You do realise the given example is only an easy to understand sample to illustrate the I/O format and aid understanding? Passing that is only the first step, and you are expected to create your own test cases to further prove your solution. The hidden test data is likely to be much more rigorous than the example, and include corner cases, and maximum data sizes allowed by the constraints.
Anyway, try this:
1 1 3 1 4 4 2 2