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 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.
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.
Input: 3
1 100
12 250
16 135
Output: 100
500
405
/* 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 >>