#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k,c,ans1,ans2,numx1,numx0,x;
while(cin>>n>>k>>c)
{
x=k/n;
numx1=k-x*n;
numx0=n-numx1;
if(x*n>=c)
{
printf("%d\n",c);
continue;
}
ans1=c+numx0;
ans2=n-k/(x+1)+c;
printf("%d\n",min(ans1,ans2));
}
}
51nod 1246 罐子和硬币
最新推荐文章于 2022-05-03 20:20:10 发布