int nonDivisibleSubset(int k, int s_count, int* s) {
int i,j;
int count;
int maxcount=0;
for (i=0;i<s_count;i++)
{ count=0;
for (j=0;j<s_count;j++)
{
if (i=j)
continue;
else
{
if ((s[i]+s[j])%k==0)
continue;
else
count=count+1;
}
}
if (count>maxcount)
{
maxcount=count;
}
}
return maxcount;
}
k - это число, для которого я делаю неделимое подмножество подмножества 's'. Я хочу найти количество элементов в самом длинном подмножестве