Codeforces Round 138 (Div. 2)


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

Examples
Input
1 1 1
Output
12
Input
4 6 6
Output
28
----------------------------------------------------------------------------------------------------
B. Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
([])
Output
1
([])
Input
(((
Output
0
----------------------------------------------------------------------------------------------------
D. Two Strings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
abab
ab
Output
Yes
Input
abacaba
aba
Output
No
Input
abc
ba
Output
No
----------------------------------------------------------------------------------------------------
E. Partial Sums
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
1 2 3
Output
1 3 6
Input
5 0
3 14 15 92 6
Output
3 14 15 92 6
----------------------------------------------------------------------------------------------------
