#include <iostream>
using namespace std;
int h, a, H, A;
int func()
{
if (a >= H) return -1;
int n = H / a + (H % a == 0 ? 0 : 1); // 怪物能抗几次
int m = n - 1; // 玩家被攻击几次
int k = m * A; // 杀死一只怪物玩家掉多少血
int res = h / k - (h % k == 0 ? 1 : 0);
return res;
}
int main()
{
int t;
cin >> t;
while (t--)
{
cin >> h >> a >> H >> A;
cout << func() << endl;
}
return 0;
}
class Solution {
public:
int used[201] = {};
int citys(vector<vector<int> >& m) {
int res = 0;
for (int i = 0; i < m.size(); i++)
{
if (!used[i])
{
res++;
dfs(m, i);
}
}
return res;
}
void dfs(vector<vector<int>>& m, int pos)
{
used[pos] = 1;
for (int i = 0; i < m.size(); i++)
{
if (!used[i] && m[pos][i])
{
dfs(m, i);
}
}
}
};
发布评论