# WA in WalkFast

Problem: WALKFAST Problem - CodeChef

My Solution: CodeChef: Practical coding for everyone

It seems to give the wrong answer for the testcase:

``````1
14 8 4 8 6 89 13 73
-990 -971 -893 -794 -694 -248 -140 -40 317 328 387 582 783 916
``````

Edit:

Simpler example:

``````1
8 1 8 1 4 92 70 45
-70 -56 -49 -7 -1 2 19 45
``````

The answer should be `9239`:

``````TIME JUST WALKING:
Start position: -70
End position: 45
Distance (metres): 115
Time taken to walk distance at 92 seconds per metre: **10580**
Start train station position: -70
Distance to walk from journey begin to start train station: 0
Time taken to walk to start train station: 0
We can reach the train station on time
TIME WALKING TO STATION THEN CATCHING TRAIN THEN WALKING REST OF THE WAY:
Time waiting for train to leave: 45
Start train station position: -70
End train station position: -7
Distance between train stations: 63
Time taken to travel this distance by train, going at 70 seconds per metre: 4410
Final end position: 45
Distance between end train station and final end of journey: 52
Time taken to walk this distance at : 92 seconds per meter: 4784
Total time: **9239**
9239
``````
2 Likes

You were right. I am an idiot. I missed multiplying a q to the train distance travelled.
But still. I am still getting wrong answers.

https://www.codechef.com/viewsolution/30789657

Thanks for taking your time out btw.

1 Like

Consider the testcase:

``````1
4 1 4 2 3 100 1 100
1 2 999 1000
``````
1 Like

999000 is the anwer?

`1197`

2 Likes

Hey! Thanks kind Sir. I overlooked that the time to reach the station and the departure could be same as well.

https://www.codechef.com/viewsolution/30790079

1 Like