Editorial for DMOPC '22 Contest 5 P1 - Triple Triplets
Submitting an official solution before solving the problem yourself is a bannable offence.
It is optimal to use only the integers and in the array . Then, the Triple value will be equal to , where represents the number of s in the array, and represents the number of s in the array.
This subtask was meant for suboptimal implementations of the full solution or brute forcing for each by hand.
Loop over all possible values of and calculate the Triple value for each, taking the maximum value for the answer.