CAT 2026 Preliminary Batch 1 (Upsolving)
A. Opening a Safe
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4
0819
2031
Output
YA
Input
3
555
149
Output
TIDAK
Input
2
67
67
Output
YA

B. 2048 Game
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4
4 2 2 8
Output
YA
Input
4
8 1 1 4
Output
TIDAK
Input
2
1024 1024
Output
YA

C. Score Game
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 2
2 1
Output
3
Input
4 5
1 0 1 1 1
Output
1
Input
3 1
3
Output
1

D. Polygon Game
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Example
Input
5

1

3

1

0

1
Output

? 5 4

? 1 3

? 2 1

? 2 4

! 4 1 3 5 2