https://www.codechef.com/problems/VOTERS.

someone please help me where am i going wrong.

my code is:

#include<stdio.h>

int presentinb(int w,int *v,int x)

{

int i;

for(i=0;i<x;i++)

{

if(w==*v)

return 1;

v++;

}

return 0;

}

int presentinc(int u,int *y,int z)

{

int i;

for(i=0;i<z;i++)

{

if(u==*y)

return 1;

y++;

}

return 0;

}

int main()

{

int n1,n2,n3;

scanf("%d %d %d",&n1,&n2,&n3);

int a[n1],b[n2],c[n3];

int i,j,k;

int d[n1+n2+n3];

for(i=0;i<n1;i++)

{

scanf("%d",&a[n1]);

}

for(i=0;i<n2;i++)

{

scanf("%d",&b[n2]);

}

for(i=0;i<n3;i++)

{

scanf("%d",&c[n3]);

}

j=0;

for(i=0;i<n1;i++)

{

if((presentinb(a[i],b,n2)==1)||(presentinc(a[i],c,n3)==1))

{

d[j]=a[i];

j++;

}

}

int e=0;

for(i=0;i<n2;i++)

{

if(presentinc(b[i],c,n3)==1)

{

for(k=0;k<j;k++)

{

if(b[i]!=d[k])

{

e++;

}

}

if(e==j)

{

d[j]=b[i];

j++;

}

e=0;

}

}

```
int t=0;
for(i=0;i<j-1;i++)
{
for(k=0;k<j-i-1;k++)
{
if(d[k+1]<d[k])
{
t=d[k+1];
d[k+1]=d[k];
d[k]=t;
}
}
}
printf("%d\n",j);
for(i=0;i<j;i++)
{
printf("%d\n",d[i]);
}
```

}

please.