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 Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

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

Problem Stats

510/821

Solve/Submission

Ranking

# User Language Timing
01 naim2711 Cpp14 0.00s
02 akib9ctg Cpp 0.00s
03 shawon100 Cpp 0.00s
04 CLown1331 Cpp14 0.00s
05 Core_i14 Cpp14 0.00s
06 Saimum_140128 Cpp14 0.00s
07 Alamgir_Hossain Cpp14 0.00s
08 shaeekh Cpp14 0.00s
09 Ruman_Hossain Cpp14 0.00s
10 emrul Cpp14 0.00s
11 raktim Cpp14 0.00s
12 Maruf1355 C 0.00s
13 atikhashmee Cpp14 0.00s
14 iamramzan Cpp14 0.00s
15 shishir09 Cpp14 0.00s
16 joy25896 Cpp14 0.00s
17 The_Viper Cpp 0.00s
18 rykamol Cpp14 0.00s
19 Sojal Cpp14 0.00s
20 non_coder C 0.00s
21 Brokenlog Cpp14 0.00s
22 pulak_ict_mbstu Cpp14 0.00s
23 AbirRahman Cpp14 0.00s
24 afzalul Cpp14 0.00s
25 giash_uddin Cpp14 0.00s
26 Sabyasachi Cpp14 0.00s
27 what Cpp14 0.00s
28 Reayz Cpp 0.00s
29 virus Cpp14 0.00s
30 mrinmoi Cpp14 0.00s
31 junayedmahmud Cpp14 0.00s
32 m_rony Cpp14 0.00s
33 Indro_BU Cpp14 0.00s
34 Tanvirh Cpp 0.00s
35 feodorv C 0.00s
36 Mr_KAJOL Cpp14 0.00s
37 Ansarul_14 Cpp14 0.00s
38 ranam_2030 Cpp14 0.00s
39 SHAHIDUL_VU_CSE Cpp14 0.00s
40 leenaiitju C 0.00s
41 bafar Cpp14 0.00s
42 JubayerSohel Cpp14 0.00s
43 seyedssz Cpp14 0.00s
44 Mehedi07 Cpp14 0.00s
45 nurul_islam Cpp14 0.00s
46 sukanta Cpp14 0.00s
47 return_SS Cpp14 0.00s
48 rafsandevs Cpp14 0.00s
49 susmoys Cpp14 0.00s
50 Momin_just Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support