#1223
Unrated
VUDU
시간 제한
1s
메모리 제한
64MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

1 second, 64 MB, 140 points 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.

입력

The first line of input contains the integer N, the sequence length (1 ⩽N ⩽1 000 000). The second line of input contains N prices ai (0 ⩽ai ⩽1 000 000 000). The third line of input contains an integer P. (0 ⩽P ⩽1 000 000 000).

출력

The first and only line of output must contain the answer to Mirko’s question for a given P.

예제 입력 1

3
1 2 3
3

예제 출력 1

1

예제 입력 2

3
1 3 2
2

예제 출력 2

5

예제 입력 3

3
1 3 2
3

예제 출력 3

1
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.