import java.util.*; import static java.lang.Math.*; public class ppp { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); boolean ue[][]=new boolean[n][m]; boolean sita[][]=new boolean[n][m]; boolean hidari[][]=new boolean[n][m]; boolean migi[][]=new boolean[n][m]; boolean map[][]=new boolean[n][m]; int sum=0; for(int i=0;i0){ int y=nowy+dy[d%4]; int x=nowx+dx[d%4]; if(!(0<=x && x