fork(2) download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define ll long long
  6. #define ull unsigned long long
  7.  
  8. #define fi first
  9. #define se second
  10.  
  11. #define FOR(x, y, z) for (int z = x; z < y; z++)
  12. #define FORD(x, y, z) for (int z = x; z > y; z--)
  13.  
  14. const int INF = 1e9 + 7;
  15.  
  16. void solve(){
  17. int n, k;
  18. cin >> n >> k;
  19. if (n % k == 0){
  20. cout << 1 << "\n";
  21. return;
  22. }
  23. int new_k = k;
  24. while (new_k < n){
  25. new_k += k;
  26. }
  27. cout << (new_k + n-1) / n << "\n";
  28. }
  29.  
  30. void testcases(){
  31. int t;
  32. cin >> t;
  33. while(t){
  34. solve();
  35. t--;
  36. }
  37. }
  38.  
  39. int main(){
  40. ios::sync_with_stdio(0);
  41. cin.tie(nullptr); cout.tie(nullptr);
  42. testcases();
  43. //solve();
  44. return 0;
  45. }
Success #stdin #stdout 0s 4980KB
stdin
10
1000000000 1000000000

1000000000 999999999

1000000000 999999998

1000000000 999999997

1000000000 999999996

1000000000 999999995

1000000000 999999994

1000000000 999999993

1000000000 999999992

1000000000 999999991
stdout
1
-1
-1
-1
-1
-1
-1
-1
-1
-1