F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Calculate the formula

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 12944    Accepted Submission(s): 3994


Problem Description
You just need to calculate the sum of the formula: 1^2+3^2+5^2+¡­¡­+ n ^2.
 

Input
In each case, there is an odd positive integer n.
 

Output
Print the sum. Make sure the sum will not exceed 2^31-1
 

Sample Input
3
 

Sample Output
10
 

Author
wangye
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-24 04:14:09, Gzip enabled