#include using namespace std; int p[100][100],h[100],v[100][100],truoc[100]; int main(){ int n,dau,cuoi,step; cin>>n>>dau>>cuoi>>step; for(int i=0;i>p[i][j]; } } for(int i=0;i>h[i]; } bool check=false; stack s; stack ans; s.push(dau); int cost; while(check==false){ int gn=0; cost=0; s.push(dau); while(!s.empty()){ int gm,j; int t=s.top();s.pop(); if(t==cuoi){ check=true; cost+=p[truoc[cuoi]][cuoi]; cout<"; int j=truoc[cuoi]; while(j!=dau){ cout<"; j=truoc[j]; } cout<=0;i--){ if(p[t][i]!=0 ){ gm= gn+p[t][i]; int fm=gm+h[i]; if(fm<=step){ ans.push(i); s.push(i); truoc[i]=t; j=i; cost=fm; } } } gn+=p[t][j]; } step+=step; } }