YavorJS

Training Lab

May 8th, 2016
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function solve(arr) {
  2. var w= Number(arr[0]); //hall length
  3. var h=Number(arr[1]); //hall width
  4. if (h>w) {
  5. h=w;
  6. }
  7. else if (h<3){
  8. h=3;
  9. }
  10. else {
  11. h=Number(arr[1]
  12. );
  13. }
  14.  
  15. if (w<h){
  16. w=h;
  17. }
  18. else if (w>100){
  19. w=100;
  20. }
  21. else {
  22. w= Number(arr[0]);
  23. }
  24.  
  25. var hallWidth = h-1;
  26. var placesPerWidth =Math.floor(hallWidth/0.7);
  27.  
  28. var placesPerLength = Math.floor(w/1.20);
  29.  
  30. var numberOfPlaces =placesPerWidth*placesPerLength -3;
  31. console.log(numberOfPlaces);
  32.  
  33.  
  34. };
Advertisement
Add Comment
Please, Sign In to add comment