Time limit
2s
Memory limit
128 MB
Kangmin has n coupons, each of which can be used to order one chicken. Whenever he orders one chicken with a coupon, the shop gives him one stamp. Every k stamps can be exchanged for one new coupon.
Determine the maximum number of chickens Kangmin can eat using the coupons he has now and any coupons he receives by exchanging stamps. A coupon is required to order each chicken.
The input consists of multiple lines. Each line contains two natural numbers n and k separated by a space. Input continues until the end of file.
For each input line, print the maximum number of chickens Kangmin can eat on its own line.