Help in Light OJ 1301
In Light OJ1301 what is the simplest idea to solve it ? My code here . It got TLE . I know the approach is wrong but can't figure it out. Please anyone help.
Atcoder ABC #351 Short Solution Discussion
Codeforces Round 941 (Div 1 + 2) Solution Discussion (with Jan)