Codeforces Round 723 (Div. 2)


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

Examples
Input
3
3
1 2 3 4 5 6
2
123 456 789 10
1
6 9
Output
3 1 4 2 5 6
123 10 456 789
9 6
----------------------------------------------------------------------------------------------------
B. I Hate 1111
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
33
144
69
Output
YES
YES
NO
----------------------------------------------------------------------------------------------------
C1. Potions (Easy Version)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
4 -4 1 -3 1 -3
Output
5
----------------------------------------------------------------------------------------------------
C2. Potions (Hard Version)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
4 -4 1 -3 1 -3
Output
5
----------------------------------------------------------------------------------------------------
D. Kill Anton
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
ANTON
NAAN
AAAAAA
OAANTTON
Output
NNOTA
AANN
AAAAAA
TNNTAOOA
----------------------------------------------------------------------------------------------------
E. Oolimry and Suffix Array
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
0 2 1
Output
1
Input
5 1
0 1 2 3 4
Output
0
Input
6 200000
0 1 2 3 4 5
Output
822243495
Input
7 6
3 2 4 1 0 5 6
Output
36
----------------------------------------------------------------------------------------------------
F. Median Queries
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
20
6
9
1
Output
? 1 5 2
? 20 19 2
! 9 10 19 7 16 18 11 14 15 6 20 8 17 4 5 3 12 2 13 1
----------------------------------------------------------------------------------------------------
