#P8661. Hot Posts

    ID: 21827 Type: Default 1000ms 256MiB

Hot Posts

Hot Posts

You are given a log of likes on a programmer forum with NN entries. Each entry is in the format ts id, indicating that the post with id id received a like at time tsts. Also given are two integers DD and KK. A post is considered hot if there exists a time TT such that the post receives at least KK likes in the time interval [T,T+D)[T, T+D) (note that the interval is left-closed and right-open).

Your task is to determine all post IDs that have ever been hot.

inputFormat

The first line contains three integers NN, DD, and KK. Each of the next NN lines contains two integers tsts and idid, representing that post idid received a like at time tsts.

outputFormat

Output the post IDs that have been hot in ascending order, separated by spaces. If no post satisfies the condition, output an empty line.

sample

6 10 3
1 101
3 102
5 101
10 101
11 102
14 101
101