My Logic is correct and showing up for sample test cases but Still Wrong Submission

https://codeforces.com/problemset/problem/1446/A