Baltic Olympiad in Informatics 2020, Day 1 (IOI, Unofficial Mirror Contest, Unrated)


A. Colors
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
7
1
1
0
0
1
Output
? 2
? 7
? 4
? 1
? 5
= 4
----------------------------------------------------------------------------------------------------
B. Mixture
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2 3
6
A 5 6 7
A 3 10 17
R 1
A 15 18 21
A 5 10 15
R 3
Output
0
2
0
2
1
1
----------------------------------------------------------------------------------------------------
C. Joker
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 8 2
1 3
1 5
1 6
2 5
2 6
3 4
3 5
5 6
4 8
4 7
Output
NO
YES
----------------------------------------------------------------------------------------------------
