Accepted
Code
/**
* Author: AhSaN (JUST-22)
* Created: 06-09-2024 08:00:49
**/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void Sol(int Cs) {
long long a, b;
cin >> a >> b;
if (a > b) swap(a, b);
long long res = (b - a) * a;
res += a * (a - 1);
cout << res << "\n";
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int Tc = 1;
cin >> Tc;
for (int Cs = 1; Cs <= Tc; Cs++) {
Sol(Cs);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1075 GCD not equal LCM
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-09-06 03:06:43
- Judged At
- 2024-11-11 02:56:59
- Judged By
- Score
- 100
- Total Time
- 32ms
- Peak Memory
- 2.062 MiB