Advertisement
Spocoman

09. Spice Must Flow

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