#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>l; vector x(n),w(n),t(n); for(Int i=0;i>x[i]>>w[i]>>t[i]; Int ans=0,lst=0; for(Int i=0;it[i]) ans+=2*t[i]-tmp; ans+=w[i]; lst=x[i]+w[i]; } assert(lst<=l); ans+=l-lst; cout<