410277: GYM103999 F Basketball
Description
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.
InputThe 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.
OutputThe 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$$$
Scoring- for 30 points, we have $$$ 0 \le A, B \le 10$$$
- for another 20 points, we have $$$A = 0$$$ or $$$B = 0$$$
- for the last 50 points, we have $$$ 0 \le A, B \le 500$$$
2 5Output
6Note
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$$$