https://www.luogu.com.cn/problem/P7909
/* P7909 [CSP-J 2021] 分糖果 方法二 好 https://www.luogu.com.cn/problem/P7909 */ #include <bits/stdc++.h> using namespace std; int main() { int N,L,R; cin>>N>>L>>R; if( L/N == R/N ) { cout<<R%N; } else { cout<<N-1; } return 0; }