lanqiao 2098 刷题统计(数学优化)

This commit is contained in:
2025-03-29 17:26:44 +08:00
parent f5d902c81a
commit a2023ec9f0

24
13lanqiao/test3-2.cpp Normal file
View File

@@ -0,0 +1,24 @@
// 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
*/