103732024-04-01 16:00:23111Pingpongcpp17Accepted 100/1004ms3200 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int T;
	cin>>T;
	while(T--){
		int A,B;
		cin>>A>>B;
		if(A==33&&B<=30){
			for(int i=0;i<3;i++){
				int x=min(B,10ll);
				B-=x;
				cout<<11<<' '<<x<<'\n';
			}
			continue;
		}
		if(A>=33&&A<44&&B>=11&&B-11<=30){
			cout<<A-33<<' '<<11<<'\n';
			A=33;
			B-=11;
			for(int i=0;i<3;i++){
				int x=min(B,10ll);
				B-=x;
				cout<<11<<' '<<x<<'\n';
			}
			continue;
		}
		if(A>=33&&A<=53&&B>=22&&B-22<=30){
			for(int i=0;i<2;i++){
				int y=min(10ll,A-33);
				A-=y;
				B-=11;
				cout<<y<<' '<<11<<'\n';
			}
			for(int i=0;i<3;i++){
				int x=min(B,10ll);
				B-=x;
				cout<<11<<' '<<x<<'\n';
			}
			continue;
		}
		cout<<-1<<' '<<-1<<'\n';
	}
	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1888 KiB
subtask220/20
2Accepted3ms2124 KiB
subtask330/30
3Accepted3ms2600 KiB
subtask450/50
4Accepted4ms2720 KiB
5Accepted4ms2864 KiB
6Accepted4ms3200 KiB