Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int m,n,count=0,i,j,k,t;
- cin>>t;
- while(t--)
- {
- count=0;
- cin>>n>>m;
- while(n>=m)
- {
- n=n-m+1;
- count++;
- }
- if(n==1)
- cout<<count<<endl;
- else
- cout<<"cannot do this"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement