#include<bits/stdc++.h>
using namespace std;
int main(){
a是题目中的N b是题目中的L c是题目中的R
int a,b,c,max=0;
cin >> a >> b >> c;
if(b==c){
cout << b%a;
}
else if(c-b<a&&b%a==0){
cout << a-1;
}
else{
for(int i=(c+b)/2;i<=c;i++){
if(max<i%a){
max=i%a;
}
}
cout << max;
}
return 0;
}
有什么HACK数据吗