Codeforces Round 411 (Div. 2)


A. Fake NP
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
19 29
Output
2
Input
3 6
Output
3
----------------------------------------------------------------------------------------------------
B. 3-palindrome
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
aa
Input
3
Output
bba
----------------------------------------------------------------------------------------------------
C. Find Amir
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
0
Input
10
Output
4
----------------------------------------------------------------------------------------------------
D. Minimum number of steps
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
ab
Output
1
Input
aab
Output
3
----------------------------------------------------------------------------------------------------
E. Ice cream coloring
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
1 1
2 2 3
1 2
1 2
2 3
Output
2
1 1 2 
Input
4 5
0
1 1
1 3
3 2 4 5
2 1
3 2
4 3
Output
3
1 1 1 2 3 
----------------------------------------------------------------------------------------------------
F. Expected diameter of a tree
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 2
1 3
3 1
2 3
Output
-1
2.0000000000
Input
5 2 3
2 4
4 3
4 2
4 1
2 5
Output
-1
2.6666666667
2.6666666667
----------------------------------------------------------------------------------------------------
