Algorithm


problem Link - :https://www.codechef.com/problems/BIRYANI 

Problem

According to a recent survey, Biryani is the most ordered food. Chef wants to learn how to make world-class Biryani from a MasterChef. Chef will be required to attend the MasterChef's classes for � weeks, and the cost of classes per week is � coins. What is the total amount of money that Chef will have to pay?

Input Format

  • The first line of input will contain an integer � — the number of test cases. The description of � test cases follows.
  • The first and only line of each test case contains two space-separated integers � and �, as described in the problem statement.

Output Format

For each test case, output on a new line the total amount of money that Chef will have to pay.

Constraints

  • 1≤�≤104
  • 1≤�,�≤100

Sample 1:

Input
 
Output
 
4
1 10
1 15
2 10
2 15
10
15
20
30

Explanation:

Test case 1: Chef will be required to attend the MasterChef's classes for 1 week and the cost of classes per week is 10 coins. Hence, Chef will have to pay 10 coins in total.

Test case 2: Chef will be required to attend the MasterChef's classes for 1 week and the cost of classes per week is 15 coins. Hence, Chef will have to pay 15 coins in total.

Test case 3: Chef will be required to attend the MasterChef's classes for 2 weeks and the cost of classes per week is 10 coins. Hence, Chef will have to pay 20 coins in total.

Test case 4: Chef will be required to attend the MasterChef's classes for 2 weeks and the cost of classes per week is 15 coins. Hence, Chef will have to pay 30 coins in total.

Code Examples

#1 Code Example with C Programming

Code - C Programming

#include<stdio.h>
int main(void) {
	int t,x,y;
	scanf("%d",&t);
	while(t--)
	{
	    scanf("%d %d",&x,&y);
	    printf("%d\n",x*y);
	}
	return 0;
}
Copy The Code & Try With Live Editor

Input

x
–
+
cmd
4
1 10
1 15
2 10
2 15

Output

x
–
+
cmd
10
15
20
30
Advertisements

Demonstration


CodeChef solotion BIRIYANI - Biryani classes CodeChef solotion in C,C++

Previous
CodeChef solution FIT - Fitness Codechef solution in C,C++
Next
CodeChef solution PRACLIST - How many unattempted problems Codechef solution in C.C++