/* * ******************************************************************************************** * AUTHOR : Vijju123 * * Language: C++14 * * Purpose: - * * IDE used: Codechef IDE. * ******************************************************************************************** * Comments will be included in practice problems if it helps ^^ */ #include #include using namespace std; int main() { // your code goes here #ifdef JUDGE freopen("Input.txt", "rt", stdin); freopen("Diff.txt", "wt", stdout); #endif ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int t; cin>>t; cout.precision(3); assert(1<=t and t<=100000); while(t--) { int n,s,y; cin>>n>>s>>y; assert(1<=n and n<=10 and 1<=s and s<=10 and 1<=y and y<=1000); int i; int v[n],d[n],p[n],c[n]; for(i=0;i>v[i];//An attempt to read input is made here :3 assert(1<=v[i] and v[i]<=200); } for(i=0;i>d[i]; assert(d[i]==0 or d[i]==1); } for(i=0;i>p[i]; assert(abs(p[i])<=1000000000); } for(i=0;i>c[i]; assert(1<=c[i] and c[i]<=1000); } long double ans=0,del=0.000001; for(i=0;idel) or (d[i]==-1 and back<-del) or(abs(back)del and backThen-c[i]>del)) { //If car cannot reach by the time Chef crosses the lane. ans+=1.0*y/s; } else { //Chef must wait for car to pass + Time taken to cross the lane ans=ans+1.0*(abs(back)-v[i]*ans*1.0)/v[i]; ans+=1.0*y/s; } } cout<