提交时间:2022-08-01 11:33:54
运行 ID: 54356
#include<bits/stdc++.h> using namespace std; int n,m; int work(int x,int y) { if(x==y) { return x; } else { return work(min(y-x,x),max(y-x,x))+x; } } int main() { scanf("%d%d",&n,&m); printf("%d\n",work(min(n,m),max(n,m))); return 0; }