Codeforces Round 930 (Div. 2)


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

Examples
Input
4
1
4
5
120240229
Output
1
4
4
67108864
----------------------------------------------------------------------------------------------------
B. Binary Path
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2
00
00
4
1101
1100
8
00100111
11101101
Output
000
2
11000
1
001001101
4
----------------------------------------------------------------------------------------------------
C. Bitwise Operation Wizard
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
<
=
>
2
Output
? 0 2 3 1
? 1 1 2 3
? 1 2 0 3
! 3 2
! 0 1
----------------------------------------------------------------------------------------------------
D. Pinball
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3
><<
4
<<<<
6
<><<<>
Output
3 6 5 
1 2 3 4 
1 4 7 10 8 1 
----------------------------------------------------------------------------------------------------
E. Pokémon Arena
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
3 3
2 3 1
2 9 9
6 1 7
1 2 1
3 3
2 3 1
9 9 9
6 1 7
1 2 1
4 2
2 8 3 5
18 24
17 10
1 10
1 1
6 3
21412674 3212925 172015806 250849370 306960171 333018900
950000001 950000001 950000001
821757276 783362401 760000001
570000001 700246226 600757652
380000001 423513575 474035234
315201473 300580025 287023445
1 1 1
Output
2
6
17
1224474550
----------------------------------------------------------------------------------------------------
F. Bitwise Paradox
time limit per test: 5 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
3
3 7
2 1 3
2 2 3
4
2 1 3
1 2 5
2 2 3
2 1 3
4 5
5 1 2 4
4 2 3 3
6
2 1 4
1 3 15
2 3 4
2 2 4
1 2 13
2 1 4
1 5
6
4
1
2 1 1
Output
-1 3 2 
5 2 2 1 
-1 
----------------------------------------------------------------------------------------------------
