eolymp
bolt
Try our new interface for solving problems
Problems

Sum of squares

Sum of squares

For given integers n and m find the sum of squares of all integers, located between n and m inclusively. Print the answer modulo 109 + 9.

Input

Two integers n and m (-1017n, m1017).

Output

Print the sum of squares of all integers between n and m inclusively.

Time limit 1 second
Memory limit 122.17 MiB
Input example #1
1 1

Output example #1
1
Input example #2
2 -2


Output example #2
10
Author Temuri Zarqua
Source Sevastopol Summer School 2013, Wave 1, Day 4