import java.io.BufferedReader; import java.io.IOException; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.Reader; import java.util.Scanner; /** * * @author cteam20 */ public class ith { public static boolean next = true; static Scanner sc = new Scanner(System.in); static int pocetDam = 0; static int X; static int Y; static String cti(){ byte[] pole = new byte[50]; String nacteno; int i; try { System.in.read(pole); nacteno = new String(pole).trim(); return nacteno; } catch (IOException ex){ return "0 0 0"; } } /** * @param args the command line arguments */ public static void main(String[] args) { try { String[] line = cti().split(" "); X = Integer.valueOf(line[0]); Y = Integer.valueOf(line[1]); pocetDam = Integer.valueOf(line[2]); do { boolean[][] souradnice = new boolean[X+1][Y+1]; int x = 0,y = 0; for (int i = 0;i 1) && (y>1) && (!konec)) { x--; y--; if (souradnice[x][y]){ konec = true; } } x = l; y = k; while (y>1 && !konec && x< X ){ x++; y--; if (souradnice[x][y]){ konec = true; } } x = l; y = k; while (x>1 && !konec && y < Y){ x--; y++; if (souradnice[x][y]){ konec = true; } } x = l; y = k; while ( !konec && x< X && y < Y){ x++; y++; if (souradnice[x][y]){ konec = true; } } if (!konec){ pocetReseni++; }else { } } } System.out.println(""+pocetReseni); line = cti().split(" "); X = Integer.valueOf(line[0]); Y = Integer.valueOf(line[1]); pocetDam = Integer.valueOf(line[2]); if (X == 0 && Y ==0 && pocetDam == 0){ next=false; } } while (next); }catch (Exception ex){ ; } } }