F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

N Knight

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 552    Accepted Submission(s): 185


Problem Description
Today, chess is one of the world's most popular games, played by millions of people worldwide at home, in clubs, online, by correspondence, and in tournaments.

Chess is played on a square board of eight rows and eight columns and denoted with letters a to h of squares. The colors of the sixty-four squares alternate and are referred to as "light squares" and "dark squares". The chessboard is placed with a light square at the right hand end of the rank nearest to each player, and the pieces are set out as shown in the diagram, with each queen on its own color.

The pieces are divided, by convention, into white and black sets. The players are referred to as "White" and "Black", and each begins the game with sixteen pieces of the specified color. These consist of one king, one queen, two rooks, two bishops, two knights and eight pawns.

Now we have another way to play with the chessboard. Give you a N*N chessboard, and ask you to place N knights on it. But the knights can’t attack each other (one knight can attack other chessman in the same row or in the column). And what’s more, no more than M knights are permissible to put on the reverse diagonal (the black grids as following picture). Now ask you how many different ways you can place this N Knight.
 

Input
Input contains multiple cases each presented on a separate line. Each line contains two integer numbers N,M(1<=N<=1000,0<=M<=N).
 

Output
For each test case, your program should output the answer mod 20090818.
 

Sample Input
1 1
 

Sample Output
1
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-03-29 23:16:59, Gzip enabled