116122024-10-31 09:35:34MagyarKendeSZLGPingpongcpp17Wrong answer 20/1003ms348 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;
        int ro = A / 11;
        int rem = A % 11;
        vector<array<int, 2>> result;

        if (rem) { B -= 11; }

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

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

        if (rem) { result.push_back({rem, 11}); }

        int wcnt = 0;
        for (auto [ac, bc] : result) { wcnt += ac > bc; }
        if (wcnt * 2 <= result.size()) {
            cout << "-1 -1\n";
        } else {
            for (auto [ac, bc] : result) {
                cout << ac << " " << bc << "\n";
            }
        }
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms320 KiB
subtask220/20
2Accepted1ms348 KiB
subtask30/30
3Wrong answer1ms320 KiB
subtask40/50
4Wrong answer2ms320 KiB
5Wrong answer2ms320 KiB
6Wrong answer3ms320 KiB