Advertisement
Guest User

Spice Must Flow

a guest
Apr 8th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5. public class DataTypeSpiceMustFlow {
  6.     public static void main(String[] args) throws IOException {
  7.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  8.  
  9.         int spice = Integer.parseInt(reader.readLine());
  10.  
  11.         int daysCount = 0;
  12.         int workersConsume = 0;
  13.         int totalSpice = 0;
  14.  
  15.  
  16.         while (spice >= 100){
  17.  
  18.             daysCount++;
  19.  
  20.             workersConsume = spice - 26;
  21.             totalSpice += workersConsume;
  22.  
  23.             spice -= 10;
  24.  
  25.         }
  26.         totalSpice -= 26;
  27.  
  28.         System.out.println(daysCount);
  29.         System.out.println(totalSpice);
  30.  
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement