Codeforces Round 755 (Div. 2, based on Technocup 2022 Elimination Round 2)


A. Mathematical Addition
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 1
2 3
3 5
6 9
Output
-1 1
-4 9
-18 50
-4 9
----------------------------------------------------------------------------------------------------
B. Coloring Rectangles
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 3
2 2
2 5
3 5
Output
1
2
4
5
----------------------------------------------------------------------------------------------------
C. Two Arrays
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3
-1 1 0
0 0 2
1
0
2
5
1 2 3 4 5
1 2 3 4 5
Output
YES
NO
YES
----------------------------------------------------------------------------------------------------
D. Guess the Permutation
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 
5 
4 
3 
3 
5 
2 
2 
1 
Output
? 1 5
? 2 5
? 3 5
! 1 3 5
? 1 5
? 2 5
? 3 5
! 2 4 5
----------------------------------------------------------------------------------------------------
E. Game with Stones
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
2
2 2
3
1 2 3
4
1 1 1 1
4
1 2 2 1
4
1 2 1 2
8
1 2 1 2 1 2 1 2
Output
1
0
4
2
1
3
----------------------------------------------------------------------------------------------------
F. Strange LCS
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2
ABC
CBA
2
bacab
defed
3
abcde
aBcDe
ace
2
codeforces
technocup
Output
1
A
0
3
ace
3
coc
----------------------------------------------------------------------------------------------------
