Codeforces Round 289 (Div. 2, ACM ICPC Rules)


A. Maximum in Table
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
1
Input
5
Output
70
----------------------------------------------------------------------------------------------------
B. Painting Pebbles
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 2 3 4
Output
YES
1
1 4
1 2 4
1 2 3 4
Input
5 2
3 2 4 1 3
Output
NO
Input
5 4
3 2 4 3 5
Output
YES
1 2 3
1 3
1 2 3 4
1 3 4
1 1 2 3 4
----------------------------------------------------------------------------------------------------
C. Sums of Digits
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1
2
3
Output
1
2
3
Input
3
3
2
1
Output
3
11
100
----------------------------------------------------------------------------------------------------
D. Restoring Numbers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
1 2 3
2 3 4
Output
YES
1000000007
0 1 
1 2 3 
Input
2 2
1 2
2 0
Output
YES
3
0 1 
1 2 
Input
2 2
1 2
2 1
Output
NO
----------------------------------------------------------------------------------------------------
E. Pretty Song
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
IEAIAIO
Output
28.0000000
Input
BYOB
Output
5.8333333
Input
YISVOWEL
Output
17.0500000
----------------------------------------------------------------------------------------------------
F. Progress Monitoring
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
Output
2
Input
3
1 3 2
Output
1
----------------------------------------------------------------------------------------------------
