Codeforces Beta Round 4 (Div. 2 Only)


A. Watermelon
time limit per test: 1 second
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
8
Output
YES
----------------------------------------------------------------------------------------------------
B. Before an Exam
time limit per test: 0.5 second
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
1 48
5 7
Output
NO
Input
2 5
0 1
3 5
Output
YES
1 4 
----------------------------------------------------------------------------------------------------
C. Registration system
time limit per test: 5 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
4
abacaba
acaba
abacaba
acab
Output
OK
OK
abacaba1
OK
Input
6
first
first
second
second
third
third
Output
OK
first1
OK
second1
OK
third1
----------------------------------------------------------------------------------------------------
D. Mysterious Present
time limit per test: 1 second
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
2 1 1
2 2
2 2
Output
1
1 
Input
3 3 3
5 4
12 11
9 8
Output
3
1 3 2 
----------------------------------------------------------------------------------------------------
