Every number greater than 1 is either a prime or a composite. Aman is studying how property of number changes when 1 is added to it. He defines a number as a "good number" if that number retains it's property. Means prime remains prime and composite remains composite.
You will be given an array of N integers . And you will be asked to solve Q queries which are of two types
Input Format
Output Format
Constraints
Author : Aayush Kapadia
Current array is 7 8 9 10 11. We are concerned only about the subarray [8,9,10]. You can observe that 8 and 9 are good numbers while 10 is not a good number. So answer is 2.
Now array changes to 7 8 13 10 11 13 is not a good number. So only good number remaining is 8. So answer is 1.