2020 ICPC, COMPFEST 12, Indonesia Multi-Provincial Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred)


A. Arena of Greed
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5
6
Output
2
4
----------------------------------------------------------------------------------------------------
B. Blue and Red of Our Faculty!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6
1 2
2 3
3 4
4 1
1 5
5 1
Output
8
----------------------------------------------------------------------------------------------------
C. Captain of Knights
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3 4 5 6
5 5 8 8
Output
27
70
----------------------------------------------------------------------------------------------------
D. Danger of Mad Snakes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2 1
1 1 10
2 2 20
2 3 30
5 2 40
Output
33800
----------------------------------------------------------------------------------------------------
E. Excitation of Atoms
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 1
5 6 7 8 10 2
3 5 6 7 1 10
Output
35
----------------------------------------------------------------------------------------------------
F. Flamingoes of Mystery
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
 
5
 
15
 
10
 
Output
 
? 1 2
 
? 5 6
 
? 3 4
 
! 1 4 4 6 7 8
----------------------------------------------------------------------------------------------------
H. Huge Boxes of Animal Toys
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2 0 1
0 1 0 0
Output
Ya Ya Tidak Tidak
Tidak Ya Tidak Tidak
----------------------------------------------------------------------------------------------------
I. Impressive Harvesting of The Orchard
time limit per test: 7 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
1 2
1
2
1
1
Output
0 1
0 1
1 2
Input
5 3
2 1 1 3 2
1 2 2 1
1
1
1
Output
6 5
3 2
4 4
----------------------------------------------------------------------------------------------------
