#include #define ALL(v) std::begin(v),std::end(v) using lint=long long; using ld=long double; templateusing numr=std::numeric_limits; void cmn(lint&x,lint y){if(x>y)x=y;} int main(){ std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false); std::cout.setf(std::ios_base::fixed);std::cout.precision(15); lint inf=numr::max(); lint n,V,L;std::cin>>n>>V>>L; std::vector>a(n+2); a.at(0)={0,0,0},a.at(n+1)={L,0,0}; for(lint i=1;i<=n;i++){ lint x,v,w;std::cin>>x>>v>>w; a.at(i)={x,v,w}; } std::vectordp(V+1,0); for(lint i=1;i<=n+1;i++){ lint x,v,w;std::tie(x,v,w)=a.at(i); x-=std::get<0>(a.at(i-1)); if(V0;j--){ if(j