Educational Codeforces Round 2


A. Extract Numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aba,123;1a;0
Output
"123,0"
"aba,1a"
Input
1;;01,a0,
Output
"1"
",01,a0,"
Input
1
Output
"1"
-
Input
a
Output
-
"a"
----------------------------------------------------------------------------------------------------
B. Queries about less or equal elements
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
aabc
Output
abba
Input
aabcd
Output
abcba
----------------------------------------------------------------------------------------------------
D. Area of Two Circles' Intersection
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0 4
6 0 4
Output
7.25298806364175601379
Input
0 0 5
11 0 5
Output
0.00000000000000000000
----------------------------------------------------------------------------------------------------
E. Lomsat gelral
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2 3 4
1 2
2 3
2 4
Output
10 9 3 4
Input
15
1 2 3 1 2 3 3 1 1 3 2 2 1 2 3
1 2
1 3
1 4
1 14
1 15
2 5
2 6
2 7
3 8
3 9
3 10
4 11
4 12
4 13
Output
6 5 4 3 2 3 3 1 1 3 2 2 1 2 3
----------------------------------------------------------------------------------------------------
F. Edge coloring of bipartite graph
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3 5
1 2
2 2
3 2
4 1
4 3
Output
3
1 2 3 1 2
----------------------------------------------------------------------------------------------------
