/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int a[100],n,i,k,j=0,count,b[20]={0,1,2,3,4,5,6,7,8,9};
printf("enter no.of digits");
scanf("%d",&n);
printf("enter the value of k");
scanf("%d",&k);
printf("enter the elements");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("the elements appear more than n/3 times\n");
for(j=0;j<10;j++)
{
count=0;
for(i=0;i<n;i++)
{
if(b[j]==a[i])
{
count++;
}
}
if(count>(n/k))
{
printf("%d ",b[j]);
}
}
return 0;
}