fork download
  1. #include <iostream>
  2. #include <iterator>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. ios::sync_with_stdio(0);
  8. cin.tie(nullptr);
  9. cout.tie(nullptr);
  10. istream_iterator<int> sin(cin);
  11. ostream_iterator<int> sout(cout,"\n");
  12. for(int t=*sin;t--;)
  13. {
  14. int n=*(++sin),k=*(++sin);
  15. *(sout++)=(k*((n+k-1)/k)+n-1)/n;
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 4868KB
stdin
4
1 5
4 3
8 8
8 17
stdout
5
2
1
3