Codechef•Apr 29, 2025
Minimum Cars required
Hazrat Ali
Codechef
N friends want to go to a restaurant for a party. Find the minimum number of cars required to accommodate all the friends.
Input Format
- The first line contains a single integer TT - the number of test cases. Then the test cases follow.
- The first and only line of each test case contains an integer NN - denoting the number of friends.
Output Format
For each test case, output the minimum number of cars required to accommodate all the friends.
Constraints
- 1≤T≤1000
- 2≤N≤1000
Sample 1:
Input
4 4 2 7 98
Output
1 1 2 25
Explanation:
Test Case 11: There are only 44 friends and a single car can accommodate 44 people. Thus, only 11 car is required.
Test Case 22: There are only 22 friends and a single car can accommodate 44 people. Thus, only 11 car is required
Test Case 33: There are 77 friends and 22 cars can accommodate 88 people. Thus, 22 cars are required.
Solution
import math
for _ in range(int(input())):
m=int(input())
ans=math.ceil(m/4)
print(ans)