https://codeforces.com/contest/988/problem/D
can anyone explain me the approach
@dare_devil_007 hey bro we are not allowed to tell on running competition solution.sorry I will help when its over.
it’s not ongoing contest,it is from the past contests
@dare_devil_007 hey, Let’s prove that the size of the sub-set will not be > 3 . Suppose a , b , c and d are four elements from a sub-set and a < b < c < d .
Let abs(a – b) = 2k and abs(b – c) = 2l then abs(a – c) = abs(a – b) + abs(b – c) = 2k + 2l = 2m . It means that k = l . Conditions must hold for the triple (b, c, d) too. Now it is easy to see that if abs(a – b) = abs(b – c) = abs(c – d) = 2k then abs(a – d) = abs(a – b) * 3 which is not a power of two. So the size of the sub-set will never be greater than 3.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.