#P8780. Days to Reach Target Problems

    ID: 21944 Type: Default 1000ms 256MiB

Days to Reach Target Problems

Days to Reach Target Problems

Xiaoming has decided to start preparing for the Lanqiao Cup competition by solving problems starting next Monday. His plan is to solve \(a\) problems on each weekday (Monday to Friday) and \(b\) problems on each weekend day (Saturday and Sunday). Given the target \(n\) problems, determine on which day (starting from the upcoming Monday as day 1) the total number of solved problems will be greater than or equal to \(n\).

Note: The days are counted consecutively. For example, day 1 is Monday, day 2 is Tuesday, ..., day 7 is Sunday, day 8 is the next Monday, and so on.

inputFormat

The input consists of three integers \(a, b, n\) separated by spaces.

  • \(a\): the number of problems solved on each weekday (Monday to Friday)
  • \(b\): the number of problems solved on each weekend day (Saturday and Sunday)
  • \(n\): the target total number of problems

outputFormat

Output a single integer representing the day (starting from the upcoming Monday as day 1) on which the total number of solved problems will be greater than or equal to \(n\).

sample

2 3 2
1