electicode
Bosh sahifaKurslarResurslarMasalalarMilliy olimpiadaMusobaqalarReyting
...

Bouquet

Vaqt limiti: 1000msXotira limiti: 256MB
Barcha yechimlar

Masala tavsifi

Somon has nnn types of flowers, one of each. He is going to choose one or more of these flowers to make a bouquet. However, she does not like two numbers aaa and bbb, so the number of flowers in the bouquet cannot be equal to aaa or bbb. How many different bouquets can Somon make? Find the number of bouquets modulo (109+7)(10^9+7)(109+7). Here, two bouquets are considered different if there is a flower that is used in one bouquet but absent in the other.

Input Format

The only line of the input contains three integers nnn, aaa and bbb (2≤n≤109,1≤a<b≤min⁡(n,2×105))(2 \le n \le 10^9, 1 \le a < b \le \min(n, 2 \times 10^5))(2≤n≤109,.

Output Format

Print a single number --- the answer to the problem modulo (109+7)(10^9+7)(109+7).

Misollar

Misol 1
Kirish
4 1 3
Chiqish
7
Misol 2
Kirish
1000000000 141421 173205
Chiqish
34076506

© 2026 Electicode. All rights reserved.

1
≤
a<
b≤
min(n,2×
105))