提交时间:2022-08-01 11:33:53
运行 ID: 54355
#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; }