Codeforces Round 853 (Div. 2)


A. Serval and Mocha's Array
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
2
3 6
3
1 2 4
3
3 6 1
3
15 35 21
4
35 10 35 14
5
1261 227821 143 4171 1941
Output
No
Yes
Yes
No
Yes
Yes
----------------------------------------------------------------------------------------------------
B. Serval and Inversion Magic
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
1001
5
10010
7
0111011
Output
Yes
Yes
No
----------------------------------------------------------------------------------------------------
C. Serval and Toxel's Arrays
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 2
1 2 3
1 4
2 5
1 1
1
1 1
10 10
4 6 9 12 16 20 2 10 19 7
1 3
5 4
2 17
2 18
6 11
7 1
8 17
5 5
5 5
2 2
Output
13
1
705
----------------------------------------------------------------------------------------------------
D. Serval and Shift-Shift-Shift
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
5
00111
11000
1
1
1
3
001
000
Output
2
3 -2
0
-1
----------------------------------------------------------------------------------------------------
E. Serval and Music Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
1 2 4
4
1 2 7 9
4
344208 591000 4779956 5403429
5
1633 1661 1741 2134 2221
Output
26
158
758737625
12334970
----------------------------------------------------------------------------------------------------
F. Serval and Brain Power
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
buaa
Output
2
Input
codeforcesround
Output
6
Input
oooooooooooaaaaeaaiaujooooooooooooo
Output
24
Input
zero
Output
0
----------------------------------------------------------------------------------------------------
