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>

using namespace std;

int main()
{

    int sum, a, b;

    std::scanf("%d %d %d", &a, &b, &sum);
    int times = 0;
    int div = 0;

    if (sum > a * 7 + b) {
        div = sum / (a * 7 + b);
        times += 7 * div;
        sum -= ((a * 7 + b) * div);
    }


    if (sum > 6 * a) times += 7;
    else {
        times += (sum % a == 0) ? sum / a : sum / a + 1;
    }
    std::printf("%d\n", times);

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define DEBUG_ARR(v,n) cout<<#v<<":";REP(i,n)cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int a,b,c;
    cin>>a>>b>>c;

    ll coins = 0;

    int day=0;
    do{
        day++;
        coins += a;
        if(day%7==0) coins += b;
    }while(coins<c);

    cout << day << endl;
    return 0;
}

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

int main(){
  int A,B;
  long C;
  cin >> A >> B >> C;
  
  int cnt=0;
  for(int coin=0;coin<C;coin+=A){
    cnt++;
    if(cnt%7==0) coin+=B;
  }
  cout << cnt << endl;
}

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

int main(){
    int A, B, C;
    cin >> A >> B >> C;

    int res = 0;
    int count = 0;
    int week = 0;
    week = A * 7 + B;

    while (res + week <= C) {
        res += week;
        count += 7;
    }

    int rest = 0;
    rest = C - res;
    if (rest%A == 0){
        if (rest > 7*A){
            count += 7;
        } else {
            count += (rest/A);
        }
    } else {
        if (rest > 7*A){
            count += 7;
        } else {
            count += (rest/A) + 1;
        }
    }
    cout << count << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;  
    cin>>a;
    cin>>b;
    cin>>c;
    d=c/a;
    i=c%a;
    if(d<7){
        if(i<0){
           cout<<d<<endl;
        }else{
           cout<<d+1<<endl; 
        }
    }else{
        e=c/(a*7+b);
        f=c%(a*7+b);
        g=f/a;
        h=f%a;
        if(h<0){
            cout<<e*7+g<<endl;
        }else{
            cout<<e*7+g<<endl;
        }
    }
}

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

int main() {
	int A, B, C;
	cin >> A >> B >> C;

	int i = 0;
	int coin = 0;

	while( coin < C ) {
		++i;
		coin += A;

		if( i % 7 == 0 ) {
			coin += B;
		}
	}

	cout << i << endl;
}

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

#define FOR(i,start,end) for(int i=start; i<(int)(end); i++)
#define REP(i,n) FOR(i,0,n)
#define SIZE_OF_ARRAY(array)  (sizeof(array)/sizeof((array)[0]))

template<class T> void print(const T& value) { cout << value << "\n"; }

int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);

    int has_coin = 0;
    int day = 0;
    while(has_coin < c) {
        day += 1;
        has_coin += a;
        if(day % 7 == 0) {
            has_coin += b;
        }
    }
    printf("%d\n", day);


    return 0;
}

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

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 && i != 1) {
            ans += b;
        }
    }

    cout << i <<  endl;
}

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

	ans += c / a;
	if (c%a)
	{
		ans++;
	}

	cout << ans << endl;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
#include<list>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {1, 1, 0, -1, -1, 0};
int dx[] = {1, 0, -1, -1, 0, 1};
#define ceil(a, b) a / b + !!(a % b)

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int weeks = c / (7 * a + b);
    int days= weeks * 7;
    int coins = days * a + weeks * b;
    int rest = c - coins;
    days += (rest + a - 1) / a;
    cout << days << endl;
}

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

int main()
{
    int a, b, c, sum=0, login=0, bonus=0;
    cin >> a >> b >> c;
    while(sum < c)
    {
        sum += a;
        login++;
        bonus++;
        if(bonus == 7)
        {
            sum += b;
            bonus = 0;
        }
    }
    cout << login << endl;
}