An EZ Walking Problem
這是一個簡單的走路問題。
給一個 的網格圖, Kirby 一開始在 ,它一次可以往上下左右分別走不超過 步(至少要走一步才算一次移動),一共會移動 次,請問能使 Kirby 最後停在 的方法數為多少?
(如果走到沒有辦法在移動了,但沒有走完 次,不會算有走到 )
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Intput
第一行有兩個正整數 ,表示網格圖的大小和要走幾次
第二行有四個非負整數 ,表示你一次最多可以往上下左右走多少步
Ouput
輸出一個非負整數。由於答案可能會很大,請輸出 後的結果
Subtask
本題共有五組子任務,條件限制如下所示。
子任務 |
分數 |
額外輸入限制 |
1 |
10 |
, , |
2 |
13 |
|
3 |
19 |
|
4 |
22 |
|
5 |
36 |
無額外限制 |
Note
Zhu is very cute