Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int i,t,n,m;
- scanf("%d",&t);
- for(i=0;i<t;i++)
- {
- scanf("%d %d",&n,&m);
- if((n-1)%(m-1)!=0)
- {
- puts("cannot do this");
- }
- else
- {
- printf("%d\n",(n-1)/(m-1));
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement