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: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
s=int(a*7+b)
t=c//(7*a+b)
r=t*s
m=c-r

if (7*a)<(c-r)<s:
    print((t+1)*7)
else:
    coin=0
    day=0
    while coin<(c-r):
        coin+=a
        day+=1
    print(t*7+day)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
W_C=int((7*a)+b)
#1週間の総コイン数

W=c//W_C
#何週間必要か

C=W_C*W
#W週間で得られたコイン数

if 7*a<c-C<W_C:
#1日で貰えるコイン×７<
#必要なコイン - W週間で得られたコイン数<
#1週間の総コイン数
    print((W+1)*7)

else:
    day=0
    coin=0
    while coin<c-C:
        coin+=a
        day+=1

    print(W*7+day)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

a,b,c = map(int,input().split())
d=1
r=0
w=0

w = c//(7*a+b)
r = c%(7*a+b)
d = (math.ceil(r/a))

if d>7:
    d = 7
d += 7*w
print(d)

Submission status: Accepted

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

x = 0
c = 0

while c < C:
    
    x = x + 1
    
    if x % 7 != 0:
        c = c + A
    
    elif x % 7 == 0:
        c = c + A + B

print(x)

Submission status: Accepted

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

if -(-c//a)<=7:
    print(-(-c//a))
elif b+7*a>=c:
    print('7')
else:
    d=c//(7*a+b)
    e=c%(7*a+b)
    if (7*a+b)-e>=b:
        f=-(-e//a)
        print(d*7+f)
    else:
        print(7*d+7)

Submission status: Accepted

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

Submission status: Accepted

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

if C<d:
    if C%A == 0:
        print(C//A)
    if C%A > 0 :
        print(C//A+1)

if C>=d:
    D = A*7+B
    E = C%D
    F = C//D
    x = E//A
    y = E%A
    if x < 7 :
        if y == 0:
            print(F*7+x)
        if y > 0 :
            print(F*7+x+1)
    if x >= 7:
        print((F+1)*7)

Submission status: Accepted

Solution code:
import math as m
A,B,C=(float(x) for x in input().split())

a=m.ceil(C/A)

s=7*A+B
t=C//s
#sは1週間にもらえるコインの枚数
u=C-s*t
#uは端数
v=m.ceil(u/A)

if v<=7:
    b=7*t+v
    
else:
    b=7*t+7
    
if a>b:
    print(int(b))
else:
    print(int(a))

Submission status: Accepted

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

m=a*7+b

if c<a*7:
    print(math.ceil(c/a))
else:
    n=math.floor(c/m)
    p=c-m*n
    if p/a<7:
        x=n*7+math.ceil(p/a)
    else:
        x=n*7+7

    print(x)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
if C<7*A+B:         #1週間目でおわる
    if  A*7<C and C<A*7+B: #実は1週目の日曜日に終わる
        print(7)
    else:    
        if C%A==0:          
            print(C//A)
        else:               #あまりがあったら＋１
            print(C//A+1) 
else:                       #2週間目以降
    if C%((7*A)+B)==0:              #日曜日に終わる
        print((C//((7*A)+B))*7)
    else :
        if C%((7*A)+B)>=7*A and C%((7*A)+B)<7*A+B: #実は日曜日に終わる
            print((C//((7*A)+B)+1)*7)
        else:
            if (C%((7*A)+B))%A==0 :
                print(((C//((7*A)+B))*7)+((C%((7*A)+B))//A))
            else:                       #余りがあったら+１
             print(((C//((7*A)+B))*7)+((C%((7*A)+B)))//A+1)

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())
cpw=7*a+b
w=c//cpw
r=c%cpw
if r<7*a:
    if r%a==0:
        d=r//a
    else:
        d=(r//a)+1
elif 0<=r-7*a and r-7*a<b:
    d=7
print(7*w+d)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
i = 0
coin = 0
while i < 10**6:
    if coin >= C:
        break
    
    i = i + 1
        
    coin = coin + A
    if i%7 == 0:
        coin = coin + B
    
print(i)

Submission status: Accepted

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

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:
A, B, C = map(int,input().split())
import math
n = 0
while True :
    x = A*n+(B*math.floor(n/7))
    if x >= C :
        break
    n += 1
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(day)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
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:
import math
A, B, C=map(int,input().split())
x=C//(A*7+B)
y=C%(A*7+B)

z=math.ceil(y/A)
r=math.ceil(z/(A*7+B))
if z>=7:
    print(x*7+7*r)
else:
    print(x*7+z)

Submission status: Accepted

Solution code:
def calcDays(A, B, C):
    import math
    weeks = C // (A * 7 + B)
    mod = C % (A * 7 + B)
    if(mod >= A * 7):
        days = 7
    else:
        days = math.ceil(mod / A)
            
    print(days + weeks * 7)

def main():
    A, B, C = map(int, input().split())
    calcDays(A, B, C)

main()

Submission status: Accepted

Solution code:
a,b,c=input().split()
d = int(a)*7+int(b) #一週間で手に入るコイン
e = int(c)//d #必要な週の数
f = int(c)-d*e #残りのコイン
if f<=6*int(a) and f%int(a)>0 : g=f//int(a)+1
elif f<=6*int(a) and f%int(a)<=0 : g=f/int(a)
else : g=7
print(int(e*7+g))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
coins = 0
login_times = 0
while True:
    coins += l[0]
    login_times += 1
    if login_times%7==0:
        coins += l[1]
    if coins>=l[2]:
        print(login_times)
        break

Submission status: Accepted

Solution code:
#!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

A, B, C = map(int, input().split())
Sum = 0
for i in range(1, 10**9):
    Sum += A
    if i%7 == 0:
        Sum += B
    if Sum >= C:
        print(i)
        sys.exit()

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())
s=0
sum=0
while 1:
    sum+=A
    s+=1
    if s%7==0:
        sum+=B
    if sum>=C:
        break
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
coin_day, coin_week, goal = map(int, input().split())
total_coin_per_week = coin_week + (7 * coin_day)
res_week, rest_coin = divmod(goal, total_coin_per_week)

res_day, residual = divmod(rest_coin, coin_day)
if residual >= 1:
    res_day += 1
if res_day >= 7:
    res_day = 7

print(res_week * 7 + res_day)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_str = input("")
input_elms = input_str.split(" ")
for login_cnt in range(1, int(input_elms[2]) + 1):
    if int(input_elms[0]) * login_cnt + int(input_elms[1]) * int(login_cnt/7) >= int(input_elms[2]):
        print(login_cnt)
        break

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

if __name__ == '__main__':

	a,b,c = map(int,input().split())
	tmp = 0
	tmp2 = 0
	tmp3 = 0
	tmp4 = 0

	tmp = a * 7 + b
	tmp2 = int(c / tmp)
	tmp3 = c % tmp

	if tmp3 != 0:
		if tmp3 > a*7:
			tmp4 = 7
		else:
			tmp4 = int(tmp3 / a)
			if tmp3 % a != 0:
				tmp4 += 1
	if c < tmp:
		print(tmp4)
	else:
		print(tmp2*7 + tmp4)

Submission status: Accepted

Solution code:

def isPrime(n):
    n = abs(n)
    if n == 2:
        return True
    if n < 2 or n & 1 == 0:
        return False
    return pow(2, n - 1, n) == 1

def gcd(n, m):
    while m:
        n, m = m, n % m
    return n

def lcm(n, m):
    return n * m // gcd(n, m)

def main():
    a, b, c = list(map(lambda x: int(x), input().split()))
    ans = 0
    for i in range(1000000 + 1):
        login_coin = i * a
        bonus_coin = i // 7 * b
        total = login_coin + bonus_coin
        if total >= c:
            ans = i
            break

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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())
i=1
result=0
while True:
    if result>=c:
        break
    result+= a
    if i%7==0:
        result+=b
    i+=1
print(i-1)

Submission status: Accepted

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

cnt = 0
coin = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    inp_line = input().split()
    
    login_coin = int(inp_line[0])       # ログインの度に得られるコイン
    add_coin = int(inp_line[1])         # 週ボーナスで追加で得られるコイン
    need_coin = int(inp_line[2])        # 少なくとも必要なコインの枚数
    
    # 入力チェック
    if not(1 <= login_coin <= 1000)\
       or not(0 <= add_coin <= 1000)\
       or not(1 <= need_coin <= 10 ** 6):
        print("入力が不正です。")
        return

    login_count = 0
    coin = 0
    while True:
        login_count += 1
        coin += login_coin
        # 7日Login
        if login_count % 7 == 0:
            coin += add_coin

        if coin >= need_coin:
            break

    print(login_count)

main()

Submission status: Accepted

Solution code:
a,b,c=(int(x) for x in input().split())
n=0
i=0
while n<c:
    n+=a
    i+=1
    if i%7==0:
        n+=b;
print(i)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
while C > 0:
    ans += 1
    C -= A
    if ans % 7 == 0:
        C -= B

print(ans)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d, s = 0, 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(" "))
ans = 0
if b == 0 :
    if c%a == 0:
        ans = c//a
    else:
        ans = c//a+1
else:
    unit = 7*a+b
    if c%unit==0:
        ans = 7*c//unit
    else:
        temp = c%unit
        if temp >= 7*a:
            ans = 7*(c//unit+1)
        else:
            if temp%a==0:
                ans = 7*(c//unit) + temp//a
            else:
                ans = 7*(c//unit) + temp//a + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    a,b,c=MI()
    week,r=divmod(c,7*a+b)
    day=(r+a-1)//a
    print(week*7+min(7,day))

main()

Submission status: Accepted

Solution code:
import sys
from math import ceil

sys.setrecursionlimit(100000)
A, B, C = list(map(int, input().split()))

if A * 7 >= C:
    print(ceil(C/A))
    exit()

cur = C
count = 0
count_i = 0
while cur > 0:
    count += 1
    count_i += 1
    if count_i == 7:
        count_i = 0
        cur -= B
    cur -= A

print(count)

Submission status: Accepted

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

#print(A,B,C)

week=A*7+B
W=int(C/week)
W1=int(W*week)
r=int(C-W1)

a=int((r+A-1)/A)

if(a>7):
    a=7

a+=W*7
print(a)

Submission status: Accepted

Solution code:
import math
a,b,c = map(int,input().split())
for i in range(10**6):
    c -= a
    if i%7 == 6:
        c -= b
    if c <= 0:
        print(i+1)
        break

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
ans = 0
n = C // (7*A+B)
r = C %  (7*A+B)
ans += 7*n
if r == 0:
    pass
elif r <= 6*A:
    ans += r//A
    if r % A != 0:
        ans += 1
else:
    ans += 7
print(ans)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
C_7=7*A+B
week_day,week_rem,day_0,day_rem=C//C_7*7,C%C_7,C//A,C%A

if C<=A:
    print(1)
elif C<C_7:
    if A*7<week_rem<=C:
        print(7)
    elif 0<day_rem<=A:
        print(day_0+1) 
    elif day_rem==0:
        print(day_0)
    else:
        print(day_0+day_rem)
elif B==0:
    if day_rem==0:
        print(day_0)
    else:
        print(day_0+1)
elif week_rem==0:
    print(week_day)
elif C>C_7:
    if 0<week_rem<=A:
        print(week_day+1)
    elif A*7<week_rem<=C_7:
        print(week_day+7)
    else:
        print(week_day+week_rem)

Submission status: Accepted

Solution code:
# AOJ Volume6 0652
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0652

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

import array
from fractions import Fraction
import functools
import itertools
import math
import os
import sys


def main():
    A, B, C = read_ints()
    print(solve(A, B, C))


def solve(A, B, C):
    weekly = A * 7 + B
    weeks = C // weekly
    rest = C - weekly * weeks
    days = (rest + A - 1) // A
    if days > 7:
        days = 7
    return weeks * 7 + days


###############################################################################
# AUXILIARY FUNCTIONS

DEBUG = 'DEBUG' in os.environ


def inp():
    return sys.stdin.readline().rstrip()


def read_int():
    return int(inp())


def read_ints():
    return [int(e) for e in inp().split()]


def dprint(*value, sep=' ', end='\n'):
    if DEBUG:
        print(*value, sep=sep, end=end)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    A,B,C = MI()
    ans = 7*(C//(A*7+B)) #1週間
    C %= A*7+B
    ans += min(7,ceil(C/A))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B, C = (int(x) for x in input().split())
D = C - (int(C/(7*A+B))*(A*7+B))
#print(D/A)
#print(int(C//(7*A+B)))
if D%A == 0:
    if D < 7*A:
        print(int(C/(7*A+B))*7 + int(D/A))
    else:
        print(int(C/(7*A+B))*7 + 7)
else:
    if D < 7*A:
        print(int(C/(7*A+B))*7 + int(D/A) + 1)
    else:
        print(int(C/(7*A+B))*7 + 7)

Submission status: Accepted

Solution code:
import random
import math
N = list(map(int, input().split()))
A=N[0]
B=N[1]
C=N[2]
x=(int)(C/(A*7+B))
sum=x*7

if abs(x*(A*7+B)-C)>= 0.0000001:
    for i in range (1,8):
        sum=sum+1
        if i== 7 and C<=x*(A*7+B)+i*A+B:
            break
        if C<=x*(A*7+B)+i*A:
            break
print(sum)

Submission status: Accepted

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

i=0
N=C
while N>0:
    N=C-A*i
    if N<=0:
        print(i)
        break
            
    else:
         i+=1
         if i%7==0:
            C-=B

Submission status: Accepted

Solution code:
#john_doe
In=list(map(int,input().split()))
cnt=0
sum=0
while(sum<In[2]):
    sum+=In[0]
    cnt+=1
    if(cnt%7==0):
        sum+=In[1]
print(cnt)

Submission status: Accepted

Solution code:
ABC=list(map(int,input().split()))
coin=0
date=0
days=0

while(1):
    days+=1
    
    if not date==6:
        coin=coin+ABC[0]
    else:
        coin=coin+ABC[1]
        coin=coin+ABC[0]

    if coin>=ABC[2]:
        print(days)
        break
    date=(date+1)%7

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())

sum=0
cnt=0

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

print(cnt)

Submission status: Accepted

Solution code:
def main():
    a, b, c = (int(i) for i in input().split())
    ans = 0
    get_week = a*7 + b
    ans = 0
    if c % get_week == 0:
        ans = (c//get_week) * 7
        return print(ans)
    else:
        ans = (c//get_week) * 7
        c = c % get_week
        cnt = 0
        while c > 0:
            c -= a
            ans += 1
            cnt += 1
            if cnt == 7:
                c -= b
                cnt = 0
        return print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 学籍番号 17D8101029G 石塚 博之 ID: mcatpolo 言語: python3

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

n = int(0)
i = int(0)

while True:
    i += 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())
i=1
while 1:
    c=c-a
    if i%7==0:
        c=c-b
    if c<=0:
        break
    i=i+1
print(i)

Submission status: Accepted

Solution code:

a,b,c=map(int,input().split())
#b=int(input())
#c=int(input())
day=0
cnt=0
while(True):
    day+=1
    #print(day)
    #print(c)
    if day%7==0:
        c-=b
    c-=a
    if c<=0:
        break
print(day)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
x=list(map(int,input().split()))
y,cnt=0,0
while x[2]>y:
    cnt+=1
    y+=x[0]
    if cnt%7==0:
        y+=x[1]
print(cnt)

Submission status: Accepted

Solution code:
t = [int(x) for x in input().split()]
i = 0

while t[2] > 0:
  i = i + 1
  t[2] = t[2] - t[0]
  if i % 7 == 0:
    t[2] = t[2] - t[1]
    
print(i)

Submission status: Accepted

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

count=0
while C>0:
    count+=1
    C-=A
    if count%7==0:
        C-=B
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Social Game
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0652

"""
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:
d, b, t = [int(x) for x in input().split()]

w = 7 * d + b

c = 0
c += (t // w) * 7
t %= w

if t >= 7*d:
    c +=7
    t = 0
else:
    c += t//d
    t %= d
    if t > 0:
        c += 1

print(c)

Submission status: Accepted

Solution code:
import sys
from sys import stdin

#input = stdin.readline()

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

def Process(A, B, C):    #その一週間のログイン計画を演算する
    got, login = 0, 0
    if C > (7*A+B):    #一週間フルでログインしてもまだ目標に到達しない場合.
        week, remain = divmod(C, (7*A+B))
        login += (7*week)
        got += ((7*A+B)*week)

    local_date = 1
    while C > got:
        got += A
        login += 1
        local_date += 1
        if local_date == 8:
            got += B
    return login

print(Process(A, B, C))

Submission status: Accepted

Solution code:
a,b,c=(int(x) for x in input().split())
week=a*7+b
weeks=c//week
c=c-weeks*week
if c>a*7:
    days=7
else:
    days=-(-c // a)
total=days+weeks*7
print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while (coin < C):
    coin += A

    day += 1

    if day % 7 == 0:
        coin += B

print(day)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
coin = 0
count = 0
output = 0

while coin < c:
    coin += a
    count += 1
    output += 1
    
    if count == 7 :
        coin += b
        count = 0

print(output)

Submission status: Accepted

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

while coin < C:
    coin += A
    ans += 1
    if ans % 7 == 0:
        coin += B

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b,c=map(int,input().split())
s=a*7+b
w=c//s
if c%s==0:
  d=0
else:
  d=min(math.ceil((c%s)/a),7)
print(7*w+d)

Submission status: Accepted

Solution code:
sum_coins = 0
coin_day, coin_weekly, coin_needed = map(int, input().split())
day = 0

while sum_coins < coin_needed:
    day +=1
    sum_coins += coin_day

    if day % 7 == 0:
        sum_coins += coin_weekly
print(day)

Submission status: Accepted

Solution code:
import math
A, B, C = map(int, input().split())
week = C // (A * 7 + B)
num = math.ceil(C % (A * 7 + B) / A)
if num > 7 :
    num = 7
print(week * 7 + num)

Submission status: Accepted

Solution code:

n = [0 for i in range(3)]

n = input().split()

coin = int(n[2])

total = 0

count = 0

day = 0

while(total < coin):
    total += int(n[0])
    count += 1
    if(count == 7):
        total += int(n[1])
        count = 0
    day += 1


print(day)

Submission status: Accepted

Solution code:
import math
line = input().split(" ")
A = int(line[0])
B = int(line[1])
C = int(line[2])

W = C//(7*A+B)
remain = C - (7*A+B)*W
#print(W, " ", remain)
D = 0
if(remain >= 7*A):
    D = 7 
else:
    D = math.ceil(remain/A)

ans = 7*W + D

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
min_k = 1000000 // 7 + 1
min_r = 0
for r in range(7):
    u = C - r * A
    d = 7 * A + B

    k = 1
    if u < 0:
        k = 0
    elif u % d == 0:
        k = u // d
    else:
        k = u // d + 1

    if min_k > k:
        min_k = k
        min_r = r

print(7 * min_k + min_r)

Submission status: Accepted

Solution code:
def getInput():
    (a, b, c) = (int(i) for i in input().split(" "))
    return a, b, c

a, b, c = getInput()

n_weeklylogin = 0
n_dailylogin = 0
weekly_gain = 7*a+b

n_weeklylogin = c//weekly_gain
total_bonus = n_weeklylogin*weekly_gain

if total_bonus >= c:
    print(n_weeklylogin*7)
else:
    n_dailylogin = -(-(c-total_bonus)//a)
    print(n_weeklylogin*7 + (n_dailylogin>=7)*7 + (n_dailylogin<7)*(n_dailylogin))

Submission status: Accepted

Solution code:
import math

(A, B, C) = list(map(int, input().split()))
cnt = 0
coin = 0

if A*7 < C:
    if A*7+B >= C:
        cnt = 7
    else:
        week_num = math.floor(C / (A*7+B))
        cnt = week_num * 7
        coin = week_num * (A*7+B)

        if A*7 < C - coin:
            cnt += 7
        else:
            cnt += math.ceil((C - coin) / A)
else:
    cnt += math.ceil((C - coin) / A)
    
print(cnt)

Submission status: Accepted

Solution code:
import math
a, b, c=map(int,input().split())
w = a*7+b
x = c//w
y = c%w
if y <= a*7:
   print((7*x)+math.ceil(y/a))
else:
   print(7*(x+1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
week = a * 7 + b
d = c // week
ans = d * 7
c -= d * week

cnt = 0
while(c > 0):
    c -= a
    ans += 1
    cnt += 1
    if(cnt == 7):
        c -= b
        cnt = 0
print(ans)

Submission status: Accepted

Solution code:

def solve():
    A, B, C = map(int, input().split())
    count = 0
    coins = 0
    while True:
        if coins >= C:
            break
        count += 1
        coins += A
        if count % 7 == 0:
            coins += B
    print(count)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L=input().split( )
A,B,C=int(L[0]),int(L[1]),int(L[2])

w=C//(7*A+B)
m=C%(7*A+B)
d=m//A
if d>=7:
    d=7
else:
    if m%A!=0:
        d+=1
print(7*w+d)

Submission status: Accepted

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