codeforces #256 A. Rewards
1 second
256 megabytes
standard input
standard output
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present — a new glass cupboard with
n shelves and he decided to put all his presents there. All the presents can be divided into two types: medals and cups. Bizon the Champion has
a1 first prize cups,
a2 second prize cups and
a3 third prize cups. Besides, he has
b1 first prize medals,
b2 second prize medals and
b3 third prize medals.
Naturally, the rewards in the cupboard must look good, that's why Bizon the Champion decided to follow the rules:
- any shelf cannot contain both cups and medals at the same time;
- no shelf can contain more than five cups;
- no shelf can have more than ten medals.
Help Bizon the Champion find out if we can put all the rewards so that all the conditions are fulfilled.
The first line contains integers a1,
a2 and
a3 (0 ≤ a1, a2, a3 ≤ 100). The second line contains integers
b1,
b2 and b3
(0 ≤ b1, b2, b3 ≤ 100). The third line contains integer
n (1 ≤ n ≤ 100).
The numbers in the lines are separated by single spaces.
Print "YES" (without the quotes) if all the rewards can be put on the shelves in the described manner. Otherwise, print "NO" (without the quotes).
1 1 1
1 1 1
4
YES
1 1 3
2 3 4
2
YES
1 0 0
1 0 0
1
NO
水题不解释#include <iostream>
using namespace std;
int main()
{
int n,a1,a2,a3,b1,b2,b3;
cin>>a1>>a2>>a3>>b1>>b2>>b3>>n;
if(n>=(a1+a2+a3+4)/5+(b1+b2+b3+9)/10)
cout<<"YES";
else
cout<<"NO"; }
版权声明:本文博主原创文章。博客,未经同意不得转载。
codeforces #256 A. Rewards的更多相关文章
- Codeforces #256 Div.2
B. Suffix Structure 1. 先判断s去掉一些元素是否能构成t,如果可以就是automaton 判断的方法也很简单,two pointer,相同元素同时++,不相同s的指针++,如果t ...
- codeforces 256 div2 C. Painting Fence 分治
C. Painting Fence time limit per test 1 second memory limit per test 512 megabytes input standard in ...
- Codeforces Round #256 (Div. 2) A. Rewards
A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- Codeforces Round #256 (Div. 2) 题解
Problem A: A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Codeforces Round #256 (Div. 2) D. Multiplication Table(二进制搜索)
转载请注明出处:viewmode=contents" target="_blank">http://blog.csdn.net/u012860063?viewmod ...
- Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)
解题报告 意思就是说有n行柜子,放奖杯和奖牌.要求每行柜子要么全是奖杯要么全是奖牌,并且奖杯每行最多5个,奖牌最多10个. 直接把奖杯奖牌各自累加,分别出5和10,向上取整和N比較 #include ...
- CF#256(Div.2) A. Rewards
A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- Codeforces Round #256 (Div. 2) B. Suffix Structures(模拟)
题目链接:http://codeforces.com/contest/448/problem/B --------------------------------------------------- ...
- Codeforces Round #256 (Div. 2)
A - Rewards 水题,把a累加,然后向上取整(double)a/5,把b累加,然后向上取整(double)b/10,然后判断a+b是不是大于n即可 #include <iostream& ...
随机推荐
- 【m从翻译os文章】写日志禁令Sqlnet.log和Listener.log
写日志禁令Sqlnet.log和Listener.log 参考原始: How to Disable Logging to the Sqlnet.log and the Listener.log (Do ...
- NET5
ASP.NET5(RC1) - 翻译 前言 ASP.NET 5 是一次令人惊叹的对于ASP.NET的创新革命. 他将构建目标瞄准了 .NET Core CLR, 同时ASP.NET又是对于云服务进行优 ...
- SystemParametersInfo API学习(128个中文参数解释,215个实际值)
uiAction:该参数指定要查询或设置的系统级参数.其取值如下:SPI_GETACCESSTIMEOUT:检索与可访问特性相关联的超时段的信息,PvParam参数必须指向某个ACCESSTIMEOU ...
- Java的一些基础小知识之JVM与GC (转)
一.JVM是什么 Java虚拟机(英语:Java Virtual Machine,缩写为JVM),又名爪哇虚拟器,一种能够运行Java bytecode的虚拟机,以堆栈结构机器来进行实做.最早由太阳微 ...
- 一段代码让你秒懂java方法究竟是传值还是传地址
先看看代码以及执行结果: 凝视写得非常清楚了.我就不多说了. 我说说我的结论.事实上在java中没有传值还是传址的概念,java仅仅有引用的概念.引用类似传址.只是是一个变量名中保存着对象的地址,地址 ...
- 《转》div 中间固定 左右自适应实现
<转自>:http://www.w3cplus.com/css/layout-column-three 对于我来说,这是一种很少碰到的布局方法,不知道大家有何体会,那么下面我们一起来看这种 ...
- iOS 如何创建单例对象
一.什么是单例? 说到单例我就想起了我的java啊 ,不禁感叹起我的大学时光,学了4年的java开发,到现在还是放弃了我的java,踏入了iOS的行列. 算了,入正轨,我现在正是铁树银花的青春美少女, ...
- Linux几种关机(重启)相关命令
在linux下一些常用的关机/重启命令有shutdown.halt.reboot.及init,它们都可以达到重启系统的目的,但每个命令的内部工作过程是不同的,通过本文的介绍,希望你可以更加灵活的运用各 ...
- OCP读书笔记(15) - 管理SQL性能调优
SQL Tuning Advisor(STA): 使用oracle提供的程序包进行sql优化 SQL> conn scott/tiger SQL), name )); SQL> inser ...
- 离别·伤
天边露出尖尖的小月 青涩似梦 一点萤火虫落在时光的蘋 搜索 若然恍惚 莺归晚巢 日隐西山 至此予你别过 未曾听你轻启朱唇 未曾见你合身回眸 风,走过紫罗兰花 淡淡的香绕过你的长发 ...