链接

[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的更多相关文章

  1. [CF1065A]Vasya and Chocolate

    题目大意:有$s$元,一个物品$c$元,每买$a$个就送$b$个,问一共可以买多少. 题解:全部买好,最后看可以送多少(其实是因为我这道题交错了,无聊才做的) 卡点:无 C++ Code: #incl ...

  2. CF1065A Vasya and Chocolate 题解

    Content 小 V 有 \(s\) 块钱,商店里有巧克力卖,每块巧克力 \(c\) 块钱,现在商店给出优惠:购买 \(a\) 块巧克力可以免费获得 \(b\) 块巧克力,求小 V 最多能够买到的巧 ...

  3. Educational Codeforces Round 52 (Rated for Div. 2)

    题目链接 A. Vasya and Chocolate 题意 已知钱,价格,赠送规则求最多获得巧克力数 思路常规算即可 代码 #include <bits/stdc++.h> #defin ...

  4. [CodeForces]Educational Round 52

    幸好我没有打这场,我VP的时候在C题就卡死了,我果然还是太菜了. A Vasya and Chocolate 题意:一个巧克力\(c\)元,买\(a\)赠\(b\),一共有\(n\)元,问能买几个巧克 ...

  5. Codeforces Edu Round 52 A-E

    A. Vasya and Chocolate 模拟题.数据会爆\(int\),要开\(long\) \(long\) #include <iostream> #include <cs ...

  6. Milliard Vasya's Function-Ural1353动态规划

    Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning mathematician. He decided to make ...

  7. CF460 A. Vasya and Socks

    A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  8. Big Chocolate

    Big Chocolate 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=19127 Big Chocolat ...

  9. Dividing a Chocolate(zoj 2705)

    Dividing a Chocolate zoj 2705 递推,找规律的题目: 具体思路见:http://blog.csdn.net/u010770930/article/details/97693 ...

随机推荐

  1. Django框架的使用教程--环境的搭建和项目的创建[一]

    Django环境的搭建 Django 常用的命令 # 创建一个名为Django_test子应用 python manage.py startapp Django_test # 生成迁移文件 pytho ...

  2. python基础 - 控制语句

    判断-if mood = True if mood: print('mood ok'); else: print('mood not OK') if-elif-else if a == 1: pass ...

  3. Numbers

    Encoding style, data structure, more content about the list, use the list as a stack, use the list a ...

  4. for(var i=1;i<=3;i++){ setTimeout(function(){ console.log(i); },0); };答案:4 4 4。

    看面试题时,发现了一道较为经典的面试题,代码如下 for(var i=1;i<=3;i++){ setTimeout(function(){ console.log(i); },0); }; / ...

  5. lamp/lnmp下添加PHP扩展

    在linux下安装好基本的PHP运行环境后有时候添加了新的功能,就得增加新的扩展,比如之前没有安装redis扩展,可以手动编译安装相关的扩展可以找下下载的php源码包中,ext目录下是否有相关的扩展源 ...

  6. 计算器和Menu

    MainActivity.java import android.app.Activity; import android.content.Intent; import android.os.Bund ...

  7. cronolog分割tomcat日志文件

    tomcat日志备份磁盘压力解决方案,使用cronolog每日生成文件uat部署操作如下,,观察两天,下周一部署生产message系统,后续根据需求部署到其它业务线 示例方案:uat—message0 ...

  8. 项目Alpha冲刺(团队)-第六天冲刺

    格式描述 课程名称:软件工程1916|W(福州大学) 作业要求:项目Alpha冲刺(团队)-代码规范.冲刺任务与计划 团队名称:为了交项目干杯 作业目标:描述第六天冲刺的项目进展.问题困难.心得体会 ...

  9. 2017-2018-2 20155314《网络对抗技术》Exp9 Web安全基础

    2017-2018-2 20155314<网络对抗技术>Exp9 Web安全基础 目录 实验目标 实验内容 实验环境 基础问题回答 预备知识 实验步骤--WebGoat实践 0x10 We ...

  10. 【Codeforces Round 1132】Educational Round 61

    Codeforces Round 1132 这场比赛做了\(A\).\(B\).\(C\).\(F\)四题,排名\(89\). \(A\)题\(wa\)了一次,少考虑了一种情况 \(D\)题最后做出来 ...