Codeforces Round 810 (Div. 1)


A. Color the Picture
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
4 6 3
12 9 8
3 3 2
8 8
3 3 2
9 5
4 5 2
10 11
5 4 2
9 11
10 10 3
11 45 14
Output
Yes
No
Yes
Yes
No
No
----------------------------------------------------------------------------------------------------
B. Rain
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 6
1 5
5 5
3 4
2 3
1 3
5 2
2 5
1 6
10 6
6 12
4 5
1 6
12 5
5 5
9 7
8 3
Output
001
11
00
100110
----------------------------------------------------------------------------------------------------
C. XOR Triangle
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
101
Output
12
Input
1110
Output
780
Input
11011111101010010
Output
141427753
----------------------------------------------------------------------------------------------------
D. Recover the Tree
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
1111
111
10
1
6
111111
11111
1111
111
11
1
12
100100000001
11100000001
1000000000
100000000
10010001
1110000
100000
10000
1001
111
10
1
Output
1 2
2 3
2 4
1 2
2 3
3 4
4 5
5 6
2 3
6 7
10 11
2 4
6 8
10 12
1 4
5 8
9 12
5 12
2 12
----------------------------------------------------------------------------------------------------
E. Two Arrays
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
3 2
2
Output
4
Input
4 5
235499701 451218171 355604420 132973458
365049318 264083156 491406845 62875547 175951751
Output
531556171
----------------------------------------------------------------------------------------------------
