CRED Coins Problem Code: CREDCOINSSubmit (Practice)
For each bill you pay using CRED, you earn CRED coins.
At CodeChef store, each bag is worth CRED coins.
Chef pays number of bills using CRED. Find the maximum number of bags he can get from the CodeChef store.
Input Format
- First line will contain , number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, two integers and .
Output Format
For each test case, output in a single line - the maximum number of bags Chef can get from the CodeChef store.
Constraints
Subtasks
- Subtask 1 (100 points): Original constraints.
Sample Input 1
3
10 10
20 4
70 7
Sample Output 1
1
0
4
Explanation
Test Case : For each bill payment, one receives CRED coins. Chef pays bills using CRED. Thus, he receives CRED coins. Chef can get bag from the CodeChef store using these coins.
Test Case : For each bill payment, one receives CRED coins. Chef pays bills using CRED. Thus, he receives CRED coins. Chef cannot get any bag from the CodeChef store using these coins.
Test Case : For each bill payment, one receives CRED coins. Chef pays bills using CRED. Thus, he receives CRED coins. Chef can get at most bags from the CodeChef store using these coins.
solution
#include<iostream>
#include<vector>
#include<algorithm>
#include<climits>
#include<string>
using namespace std;
class solution
{
public:
void solve()
{
int x, y, sum;
cin >> x >> y;
sum = x * y;
cout << sum / 100 << "\n";
}
};
int main()
{
solution ss;
int t;
cin >> t;
while (t--)
{
ss.solve();
}
return 0;
}
No comments:
Post a Comment