单点时限: 2.0 sec
内存限制: 256 MB
Are you tired of city life? Have you ever had illusions of pastoral peace? The clean atmosphere, the closeness to nature and the gentle pace of living, all made Setsuna yearn for the pastoral life more.
In order to experience the simple pastoral life, Setsuna has moved to Star Valley and started her farming journey.
Soon, she discovers the problem: overgrown weeds are harming her farm. In Chinese, we call it “Sheng Cao”. She realized that weeding should be put at the top priority.
The farm can be described as an
Setsuna will use mower
Setsuna wonders how many units of weed she will remove.
The answer might be very large, so please output the desired answer modulo
The first line contains three integers
The next
The
It is guaranteed that
Output one integer indicating the answer modulo
2 2 3 1 2 3 4 r 1 5 c 2 6 r 1 7
45
3 4 1 1 2 3 4 5 6 7 8 9 10 11 12 r 1 1000000000000000000
172998509
Sample
At the end of moment
At the end of moment
At the end of moment
At the end of moment
So the answer is