CEOI 2019 day 1 online mirror (unrated, IOI format)


A. Building Skyscrapers
time limit per test: 3.5 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
3
2
0 0
0 1
0 2
Output
YES
1
2
3
Input
3
1
0 0
1 1
2 2
Output
YES
2
3
1
Input
2
1
0 0
0 2
Output
NO
----------------------------------------------------------------------------------------------------
B. Dynamic Diameter
time limit per test: 6 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
4 3 2000
1 2 100
2 3 1000
2 4 1000
2 1030
1 1020
1 890
Output
2030
2080
2050
Input
10 10 10000
1 9 1241
5 6 1630
10 5 1630
2 6 853
10 1 511
5 3 760
8 3 1076
4 10 1483
7 10 40
8 2051
5 6294
5 4168
7 1861
0 5244
6 5156
3 3001
8 5267
5 3102
8 3623
Output
6164
7812
8385
6737
6738
7205
6641
7062
6581
5155
----------------------------------------------------------------------------------------------------
C. Cubeword
time limit per test: 1.7 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
1
radar
Output
1
Input
1
robot
Output
2
Input
2
FLOW
WOLF
Output
2
Input
2
baobab
bob
Output
4097
Input
3
TURING
SUBMIT
ACCEPT
Output
162
Input
3
MAN1LA
MAN6OS
AN4NAS
Output
114
----------------------------------------------------------------------------------------------------
