Hint
Tutorial
Bonus: solve for every $$$k$$$ from $$$1$$$ to $$$n$$$ for $$$n \le 10^5$$$.
Hint 1
Hint 2
Tutorial
Hint 1
Hint 2
Hint 3
Tutorial
Bonus: solve for when $$$a_i$$$ can also be negative.
Hint 1
Hint 2
Hint 3
Hint 4
Tutorial
Bonus: solve for every $$$k$$$ from $$$1$$$ to $$$n$$$.
[problem:1712E]
Hint
Tutorial
Hint
Tutorial
Bonus: solve for $$$n, q \le 10^6$$$.
Don't forget to rate the problems!
Problem Feedback
PS: Solution codes probably will be added later
PPS: I will post the answers to the problem references a bit later! Try to guess them if you haven't already.