The problemsetters opened the problem for some other languages again - thanks for that.
My other suggestion was to increase the number of testcases in a way that even someone who knows the expected output and thus could submit a code that only prints that output (instead of processing the input data) has no chance to get a short code.
If you look at the changes they made at the problem description, it seems that the number of test cases has really increased ("15 to 20").
But that isn't true. The only change is adding the number of testcases as first line of input data, but there are still only 7 testcases!
Problemsetters, if you are really interested in avoiding any "bad taste": Why do you do such things? Why not producing an input of, say, 200 lines.
Just write a short piece of code and generate 200 random testcases, perhaps add some special cases and even one who knows about the i/o doesn't have any advantage by that.