Problems
Jeong-ol decided to start a new RPG game starting today.
In this game, you can log in once a day, and you can get
Also, if you log in for 7 consecutive days from Monday to Sunday, you can get an additional
There is no other way to get coins.
Today is Monday.
Find the minimum number of times Jeong-ol must log in to get at least
Input
In the first line, three numbers
Output
Print the minimum number of logins required for Jeongol to obtain
Subtask
| # | Score | Condition |
|---|---|---|
| #1 | 40 | |
| #2 | 60 | No additional restrictions |
Example #1
3 0 10
4
You can earn 12 coins by logging in for 4 consecutive days starting from Monday.
Since you cannot earn 10 or more coins with 3 or fewer logins, the minimum number of logins required is 4.
Example #2
1 2 10
8
If you log in consecutively from Monday to Sunday, you can get 2 additional coins in addition to the 7 daily coins, for a total of 9 coins. Therefore, if you log in one more time, you can get 10 coins.
Since you cannot get 10 or more coins with 7 or fewer logins, the minimum number of times you must log in is 8.