Editorial
Let be the point outside the plane. Consider a set of at least four point indices.
If , every selected point lies on , so the answer is YES.
If , the set also contains at least three points on . These three points are not collinear, so the unique plane containing them is . Since does not lie on , the answer is NO.
Therefore, a query containing at least four points tells us exactly whether the queried set contains .
Initially, let the candidate set be . We maintain the invariant .
While , split into two sets and whose sizes differ by at most one. Query . If the answer is NO, replace with . Otherwise, replace with . Both parts have size at least five, so the criterion above is always valid.
After this process, . For every , query . This set has at least four points. The answer is YES exactly when , so this identifies the answer.
The sum of the queried set sizes during the halving phase is less than . The final phase uses at most nine queries of at most eight points each. Thus, the sum of over all queries is less than , which is at most .
Suppose the halving phase uses queries and leaves candidates. If , then , so the total number of queries is . If , then implies , so at most queries are used. Therefore, the algorithm always uses at most queries.
The time complexity, including all printed indices, is , and the memory complexity is .