Text this: An Optimal Algorithm for Cardinality-Constrained Diameter Partitioning