#include <stdio.h> int main() { int t=10,n,b; while (scanf("%d",&n)==1&&t--) { if (n==0) break; b=0; while (n>1) { if (n==2) { b++; break; } else { b=b+n/3; n=n/3+n%3; } } printf("%d\n",b); } return 0; }
Sunday, April 24, 2016
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment