Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = [
- // '5 8 4 1'
- '5 3 2 3'
- ];
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- let arr = gets().split(' ');
- // console.log(arr);
- let T = arr[0];
- let N = arr[1];
- let S = arr[2];
- let P = arr[3];
- let targetBoats = T * N;
- let boatPerPacket = S * P;
- console.log(targetBoats, boatPerPacket);
- let paperNeeded = targetBoats / boatPerPacket;
- print(Math.ceil(paperNeeded));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement