11746. Sum the Series Problem code: SUMUP
for j in[1]*input():
s,a,b=0,1,3
for i in range(input()):s+=(b-a)/(b*a*2.0);a=b;b+=2*i+4
print"{0:.5f}".format(s)
for j in[1]*input():
s,a,b=0,1,3
for i in range(input()):s+=(b-a)/(b*a*2.0);a=b;b+=2*i+4
print"{0:.5f}".format(s)
No comments:
Post a Comment