#include <bits/stdc++.h>using namespace std;int n, t, m, cnt;int main() { cin >> n >> m >> t; //建优先队列数组 priority_queue<int, vector<int>, greater<int>> h[100010]; for (int i = 1; i <= m; i++) { int ts, id; cin >> ts >> id; h[id].push(ts); } //遍历每家店肆 for (int i = 1; i <= n; i++) { int last = 0, pri = 0;//last:上一次订单时间,pri:记优先级 bool in = false;//判断是否在优先级队列中 //遍历市肆的所有订单 while (!h[i].empty()) { int x = h[i].top();//x时刻 h[i].pop(); //判断是否有同一时刻多次订单 if (last != x) { //盘算时间差,淘汰优先级 pri -= (x - last - 1); //优先级不能为负 if (pri < 0) pri = 0; } //判断是否移除优先级 if (in && pri <= 3) in = false; //增加优先级 pri += 2; last = x; //判断是否加入缓存 if (pri > 5) { in = true; } } //判断T时刻该店肆是否在优先缓存中 if (last != t) {