Codechef•Aug 17, 2025
Mana Points
Hazrat Ali
Codechef
Chef is playing a mobile game. In the game, Chef's character Chefario can perform special attacks. However, one special attack costs X mana points to Chefario.
If Chefario currently has Y mana points, determine the maximum number of special attacks he can perform.
Input Format
- The first line contains a single integer T — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two space-separated integers X and Y — the cost of one special attack and the number of mana points Chefario has initially.
Output Format
For each test case, output the maximum number of special attacks Chefario can perform.
Constraints
- 1≤T≤10
- 1≤X≤100
- 1≤Y≤1000
Sample 1:
Input
3 10 30 6 41 50 2
Output
3 6 0
Solution
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
cout << b / a << endl;
}
return 0;
}