[Timus] Workdays

The problem statement is here: http://acm.timus.ru/problem.aspx?space=1&num=1264

Pretty straightforward problem. One thing to note that you should use long instead of int as for the max N and max M the result won’t be in the int range.

package codes;

import FastIO.InputReader;
import FastIO.OutputWriter;

public class Task1264 {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        long n = in.nextLong();
        long m = in.nextLong();

        long res = n*(m+1);
        out.println(res);
    }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.