C. Joyboard
样例1列表找规律:
#include<iostream>
#define int long long
using namespace std;
signed main()
{
int T;cin>>T;
while(T--){
int n,m,k;cin>>n>>m>>k;
if(k==1){
cout<<1<<endl;
}else if(k==2){
cout<<min(n-1,m)+m/n<<endl;
}else if(k==3){
cout<<m-min(n-1,m)-m/n<<endl;
}else{
cout<<0<<endl;
}
}
}