Hello cf, according to the editorial of 241C problem the group which will pay maximum should be assigned to the smallest sized table to which it can fit. Can anybody prove this is optimal strategy?
Also the problem has a tag of dp, so how to solve this problem using dp?
Any help is highly appreciated.