Go: package main

import (
	"fmt"
)

func calcDay(daily, bonus, req int) int {
	fullWcoin   := 7 * daily + bonus	//"週給"
	sixDaycoin := 6 * daily				//6日目まででもらえるコイン

	week := req / fullWcoin //必要満週数
	day := 0
	rem  := req % fullWcoin
		
		if sixDaycoin < rem && rem < fullWcoin {
			week++
		} else {
			day = rem / daily
				if rem % daily > 0 {
					day++
				}
		}

	return 7 * week + day
}

func main() {
	var daily, bonus, req int
		fmt.Scanf("%d %d %d",&daily ,&bonus ,&req)
		fmt.Printf("%d\n",calcDay(daily, bonus, req))
}

C++: #include<iostream>
#include<cstdio>
using namespace std;

int main(){
    int coin_d, coin_b, norma,day;
    scanf("%d %d %d",&coin_d,&coin_b,&norma);
    day = (norma/(coin_d*7+coin_b))*7;
    if((norma%(coin_d*7+coin_b))/coin_d >= 7){
        day = day+7;
    }else if((norma%(coin_d*7+coin_b))%coin_d > 0){
        day = day + (norma%(coin_d*7+coin_b))/coin_d + 1;
    }else{
        day = day + (norma%(coin_d*7+coin_b))/coin_d;
    }
    cout << day << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; i < (long long)n; i++)
#define _GLIBCXX_DEBUG
#define ll long long
using namespace std;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, B, C;
    cin >> A >> B >> C;
    ll W = (7 * A) + B;
    ll T = C % W;
    cout << ((C / W) * 7) + min(7, (int)((T + A - 1) / A)) << endl;
}

C++: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
 
 
 
 
int main(){
 
    int A,B,C;
 
    scanf("%d %d %d",&A,&B,&C);
 
    int ans = C,left = 0,right= C,mid = (left+right)/2;
 
    while(left <= right){
 
        if(mid*A+mid/7*B >= C){
 
            ans = mid;
            right = mid-1;
 
        }else{
 
            left = mid+1;
        }
        mid = (left+right)/2;
    }
 
    printf("%d\n",ans);
 
    return 0;
}

C++: #include <iostream>
using namespace std;

int main(void){
    int a,b,c;
    cin>>a>>b>>c;
    int n=c/(a*7+b);
    int rem=c-n*(a*7+b);
    cout<<n*7+(rem-rem%a)/a<<endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
	int a, b, c;
	cin>>a>>b>>c;
	int cnt = 0;
	int sum = 0;
	while(sum < c)
	{
		sum+=a;
		cnt++;
		if(cnt % 7 == 0)
			sum += b;
	}
	cout<<cnt<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;

  int count = 0;
  int point = 0;
  while(1) {
    count++;
    point+=a;
    //cout << count << " " << point << endl;
    if(count % 7 == 0) point+=b;
    if(point >= c) {
      cout << count << endl;
      break;
    }
  }

  return 0;
}

C++: #include <iostream>

int cutBySeven(int x)
{
  if (x > 7){
    return 7;
  }else{
    return x;
  }
}

int main()
{
  // データ準備
  int a, b, c;

  std::cin >> a >> b >> c;

  // 1週間ログインするともらえるコイン
  int coinPerWeek = 7*a+b;

  // 最低何週間のログインが必要か
  int minimumWeek = c/coinPerWeek;

  // minimumWeek 週間のログインで足りない分のコイン
  int luck = c%coinPerWeek;

  // luck 分のコインを集めるのに必要な日数
  int daysForLuck = cutBySeven((luck%a==0) ? luck/a : luck/a+1);

  // 出力
  std::cout << minimumWeek*7+daysForLuck << '\n';
}

C++: #include <iostream>
using namespace std;
int main(void){

    int a,b,c;
    cin >> a >> b >> c;
    int score = 0;
    for(int day = 1; ; day++){
        score += a;
        if(day % 7 == 0){
            score += b;
        }
        if(score >= c){
            cout << (day) << endl;
            break;
        }
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A, B, C; cin >> A >> B >> C;
    int ans = 0;
    while(C > 0)
    {
        int res = 0;
        if(C >= 7 * A)
        {
            C -= 7 * A + B;
            res += 7;
        }
        else
        {
            res += (C + A - 1) / A;
            C = 0;
        }
        ans += res;
    }
    cout << ans << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    
        int A, B, C;
        cin >> A >> B >> C;
        int ans = 0;
        int i = 0;
        
        while(true){
            i++;
            if(i%7 != 0){
                C-=A;
                ans++;
                if(C <= 0) break;
            }
            else{
                C-=(A+B);
                ans++;
                    if(C <= 0) break;
            }
            
        }
        
        cout << ans << endl;

}

C++: #include <bits/stdc++.h>

using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int now = 0;
    int day = 0;
    while (now < c) {
        now += a;
        ++day;
        if (day % 7 == 0) {
            now += b;
        }
    }
    cout << day << '\n';
}

C++: #include<iostream>
using namespace std;

int main() {


int A , B , C = 0 ;	// A:毎日もらえるコイン数 , B:7日連続ログインでもらえるコイン数 , C:手に入れたい総コイン数


int days = 0 ; 
int week_day_count = 0 ; // 週の何日目かのカウント。月曜日:1 , 火曜日:2 , …　土曜日:6 , 日曜日:7

cin >> A >> B >> C ;


	while( C > 0 ){
	
	days = days + 1 ;			// 「経過日数」を1追加
	week_day_count = week_day_count + 1 ;	// 週の何日目かのカウントを1追加

	C = C - A ;				// 毎日のログインボーナスの処理

		if( 7 == week_day_count ) 	//「日曜日になったとき」の処理。if( week_day_count == 7 )としなかったのはミス防止
		{ C = C - B ; 
		  week_day_count = 0 ;		// 週の何日目かのカウントを0にする。
		}else{				// C++ではelse{}は省略可
		}

		if( C <= 0 ) 			// Cが0未満になったときループを抜ける
		{
		break;
		}else{				// C++ではelse{}は省略可
		}
    

	}

cout << days << endl;

}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    for (int i = 1;; i++) {
        c -= a;
        if (i % 7 == 0) c -= b;
        if (c <= 0) {
            cout << i << endl;
            break;
        }
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c,i=0,x=0;
    cin>>a>>b>>c;
    while(1){
        i++;
        x=x+a;
        if(i%7==0){
            x=x+b;
        }
         if(c<=x){
            break;
        }
    }
    cout<<i<<endl;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int a, b, c, ans, w;

int main()
{
    cin >> a >> b >> c;
    while (c > 0){
        ans++;
        w++;
        if (w == 7)w = 0, c -= b;
        c -= a;
    }
    cout << ans << endl;
}

C++: /*17D8103001E Fukushima Emi persimmon8 c++ 19.10.31*/

#include<iostream>
using namespace std;

int min(int a,int b,int n){
  int c=0,m=0;

  if(n<a) return 1;
  else if(n<7*a){
    while(1){
      m+=a;
      c++;
      if(m>=n) break;
    }
    return c;
  }else{
    while(1){
      m+=a;
      c++;
      if(c%7==0) m+=b;
      if(m>=n) break;
    }
    return c;
  }
  return c;
}

int main(){
  int n,a,b;
  cin>>a>>b>>n;
  //cout<<n<<a<<b;
  
  int ans=min(a,b,n);
  cout<<ans<<endl;

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int ans = 0;
    int i=0;
    while(ans<c){
        
        i++;
        ans += a;
        if(i%7==0)ans+=b;
        
    }
    cout<<i<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int A,B,C;
  cin>>A>>B>>C;
  int a=0;
  int count=0;
  while(count<C){
    count+=A;
    a++;
    if(a%7==0) count+=B;
    
  }
  cout<<a<<endl;;
  return 0;
}