太痛苦了,90求调
#include <bits/stdc++.h>
using namespace std;
long long x,y;
long long ans;
int main(){
cin>>x>>y;
if(max(x,y)==x){
swap(x,y);
}
while(1){
ans+=x*4;
y-=x;
if(x==y||min(x,y)==0){
break;
}if(max(x,y)==x){
swap(x,y);
}
}ans+=x*4;
cout<<ans;
}
其实同楼下帖子(但那个帖子好像没人回