Coder-Strike 2014 - Finals


A. 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
----------------------------------------------------------------------------------------------------
B. 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
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. 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
----------------------------------------------------------------------------------------------------
E. Playing the ball
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 5
1 1 1
5 0 1
Output
1
Input
2 5
4 0 3
5 3 1
Output
2
Input
1 10
20 0 10
Output
3
----------------------------------------------------------------------------------------------------
