Water
不难发现,我们期望把尽可能多的杯子里面的水集中到一个杯子里面去。
所以存在以下两种情况:
-
可以把所有杯子里面的水集中到一个杯子里面,这个时候答案就是 。
-
或者,一个杯子最多只能装下 个杯子中的全部水,不能集中全部杯子的。这个时候答案就是 。
#include<bits/stdc++.h>
using namespace std;
int main(){
// freopen("text2.in","r",stdin);
// freopen("text2.out","w",stdout);
long long a,b,n;
cin>>a>>b>>n;
if(b*n<=a) cout<<b*n<<endl;
else cout<<a/b*b<<endl;
}