ProdanTenev

trainingLab

Feb 8th, 2022 (edited)
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.68 KB | None | 0 0
  1. function trainingLab(input) {
  2.     let lenght = Number(input[0]);
  3.     let width = Number(input[1]);
  4.     let reservedSeats = 3;
  5.     let reservedSpace = 100;
  6.     // Едно работно място заема 70 на 120 cm
  7.     // Коридорът е широк поне 100 cm.
  8.     let convertedLenght = lenght * 100;
  9.     let convertedWidth = width * 100;
  10.     let widthAfterReservedSpace = convertedWidth - reservedSpace;
  11.     let workingPlacesWidth = Math.floor(widthAfterReservedSpace / 70);
  12.     let workingPlacesLenght = Math.floor(convertedLenght / 120);
  13.     let allWorkingPlaces = (workingPlacesLenght * workingPlacesWidth) - reservedSeats;
  14.     console.log(allWorkingPlaces);  
  15. }
Add Comment
Please, Sign In to add comment