Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int firstEmployeeEfficiency = Integer.parseInt(scanner.nextLine());
- int secondEmployeeEfficiency = Integer.parseInt(scanner.nextLine());
- int thirdEmployeeEfficiency = Integer.parseInt(scanner.nextLine());
- int studentsCount = Integer.parseInt(scanner.nextLine());
- int studentsCounter = 0;
- int hoursCounter = 0;
- int hours = 0;
- while (studentsCount > studentsCounter) {
- studentsCounter = studentsCounter + firstEmployeeEfficiency + secondEmployeeEfficiency
- + thirdEmployeeEfficiency;
- hoursCounter++;
- hours ++;
- if (hoursCounter % 4 == 0) {
- hours++;
- }
- }
- System.out.printf("Time needed: %dh.", hours);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment