[Timus] 2012 About Grisha N.

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

public void solve(int testNumber, InputReader in, OutputWriter out) {
        // given.
        int totalProblems = 12;
        int maxHrs = 5;

        int f = in.nextInt();

        int remainingProblems = totalProblems - f;

        int timeReqd = remainingProblems * 45;

        if (timeReqd <= 60 * (maxHrs - 1)) {
            out.println("YES");
        } else {
            out.println("NO");
        }
    }

 

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.