HDACM 1555
水题
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);while (sc.hasNext()) {int m = sc.nextInt();int k = sc.nextInt();if (m==0&&k==0) {break;}int t = 0;int i = 0;while (m>0) {t++;i++;m--;if (i==k) {m++;i=0;}}System.out.println(t);}sc.close();}
}