Super Poker

I have a set of super poker cards, consisting of an infinite number of cards. For each positive integer p, there are exactly four cards whose value is p: Spade(S), Heart(H), Club(C) and Diamond(D). There are no cards of other values. Given two positive integers n and k, how many ways can you pick up at most k cards whose values sumton? Forexample,ifn=15andk=3,onewayis3H+4S+8H,shownbelow: Input Therewillbeatmost20testcases,eachwithtwointegersnandk(1≤n≤109,1≤k≤10). The input is terminated by n = k = 0. Output For each test case, print the number of ways, modulo 1,000,000,009. Sample Input 21 22 23 50 5 00 Sample Output 4 10 10 1823966