Advertisement
CR7CR7

tab

Mar 4th, 2023
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.   public static void main(String[] args) {
  5.     Scanner scanner = new Scanner(System.in);
  6.  
  7.     float w = scanner.nextFloat();
  8.     float h = scanner.nextFloat();
  9.  
  10.     int chairH = 70;
  11.     int chairW = 120;
  12.  
  13.     float totalW = w * 100;
  14.     float totalH = h * 100;
  15.  
  16.     float freeRowH = totalH - 100;
  17.     float chairRowH = (int) freeRowH / chairH;
  18.  
  19.     float chairRowW = (int) totalW / chairW;
  20.  
  21.     int allChairs = (int) ((chairRowH * chairRowW) - 3);
  22.  
  23.     System.out.println(allChairs);
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement