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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (int i = m; i < (n); ++i)
using namespace std;
using ll = long long;

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int ans;
    ans = c / (7 * a + b);
    int sa = c % (7 * a + b);
    vector<int> s = {a,a,a,a,a,a,a+b};
    int cnt = 0;
    while (sa > 0){
        sa -= s[cnt];
        cnt++;
    }
    ans = ans * 7 + cnt;
    cout << ans << endl;
}

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

int main(){
  int a,b,c,d,e,f,g;
  scanf("%d%d%d",&a,&b,&c);
  d = c / (a*7+b);
  e = c % (a*7+b);
  f = e / a;
  g = e % a;
  if(g == 0){
    printf("%d\n",min(7*d+f,7*(d+1)));
  }
  else{
    printf("%d\n",min(7*d+f+1,7*(d+1)));
  }
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define enld endl

int main() {
	lint A, B, C;
	cin >> A >> B >> C;
	lint now = 0;
	lint cnt = 0;
	while (1) {
		now += A;
		if (cnt % 7 == 6) {
			now += B;
		}
		if (now >= C) {
			cout << cnt+1 << endl;
			break;
		}
		cnt++;
	}
}

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

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

	cin >> a >> b >> c;
	cout << (c / (a * 7 + b)) * 7 + min((c % (a * 7 + b) + a - 1) / a, 7) << endl;

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 105
const int INF = 1e9 + 7;



int main() {

	int a, b, c;
	cin >> a >> b >> c;

	int ans = 7 * (c / (7 * a + b));
	//cout << a << " " << b << " " << c << endl;
	c -= (7 * a + b) * (c / (7 * a + b));
	
	//cout << c << endl;
	ans += (c) / a + c % a;

	cout << ans << endl;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int week = a * 7 + b;
  int day = a;
  cout << min((c / week) * 7 + ((c % week + day - 1) / day), ((c + week - 1) / week) * 7) << endl;
  return 0;
}

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

int main() {
    int a, b, c; cin >> a >> b >> c;
    const int set = 7 * a + b,
          week = c / set,
          rest = c % set;
    double additional_days;
    if (rest > 7 * a)
        additional_days = 7;
    else {
        float tmp = (float)rest / a;
        // test begin -----
        //cout << "tmp: " << tmp << endl;
        // test end -----
        additional_days = ceil(tmp);
    }

    int result = 7 * week + additional_days;
    cout << result << endl;
    // test
    /*
       cout << "set: " << set << endl
       << "week: " << week << endl
       << "rest: " << rest << endl
       << "additional_days: " << additional_days << endl;
    */
}

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int a, b, c; cin >> a >> b >> c;
    int coins = 0;
    int ans = 0;
    while(true) {
        if(coins >= c) break;
        coins += a;
        ans++;
        if(ans%7 == 0) coins += b;
    }
    cout << ans << '\n';
    return 0;
}

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

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    int d=c/(a*7+b);
    int e=c%(a*7+b);
    if(e%a!=0){
        if(e>a*7){
            cout << d*7+7 << endl;
            return 0;
        }
        cout << d*7+e/a+1 << endl;
        return 0;
    }
    else
    {
        if(e>a*7){
            cout << d*7+7 << endl;
            return 0;
        }
        cout << d*7+e/a << endl;
        return 0;
    }
    
}

C++: #include<iostream>

int main(){
  int A,B,C;
  std::cin>>A>>B>>C;
  int coin_count=0,day=0;
  while(coin_count<C){
    day++;
    coin_count+=A;
    if(day%7==0){
      coin_count+=B;
    }
    if(coin_count>=C)break;
  }
  std::cout<<day<<std::endl;
  return 0;
}

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

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

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

// GCD, LCM
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
 
int main()
{
    int A,B,C,temp=0,ans=0;
    cin>>A>>B>>C;

    while(1){
        ans++;
        temp+=A;
        if(ans%7==0)temp+=B;
        if(temp>=C)break;
    }

    cout<<ans<<endl;
 
    return 0;
}

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

int main(){
    
    int cA,cB,cC;
    int mResult=0;
    
    cin>>cA>>cB>>cC;
    
    while(cC>0){
        mResult++;
        cC-=cA;
        if(!(mResult%7)){
            cC-=cB;
        }
    }
    
    cout<<mResult<<endl;
    
    return 0;
}