Codeforces Round 331 (Div. 2)


A. Wilbur and Swimming Pool
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
0 0
1 1
Output
1
Input
1
1 1
Output
-1
----------------------------------------------------------------------------------------------------
B. Wilbur and Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2 3 4 5
Output
5
Input
4
1 2 2 1
Output
3
----------------------------------------------------------------------------------------------------
C. Wilbur and Points
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
2 0
0 0
1 0
1 1
0 1
0 -1 -2 1 0
Output
YES
0 0
1 0
2 0
0 1
1 1
Input
3
1 0
0 0
2 0
0 1 2
Output
NO
----------------------------------------------------------------------------------------------------
D. Wilbur and Trees
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 0.500000
1 2
Output
3.250000000
Input
4 3 0.4
4 3 1 2
Output
6.631200000
----------------------------------------------------------------------------------------------------
E. Wilbur and Strings
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1 2
0
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
0000000000000
2413423432432
Output
YES
NO
Input
4 2 5
01
23
45
67
0 1
0 -1
0 1
0 -1
0 1
0 -1
0 1
0 -1
0 1
0 -1
0000000000
010101011101
32232232322
44343222342444324
6767
Output
YES
YES
YES
NO
YES
----------------------------------------------------------------------------------------------------
