Md. Arifur Rahman (Sazal)
ক্রমে ক্রমে হ্রাস পাচ্ছে বিবেক, ঘুমিয়ে পড়ছে মানবতা……
Pages
Home
ACM Algorithm
Math
E- Balagurusamy
Basic Program
Assembly Language
Gallery
My Portfolio
Wednesday, 18 May 2011
10346-Peter’s Smokes
#include<stdio.h>
int main()
{
int it,n,k;
//freopen("in.txt","r",stdin);
while(!(scanf("%d%d",&n,&k)^2) && k>1)
{
it=n;
while(n>=k)
{
it+=n/k;
n=(n/k)+(n%k);
}
printf("%d\n",it);
}
return(0);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment