一年没更新博客了(好几个月没写代码了),renegade is back!
尽量保持每天一道题。
以后还是要朝着算法的方向努力呀!
这题没什么好说的,小学数学题。
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
using namespace std;
long long s, a, b, c, ans, temp;
int t;
int main() {
scanf("%d", &t);
while (t--) {
scanf("%lld %lld %lld %lld", &s, &a, &b, &c);
temp = s / c;
ans = temp + (temp / a)*b;
printf("%lld\n", ans);
}
return 0;
}