Solution for CCC '17 J1 - Quadrant Selection in Java 8


Nov. 5, 2019 2.702261 seconds Java 8
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        
        if(a > 0 && b > 0){
            System.out.println("1");
        }else if(a > 0 && b < 0){
            System.out.println("4");
        }else if(a < 0 && b > 0){
            System.out.println("2");
        }else if(a < 0 && b < 0){
            System.out.println("3");
        }
    }
}

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.