Archeologists have recently found unquestionable proof that some ancient cultures used a complex method of encoding information in pictures. The ancient artists hid their arcane message in a few pixel columns of their pictures, selected according to a secret formula known only to a few. Fortunately, our archeologists managed to find the formula on ancient stone tablets. Even with the formula, finding the proper columns is a non-trivial task - only when the proper columns were found by luck on the flaking paint over an ancient egyptian grave, it became clear that this code is part of something big. A great mistery is about to be solved - but first, the columns must be found.
In this task, your input is a JPG image file. You have to select five columns of this image and send back the index of these columns. We will evaluate our magic expression (see below) on the selected five columns, resulting in a number. The goal of the task is to minimize this number. For each input file, the team with the smallest result will get the most points.
((red1 - green2) * red3 + green4) * blue5
(Where red1 is the red component from the pixel in the first column, green4 is the green component from the pixel in the fourth column, and so on.)
The result of this expression for each row will produce a total sum; we will then divide this total sum by 8 and take the absolute value to get the final result.
The JPG image file.
Five integers of the selected five columns. The leftmost column has the index 0. The output should be written as a single line of text, five numbers separated by whitespace.
Say we have the following 5x4 pixel input image (written as R, G, B):
col0 col1 col2 col3 col4 0, 0, 0 8, 2,4 0, 8, 5 3, 5, 4 0, 0, 0 row0 0, 0, 0 4, 5,7 0, 0, 0 7, 1, 1 0, 0, 0 row1 1, 1, 3 7, 2,6 0, 0, 0 4, 4, 6 0, 0, 0 row2 0, 0, 2 7,10,3 3,11, 0 3, 4, 6 0, 0, 0 row3With the following submission:
0 1 2 3 3
Then the score will be evaluated as follows:
((0 - 2) * 0 + 5) * 4 + ((0 - 5) * 0 + 1) * 1 + ((1 - 2) * 0 + 4) * 6 + ((0 - 10) * 3 + 4) * 6Total sum will be -111; absolute value of -111/8 with integer division will give the final score 13.