Codeforces Round 599 (Div. 1)


A. Tile Painting
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
Output
2
Input
5
Output
5
----------------------------------------------------------------------------------------------------
B. 0-1 MST
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 11
1 3
1 4
1 5
1 6
2 3
2 4
2 5
2 6
3 4
3 5
3 6
Output
2
Input
3 0
Output
0
----------------------------------------------------------------------------------------------------
C. Sum Balance
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 1 7 4
2 3 2
2 8 5
1 10
Output
Yes
7 2
2 3
5 1
10 4
Input
2
2 3 -2
2 -1 5
Output
No
Input
2
2 -10 10
2 0 -20
Output
Yes
-10 2
-20 1
----------------------------------------------------------------------------------------------------
D. Number Discovery
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
10 2
40 5
Output
11
12
----------------------------------------------------------------------------------------------------
E. Planar Perimeter
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3 3
Output
4
2 1 4 
1 2 3 
Input
3
5 3 5
Output
6
1 2 3 4 5
4 5 6
1 3 4 6 5
----------------------------------------------------------------------------------------------------
