mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
A - Mathematical Addition
https://codeforces.com/contest/1589/submission/135351528
This commit is contained in:
parent
42d5617483
commit
483d7ddd61
20
CodeForces/1589/A/A.cpp
Normal file
20
CodeForces/1589/A/A.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user