Codeforces Beta Round 80 (Div. 2 Only)


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

Examples
Input
12
Output
4
Input
20
Output
15
Input
10
Output
0
----------------------------------------------------------------------------------------------------
B. Testing Pants for Sadness
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 1
Output
2
Input
2
2 2
Output
5
Input
1
10
Output
10
----------------------------------------------------------------------------------------------------
C. Cthulhu
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 6
6 3
6 4
5 1
2 5
1 4
5 4
Output
FHTAGN!
Input
6 5
5 6
4 6
3 1
5 1
1 2
Output
NO
----------------------------------------------------------------------------------------------------
D. Russian Roulette
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 3
1
2
3
Output
..X
Input
6 3 6
1
2
3
4
5
6
Output
.X.X.X
Input
5 2 5
1
2
3
4
5
Output
...XX
----------------------------------------------------------------------------------------------------
E. Time to Raid Cowavans
time limit per test: 4 seconds
memory limit per test: 70 megabytes
input: standard input
output: standard output

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