Codeforces Beta Round 51


A. Flea travel
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
YES
Input
3
Output
NO
----------------------------------------------------------------------------------------------------
B. Smallest number
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1 1 1
+ + *
Output
3
Input
2 2 2 2
* * +
Output
8
Input
1 2 3 4
* + +
Output
9
----------------------------------------------------------------------------------------------------
C. Pie or die
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 1
1 2
Output
YES
Input
3 4 0
Output
NO
Input
100 50 2
50 25
50 25
Output
NO
----------------------------------------------------------------------------------------------------
D. Beautiful numbers
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
1 9
Output
9
Input
1
12 15
Output
2
----------------------------------------------------------------------------------------------------
E. Very simple problem
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
5 0
0 0
0 5
5 5
1
1 3
Output
2
Input
3
0 0
0 5
5 0
2
1 1
10 10
Output
1
0
Input
5
7 6
6 3
4 1
1 2
2 4
4
3 3
2 3
5 5
4 2
Output
5
3
3
4
----------------------------------------------------------------------------------------------------
