Please help me in problem elevator


I’m new to code chef recently joined.

I’m trying to solve the elevator problem .Howeve rwhen I submit I keep getting wrong answer error.

Please help!! here’s my code:

 int main(){
	int distance = 0, vel1 = 0, vel2 = 0;
	float time1 = 0 ,time2 =0;
	//Enter Distance, velocity of elevator and stairs
	scanf("%d %d %d",&distance,&vel1,&vel2);
	/*if vel1>vel2 i.e velocity of stairs > velocity of Elevator
	automatically display stairs since 1.41*Distance < 2*Distance*/
	if(vel1 >= vel2){
	time1 = (sqrt(2) * distance)/ (float) vel1; 
	time2 = (2*distance)/(float) vel2;      //convert to float 
	//Check for least time 
	if(time1 <time2)

“The first line contains a single integer T, the number of test cases”

Your code does not take input for the number of test cases.
Test cases basically mean the number of times your code needs to run when tested.
Only one change is required and you will get AC.
before taking input for velocities and n you need to take T as input and run your code T times.
something like this-

int main() {

for(a=0;a<T;a++) {
// your code here

and dont forget to replace your return(0) with continue.

Thank you so much! that helped greatly(didn’t even know about this !) also I was missing \n after Elevator and Stairs i.e