#include #include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} const ll INF=1LL<<60; ll op(ll l,ll r){return max(l,r);} ll e(){return -INF;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,S,H; cin>>N>>S>>H; vectorX(N),Y(N); vectorZ(N); atcoder::segtreeseg(N+1); seg.set(0,0); for(int i=0;i>X[i]>>Y[i]>>Z[i]; for(int i=0;i