提交时间:2024-03-28 21:08:11
运行 ID: 140111
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; ull A, B, sum; int main() { scanf("%llu%llu", &A, &B); while (B) { sum += A / B * B; ull tmp(B); B = A % B; A = tmp; } printf("%llu\n", sum); return 0; }