CSPC '15 #2 - Build Season

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Wylie Coyote is trying to calculate how many hours it takes the Crescent School robotics team to build their robot. Team 610 (Crescent's robotics team) builds a robot in a six-week period between January and February, with each week numbered from 1 \dots 6. During this time, they have a very rigorous schedule, and they work different hours on weekends and weekdays.

Since there's no pressure, they only begin working on weekends after week W, after which they will work H hours each weekend. Apart from the weekend, they work N hours every week.

Your task is to write a program that calculates how many hours it takes for them to build their robot, which is completed on week 6.

Input Specification

The input will consist of 2 or 3 positive integers.

The first line will contain the single integer N. The second line will contain the week W on which Team 610 begins working weekends, inclusive (0 \le W \le 6). If W = 0, Team 610 does not work weekends. If W > 0, the third line of input will contain the integer H.

Output Specification

The output should be: It takes X hours for Team 610 build a robot., where X is the number of hours they worked.

Sample Input

2
3
2

Sample Output

It takes 20 hours for Team 610 build a robot.

Explanation

They work 2 hours each week for weeks 1 and 2. Then, they work 2 hours a week and 2 hours per weekend for weeks 3, 4, 5 and 6. In total, they work 20 hours.


Comments


  • 5
    CanadianGator  commented on Nov. 3, 2015, 8:36 p.m.

    If output is:

    "It takes (x) hours for Team 610 **to** build a robot"

    You always get WA.


    • -3
      bobhob314  commented on Nov. 3, 2015, 10:57 p.m.

      Judges tend to be very strict about wording. Gorav is a hardworking individual who has made some grammatical errors, as we all find ourselves doing from time to time. Please respect his problems.


  • 2
    GHETTO  commented on Feb. 27, 2015, 6:58 p.m.

    Problem statement states that they work from week 1 ... 6, but the input is 0 ... 6 inclusive?


    • 0
      iCode  commented on Feb. 21, 2022, 12:27 a.m. edited

      The input for W can be 0 since if W = 0, Team 610 does not work on the weekends.