AIM Tech Round 3 (Div. 2)


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

Examples
Input
2 7 10
5 6
Output
1
Input
1 5 10
7
Output
0
Input
3 10 10
5 7 7
Output
1
Input
1 1 1
1
Output
0
----------------------------------------------------------------------------------------------------
B. Checkpoints
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 10
1 7 12
Output
7
Input
2 0
11 -10
Output
10
Input
5 0
0 0 1000 0 0
Output
0
----------------------------------------------------------------------------------------------------
C. Letters Cyclic Shift
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
codeforces
Output
bncdenqbdr
Input
abacaba
Output
aaacaba
----------------------------------------------------------------------------------------------------
D. Recover the String
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2 3 4
Output
Impossible
Input
1 2 2 1
Output
0110
----------------------------------------------------------------------------------------------------
E. Centroids
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

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