Codeforces Round 750 (Div. 2)


A. Luntik and Concerts
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 1 1
2 1 3
5 5 5
1 1 2
Output
0
1
0
1
----------------------------------------------------------------------------------------------------
B. Luntik and Subsequences
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
5
1 2 3 4 5
2
1000 1000
2
1 0
5
3 0 2 1 1
5
2 1 0 3 0
Output
1
0
2
4
4
----------------------------------------------------------------------------------------------------
C. Grandma Capa Knits a Scarf
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
8
abcaacab
6
xyzxyz
4
abba
8
rprarlap
10
khyyhhyhky
Output
2
-1
0
3
2
----------------------------------------------------------------------------------------------------
D. Vupsen, Pupsen and 0
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2
5 5
5
5 -2 10 -9 4
7
1 2 3 4 5 6 7
Output
1 -1
-1 5 1 -1 -1
-10 2 2 -3 5 -1 -1
----------------------------------------------------------------------------------------------------
E. Pchelyonok and Segments
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
1
1
3
1 2 3
5
1 1 2 2 3
7
1 2 1 1 3 2 6
5
9 6 7 9 7
Output
1
1
2
3
1
----------------------------------------------------------------------------------------------------
F1. Korney Korneevich and XOR (easy version)
time limit per test: 1.5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
4 2 2 4
Output
4
0 2 4 6 
Input
8
1 0 1 7 12 5 3 2
Output
12
0 1 2 3 4 5 6 7 10 11 12 13 
----------------------------------------------------------------------------------------------------
F2. Korney Korneevich and XOR (hard version)
time limit per test: 1.5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
4 2 2 4
Output
4
0 2 4 6 
Input
8
1 0 1 7 12 5 3 2
Output
12
0 1 2 3 4 5 6 7 10 11 12 13 
----------------------------------------------------------------------------------------------------
G. Kuzya and Homework
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
*/*
Output
2
Input
7
6 4 10 1 2 15 1
*/*/*//
Output
8
----------------------------------------------------------------------------------------------------
