As , there are total possible area . We can split it into sequential segments where length of each segment is {}.
At first, query on these segments and find secret area lies in which segment. It can be done with binary search on segment to segment. It takes at most queries.
Now, we’ve a length segment means possible area. Iterate on each area, take only valid area. Valid area means which integer has at least two divisors (divisors can be same) less than or equal to . Now binary search on valid area. It takes at most queries.