提交时间:2024-01-03 13:31:43
运行 ID: 119030
#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",sum); return 0; }