Advertisement
Spocoman

07. House Painting

Dec 8th, 2021 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function housePainting(input) {
  2.     let x = parseFloat(input[0]);
  3.     let y = parseFloat(input[1]);
  4.     let h = parseFloat(input[2]);
  5.  
  6.     let green = 2 * x * y - 1.5 * 1.5 * 2 + x * x * 2 - 1.2 * 2;
  7.     let red = 2 * x * y + 2 * x * h / 2;
  8.  
  9.     console.log(`${(green / 3.4).toFixed(2)}\n${(red / 4.3).toFixed(2)}`);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement