3416 - F - Football Statistics

Created by Luis Manuel Díaz Barón
Added by luismo (2015-11-23)
Limits
Total Time: 3000 MS | Test Time: 1000 MS |Memory: 512 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

Football is the most popular game in the world. Two teams of N players face each other in the field and the main purpose of a team is to score goals against the other. The team with more goals is considered a winner. If both teams score the same amount of goal, then the game ends in a tie. We call a game homogeneous if all goals in each team are scored by the same player. 

Given the number of players per team and the final score, can you calculate the number of possible non-homogeneous games? Note that by definition a game with final score 0-0 is considered non-homogeneous.

El fútbol es el juego más popular en el mundo. Dos equipos de N jugadores se enfrentan en el campo, donde el objetivo principal de un equipo es anotarle goles al equipo contrario. El equipo que anota la mayor cantidad de goles se considera el ganador. Si ambos equipos anotan la misma cantidad de goles, entonces el juego termina en empate. Se define un juego homogéneo si todos los goles en cada equipo son anotados por el mismo jugador.

Dado el número de jugadores por equipo y el marcador final, ¿puedes calcular el número de juegos no homogéneos posibles;jsessionid=DBD7DF483F1DA0EEAB90DF7816642AB3? Tenga en cuenta que, por definición, un juego con marcador final 0-0 se considera no homogéneo.

Football is the most popular game in the world. Two teams of N players face each other in the field and the main purpose of a team is to score goals against the other. The team with more goals is considered a winner. If both teams score the same amount of goal, then the game ends in a tie. We call a game homogeneous if all goals in each team are scored by the same player. 

Given the number of players per team and the final score, can you calculate the number of possible non-homogeneous games? Note that by definition a game with final score 0-0 is considered non-homogeneous.

Input specification

There may be several test cases in the input, but no more than 105. For each case, there is a single line containing three space-separated integers N, A, and B (1 N 106, 0 A, B 106), representing the number of players per team and the amount of goals scored by team A and team B, respectively.

La entrada puede contener varios casos de entrada, pero no más de 105 casos. Para cada caso, existe una línea que contiene tres enteros separados por un espacio N, A, and B (1 N 106, 0 A, B 106), que representan el número de jugadores por equipo y el número de goles anotados por los equipos A y B respectivamente.

There may be several test cases in the input, but no more than 105. For each case, there is a single line containing three space-separated integers N, A, and B (1 N 106, 0 A, B 106), representing the number of players per team and the amount of goals scored by team A and team B, respectively.

Output specification

A single line per case containing the answer. Print the value modulo 1000000007.
La salida contiene una línea para cada caso con la respuesta. Imprima el valor módulo 1000000007.

There may be several test cases in the input, but no more than 105. For each case, there is a single line containing three space-separated integers N, A, and B (1 N 106, 0 A, B 106), representing the number of players per team and the amount of goals scored by team A and team B, respectively.

Sample input

3 2 1
3 4 3

Sample output

18
2178

Hint(s)

http://coj.uci.cu/contest/
http://coj.uci.cu/contest/
http://coj.uci.cu/contest/