记录编号 | 575415 | 评测结果 | AAAAAAAAAAAAATTTTTTA | ||
---|---|---|---|---|---|
题目名称 | 3657.[NOI Online 2022 1st PJ]数学游戏 | 最终得分 | 70 | ||
用户昵称 | 是否通过 | 未通过 | |||
代码语言 | C++ | 运行时间 | 6.162 s | ||
提交时间 | 2022-09-14 20:30:47 | 内存使用 | 0.00 MiB | ||
#include <bits/stdc++.h> using namespace std; unsigned long long x, y, z, d, t; int main() { freopen("noi_online2022_math.in","r",stdin); freopen("noi_online2022_math.out","w",stdout); scanf("%d", &t); for(int i = 1; i <= t; ++i) { cin >> x >> z; y = z / x / sqrt(__gcd(x * x, z / x)); if(z == x * y * __gcd(x , y)) printf("%d\n", y); else printf("-1\n"); } return 0; }