1 #include<stdio.h>
2 int bx,by;
3 int hx,hy;
4 float dp[50][50];
5 float pro;
6 int main()
7 {
8 freopen("a.txt","r",stdin);
9 int i,j;
10 while(scanf("%d%d%d%d",&bx,&by,&hx,&hy)==4)
11 {
12 pro=1;
13
14 for(i=0;i<=by;i++)
15 for(j=0;j<=bx;j++)
16 {
17 dp[i][j]=1;
18 }
19 printf("%d %d\n",hx,hy);
20 for(j=0;j<=bx+1;j++)
21 dp[by+1][j]=-1;
22 for(j=0;j<=by+1;j++)
23 dp[j][bx+1]=-1;
24 dp[hx-2][hy+1]=dp[hx-1][hy+2]=dp[hx][hy]=dp[hx+1][hy+2]=dp[hx+2][hy+1]=dp[hx-2][hy-1]=dp[hx-1][hy-2]=dp[hx+1][hy-2]=dp[hx+2][hy-1]=-1;
25 printf("%.0f\n",dp[hx-1][hy-2]);
26 printf("%d %d\n",hx-1,hy-2);
27 /* for(i=0;i<=by;i++)
28 for(j=0;j<=bx;j++)
29 {
30 if(dp[i][j]==-1)
31 break;
32 if(dp[i+1][j]!=-1&&dp[i][j+1]!=-1)
33 dp[i][j]=2;
34 if((dp[i+1][j]!=-1&&dp[i][j+1]==-1)||(dp[i][j+1]!=-1&&dp[i+1][j]==-1))
35 dp[i][j]=1;
36 if(dp[i+1][j]==-1&&dp[i][j+1]==-1)
37 dp[i][j]=0.5;
38 pro*=dp[i][j];
39 printf("dp[%d][%d]=%.0f\n",i,j,dp[i][j]);
40
41 }
42 printf("%.0f\n",pro); */
43 for(i=0;i<=by+1;i++)
44 {
45 printf("\n");
46 for(j=0;j<=bx+1;j++)
47 printf("%-4d",dp[i][j]);
48 }
49 }
50 return 0;
51 }
52
53