All tasks are getting AC except last task(5) which shows WA.
Is there really a typical case which I am missing or some thing else ?
Since you are getting WA in the last task, it would generally mean that you are missing some corner cases. Try to run your code on all the corner cases provided by the constraints and see what result you are getting. See if you using the correct datatype and also try some corner cases.