A. Vasya and Chocolate

Posted mch5201314

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;
}

以上是关于A. Vasya and Chocolate的主要内容,如果未能解决你的问题,请参考以下文章

A. Vasya and Book

cf1082 A. Vasya and Book

Codeforces 1082 A. Vasya and Book-题意 (Educational Codeforces Round 55 (Rated for Div. 2))

Educational Codeforces Round 59 (Rated for Div. 2)G. Vasya and Maximum Profit 区间dp

C. Vasya and Multisets

Codeforces 1107 E - Vasya and Binary String