Codeforces Round 382 (Div. 1)


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

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

Examples
Input
4
Output
2
Input
27
Output
3
----------------------------------------------------------------------------------------------------
C. Ostap and Tree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 0
1 2
Output
1
Input
2 1
1 2
Output
3
Input
4 1
1 2
2 3
3 4
Output
9
Input
7 2
1 2
2 3
1 4
4 5
1 6
6 7
Output
91
----------------------------------------------------------------------------------------------------
D. Permutations
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
1 1
1 2
2 2
Output
NO
YES
NO
Input
3 3
1 1
2 2
3 3
Output
NO
NO
NO
Input
3 7
3 3
3 1
1 3
1 1
2 2
1 2
2 1
Output
YES
NO
NO
NO
YES
NO
NO
----------------------------------------------------------------------------------------------------
E. Chess Championship
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 5
8 6 4 2 0
Output
yes
XWWWW
LXWWW
LLXWW
LLLXW
LLLLX
Input
5 1
9
Output
no
----------------------------------------------------------------------------------------------------
