static LPair assignEachPointToClosestNeighbor(Cl l1, Cl l2) { new LPair pairs; for (Pt a : l1) { if (empty(l2)) break; Pt b = lowestAccordingTo(l2, x -> ptDistanceSquared(a, x)); l2.remove(b); } ret pairs; }