Codeforces Round 700 (Div. 2)


A. Yet Another String Game
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
a
bbbb
az
Output
b
azaz
by
----------------------------------------------------------------------------------------------------
B. The Great Hero
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
3 17 1
2
16
10 999 3
10 20 30
100 50 30
1000 1000 4
200 300 400 500
1000 1000 1000 1000
999 999 1
1000
1000
999 999 1
1000000
999
Output
YES
YES
YES
NO
YES
----------------------------------------------------------------------------------------------------
C. Searching Local Minimum
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
3
2
1
4
5
Output
? 1
? 2
? 3
? 4
? 5
! 3
----------------------------------------------------------------------------------------------------
D1. Painting the Array I
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
7
1 1 2 2 3 3 3
Output
6
Input
7
1 2 3 4 5 6 7
Output
7
----------------------------------------------------------------------------------------------------
D2. Painting the Array II
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
6
1 2 3 1 2 2
Output
4
Input
7
1 2 1 2 1 2 1
Output
2
----------------------------------------------------------------------------------------------------
E. Continuous City
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
YES
2 1
1 2 1
Input
4 6
Output
YES
5 6
1 2 3
1 3 4
1 4 5
2 5 1
3 5 1
4 5 1
----------------------------------------------------------------------------------------------------
