Logo
(追記) (追記ここまで)

5359번 - Music 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB104878484.000%

문제

Silence is useless. We need the world to be full of music. In computer music, volume is represented as an array of integers of length n. Silence in music is defined by 2 parameters c and m. Silence occurs in any sub-array of length m where the difference between the minimum element and the maximal element is no greater than c. For example if the volume array is [1,3,2,7,5,4,6,6] and m = 3, c = 2. Then silence occurs in the subarrays of size 3 indexed at 0, 4, and 5. Output the total number of silence intervals.

입력

The first line in the data file is an integer that represents the number of data sets to follow. Each data set is 2 lines. The first line contains n, m, c (n <= 20, m<=20, c<=1000). The second line contains n integers representing the volume array. Each integer is less than or equal to 1000.

출력

Print the total number of silence intervals for each data set.

제한

예제 입력 1

3
8 3 2
1 3 2 7 5 4 6 6
4 2 1
1 2 3 4
4 5 900
1 1 1 1

예제 출력 1

3
3
0

힌트

출처

School > PLU High School Programming Contest > PLU 2012 > Advanced 6번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /