Well, it's a very simple task.
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 32 megabytes
You are tasked with a straightforward problem involving bitwise operations. Given a number (N) and a specified operation type, you need to compute the resulting value as follows:
If the operation is bitwise AND, denoted by "", compute:
[ 1 & 2 & ...& N ]
If the operation is bitwise OR, denoted by "|", compute:
[ 1 | 2 | ...| N ]
Input
The input consists of multiple test cases. The first line contains the integer (T), representing the number of test cases, where (1 T 10^4). Each of the following (T) lines contains two values: the type of operation (OR or AND) and the number (N), where (1 N 10^100).
Output
For each test case, output the result on a new line.
Examples
Input #1
Answer #1
Submissions 246
Acceptance rate 20%