import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int countMonster = Integer.parseInt(br.readLine()); List monsterList = new ArrayList<>(countMonster); int countFairy = Integer.parseInt(br.readLine()); List fairyList = new ArrayList<>(countFairy); for( int i=0; i Integer.compare(o1[0], o2[0])); monsterList.sort((o1,o2) -> o1.compareTo(o2)); //Combat > int idxMonster = 0; for(int i=0; i 0; idxMonster++,fairyCountAtk--){ int monsterPower = monsterList.get(idxMonster); if( monsterPower >= fairyPower ){ break; } } } System.out.println((idxMonster)); }catch(Exception e){ e.printStackTrace(); } } }