Problem:

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

 問題文

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

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

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

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

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

 制約

1 ≦ A ≦ 1000

0 ≦ B ≦ 1000

1 ≦ C ≦ 1000000 (= 10^6)

  入力・出力

入力

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

A B C

出力

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

40 点) B = 0

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

-->

 入出力例

入力例 1

3 0 10

出力例 1

4

1 回のログインあたり 3 枚のコインが得られ，10 枚のコインを集めたい．

JOI 君は，月曜日から連続 4 日間ログインすることで 12 枚のコインが得られる．

3 回以下のログインで 10 枚以上のコインを得ることはできないので，JOI 君がログインしなければならない回数の最小値は 4 である．従って，4 を出力する．

入力例 2

1 2 10

出力例 2

8

1 回のログインあたり 1 枚のコインが得られる．それとは別に，1 週間連続でログインすることで 2 枚のコインが得られる．10 枚のコインを集めたい．

月曜日から日曜日まで連続でログインすると，日々のコイン 7 枚に加えて，2 枚のコインが得られるため，合計 9 枚のコインが得られる．従って，更にもう 1 回ログインすることにより，10 枚のコインが得られる．

7 回以下のログインで 10 枚以上のコインを得ることはできないので，JOI 君がログインしなければならない回数の最小値は 8 である．従って，8 を出力する．

情報オリンピック日本委員会作 『第 18 回日本情報オリンピック JOI 2018/2019 予選競技課題』



Sample input:
3 0 10


Sample output:
4

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
days = C//(A+(B/7))

coins = A*days + B*days/7

days = days if coins >= C else days +1

print(days)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())

days = C//(A+(B/7))

coins = A*days + B*days/7

days = int(days) if coins >= C else int(days+1)

print(days)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())

days = C / (A+(B/7))

coins = A*days + B*days/7

days = int(days) if coins >= C else int(days+1)

print(days)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if b==0:
  if c%a==0:
    print(c//a)
  else:
    print((c//a)+1)
else :
  if (c-b)%a==0:
    if c-b>7:
      print(((c-b)//a))
    else:
      print(7+((c-b)//a))
  else:
    print(7+1+((c-b)//a))

Submission status: Accepted

Solution code:
A,B,C = map(int, input().split())

days = int(C/(A+(B/7)))

while 1:
    coins = A* days + B * (days//7)

    if ( coins >= C):
        break
    else:
        days += 1

print(days)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
ans=0
k=C//(7*A+B)
C-=k*(7*A+B)
if C<=7*A:
	print(7*k+(C+A-1)//A)
else:
	print(7*(k+1))

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
print(c//(7*a+b)*7+(7 if c%(7*a+b)>6*a else (c%(7*a+b)+a-1)//a))

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())

d=0
s=0
while s<c:
    d +=1
    if d%7==0:
        s +=b
    s +=a
print(d)

Submission status: Accepted

Solution code:
A,B,C=(int(x) for x in input().split())

if B==0:
    x=C//A
    if C%A!=0:
        x=x+1

elif A>C:
    x=1
elif C//A<7:
    x=C//A+1
else:
    t=0
    y=A*7
    y=y+B
    z=C%y
    if 0<z<A:
        t=1
    z=z//A
    if z>7:
        t=7-z
    s=C//y
    s=s*7
    x=z+s+t
print(x)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
q, r = divmod(c, a*7+b)
s = min(7, (r+a-1)//a)
print(7*q + s)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

d = 0
s = 0
while s < c:
    d += 1
    if d%7 == 0:
        s += b
    s += a
print(d)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
coin = 0
for day in range(1, C+1): 
    coin += A
    if day % 7 == 0:
        coin += B
    if coin >= C:
        break
print(day)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
x = 0
d = 0
while 1:
    if x >= c:
        break
    else:
        d = d +1
        x = x+a
        if d%7 == 0:
            x = x+b
print(d)

Submission status: Accepted

Solution code:
import math

daily_coin, bonus_coin, goal = (int(x) for x in input().split())

days = goal // daily_coin
weekly_coin = daily_coin * 7 + bonus_coin

if days < 7:
    print(math.ceil(goal / daily_coin))

elif days == 7:
    if daily_coin * 7 < goal < weekly_coin:
        print(7)
        
else:
    week = goal // weekly_coin
    rest_coin = goal - weekly_coin * week
    if (daily_coin * 7 < rest_coin < weekly_coin) or (daily_coin * 6 < rest_coin < weekly_coin):
        rest_days = 7
        print(week * 7 + rest_days)
    else:
        rest_days = math.ceil(rest_coin / daily_coin)
        print(week * 7 + rest_days)

Submission status: Accepted

Solution code:
from math import ceil

a,b,c = map(int,input().split())
week = (a*7 + b)
days = (c//week)*7
if a*6 < c-(days/7)*week:
    days += 7
else:
    days += ceil(((c%week)/a))
print(days)

Submission status: Accepted

Solution code:
import sys
a,b,c = input().split()
i = 0
sum = 0

while sum < int(c):
    i += 1
    sum += int(a)
    if i%7 == 0:
        sum += int(b)
print(i)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0

for day in range(1,C+1):
    coin+=A
    if day % 7 ==0:
       coin+=B
    if coin >=C:
       break
   
print(day)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
ans = c//(a*7+b)*7+min((c%(a*7+b)+a-1)//a,7)
print(ans)

Submission status: Accepted

Solution code:
A,B,C=(int(x) for x in input().split())

if B==0:
    x=C//A
    if C%A!=0:
        x=x+1
elif A>C:
    x=1
elif C//A<7:
    x=C//A+1
else:
    t=0
    y=A*7
    y=y+B
    z=C%y
    if 0<z<A:
        t=1
    z=z//A
    if z>7:
        t=7-z
    s=C//y
    s=s*7
    x=z+s+t
print(x)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
f=a*7+b
z=c//f
d=c%f
e=d//a
j=d%a
if d!=0:
    if d<=7*a:
        if d%a==0:
            print(7*z+e)
        if d%a!=0:
            print(7*z+e+1)
    else:
        print(7*z+7)
else:
    print(7*z)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
cnt=0
d=0
while cnt < c:
    d+=1
    if d % 7 == 0:
        cnt+=b
    cnt+=a
print(d)

Submission status: Accepted

Solution code:
a, b, c = map(int,input().split())

day = 0
coin = 0
loginCont = 0
while True:
    day += 1
    loginCont += 1
    coin += a
    if day == 7:
        coin += b
        day = 0
        if coin >= c:
            break
    if coin >= c:
        break

print(loginCont)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b,c=map(int,input().split())

sum=0
i=0
while True:
    sum+=a
    i+=1
    if sum>=c:
        print(i)
        break
    if i%7==0:
        sum+=b
        if sum>=c:
            print(i)
            break

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
count=0
sum=0
while True:
    count+=1
    sum+=a
    if count%7==0:
        sum+=b
    if sum>=c:
        break
print(count)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
n=0
for i in range(1,c+1):
    n+=a
    if i%7==0:
        n+=b
    if n>=c:
        break
print(i)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
cnt = 0
d = 0
while cnt < c:
    d+=1
    if d % 7 == 0:
        cnt+=b
    cnt+=a
print(d)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C: break
print(day)

Submission status: Accepted

Solution code:
#ゲームのログイン（1日1回）でコイン獲得
# a:coins/1day b:bounus/week c:goal of gained coins
# 毎日ログイン前提
a,b,c = list(map(int,input().split()))


days_needed = 0
coins = 0

flag = True
while flag:  
    days_needed += 1
    coins += a
    if days_needed % 7 == 0:
        coins += b

    if coins >= c:
        flag=False

print(days_needed)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
mon=0
day=0
while mon<c:
    mon+=a
    day+=1
    if day%7==0:
        mon+=b 
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
x=A*7+B
y=C//(A*7+B)
z=x*y
w=C-z
if (A*7)<w<x:
    print((y+1)*7)
else:
    coin=0
    day=0
    while coin<w:
        coin+=A
        day+=1
    print(y*7+day)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
n = 0 
temp = 0 
while temp < C:
	n = n + 1
	if n % 7 == 0:
		temp = temp + A + B
	else:
		temp = temp + A

print(n)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

coin=0
for day in range(1, C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day%7 ==0:
        coin+=B
    if coin>=C:
        break
print(day)

Submission status: Accepted

Solution code:
import math

a,b,c = map(int,input().split())

x = c // (7*a + b)
y = c - (7*a + b)*x
z = math.ceil(y/a)

if y > 6 * a:
    print(7 * (x + 1))
else:
    print(7 * x + z)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

coin = 0
for day in range(1, C+1):
    coin += A
    if day % 7 == 0:
        coin += B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
import math

a, b, c = map(int, input().split())

days = 1 
coin = 0



while c > coin: 
    coin = a * days + b * math.floor(days/7)
    days = days + 1
print (days - 1)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = 0
s = 0
while s < c:
    d += 1
    if d%7 == 0:
        s += b
    s += a
print(d)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

x = 0   
y = 0   

while y < C:
    y += A
    x += 1 
    if x%7 == 0:
        y += B
        
print(x)

Submission status: Accepted

Solution code:
def eval(A, B, C):
    rest = C
    count = 0
    
    while True:
        for i in range(7):
            rest -= A
            if i == 6:
                rest -= B
                
            count += 1
            if rest <= 0:
                return count


A, B, C = tuple(map(int, input().split()))
print(eval(A, B, C))

Submission status: Accepted

Solution code:
    
A, B, C = map(int, input().split())
ans = 0
k = C // (7*A+B)
C -= k*(7*A+B)
if C <= 7*A:
    print(7*k + (C+A-1)//A)
else:
    print(7*(k+1))

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
ans = c // (a * 7 + b) * 7
c %= a * 7 + b
ans += min(7, (c + a - 1) // a)
print(ans)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for day in range(1,C+1):
    coin += A
    if day % 7 == 0:
        coin +=B
    if coin >= C:
        break
print(day)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

d = 0
e = 0
while e < c:
    d += 1
    if d%7 == 0:
        e += b
    e += a
print(d)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = c//(7*a+b)
c -= k*(7*a+b)
if c <= 7*a:
    print(7*k + (c+a-1)//a)
else:
    print(7*(k+1))

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C:
        break
    
print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split ())
coin = 0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C:break
print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7== 0:
        coin+=B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())

coin = 0
for day in range(1, C+1):
    coin+=A
    
    if day%7==0:
        coin+=B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for i in range(1,C+1):
    coin+=A
    if i%7==0:
        coin+=B
    if coin>=C:
        break
print(i)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

ok = 100000000
ng = 0
while ok - ng > 1:
    m = (ok + ng) // 2
    ge = m * a + (m // 7) * b
    if ge >= c:
        ok = m
    else:
        ng = m
print(ok)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 ==0:
        coin+=B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for day in range (1,C+1):
    coin +=A
    if day %7 == 0:
        coin += B
    if coin >= C: break
print(day)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if c<(7*a+b):
    if c<=6*a:
        if c%a==0:
            print(c//a)
        else:
            print(c//a+1)
    else:
        print(7)
else:
    if c%(7*a+b)==0:
        print(int(7*c/(7*a+b)))
    else:
        if (c%(7*a+b))<=6*a:
            if c%(7*a+b)%a==0:
                print(int(c//(7*a+b)*7+(c%(7*a+b))//a))
            else:
                print(int(c//(7*a+b)*7+(c%(7*a+b))//a)+1)
        else:
            print(int(c//(7*a+b)*7+7))

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
day=0
coin=0
while coin<C:
    day+=1
    coin+=A
    if day%7==0:
        coin+=B
print(day)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

A,B,C =map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
import math
A,B,C = map(int, input().split())
x=C//(7*A+B)
y=C-(7*A+B)*x
if y <= A*6:
    print(x*7+math.ceil(y/A))
else:
    print(x*7+7)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
day=1
while True:
    coin+=A
    if day%7==0:
        coin+=B
    if coin>C or coin==C:
        break
    day+=1
print(day)

Submission status: Accepted

Solution code:
import math
a,b,c=map(int,input().split())
q,m=divmod(c,a*7+b)
print(7*q+min(7,math.ceil(m/a)))

Submission status: Accepted

Solution code:
def main():
    a,b,c = map(int,input().split())
    target = c
    daily_coin = a
    weekly_coin = b
    weekly_daily_total_coin = 7 * a + b
    counter = 0

    counter += (target // weekly_daily_total_coin) * 7
    target %= weekly_daily_total_coin
    #print(counter,target)
    temp = 0
    if target % daily_coin != 0 :
        temp += 1
    counter += min(target // daily_coin + temp,7)
    print(counter)



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day%7==0:
        coin+=B
    if coin>=C:
        break

print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

x=C%(A*7+B)
y =C//(A*7+B)

if (C//A)<7:
    if C%A==0:
        print(C//A)
    else:
        print(C//A+1)
        
elif x==0:
    print(y*7)
else:
    z=x%A
    w=x//A
    if w>(A*7):
        print(y*7+7)
    elif w==7 and z<=B:
        print(y*7+7)
    elif z==0:
        print(y*7+w)
    else:
        print(y*7+w+1)

Submission status: Accepted

Solution code:
import math
a, b, c = map(int, input().split())

n = 0

while True:
    n += 1
    if (a * n + math.floor(n / 7) * b >= c):
        break

print(n)

Submission status: Accepted

Solution code:
y=0
z=1
x=list(map(int,input().split()))
#print(x)

a=x[0]
b=x[1]
c=x[2]

while True:
    if y>=c:
        break
    elif z%7==0:
        z+=1
        y+=a+b
        #print(z)
    else :
        y+=a
        z+=1
        #print(y)
print(z-1)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
X=1
while True:
    if (C<=A*X+(X//7)*B):

        print(X)
        break
    else:
        X=X+1

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >=C:
        break
        
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
x=0
for i in range(1,1+C):
    x+=A
    if i%7==0:
        x+=B
    if x>=C:
        break
print(i)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C: break
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin >= C : break

print(day)

Submission status: Accepted

Solution code:
a, b, c=map(int, input().split())
ans=c//(a*7+b)*7
c%=a*7+b
ans+=min(7, (c+a-1)//a)
print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=0
while c>0:
    c=c-a
    d=d+1
    if d%7==0:
        c=c-b
    
print(d)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for day in range(1,1+C): #1日からC日まで繰り返す
    coin=coin+A
    if day%7==0: 
        coin=coin+B #七日経ったらB枚のコインも追加
    if coin>=C:
        break #coinがC枚より多くなったら繰り返し終了
print(day)

Submission status: Accepted

Solution code:
A, B, C = [int(i) for i in input().split(' ')]

week_reward = A * 7 + B

weeks, remain_rewards = divmod(C, week_reward)

remain_days = 0

if remain_rewards == 0:
    print(weeks * 7)
    exit(0)

for i in range(1, 7):
    if remain_rewards <= A * i:
        print(weeks * 7 + i)
        exit(0)

    if i == 6:
        print((weeks + 1) * 7)

Submission status: Accepted

Solution code:
a, b, c = map(int,input().rstrip().split())

day = 1
while((a*day + b*(day//7)) < c):
    day += 1

print(day)

Submission status: Accepted

Solution code:
#20 ソーシャルゲーム

A, B, C = map(int,input().split())

coin = 0
for day in range (1, 1+C):
        coin += A
        
        if day % 7 == 0:
                coin += B
        if coin >= C:
                break

print(day)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

coin=0
for day in range(1, c+1):
    coin+=a
    
    if day % 7 == 0:
        coin+=b
    if coin >= c: break

print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
coin = 0
for day in range(1,C+1):
    coin += A
    if day % 7 == 0:
        coin += B
    if coin >= C:
        break
print(day)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

coin=0
for day in range(1,c+1):
    coin+= a
    if day%7 == 0:
        coin+= b
    if coin >= c: break
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for i in range(1,C+1):
    coin+=A
    if i%7==0:
        coin+=B
    if coin>=C:
        break
print(i)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 == 0:
        coin+=B
    if coin>=C:
        break
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day%7==0:
        coin+=B
    if coin>=C:
        break
    
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    if day%7==0:
        coin+=B
    if coin>=C:
        break
print(day)

Submission status: Accepted

Solution code:

A,B,C=map(int,input().split())

y=0

for x in range(1,C+1):
    y+=A
    if x%7==0:
        y+=B
    if y>=C:
        break
print(x)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
coin=0
for day in range(1,C+1):
    coin+=A
    if day % 7 ==0:
        coin+=B
    if coin >= C: break
print(day)

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())

coin = 0
for day in range(1,C+1):
    coin += A
    
    if day % 7 == 0:
        coin += B
    if coin >= C:break

print(day)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
m=0
for day in range(1,c+1):
    m+=a
    if day%7==0:
        m+=b
    if m>=c:break

print(day)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
s = 0
s += c // (a*7+b)*7
c %= (a*7+b)
s += min(7, (c + a - 1) // a)
print(s)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())

coin=0
for day in range(1,c+1):
    coin+=a
    #月曜から日曜まで連続でログイン
    if day % 7 == 0:
        coin+=b
    if coin >= c: break
print(day)

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())

coin = 0
for day in range(1, C+1):
    coin += A
    if day % 7 == 0:
        coin += B
    if coin >= C:
        break
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
ans = C//(7*A+B)*7 + min((C%(7*A+B)+A-1)//A,7)
print(ans)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
coin=0
for day in range(1,C+1):
    coin += A
    if day %7 == 0:
        coin += B
    if coin >= C: break
print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
coin = 0
for day in range(1, C+1):
     coin += A
     if day % 7 == 0:
          coin += B
     if coin >= C:  break
print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int, input().split())

coin = 0
for day in range(1, C+1):
    coin=coin+A
    if day % 7 == 0:
        coin = coin + B
    if coin >= C:
        break
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int, input().split())

coin=0
for day in range(1, C+1) :
    coin+=A
    if day % 7 == 0 :
        coin+=B
    if coin >= C : break 
print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

coin=0
for day in range(1,C+1):
    coin+=A
    
    if day %7 == 0:
        coin+=B
    
    if coin >= C :break

print(day)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())

day = 0
login = 0
while True:
    day += 1
    login += A
    if day % 7 == 0:
        login += B
    if login >= C:
        break
print(day)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
i=1
while True:
    x=a*i+b*(i//7)
    if x >= c:
        print(i)
        break
    i += 1

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

coin=0
for day in range(1, C+1):
    coin+=A
    #月曜日から日曜日まで 7 日連続でログインすると
    if day % 7 == 0:
        coin+=B
    if coin >= C: break

print(day)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

day = 0
coin = 0

while coin < c:
    day += 1
    coin += a
    if day % 7 == 0:
        coin += b


print(day)

Submission status: Accepted

Solution code:
day=0
sum=0

a,b,c=map(int,input().split())

while True:
    day+=1
    
    if day%7==0:
        sum+=(a+b)
    else:
        sum+=a
    
    if sum>=c:
        print(day)
        break

Submission status: Accepted

Solution code:
s = input().split()
l = 0
N = int(s[0])#１日
A = int(s[1])#ボーナス
B = int(s[2])#ほしい
W = N*7+A
if B%W == 0:
  l = B//W*7
else:
  if int(B%W) > int(N*7):
    l = (1+B//W)*7
  else:
    if int(B%W%N) == 0:
      l = B//W*7+B%W//N
    else:
      l = B//W*7+B%W//N+1
print(l)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
i=0
while A*i+i//7*B<C:
    i+=1
print(i)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if c%(a*7+b)<=7*a:
    print(c//(a*7+b)*7-(-1*(c%(a*7+b)))//a)
else:print(-1*((-1*c)//(a*7+b))*7)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
x=A*7+B
y=C//(A*7+B)
z=x*y
w=C-z

if (A*7)<w<x:
    print((y+1)*7)
else:
    coin=0
    day=0
    while coin<w:
        coin+=A
        day+=1
    print(y*7+day)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=0
i=1
while True:
    if i%7==0:
        d=d+a+b
    else:
        d=d+a
    if d>=c:
        break
    i=i+1
print(i)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
i=1
while True:
    if i*A+int(i/7)*B>=C:
        break
    i+=1
print(i)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
n = 0  # ログイン回数
temp = 0  # n回ログインした後の合計枚数
while temp < C:
	n = n + 1
	if n % 7 == 0:
		temp = temp + A + B
	else:
		temp = temp + A

print(n)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=int(a*7+b)
e=int(c%d)
if c<d:
    if c%a==0:
        if c/a>=7:
            print(7)
        else:
            print(int(c/a))
    else:
        if c/a>=6:
            print(7)
        else:
            print(int(c/a)+1)
else:
    if e==0:
        print(int(c/d)*7)
    else:
        if e%a==0:
            if e/a>=7:
                print(int(c/d)*7+7)
            else:
                print(int(c/d)*7+int(e/a))
        else:
            if e/a>=6:
                print(int(c/d)*7+7)
            else:
                print(int(c/d)*7+int(e/a)+1)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

d = 0
s = 0
while s < c:
    d += 1
    if d%7 == 0:
        s += b
    s += a
print(d)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
Day=0
coin=0
while C>coin:
    Day+=1
    coin+=A
    if Day%7==0:
        coin+=B
print(Day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
ans = C//(7*A+B)*7 + min((C%(7*A+B)+A-1)//A,7)
print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
day=0
coin=0
 
while coin<c:
    day+=1
    coin+=a
    if day%7==0:
        coin+=b
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
sum=0
i=1
while True:
    if i%7==0:
        sum+=B
    sum+=A
    if sum>=C:
        break
    i+=1
print(i)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
coin = 0
day = 1
while coin < C :
    coin += A
    if day % 7 == 0 :
        coin += B
    day += 1
print(day-1)

Submission status: Accepted

Solution code:
#0652
a , b , c = map(int,input().split())
sum = 0
count = 0 
while True:
    if sum >= c:
        break
    sum += a
    count += 1
    if count%7 == 0:
        sum += b 
        
print(count)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
x = A * 7 + B
ans = C // x * 7
C = C % x
y = C // A
if C % A > 0:
  y += 1
if y > 7:
  y = 7
ans += y
print(ans)

Submission status: Accepted

Solution code:
inputs = input().split()
a = int(inputs[0])
b = int(inputs[1])
c = int(inputs[2])

y = 7*c / (7*a + b)
if y - int(y) > 0:
    x = int(y) + 1
else:
    x = int(y)


while True:
    if a*x + int(x/7) * b >= c:
        print(x)
        break
    else:
        x+=1

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d,e=0,0
while d<c:
    d +=a
    e +=1
    if e%7 == 0:
        d +=b
print(e)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())

week = C // (7 * A + B)
coin = week * (7 * A + B)

day = week * 7

if (C - coin) / A < 7 :
    day += (C - coin) // A
    coin += (C - coin) // A * A
    
    if coin != C :
        day += 1
        
else :
    day += 7
    coin += 7 * A + B
    
    if coin < C :
        day += 1
        
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
point=0
if C>7*A+B:
    warareru=C%((7*A)+B)
    ans=C//((7*A)+B)
    while warareru>0:
        point+=1
        if point%7!=0:
            warareru-=A

        else:
            warareru-=A+B


    print(ans*7+point)
elif C>=7*A and C<=7*A+B:
    print("7")
else:
    if C%A==0:
        print(C//A)
    else:print((C//A)+1)

Submission status: Accepted

Solution code:
import math as m
A,B,C=map(int,input().split())
pw=A*7+B
w=C//pw
r=C%pw
d=0
if  0<r<7*A:
    if r%A==0:
        d=r//A
    else:
        d=(r//A)+1
    
elif 7*A<=r<7*A+B: 
    d=7
print(w*7+ d )

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())

day=0
coin=0

while coin<c:
    day+=1
    coin+=a
    if day%7==0:
        coin+=b
print(day)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
day=0
coin=0

while True:
    if coin>=C:
        break
    day+=1
    coin+=A
    if day%7==0:
        coin+=B
print(day)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

D=0 #Dは日数
X=0 #Xは枚数
while X<C:
    D+=1
    X+=A
    if D%7 == 0:
        X+=B
print(D)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=0
s=0
while s<c:
    d+=1
    if d%7==0:
        s+=b
    s+=a
print(d)

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
x = 0
y = 0
while x < C:
    y += 1
    if y%7 == 0:
        x += B
    x += A
print(y)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

day=0
coin=0

while coin<c:
    day+=1
    coin+=a
    if day%7==0:
        coin+=b
        
    
print(day)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

A, B, C = map(int, input().split())

d = 0
cnt = 0
while True:
   d += 1
   if d % 7 == 0:
      cnt += (A + B)
   else:
      cnt += A
   if cnt >= C:
      print(d)
      break

Submission status: Accepted

Solution code:

import sys
from math import ceil

def solve(a, b, c):
    q, r = divmod(c, (a*7 + b))
    return q * 7 + min(ceil(r / a), 7)


def main(args):
    a, b, c = map(int, input().split())
    ans = solve(a, b, c)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())

x=0
i=0

while x<c:
    x+=a
    i+=1
    
    if i%7==0:
        x+=b

print(i)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
s=7*A+B
w=C//s
D=C%s

if D<7*A :
    d=-(-D//A)
elif 0<=D-7*A and D-7*A<B :
    d=7
    
print(7*w+d)

Submission status: Accepted

Solution code:
#標準入力とリストの初期化
a,b,c = map(int,input().split())
count,coin = 0,0

#毎日ログインボーナスを加算し7日ログインしたらボーナスを追加する
while coin < c:
    count += 1
    coin += a
    if count % 7 == 0:coin += b

#かかった日数を出力する
print(count)

Submission status: Accepted

Solution code:
inputText = input().split()
a = int(inputText[0])
b = int(inputText[1])
c = int(inputText[2])
week = a*7+b
weeks = int(c /week)
remain = c % week
totalday = weeks * 7
totalday += int(remain/a)
totalday2 = (int(c/week)+1)*7
if remain%a != 0:
    totalday +=1
print(min(totalday,totalday2))

Submission status: Accepted

Solution code:
def main():
    a, b, c = map(int, input().split())
    w = a * 7 + b
    ans = c // w * 7
    c = c % w
    d = c // a
    if c % a > 0:
        d += 1
    if d > 7:
        d = 7
    ans += d
    print(ans)

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
A, B, C = map(int, input(). split())

i = 1
sum = 0
while True:
    if i%7 == 0:
        sum += A + B
    if i%7 != 0:
        sum += A
    if sum >= C:
        break
    i += 1
    
print(i)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
x=c//(7*a+b)
r=c-(7*a+b)*x
t=r//a
if c%(7*a+b)!=0:
    if r>=7*a:
        print(7*x+7)    
    else:
        if r%a!=0:
            print(7*x+t+1)
        else:
            print(7*x+t)
else:
    print(7*x)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
S=0
i=0
while C>S:
    S=S+A
    if C>S and i+1>=7 and (i+1)%7==0:
        S=S+B
    i=i+1
print(i)

Submission status: Accepted

Solution code:
import math

A,B,C=map(int,input().split())

w=C//(7*A+B)

z=C-(7*A+B)*w

if z<=A*6:
    print(w*7+math.ceil(z/A))
    
else:
    print(w*7+7)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
x=A*7+B
y=C//(A*7+B)
z=x*y
v=C-z

if (A*7)<v<x:
    print((y+1)*7)
else:
    coin=0
    day=0
    while coin<v:
        coin+=A
        day+=1
    print(y*7+day)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

A,B,C =map(int,input().split())
K = int(0)

while C>=7*A+B:
    C = C - (7*A+B)
    K += 1
#print(C)
if C>7*A:
    #print(A,C)
    C=7+7*K
elif C%A==0:
    #print(A,C)
    C=(C/A)+7*K
else:
    #print(A,C)
    C=(C/A)+1+7*K
    
print('%d'%C)