Under construction

Still being built. Things may change

Light Bulb Game

Time limit1sMemory limit128 MB

Summary
Count the ways to pick m distinct switch-combinations over n bulbs (unordered as a set of turns) whose XOR sum turns on exactly the first v bulbs, modulo 10567201.
Level

Hard8 of 10

Topics
Combinatorics, Math, Bit manipulation
Solved
No attempts yet

Problem

Sanggeun has nn bulbs and nn switches. Each bulb is either on or off, and each switch is connected to one bulb. Pressing a switch flips the state of its bulb: pressing the switch of a bulb that is on turns it off, and pressing the switch of a bulb that is off turns it on. Initially every bulb is off. Sanggeun invented a game with these bulbs.

One turn consists of choosing a combination of switches and pressing exactly those switches. Choosing no switch at all is also a valid combination. After mm turns, the first vv bulbs must be on and all the others off. The game has one restriction: the same combination may not be used more than once.

Because the game is very easy, there are a great many ways to win, and Sanggeun wants to find them all. Write a program that computes how many winning ways there are in total.

Given two winning ways AA and BB, if AA can be turned into BB by suitably reordering its turns, they count as the same way.

For example, when n=4n=4, m=3m=3, v=2v=2, you can win by pressing 1, 2, 4 on the first turn, 1, 3 on the second turn, and 1, 3, 4 on the third turn. This way is the same as pressing 1, 3 on the first turn, 1, 2, 4 on the second turn, and 1, 3, 4 on the third turn.

Input

The input consists of several test cases, at most 500 of them. Each test case is a single line containing nn (1≤n≤10001 \le n \le 1000), mm (1≤m≤10001 \le m \le 1000), and vv (0≤v≤n0 \le v \le n). The last line contains 0 0 0.

Output

For each test case, print the number of ways to win the game modulo 1056720110567201.

Examples1

  1. Example 1

    Input
    3 3 1
    6 4 0
    6 4 3
    0 0 0
    
    Expected output
    7
    10416
    9920