#include #define rep(i,a,b) for(int i=int(a);i> L >> R >> M; cout << min(R-L+1, M) << endl; }