Ligh7_of_H3av3n

01.MiningRig

Oct 21st, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. package ZadachiOtIzpita2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class MiningRig {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int priceVIdeo = Integer.parseInt(scanner.nextLine());
  10.         int priceprovodnik = Integer.parseInt(scanner.nextLine());
  11.         double pricePerDay = Double.parseDouble(scanner.nextLine());
  12.         double profitPerDay = Double.parseDouble(scanner.nextLine());
  13.  
  14.         double totalSpent = (priceVIdeo + priceprovodnik) * 13 + 1000;
  15.         double totalNetIncPerGpu = (profitPerDay - pricePerDay) * 13;
  16.  
  17.         System.out.printf("%.0f\n", totalSpent);
  18.         System.out.printf("%.0f", Math.ceil(totalSpent / totalNetIncPerGpu));
  19.     }
  20. }
  21.  
Add Comment
Please, Sign In to add comment