atcoder#ABC117D. [ABC117D] XXOR
[ABC117D] XXOR
Score : points
Problem Statement
You are given non-negative integers and another non-negative integer .
For a integer between and (inclusive), let XOR XOR XOR .
Here, for non-negative integers and , XOR denotes the bitwise exclusive OR of and .
Find the maximum value of .
What is XOR?
The bitwise exclusive OR of and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if, when written in base two, exactly one of and has in the 's place, and otherwise.
For example, XOR . (When written in base two: XOR .)
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum value of .
3 7
1 6 3
14
The maximum value is: XOR XOR XOR .
4 9
7 4 0 3
46
1 0
1000000000000
1000000000000