-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuantityRequired.java
25 lines (18 loc) · 1013 Bytes
/
QuantityRequired.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
Challenge
Each pizza is made up of 4 slices. There are N friends and each friend needs exactly X slices. You will have to create code capable of calculating the minimum number of pizzas they must order to satisfy their appetite.
Input
The first line of input will contain a single integer T, indicating the number of test cases. Each test case consists of two integers. N for the number of friends and X for the amount of slice each friend wants.
Output
For each test case, produce the minimum number of pizzas required, as shown in the example below:
There is only 1 friend who needs 5 slices. If he sends 1 pizza, he will only receive 4 slices. So at least 2 pizzas must be ordered to have the required number of slices.
*/
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
final int SLICE = 4;
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt();
// TODO: Return the number of pizzas needed to fill the order.
}
}