Create 1277.cpp

This commit is contained in:
Kirigaya Kazuto 2016-04-11 19:02:17 +08:00
parent b58f68e6bc
commit de2635164d

28
QUSTOJ/1277.cpp Normal file
View File

@ -0,0 +1,28 @@
#include <cstdio>
int main()
{
long long inc;
scanf("%I64d",&inc);
int step=0;
while(inc>4)
{
long long a=inc/3+1;
long long b=inc-2*a;
inc=a<b?b:a;
step++;
}
if(inc==2)
{
step++;
}
else if(inc==3)
{
step++;
}
else if(inc==4)
{
step+=2;
}
printf("%d\n",step);
return 0;
}