0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-30 23:16:30 +00:00
OI-codes/CodeForces/1589/A/A.cpp

21 lines
340 B
C++
Raw Normal View History

#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;
}