poj2509专题

poj2509---抽k根烟就换一支,求能抽烟的总数

#include <stdio.h>#include <stdlib.h>int main(){int now,k;while(scanf("%d %d",&now,&k) != EOF){int hav=0;while(now >= k){hav += now/k*k;now = now/k + now%k;}hav += now;printf("%d\n",hav);}ret