1343: 骑士游历
Memory Limit:128 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:498
Solved:174
Description
设有一个n*m的棋盘(2≤n≤25,2≤m≤25,n是行,m是列),如下图,在棋盘上有一个中国象棋马。
规定:
1)马只能走日字
2)马只能向右跳
问给定起点x1,y1和终点x2,y2,求出马从x1,y1出发到x2,y2的合法路径条数。
Input
第一行2个整数n和m
第二行4个整数x1,y1,x2,y2
Output
输出方案数
Sample Input Copy
25 25
1 15 3 15
Sample Output Copy
2
HINT
2<=n,m<=25