Need Help With Atcoder solution

As you can see this solution of mine is giving WA’s on 4 of the test cases.
(https://atcoder.jp/contests/abc128/submissions/5769284)
Can anyone tell why?