这题有会做的吗,我做总是超时,谁有更好的办法,求指教
Please calculate how many prime numbers are there between two integers a and b (including).Input
There are some cases. Each line of input a b. 1 ≤ a < b ≤ 10000.
Output
If the result is a prime number, output "YES", else output "NO" in a single line.
Sample Input
1 3
5 9
1 1000
Sample Output
YES
YES
NO