题意:
思路: 按照题意模拟即可//By SiriusRen#includeusing namespace std;int c,f1,f2,d,xx,yy,vis[2005];int main(){ scanf("%d%d%d%d",&c,&f1,&f2,&d); for(int i=1;i<=c;i++){ scanf("%d%d",&xx,&yy); vis[xx]++,vis[yy+1]--; } for(int i=1;i<=d;i++)vis[i]+=vis[i-1]; while(f2!=f1)f2+=vis[d--]; printf("%d\n",d+1);}