Berland Beauty — test case 271 TLE !
Can anyone explain how can I improve submission link..
Codeforces Round 1123 Solution Discussion