Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(arr) {
- var w= Number(arr[0]); //hall length
- var h=Number(arr[1]); //hall width
- if (h>w) {
- h=w;
- }
- else if (h<3){
- h=3;
- }
- else {
- h=Number(arr[1]
- );
- }
- if (w<h){
- w=h;
- }
- else if (w>100){
- w=100;
- }
- else {
- w= Number(arr[0]);
- }
- var hallWidth = h-1;
- var placesPerWidth =Math.floor(hallWidth/0.7);
- var placesPerLength = Math.floor(w/1.20);
- var numberOfPlaces =placesPerWidth*placesPerLength -3;
- console.log(numberOfPlaces);
- };
Advertisement
Add Comment
Please, Sign In to add comment