Time Limit: 2 sec / Memory Limit: 1024 MB
NNA_1A1\ldots…A_NAN
5
2 1 5 4 3
4
If the persons stand on stools of heights 00, 11, 00, 11, and 22, respectively, their heights will be 22, 22, 55, 55, and 55, satisfying the condition.
We cannot meet the goal with a smaller total height of the stools.