Codeforces Round 157 (Div. 1)


A. Little Elephant and Bits
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
101
Output
11
Input
110010
Output
11010
----------------------------------------------------------------------------------------------------
B. Little Elephant and Elections
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
Output
0
Input
8
Output
1440
----------------------------------------------------------------------------------------------------
C. Little Elephant and LCM
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 4 3 2
Output
15
Input
2
6 3
Output
13
----------------------------------------------------------------------------------------------------
D. Little Elephant and Broken Sorting
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
1 2
1 2
Output
0.500000000
Input
4 3
1 3 2 4
1 2
2 3
1 4
Output
3.000000000
----------------------------------------------------------------------------------------------------
E. Little Elephant and Tree
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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