题解:P5709 【深基2.习6】Apples Prologue / 苹果和虫子
Dark_Knight_AK_ALL · · 题解
思路:
有
代码:
#include<bits/stdc++.h>
using namespace std;
int m,t,s;
int main()
{
cin>>m>>t>>s;
if(t==0)
{
cout<<0<<endl;
return 0;
}
if(s%t==0)
{
if(m-s/t>=0)
cout<<m-s/t;
else cout<<0;
}
else
{
if(m-s/t-1>=0)
cout<<m-s/t-1;
else cout<<0;
}
return 0;
}