Train or walk

#include
using namespace std;
int main()
{
int t;
cin>>t;
int city[30],i;
int ab,ac,cd,db,ans;
for(i=0;i<t;i++)
{
int n,a,b,c,d,p,q,y;
cin>>n>>a>>b>>c>>d>>p>>q<<y;
int j;
for(j=0;j<n;j++)
{
cin>>city[i];
ab = p * ((a > b) ? (city[a] - city[b]) : (city[b] - city[a]));
ac = p * ((a > c) ? (city[a] - city[c]) : (city[c] - city[a]));
cd = q * ((c > d) ? (city[c] - city[d]) : (city[d] - city[c]));
db = p * ((d > b) ? (city[d] - city[b]) : (city[b] - city[d]));
ans=ab;
if(ac<=y)
ans=y+cd+db;
if(ab<ans)
ans=ab;
cout<<ans;
}

}
return 0;

}

i dont understand why it is not running correctly

You don’t have any submissions for Train or Walk, that I can see - are you trying to Run without providing Custom Input?

You are mistake for cin>>n>>a>>b>>c>>d>>p>>q<<y; in q>>y . write >> this braces then run correctly…