Young Mirko has been buying voodoo dolls lately. Considering that he is very interested in the cheapest purchase possible, he has been tracking the prices of voodoo dolls each day. His price list consists of doll prices in the last N days, where doll price ai represents the price of a doll i days ago.
Mirko thinks he has noticed a connection between the average doll price in a sequence of consecutive days and the price on the following day. He wants to test his hunch and is puzzled by a very interesting question: “For a given P, how many different consecutive subsequences in the last N days are there, when the average doll price was greater than or equal to P?”
Two consecutive subsequences are considered different if their beginnings or ends are different.
input input input 3 1 2 3 3 3 1 3 2 2 3 1 3 2 3 output output output 1 5 1 Clarification of the first example: The only subsequence that has an average greater than or equal to 3 is {3}. Clarification of the second example: The subsequences that have an average greater than or equal to 2 are {1, 3}, {1, 3, 2}, {3}, {3, 2}, {2}. 입력 출력
출처:coci/2015-2016/contest2 5/6