**Physical Address**

304 North Cardinal St.

Dorchester Center, MA 02124

A new TV streaming service was recently started in Chefland called the Chef-TV.

A group of N*N* 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 X*X* rupees. Determine the minimum total cost that the group of N*N* friends will incur so that everyone in the group is able to use Chef-TV.

- The first line contains a single integer T
*T*— the number of test cases. Then the test cases follow. - The first and only line of each test case contains two integers N
*N*and X*X*— the size of the group of friends and the cost of one subscription.

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.

- 1≤
*T*≤1000 - 1≤
*N*≤100 - 1≤
*X*≤1000

```
Input: 3
1 100
12 250
16 135
Output: 100
500
405
```

**Test case 1:**There is only one person in the group. Therefore he will have to buy 11 subscription. Therefore the total cost incurred is 100100.**Test case 2:**There are 1212 people in the group. Therefore they will have to buy 22 subscriptions. Therefore the total cost incurred is 500500.**Test case 3:**There are 1616 people in the group. Therefore they will have to buy 33 subscriptions. Therefore the total cost incurred is 405405

```
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while (t-- > 0) {
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int x = Integer.parseInt(st.nextToken());
System.out.println((int)(Math.ceil(n / 6.0) * x));
}
}
}
```

```
# cook your dish here
import math as m
for i in range(int(input())):
a,b=map(int,input().split())
print(m.ceil(a/6)*b)
```

```
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n, x;
cin>>n>>x;
cout<<((n/6) + (n%6?1:0))*x<<endl;
}
return 0;
}
```

In our experience, we suggest you solve this Subscriptions CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.

If you are stuck anywhere between any coding problem, just visit Queslers to get the Subscriptions CodeChef Solution

I hope this Subscriptions CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.

This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.

Keep Learning!

**More Coding Solutions >>**