You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
381 B

#include <bits/stdc++.h>
using namespace std;
// 如果 l,r之间的跨度大于等于一个n, 那么我们肯定可以想办法拿到n-1
// 如果l,r之间的跨度小于一个n,那么r%n就是答案
int main() {
int n, l, r;
cin >> n >> l >> r;
if (l / n == r / n)
cout << r % n << endl;
else
cout << n - 1 << endl;
return 0;
}