1. 

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem 530 - Binomial Showdown
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=471
* @author Miesel Christoph
* @author Seilbeck Robert
* @author Wolfram Andre
* @version 1.0 01.06.2009
*
* Status : Accepted
* Runtime: 0.104
*/

import java.util.Scanner;

public class Main
{
public static void main(String... args)
{
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long k = sc.nextLong();
while(true)
{
if(n == 0 && k == 0)
break;
long res = 1;
long differenz = 0;
long knight;
int counter = 0;
int destroy = 1;
// k wird herausgekürzt
if(n-k >= k)
{
differenz = n-2*k+1;
knight = n-k-differenz+1;
for(long i = k + differenz; i<=n; i++)
{
counter++;
if(counter >5 && destroy <= knight)
{
res /= destroy;
destroy++;
}
res *= i;
}
for(int i = destroy; i<=knight; i++)
res /= i;

}
// n-k wird herausgekürzt
else
{
differenz = k - (n-k) + 1;
knight = k-differenz + 1;

for(long i = n-k+differenz; i<=n; i++)
{
counter++;
if(counter > 5 && destroy <= knight)
{
res /= destroy;
destroy++;
}
res *= i;
}
for(int i = destroy; i<=knight; i++)
res /= i;


}
System.out.println(res);

counter = 0;
destroy = 1;
res = 1;
n = sc.nextLong();
k = sc.nextLong();
}
}
}