/* 分からず */ package no200; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = sc.nextInt(); int[] b = new int[a]; for(int i=0;i handA = new ArrayList<>(); ArrayList handB = new ArrayList<>(); int ans = 0; for(int i=0;i= handA.size()) { handA.remove(0); handB.remove(handB.size()-1); }else{ handA.remove(ceilI); handB.remove(0); ans++; } } System.out.println(ans); } static class Int { int i,n; public Int(int i,int n) { } } }