#include <iostream>
#include <vector>
#include <map>
using namespace std;
class Solution {
public:
bool carPooling(vector<vector<int>>& trips, int capacity) {
map<int, int> map;
for(const vector<int>& trip: trips)
map[trip[1]] += trip[0], map[trip[2]] -= trip[0];
int cur = 0;
for(const pair<int, int>& p: map){
cur += p.second;
if(cur > capacity) return false;
}
return true;
}
};
int main() {
return 0;
}