Need help in atcoder abc 139 E problem

Why my code is getting a TLE :
problem link : E - League
my solution : https://atcoder.jp/contests/abc139/submissions/7286383