Here is my code. I’m unable to find errors even after going through it several times.I used Dev C++ compiler and my code is in C
Why are you printing
Staircase instead of stairs? It will give an immediate WA.
Please read the output section and strictly follow it.
another error, the elevator moves 2*N distance, because as the problem said, the elevator at first goes from ground floor to the chef’s floor which is N, and then from chef’s floor to ground floor, which is N again! You haven’t considered this fact in your code.
The Elevator moves twice ie from ground floor to N floor and from N floor to ground floor Hence the total distance covered is 2*N
In the question you are said to print Stairs not Staircase Hence it will show a wrong answer.
You print a new line before and after the every output Hence it two new lines,hence it will show wrong answer.(You must also not leave extra space)
You are using root 2 value as 1.732 but actually it is 1.414,Moreover You are not recomended to use these values because you may get wrong in some test cases you should use sqrt(2) function in math.h
Your answer is going to be evaluated by computer Hence the output generated by your code must exactly match(character by character) with their output file.
You are not required to check if the input variables are within limit .It is guaranteed that they are within the limit.