QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#661896 | #7505. Billiard | abbcc_1# | AC ✓ | 28ms | 3700kb | C++20 | 326b | 2024-10-20 18:53:13 | 2024-10-20 18:53:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int kase;
cin >> kase;
while (kase--) {
int n, m;
cin >> n >> m;
cout << 2LL * n * m / __gcd(n, m) << "\n";
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3688kb
input:
5 2 2 2 3 2 4 2 5 2 6
output:
4 12 8 20 12
result:
ok 5 number(s): "4 12 8 20 12"
Test #2:
score: 0
Accepted
time: 28ms
memory: 3700kb
input:
100000 669308197 625790677 309402658 883960814 154288189 163799396 169512282 927758946 37480140 679939211 638101705 830820808 849697397 511857001 128162256 837500527 418377194 190545353 124951845 974336011 255633368 725343901 307301176 504671996 849730549 744535846 306521588 89276096 39998531 431540...
output:
837693659444558738 273499825419443612 50544624336267688 52422178694124924 50968433639539080 1060296348268555280 869847122771852794 214671913883017824 159439660235758964 243490164448780590 370844208741777136 77543148932533648 1265309706343518908 13682525358180224 34521982853617308 309194370418458864 ...
result:
ok 100000 numbers