Codeforces Round 468 (Div. 2, based on Technocup 2018 Final Round)


A. Friends Meeting
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
Output
1
Input
101
99
Output
2
Input
5
10
Output
9
----------------------------------------------------------------------------------------------------
B. World Cup
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 1 2
Output
1
Input
8 2 6
Output
Final!
Input
8 7 5
Output
2
----------------------------------------------------------------------------------------------------
C. Laboratory Work
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
-1 1 1 0 0 -1
Output
2
0 0 0 0 0 0 
Input
3
100 100 101
Output
3
101 100 100 
Input
7
-10 -9 -10 -8 -10 -9 -9
Output
5
-10 -10 -9 -9 -9 -9 -9 
----------------------------------------------------------------------------------------------------
D. Peculiar apple-tree
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1
Output
1
Input
5
1 2 2 2
Output
3
Input
18
1 1 1 4 4 3 2 2 2 10 8 9 9 9 10 10 4
Output
4
----------------------------------------------------------------------------------------------------
E. Game with String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
technocup
Output
1.000000000000000
Input
tictictactac
Output
0.333333333333333
Input
bbaabaabbb
Output
0.100000000000000
----------------------------------------------------------------------------------------------------
F. Teodor is not a liar!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 4
1 2
3 4
Output
4
Input
4 6
1 3
2 3
4 6
5 6
Output
5
----------------------------------------------------------------------------------------------------
