最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501
当前位置: 首页 - 科技 - 知识百科 - 正文

CodeforcesRound#256(Div.2)A.Rewards_html/css

来源:懂视网 责编:小采 时间:2020-11-27 15:54:15
文档

CodeforcesRound#256(Div.2)A.Rewards_html/css

CodeforcesRound#256(Div.2)A.Rewards_html/css_WEB-ITnose:A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Bizon the Champion is called the Champion for a reason. Bizon the Champion has recently got a presen
推荐度:
导读CodeforcesRound#256(Div.2)A.Rewards_html/css_WEB-ITnose:A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Bizon the Champion is called the Champion for a reason. Bizon the Champion has recently got a presen

A. Rewards

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

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.

    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 11 1 14

    Output

    YES

    Input

    1 1 32 3 42

    Output

    YES

    Input

    1 0 01 0 01

    Output

    NO

    题意:一种是奖杯一种是奖牌放架子上,一层能放5个奖杯,或者10个奖牌,一层不能有两种,水题。

    AC代码:

    import java.util.*;public class Main { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int a1=scan.nextInt(),a2=scan.nextInt(),a3=scan.nextInt(); int b1=scan.nextInt(),b2=scan.nextInt(),b3=scan.nextInt(); int n=scan.nextInt(); int sum1,sum2; sum1=a1+a2+a3; sum2=b1+b2+b3; int count=0; if(sum1%5==0){ count+=sum1/5; } else count+=sum1/5+1; if(sum2%10==0){ count+=sum2/10; } else count+=sum2/10+1; if(count>n) System.out.println("NO"); else System.out.println("YES"); }}

    ??

    声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文档

    CodeforcesRound#256(Div.2)A.Rewards_html/css

    CodeforcesRound#256(Div.2)A.Rewards_html/css_WEB-ITnose:A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Bizon the Champion is called the Champion for a reason. Bizon the Champion has recently got a presen
    推荐度:
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top