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的更多相关文章
- [CF1065A]Vasya and Chocolate
题目大意:有$s$元,一个物品$c$元,每买$a$个就送$b$个,问一共可以买多少. 题解:全部买好,最后看可以送多少(其实是因为我这道题交错了,无聊才做的) 卡点:无 C++ Code: #incl ...
- CF1065A Vasya and Chocolate 题解
Content 小 V 有 \(s\) 块钱,商店里有巧克力卖,每块巧克力 \(c\) 块钱,现在商店给出优惠:购买 \(a\) 块巧克力可以免费获得 \(b\) 块巧克力,求小 V 最多能够买到的巧 ...
- Educational Codeforces Round 52 (Rated for Div. 2)
题目链接 A. Vasya and Chocolate 题意 已知钱,价格,赠送规则求最多获得巧克力数 思路常规算即可 代码 #include <bits/stdc++.h> #defin ...
- [CodeForces]Educational Round 52
幸好我没有打这场,我VP的时候在C题就卡死了,我果然还是太菜了. A Vasya and Chocolate 题意:一个巧克力\(c\)元,买\(a\)赠\(b\),一共有\(n\)元,问能买几个巧克 ...
- Codeforces Edu Round 52 A-E
A. Vasya and Chocolate 模拟题.数据会爆\(int\),要开\(long\) \(long\) #include <iostream> #include <cs ...
- Milliard Vasya's Function-Ural1353动态规划
Time limit: 1.0 second Memory limit: 64 MB Vasya is the beginning mathematician. He decided to make ...
- CF460 A. Vasya and Socks
A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Big Chocolate
Big Chocolate 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=19127 Big Chocolat ...
- Dividing a Chocolate(zoj 2705)
Dividing a Chocolate zoj 2705 递推,找规律的题目: 具体思路见:http://blog.csdn.net/u010770930/article/details/97693 ...
随机推荐
- 【PAT】B1076 Wifi密码(15 分)
注意接收字符时缓冲区的换行要接受掉 #include<stdio.h> int main() { int n; scanf("%d", &n); n *= 4; ...
- Ubuntu + python pip遇到的问题
今天在做Flask跨源资源共享(CORS)的时候在安装flask-cors时遇到了两个问题. 首先我是在Ubuntu环境下安装的,整了好一会才弄得出来,现在整理一下. 安装flask-cors pip ...
- IntelliJ IDEA 创建Spring项目
第一步:点击file --> new --> project... 第二步: 在左侧选择Spring, 然后勾选Spring , 最后点击Next 第三步 : 填写项目名称和项目地址,点击 ...
- if 嵌套if 的先后顺序的区别 (自测)
# 验证 verify very good! # username = input("请输入用户名").capitalize()# password = input("请 ...
- golang的json序列化问题
首先看一段代码: package main import ( "encoding/json" "fmt" ) type Result struct { //st ...
- python scrapy 登录知乎过程
前面了解了scrapy框架的大概各个组件的作用, 现在要爬取知乎数据,那么第一步就是要登录! 看下知乎的登录页面发现登录主要是两大接口 一: 登录页面地址,获取登录需要的验证码,如下图 打开知乎登录页 ...
- (12)Python异常
- cenos下安装MySQL最新版(5.7.18)记录。附卸载老版本过程
首先说明:老版本数据库没有数据,所以无数据备份过程.如果你在升级数据库过程里,需要备份数据,请另外自行处理. 1.下载最新版MySQL.解压待用 wget https://dev.mysql.com/ ...
- (1)HomeAssistant 安装开始
https://www.hachina.io/docs/1843.html 在Windows中安装Python3和HomeAssistant 第一步:在浏览器中访问Python官网网址为:www.py ...
- Arduino IDE for ESP8266 (0) 官方API
http://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html 0 简单的连接到WIFI #include <ES ...