Codeforces Round 450 (Div. 2)


A. Find Extra One
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1
-1 -1
2 -1
Output
Yes
Input
4
1 1
2 2
-1 1
-2 2
Output
No
Input
3
1 2
2 1
4 60
Output
Yes
----------------------------------------------------------------------------------------------------
B. Position in Fraction
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2 0
Output
2
Input
2 3 7
Output
-1
----------------------------------------------------------------------------------------------------
C. Remove Extra One
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
1
Output
1
Input
5
5 1 2 3 4
Output
5
----------------------------------------------------------------------------------------------------
D. Unusual Sequences
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 9
Output
3
Input
5 8
Output
0
----------------------------------------------------------------------------------------------------
E. Maximum Questions
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
bb?a?
1
Output
2
Input
9
ab??ab???
3
Output
2
----------------------------------------------------------------------------------------------------
