• + 3 comments

    Try to use

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    

    to read the input. It has 100000 test cases so Scanner won't work