Bayan 2012-2013 Elimination Round (ACM ICPC Rules, English statements)


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

Examples
Input
4 6
1 2 5 2
2 3 3 4
Output
10
Input
2 3
5 6
5 5
Output
14
----------------------------------------------------------------------------------------------------
B. Friends
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
1 2 3
Output
3
Input
3 2
1 2 3
Output
5
Input
3 3
1 2 3
Output
6
----------------------------------------------------------------------------------------------------
C. Mirror Box
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
50 50 7
10 F 1 80000
20 T 1 80000
30 T 81000 82000
40 T 83000 84000
50 T 85000 86000
60 T 87000 88000
70 F 81000 89000
Output
100
Input
80 72 9
15 T 8210 15679
10 F 11940 22399
50 T 30600 44789
50 F 32090 36579
5 F 45520 48519
120 F 49250 55229
8 F 59700 80609
35 T 61940 64939
2 T 92540 97769
Output
120
----------------------------------------------------------------------------------------------------
D. Numbers
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
1 2 3
Output
Yes
3
1 2 3 
Input
3 5
1 2 3
Output
No
----------------------------------------------------------------------------------------------------
E. Flights
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
3 10 12
##########
#z1a1111b#
##########
2 3 ab 2 8
Output
2 8
Input
10 3 5
###
#w#
#1#
#a#
#1#
#1#
#1#
#1#
#b#
###
3 2 abababababababab 6 2
Output
8 2
Input
3 10 6
##########
#z1a1311b#
##########
2 3 ab 2 8
Output
2 7
----------------------------------------------------------------------------------------------------
G. Challenging Balloons
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

No test samples are available for this problem
----------------------------------------------------------------------------------------------------
