Advertisement
noshin98

uva 11313

Dec 15th, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,t,n,m;
  5.     scanf("%d",&t);
  6.  
  7.         for(i=0;i<t;i++)
  8.         {
  9.             scanf("%d %d",&n,&m);
  10.             if((n-1)%(m-1)!=0)
  11.             {
  12.                 puts("cannot do this");
  13.             }
  14.             else
  15.             {
  16.                 printf("%d\n",(n-1)/(m-1));
  17.             }
  18.         }
  19.         return 0;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement