提交时间:2021-12-06 14:03:49

运行 ID: 33493

#include<bits/stdc++.h> using namespace std; int main() { freopen("candy.in","r",stdin); freopen("candy.out","w",stdout); long long r , y , z ; cin >> r >> y >> z ; y = y/r*r+r; if(y <= z) cout << r-1; else cout << z - z/r*r ; return 0; }