Codeforces Round 883 (Div. 3)


A. Rudolph and Cut the Rope
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
4 3
3 1
1 2
4
9 2
5 2
7 7
3 4
5
11 7
5 10
12 9
3 2
1 5
3
5 6
4 5
7 7
Output
2
2
3
0
----------------------------------------------------------------------------------------------------
B. Rudolph and Tic-Tac-Toe
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
+X+
OXO
OX.
O+.
+OX
X+O
.XO
OX.
+++
O.+
X.O
+..
.++
X.O
+..
Output
X
O
+
DRAW
DRAW
----------------------------------------------------------------------------------------------------
C. Rudolf and the Another Competition
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3 3 120
20 15 110
90 90 100
40 40 40
2 1 120
30
30
1 3 120
10 20 30
3 2 27
8 9
10 7
10 8
3 3 15
7 2 6
7 5 4
1 9 8
Output
2
1
1
2
1
----------------------------------------------------------------------------------------------------
D. Rudolph and Christmas Tree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3 4 2
1 4 5
1 5 1
3
4 6 6
1 2 3 4
2 1 200000
1 200000
2 4 3
9 11
Output
11
2.5
34.5
199999.9999975
11.333333
----------------------------------------------------------------------------------------------------
E1. Rudolf and Snowflakes (simple version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
1
2
3
6
13
15
255
10101
1000000
Output
NO
NO
NO
NO
YES
YES
YES
YES
NO
----------------------------------------------------------------------------------------------------
E2. Rudolf and Snowflakes (hard version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
1
2
3
6
13
15
255
10101
1000000000000000000
Output
NO
NO
NO
NO
YES
YES
YES
YES
NO
----------------------------------------------------------------------------------------------------
F. Rudolph and Mimic
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
5
1 1 2 2 3
2 1 1 2
2 2 2
2
8
1 2 3 4 3 4 2 1
4 3 4 3 2 2 1 3
 
2 3 3 2
5 3 2
2 5
15
1 2 3 4 5 6 7 8 7 6 5 4 3 2 1 
1 2 3 4 5 6 7 8 7 9 5 4 3 2 1 
Output
 
 
- 1 5
- 1 3
- 2 1 2
! 1
- 0
- 4 1 3 7 8
- 1 4
- 1 2
! 2
- 0
! 10
----------------------------------------------------------------------------------------------------
G. Rudolf and CodeVid-23
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
5 4
10011
3
10000
00110
3
00101
00000
3
01010
00100
5
11010
00100
4 1
0000
10
1011
0100
2 2
11
2
10
01
3
01
10
2 3
11
3
01
10
3
10
00
4
10
01
Output
8
0
-1
6
----------------------------------------------------------------------------------------------------
