Juca dreams of retiring and spending the rest of his life peacefully. He calculated that he needs to have at least $$$R$$$ thousand reais. Juca has a variable income job, and at the end of each year, he receives a payment that varies from $$$1$$$ to $$$R$$$ thousand reais, with uniform probability.
If, after receiving his salary, his total income is $$$R$$$ thousand reais or more, he retires happily. Otherwise, he decides to adjust his income according to inflation:
Juca is curious to know the expected value of the number of years it will take for him to retire. It can be shown that the answer is a fraction $$$\frac{p}{q}$$$ with $$$gcd(p,q) = 1$$$. Print $$$p \cdot q^{-1} \mod (10^9 + 7)$$$.
The input consists of three integers $$$R$$$, $$$a$$$, and $$$b$$$ in that order. It is guaranteed that $$$1 \leq R \leq 500$$$ and $$$0 \leq a \lt b \leq 1000 $$$.
It can be shown that the answer is a fraction $$$\frac{p}{q}$$$ with $$$gcd(p,q) = 1$$$. Print $$$p \cdot q^{-1} \mod (10^9 + 7)$$$.
1 0 1
1
2 1 2
2
500 1 2
699460048
500 0 1
830988645
"Reais" is Brazil's currency (BRL).
| Name |
|---|


