#include <iostream>#include <algorithm>usingnamespacestd;constintN=1e5+10;typedefpair<int,int>PII;#define x first#define y secondPIIlogs[N];boolst[N];intcnt[N];intmain(){intn,d,k;cin>>n>>d>>k;for(inti=0;i<n;i++)cin>>logs[i].x>>logs[i].y;//时间,编号sort(logs,logs+n);//按照时间先排序for(inti=0,j=0;i<n;i++){cnt[logs[i].y]++;//目标编号出现次数加1while(logs[i].x-logs[j].x>=d)cnt[logs[j].y]--,j++;//滑动窗口,保证目标区域合法if(cnt[logs[i].y]>=k)st[logs[i].y]=true;//如果编号次数超K则输出}for(inti=0;i<N;i++)if(st[i])cout<<i<<endl;return0;}