Some test cases are not passed

I am not getting why 2 test cases are not passed wth my code.

Look out for integer overflows.use long int everywhere