0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 17:52:02 +00:00
OI-codes/Codeforces/1589/A/A.cpp
2022-04-01 18:33:24 +08:00

21 lines
340 B
C++

#include <bits/stdc++.h>
using namespace std;
int t, u, v;
long long uu, vv, k, x, y;
int main() {
cin >> t;
while (t--) {
cin >> u >> v;
uu = 1ll * u * u;
vv = 1ll * v * v;
k = __gcd(uu, vv);
x = -(uu / k);
y = vv / k;
cout << x << ' ' << y << endl;
}
return 0;
}