Maximum spacing k-clustering on a large input and with distances given implicitly