Technocup 2019 - Elimination Round 1


A. In Search of an Easy Problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
0 0 1
Output
HARD
Input
1
0
Output
EASY
----------------------------------------------------------------------------------------------------
B. Vasya and Cornfield
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
4
2 4
4 1
6 3
4 5
Output
YES
NO
NO
YES
Input
8 7
4
4 4
2 8
8 1
6 1
Output
YES
NO
YES
YES
----------------------------------------------------------------------------------------------------
C. Vasya and Golden Ticket
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
73452
Output
YES
Input
4
1248
Output
NO
----------------------------------------------------------------------------------------------------
D. Vasya and Triangle
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3 3
Output
YES
1 0
2 3
4 1
Input
4 4 7
Output
NO
----------------------------------------------------------------------------------------------------
E. Vasya and Good Sequences
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
6 7 14
Output
2
Input
4
1 2 1 16
Output
4
----------------------------------------------------------------------------------------------------
F. Putting Boxes Together
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 8
1 2 6 7 10
1 1 1 1 2
1 1
1 5
1 3
3 5
-3 5
-1 10
1 4
2 5
Output
0
10
3
4
18
7
----------------------------------------------------------------------------------------------------
G. Linear Congruential Generator
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4
2 3 5 7
Output
210
Input
3
5 3 3
Output
30
----------------------------------------------------------------------------------------------------
