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;
}
posted @ 2018-10-15 17:59  ChunhaoMo  阅读(196)  评论(0编辑  收藏  举报