返回题解分享
讨论 / 题解分享/ 帖子详情

刷题统计(编程题) - 题解

#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main()
{
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);
    LL a = 0,b = 0,n = 0;
    std::cin >> a >> b >> n;

    LL discuss = (n / (a * 5 + b * 2)) * 7;
    LL remainder = n % (a * 5 + b * 2);
    
    for (int i = 0; i < 5 && remainder > 0; i++) {
        ++discuss;
        remainder -= a;
    }
    for (int j = 0; j < 2 && remainder > 0; j++) {
        ++discuss;
        remainder -= b;
    }
    std::cout << discuss;
    return 0;
}
0 回复 0 转发 0 喜欢 1 阅读
回复 (0)
默认 最新
暂无回复,快来抢沙发!