import java.net.NetworkInterface; import java.util.*; public class Main {public static int upper_bound(long[] arr, long key) { int len = arr.length; int lo = 0; int hi = len-1; int mid = (lo + hi)/2; while (true) { long cmp = arr[mid]-key; if (cmp == 0 || cmp < 0) { lo = mid+1; if (hi < lo) return mid