Codeforces Round 252 (Div. 2)


A. Valera and Antique Items
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 50000
1 40000
2 20000 60000
3 10000 70000 190000
Output
3
1 2 3
Input
3 50000
1 50000
3 100000 120000 110000
3 120000 110000 120000
Output
0
----------------------------------------------------------------------------------------------------
B. Valera and Fruits
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
1 5
2 3
Output
8
Input
5 10
3 20
2 20
1 20
4 20
5 20
Output
60
----------------------------------------------------------------------------------------------------
C. Valera and Tubes
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3 3
Output
3 1 1 1 2 1 3
3 2 1 2 2 2 3
3 3 1 3 2 3 3
Input
2 3 1
Output
6 1 1 1 2 1 3 2 3 2 2 2 1
----------------------------------------------------------------------------------------------------
D. Valera and Swaps
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2 3 4 5
2
Output
2
1 2 1 3 
Input
5
2 1 4 5 3
2
Output
1
1 2 
----------------------------------------------------------------------------------------------------
E. Valera and Number
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1 50
Output
1.0000000000000
Input
5 3 0
Output
3.0000000000000
Input
5 3 25
Output
1.9218750000000
----------------------------------------------------------------------------------------------------
