This is obtained when we place one person in m-1 teams each and place all the remaining people in the last team. In any other arrangement, the number of friends can be increased by transfering a person from a given team to the team with the maximum number of people. In this arrangement, no such transfer can take place. This yields the maximum number of friendships. Detailed proofs given in the '
source not stored for this graph (policy: none)