static Pt rectsMaxBottomRight(L rects) { int x = 0, y = 0; for (Rect r : rects) { x = max(x, r.x2()); y = max(y, r.y2()); } ret new Pt(x, y); }