232222026-01-16 17:47:08KoszorusBlankaFőzet készítéscpp17Wrong answer 0/506ms560 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int T;
    cin >> T;

    queue <int> Valaszok;

    int db;
    for (int i = 1; i <= T; i++) {
        int A, B;
        cin >> A >> B;

        db = 0;

        for (int a = 1; a <= A; a++) {
            for (int b = 1; b <= B; b++) {
                if (__gcd(a, b) == 1) {
                    db++;
                    A -= a; B -= b;
                }
            }
        }

        Valaszok.push(db);
    }

    while (!Valaszok.empty()) {
        cout << Valaszok.front() << endl;
        Valaszok.pop();
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms316 KiB
2Wrong answer0/04ms508 KiB
3Wrong answer0/31ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/31ms316 KiB
6Wrong answer0/21ms508 KiB
7Wrong answer0/34ms388 KiB
8Wrong answer0/24ms316 KiB
9Wrong answer0/34ms316 KiB
10Wrong answer0/24ms316 KiB
11Wrong answer0/24ms508 KiB
12Wrong answer0/24ms412 KiB
13Wrong answer0/24ms316 KiB
14Wrong answer0/26ms508 KiB
15Wrong answer0/24ms400 KiB
16Wrong answer0/24ms560 KiB
17Wrong answer0/24ms508 KiB
18Wrong answer0/24ms316 KiB
19Wrong answer0/24ms316 KiB
20Wrong answer0/36ms412 KiB
21Wrong answer0/34ms396 KiB
22Wrong answer0/36ms396 KiB
23Wrong answer0/36ms316 KiB