I think this may be a solution even for n=2m.
Point people around the circle from 1 to 2 m.
In round j, 1β€jβ€m, person j shakes hands with person j+1 , and all other handshakes are "parallel" to this (therefore j-1 with j + 2, j-2 with j + 3, etc. - everywhere, these labels are interpreted modulo n, if necessary) . At the end of these rounds everyone shook hands with all the odd number of people.
In the round m + j, 1β€jβ€m, j trembles with j + 2, and all other handshakes are parallel (therefore j-1 with j + 3, j-2 with j + 4, etc.). This processes all pairs with an even number of people. Thus, the total amount is 2 m.
As noted in the statement of the problem, 2m-1 rounds are impossible, so the answer is 2m.
The odd case is even simpler. In round j, man j sits, and j-1 greets j + 1, j-2 greets j + 2, etc., Using n rounds again.
Nathan srivi
source share