Computer Science, asked by vinaygupta7115, 1 year ago

Ritik loves to jump here and there.So his friend Sugam gave him an array of N Integers in which he can choose any pair of Integers Ai and Aj only if i+K=j.Now he can add 1 to one of those elements and subtract one from the other i.e move 1 from one element to the other.He can perform this operation any number of times by jumping here and there in the array.
Now Ritik wants to know if he can make all the numbers Prime by jumping and performing 0 or more number of given operations on the array.
Note-0 and 1 are not considered as prime numbers.

Input Format
Your function contains two arguments A One Dimensional Integer Array of size N and an Integer K.
First line of input contains an Integer K.(1<=K<=N)
Second line of input contains an Integer N denoting the size of Array. (1<=N<=10000)
Next N lines of input each containing an Integer Ai.(1<=i<=N , 1<=Ai<=100)

Constraints
1<=K<=N
1<=N<=10000
1<=i<=N , 1<=Ai<=100

Answers

Answered by sagar310
0
I k the required the show of two modifg
Similar questions