CSES - BOI 2016, day 1 - Instructions Submission

You must submit the source code of your program, unless otherwise stated. Your code will be compiled and tested, and you will see full test results.

The tests are grouped into test groups, and you will get the score of a test group if all tests inside the group are accepted.

You can submit several solutions to a task, and the maximum score of a submission will be your final score for the task.


Time and memory limits for the tasks are given in task statements.

The maximum size for the source code is 128 kB.


Your program must read from the standard input and write to the standard output, unless otherwise stated.

In C++, you can use the following code for more efficient I/O:
In Java, you can use the class IO.java for efficient I/O. The class will be compiled with your program on the server.

Here is an example how to use IO.java:
public class Solution {
    public static void main(String[] args) {
        IO io = new IO();
        int a = io.nextInt();
        int b = io.nextInt();
    io.close(); // ALWAYS CALL THIS

The C++ compiler is g++ 4.8.4. Compiler flags are -std=c++11 -O2 -Wall.

The Java compiler is Oracle javac 1.8.0_74.

The Pascal compiler is Free Pascal Compiler version 2.6.2. Compiler flags are -O2.