codeforces-448A-Rewards

简介:
Rewards
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard 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.

Input
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.

Output
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).

Sample test(s)

input
1 1 1
1 1 1
4

output
YES

input
1 1 3
2 3 4
2

output
YES

input
1 0 0
1 0 0
1
output
NO




第一次在codeforces上做的题
//取余问题,大水题

AC代码:

#include<stdio.h>
#include<string.h>
int main()
{
    int x,y,z,k,a,b,c,m;
    char s[5];
    scanf("%d%d%d",&x,&y,&z);
    scanf("%d%d%d",&a,&b,&c);
    scanf("%d",&k);
    ((x+y+z+4)/5+(a+b+c+9)/10)>k?m=1:m=2;
    if(m==2)
      printf("YES\n");
    else
      printf("NO\n");
    return 0;
}

相关文章
最近ovirt遇到一些问题整理及解决方法
最近ovirt遇到一些问题整理及解决方法
1252 0
|
存储 消息中间件 监控
消息中间件系列四、认识AMQP和RabbiyMq的简单使用
AMQP AMQP(advanced message queuing protocol)是一个提供统一消息服务的应用层标准协议,基于此协议的客户端与消息中间件可传递消息,并不受客户端/中间件不同产品,不同开发语言等条件的限制 。
3692 101
|
弹性计算 资源调度 运维
【实操系列】 AnalyticDB PostgreSQL发布实例计划管理功能,实现资源分时弹性&分时启停
简介: 本文将对AnalyticDB PostgreSQL产品的计划任务管理功能以及其背后的实现机制和最佳实践做详细介绍。
716 1
|
存储 搜索推荐 算法
抖音SEO优化怎么做?一文搞透抖音短视频优化!
为什么要做抖音SEO?哪些企业适合做抖音SEO?
1153 0
抖音SEO优化怎么做?一文搞透抖音短视频优化!
|
机器学习/深度学习 算法 计算机视觉
【图像配准】基于surf实现图像特征点检测及图像拼接处理附matlab代码
【图像配准】基于surf实现图像特征点检测及图像拼接处理附matlab代码
|
SQL 存储 关系型数据库
MYSQL中锁的各种模式与类型
在日常开发工作中,我们几乎需要天天与数据库打交道,作为一名只会CRUD的SQL BOY,除了每天用mybatis-generator自动生成DAO层代码之外,我们几乎不用去care数据库中如何处理并发请求,但是突然某一天MYSQL数据库告警了,出现了死锁,我们的内心慌的一匹,不禁想问:这不就是个普通查询吗,咋还锁起来了? 为了避免慌乱的表情被主管捕捉到,我们需要提前了解一下数据库中到底有哪些锁。 在MySQL中,其实将锁分成了两类:锁类型(lock_type)和锁模式(lock_mode)。 锁类型描述的锁的粒度,也就是把锁具体加在什么地方;而锁模式描述的是到底加的是什么锁,是读锁还是写
MYSQL中锁的各种模式与类型
|
JavaScript 安全 Java
autojs之一键加密
使用场景 加密autojs
1453 0
|
JavaScript Windows Python
在阿里云镜像站下载KiCad
在阿里云镜像站下载KiCad
在阿里云镜像站下载KiCad
|
存储 安全 Android开发
无影云电脑的体验及其他平台的比较
本篇将介绍无影云电脑作为个人电脑的体验,说明其优缺点,并与其他平台的云电脑比较(主要是云游戏平台)。
|
存储 监控 安全
Android R 新特性分析及适配指南
Android R(Android 11 API 30)于2020年9月9日正式发布,随国内各终端厂商在售Android设备的版本更新升级,应用软件对Android R 版本的兼容适配已迫在眉睫。
810 0
Android R 新特性分析及适配指南