Time limit
2s
Memory limit
128 MB
Three special dice are rolled at the same time. The first die has faces numbered from 1 to S1, the second die has faces numbered from 1 to S2, and the third die has faces numbered from 1 to S3.
For every possible triple of rolled values (a, b, c), count how often each sum a + b + c appears. Print the sum that appears most often. If several sums appear equally often, print the smallest such sum.
The first line contains three integers S1, S2, and S3, separated by spaces.
2 <= S1 <= 202 <= S2 <= 202 <= S3 <= 40Print the most frequent sum of the three dice. If there is more than one answer, print the smallest sum among them.