# DCP-167: High school series Back to All Problems

Beginner Math > Basic Math

In high school we learned about various series and how to compute a formula for a series. In this problem we will apply that knowledge and compute the sum of a series up to n<sup>th</sup> term of that series. The series that we are going to consider is: 1<sup>3</sup> + 2<sup>3</sup> + 3<sup>3</sup> + 4<sup>3</sup> + 5<sup>3</sup> + ... + n<sup>3</sup> We have to find out the sum of this series up to n<sup>th</sup> item where n will be given as input in the program. You can always be sure that the end result will fit in 32 bit signed integer. Input: ------ Input starts with an integer **T (1 <= T <= 200)**, denoting the number of test cases. Each case contains an integer **N (1 ≤ N ≤ 300)** denoting the n<sup>th</sup> item up to which you have to calculate the sum. Output: ------- For each case of input, print the case number as "Case #:" and then print the sum of the n items of the series in a single line. *Please check sample input/output for better understanding of the format.* Sample Input ------------ 3 1 3 11 Sample Output ------------- Case 1: 1 Case 2: 36 Case 3: 4356

### 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

# 549/882

Solve/Submission

### Ranking

# User Language Timing
01 Ansarul_14 Cpp14 0.00s
02 sukanta Cpp14 0.00s
03 bafar Cpp14 0.00s
04 JubayerSohel Cpp14 0.00s
05 Sabyasachi Cpp14 0.00s
06 joy25896 Cpp14 0.00s
07 Brokenlog Cpp14 0.00s
08 emrul Cpp14 0.00s
09 Mehedi07 Cpp14 0.00s
10 Ashish972 Cpp14 0.00s
11 Alamgir_Hossain Cpp14 0.00s
12 Indro_BU Cpp14 0.00s
13 jayed_al_hasan Cpp14 0.00s
14 golapraj Cpp14 0.00s
15 iamramzan Cpp14 0.00s
16 seyedssz Cpp14 0.00s
17 rafsandevs Cpp14 0.00s
18 terminator_c Cpp14 0.00s
19 Sojal Cpp14 0.00s
20 rykamol Cpp14 0.00s
21 Avijeet Cpp14 0.00s
22 nurul_islam Cpp14 0.00s
23 m_rony Cpp14 0.00s
24 mamunrahaman Cpp14 0.00s
25 HM39 Cpp14 0.00s
26 Mr_KAJOL Cpp14 0.00s
27 giash_uddin Cpp14 0.00s
28 Core_i14 Cpp14 0.00s
29 atikhashmee Cpp14 0.00s
30 SakibAlamin Cpp14 0.00s
31 hidden139 Cpp14 0.00s
32 gsshanto Cpp14 0.00s
33 return_SS Cpp14 0.00s
34 Rakib05 Cpp14 0.00s
35 what Cpp14 0.00s
37 SHAHIDUL_VU_CSE Cpp14 0.00s
38 Saimum_140128 Cpp14 0.00s
39 shaeekh Cpp14 0.00s
40 rabiulrafi01 Cpp14 0.00s
41 afzalul Cpp14 0.00s
42 susmoys Cpp14 0.00s
43 lolcoder Cpp14 0.00s
44 Ruman_Hossain Cpp14 0.00s