FMI No Stress 11 |
---|
Finished |
In Scundu, two boys were playing basketball. They are not very good at the game, so they got bored and decided to rest on a bench. While sitting there, they wondered: if a game of basketball ends with the score $$$A$$$ and $$$B$$$, where $$$A$$$ is the score of the first team and $$$B$$$ is the score of the second team, in how many ways can this score be obtained? Because they are not very good at programming either, they need your help to find out.
In Scundu, the basketball rules are the following: depending on the striking distance, each team can get either 2 or 3 points for introducing the ball in the basket. Because scundenians are superior people, we consider that faults will never occur.
The input contains two integers $$$A$$$ and $$$B$$$ ($$$ 0 \le A, B \le 500$$$ ), where $$$A$$$ is the score of the first team and $$$B$$$ is the score of the second team.
The output contains one integer $$$X$$$, the number of ways that score can be obtained. Because the number of ways can be very big, the number of ways should be printed modulo $$$1.000.000.007$$$
2 5
6
The ways we can obtain the score are the following:
$$$0$$$ to $$$0$$$ -> $$$2$$$ to $$$0$$$ -> $$$2$$$ to $$$3$$$ -> $$$2$$$ to $$$5$$$
$$$0$$$ to $$$0$$$ -> $$$2$$$ to $$$0$$$ -> $$$2$$$ to $$$2$$$ -> $$$2$$$ to $$$5$$$
$$$0$$$ to $$$0$$$ -> $$$0$$$ to $$$3$$$ -> $$$2$$$ to $$$3$$$ -> $$$2$$$ to $$$5$$$
$$$0$$$ to $$$0$$$ -> $$$0$$$ to $$$3$$$ -> $$$0$$$ to $$$5$$$ -> $$$2$$$ to $$$5$$$
$$$0$$$ to $$$0$$$ -> $$$0$$$ to $$$2$$$ -> $$$2$$$ to $$$2$$$ -> $$$2$$$ to $$$5$$$
$$$0$$$ to $$$0$$$ -> $$$0$$$ to $$$2$$$ -> $$$0$$$ to $$$5$$$ -> $$$2$$$ to $$$5$$$
Name |
---|