Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SpiceMustFlow {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int yield = Integer.parseInt(scanner.nextLine());
- int totalSpice = 0;
- int days = 0;
- while (yield >= 100) {
- days++;
- totalSpice += yield - 26;
- yield -= 10;
- }
- if (days > 0) {
- totalSpice -= 26;
- }
- System.out.println(days);
- System.out.println(totalSpice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement