Codeforces Beta Round 77 (Div. 2 Only)


A. Football
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
001001
Output
NO
Input
1000000001
Output
YES
----------------------------------------------------------------------------------------------------
B. Lucky Numbers (easy)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4500
Output
4747
Input
47
Output
47
----------------------------------------------------------------------------------------------------
C. Hockey
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
bers
ucky
elu
PetrLoveLuckyNumbers
t
Output
PetrLovtTttttNumtttt
Input
4
hello
party
abefglghjdhfgj
IVan
petrsmatchwin
a
Output
petrsmatchwin
Input
2
aCa
cba
abAcaba
c
Output
abCacba
----------------------------------------------------------------------------------------------------
D. Volleyball
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 3
1 2 3
1 4 1
2 4 1
2 3 5
2 7
7 2
1 2
7 7
Output
9
----------------------------------------------------------------------------------------------------
E. Horse Races
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2
1 100
Output
4
Input
1 2
70 77
Output
2
Input
2 1
1 20
80 100
Output
0
0
----------------------------------------------------------------------------------------------------
