10302 - Summation of Polynomials


Difficulty : easy

Solution Description :
Simple math

problem description not need you need only
1 + 8 + 27 + ... + x^3

i.e 1^3+2^3+3^3 +...........+x^3
fx3[1] = 1
fx3[2] = 1 + 8 = 9
fx3[3] = 9 + 27 = 36

so. fx3[n] = fx3[n-1] + n^3
Pregenerate all term for i=1 to 500000

input n
print fx3[n]

use long double as data type in c++