European Girls Olympiad in Informatics 2022. Day 1
A. SubsetMex
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
4
0 3 0 3
5
4 1 0 2 0
Output
4
10

B. Lego Wall
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
2 2
Output
3
Input
3 3
Output
12
Input
5 7
Output
1436232

C. SocialEngineering
time limit per test
5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

D. Tourists
time limit per test
4 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
8 4 11
1 4 8 1
6 4
6 3
3 7
6 5
5 1
1 2
1 8
q 4
t 3 4 5
t 2 2 7
q 4
e 5 10
e 1 5
q 4
t 1 1 5
t 2 2 1
q 1
q 2
Output
0
-1
9
4
-7