Advertisement
ErolKZ

Untitled

Nov 25th, 2021
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1.  
  2. let input = [
  3.  
  4. // '5 8 4 1'
  5.  
  6. '5 3 2 3'
  7.  
  8. ];
  9.  
  10.  
  11. let print = this.print || console.log;
  12. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  13.  
  14.  
  15. let arr = gets().split(' ');
  16.  
  17. // console.log(arr);
  18.  
  19.  
  20. let T = arr[0];
  21.  
  22. let N = arr[1];
  23.  
  24. let S = arr[2];
  25.  
  26. let P = arr[3];
  27.  
  28. let targetBoats = T * N;
  29.  
  30.  
  31. let boatPerPacket = S * P;
  32.  
  33. console.log(targetBoats, boatPerPacket);
  34.  
  35.  
  36. let paperNeeded = targetBoats / boatPerPacket;
  37.  
  38. print(Math.ceil(paperNeeded));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement