Problem list
Log in
#joi00151 · JOI 2019 Preliminary

ソーシャルゲーム (Social Game)

Bronze III 2.0 s 1024 MB

JOI 君は明日から新たにソーシャルゲームを始めることにした.

このソーシャルゲームでは, 1 日につき 1 回までログインすることができ,ログインするたびに A 枚のコインが得られる.

また,月曜日から日曜日まで 7 日連続でログインすると,そのたびに,追加で B 枚のコインが得られる.

これ以外にコインがもらえることはない.

明日は月曜日である.JOI 君が少なくとも C 枚のコインを得るためにログインしなければならない回数の最小値を求めよ.

Input

入力は以下の形式で標準入力から与えられる.

A B C

Output

JOI 君が少なくとも C 枚のコインを得るためにログインしなければならない回数の最小値を出力せよ.

Constraints

1 ≦ A ≦ 1000

0 ≦ B ≦ 1000

1 ≦ C ≦ 1000000 (= 10^6)

入力・出力

( 40 点) B = 0

( 60 点) 追加の制約はない.

Example 1

Input
3 0 10
Output
4

Example 2

Input
1 2 10
Output
8
Source
JOI 2019 Preliminary
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code