Runtime Error
正在同步测试数据,请稍后 [Hydro](https://hydro.ac)提供评测服务
代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("candy.in","r",stdin);
freopen("candy.out","w",stdout);
std::ios::sync_with_stdio(false);
long long n,l,r;cin>>n>>l>>r;
if(l-r>n)
{
cout<<n-1<<endl;
return 0;
}
if(l==r)
{
cout<<l%n<<endl;
return 0;
}
int p=r/n;
if(p>1)
{
cout<<n-1<<endl;
return 0;
}
else
{
cout<<r-n<<endl;
return 0;
}
return 0;
}