CF17A.Noldbach problem

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 22 can be expressed as the sum of two primes. That got Nick's attention and he decided to invent a problem of his own and call it Noldbach problem. Since Nick is interested only in prime numbers, Noldbach problem states that at least kk prime numbers from 22 to nn inclusively can be expressed as the sum of three integer numbers: two neighboring prime numbers and 11 . For example, 19 = 7 + 11 + 1, or 13 = 5 + 7 + 1.

Two prime numbers are called neighboring if there are no other prime numbers between them.

You are to help Nick, and find out if he is right or wrong.

输入格式

The first line of the input contains two integers nn ( 2<=n<=10002<=n<=1000 ) and kk ( 0<=k<=10000<=k<=1000 ).

输出格式

Output YES if at least kk prime numbers from 22 to nn inclusively can be expressed as it was described above. Otherwise output NO.

输入输出样例

  • 输入#1

    27 2
    

    输出#1

    YES
  • 输入#2

    45 7
    

    输出#2

    NO

说明/提示

In the first sample the answer is YES since at least two numbers can be expressed as it was described (for example, 13 and 19). In the second sample the answer is NO since it is impossible to express 7 prime numbers from 2 to 45 in the desired form.

首页