Educational Codeforces Round 23


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

Examples
Input
0 0 0 6
2 3
Output
YES
Input
1 1 3 6
1 5
Output
NO
----------------------------------------------------------------------------------------------------
B. Makes And The Product
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 1 1 1
Output
4
Input
5
1 3 2 3 4
Output
2
Input
6
1 3 3 1 3 2
Output
1
----------------------------------------------------------------------------------------------------
C. Really Big Numbers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
12 1
Output
3
Input
25 20
Output
0
Input
10 9
Output
1
----------------------------------------------------------------------------------------------------
D. Imbalanced Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 4 1
Output
9
----------------------------------------------------------------------------------------------------
E. Choosing The Commander
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

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