Codechef•Apr 15, 2025
Subscriptions
Hazrat Ali
Codechef
A group of NN friends in Chefland want to buy Chef-TV subscriptions. We know that 66 people can share one Chef-TV subscription. Also, the cost of one Chef-TV subscription is XX rupees. Determine the minimum total cost that the group of NN friends will incur so that everyone in the group is able to use Chef-TV.
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 two integers NN and XX — the size of the group of friends and the cost of one subscription.
Output Format
For each test case, output the minimum total cost that the group will incur so that everyone in the group is able to use Chef-TV.
Constraints
- 1≤T≤1000
- 1≤N≤100
- 1≤X≤1000
Sample 1:
Input
3 1 100 12 250 16 135
Output
100 500 405
Solution
import math
for _ in range(int(input())):
m,n=map( int, input().split())
print(math.ceil(m/6)*n)