package yukicoder; import java.util.Scanner; public class Main { public static void main(String[] args) { @SuppressWarnings("resource") Scanner sc = new Scanner(System.in); String moment = sc.nextLine(); String[] spl = moment.split(" "); int animal = Integer.parseInt(spl[0]); int boat = Integer.parseInt(spl[1]); if(animal < 3 || boat < 3){ System.out.println(-1); return; } int numDay = -1; for(int i = boat ; i > 2 ; i--){ if((animal % i) != 2){ numDay = animal / i; if((animal % i) != 0){ numDay++; } break; } } System.out.println(numDay); } }