题解
题目大意 有s元 每个巧克力c元买a送b
AC代码
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
int main()
{
#ifdef LOCAL
freopen("C:/input.txt", "r", stdin);
#endif
int T;
cin >> T;
while (T--)
{
int s, a, b, c;
cin >> s >> a >> b >> c;
ll k = s / c;
cout << k + 1LL * k / a * b << endl;
}
return 0;
}