Mock CCO '18 Contest 1 Problem 3 - A Segment Tree Problem

View as PDF

Submit solution


Points: 15 (partial)
Time limit: 1.0s
Memory limit: 32M

Problem type

Given a 1-indexed array of N integers, consider all subarrays of size M. A subarray is good if the range of the subarray is at most C. Compute all good subarrays.

Constraints

1 \le N \le 10^6

1 \le M \le 10^4

0 \le C \le 10^4

0 \le l_i \le 10^6

Input Specification

The first line will contain three space-separated integers, N, M, and C.

The next line contains N space-separated integers, the l_i in order comprising the list.

Output Specification

Output, on separate lines, all starting indices of good subarrays. Print exactly one per line, and print them in increasing order.

If no subarrays are good, output NONE.

Sample Input

7 2 0
0 1 1 2 3 2 2

Sample Output

2
6

Comments

There are no comments at the moment.