Comments

Sorry, my bad. It is the correct formula, even if a0 is negative.

In E, they used the following formula to calculate the first t terms of an arithmetic series: ~~~~~ int ut = (u + (u — t + 1)) * t / 2; ~~~~~ But it is wrong because u-t+1 might be negative, and in that case, the standard formula doesn't work, but why does it pass the test cases?

What is the level of complexity of problem E in terms of rating? Is it like the 1600 problem?