# DCP-154: Square Sum Difference Back to All Problems

Easy Math > Number Theory

The sum of squares of first 5 natural numbers is, **1²+2²+3²+4²+5²=55**. The square of the sum of first 5 natural numbers is, **(1+2+3+4+5)²=225**. The absolute difference between these two numbers are **170**. Find the difference between the sum of the squares of first **N** natural numbers and the square of their sum. Input: ------ First line contains **T(1≤T ≤10000)** denoting the number of test cases. The following **T** lines contain an integer **N (1 ≤ N ≤ 10000)**, Output: ------- Print the required answer for each test cases. Sample Input ------------ 2 10 500 Sample Output ------------- 2640 15645770750

### Problem Limits

 Language Time Limit (seconds) C 1.00 C++ 1.00 C++14 1.00 C# 3.00 Go 3.00 Java 3.00 JavaScript 3.00 Objective-C 3.00 Perl 3.00 PHP 3.00 Python 3.00 Python3 3.00 Ruby 3.00 VB.Net 3.00

# 373/657

Solve/Submission

### Ranking

# User Language Timing
01 MAHRahat Cpp14 0.00s
02 Mehedi07 Cpp14 0.00s
04 Koushik54 Cpp14 0.00s
05 afzalul Cpp14 0.00s
06 feodorv C 0.00s
07 FariD Cpp14 0.00s
08 Not_Found0001 Cpp 0.00s
09 kpretomazi Cpp 0.00s
10 abdulmukit Cpp 0.00s
11 mamun02inf Cpp 0.00s
12 ruhul_amin1122 Cpp 0.01s
13 t0whid Cpp 0.01s
14 muntasir10mu Cpp 0.01s
15 mahmud2690 Cpp 0.01s
16 Raju47 Cpp 0.01s
17 ashikvai Cpp 0.01s
18 KM_Muntasir Cpp 0.01s
19 souravahmed C 0.01s
20 milon019 Cpp 0.01s
21 Ruhul1975 Cpp 0.01s
22 Ratul23 Cpp 0.01s
23 Minhaj10 C 0.01s
24 exceptional_prapti Cpp 0.01s
25 Frdhsn C 0.01s
26 Rafiqul01 Cpp14 0.01s
27 Morass Cpp14 0.01s
28 Alnoman120113 C 0.01s
29 _dipu Cpp14 0.01s
31 joymollick Cpp14 0.01s
32 waqqas Cpp 0.01s
33 nazmul_bzs Cpp14 0.01s
34 n433m Cpp 0.01s
35 sojeeeeb Cpp 0.01s
36 sk_roy Cpp14 0.01s
37 SakibAlamin Cpp14 0.01s
39 Nazmul0092 Cpp14 0.01s
40 giash_uddin Cpp14 0.01s
41 hmtanbir Cpp14 0.01s
42 seyedssz Cpp14 0.01s
43 joy25896 Cpp14 0.01s
44 return_SS Cpp14 0.02s
45 alhelal_cse Cpp14 0.02s
46 ash12 Cpp14 0.02s
47 Alamgir_Hossain Cpp14 0.02s
48 terminator_c Cpp14 0.02s
49 golapraj Cpp14 0.02s
50 deder Cpp14 0.02s
Feedback