Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

2195.   2006 World Cup
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 905   Accepted Runs: 208

The 2006 FIFA World Cup Final was held in Berlin, Germany on July 9th, 2006, with France against Italy. Both France and Italy are the conquerors of the European soccer field. Soccer fans from all over the world came to Berlin Olympic Stadium to celebrate this world's biggest soccer party. In front of the ticket booth outside the stadium, we observed something interesting:

The ticket for the final match costs $50. There are m fans in the line having only $50 bill and n fans having only $100 bill. The ticket booth does not hold any changes. Please calculate in how many ways can these (m+n) soccer fans all get their tickets without the ticket booth running out of changes.


Every pair of data consists of two non-negative integers m, n(not exceed 300), separated by a space. The last line of the input is a line containing two zeros.


For every pair of data, output the number of ways the fans could line up.

Sample Input

1 1
1 2
3 0
0 0

Sample Output



We assume no difference between fans other than the type of bills they hold. For example, in Sample 3, there is only one way for three people to line up if all of them have $50 bill.

Author: Wtommy

Source: TOJ 2006 Weekly Contest 4
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz