ICPC 2023 Online Spring Challenge powered by Huawei


A. Buffer Sharing in Multi-tenant Database Environment
time limit per test: 15 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
2 10 10
3 5
10 10
1 5 10 1 5 10
1 1
2 1
1 2
2 2
1 3
2 3
1 4
2 4
1 5
2 5
Output
1
6
2
7
3
8
4
9
5
10
----------------------------------------------------------------------------------------------------
