Codeforces Round 238 (Div. 1)


A. Unusual Product
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1 1
0 1 1
1 0 0
12
3
2 3
3
2 2
2 2
1 3
3
3
1 2
2 1
1 1
3
Output
01001
----------------------------------------------------------------------------------------------------
B. Toy Sum
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 4 5
Output
2
999993 1000000
Input
1
1
Output
1
1000000 
----------------------------------------------------------------------------------------------------
C. Graph Cutting
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 12
1 2
2 3
3 4
4 1
1 3
2 4
3 5
3 6
5 6
6 7
6 8
7 8
Output
1 2 4
1 3 2
1 4 3
5 3 6
5 6 8
6 7 8
Input
3 3
1 2
2 3
3 1
Output
No solution
Input
3 2
1 2
2 3
Output
1 2 3
----------------------------------------------------------------------------------------------------
D. Hill Climbing
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1 4
2 1
3 2
4 3
6 4
7 4
3
3 1
5 6
2 3
Output
5 6 3 
----------------------------------------------------------------------------------------------------
E. Hamming Triples
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
0 3
0 5
1 4
1 5
Output
3
Input
10 4
1 5
0 5
0 5
1 5
Output
4
----------------------------------------------------------------------------------------------------
