Cup collection algorithm documentation.