Editorial for Tổ ong


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

HINT

Gọi \(a[i]\) là số ô mang giá trị \(i\) ta dễ dàng nhận thấy với \(n > 0\) thì \(a[n] = a[n-1] + 6\)

Từ đó ta có tổng số ô bé hơn hoặc bằng \(n\) sẽ bằng:\(a[0]+a[1]+a[2]+a[3]+...+a[n]=1+a[1]+a[1] * 2+a[1]*3+...+a[1]*n=6*n(1+n)/2+1=3n(1+n)+1\)



Comments

There are no comments at the moment.