SMPSUM - Iterated sums
Please compute the sum of squares for the given numbers: a, a+1, ..., b-1, b.
Input
Two numbers: a and b separated by space, where 1 <= a <= b <=100.
Output
Computed sum: a*a + (a+1)*(a+1) + ... + (b-1)*(b-1) + b*b
Example
Input: 1 4 Output: 30
Example 2
Input: 5 6 Output: 61
Added by: | kuszi |
Date: | 2013-08-26 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |