#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;
}
#include <iostream>
#include <string>
#include <unordered_set>
#include <algorithm>
using namespace std;
int n;
unordered_set<string> set;
int main()
{
cin >> n;
while (n--)
{
string s;
cin >> s;
sort(s.begin(), s.end());
set.insert(s);
}
cout << set.size() << 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);
}
}
}
};
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有