Problem H
Find the Summation
Input: standard input Output: standard output
Problem
Professor Edward is very angry with his students, because they have not completed his home task. As a result, he boycotts the classroom. Students realize their wrong. They go to the professor’s room and acknowledge their fault. Professor Edward give the students one condition : If they can find the summation of a series, then he will return to the classroom. The series is:
S=∑_(K=0)^N 〖(2K+6K^2)〗
You will be given N, find the summation of this series as soon as possible.
Input
The first line of input will contain an integer T(1<=T<=10)that will determine the number of test cases. Each case starts with one integer N(1<=N<=100).
Output
For each test case, output the line “Case #x: S“, where x is the number of the test case, S is the summation of the series.
Sample Input:
3
1
5
16

Sample Output:
Case #1: 8
Case #2: 360
Case #3: 9248

______________________________________________________________________________
Problem Setter: Forhad Ahmed, ACM ICPC World Finalist, 2012
Problem Setter: Forhad Ahmed, ACM ICPC World Finalist, 2012
Shahjalal University of Science and Technology (SUST)
Special Thanks: Mahfuzur Rahman
Special Thanks: Mahfuzur Rahman
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .