#include<bits/stdc++.h> using namespace std; int main(){ int n,l,r; cin>>n>>l>>r; if(r-l+1>=n) cout<<n-1; else cout<<r%n; return 0; }
测试点4过不了 输入 4321 5678 9876 输出 4320 正确结果1234 求帮助