Codeforces Beta Round 76 (Div. 2 Only)


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

Examples
Input
01001100100101100000010110001001011001000101100110010110100001011010100101101100
0100110000
0100110010
0101100000
0101100010
0101100100
0101100110
0101101000
0101101010
0101101100
0101101110
Output
12345678
Input
10101101111001000010100100011010101101110010110111011000100011011110010110001000
1001000010
1101111001
1001000110
1010110111
0010110111
1101001101
1011000001
1110010101
1011011000
0110001000
Output
30234919
----------------------------------------------------------------------------------------------------
B. Friends
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 3
2 3
1 4
5 3
Output
WIN
Input
5
1 2
2 3
3 4
4 5
5 1
Output
FAIL
----------------------------------------------------------------------------------------------------
C. Frames
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
11 4 3 9
Output
3
Input
20 5 2 20
Output
2
----------------------------------------------------------------------------------------------------
D. End of Exams
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 500 3
Output
YES
1 333.333333
2 333.333333
2 166.666667 1 166.666667
Input
4 100 5
Output
YES
3 20.000000 4 60.000000
1 80.000000
4 40.000000 2 40.000000
3 80.000000
2 60.000000 1 20.000000
Input
4 100 7
Output
NO
Input
5 500 2
Output
YES
4 250.000000 5 500.000000 2 500.000000
3 500.000000 1 500.000000 4 250.000000
----------------------------------------------------------------------------------------------------
E. Azembler
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
41
Output
2
lea ebx, [eax + 4*eax]
lea ecx, [eax + 8*ebx]
Input
2
Output
1
lea ebx, [eax + eax]
Input
4
Output
1
lea ebx, [4*eax]
----------------------------------------------------------------------------------------------------
