#P4574. [CQOI2013] 二进制A+B
[CQOI2013] 二进制A+B
Description
You are given three integers and write them as binary integers without leading zeros.
For example, when , their binary forms are .
Next, pad the shorter ones with leading zeros so that have the same number of bits as the longest one. In the example above, after padding we get .
Finally, rearrange the bits of to obtain such that . In the example above, one possible rearrangement is .
Your task is to make as small as possible. If there is no solution, output .
Input Format
The input contains a single line with three integers .
Output Format
Output a single line with the minimum value of .
7 6 9
10
Hint
For all testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号