import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int N = scn.nextInt(); int D = scn.nextInt(); int[] ling = new int[N];//1は足場がある0は足場がない for(int i=0; i N-1){ t = (t + D - (N-1)) - 1 ; }else{ t += D; } if(ling[t] == 0){ break; }else{ count ++; } } System.out.println(count); } }