All submissions for this problem are available.
As we all know, Virat Kohli is in the form of his life and hitting centuries has become his habit. Bollywood diva Anushka Sharma is interested in knowing if the number of centuries he would score in two consecutive years would be two consecutive prime numbers (e.g. 7 and 11 ) and successor of sum of both those numbers would also be a prime number p. She gave him numbers n and k and asks if there lie at least k possible values of p between 2 and n. Virat is not a great mathematician and fails to tell her and they broke up on news of which Rohit Sharma is the happiest man on earth. Now, Rohit wants to impress Anushka by giving the answer and doesn’t want to take a chance. So, Rohit hires you to write a program for himself that calculates the answer of the question posed by Anushka.
The only line of input contains two numbers n and k.
Output YES if there lies more than or equal to k numbers satisfying the condition for p and NO otherwise.
- 2 ≤ n ≤ 1000
- 0 ≤ k ≤ 1000
Input: 10 1 Output: NO
Input: 25 2 Output: YES
Example case 1, there is no such number between 2 and 10.
Example case 2, there lies 2 numbers 13(5+7+1) and 19(7+11+1).
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA|
Fetching successful submissions