Proper solution based on http://codesays.com/2014/solution-to-min-avg-two-slice-by-codility/