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 ...
随机推荐
- MySQL面试题之为什么要为innodb表设置自增列做主键?
为什么要为innodb表设置自增列做主键? 1.使用自增列做主键,写入顺序是自增的,和B+数叶子节点分裂顺序一致 2.表不指定自增列做主键,同时也没有可以被选为主键的唯一索引,InnoDB就会选择内置 ...
- 1.2 Spyder的基本使用
[TOC] 1.0 Spyder的基本使用 1.Spyder的主题与文字修改: 2.Spyder的使用技巧: (一)安装Anaconda: 官网下载:https://www.anaconda.com/ ...
- Linux 小知识翻译 - 「版本号」的命名方式
包括OS,所有的软件都有版本号信息.一般来说,版本号的增大表示软件的功能增强了或者修正了一些Bug,也就是表示软件更新了. 版本号的命名方式没有统一的标准.每种软件都不一样. 大部分情况下,版本号以「 ...
- java死锁详解
进程死锁及解决办法: 一:死锁的概念: 死锁是进程死锁的简称 什么是死锁: 死锁是指多个进程循环等待他方占有的资源而无限的僵持下去的局面.很显然,没有外力作用,那么死锁涉及到的各个进 ...
- Android Studio IDE的 LogCat如何过滤指定应用的调试信息
http://blog.csdn.net/wangqing830414/article/details/40377979 打开 LogCat在搜索框右侧的No Filters中选择 Edit Filt ...
- JSON数据解析(自写)
自写的JSON解析数据 void setup() { Serial.begin(115200); char chArray[50] = "some characters"; Str ...
- docker官方文档学习-1-Docker for mac安装配置
https://docs.docker.com/docker-for-mac/ Get started with Docker for Mac 首先像在本博客docker-1-环境安装及例子实践处将环 ...
- Spring配置跨域请求
本文主要是Spring+SpringMVC+MyBatis/MyBatis Plus框架环境,包括SpringBoot同样适用. 1.编写拦截器 package com.interceptor; im ...
- Qt读取文件时中文乱码问题
在默认情况下,Qt 以 Unicode 格式处理文本字符,因此,字符本身是不会有问题的.之所以出现乱码,原因在于 Qt 不知道将 Unicode 字符以何种方式显示出来. 文本文件含有简 ...
- QT 按钮的使用技巧
按钮透明 // ui->pushButton->setFlat( true );// ui->pushButton->setStyleSheet( "QP ...