Codeforces Round 676 (Div. 2)


A. XORwice
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
6 12
4 9
59 832
28 14
4925 2912
1 1
Output
10
13
891
18
6237
0
----------------------------------------------------------------------------------------------------
B. Putting Bricks in the Wall
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
S010
0001
1000
111F
3
S10
101
01F
5
S0101
00000
01111
11111
0001F
Output
1
3 4
2
1 2
2 1
0
----------------------------------------------------------------------------------------------------
C. Palindromifier
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
abac
Output
2
R 2
R 5
Input
acccc
Output
2
L 4
L 2
Input
hannah
Output
0
----------------------------------------------------------------------------------------------------
D. Hexagons
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
-3 1
1 3 5 7 9 11
1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
Output
18
1000000000000000000
----------------------------------------------------------------------------------------------------
E. Swedish Heroes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
5 6 7 8
Output
26
Input
5
4 -5 9 -2 1
Output
15
----------------------------------------------------------------------------------------------------
