Codeforces Round 238 (Div. 2)


A. Gravity Flip
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 2 1 2
Output
1 2 2 3 
Input
3
2 3 8
Output
2 3 8 
----------------------------------------------------------------------------------------------------
B. Domino Effect
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
14
.L.R...LR..L..
Output
4
Input
5
R....
Output
0
Input
1
.
Output
1
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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 
----------------------------------------------------------------------------------------------------
E. 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
----------------------------------------------------------------------------------------------------
