Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package TestJan;
- import java.util.Scanner;
- public class Sandbox {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double a = Double.parseDouble(scanner.nextLine());
- double b = Double.parseDouble(scanner.nextLine());
- double price = Double.parseDouble(scanner.nextLine());
- double pricePerKg = Double.parseDouble(scanner.nextLine());
- double area = a * b;
- double areaSand = (a - 0.4) * (b - 0.4);
- double borders = area - areaSand;
- double sand = Math.ceil(areaSand * 20);
- double pipes = Math.ceil(borders / 0.44);
- double sum = sand * price + pipes * pricePerKg;
- System.out.printf("%.2f", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement