Advertisement
Ivelin_Arsov

SpiceMustFlow

May 29th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SpiceMustFlow {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int startingYield = Integer.parseInt(scan.nextLine());
  7.         int dayCnt = 0;
  8.         int sumOfSpice = 0;
  9.         while (startingYield >= 100) {
  10.             dayCnt++;
  11.             sumOfSpice += startingYield;
  12.             sumOfSpice -= 26;
  13.             startingYield -= 10;
  14.             if (startingYield < 100){
  15.                 sumOfSpice -= 26;
  16.             }
  17.         }
  18.  
  19.         System.out.println(String.format("%d%n%d", dayCnt, sumOfSpice));
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement