ChongBit

发布时间: 2017年6月19日 00:24   时间限制: 1000ms   内存限制: 128M

Consider you are given a 32-bit unsigned integer N. You have to find a mask M such that L ≤ M ≤ R and N OR M is maximum. For example, if N is 100 and L = 50, R = 60 then M will be 59 and N OR M will be 127 which is maximum. If several value of M satisfies the same criteria then you have to print the minimum value of M.

Each input starts with 3 unsigned integers N, L, R where L ≤ R. Input is terminated by EOF.

For each input, print in a line the minimum value of M, which makes N OR M maximum.

复制
100 50 60
100 50 50
100 0 100
1 0 100
15 1 15
59
50
27
100
1
1717

old_judge

old_judge_None