static int[] resizeIntArray(int[] a, int n) { if (n == l(a)) ret a; int[] b = new int[n]; arraycopy(a, 0, b, 0, min(l(a), n)); ret b; }