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& ...
随机推荐
- 条款38 通过复合塑膜出has-a或"依据某物实现"
结论: 复合的意义和public继承全然不同. (public继承參考:条款32 确定你的public继承塑模出is-a关系) 在应用域,复合意味着has-a(有一个).在实现域,复合意味着is-im ...
- PHP中抽象类与接口的应用场景
<?php /*** ====笔记部分==== 接口的具体语法: 0:以人类为, class Human 是人的草图 而接口 是零件 可以用多种零件组合出一种新特种来. 1: 如上,接口本身即是 ...
- linux 怎么使用一个c/c++库
linux 怎么使用一个c/c++库 使用一个库,库有动态和静态之分. 静态库只要能够编译通过,运行时就没有提示缺少这个库可能,因为把这个库就是这个使用者的一部分了.动态库.两部分.1 库信息的注册 ...
- IP分类地址——a,b,c 类是如何划分的
今天IP网络使用32位地址,点分十进制格式,如172.16.0.0.地址格式:IP地址=网络地址+主机地址 或 IP地址=主机地址+子网地址+主机地址. IP地址类型 当互联网最初的设计,为了便于网络 ...
- SPOJ DISUBSTR(后缀数组)
传送门:DISUBSTR 题意:给定一个字符串,求不相同的子串. 分析:对于每个sa[i]贡献n-a[i]个后缀,然后减去a[i]与a[i-1]的公共前缀height[i],则每个a[i]贡献n-sa ...
- HDU2844_Coins【多重背包】【二进制优化】
Coins Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Subm ...
- C++ 中获取 可变形參函数中的參数
#include <iostream> #include <stdarg.h> using namespace std; int ArgFunc(const char * st ...
- Axure RP 实践.1
工作需要设计产品原型,找来Axure RP帮忙,看了一些文章,其中下面这段话深得我心. “只使用Axure的默认控件(Wireframe),不要用那些样式花哨的自定义控件,并且所有页面中使用的颜色不能 ...
- Struts2 学习第一步准备工作
第一步:安装下载MyEclispe10 对于MyEclispe的下载安装就不再详述了. 第二步:下载Struts-2.3.15 Struts-2.3.15下载地址: http://struts.apa ...
- SWT中在treeview中显示图片
package com.repositoryclient.treeview; import org.eclipse.jface.resource.ImageDescriptor; import org ...