P27248 [AtCoder] Social Game
普及
题目描述

Problem Description

JOI has decided to start a new social game from tomorrow.

In this social game, you can log in once per day, and each login gives you A coins.

Additionally, if you log in for 7 consecutive days from Monday to Sunday, you will receive an extra B coins each time.

There are no other ways to get coins.

Tomorrow is Monday. Find the minimum number of times JOI needs to log in to get at least C coins.

Input Format

The input is given from the standard input in the following format:

$ A $ $ B $ $ C $

Output Format

Output the minimum number of times JOI needs to log in to get at least C coins.

Sample Input and Output

Sample Input #1

3 0 10

Sample Output #1

4

Sample Input #2

1 2 10

Sample Output #2

8

Notes/Hints

Constraints

  • $1\ ≦\ A\ ≦\ 1000$
  • $0\ ≦\ B\ ≦\ 1000$
  • $1\ ≦\ C\ ≦\ 1000000\ (=\ 10^6)$

Subtasks

  1. ($ 40 $ points) $B\ =\ 0$
  2. ($ 60 $ points) No additional constraints.

Sample Explanation 1

  • Each login gives 3 coins, and you want to collect 10 coins.
  • JOI can log in for 4 consecutive days from Monday, which gives 12 coins.
  • It is not possible to get 10 or more coins with 3 or fewer logins, so the minimum number of logins JOI needs is 4. Therefore, output 4.

Sample Explanation 2

  • Each login gives 1 coin. Additionally, logging in for a week gives 2 extra coins. You want to collect 10 coins.
  • Logging in from Monday to Sunday gives 7 coins plus 2 extra coins, totaling 9 coins. Therefore, one more login is needed to get 10 coins.
  • It is not possible to get 10 or more coins with 7 or fewer logins, so the minimum number of logins JOI needs is 8. Therefore, output 8.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 0 10
样例输出
4