Providing wrong result for a test case

For which test case it is providing wrong ans.

use long long int…