Codeforces Round 349 (Div. 2)


A. Pouring Rain
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2 3 100
Output
NO
Input
1 1 1 1
Output
YES
3.659792366325
----------------------------------------------------------------------------------------------------
B. Coat of Anticubism
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 1
Output
1
Input
5
20 4 3 2 1
Output
11
----------------------------------------------------------------------------------------------------
C. Reberland Linguistics
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
abacabaca
Output
3
aca
ba
ca
Input
abaca
Output
0
----------------------------------------------------------------------------------------------------
D. World Tour
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
8 9
1 2
2 3
3 4
4 1
4 5
5 6
6 7
7 8
8 5
Output
2 1 8 7
----------------------------------------------------------------------------------------------------
E. Chain Reaction
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 1
1 -1
-1 1
-1 -1
1 1
2 2
4 4
6 6
Output
0
1 1
1 -1
-1 1
-1 -1
-1
----------------------------------------------------------------------------------------------------
