/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package listaexercicios;

/**
 *
 * @author awolf
 */
public class Questao8 {

    public static void main(String[] args) {
        int lin = Entrada.leiaInt("Linha");
        while (lin < 1 || lin > 10) {
            System.out.println("Linha inválida");
            lin = Entrada.leiaInt("Linha");
        }

        int col = Entrada.leiaInt("Coluna");
        while (col < 1 || col > 10) {
            System.out.println("Coluna inválida");
            col = Entrada.leiaInt("Coluna");
        }

        if (lin >= 1 && lin <= 3 && col >= 1 && col <= 2) {
            System.out.println("Quadrante 1");
        } else if (lin >= 3 && lin <= 4 && col >= 1 && col <= 8
                || lin >= 5 && lin <= 7 && col >= 2 && col <= 5
                || (col == 5 && (lin == 5 || lin == 6))
                || lin == 5 && col == 6) {
            System.out.println("Quadrante 2");
        } else if (lin >= 5 && lin <= 8 && col == 1) {
            System.out.println("Quadrante 3");
        } else if (lin >= 9 && lin <= 10 && col >= 1 & col <= 7
                || lin >= 6 && lin <= 7 && col >= 6 && col <= 8
                || lin == 8 && col >= 1 && col <= 7
                || lin == 7 && col == 5) {
            System.out.println("Quadrante 4");
        } else if (lin >= 6 & lin <= 10 && col >= 8 && col <= 10) {
            System.out.println("Quadrante 6");
        } else {
            System.out.println("Quadrante 5");
        }
    }
}
