Codeforces Round 930 (Div. 1)


A. 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
----------------------------------------------------------------------------------------------------
B. 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 
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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 
----------------------------------------------------------------------------------------------------
E. Yet Yet Another Permutation Problem
time limit per test: 5 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
6
2
2 1
3
1 2 3
3
3 1 2
4
2 4 1 3
5
3 5 1 4 2
15
6 13 2 8 7 11 1 3 9 15 4 5 12 10 14
Output
1
3
2
4
18
424488915
----------------------------------------------------------------------------------------------------
F. Grand Finale: Circles
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
1 1 3
-1 1 3
1 -1 2
-1 -1 2
Output
0.0000000000000000 -0.7637626158259733 0.9724747683480533
Input
4
41580 -23621 95642
-41580 -23621 95642
0 47821 95642
0 0 109750
Output
0.0000000000000000 0.0000000000000000 47821.0000000000000000
----------------------------------------------------------------------------------------------------
