Processing math: 100%
Bitwise operations 2 - MarisaOJ: Marisa Online Judge
Given q queries, each query consists of two non-negative 15-bit integers a and b. Print the integer c as the result, where c is calculated as follows:
- For bits from 0 to 4, the corresponding bit of c is the XOR of the two corresponding bits in a and b.
- For bits from 5 to 9, the corresponding bit of c is the AND of the two corresponding bits in a and b.
- For bits from 10 to 14, the corresponding bit of c is the OR of the two corresponding bits in a and b.
For example:
### Input
- The first line contains an integer q.
- The next q lines each contain two non-negative integers a and b.
### Output
- Print q lines, each line containing an integer representing the result.
### Constraints
- 1≤q≤105.
- 0≤a,b<215.
### Example
Input:
51477018964146588827303032496930474195701069519875
Output:
3072614425297183176828036
Topic
Bitmasks
Rating
1000
Solution (0)
Solution