提交时间:2021-12-06 13:54:46

运行 ID: 33464

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