CodechefApr 20, 2025

Minimum Pizzas

Hazrat Ali

Codechef

Each pizza consists of 44 slices. There are NN friends and each friend needs exactly XX slices.

Find the minimum number of pizzas they should order to satisfy their appetite.

Input Format

  • The first line of input will contain a single integer TT, denoting the number of test cases.
  • Each test case consists of two integers NN and XX, the number of friends and the number of slices each friend wants respectively.

Output Format

For each test case, output the minimum number of pizzas required.

Constraints

  • 1≤T≤100
  • 1≤N,X≤10

Sample 1:

Input
 
4
1 5
2 6
4 3
3 5
Output
2
3
3
4
 

Explanation:

Test case 11: There is only 11 friend who requires 55 slices. If he orders 11 pizza, he will get only 44 slices. Thus, at least 22 pizzas should be ordered to have required number of slices.

Test case 22: There are 22 friends who require 66 slices each. Thus, total 1212 slices are required. To get 1212 slices, they should order 33 pizzas.

Test case 33: There are 44 friends who require 33 slices each. Thus, total 1212 slices are required. To get 1212 slices, they should order 33 pizzas.

Test case 44: There are 33 friends who require 55 slices each. Thus, total 1515 slices are required. To get 1515 slices, they should order at least 44 pizzas.

 

Solution

for _ in range(int(input())):
    m,n=map(int, input().split())
    p=(m*n)
    if p%4==0:
        print(int(p/4))
    else:
        print(int(p/4)+1)

 

 

 

Comments