SubsetCheating

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Little Square and Little Triangle took a math test. Little Triangle didn’t study for the test, but, fortunately for him, Little Square, his best friend, succeeded in studying for the exam, so Little Triangle was able to copy parts of Little Square’s solutions on the test.

We know that the test had NN problems in total and that at each one of them Little Triangle’s score is not more than Little Square’s score. All scores are nonegative integers. We don’t know the exact score of any of them at any problem, but we know that in total Little Square has AA points while Little Triangle has BB points total.

Knowing NN (the number of problems that made up the math test), AA (the sum of the scores that Little Square got on the problems) and BB (Little Triangle’s sum of scores), we want to compute the number of ways in which the two of them could have been scored on the test, modulo 109+710^9 + 7.

입력

The sole line of standard input will contain tree nonnegative integers NN, AA and BB, separated by a single space, with the same meaning as explained above.

출력

The standard output will contain only one integer, representing the number of ways in which Little Square and Little Triangle could have been scored on the test, modulo 109+710^9 + 7.

제한

  • 1N1061 ≤ N ≤ 10^6
  • 0A,B1060 ≤ A, B ≤ 10^6
  • 22 ways of scoring are considered distinct (different) if Little Square or Little Triangle have a different number of points on at least one of the NN problems.

힌트

In the first example, we have N=2N = 2 problems on the math test. Little Square has A=3A = 3 points in total, while Little Triangle has B=2B = 2 points in total. From now on let P1P1 be the first problem, and P2P2 the second problem.

There are 66 distinct ways in which Little Square and Little Triangle could have scored on the test:

  • Little Square: 00 points - P1P1, 33 points - P2P2; Little Triangle: 00 points - P1P1, 22 points - P2P2
  • Little Square: 11 points - P1P1, 22 points - P2P2; Little Triangle: 00 points - P1P1, 22 points - P2P2
  • Little Square: 11 points - P1P1, 22 points - P2P2; Little Triangle: 11 points - P1P1, 11 points - P2P2
  • Little Square: 22 points - P1P1, 11 points - P2P2; Little Triangle: 22 points - P1P1, 00 points - P2P2
  • Little Square: 22 points - P1P1, 11 points - P2P2; Little Triangle: 11 points - P1P1, 11 points - P2P2
  • Little Square: 33 points - P1P1, 00 points - P2P2; Little Triangle: 22 points - P1P1, 00 points - P2P2