private static void go(Pair pair1) {
        if (k <= 0)
            return;

        Queue<Pair> lf = new PriorityQueue<>();

        lf.add(pair1);
        while (!lf.isEmpty()) {
            k--;
            Pair pair = lf.remove();
            long mid = pair.from + (pair.to - pair.from) / 2;
            if (k == 0 || pair.to < pair.from) {
                y = Math.max(mid - pair.from, pair.to - mid);
                z = Math.min(mid - pair.from, pair.to - mid);
                return;
            }

            Pair left = new Pair(pair.from, mid - 1);
            Pair right = new Pair(mid + 1, pair.to);
            lf.add(left);
            lf.add(right);

        }
    }
Why Did you create this class? what does it do?
src/codejam2018/Practice4.java