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 startingYield = Integer.parseInt(scanner.nextLine());
- int workerConsumes = 26;
- int daysCount = 0;
- int totalAmountSpice = 0;
- if (startingYield >= 100) {
- while (startingYield >= 100) {
- totalAmountSpice += startingYield - workerConsumes;
- startingYield -= 10;
- daysCount++;
- }
- totalAmountSpice -= 26;
- }
- System.out.println(daysCount);
- System.out.println(totalAmountSpice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment