#include #include #include #include #include #include #include #include #include #define maxn 200007 #define infm ((1<<30)-1) #define fst first #define scn second using namespace std; typedef pair PAf; typedef pair PA; typedef long long LL; typedef pair TA; int n,m,ans,tot; const int p=1000000007; LL qpow(LL a,LL b) { LL ans; for(ans=1;b;b>>=1,a=a*a%p) if(b&1)ans=ans*a%p; return ans; } LL getc(LL n,LL m) { if(nn-m)m=n-m; LL s1=1,s2=1; for(LL i=0;ie2+e3) return 0; return a1*mod_inv(a2*a3%p)%p; } int q[maxn]; int main() { int T=1; scanf("%d",&T); for (int cT=1;cT<=T;++cT) { tot=0; int k; scanf("%d%d%d",&n,&m,&k); for (int i=0;i=m) ++tmp; r=i; if (tmp==k) { break; } ++r; } LL ans=n-r; for (int i=1;i=m) --tmp; while (r+1=m) ++tmp; } if (tmp>=k) ans+=n-r; } cout<