Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Elevator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int numberOfPeople = Integer.parseInt(scanner.nextLine());
- int capacityOfElevator = Integer.parseInt(scanner.nextLine());
- // int fullCourses = (int)Math.ceil((double)numberOfPeople / capacityOfElevator);
- int courses = (int)Math.ceil((double)numberOfPeople / capacityOfElevator);
- int fullCourses = courses % numberOfPeople;
- System.out.println(fullCourses);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment