Here is the link of the question Boredom (Div 1)
and here is my implementation Ideone Link
Can you please spot the error? It is a very short code. Thanks
Your code is accepted now.
Check my submission. Just did slight modification in your code.
Actually you are using int and i*cnt[i]+arr[i-2] can exceed range of int so just replace int with long long and get Accepted.
1 Like