A. Vasya and Chocolate
链接
[http://codeforces.com/contest/1065/problem/A]
分析
一个公式完事
代码
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
//freopen("in.txt","r",stdin);
ll t,s,a,b,c;
cin>>t;
while(t--){
cin>>s>>a>>b>>c;
ll sum=0;
sum=s/c+s/c/a*b;
cout<<sum<<endl;
}
return 0;
}