Codeforces Round 538 (Div. 2)


A. Got Any Grapes?
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 6 2
4 3 3
Output
YES
Input
5 1 1
4 3 2
Output
NO
----------------------------------------------------------------------------------------------------
B. Yet Another Array Partitioning Task
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9 2 3
5 2 5 2 4 1 1 3 2
Output
21
3 5 
Input
6 1 4
4 1 3 2 2 3
Output
12
1 3 5 
Input
2 1 2
-1000000000 1000000000
Output
0
1 
----------------------------------------------------------------------------------------------------
C. Trailing Loves (or L'oeufs?)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 9
Output
1
Input
38 11
Output
3
Input
5 2
Output
3
Input
5 10
Output
1
----------------------------------------------------------------------------------------------------
D. Flood Fill
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
5 2 2 1
Output
2
Input
8
4 5 2 2 1 3 5 5
Output
4
Input
1
4
Output
0
----------------------------------------------------------------------------------------------------
E. Arithmetic Progression
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0
1
14
24
9
19
Output
> 25
> 15
? 1
? 2
? 3
? 4
! 9 5
----------------------------------------------------------------------------------------------------
F. Please, another Queries on Array?
time limit per test: 5.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
5 9 1 2
TOTIENT 3 3
TOTIENT 3 4
MULTIPLY 4 4 3
TOTIENT 4 4
Output
1
1
2
----------------------------------------------------------------------------------------------------
