Addition and Multiplication
Time limit1sMemory limit128 MB
For integers a < b, multiply the triangular numbers T(k)=1+2+...+k for k from a to b, and print the result modulo 14579.
- Level
Easy3 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Namgyu recently learned addition and multiplication. Dohyun doubts that he learned them properly, so he made up a problem.
Given two integers and with , compute the following value.
For every integer from to , take the sum of the integers from to , then multiply all of those sums together.
Namgyu cannot work this value out on his own. Write the program that computes it for him.
Input
The first line contains two integers and separated by a space. ()
Output
Print the value of the expression above. The result can get very large, so print it modulo .