116212024-11-01 11:29:50MagyarKendeSZLGPingpongcpp17Wrong answer 20/1002ms436 KiB
#include <array>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    cin.tie(0), ios::sync_with_stdio(0);
    int T;
    cin >> T;
    while (T--) {
        int A, B;
        cin >> A >> B;

        if (A < 33 || A > 53) {
            cout << "-1 -1\n";
            continue;
        }

        A -= 33;

        vector<array<int, 2>> result;

        if (A) {
            if (B < 11) {
                cout << "-1 -1\n";
                continue;
            }
            if (A == 1 || B < 22) {
                result.push_back({A, 11});
                B -= 11;
            } else {
                int ra = min(10, A - 1);
                result.push_back({ra, 11});
                result.push_back({A - ra, 11});
                B -= 22;
            }
        }

        for (int i = 0; i < 3; i++) {
            int bsc = min(10, B);
            result.push_back({11, bsc});
            B -= bsc;
        }

        if (B > 0) {
            cout << "-1 -1\n";
            continue;
        }

        for (auto [ac, bc] : result) {
            cout << ac << " " << bc << "\n";
        }
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
subtask220/20
2Accepted1ms320 KiB
subtask30/30
3Wrong answer1ms320 KiB
subtask40/50
4Wrong answer2ms320 KiB
5Wrong answer2ms320 KiB
6Wrong answer2ms436 KiB