Guest User

Untitled

a guest
May 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include<algorithm>
  4. #include<math.h>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int t,n,k,i,j,coke,a;
  10. scanf("%d",&t);
  11. j=0;
  12. for (i=1;i<=t;i++)
  13. {
  14. scanf ("%d %d",&n,&k);
  15. a=n;
  16. coke=n;
  17. while(a>=k)
  18. {
  19. a=n-k+1;
  20. n=a;
  21. coke++;
  22.  
  23.  
  24. }
  25. printf("Case %d: %d\n",i,coke);
  26. }
  27. return 0;
  28. }
Add Comment
Please, Sign In to add comment