Didart

Spice Must Flow

Jun 9th, 2021
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SpiceMustFlow {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int startingYield = Integer.parseInt(scanner.nextLine());
  8.        
  9.         int workerConsumes = 26;
  10.         int daysCount = 0;
  11.         int totalAmountSpice = 0;
  12.  
  13.         if (startingYield >= 100) {
  14.             while (startingYield >= 100) {
  15.                 totalAmountSpice += startingYield - workerConsumes;
  16.                 startingYield -= 10;
  17.                 daysCount++;
  18.             }
  19.             totalAmountSpice -= 26;
  20.         }
  21.         System.out.println(daysCount);
  22.         System.out.println(totalAmountSpice);
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment