116232024-11-01 11:55:11MagyarKendeSZLGPingpongcpp17Accepted 100/1002ms320 KiB
#include <iostream>
using namespace std;

void win_a(int B) {
    for (int i = 0; i < 3; i++) {
        cout << "11 " << min(10, B) << "\n";
        B -= min(10, B);
    }
}

void solve() {
    int A, B;
    cin >> A >> B;

    // 3 - 0
    if (A == 33 && B <= 30) {
        win_a(B);
        return;
    }

    // 3 - 1
    if (A >= 33 && A <= 43 && B >= 11 && B <= 41) {
        cout << A - 33 << " 11\n";
        win_a(B - 11);
        return;
    }

    // 3 - 2
    if (A >= 33 && A <= 53 && B >= 22 && B <= 52) {
        A -= 33;
        for (int i = 0; i < 2; i++) {
            cout << min(10, A) << " 11\n";
            A -= min(10, A);
        }
        win_a(B - 22);
        return;
    }

    cout << "-1 -1\n";
}

int main() {
    cin.tie(0), ios::sync_with_stdio(0);
    int T;
    cin >> T;
    while (T--) solve();
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
subtask220/20
2Accepted1ms320 KiB
subtask330/30
3Accepted1ms320 KiB
subtask450/50
4Accepted1ms320 KiB
5Accepted2ms320 KiB
6Accepted2ms320 KiB