Rt,对拍无果
# include <bits/stdc++.h>
# define ffor(i,name) \
for (auto i = name.begin (); i != name.end (); ++ i)
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
ll a, b, c, s[65], x, y, tot;
int n;
bitset <65> vis;
int main () {
ios::sync_with_stdio (0);
cin.tie (0);
cout.tie (0);
cin >> a >> b >> c;
for (int i = 0; i < 63; ++ i)
if (c & 1ll << i)
s[++ n] = i, vis[i] = 1;
if (a + b < n || (n ^ a ^ b) & 1) {
puts ("-1");
return 0;
}
a = (a - b + n) / 2, b -= n - a;
if (a < 0 || n - a < 0) {
puts ("-1");
return 0;
}
// cout << a << ' ' << n - a << ' ' << b << '\n';
for (int i = 0; i < 60; ++ i)
if (! vis[i]) {
x |= 1ll << i, y |= 1ll << i;
if (++ tot >= b)
break ;
}
if (tot < b) {
puts ("-1");
return 0;
}
// cout << x << ' ' << y << '\n';
for (int i = 1; i <= a; ++ i)
x |= 1ll << s[i];
for (int i = a + 1; i <= n; ++ i)
y |= 1ll << s[i];
cout << x << ' ' << y;
return 0;
}