#include<bits/stdc++.h>
using namespace std;
long long x,y;
int gcd(long long a,long long b){
if(a==0){
return b;
}
else if(a<b) swap(a,b);
else if(!(a & 1) && !(b & 1))return 2*gcd(a/2,b/2);
else if(!(a & 1))return gcd(a/2,b);
else if(!(b & 1))return gcd(a,b/2);
else return gcd(a-b,b);
}
int main(){
cin>>x>>y;
cout<<gcd(x,y);
return 0;
}
如果x不是y的倍数or因数就会炸
rt求教