Unexpected output in ramu problem

i have tried the problem but getting wrong output . i cannot find the error in the code .
please tell the correction i have to do to get desired output.

You need to take input for the four lines T(number of testcases) times. While Cost and other inputs are taken only one time.

Tried but not getting correct output.

You are not storing input in the correct way. To store details about every rickshaw and cab you need to use array, a single variable can’t do the trick.