Educational Codeforces Round 156 (Rated for Div. 2)


A. Sum of Three
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
10
4
15
9
Output
YES
4 5 1
NO
YES
2 8 5
NO
----------------------------------------------------------------------------------------------------
B. Fear of the Dark
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3 3
1 0
-1 6
3 3
-1 -1
4 3
Output
3.6055512755
3.2015621187
----------------------------------------------------------------------------------------------------
C. Decreasing String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
cab
6
abcd
9
x
1
Output
abx
----------------------------------------------------------------------------------------------------
D. Monocarp and the Set
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 4
<?>?>
1 ?
4 <
5 <
1 >
Output
3
0
0
0
1
Input
2 2
>
1 ?
1 <
Output
1
0
1
----------------------------------------------------------------------------------------------------
E. I Wanna be the Team Leader
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5 3
4 6 100 5 1
50 1 12
Output
YES
1 3
1 5
3 2 4 1
Input
5 3
3 6 100 5 1
50 1 12
Output
NO
Input
5 3
2 2 2 2 4
3 5 1
Output
YES
1 5
3 1 2 3
1 4
Input
5 1
10 20 30 40 50
4
Output
YES
1 4
----------------------------------------------------------------------------------------------------
F. Diamond Theft
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 6
1 2
1 2
2 1
Output
6
Input
4
2 8
3 2
3 2
3 5
Output
9
Input
2
3 2
2 3
Output
4
Input
1
3 1
Output
4
Input
8
2 1
2 2
3 5
3 6
1 2
1 3
1 4
1 5
Output
11
----------------------------------------------------------------------------------------------------
