April Fools Day Contest 2013


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

Examples
Input
2
Output
Adams
Input
8
Output
Van Buren
Input
29
Output
Harding
----------------------------------------------------------------------------------------------------
B. QR code
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
0
Input
3 7
Output
0
Input
13 10
Output
1
----------------------------------------------------------------------------------------------------
C. WTF?
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
0
1
1
Output
0.666667
----------------------------------------------------------------------------------------------------
D. Orange
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
AprilFool
14
Output
AprILFooL
----------------------------------------------------------------------------------------------------
E. HQ
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
HHHH
Output
Yes
Input
HQHQH
Output
No
Input
HHQHHQH
Output
No
Input
HHQQHHQQHH
Output
Yes
----------------------------------------------------------------------------------------------------
F. Greedy Petya
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
1 2
2 1
1 1
Output
Yes
Input
3 0
Output
No
Input
10 20
3 10
4 6
4 9
7 5
8 8
3 10
9 7
5 2
9 2
10 6
10 4
1 1
7 2
8 4
7 2
1 8
5 4
10 2
8 5
5 2
Output
No
----------------------------------------------------------------------------------------------------
