题解:CF1790E Vlad and a Pair of Numbers
fish_love_cat · · 题解
卡我题单上限我已急哭。
容易知道
所以我们需要对于给定的
显然有解必须要求
其余情况,我们现在已知了
如果这个解不满足条件,那么容易得知局面不合法,故也不需要另外分讨。
// LUOGU_RID: 143902086
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
int x,a,b;cin>>x,a=x/2,b=3*a;
if((a^b)==x)cout<<a<<' '<<b<<'\n';
else puts("-1");
}
return 0;
}
// 我不知道该怎么将这本日记交给她。
// 我究竟能为沙耶做些什么?
// 我不知道。
// 因为我没有失去过重要的人。