题解:P5709 【深基2.习6】Apples Prologue / 苹果和虫子
简单题,题目好心地提醒了我们要特判
当
所以这就不能算一个完整的苹果,要将答案减去
代码实现:
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int m, t, s;
cin >> m >> t >> s;
if (t == 0) cout << 0 << '\n';
else {
int ans = m - s / t;
if (s % t != 0) ans--;
cout << max(0, ans) << '\n';
}
return 0;
}