You are given n positive array elements(including 0) , you can perform these operations on Ai any number of times ,
- subtract 1 from element
- subtract any prime number from the element
Find the minimum number of steps required to convert all elements to zero .
Example ;- if an array element is 4 , you can change it to 0 in following two operations - - subtract 3(prime number) from 4 such that the element becomes 1
- subtract 1 form 1 such that the element becomes 0;
Therefore the minimum number of operations required to change a single element 4 to 0 is 2 .
Test case 1:-
4
0 1 2 4 Output:- 4
explanation :-
for 0 required operation is 0
for 1 -> 1(subtract 1)
for 2 -> 1(subtract prime no. 2)
for 4 -> 2
therefore 0+1+1+2 = 4