I hope to divide the number into several subgroups and randk them according
another criteria. How can i do this