Codeforces Round 382 (Div. 2)


A. Ostap and Grasshopper
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
#G#T#
Output
YES
Input
6 1
T....G
Output
YES
Input
7 3
T..#..G
Output
NO
Input
6 2
..GT..
Output
NO
----------------------------------------------------------------------------------------------------
B. Urbanization
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1 1
1 5
Output
6.00000000
Input
4 2 1
1 4 2 3
Output
6.50000000
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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
----------------------------------------------------------------------------------------------------
E. 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
----------------------------------------------------------------------------------------------------
