Editorial for Ауыспалы сумма


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 1.

n өте үлкен болуы мүмкін, сондықтан барлық мүшелерді бір-бірлеп есептеу тиімсіз.

Hint 2.

Өрнектегі мүшелерді жұптап қарастыруға болады:
\(1^2 - 2^2\), \(3^2 - 4^2\), \(5^2 - 6^2\) және т.с.с.

Hint 3.

Әр жұпты ықшамдауға болады:
\((2k - 1)^2 - (2k)^2\)
Осы айырмалардың қандай заңдылықпен өзгеретінін байқап көріңіз.