Manthan, Codefest 16


A. Ebony and Ivory
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 6 15
Output
No
Input
3 2 7
Output
Yes
Input
6 11 6
Output
Yes
----------------------------------------------------------------------------------------------------
B. A Trivial Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
5
5 6 7 8 9 
Input
5
Output
0
----------------------------------------------------------------------------------------------------
C. Spy Syndrome 2
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
30
ariksihsidlihcdnaehsetahgnisol
10
Kira
hates
is
he
losing
death
childish
L
and
Note
Output
Kira is childish and he hates losing 
Input
12
iherehtolleh
5
HI
Ho
there
HeLLo
hello
Output
HI there HeLLo 
----------------------------------------------------------------------------------------------------
D. Fibonacci-ish
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 -1
Output
3
Input
5
28 35 7 14 21
Output
4
----------------------------------------------------------------------------------------------------
E. Startup Funding
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
3 2 1
300 200 300
Output
133.3333333
----------------------------------------------------------------------------------------------------
F. The Chocolate Spree
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
1 2 3 4 5 6 7 8 9
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
Output
25
Input
2
20 10
1 2
Output
30
----------------------------------------------------------------------------------------------------
G. Yash And Trees
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
8 20
3 7 9 8 4 11 7 3
1 2
1 3
3 4
4 5
4 6
4 7
5 8
4
2 1
1 1 1
2 5
2 4
Output
3
1
1
Input
5 10
8 7 5 1 0
1 2
2 3
1 5
2 4
3
1 1 0
1 1 2
2 2
Output
2
----------------------------------------------------------------------------------------------------
H. Fibonacci-ish II
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

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