</pre><pre name="code" class="cpp">
</pre><pre name="code" class="cpp">
#include<iostream>
typedef long long LL;
using namespace std;
int main()
{
LL a,b,temp;
LL n=0;
cin>>a>>b;
while(a%b!=0)
{
n+=a/b;
temp=b+a%b;
a=b>a%b?b:a%b;
b=temp-a;
}
n+=a/b;
cout<<n;
//system("pause");
return 0;
}
非常简单的一个题,但是要注意LL,学到了,gcd算法,之前脑残的用模拟的一步步减,超时没商量