#P53. [KBC004E] Sum 2
[KBC004E] Sum 2
Source
This problem is adapted from Long Long OJ. All rights reserved.
Attention
The time limit for this problem is 0.1 seconds, and the memory limit is 8 MB.
Problem Description
Little A has numerous triples where the values are in the range , and each triple is non-decreasing.
Little A lists all such triples without repetition or omission, and now he wants to ask you: what is the sum of all the numbers in these triples?
Please note that the output result should be taken modulo .
Input Format
Input a single integer .
Output Format
Output the sum of all numbers in the triples modulo .
Samples
3
60
100000
493051141
Sample 1 Explanation
The valid triples are $(1,1,1),(1,1,2),(1,1,3),(1,2,2),(1,2,3),(1,3,3),(2,2,2),(2,2,3),(2,3,3),(3,3,3)$, and the sum of all numbers in these triples is .
Data Range
For of the data, .