Question
Khalid likes prime numbers. However, there is one thing he loves even more. Of course, it's semiprimes! A semi-prime number is an integer which can
Khalid likes prime numbers. However, there is one thing he loves even more. Of course, it's semiprimes! A semi-prime number is an integer which can be expressed as a product of two distinct primes. For example, 15=3515=35 is a semi-prime number, but 11, 9=339=33 and 55 are not. Khalid is wondering how to check if an integer can be expressed as a sum of two (not necessarily distinct) semi-primes. Help Chef with this tough task! Input The first line contains an integer which is the number of test cases The rest of the file contains one test case in each line. Output For each test case, print a single line with the answer to this problem to an output file. Examples numbers.txt output.txt 3 30 45 62 YES YES NO Explanation Example case 1: 30 can be expressed as 15 + 15 = (35) + (35). Example case 2: 45 can be expressed as 35 + 10 = (57) + (25). Example case 3: 62 cannot be expressed as a sum of two semi-primes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started