import java.util.PriorityQueue; import java.util.Scanner; public class Main { static Scanner scan = new Scanner(System.in); static PriorityQueue q = new PriorityQueue<>(); static int N; static int[] A, B; public static void main(String[] args) { input(); solve(); } static void input() { N = scan.nextInt(); A = new int[N]; B = new int[N]; for(int i=0; i { int level; int count; Node(int level, int count) { this.level = level; this.count = count; } void gain(int level) { this.level += level / 2; this.count++; } @Override public int compareTo(Node other) { if(this.level == other.level) { return this.count - other.count; } return this.level - other.level; } } }