Educational Codeforces Round 118 (Rated for Div. 2)


A. Long Comparison
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
2 1
19 0
10 2
100 1
1999 0
2 3
1 0
1 0
99 0
1 2
Output
>
=
<
=
<
----------------------------------------------------------------------------------------------------
B. Absent Remainder
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2
1 4
4
2 8 3 4
5
3 8 5 9 7
6
2 7 5 3 4 8
Output
4 1
8 2
8 4
9 5
7 5
8 7
4 3
5 2
----------------------------------------------------------------------------------------------------
C. Poisoned Dagger
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 5
1 5
3 10
2 4 10
5 3
1 2 4 5 7
4 1000
3 25 64 1337
Output
3
4
1
470
----------------------------------------------------------------------------------------------------
D. MEX Sequences
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
0 2 1
2
1 0
5
0 0 0 0 0
4
0 1 2 3
Output
4
2
31
7
----------------------------------------------------------------------------------------------------
E. Crazy Robot
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
3 3
...
.L.
...
4 5
#....
..##L
...#.
.....
1 1
L
1 9
....L..#.
Output
...
.L.
...
#++++
..##L
...#+
...++
L
++++L++#.
----------------------------------------------------------------------------------------------------
F. Tree Coloring
time limit per test: 4.5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2
3 2
4 2
2 5
Output
42
Input
5
1 2
2 3
3 4
4 5
Output
53
Input
20
20 19
20 4
12 4
5 8
1 2
20 7
3 10
7 18
11 8
9 10
17 10
1 15
11 16
14 11
18 10
10 1
14 2
13 17
20 6
Output
955085064
----------------------------------------------------------------------------------------------------
