Advertisement
SUni2020

Bricks

Mar 28th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Bricks {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int x = Integer.parseInt(scanner.nextLine());
  7. int w = Integer.parseInt(scanner.nextLine());
  8. int m = Integer.parseInt(scanner.nextLine());
  9.  
  10. int bricksInOneCourse = w * m;
  11.  
  12. double totalCourses = Math.ceil( (double) x / bricksInOneCourse);
  13. System.out.print(totalCourses);
  14.  
  15.  
  16.  
  17.  
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement