rt,感觉我的方法不太像讨论区里的做法,但我在赛时A了
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int t;
cin >> t;
while(t--){
int n,k;
cin >> n >> k;
if(k % (n - k) == k){
cout << k <<" " << n - k << endl;
}else{
cout << -1 << endl;
}
}
}