#include using namespace std; using ll = long long; using P = pair; #define rep(i,n) for(int (i) = 0; i<(n); i++) int main(){ ll n, y, z; cin >> n >> y >> z; vector> tp(n); for(auto &[l, x, c] : tp) cin >> c >> l >> x; tp.push_back(tuple(z, 0, 0)); sort(tp.begin(), tp.end()); ll ans = 0; priority_queue

q; int idx = 0; while(y(tp[idx])<=y){ auto [l, x, c] = tp[idx]; q.push(P(x, c)); idx++; } if(q.empty()){ ans = -1; break; } auto [x, c] = q.top(); q.pop(); // k 体倒す ll k = (get<0>(tp[idx])-y-1)/x+1; // 次のスライムのレベル(いなければ z)まであげる if(c