Finding the problem is the first task based on the input, output format and exe file provided. Then think the logic and code the same.
The task in this problem is to print difference between sum of squares of n natural numbers and square of sum of n natural numbers, where n is number input by user.
After having number of test cases as input, each test is to be inputted and processed. Each test case contains a number (n). Sum of squares of numbers can be calculated by n(n+1)(2n+1)/6. Square of sum of n natural numbers can be calculated by (n(n+1)/2)^2
Author’s solution can be found here
Exe file for problem can be found here