Educational Codeforces Round 65 (Rated for Div. 2)


A. Telephone Number
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
13
7818005553535
11
31415926535
Output
YES
NO
----------------------------------------------------------------------------------------------------
B. Lost Numbers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
16
64
345
672
Output
? 1 1
? 2 2
? 3 5
? 4 6
! 4 8 15 16 23 42
----------------------------------------------------------------------------------------------------
C. News Distribution
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 5
3 2 5 4
0
2 1 2
1 1
2 6 7
Output
4 4 1 4 4 2 2 
----------------------------------------------------------------------------------------------------
D. Bicolored RBS
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
()
Output
11
Input
4
(())
Output
0101
Input
10
((()())())
Output
0110001111
----------------------------------------------------------------------------------------------------
E. Range Deleting
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
2 3 1
Output
4
Input
7 4
1 3 1 2 2 4 3
Output
6
----------------------------------------------------------------------------------------------------
F. Scalar Queries
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
5 2 4 7
Output
167
Input
3
123456789 214365879 987654321
Output
582491518
----------------------------------------------------------------------------------------------------
G. Low Budget Inception
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 5
0 5 7
9
0 1 2 3 4 5 6 7 8
Output
1.570796326794897
1.570796326794897
0.785398163397448
0.927295218001612
0.785398163397448
1.570796326794897
1.570796326794897
1.570796326794897
1.570796326794897
Input
2 7
0 4
3
1 3 4
Output
1.570796326794897
0.927295218001612
1.570796326794897
Input
5 0
0 1 2 3 4
6
0 1 2 3 4 5
Output
1.570796326794897
3.141592653589793
3.141592653589793
3.141592653589793
3.141592653589793
1.570796326794897
----------------------------------------------------------------------------------------------------
