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
hide comments
krish_47:
20181118 07:25:47
This problem can be solved in O(1) time . 

mohameda7maa:
20181004 08:33:49
a, b as input


nadstratosfer:
20180520 04:43:52
pintman: Not true, all input files contain exactly 2 spaceseparated numbers in a line. Got AC with a solution designed to crash if it was otherwise. Last edit: 20180520 04:44:43 

pintman:
20180519 08:49:30
It seems that input().split() (in python) results in three values for the first input but into two values for all others. Your input data may be not consistent. :( 

freborn:
20180323 16:56:13
AC in one go ! easy for a biginner :: 

lohithsai:
20171227 13:22:02
guys here it is very simple that given question is iterated sum just apply logic:


tranxuanbach:
20171112 01:30:19
I hope this help !


rushikeshkoli:
20170902 15:41:25
when a==b, it will simply output the square of either a or b. Last edit: 20170902 16:04:53 

sekhar21:
20170620 22:36:14
what will happen if a == b? 

udayraj_123:
20160613 21:37:09
@ryukerg You are right, deriving a formula is a way. 
Added by:  kuszi 
Date:  20130826 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 