Janmansh and Coins CodeChef Solution

Problem – Janmansh and Coins CodeChef Solution

Janmansh received X coins of 10 rupees and Y coins of 5 rupees from Chingari. Since he is weak in math, can you find out how much total money does he have?

Input Format

  • The first line will contain T – the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains two integers XY – the number of 10 and 5 rupee coins respectively.

Output Format

For each test case, output how much total money does Janmansh have.

Constraints

  • 1≤T≤100
  • 0≤X,Y≤100

Sample 1:

Input: 2
2 1
3 4
Output: 25
50

Explanation:

Test case-1: He has 2 coins of 10 rupees and 1 coin of 5 rupees. Hence he has 2⋅10+5=25 rupees.

Test case-2: He has 3 coins of 10 rupees and 4 coins of 5 rupees. Hence he has 3⋅10+4⋅5=50 rupees.

Janmansh and Coins CodeChef Solution in C++17

#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin>>t;
	
	while(t--)
	{
	   int x,y;
	   cin>>x>>y;
	   
	   cout<<(10*x)+(5*y)<<endl;
	   
	}
	
	
	return 0;
}

Janmansh and Coins CodeChef Solution in Pyth 3

# cook your dish here
n=int(input())
for i in range(n):
    a,b=map(int,input().split())
    print(a*10+b*5)

Janmansh and Coins CodeChef Solution in Java

/* 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
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		for(int i=0;i<t;i++)
		{
		    int x=sc.nextInt();
		    int y=sc.nextInt();
		    x=x*10;
		    y=y*5;
		    System.out.println(x+y);
		}
	}
}
Janmansh and Coins CodeChef Solution Review:

In our experience, we suggest you solve this Janmansh and Coins 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 Janmansh and Coins CodeChef Solution

Find on CodeChef

Conclusion:

I hope this Janmansh and Coins 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 >>

LeetCode Solutions

Hacker Rank Solutions

CodeChef Solutions

Leave a Reply

Your email address will not be published. Required fields are marked *