CAT 2026 Semifinal (Upsolving)
A. Buying Souvenirs
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
5 9
2 4
1 10
3 7
3 8
10 20
Output
YA
1
2 9
Input
5 1
2 4
2 10
3 7
3 8
10 20
Output
TIDAK

B. Tree Journey
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4 2
1 4
2 4
3 4
1 2
3 3
Output
9
Input
5 5
2 3
1 3
1 4
4 5
1 2
2 3
3 1
4 4
5 5
Output
4

C1. Finding Treasure (Easy)
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 7 5
Output
12
Input
1 10000 10000
Output
0
Input
100 100 1
Output
99
Input
6 1 1
Output
3

C2. Finding Treasure (Hard)
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 7 5
Output
12
Input
1 10000 10000
Output
0
Input
100 100 1
Output
99
Input
6 1 1
Output
3

D. Rectangle Division
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
2 2 2
Output
4
Input
2 3 3
Output
7