Getting wrong answers in all cases

though my program runs correctly on custom test cases but it failed while submitting