24 lines
547 B
C++
24 lines
547 B
C++
// lanqiao 2098 刷题统计(数学优化)
|
|
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
#define int long long
|
|
signed main(){
|
|
int a, b, n; cin >> a >> b >> n;
|
|
int d = 5 * a + 2 * b;
|
|
if(n % d == 0) cout << (n/d)*7 << endl;
|
|
else{
|
|
int r = n % d, sum = 0;
|
|
for(int i = 1; i <= 7; i++){
|
|
if(i <= 5) sum += a;
|
|
else sum += b;
|
|
if(sum >= r){
|
|
cout << (n/d)*7 + i << endl;
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
/* test samples -> 8
|
|
10 20 99
|
|
*/ |