Sum of products
Easy
Execution time limit is 3 seconds
Runtime memory usage limit is 64 megabytes
Given natural numbers (a), (b), and (n), your task is to compute the following sum of products:
[ a (a+1) ... (a+n-1) + (a+1) (a+2) ... (a+n) + ...+ b (b+1) ... (b+n-1) ]
Since the result can be extremely large, you need to find the remainder of this sum when divided by (1000000009).
Input
The input consists of a single line containing the natural numbers (a), (b), and (n) ((a b 10^18), (b-a 10^7), and (n 10^7)).
Output
Output the computed sum of products modulo (1000000009).
Examples
Input #1
Answer #1
Submissions 85
Acceptance rate 21%