CF306C.White, Black and White Again

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Polycarpus is sure that his life fits the description: "first there is a white stripe, then a black one, then a white one again". So, Polycarpus is sure that this rule is going to fulfill during the next nn days. Polycarpus knows that he is in for ww good events and bb not-so-good events. At least one event is going to take place during each day. As each day is unequivocally characterizes as a part of a white or a black stripe, then each day is going to have events of the same type only (ether good or not-so-good).

What is the number of distinct ways this scenario can develop over the next nn days if Polycarpus is in for a white stripe (a stripe that has good events only, the stripe's length is at least 1 day), the a black stripe (a stripe that has not-so-good events only, the stripe's length is at least 1 day) and a white stripe again (a stripe that has good events only, the stripe's length is at least 1 day). Each of nn days will belong to one of the three stripes only.

Note that even the events of the same type are distinct from each other. Even if some events occur on the same day, they go in some order (there are no simultaneous events).

Write a code that prints the number of possible configurations to sort the events into days. See the samples for clarifications on which scenarios should be considered distinct. Print the answer modulo 10000000091000000009 (109+9)(10^{9}+9) .

输入格式

The single line of the input contains integers nn , ww and bb ( 3<=n<=40003<=n<=4000 , 2<=w<=40002<=w<=4000 , 1<=b<=40001<=b<=4000 ) — the number of days, the number of good events and the number of not-so-good events. It is guaranteed that w+b>=nw+b>=n .

输出格式

Print the required number of ways modulo 10000000091000000009 (109+9)(10^{9}+9) .

输入输出样例

  • 输入#1

    3 2 1
    

    输出#1

    2
    
  • 输入#2

    4 2 2
    

    输出#2

    4
    
  • 输入#3

    3 2 2
    

    输出#3

    4
    

说明/提示

We'll represent the good events by numbers starting from 1 and the not-so-good events — by letters starting from 'a'. Vertical lines separate days.

In the first sample the possible ways are: "1|a|2" and "2|a|1". In the second sample the possible ways are: "1|a|b|2", "2|a|b|1", "1|b|a|2" and "2|b|a|1". In the third sample the possible ways are: "1|ab|2", "2|ab|1", "1|ba|2" and "2|ba|1".

首页