Codeforces Beta Round 97 (Div. 2)


A. Presents
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 3 4 1
Output
4 1 2 3
Input
3
1 3 2
Output
1 3 2
Input
2
1 2
Output
1 2
----------------------------------------------------------------------------------------------------
B. Ternary Logic
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
14 34
Output
50
Input
50 34
Output
14
Input
387420489 225159023
Output
1000000001
Input
5 5
Output
0
----------------------------------------------------------------------------------------------------
C. Replacement
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2 3 4 5
Output
1 1 2 3 4
Input
5
2 3 4 5 6
Output
1 2 3 4 5
Input
3
2 2 2
Output
1 2 2
----------------------------------------------------------------------------------------------------
D. Rectangle and Square
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0
10 11
10 0
0 11
1 1
2 2
2 1
1 2
Output
YES
5 6 7 8
1 2 3 4
Input
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
Output
NO
Input
0 0
4 4
4 0
0 4
1 2
2 3
3 2
2 1
Output
YES
1 2 3 4
5 6 7 8
----------------------------------------------------------------------------------------------------
E. Zero-One
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
????
Output
00
01
10
11
Input
1010
Output
10
Input
1?1
Output
01
11
----------------------------------------------------------------------------------------------------
