304 North Cardinal St.
Dorchester Center, MA 02124

# CRED Coins CodeChef Solution

## Problem – CRED Coins CodeChef Solution

For each bill you pay using CRED, you earn X CRED coins.
At CodeChef store, each bag is worth 100 CRED coins.

Chef pays Y number of bills using CRED. Find the maximum number of bags he can get from the CodeChef store.

### Input Format

• First line will contain T, number of test cases. Then the test cases follow.
• Each test case contains of a single line of input, two integers X and Y.

### Output Format

For each test case, output in a single line – the maximum number of bags Chef can get from the CodeChef store.

### Constraints

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

• Subtask 1 (100 points): Original constraints.

### Sample 1:

``````Input: 3
10 10
20 4
70 7
Output: 1
0
4``````

### Explanation:

Test Case 1: For each bill payment, one receives 10 CRED coins. Chef pays 10 bills using CRED. Thus, he receives 100 CRED coins. Chef can get 1 bag from the CodeChef store using these coins.

Test Case 2: For each bill payment, one receives 20 CRED coins. Chef pays 4 bills using CRED. Thus, he receives 80 CRED coins. Chef cannot get any bag from the CodeChef store using these coins.

Test Case 3: For each bill payment, one receives 70 CRED coins. Chef pays 7 bills using CRED. Thus, he receives 490 CRED coins. Chef can get at most 4 bags from the CodeChef store using these coins.

## CRED Coins CodeChef Solution in C++17

``````#include <iostream>
using namespace std;

int main() {
int t;
cin >> t;
while( t--){
int x, y;
cin >> x>> y;
cout << x * y / 100<<endl;
}
return 0;
}
``````

## CRED Coins CodeChef Solution in Pyth 3

``````# cook your dish here
t= int(input())
for i in range(t):
x,y = map(int,input().split(" "))
p = x*y
print(int(p/100))``````

## CRED 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
{
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*y;
System.out.println(x/100);
}
}
}
``````
##### CRED Coins CodeChef Solution Review:

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

Find on CodeChef

##### Conclusion:

I hope this CRED 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