In the upcoming year, there will be many team olympiads, so the teachers of…
- User
In the upcoming year, there will be many team olympiads, so the teachers of "T-generation" need to assemble a team of three pupils to participate in them. Any three pupils will show a worthy result in any team olympiad. But winning the olympiad is only half the battle; first, you need to get there... Each pupil has an independence level, expressed as an integer. In "T-generation", there is exactly one student with each independence levels from to , inclusive. For a team of three pupils with independence levels , , and , the value of their team independence is equal to , where denotes the bitwise XOR operation. Your task is to choose any trio of students with the maximum possible team independence. Input Each test contains multiple test cases. The first line contains a single integer ( ) — the number of test cases. The description of the test cases follows. The first line of each test case set contains two integers and ( , ) — the minimum and maximum independence levels of the students. Output For each test case set, output three pairwise distinct integers , and , such that and the value of the expression is maximized. If there are multiple triples with the maximum value, any of them can be output. Example input 8 0 2 0 8 1 3 6 22 128 137 69 98 115 127 0 1073741823 Note In the first test case, the only suitable triplet of numbers ( ) (up to permutation) is ( ). In the second test case, one of the suitable triplets is ( ), where . It can be shown that is the maximum possible value of for . l r a b c (a ⊕ b) + (b ⊕ c) + (a ⊕ c) ⊕ t 1 ≤ t ≤ 10 4 l r 0 ≤ l, r < 2 30 r − l > 1 a, b c l ≤ a, b, c ≤ r (a ⊕ b) + (b ⊕ c) + (a ⊕ c) output Copy 1 2 0 8 7 1 2 1 3 7 16 11 134 132 137 98 85 76 123 121 118 965321865 375544086 12551794 a, b, c 0, 1, 2 8, 7, 1 (8 ⊕ 7) + (7 ⊕ 1) + (8 ⊕ 1) = 15 + 6 + 9 = 30 30 (a ⊕ b) + (b ⊕ c) + (a ⊕ c) 0 ≤ a, b, c ≤ 8 type in c++ true code
- Assistant