#include <iostream>
using namespace std;
int n,v[201],z=0,k,maxim,ok=1;
float ma=0.0;
int main(){
cin>>n>>k;
for(int i=1;i<=n;i++)cin>>v[i];
for(int i=1;i<=n;i++){
if(v[i]>0 && i%2==0)ma+=v[i];
z=0;
for(int d=2;d<=n/2;d++)if(v[i]%d==0)z++;
if(ok==1){
cout<<" 3. ";
ok=0;
}
if(z==0)cout<<v[i]<<" ";
}
cout<<" 2. ";
cout<<ma/n;
for(int i=k;i<=n;i++)v[i]=v[i+1];n--;
cout<<" 5. ";
for(int i=1;i<=n;i++)cout<<v[i]<<" ";
}