提交时间:2022-11-26 11:00:46

运行 ID: 66139

#include<bits/stdc++.h> using namespace std; int main() { long long n,l,r,s; scanf("%ld%ld%ld",&n,&l,&r); s=l%n; if(s+(r-l)>=n-1){ cout<<n-1; } else{ cout<<max(l%n,r%n); } return 0; }