Coder-Strike 2014 - Finals (online edition, Div. 2)


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

Examples
Input
4 2 3
1 2
2 3 4
Output
1 1 2 2
Input
5 5 2
3 4 1 2 5
2 3
Output
1 1 1 1 1
----------------------------------------------------------------------------------------------------
B. Start Up
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
AHA
Output
YES
Input
Z
Output
NO
Input
XO
Output
NO
----------------------------------------------------------------------------------------------------
C. Online Meeting
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
+ 1
+ 2
- 2
- 1
Output
4
1 3 4 5 
Input
3 2
+ 1
- 2
Output
1
3 
Input
2 4
+ 1
- 1
+ 2
- 2
Output
0
Input
5 6
+ 1
- 1
- 3
+ 3
+ 4
- 4
Output
3
2 3 5 
Input
2 4
+ 1
- 2
+ 2
- 1
Output
0
----------------------------------------------------------------------------------------------------
D. Bug in Code
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2
2 3
1 4
1 4
2 1
Output
6
Input
8 6
5 6
5 7
5 8
6 2
2 1
7 3
1 3
1 4
Output
1
----------------------------------------------------------------------------------------------------
E. Cup Trick
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
2 1
Output
2 1 
Input
3 2
1 2
1 1
Output
2 1 3 
Input
3 3
1 3
2 3
1 3
Output
-1
----------------------------------------------------------------------------------------------------
