Public submissions
Source code of every submission to this problem in this contest
will be visible for everyone since 20130826 12:38:07.
Submit  All submissions  Best solutions  Back to list 
SMPSUM  Iterated sums 
Please compute the sum of squares for the given numbers: a, a+1, ..., b1, b.
Input
Two numbers: a and b separated by space, where 1 <= a <= b <=100.
Output
Computed sum: a*a + (a+1)*(a+1) + ... + (b1)*(b1) + b*b
Example
Input: 1 4 Output: 30
Example 2
Input: 5 6 Output: 61
Added by:  kuszi 
Date:  20130826 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Public source code since:  20130826 12:38:07 
hide comments


20150622 05:05:15
very easy :D AC in 1st go :D 

20150329 01:26:17 kuszi
@rixx 25+36=61, what is wrong here? 

20150327 20:33:12 rixx
first example is ok but what is the second example calculation ?? 

20150125 13:10:46 Priyamthegreat
Very easy... Accepted in first go :D 

20141025 21:56:58 kuszi
@Amit Tapas 1 4 1*1 + 2*2 + 3*3 + 4*4 = 30 

20141024 13:29:30 Amit Tapas
the examples given are not clear.Pls explain the sum 

20140830 17:09:45 kuszi
@Adela Gao please name your main class "Main". There is a java corner at SPOJ forum. 

20140829 22:16:27 Adela Gao
My java file is working perfectly locally but it's impossible to compile online here 

20140116 22:56:09 kuszi
@Dennis Lee: Thank you! 

20140116 19:47:26 Dennis Lee
typo: squeres>squares grammar: SVA Compute the sum of squeres for a given numbers: a, a+1, ..., b1, b > Compute the sum of squares for the given numbers: a, a+1, ..., b1, b 