CF85D Sum of Medians
Description
In one well-known algorithm of finding the $ k $ -th order statistics we should divide all elements into groups of five consecutive elements and find the median of each five. A median is called the middle element of a sorted array (it's the third largest element for a group of five). To increase the algorithm's performance speed on a modern video card, you should be able to find a sum of medians in each five of the array.
A sum of medians of a sorted $ k $ -element set $ S={a_{1},a_{2},...,a_{k}} $ , where $ a_{1}<a_{2}<a_{3}<...<a_{k} $ , will be understood by as
The  operator stands for taking the remainder, that is  stands for the remainder of dividing $ x $ by $ y $ .
To organize exercise testing quickly calculating the sum of medians for a changing set was needed.
Input Format
N/A
Output Format
N/A