P10056 题解

可以把所有的水集中在一起,也就是 \(b \times n\),然后判断 \(b \times n\) 是否大于 \(a\),真则输出,若为假,那么最多有 \(\left\lfloor\dfrac{a}{b}\right\rfloor \times b\) 体积的水,输出即可。

#include<bits/stdc++.h>

using namespace std;

long long a, b, n;

int main() {
    cin >> a >> b >> n;
    if (n * b < a) cout << b * n;
    else cout << a / b * b;
    return 0;
}
posted @ 2024-01-14 19:14  FurippuWRY  阅读(24)  评论(0)    收藏  举报