N Sequence (Keteki)
CodeChefOpen on judge ↗
For a given number n there is sequence 1,2,3...,n,n-1,n-2....,1. Print sum of square of each element in that sequence. Input First line of input has number T, the count of test cases. Each test has the number n on a newline. Output Print the required value of each test case, each on a newline. Constraints - 1 ≤ T ≤ 10 - 1 ≤ n ≤ 1000 Example Input: 1 2 Output: 6 Explanation Example
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start