190822025-11-21 19:07:37szjRácsháló gráfcpp17Wrong answer 0/501ms508 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int m, n, k, a, b, l1, l2;
    cin >> n >> m >> k;
    l1=m+n-2;
    l2=l1;
    while(k--)
    {
        cin >> a >> b;
        if(a%m < b%m)l1--;
        else l2--;
        cout << max(l1, l2) << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms508 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms320 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/21ms316 KiB
8Wrong answer0/21ms316 KiB
9Wrong answer0/21ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/21ms316 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/31ms316 KiB
14Wrong answer0/31ms316 KiB
15Wrong answer0/31ms316 KiB
16Wrong answer0/31ms316 KiB
17Wrong answer0/31ms316 KiB
18Wrong answer0/31ms316 KiB
19Wrong answer0/31ms316 KiB
20Wrong answer0/31ms316 KiB
21Wrong answer0/31ms316 KiB
22Wrong answer0/31ms316 KiB