Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7. int n, k;
  8.  
  9. cin >> n >> k;
  10.  
  11. if (n <= k) {
  12. cout << 2;
  13. } else {
  14. if ((n * 2) % k == 0) {
  15. cout << n * 2 / k;
  16. } else {
  17. cout << n * 2 / k + 1;
  18. }
  19. }
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement