this interactive problem do not forget flush output print query coutflush fflushstdout C similar function programming languagesthere n gift box row number 1 n leave right its know exactly k contain valuable gift box contain lucky stone all box look differ weight all box stone weight strictly heavy box valuable item but valuable gift different box valuable item different weightsyou ask 50 query print answer do not count by query compare total weight nonintersecte subset box a_1 a_2 dots a_k_a b_1 b_2 dot b_k_b in return you ll result FIRST subset a_1 a_2 dots a_k_a strictly heavy SECOND subset b_1 b_2 dot b_k_b strictly heavy equal subset equal total weight waste query incorrect limit query exceed use query maybe intuition find box valuable gift minimum index