#include<stdio.h>
int main()
{
    int n;

    scanf("%d",&n);

    if(n>2&&n%2==0)
        printf("YES\n");
    else
        printf("NO\n");

    return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w>=1 || w<=100)
    {
        if(w==2)
        {
                printf("NO");
        }
        else if(w%2==0)

    {
        printf("YES");
    }
     else
    {
         printf("no");
    }
    }
}

#include<stdio.h>
int main()
{
    int w,i,a,b;
    scanf("%d",&w);
        if(w>0&&w%2==0&&w!=2)
        {
        printf("YES\n");
        }

        else
            printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w>2 && w%2==0)
        printf("YES");
    else
        printf("NO");
        return 0;
}

#include <stdio.h>
int main (){
int a;
scanf ("%d", &a);
if (a==2){
    printf ("NO\n");
}
else{
if (a%2 != 0){
    printf ("NO\n");
}
else {
    printf ("YES\n");
}
}
return 0;
}

/* 1491338037802 */

#include <stdio.h>

int main(){
	int w;

	scanf("%d", &w);

	if(w%2==0 && w != 2) printf("YES\n");
	else printf("NO\n");

	return 0;
}
/* 1506037327920 */

#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);

if(a%2==0 && a!=2)
  printf("YES");

else

    printf("NO");
return 0;
}

#include <stdio.h>

int main(){

    int w,a;
    scanf("%d", &w);

    if(w%2==0){
        if(w==2)
             printf("NO\n");
             else ( printf("YES\n") );
    }

        else ( printf("NO\n") );

    return 0;
}

/* 1491694425232 */

#include<stdio.h>
 int main()
 {
     int w;
     scanf("%d",&w);
     if(w%2==0 && w>2)
     {
         printf("YES");
     }
     else
     {
         printf("NO");
     }
 }

#include <stdio.h>

int main()
{
	int W;
	scanf("%d", &W);
	if(W>2 && W%2==0)
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
	return 0;
}

#include <stdio.h>
int main ()
{
    int w;
    scanf("%d", &w);
    if(w%2==0 && w!=2){
        printf("yes",w);
    }
    else{
        printf("no",w);
    }
    return 0;
}

#include <stdio.h>

int main(){
    int a;

    scanf("%d", &a);

    if(a%2 == 0 && a > 2){
        printf("YES\n");
    }else{
        printf("NO\n");
    }

    return 0;
}

/* 1490975184008 */

#include <stdio.h>
#include<math.h>

int main()
{
    int weight;

     scanf("%d", &weight);

     if ( weight >= 1 && weight <=100){
      double parts = (double) weight /2;

      int remain = weight - 2;

     if ( remain >= 2 && remain % 2 == 0 )

       printf("Yes\n");

     else

      printf("No\n");
      }

       return 0;
}

#include <stdio.h>

int main()
{
    int w;
    scanf("%d",&w);
    if((w%2==0)&&(w>2))
    {
        printf("YES");
    }
    else printf("NO");
return 0;
}

#include<stdio.h>
int main(void)
{
	short int w;
	scanf("%d", &w);
//	printf("w1")
	if (w % 2 == 0 && w > 2 )// && w2 % 2 == 0)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include<stdio.h>
int main()
{
    int w,a,b,d,c;
    scanf("%d",&w);
    if(w==2)
       printf("no");
    if(w<=100 && w>=1 &&w!=2)
    {
        if(w%2==0)
                printf("YES");
            else
                printf("NO");

    }

    return 0;
}

#include <stdio.h>

int main()
{
    int w;
        scanf ("%d",&w);
        if(w!=2 && w%2==0)
        printf("YES\n");
        else{
        printf("NO\n");}
    return 0;
}
/* 1491891267270 */

#include<stdio.h>
int main(void)
{
	int w;
	scanf("%d", &w);
	int a;
	a = w/ 2;
	if (w < 3)
		printf("No\n");
	else if (w > 3 && w % 2 == 0)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

#include<stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    if(n%2==0&&n!=2){
        printf("YES");
    }
    else{
        printf("NO");
    }
    return 0;
}

#include<stdio.h>

int main()
{
    int x;
    scanf ("%d", &x);

    if(x%2==0 && x>2)
    {
         printf("YES");
    }
    else
   {
         printf("NO");
    }
     return 0;
}

#include <stdio.h>

int main() {
    int w;
	scanf("%d", &w);
    if(w <= 2 || w%2 != 0){
        printf("NO");
    } else {
        printf("YES");
    }
	return 0;
}

#include <stdio.h>

int main() {
    int w, i=2, ind=0;
	scanf("%d", &w);
    if(w <= 2 || w%2 != 0){
        printf("NO");
    } else {
        printf("YES");
    }
	return 0;
}

#include<stdio.h>

int main(){

    int n;
    scanf("%d", &n);
    if(n <= 2 || n%2 != 0){
        printf("NO\n");
    }
    else{
        printf("YES\n");
    }

    return 0;
}

#include <stdio.h>
#include <math.h>
int main()
{
    int w;
    scanf("%d", &w);
    if (w % 2 == 0 && w != 2)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}

/* 1491694402966 */

 #include<stdio.h>
main()
{
    int n,i,j;
    scanf("%d",&n);

     if(n!=2 && (n)%2==0)
    {
           printf("YES");
        }

    else{
        printf("NO");
    }
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0 && w!=2 && w!=1)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>;
main()
{
    int w;
    scanf("%d",&w);

    if(1<= w && w <=100)

        {
            if(w%2==0 && w!=2)

    printf("yes");

    else
    printf("no");}
    else
        printf("error");

}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w==2)
    printf("NO");
    else if(w%2==0)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>
int main(){
    int w;
    scanf("%d",&w);
    if(w==0||w==2)
        printf("NO");
    else{
        if(w%2==0)
            printf("YES");
        else
            printf("NO");
    }
    return 0;
}

//
//  main.c
//  A
//
//  Created by Samuel Souza on 21/09/17.
//  Copyright © 2017 Samuel Souza. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[]) {

    int kg = 0, status = 0;

    scanf("%d", &kg);

    for(int i=1;i<kg;i++){

        for(int j=1;j<kg;j++){

            if(i+j == kg){

                if(i%2 == 0 && j%2 == 0){

                    status = 1;
                    break;

                }

            }

        }

    }
    if(status){printf("YES\n");}
    else{printf("NO\n");}

}

/* 1506025401385 */

#include<stdio.h>
int main()
{
	int w;
	scanf("%d",&w);
	if(w%2==0&&w!=2)
	printf("YES");
	else
	printf("NO");
	return 0;
}

#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    if(n%2==0&&n>=4)
    {
        printf("YES\n");
    }else if(n<=2||n%2!=0)
    {
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
int main()
{
    int a;
    scanf("%d",&a);
    if (a%2==0&&a!=2)
    printf("YES");
    else
    printf( "NO");
 return 0;
}

#include<stdio.h>
int main( ){
int k;
scanf("%d",&k);
if(k%2==0&&k>2){
    printf("yes");
}
else
printf("no");
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main() {
    int w;
    scanf ("%d",&w);
    if ((w%2!=0)||(w==2))
    {
        printf("NO");
    }
    else
    {
        printf("YES");
    }

    return (EXIT_SUCCESS);
}

#include <stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w>2 && w % 2 == 0 && w<=100)
        printf("YES");
    else
        printf("NO");
    return 0;
}

int main ()
{
    int n;

    scanf ("%d", &n);
    if (n % 2 != 0)
    printf ("NO\n");
    else if (n <= 2)
    printf ("NO\n");

    else
    printf ("YES\n");

    return 0;
}

#include <stdio.h>
int main() {
    int n;
    scanf("%d", &n);
    if(n>2 && n % 2 == 0)
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
int main(){
	int w;
	scanf("%i", &w);
	if( w <= 2 || w%2 != 0){
		printf("NO");
	}
	else{
		printf("YES");
	}
	return 0;
}

/* 1505940185180 */

#include<stdio.h>
int main()
{
    int k;
    scanf("%d",&k);
    if(k>2&&(k%2==0))
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
    int n;
    scanf("%d", &n);
    if (n%2!= 0)
        printf("NO\n");
    else
    {
    if (n<=2)
        printf("NO\n");
    else
        printf("YES\n");
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w>=1&&w<=100)
    {
        if(w%2==0 && w!=2)
        {
            printf("YES");
        }
        else
        {
            printf("NO");
        }
    }

    return 0;
}

#include<stdio.h>

int main()
{
 int w,a,b;
 scanf("%d",&w);
for(a=1;a<=w;a++)
    {
        b=w-a;

    }

    if( b%2==0 && a%2==0)
    {
        printf("NO");
    }
    else if(w==2)
        {printf("NO");}
 else printf("YES");

 return 0;
}

#include<stdio.h>
int main()
{
int w;
scanf("%d",&w);
if(w%2==0 && w>2)
{
printf("YES\n");
}
else
{
printf("NO\n");
}
return 0;
}

#include<stdio.h>
#include<conio.h>

    int main()
    {
        int n;
        scanf("%d",&n);

        if(n>2 && n<101 && n%2==0){
            printf("YES");
        }

        else if((n==2)||(n>0 && n<101 && n%2!=0)){
            printf("NO");
        }

        return 0;
    }

#include<stdio.h>
int main()
{
    int w;

    scanf("%d",&w);
   if(w>2){
    if(w%2==0)
        printf("YES\n");
    else
        printf("NO\n");
   }
else
    printf("NO\n");

    return 0;
}

#include <stdio.h>
int main () {
    int a,b;

    scanf("%d",&a);
    b=a%2;

    if(b==1){
        printf("NO");
        return 0;
    }
    if(a==2){
   printf("NO");
    }
    else
    {
        printf("YES");

    }

    return 0;
}

#include <stdio.h>
int main(){
int w;
scanf("%d",&w);
if (w>2 && w%2==0)
 printf("YES");
else
  printf("NO");
}

#include <stdio.h>
int main()
{
    int weigh;
    scanf("%d", &weigh);
    int i = 2;
    int count = 0;
    while( i <= 100 )
    {
        if( ( weigh - i )% 2 ==  0 && weigh != 2 )
        {
            printf("YES");
            count = 1;
            break;
        }

        i = i + 2;
    }
    if( count == 0 )
    {
        printf("NO");
    }

}

#include<stdio.h>
#include<math.h>
int main ()
{
    int w;
    scanf("%d", &w);
    if (((w%2)==0) && (w != 2))
    {
        printf("YES\n");
    }else{
        printf("NO\n");
    }

    return 0;
}

/* 1491694440230 */

#include <stdio.h>
int main() {
    int num;
    scanf("%d", &num);
    if(num>2 && num % 2 == 0)
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
int main()
{   int weight;
    scanf("%d",&weight);
    if(weight==2)
    {
    printf("No");
    }
    else if(weight%2==0)
    {
    printf("Yes");
    }
    else{
    printf("No");
    }
    return 0;
}

#include<stdio.h>
#include<math.h>
int main ()
{
    int w;
    scanf("%d", &w);
    if (((w%2)==0) && (w != 2))
    {
        printf("YES\n");
    }else{
        printf("NO\n");
    }

    return 0;
}

/* 1491694427230 */

#include <stdio.h>

int main()
{
    int a, b, c;

    scanf("%d", &a);

    if(a>=0 && a<=100){
    if(a==2)
    {
    printf("NO");
    }
    else if(a%2== 0){printf("YES");}
    else{printf("NO");}
    }
    return 0;
}

#include <stdio.h>
int main(void)
{
int w;
scanf("%d\n",&w);
if(w>2){
if(w%2==0){
printf("YES\n");
}
else{
printf("NO\n");
}
}
else{printf("NO\n");}
}

#include<stdio.h>

int main(){

    int n;
    scanf("%d", &n);
    if(n <= 2 || n%2 != 0){
        printf("NO\n");
    }
    else{
        printf("YES\n");
    }

    return 0;
}

#include <stdio.h>
int main(){
    int w;
    scanf("%d", &w);
    if(w == 2) printf("no");
    else if(!(w % 2))
        printf("yes");
    else
        printf("no");
    return 0;
}

#include<stdio.h>

main()
{
	int x;
	scanf("%d",&x);
	if(x>2&&x%2==0)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);

    if(w<=2||w%2==1)
       {printf("NO\n");}
    else
        {printf("YES\n");}
    return 0;

}

#include<stdio.h>
int main()
{
    int w;
    while(scanf("%d",&w)==1)
    {
        if(w>2&&w%2==0)
        {
            printf("YES");
        }
        else
        printf("NO");
    }
    return 0;
}

#include<stdio.h>

int main(){
	int w;
    scanf("%d",&w);
    if(w==2)
    printf("NO");
    else if(w%2==0)
    printf("YES");
    else
    printf("NO");
  	return 0;
}

/* 1534604185268 */

#include<stdio.h>
int main(){

    int w;
    scanf("%d",&w);

        if(w>=4&&w%2==0) printf("Yes");
         else printf("No");

    return 0;

}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w%2!=0 || w<=2)
        printf("NO\n");
    else
        printf("YES\n");
    return 0;
}

#include <stdio.h>
int main()
{
	int w,i;
	scanf("%d",&w);
	if(w<=100&&w>=1)
	{
		if(w>2){
		i = w%2;
		if(i==0)
		{
			printf("YES");
		}
		else
		{
			printf("NO");
		}
		}
		else
		{printf("NO");}
	}
	else
	{
		printf("insufficient value");
	}
	return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include<time.h>

int main() {

int weight ;

scanf(" %d" , &weight) ;
  if(weight%2 == 0 && weight != 2)
  {
      printf("Yes \n");
  }
  else printf("NO \n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main(){

    int n;
    scanf("%d", &n);
    if(n <= 2 || n%2 != 0){
        printf("NO\n");
    }
    else{
        printf("YES\n");
    }

    return 0;
}

#include<stdio.h>
int main()
{
    int x;
    scanf("%d",&x);
    if(x%2==0&&x>2)

        printf("YES");

    else
    printf("NO");

}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d", &w);
    if(w % 2 ==0 && w>2 ){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
    return 0;
}

#include<stdio.h>

int main()
{int w;
long long i=0;
for(;i<1000000000000;i++){

}
scanf("%d",&w);
if(w<=2)
printf("no");
else if(w%2==0)
 printf("YES");
 else
 	printf("NO");
 	return 0;
}

#include<stdio.h>
int main(void)
{
int w;
scanf("%d",&w);
if(w==2)
printf("NO");
else if(1<=w && w<=100)
{
    if(w%2==0)
    printf("YES");
    else
    printf("NO");
}
return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w>2&&w%2==0){
        printf("YES");}
    else{
        printf("NO");}
    return 0;
}

#include <stdio.h>

int main()
{
	int num;
	scanf("%d", &num);

	if (num > 2 && (num % 2) == 0 )
	{
		puts("YES");
	}
	else
		puts("NO");

}
/* 1523934934469 */

#include<stdio.h>

int main()
{
    int w;
    scanf("%d", &w);
    if(w%2 == 0)
    {
        w-=2;
        if(w%2==0)
            printf("YES");
    }
    else
        printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{ int w;
scanf("%d",&w);
if(w%2==0)
printf("YES\n");
else
printf("NO\n");
return 0;
}

#include<stdio.h>
int main()
{
    int w;
    printf("Weight:");
    scanf("%d",&w);
    if(w%2==0&&w>2)
    printf("Yes");
    else
    printf("No");
    return 0;
}

#include <stdio.h>
#include <string.h>
int main(){
	int a;
	scanf("%d",&a);
	if(a%2==0) printf("YES");
	else printf("NO");
	return 0;
}
/* 1513874669286 */

#include <stdio.h>

int main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0 && w<=100 && w>=1)
        printf("YES");
    else
        printf("NO");

    return 0;

}

#include<stdio.h>
main()
{
    printf("the weight of the watermelon\n");
    int w;
    scanf("%d",&w);

    if(w%2==0)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
}

#include<stdio.h>
int main(){
    int w;
    for(w=1;w<=100;w++){
        if(w%2==0){
        printf("YES");}
        else printf("NO"); }
        return 0;
    }

#include<stdio.h>
int main()
{
    int n,b,a,w;
    scanf("%d",&w);
    for(n=1;n<=(w/2);n++)
    {
 a=w-2*n;
 b=2*1;
 if((a+b)==w)
    {
        printf("yes");
    break;
    }
    printf("no");
    }
}

#include<stdio.h>
void main()
{
    int a,q;
    scanf("%d",&a);
    if(a<=2){
        printf("NO\n");
    }
    else if(a%2==0){
       q=a/2;
       if(q%2==0){
        printf("YES\n");
       }
       else{
        printf("NO\n");
       }
    }
    else{
        printf("NO\n");
    }
return 0;}

#include<stdio.h>
int main()
{
    int x;
    printf("give the weight");
    scanf("%d",&x);
    if(x>=1 && x<=100)
    {
        if(x==2 && x==4){
            printf(" \n no");
        }
        if(x%2==0){
            printf("\n yes");
        }
        else
        {
            printf("\n no");
        }
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int w;
int b;
int c;
int main(){
printf("Enter vlaue of Watermelon");
printf("\n");
scanf("%d", &w);
printf("\n");
b =w % 2;
c =b % 2;
if(c == 0){
   printf("YES");
}
else
{
  printf("NO");
}
return 0;
}

#include<stdio.h>
int main()
{
    int w;

    scanf("%d",&w);
    {
    if(w % 2 == 0)
    {
        printf("yes");
    }
    else
    {
        printf("no");
    }
    }
}

#include<stdio.h>
int main()
{
    int w,a,b;
    w=a+b;
    scanf("%d %d %d",&w,&a,&b);

    if(w%2==0){if(a%2==0&&b%2==0)
        printf("yes");

    }
    else{
        printf("no");
    }
    return 0;
}

#include <stdio.h>
int main()
{
    int w;
    scanf("%d", &w);
    if (w%2==0)
    {
        printf("YES\n");
    } else{
    printf("NO\n");
    }
    return 0;
}
/* 1491787813352 */

#include<stdio.h>
int main (){
	int x,y,l;
	scanf("%d",&x);
	if(x>=1 && x<=100){
		for(y=1;y<100;y+=2){
			if(y==x){
				l++;
			}
		}
		if(l>0){
			printf("NO");
		}
		else{
			printf("YES");
		}
	}
    else{
    	return 0;
	}
}

#include<stdio.h>
int main()
{
    int m;
    printf("Weight:");
    scanf("%d",&m);
    if(m%2==0&&m>2)
    printf("Yes");
    else
    printf("No");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
int z;
scanf("%d",&z);
if(z%12==0)
{
    printf("YES");

}
else
{
 printf("NO");
}
    return 0;
}

#include <stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if (w%4==0)
    {printf ("YES");}
    else
    {
    printf ("NO");}
}

#include<stdio.h>
#include<string.h>

int main()
{
 int w;
 scanf("%d",&w);
 if(w==2)
    printf("NO");
 if(w%2==0)
    printf("YES");
 else
    printf("NO");
 return 0;
}

#include <math.h>

int main ()
{

int a;
scanf("%d", &a);
if (a%2==0){
    printf(" YES\n");

}else{

printf(" NÃO\n");
}

return 0;
}
/* 1505333252004 */

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0)
    printf("YES");
    else
    printf("NO");
}

#include <stdio.h>

int main() {
    int w;
	scanf("%d", &w);
    if(w%2==0){
        printf("YES");
    }
    else
    {
        printf("NO");
    }
	return 0;
}

#include<stdio.h>
int main()
{
    int w,x;
    scanf("%d",&w);
    if(w%2==0)

         printf("YES")   ;

    else
     printf("NO");
    return 0;
}

#include <stdio.h>
#include <math.h>
main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0){
        if((w/2)%2==0){
            printf("YES");
        }
    }
    else{
        printf("NO");
    }
    return 0;
}

#include<stdio.h>
int main() {
    int n;
    scanf("%d", &n);
    if(n % 2 == 0) {
        printf("YES");
    }
    else {
        printf("NO");
    }
    return 0;
}

#include <stdio.h>

int main(void) {
	int w;
	scanf("%d",&w);
	if( (w/2)%2==0)
	    printf("YES");
	else
	    printf("NO");
	return 0;
}

#include <stdio.h>
int main ()
{
    int w;
    scanf ("%d", &w);
    if (w % 2 == 0)
    {
        printf ("YES\n");
    }
    else
    {
        printf ("NO\n");
    }

return 0;
}

/* 1491921578836 */

int main()
{

    int w;
    scanf("%d",&w);

    if(1<=w && w<=100 && w!=2)
         printf("YES\n");
    else
         printf("NO\n");

    return 0;
}

#include <stdio.h>

int main(){
    int w;

    scanf("%d", &w);
    if(w > 1){
        if(w % 2 == 0)
            printf("YES");
        return 0;
    }
    printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
    int w, x;
    scanf("%d",&w);
    x=w/2.0;
    if(w%2==0)
     { x=w/2;
      if(x%2==0)
         printf("YES")  ;
      else
         printf("NO");
     }
    else
     printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
    int w,b;
    scanf("%d,&w");
    b=w/2;
    if(b%2==0)
    {
        printf("YES");
    }
    else{
        printf("NO");
    }
    return 0;

}

#include <stdio.h>
int main ()
{
    int w;
    scanf ("%d", &w);
    if (w%2 == 0)
    {
        printf ("YES\n");

    }
    else
    {
        printf ("NO\n");
    }
return 0;
}

/* 1491325246072 */

#include<stdio.h>
int main()
{
    int x;
    printf("give the weight");
    scanf("%d",&x);
    if(x>=1 && x<=100)
    {
        if(x==2){
            printf("no");
        }
        if(x%2==0){
            printf("yes");
        }
        else
        {
            printf("no");
        }
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int w=8;
    scanf("%d",&w);
    if(w%2==0)
    printf("Yes");
    else
    printf("No");
    return 0;
}

#include<stdio.h>

int main()
{
 int w;
 int a,b;
 scanf("%d",&w);
 w= a+b;
 if((a /2==0) && (b /2==0))
 {
     printf("YES");
 }
 else
    printf("NO");
    return 0;

}

#include <stdio.h>

int main(void)
{
  int w;
  scanf("%d",&w);
  int onepart=w/2;

      if(w%2==0 && onepart%2==0)
      {
          printf("Yes");

      }
      else
      {
          printf("No");
      }

}

#include <stdio.h>

int main()
{
	int num;
	scanf("%d", &num);

	if ( (num & 1) == 0 && num > 2)
	{
		printf("YES");
	}

	printf("NO");
}

/* 1523935266808 */

    #include<stdio.h>
    #include<conio.h>

    int main()
    {
        int n;
        printf("Please enter the weight=");
        scanf("%d",&n);

        if(n>=1 && n<=100 && n%2==0){
            printf("YES");
        }

        else if(n>=1 && n<=100 && n%2!=0){
            printf("NO");
        }

        return 0;
    }

#include<stdio.h>

int main()
{
     int d,sumTime,minTime[d],maxTime[d],study[d],total=0,i,maxSum=0;
    scanf("%d %d",&d,&sumTime);
    for(i=0;i<d;++i)
    {
        scanf("%d %d",&minTime[i],&maxTime[i]);
        total+=minTime[i];
        study[i]=minTime[i];
        maxSum+=maxTime[i];

    }
    printf("Total : %d ",total);
    i=0;
    while((total!=maxSum) && (total!=sumTime) && (i<d))
    {
        if(study[i]+1<=maxTime[i])
           {
                total+=1;
                printf("Total : %d ",total);
                study[i]+=1;
                printf("Study : %d ",study[i]);
            }
        else
        i++;
    }
    if(total==sumTime)
    {
            printf("YES\n");
            for(i=0;i<d;++i)
                printf("%d ",study[i]);
    }
    else
        printf("NO");
    return 0;

}

#include<stdio.h>

int w,a;
int main(){

    scanf("%d",&a);
    if((a>=1)&& (a<=100)){
        w=a;
        if((w%2)==0){
        printf("Yes");
    }
    else{
        printf("No");
    }
    }
    return 0;
}

#include <stdio.h>
#include <math.h>
main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0){
        if((w/2)%2==0){
            printf("YES");
        }
    }
    else{
        printf("NO");
    }
    return 0;
}

#include <stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0&& (w%2==0 ||((w/2)-1)%2==0 ))
        printf("YES");
    else if(w>100)
        printf("Error");
        else if(w<1)
            printf("Error");
        else
            printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{   int w;
    printf("enter the weight of your watermelon = \t");
    scanf("%d",&w);
    if(w%2==0 & w>=1 & w<=100 )
            printf("yes");
        else
            printf("NO");

    return 0;
}

#include<stdio.h>

int main(){
    int w;
    scanf("%d",&w);
    if((!(w%2)) && (w!=0))
        printf("YES");
    else
        printf("NO");
    return 0;
}

#include <stdio.h>
int main()
{
  int a,k;

    int y,x,d=0,t;
    scanf("%d",&a);

     for(x=1;x<=a;x++)
     for(y=1;y<=a;y++)
      if(y+x==a)
      if(y%2==0 && x%2==0)
      d+=1;
     if(a%2==0 && d==1)
     printf("YES\n");
     else
     printf("NO\n");

    return 0;

}

#include <stdio.h>
int main()
{
    int w, m, n, k;
    k = 2 * m + 2 * n;
    if (w == k)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
}

#include<stdio.h>
int main()
{
    int a, b, c;
    scanf("%d", &a);
    if(0<=a && a<=100 && a%2==0){
        printf("YES");
    }
    return 0;
}

#include <stdio.h>

int main() {
    int w, i=2, ind=0;
	scanf("%d", &w);
    if(w > 2 && w <= 100){
        while(i<(w/2) && ind == 0){
            if((w/2)%i==0){
                ind = 1;
            }
            i++;
        }
        if(ind){
            printf("YES");
        } else {
            printf("NO");
        }
    }
	return 0;
}

#include<stdio.h>
void main()
{
    int w;
    printf("Enter the weight:");
    scanf("%d",&w);
   if(w>2){
    if(w%2==0)
        printf("YES\n");
    else
        printf("N0\n");
   }
else
    printf("N0\n");

    return 0;
}

#include <stdio.h>
int main()
{
int weight;
scanf("%d",&weight);
if(weight%2==0)
{
printf("Yes");
}
else if(weight==2)
{
printf("Yes");
}
else
{
printf("No");
}
    return 0;
}

#include <stdio.h>
int main()
{
    int number;

    printf("Enter an integer: ");
    scanf("%d", &number);

    if( number>=2 && number % 2 == 0)
        printf("%d is YES.", number);
    else
        printf("%d is NO.", number);

    return 0;
}

//By sushmitha1999, contest: Codeforces Beta Round #4 (Div. 2 Only), problem: (A) Watermelon, Compilation error, #
 #include<stdio.h>
main()
{
    int i,n,j,count=0;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
        {
            if((i+j)==n)
            {
                if(i%2==0 && j%2==0)
                {
                    count++;
                }
            }
        }
    if(count>1)
    {
        printf("YES");
    }
    else{
        printf("NO");
    }
}
}

#include <stdio.h>
int main ()
{
    int P;
    scanf("%d", &P);
    if ( P%2 == 0)
    {
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    return 0;
}

/* 1491694316117 */

#include <stdio.h>

int main()
{
   int w;
   scanf("%d",&w);

   if(w>2&&w<=100){
    if(w%2==0){
        printf("Yes");
    }
    else{
        printf("No");
    }
   }
   return 0;

}

#include<stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    if(n%2==0){
        printf("YES");
    }
    else if(n%2!=0){
        printf("NO");
    }
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include<time.h>

int main() {

int weight ;

printf("enter the weight of the watermelon : \n");
scanf(" %d" , &weight) ;
  if(weight%2 == 0 )
  {
      printf("YES");
  }
  else printf("NO");
    return 0;
}

#include<stdio.h>
int main()
{
int w;
printf("enter the weight");
scanf("%d",&w);
if(w>0 && w<100 && w!=2 && w%2==0)
{printf("YES");}
else
printf("/n no");
return 0;
}

#include<stdio.h>

int main()
{
    int num,sum,sum1;

    scanf("%d",&num);

    sum=num/2;
    sum1=num-sum;
    if(sum>=1 && sum1>=1)
    {
      if(num%2==0 && sum%2==0 && sum%2==0)
        printf("YES\n");

    else
        printf("NO\n");
    }

    return 0;
}

#include<stdio.h>
int main()
{
int w;
if(w%2==0)
{
	if((w/2)%2==0)
		printf("YES");
	else
		printf("NO");

}
if(w%2==1) {
	printf("NO");
}
return 0;
}

#include <stdio.h>
#include<math.h>

int main()
{
    int weight, i;

     scanf("%d", &weight);

     if ( weight >= 1 && weight <=100 && weight != 2){
      double parts = (double) weight /2;

      for (int i = 0; i <= parts; i++){
          weight = weight - 2;
          if (weight == 0){
              break;
          }
      }

     if ( weight == 0.0 )

       printf("Yes\n");

     else if ( weight != 0.0)

      printf("No\n");
      }

       return 0;
}

#include<stdio.h>
int main ()
{
    int w;
    printf("Enter the weight: ");
    scanf("%d", &w);
    if (w==2)
        {
          printf("No");
        }
    else if(w%2==0)
    {
        printf("Yes");
    }

    else
        printf("No");

return 0;
}

#include <stdio.h>
    int main ()
{
    int x;
    scanf("%d", &x);
    if (x % 2 != 0)
            printf("NAO\n");

    else printf("SIM\n");

return 0;
}

/* 1505329285958 */

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if((w%2)==0)
    {
        printf("YES\n");
    }else
    {
        printf("NO\n");
    }
    return 0;
}
/* 1491843011470 */

#include<stdio.h>

int main()
{
    int x;
    scanf("%d",&x);
    if(x%2==0 && x<=100 && x>=1)
    printf("YES\n");
    else
    printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d", &w);
    if(1 <= w && w <= 100 && w > 2)
    if(w % 2 == 0){
        printf("Yes");
    }
    return 0;
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(1<w&&w<100)
    {
    if(w%2==0)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
    }
    return 0 ;
}

#include <stdio.h>
int main()
{
int weight;
scanf("%d",&weight);
if(weight%2==0)
{
printf("Yes");
}
else
{
printf("No");
}
    return 0;
}

int main()
{
    int n,k;
    scanf("%d",&n);
    k=n%2;
    if(k%2==0)
       printf("YES");
    else
        printf("NO");
}

#include<stdio.h>
int main()
{
    int w;
    scanf("%d",&w);
    if(w%2==0)
        printf("YES\n");
    if(w<=2)
    printf("NO\n");
    else
        printf("NO\n");
    return 0;
}

#include<stdio.h>
int main()
{
	int a,b,w,p,m;
	scanf("%d",&w);
	for(w=0;w<100;w++)
	{
		scanf("%d",&w);
		if(w>=4)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

#include <stdio.h>

int main(){

	int w;

	scanf("%d", &w);

	if(w == 1) printf("NO\n");
	else printf("YES\n");

	return 0;
}
/* 1506034682222 */

#include<stdio.h>
int main()
{
    int w,rem;

    scanf("%d",&w);
    rem=(w%2);
    if(rem==0){
        printf("yes");
    }
    else{
        printf("nope");
    }
}

#include<stdio.h>
int main()
{
	int a,b,w,p,m;
	scanf("%d",&w);
	for(w=1;w<=100;w++)
	{
		scanf("%d",&w);
		if(w>=4 && w%2==0)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

    #include<stdio.h>
    #include<conio.h>

    int main()
    {
        int n;
        printf("Please enter the weight=");
        scanf("%d",&n);

        if(n%2==0){
            printf("YES");
        }

        else{
            printf("NO");
        }

        return 0;
    }

#include<stdio.h>
int main()
{
    short int n;
    scanf("%hd",&n);
    int temp = n/2;
    int rem = temp/2;
    int tem2 = (rem+rem)*2;
    if(n%2==0&&n==tem2&&n>=1&&n<=100)
    {
        printf("YES\n");
    }else
    {
        printf("NO\n");
    }
    return 0;
}

#include <stdio.h>
int main() {
    int w ;
    scanf ("%d", &w);
    if ((w/2)%2==0){
        printf("YES");
    }
    else
    printf("NO");
}

#include<stdio.h>

int main()
{
    int w;
    do
        scanf("%d", &w);
    while(w<1 || w>100);
    if(w%2 == 0)
    {
        for(int i = 0; i < w; i++)
        {
            if(i&1)
                continue;
            else
                w -= i;
                if(w%2 == 0)
                {
                    printf("YES");
                    break;
                }
                else
                    printf("NO");
        }
    }
    else
        printf("NO");
    return 0;
}

#include<stdio.h>
int main(){
int wes,m1,m2;
scanf("%d",&wes);
m1=wes/2;
m2=wes/2;
if (wes==2){
printf("no");
}
if (wes%2==0 && wes<=100 && wes>=1){
if (m1%2==0 && m2%2==0){
printf("yes");
}}
else {
  printf("no");
}
return 0;}

#include<stdio.h>
#include<conio.h>
int main()
{
	int w;
	printf("total weigh of watermelon");
	scanf("%d",&w);

	if(w%2==0 && w<=100)
	printf("yes");

}

#include<stdio.h>
int main()
{
    int w;
    printf("input w=");
    scanf("%d",&w);
    if(w>100)
    {
        printf("the vaiue of w is not acceptable");
    }
    if(w<1)
    {
        printf("the vaiue of w is not acceptable");
    }
    if(w%4==0)
    {
        printf("yes");
    }
    else
    {
        printf("no");
    }
    return 0;
}

#include<stdio.h>

int main()
{int w;
long long i=0,j=0;
for(;i<100000000000;i++){
    j++;
}
printf("%I64d\n",j);
scanf("%d",&w);
if(w<=2)
printf("no");
else if(w%2==0)
 printf("YES");
 else
 	printf("NO");
 	return 0;
}

#include <stdio.h>

    int main() {
        int w,k;
        scanf("%d",&w);
          k=w%2;
            { if(w<0)
                return 0;
            }
            {if(w>100)
                return 0;
            }
            {if(w==2)
                printf("NO");
            }
            { if(k==0)
            printf("YES");
            }
            { if(k==1)
            printf("NO");
            }
        return 0;
}

int main()
{

    int w;
    scanf("%d",&w);

    if(w > 2 )
         printf("YES\n");
    else
         printf("NO\n");

    return 0;
}

#include<stdio.h>

int main(){
	int watermelon;
	scanf("%i",&watermelon);

	if(!(watermelon%2 && watermelon == 2)){
		printf("YES");
	}
	else
		printf("NO");
}

#include<stdio.h>
main()
{
int w;
scanf("%d",&w);
if(w%2==0)
{
printf("YES");
}
else if(w%2!=0)
{
printf("NO");
}
}

#include <stdio.h>>

int main()
{   int weight;
    scanf("%d",&weight);
    if(weight<=100)
    {
       if(weight%2==0)
       {
         printf("Yes");
       }
       else
       {
       printf("No");
       }
    }
    else
    {
    printf("NO");
    }
    return 0;
}

#include<stdio.h>

main()
{
	int x;
	scanf("%d",&x);
	if(x>2)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}

// @BEGIN_OF_SOURCE_CODE
#include <stdio.h>

int main()
{
    int w;
    while(scanf("%d",&w) != EOF )
    {
        if(w >=1 && w <= 100)
        {if (w%2 == 1)
        {
            printf("NO\n");
        }
        else if (w <= 2)
        {
            printf("NO\n");
        }
        else if(w%2 ==0)
        {
            w/=2;
            if(w%2 == 1)
            {
                printf("NO\n");
            }
            else
            {
                printf("YES\n");
            }
        }
    }}
    return 0;
}
// @END_OF_SOURCE_CODE

#include <stdio.h>

int main(void)
{
  int w;
  scanf("%d",&w);
      if(w%2==0 &&  w!=0)
      {
          printf("Yes");

      }
      else
      {
          printf("No");
      }

}

#include<stdio.h>

typedef long long ll;

int main()
{
    ll n,f=0;
    scanf("%lld",&n);
    for(int i=0;i<=100;i=i+2)
    {
        for(int j=0;j<=100;j=j+2)
        {
            if(i+j==n)
            {
                printf("YES\n");
                f=1;
                break;
            }

        }
        if(f==1)
            {
                break;
            }

    }
    if(f==0)
    {
        printf("NO\n");
    }

    return 0;

}

#include <stdio.h>

int main(){
    int n;

 scanf ("%d", &n);

    // if n is odd, ans is NO. Odd numbers can not be expressed as a sum of
    // two even numbers
    if (n % 2 != 0) printf ("NO\n");

    // if n is even, but less than or equals to 2, ans is NO.
    // possible values of n: 0 and 2
    // NB: Both part should be even and POSITIVE (positive > 0)
    if (n <= 2) printf ("NO\n");

    else printf ("YES\n");
}

int main()
{
    int w;
    while(scanf("%d",&w)==1)
    {
        if(w>2&&w%2==0)
        {
            printf("YES");
        }
        printf("NO");
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    int a[n];
    int i;
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    int idx=n,j,ko,max=0,all;
    for(i=0;i<n;i++){
        ko=1;
        for(j=i+1;j<n;j++){
            if(a[j]==a[i]){
                ko++;
            }
        }
        if(ko>max){
            max=ko;
        }
    }
    for(i=0;i<n;i++){
        for(j=0;j<i;j++){
            if(a[i]==a[j]){
                idx--;
                break;
            }
        }
    }
    if(max%k==0){
        all=max*idx;
    }
    else if(max%k!=0){
        all=(max/k+1)*k*idx;
    }
    printf("%d",all-n);
    return 0;
}

#include<stdio.h>

int main(void)
{
	int nUtensil;
	int kGuest;
	int dNum = 1;
	int Dish = 1;
	int Type[100];
	int minimum;
	int temp = 1;

	scanf("%d %d",&nUtensil,&kGuest);

	for (int cnt = 0;cnt <= nUtensil-1;cnt++)
	{
		scanf("%d",&Type[cnt]);
	}

	for (int cnt1 = 0;cnt1 <= nUtensil -1;cnt1++)
	{
		for (int cnt2 = cnt1+1;cnt2 <= nUtensil-1;cnt2++)
		{
			int temp;
			if (Type[cnt1]>Type[cnt2])
			{
				temp = Type[cnt1];
				Type[cnt1] = Type[cnt2];
				Type[cnt2] = temp;
			}
		}
	}

	for (int cnt = 0;cnt <= nUtensil-2;cnt++)
	{
		if (Type[cnt] != Type[cnt+1])
		{
			temp = 1;
			dNum++;
		}
		else
		{
			temp++;
		}

		if ((temp-1)/kGuest+1 > Dish)
		{
			Dish = (temp-1)/kGuest + 1;
		}
	}

	minimum = kGuest*dNum*Dish - nUtensil;
	printf("%d",minimum);
}

#include<stdio.h>
int a[105]={0};
int main()
{
	int n,k,x,j,count=0;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&x);
		a[x]++;
	}
	int max=0;
	for(int i=1;i<=105;i++)
	if(max<a[i]&&a[i]!=0) max=a[i];
	for(j=1;j*k<max;) j++;
	for(int i=1;i<=105;i++) if(a[i]!=0) count++;
	int ans=count*j*k-n;
	printf("%d",ans);
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_SIZE 100

int getTotal(int *uten,int k);
int maxElement(int *arr);
int in(int *arr,int n);

int main()
{
    //defining variables and arrays needed
    int k , n , nod = 0,nok = 0,temp;
    scanf(" %d %d",&n,&k);
    int arrAfter[MAX_SIZE+1]={0};
    int arr[MAX_SIZE+1]={0};

    for(int i=1;i<=n;i++){
        scanf(" %d",&temp);
        if(!in(arr,temp))
            nok++;
        arr[i]=temp;
        arrAfter[temp]++;

    }
    int maxelement = maxElement(arrAfter);
    nod = getTotal(&maxelement,k)/k;

    printf("%d",nod*nok*k-n);

    return 0;
}

//provides an array with the amount of kitchen utensils left after the party
int maxElement(int *arr){
    int max = 0;
    for(int i=1;i<=MAX_SIZE;i++){
        if(max<*(arr+i))
            max=*(arr+i);
    }
    return max;
}

//get the TOTAL number of utensils served of a certain kind
int getTotal(int *kit,int k){
    int temp = *kit;
    if(temp!=0){
        while((temp%k)!=0){
            temp += 1;
        }
    }
    return temp;
}

int in(int *arr,int n){
    for(int i=1;i<=MAX_SIZE;i++){
        if(n==*(arr+i))
            return 1;
    }
    return 0;
}

#include <stdio.h>

int main()
{

    int k_guests, // guests
        n_count_of_devices, // count of device
        types_of_devices; // type of device
    int c, set_of_device, flag, count_of_dishes;
    int arr_with_devices[100]; // arr with count of devices rewrite!
    int arr_with_types_of_devices[100];
    int count;
    int max_set;

    scanf("%d", &n_count_of_devices);
    if (!n_count_of_devices) // zero devices
        goto end;
    scanf("%d", &k_guests);

    flag = types_of_devices = count = 0;
    for (int i = 0; i < n_count_of_devices; i++) {
            scanf("%d", &c);
            arr_with_devices[i] = c;
            for (int j = 0; j < i; j++)
                if (arr_with_devices[j] == c) {
                    flag = 1;
                    break;
                }
            if (!flag) {
                types_of_devices++; // new device founded
                arr_with_types_of_devices[count++] = c;
            } else flag = 0;
        }

    set_of_device = max_set = 0;
    for (int i = 0; i < count; i++) {
        for (int j = 0; j < n_count_of_devices; j++)
            if (arr_with_types_of_devices[i] == arr_with_devices[j])
                set_of_device++;
        if (set_of_device > max_set)
            max_set = set_of_device;
        set_of_device = 0;
    }

    count_of_dishes = (max_set % k_guests == 0) ? max_set / k_guests : max_set / k_guests + 1;
    printf("%d", count_of_dishes * k_guests * types_of_devices - n_count_of_devices);

end:

    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    int n,k,i,dish=0,maxdish=0,u=0;
    scanf("%d %d",&n,&k);
    int x,count[100]={0};
    for(i=0;i<n;i++)
    {
        scanf("%d",&x);
        if(count[x-1]==0)u++;
        count[x-1]++;
        dish=ceil((float)count[x-1]/(float)k);
        if(dish>maxdish)maxdish=dish;
    }
    printf("%d",maxdish*u*k-n);
}

#include<stdio.h>
#define MAX 100
int a[MAX],b[MAX];
int main()
{
	int k,n;
	int max=0,i;
	for(i=0;i<MAX;i++)
		b[i]=0;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		b[a[i]-1]++;

	}
	for(i=0;i<MAX;i++)
		max=(max>=b[i])?max:b[i];
	int max_,result=0;
	max_=(max%k==0)?max:max-max%k+k;
	for(i=0;i<MAX;i++)
		if(b[i]>0)
			result+=max_-b[i];
	printf("%d",result);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main() {
    int k, n;

    scanf("%d %d", &n, &k);
    int* items = malloc(n*4);
    for (int i = 0; i < n; i++) {
        scanf("%d", &(items[i]));
    }

    int repets[100] = {};

    for (int i = 0; i < 100; i++) {
        repets[i] = 0;
    }

    for (int i = 0; i < n; i++) {
        repets[items[i] - 1] += 1;
    }

    int max_rep = 0;
    int typenum = 0;

    for (int i = 0; i < 100; i++) {
        if (repets[i] > max_rep) {
            max_rep = repets[i];
        }

        if (repets[i] != 0) {
            typenum++;
        }
    }

    int min_dish_num = 0;

    while (min_dish_num*k < max_rep) {
        min_dish_num += 1;
    }

    printf("%d\n", typenum*min_dish_num*k - n);

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b=1,max=1,somonan,dem,n,k,i,mini;
    scanf("%d%d",&n,&k);
    int array[n];
    for(i=0;i<n;i++)
    {
        scanf("%d", &array[i]);
    }
    for(a=0;a<n;a++)
    {
        for(i=0;i<n-1;i++)
        {
            if(array[i]>array[i+1])
            {
                dem=array[i];
                array[i]=array[i+1];
                array[i+1]=dem;
            }
        }
    }
    dem=1;
    for(i=0;i<n-1;i++)
    {
        if(array[i]==array[i+1])
        {
            dem++;
            if(dem>max)
            {
                max=dem;
            }
        }
        else
        {
            b++;
            dem=1;
        }
    }
    if(max<k)
    {
        somonan=1;
    }
    else
    {
        if(max%k==0)
        {
            somonan=max/k;
        }
        else
        {
            somonan=max/k+1;
        }
    }
    mini=somonan*k*b-n;
    printf("%d",mini);
    return 0;
}

#include <stdio.h>

int main(void){
	int n, k, temp, maxi = -1, miss = 0, dish;
	int arr[100] = {0};
	scanf("%d%d", &n, &k);

	while(n--){
		scanf("%d", &temp);
		arr[temp-1]++;
		if(arr[temp - 1] > maxi) maxi = arr[temp - 1];
	}
	dish = maxi / k;
	if(maxi % k > 0) dish++;
	for(int i = 0; i < 100; i++){
		if(arr[i] == 0) continue;
		miss += (dish * k - arr[i]);
	}
	printf("%d", miss);
}

#include<stdio.h>
#include<string.h>
int min(int x,int y)
{
	if(x>y) return y;
	else return x;
}
int max(int x,int y)
{
	if(x>y) return x;
	else return y;
 }
int main()
{
	int utensil,guest,minimum=0,cnt=0;
	int i,temp;
	int remain[105];
	memset(remain,0,sizeof(remain));
	scanf("%d%d",&utensil,&guest);
	for(i=1;i<=utensil;i++)
	{
		scanf("%d",&temp);
		remain[temp]++;
	}
	for(i=1;i<=100;i++)
	{
		if(remain[i])
		{
			cnt++;
			minimum=max(minimum,(remain[i]+guest-1)/guest);
		}
	}
	printf("%d",minimum*cnt*guest-utensil);
	return 0;
 }

#include<stdio.h>
#include<math.h>
int main()
{
	int n,k,max=0,temp,count=0,res,i=0,p;
	int utensil[101]={0};
	scanf("%d %d",&n,&k);
	while(i<n)
	{
		scanf("%d",&temp);
		if(utensil[temp]==0)
		{
			count++;
		}
		utensil[temp]++;
		if(utensil[temp]>max)
		{
			max=utensil[temp];
		}
		i++;
	}
	p=(max+k-1)/k;
	res=(p*count*k)-n;
	printf("%d",res);
return 0;
}

#include<stdio.h>
main()
{
int i,j,k,l,m,n,p,q,max=0,sum=0,z;
int count,count1;
scanf("%d",&n);
scanf("%d",&k);
int a[n],b[101]={0};
for(i=0;i<n;i++)
{scanf("%d",&a[i]);
}
for(j=0;j<n;j++)
{count=0;
for(m=j;m<n;m++)
{if(a[j]==a[m])
count=count+1;}
if(count>max)
max=count;}
if(max%k==0)
z=max/k;
else
z=(max/k)+1;
for(l=1;l<=100;l++)
{count1=0;
for(p=0;p<n;p++)
{if(a[p]==l)
count1+=1;}
b[l]=count1;}
for(q=0;q<=100;q++)
{if(b[q]!=0)
sum+=((z*k)-b[q]);}
printf("%d\n",sum);
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    int arr[100] = {};
    int t;
    for (int i = 0; i < n; i++) {
        scanf("%d", &t);
        arr[t % 100]++;
    }
    int ctr = 0;
    int __max = 0, temp;
    for (int i = 0; i < 100;i++) {
        if (arr[i]) {
            ctr++;
            temp = (arr[i] / k + ((arr[i] % k) > 0));
            __max = __max > temp ? __max : temp;
        }
    }
    printf("%d\n", k * __max * ctr - n);
	return 0;
}

#include <stdio.h>

int Cnt[101];

int main()
{
    int n, k, a, max = 0;
    scanf("%d %d", &n, &k);
    for(int i = 0; i < n; ++i) {
        scanf("%d", &a);
        ++Cnt[a];
        if(max < Cnt[a]) {
            max = Cnt[a];
        }
    }
    if(max % k != 0) {
        max += k - 1;
        max /= k;
        max *= k;
    }
    int ans = 0;
    for(int i = 1; i < 101; ++i) {
        if(Cnt[i]) {
            ans += max - Cnt[i];
        }
    }
    printf("%d\n", ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIZE 10010

int main() {
	int n, k, a[SIZE], size = 0, i, t, sum = 0, max = 0, j = 1, c;

	scanf ("%d %d", &n, &k);

	memset (a, 0, sizeof a[0] * SIZE);

	for (i = 0; i < n; i++) {
		scanf ("%d", &t);

		if (t > size)
			size = t;

		a[t]++;
	}

	for (i = 1; i <= size; i++)
		if (a[i] != 0)
			a[j++] = a[i];
	size = j - 1;

	for (i = 1; i <= size; i++)
		if (a[i] > max)
			max = a[i];

	c = (max - 1) / k + 1;

	for (i = 1; i <= size; i++)
		if (a[i] > k)
			a[i] %= k;

	for (i = 1; i <= size; i++)
		if (a[i] > max)
			max = a[i];

	sum = c * size * k - n;

	printf ("%d", sum);

	return 0;
}

#include <stdio.h>

int arr[1005];
int main ()
{
	int n,k;
	scanf("%d %d",&n,&k);
	int a;
	for (int i=0;i<n;i++){
		scanf("%d",&a);
		arr[a]++;
	}
	int max=0;
	for (int i=0;i<1000;i++)
	{
		if (arr[i]>max) max=arr[i];
	}
	// printf("%d\n",max);
	int dish=1;
	while (k*dish<max)
		dish++;

	// printf("%d\n",dish);
	int count=0;
	for (int i=0;i<1000;i++)
	{
		if (arr[i]!=0)
			count+=dish*k-arr[i];
	}
	printf("%d\n",count);
}

#include <stdio.h>
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	int a[100]={0};
	for(int i=0;i<n;i++){
		int y;
		scanf("%d",&y);
		a[y-1]++;
	}
	int max=0,num=0;
	for(int i=0;i<100;i++){
		if(a[i]>max)
		max=a[i];
		if(a[i]!=0)
		num++;
	}
	int g;
	if(max%m==0){
		g=max/m;
	}
	else{
		g=max/m+1;
	}
	printf("%d",g*m*num-n);

}

#include<stdio.h>
int main()
{
	int n,m;
	int i,a[10001],max,sum,count,h;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		int b[101]={0};
		count=max=0;
		for(i=1;i<=n;i++)
			{scanf("%d",&a[i]);
		b[a[i]]++;
		if(b[a[i]]>max)
		max=b[a[i]];
		}
		if(max%m==0)
		sum=max/m;
		else
		sum=max/m+1;
		for(i=1;i<=100;i++)
		if(b[i])
		count++;
		h=sum*count*m-n;
		printf("%d\n",h);
	}
	return 0;
}

#include <stdio.h>

int
main(void)
{
	//freopen("input.txt", "r", stdin);
	int a[101];
	int cnt[100] = { 0, };
	for (int i = 0; i < 100; i++) {
		cnt[i] = 0;
	}
	int n, k;
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}

	// max # of array
	int max = 0;
	for (int i = 0; i < n; i++) {
		if (max < a[i]) {
			max = a[i];
		}
	}

	for (int i = 0; i < n; i++) {
		cnt[a[i]-1]++;
	}
	int f_max = 0;
	for (int i = 0; i < 100; i++) {
		if (f_max < cnt[i]) {
			f_max = cnt[i];
		}
	}

	int num_type = 0;
	for (int i = 0; i < 100; i++) {
		if (cnt[i] != 0) {
			num_type++;
		}
	}
	int num_dish = (f_max + k - 1) / k;

	int res = num_dish * k * num_type - n;
	//printf("%d %d %d %d\n", num_dish, num_type, f_max, k);
	printf("%d\n", res);

	return 0;
}

#include "stdio.h"

int count(int*mas)
{
	int a=0;
	for(int i=0;i<100;i++)
		if(mas[i]!=0)a++;
	return a;
}

int find_max(int*mas,int g)
{
	int max=0;
	for (int i=0;i<100;i++)
	{
		if(mas[i]>max)max=mas[i];
	}
	if(max%g==0)
		return max/g;
	else return (max/g)+1;
}

int main()
{
	int n,g,tmp,sum;
	scanf("%d%d",&n,&g);
	int mas[100];
	for (int i=0;i<100;i++)
		mas[i]=0;
	for (int i=0;i<n;i++)
	{
		scanf("%d",&tmp);
		mas[tmp-1]+=1;
	}
	sum=g*find_max(mas,g)*count(mas)-n;
	printf("%d",sum);
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
    int i,n,k,count=0,max=0,j,z;
    int c[100]={};
    scanf("%d%d",&n,&k);
    int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<100;i++)
    {
        for(j=0;j<n;j++)
        {
            if(a[j]==i+1)
            c[i]++;
        }
        if(c[i]>max)
        max=c[i];
        if(c[i]>0)
        count++;
    }
    z=ceil((float)max/k);
   printf("%d",(k*count*z)-n);
    return 0;
}

#include<stdio.h>

struct Utensils
{
	int num;
	int count;
};

int main()
{
	int n,k;
	while((scanf("%d%d",&n,&k))!=-1)
	{
		int i,j,iCount=0,ok,u[n],setnum = 0;
		struct Utensils U[n];
		for(i = 0;i < n;i++) scanf("%d",&u[i]);
		for(i = 0;i < n;i++)
		{
			ok = 1;
			for(j = 0;j<iCount;j++)
			{
				if(U[j].num == u[i])
				{
					U[j].count++;
					ok = 0;
					break;
				}
			}
			if(ok)
			{
				U[iCount].num = u[i];
				U[iCount++].count = 1;
			}
		}
		for(i = 0;i < iCount;i++)
		{
			if(setnum < (U[i].count-1)/k+1) setnum = (U[i].count-1)/k+1;
		}
		printf("%d\n",setnum*iCount*k-n);
	}
	return 0;
}

#include <stdio.h>
#define MAX 100
int main()
{
	// n����ͺ�ʣ�µĲ;���Ŀ
	// k�ǲμ�����Ŀ�����Ŀ
	int n, k;
	// ��ȡn��k��ֵ
	scanf("%d%d", &n, &k);
	// a[]��ʣ�µĲ;ߵ�ÿ������ĸ���
	int a[MAX] = {0};
	int i;
	for(i = 0; i < n; i++) {
		int x;
		scanf("%d", &x);
		a[x-1]++;
	}
	// �ҵ����ֵm������ͳ�Ƴ�����ĸ���c
	int m = 0;
	int c = 0;
	for(i = 0; i < MAX; i++) {
		if(a[i] == 0)
			continue;
		if(a[i] > m)
			m = a[i];
		c++;
	}
	// ����;ߵ�����t
	while(m % k != 0) m++;
	// ������
	printf("%d", m * c - n);
	return 0;
}

#include<stdio.h>
#include<string.h>
main(){
	int type=0,s[105],s1[105],n,k,max;
	memset(s,'\0',sizeof(s));
	memset(s1,'\0',sizeof(s1));
	scanf("%d %d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&s[i]);
	}
	for(int i=0;i<n-1;i++){
		for(int k=i+1;k<n;k++){
			if(s[i]==s[k]){
				s1[i]++;
			}
		}
	}
	max=s1[0];
	for(int i=1;i<n;i++){
		if(max<s1[i])
		max=s1[i];
	}
	max+=1;
	int z=k;
	while(max>k){
		k+=z;
	}
	int count=0;
	for(int i=0;i<n;i++){
		int t=0;
		for(int j=i-1;j>=0;j--){
			if(s[i]==s[j])
			t++;
		}
		if(!t){
			count++;
		}
	}
	int re=count*k-n;
	printf("%d",re);
}

#include<stdio.h>
int max(int a,int b){
	if (a>b) return a;
	else return b;
}
int main(){
	int n,k,p,i,j,ans,
		num=0,
		sum=0,
		maxm=-1,
		maxn=-1,
		a[101]={0};
	scanf("%d%d",&n,&k);
	for(i=1;i<=n;i++){
		scanf("%d",&p);
		maxn=max(maxn,p);
		a[p]++;
	}
	for(i=1;i<=maxn;i++){
		if (a[i]!=0){
			maxm=max(maxm,a[i]);
			num++;
			sum=sum+a[i];
		}
	}
	(maxm%k==0)?(p=maxm/k):(p=maxm/k+1);
	ans=p*k*num-sum;
	printf("%d",ans);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int cnt[100];

int compare (const void * a, const void * b){
    return *(int*)b - *(int*)a;
}

int main() {
    int n, k, i, a;
    int stolen = 0;
    int max = 0;

    scanf("%d %d", &n, &k);
    for (i = 0; i < n; ++i) {
        scanf("%d", &a);
        (cnt[a-1])++;
    }

    qsort(cnt, 100, sizeof(int), compare);
    while (max < cnt[0]) {
        max += k;
    }

    for (i = 0; i < 100; ++i) {
        if (!cnt[i]) { break; }
        stolen += max - cnt[i];
    }
    printf("%d", stolen);

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int fun(const void* a, const void* b){
	return (*(short int*)a - *(short int*)b) * (-1);
}

int main(){
	int n, k, i = 0, A[100], l = 0, countpr = 0, countmax, dish;
	scanf("%d%d", &n, &k);
	for(i = 0; i < 100; i++){
		A[i] = 0;

	}
	for(i = 0; i < n; i++){
		scanf("%d", &l);
		if(A[l-1] == 0) countpr++;
		A[l-1]++;
	}

	qsort(A, 100, sizeof(int), fun);

	countmax = A[0];

	if(countmax < k) dish = 1;

	else if(countmax % k == 0) dish = countmax/k;

	else dish = (countmax/k)+1;

	//printf("dish = %d, countpr = %d\n", dish, countpr);

	printf("%d\n", dish*countpr*k - n);

	//printf("%d\n", dish);

	//for(i = 0; i < 100; i++){
	//	printf("%d ", A[i]);
	//}

	return 0;
}

 #include<stdio.h>
#include<stdlib.h>
int main()
{
	int n ;
	int k;
	scanf("%d",&n);
	scanf("%d",&k);
	int* tab ;
	tab=malloc(n*sizeof(int));
	int i ;
	int inter[101]={0};
	int max=0 , out=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&tab[i]);
		inter[tab[i]]++;
		if(	inter[tab[i]]>max)
		{
			max=inter[tab[i]];
		}
	}
	while(max%k)
	{
		max++;
	}
	for(i=1;i<101;i++)
	{
		if(inter[i]!=0)
		{
		out+=max-inter[i];
		}
	}
	printf("\n%d",out);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

#define NUM_TYPES 100

int main(int argc, char** argv){
	int n, k, uten;
	scanf("%d %d", &n, &k);
	int num_types[NUM_TYPES];
	for(int i = 0; i < NUM_TYPES; i++)
		num_types[i] = 0;
	int num_distinct = 0;
	int num_dish = 0;
	for(int i = 0; i < n; i++){
		scanf("%d", &uten);
		if(!num_types[uten-1]++)
			num_distinct++;
		if(num_types[uten-1] > k * num_dish)
			num_dish++;
	}

	// Solve the problem
	int min_missing = (k * num_distinct * num_dish) - n;
	printf("%d\n", min_missing);

	return EXIT_SUCCESS;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int uten,guest;
    scanf("%d%d",&uten,&guest);
    int a[uten][2];
    for(int i=0;i<uten;i++)
        scanf("%d",&a[i][0]);
    for(int i=0;i<uten;i++)
        a[i][1]=1;
    for(int i=0;i<uten;i++){
        if(a[i][0]){
            for(int j=i+1;j<uten;j++){
                if(a[j][0]==a[i][0]){
                    a[i][1]++;
                    a[j][0]=a[j][1]=0;
                }
            }
        }
    }
    int dishes=0;
    for(int i=0;i<uten;i++){
        if(a[i][1]>dishes)
            dishes=a[i][1];
    }
    dishes=((dishes/guest)+(dishes%guest?1:0))*guest;
    int stolen=0;
    for(int i=0;i<uten;i++){
        if(a[i][0]){
            if(a[i][1]%dishes){
                stolen+=dishes-a[i][1];
            }
        }
    }
    printf("%d",stolen);
    return 0;
}

#include<stdio.h>
int main(){
	int n,k,max=0;
	scanf("%d %d",&n,&k);
	int used[101]={0},list[101]={0};
	for(int i=1;i<=n;i++){
		scanf("%d",&used[i]);
		list[used[i]]+=1;
	}
	for(int i=1;i<=100;i++){
		if(list[i]>=max)
			max=list[i];
	}

	if((max%k)!=0){
		max=(max/k)+1;
		max*=k;
	}
	int stolen=0;
	for(int i=1;i<=100;i++){
		if(list[i]!=0){
			stolen+=(max-list[i]);
		}
	}
	printf("%d\n", stolen);
	return 0;
}

#include <stdio.h>
int arr[100];
int main()
{
	int n,k,i,tmp,max=0,tp=0;
	scanf("%d %d",&n,&k);
	for(i=0;i<n;i++)
	{
		scanf("%d",&tmp);
		arr[tmp-1]++;
	}
	for(i=0;i<100;i++)
	{
		if(arr[i])
		{
			tp++;
			if(arr[i]>max) max=arr[i];
		}
	}
	if(max%k) max=max/k+1;
	else max=max/k;
	printf("%d",max*tp*k-n);

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,dem,max=0,z=0,i;
    scanf("%d%d",&n,&k);
    if (n==0)
        printf("%d",k);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[z]=a[i];
        z++;
    }
    for(i=0;i<n;i++)
    {   dem=0;
        for(int j=i;j<n;j++)
        {
            if (a[j]==a[i])
                dem++;
        }
        if(dem>max)
            max=dem;
    }
    int kq,c,sodoi,sopt=1;
    for (i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]<a[j])
            {
                sodoi=a[i];
                a[i]=a[j];
                a[j]=sodoi;
            }
        }
    }
    for (i=1;i<n;i++)
    {
        if (a[i] != a[i-1])
            sopt++;
    }
    c=max/k;
        if ((float)max/k>c)
        {
            c++;
        }
        kq=sopt*c*k-n;
    if (sopt==1 && (float)max/k==c)
        kq=0;
    printf("%d",kq);
return 0;
}

#include<stdio.h>

int main(void) {
    int n, k;
    int arr[105] ={0,};
    int max_i = 0;
    int cnt = 0;
    scanf("%d %d", &n, &k);

    for(int i =0; i < n; i++) {
        int temp;
        scanf("%d", &temp);
        arr[temp]++;
        if(arr[temp] == 1)
            cnt++;
        if( arr[temp] > arr[max_i])
            max_i = temp;
    }

    arr[max_i] += k-1;
    arr[max_i] /= k;

    printf("%d", cnt * arr[max_i] * k - n);
    return 0;
}

#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "math.h"

#ifdef WIN32
    #define LLINT "%I64d"
    #define ULLINT "%I64u"
#else
#endif

#define INT "%d"
#define LINT "%ld"
#define ULINT "%lu"
#define SINT "%hd"
#define USINT "%hu"
#define STRING "%s"
#define KITCHEN_SIZE 101

typedef long int LInt;
typedef unsigned long int ULInt;
typedef short int SInt;
typedef unsigned short int USInt;
typedef long long int LLInt;
typedef unsigned long long int ULLInt;

int main()
{
    int CurrentType = 0;
    int MaxRemained = 0;
    int UtensilsTypes[KITCHEN_SIZE] = { 0 };
    int GuestsCount = 0;
    int RemainedUtensils = 0;
    int DishesPerQuest = 0;
    int TypesCount = 0;

    scanf(INT INT, &RemainedUtensils, &GuestsCount);
    for (int i = 0; i < RemainedUtensils; i++)
    {
        scanf(INT, &CurrentType);

        if (UtensilsTypes[CurrentType] == 0)
        {
            TypesCount++;
        }

        UtensilsTypes[CurrentType]++;

        if (UtensilsTypes[CurrentType] > MaxRemained)
        {
            MaxRemained = UtensilsTypes[CurrentType];
        }
    }

    if (MaxRemained <= GuestsCount)
    {
        DishesPerQuest = 1;
    }
    else
    {
        DishesPerQuest = MaxRemained / GuestsCount;

        if (MaxRemained % GuestsCount)
        {
            DishesPerQuest++;
        }
    }

    printf(LINT"\n", (LInt)TypesCount * (LInt)GuestsCount * (LInt)DishesPerQuest  - (LInt)RemainedUtensils);

	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{

    int n,k,freq[101],total=0,resp,aux,dishes,max = 0;

    scanf("%d %d",&n,&k);

    for(int i =0; i<101;i++)
    {
        freq[i] = 0;
    }

    for(int i =0; i<n;i++)
    {
        scanf("%d",&aux);

        if(freq[aux] == 0)
            total++;

        freq[aux]++;

        if(freq[aux] > max)
            max = freq[aux];
    }

    if(max%k == 0)
        dishes = max/k;
    else
        dishes = max/k + 1;

    printf("%d\n",dishes*total*k - n);

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    int i,a[n],num[101],cnt=0,max=0,s,sum=0;
    memset(num,0,101*sizeof(int));
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        if(num[a[i]]<=0)
            cnt++;
        num[a[i]]++;
        if(max<num[a[i]])
            max=num[a[i]];
    }
    s=ceil((float)max/k);
    s=s*k;
    for(i=0;i<101;i++)
        if(num[i]>0)
          sum+=s-num[i];
    printf("%d\n",sum);
}

#include <stdio.h>

int main()
{
	int n, k, i, a[101] = { 0 },m,ma=0,ans,gs=0,mk=0;
	scanf("%d %d", &n, &k);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &m);
		a[m]++;
	}
	for (i = 0; i < 101; i++)
	{
		if (a[i] > ma)
			ma = a[i];
		if (a[i] > 0)
			gs++;
	}
	if (ma%k == 0)
		mk = ma / k;
	else
		mk = ma / k + 1;
	ans = mk*k*gs - n;
	printf("%d", ans);

	return 0;
}

    #include<stdio.h>
int main()
{
    int b[110],a[110];
    int sheng,ren,i,j,shu=0;
    for(i=1;i<=100;i++)
        a[i]=0;
    scanf("%d%d",&sheng,&ren);
    for(i=1;i<=sheng;i++)
    {
        scanf("%d",&b[i]);
        j=b[i];
        a[j]++;
    }
    int max;
    max=a[1];
    for(i=1;i<=100;i++)
{
    if(a[i]>=max)
        max=a[i];
        if(a[i]!=0)
            shu++;
}
if(max>ren)
    for(i=2;i<max;i++)
{
    if(max<=ren*i)
        break;
}
else
    i=1;
int zhong;
zhong = ren*i*shu-sheng;
printf("%d",zhong);
    return 0;
}

#include <stdio.h>
#include <string.h>

int max(int a, int b){ return a>b?a:b;}
 int main()
 {
 	int x,y,n,k,i;
 	scanf("%d %d",&n,&k);
 	int ar[105];
 	memset(ar,0,sizeof(ar));
 	for(i=0;i<n;i++)
 	{
 		scanf("%d",&x);
 		ar[x]++;
 	}
 	x=0;
 	for(i=0;i<101;i++)
 	{
 		y=ar[i]/k;
 		if(ar[i]%k)y++;
 		x=max(x,y);
 	}
 	x*=k;
 	y=0;
 	for(i=0;i<101;i++)
 	{
 		if(ar[i])y+=x-ar[i];
 	}
 	printf("%d\n", y);
 	return 0;
 }

#include <stdio.h>
#include <string.h>

int main(){

	int x,y;
	scanf("%d",&x);
	scanf("%d",&y);
	int en,fre[101],di=0;
	memset(fre,0,sizeof(fre));
	while(x--){
		scanf("%d",&en);
		fre[en]++;
		if(fre[en]>di*y)di++;
	}
	int i,res=0;
	for(i=1;i<=100;i++)if(fre[i])res+=di*y-fre[i];
	printf("%d\n",res);

	return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>

int main()
{
    unsigned int n,k,a[101],x[101]={0},d=0,t,min,i,count=0,sum=0;

    scanf("%u %u",&n,&k);

    min=0;

    for(i=0;i<n;i++)
    {
        scanf("%u",&a[i]);
    }

    for(i=0;i<n;i++)
    {
        x[a[i]]++;
    }

    for(i=0;i<=100;i++)
    {
        if(x[i]>0)
            count++;

        if(x[i]>min)
            min=x[i];

    }
    int p=1;
    while(min>k)
    {
        min=min-k;
        p++;
    }

    d=p*k*count-n;

    printf("%u",d);

    return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

  int n, k, i;

  scanf("%d%d", &n, &k);

  int a[n];
  int c[128];
  int max = 0;
  int v;
  int ans = 0;

  for(i = 1; i <= 100; i++){
    c[i] = 0;
  }

  for(i = 0; i < n; i++){
    scanf("%d", &a[i]);
    c[a[i]]++;
  }

  for(i = 1; i <= 100; i++){
    if(c[i] > max){
      max = c[i];
    }
  }

  if(max % k == 0){
    v = max;
  }else{
    v = ((max / k) + 1) * k;
  }

  for(i = 1; i <= 100; i++){
    if(c[i] >= 1){
      ans += (v - c[i]);
    }
  }

  printf("%d\n", ans);

  return 0;
}

#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "math.h"

#ifdef WIN32
    #define LLINT "%I64d"
    #define ULLINT "%I64u"
#else
#endif

#define INT "%d"
#define LINT "%ld"
#define ULINT "%lu"
#define SINT "%hd"
#define USINT "%hu"
#define STRING "%s"
#define KITCHEN_SIZE 101

typedef long int LInt;
typedef unsigned long int ULInt;
typedef short int SInt;
typedef unsigned short int USInt;
typedef long long int LLInt;
typedef unsigned long long int ULLInt;

int main()
{
    int CurrentType = 0;
    int MaxRemained = 0;
    int UtensilsTypes[KITCHEN_SIZE] = { 0 };
    int GuestsCount = 0;
    int RemainedUtensils = 0;
    int DishesPerQuests = 0;
    int TypesCount = 0;

    scanf(INT INT, &RemainedUtensils, &GuestsCount);
    for (int i = 0; i < RemainedUtensils; i++)
    {
        scanf(INT, &CurrentType);

        if (UtensilsTypes[CurrentType] == 0)
        {
            TypesCount++;
        }

        UtensilsTypes[CurrentType]++;

        if (UtensilsTypes[CurrentType] > MaxRemained)
        {
            MaxRemained = UtensilsTypes[CurrentType];
        }
    }

    if (MaxRemained <= GuestsCount)
    {
        printf(LINT"\n", (LInt)TypesCount * (LInt)GuestsCount - (LInt)RemainedUtensils);
    }
    else
    {
        DishesPerQuests += TypesCount / GuestsCount;
        if (TypesCount % GuestsCount)
        {
            DishesPerQuests++;
        }

        printf(LINT"\n", (LInt)TypesCount * (LInt)GuestsCount * (LInt)DishesPerQuests  - (LInt)RemainedUtensils);
    }

	return 0;
}

#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "math.h"

#ifdef WIN32
    #define LLINT "%I64d"
    #define ULLINT "%I64u"
#else
#endif

#define INT "%d"
#define LINT "%ld"
#define ULINT "%lu"
#define SINT "%hd"
#define USINT "%hu"
#define STRING "%s"
#define KITCHEN_SIZE 101

typedef long int LInt;
typedef unsigned long int ULInt;
typedef short int SInt;
typedef unsigned short int USInt;
typedef long long int LLInt;
typedef unsigned long long int ULLInt;

int main()
{
    int CurrentType = 0;
    int MaxRemained = 0;
    int UtensilsTypes[KITCHEN_SIZE] = { 0 };
    int GuestsCount = 0;
    int RemainedUtensils = 0;
    int DishesPerQuests = 0;
    int TypesCount = 0;

    scanf(INT INT, &RemainedUtensils, &GuestsCount);
    for (int i = 0; i < RemainedUtensils; i++)
    {
        scanf(INT, &CurrentType);

        if (UtensilsTypes[CurrentType] == 0)
        {
            TypesCount++;
        }

        UtensilsTypes[CurrentType]++;

        if (UtensilsTypes[CurrentType] > MaxRemained)
        {
            MaxRemained = UtensilsTypes[CurrentType];
        }
    }

    if (MaxRemained <= GuestsCount)
    {
        printf(INT"\n", TypesCount * GuestsCount - RemainedUtensils);
    }
    else
    {
        DishesPerQuests += TypesCount / GuestsCount;
        if (TypesCount % GuestsCount)
        {
            DishesPerQuests++;
        }

        printf(INT"\n", TypesCount * GuestsCount * DishesPerQuests  - RemainedUtensils);
    }

	return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>

int main()
{
    unsigned int n,k,a[101],x[101]={0},d=0,min,i,count=0,sum=0;

    scanf("%u %u",&n,&k);

    min=101;

    for(i=0;i<n;i++)
    {
        scanf("%u",&a[i]);
    }

    for(i=0;i<n;i++)
    {
        x[a[i]]++;
    }

    for(i=0;i<=100;i++)
    {
        if(x[i]>0)
            count++;

        if(x[i]<k && x[i]>0)
            sum++;

    }

    d=sum*k*count-n;

    printf("%u",d);

    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>

int main()
{
    unsigned int n,k,a[101],x[101]={0},d=0,min,i,count=0;

    scanf("%u %u",&n,&k);

    min=101;

    for(i=0;i<n;i++)
    {
        scanf("%u",&a[i]);
    }

    for(i=0;i<n;i++)
    {
        x[a[i]]++;
    }

    for(i=0;i<=100;i++)
    {
        if(x[i]>0)
            count++;

        if(x[i]<=min && x[i]>0)
            min=x[i];
    }

    d=(k-min)*k*count-n;

    printf("%u",d);

    return 0;
}

#include<stdio.h>

int main(void)
{
	int nUtensil;
	int kGuest;
	int dNum = 1;
	int Dish = 1;
	int Type[100];
	int minimum;
	int temp = 1;

	scanf("%d %d",&nUtensil,&kGuest);

	for (int cnt = 0;cnt <= nUtensil-1;cnt++)
	{
		scanf("%d",&Type[cnt]);
	}

	for (int cnt1 = 0;cnt1 <= nUtensil -1;cnt1++)
	{
		for (int cnt2 = cnt1+1;cnt2 <= nUtensil-1;cnt2++)
		{
			int temp;
			if (Type[cnt1]>Type[cnt2])
			{
				temp = Type[cnt1];
				Type[cnt1] = Type[cnt2];
				Type[cnt2] = temp;
			}
		}
	}

	for (int cnt = 0;cnt <= nUtensil-2;cnt++)
	{
		if (Type[cnt] != Type[cnt+1])
		{
			temp = 1;
			dNum++;
		}
		else
		{
			temp++;
		}

		if ((temp-1)/kGuest+1 > Dish)
		{
			Dish = (temp-1)/kGuest + 1;
		}
	}

	for (int cnt = 0;cnt <= nUtensil-1;cnt++)
	{
		printf("%d ",Type[cnt]);
	}
	minimum = kGuest*dNum*Dish - nUtensil;
	printf("%d",minimum);
}

#include<stdio.h>
int a[105]={0};
int main()
{
	int n,k,x,j,count;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&x);
		a[x]++;
	}
	int max=0;
	for(int i=1;i<=n;i++)
	if(max<a[i]) max=a[i];
	for(j=1;j*k<max;j++);
	for(int i=1;i<=n;i++) if(a[i]!=0) count++;
	int ans=count*j*k-n;
	printf("%d",ans);
}

#include<stdio.h>
int a[105]={0};
int main()
{
	int n,k,x,j,count=0;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&x);
		a[x]++;
	}
	int max=0;
	for(int i=1;i<=n;i++)
	if(max<a[i]&&a[i]!=0) max=a[i];
	for(j=1;j*k<max;) j++;
	for(int i=1;i<=n;i++) if(a[i]!=0) count++;
	int ans=count*j*k-n;
	printf("%d",ans);
}

#include <stdio.h>

int main()
{
    int k_guests, // guests
        n_count_of_devices, // count of device
        types_of_devices; // type of device
    int c, device, flag, count_of_dishes;
    int arr_with_devices[100]; // arr with count of devices rewrite!

    scanf("%d", &n_count_of_devices);
    if (!n_count_of_devices) // zero devices
        goto end;
    scanf("%d", &k_guests);

    flag = types_of_devices = 0;
    count_of_dishes = device = 1;
    for (int i = 0; i < n_count_of_devices; i++) {
            scanf("%d", &c);
            arr_with_devices[i] = c;
            for (int j = 0; j < i; j++)
                if (arr_with_devices[j] == c) {
                    flag = 1;
                    device++;
                }
            if (!flag)
                types_of_devices++; // new device founded
            else flag = 0;
            if (device > k_guests)
                count_of_dishes++;
            device = 1;
        }
    printf("%d", count_of_dishes * k_guests * types_of_devices - n_count_of_devices);

end:

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b=1,max=1,somonan,dem,n,k,i,mini;
    scanf("%d%d",&n,&k);
    int array[n];
    for(i=0;i<n;i++)
    {
        scanf("%d", &array[i]);
    }
    for(a=0;a<n;a++)
    {
        for(i=0;i<n-1;i++)
        {
            if(array[i]>array[i+1])
            {
                dem=array[i];
                array[i]=array[i+1];
                array[i+1]=dem;
            }
        }
    }
    dem=1;
    for(i=0;i<n-1;i++)
    {
        if(array[i]==array[i+1])
        {
            dem++;
            if(dem>max)
            {
                max=dem;
            }
        }
        else
        {
            b++;
            dem=1;
        }
    }
    if(max<k)
    {
        somonan=1;
    }
    else
    {
        if(max%k==0)
        {
            somonan=max/k;
        }
        else
        {
            somonan=max%k+1;
        }
    }
    mini=somonan*k*b-n;
    printf("%d",mini);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b=1,max=1,somonan,dem,n,k,i,mini;
    scanf("%d%d",&n,&k);
    int array[n];
    for(i=0;i<n;i++)
    {
        scanf("%d", &array[i]);
    }
    for(a=0;a<n;a++)
    {
        for(i=0;i<n-1;i++)
        {
            if(array[i]>array[i+1])
            {
                dem=array[i];
                array[i]=array[i+1];
                array[i+1]=dem;
            }
        }
    }
    dem=1;
    for(i=0;i<n-1;i++)
    {
        if(array[i]==array[i+1])
        {
            dem++;
            if(dem>max)
            {
                max=dem;
            }
        }
        else
        {
            b++;
            dem=1;
        }
    }
    if(max<k)
    {
        somonan=1;
    }
    else
    {
        if(max%k==0)
        {
            somonan=max/k;
        }
        else
        {
            somonan=max%k+1;
        }
    }
    for(i=0;i<n;i++)
    {
        printf("array[%d]:%d\n",i,array[i]);
    }
    printf("somonan:%d\nmax:%d\nb:%d\n",somonan,max,b);
    mini=somonan*k*b-n;
    printf("%d",mini);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,i,k=0;
    scanf("%d",&n);
    int m[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&m[i]);
        k=k+m[i];
    }
    if(k==0)
    {
        printf("EASY");
    }
    else
    {
        printf("HARD");
    }
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b=1,max=1,somonan,dem,n,k,i,mini;
    scanf("%d%d",&n,&k);
    int array[n];
    for(i=0;i<n;i++)
    {
        scanf("%d", &array[i]);
    }
    for(a=0;a<n;a++)
    {
        for(i=0;i<n-1;i++)
        {
            if(array[i]>array[i+1])
            {
                dem=array[i];
                array[i]=array[i+1];
                array[i+1]=dem;
            }
        }
    }
    dem=1;
    for(i=0;i<n-1;i++)
    {
        if(array[i]==array[i+1])
        {
            dem++;
            if(dem>max)
            {
                max=dem;
            }
        }
        else
        {
            b++;
            dem=1;
        }
    }
    if(max<k)
    {
        somonan=1;
    }
    else
    {
        if(max%k==0)
        {
            somonan=max/k;
        }
        else
        {
            somonan=max/k+1;
        }
    }
    for(i=0;i<n;i++)
    {
        printf("array[%d]:%d\n",i,array[i]);
    }
    printf("somonan:%d\nmax:%d\nb:%d\n",somonan,max,b);
    mini=somonan*k*b-n;
    printf("%d",mini);
    return 0;
}

#include<stdio.h>
int min(int x,int y)
{
	if(x>y) return y;
	else return x;
}
int main()
{
	int utensil,guest,minimum=1e6,cnt=0,possible=1e6,flag=0;
	int i,temp;
	int remain[105]={0};
	scanf("%d%D",&utensil,&guest);
	for(i=1;i<=utensil;i++)
	{
		scanf("%d",&temp);
		remain[temp]++;
	}
	for(i=1;i<=100;i++)
	{
		if(remain[i]!=0)
		{
			cnt++;
			if(remain[i]<=guest) minimum=min(minimum,remain[i]);
			else if(remain[i]>guest)
			{
				flag=1;
				possible=min(possible,(remain[i]+guest-1)/guest);
			}
		}
	}
	if(flag) minimum=minimum+possible-min(minimum,possible);
	printf("%d",minimum*cnt*guest-utensil);
	return 0;
 }

#include<stdio.h>
int min(int x,int y)
{
	if(x>y) return y;
	else return x;
}
int max(int x,int y)
{
	if(x>y) return x;
	else return y;
 }
int main()
{
	int utensil,guest,minimum=1e6,cnt=0,possible=0,flag=0;
	int i,temp;
	int remain[105]={0};
	scanf("%d%D",&utensil,&guest);
	for(i=1;i<=utensil;i++)
	{
		scanf("%d",&temp);
		remain[temp]++;
	}
	for(i=1;i<=100;i++)
	{
		if(remain[i]!=0)
		{
			cnt++;
			if(remain[i]<=guest) minimum=min(minimum,remain[i]);
			else if(remain[i]>guest)
			{
				flag=1;
				possible=max(possible,(remain[i]+guest-1)/guest);
			}
		}
	}
	if(flag) minimum=max(minimum,flag*possible);
	printf("%d",minimum*cnt*guest-utensil);
	return 0;
 }

#include<stdio.h>
#include<math.h>
int main()
{
	int n,k,max=0,temp,count=0,res,i=0,p;
	int utensil[101]={0};
	scanf("%d %d",&n,&k);
	while(i<n)
	{
		scanf("%d",&temp);
		if(utensil[temp]==0)
		{
			count++;
		}
		utensil[temp]++;
		if(utensil[temp]>max)
		{
			max=utensil[temp];
		}
		i++;
	}
	p=(max+k-1)/k;
	res=(p*count*k)+n;
	printf("%d",res);
return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    int arr[100] = {};
    int t;
    for (int i = 0; i < n; i++) {
        scanf("%d", &t);
        arr[t % 100]++;
    }
    int ctr = 0;
    int __max = 0, temp;
    for (int i = 0; i < 100;i++) {
        if (arr[i]) {
            ctr++;
            temp = (arr[i] / k + ((arr[i] % k) > 0));
            printf("%d %d\n", arr[i], i);
            __max = __max > temp ? __max : temp;
        }
    }
    printf("%d\n", k * __max * ctr - n);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define SIZE 100

int main() {
	int n, k, a[SIZE + 1], size = 0, i, t, sum = 0, max = 0, j = 1, c = 1;

	scanf ("%d %d", &n, &k);

	memset (a, 0, sizeof a[0] * SIZE);

	for (i = 0; i < n; i++) {
		scanf ("%d", &t);

		if (t > size)
			size = t;

		a[t]++;
	}

	for (i = 1; i <= size; i++)
		if (a[i] != 0)
			a[j++] = a[i];

	size = j - 1;

	for (i = 1; i <= size; i++)
		if (a[i] > max)
			max = a[i];

	if (max > k)
		c += (max - 1) / k;

	sum = k * size * c - n;

	printf ("%d", sum);

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b=1,max=1,somonan,dem,n,k,i,mini;
    scanf("%d%d",&n,&k);
    int array[n];
    for(i=0;i<n;i++)
    {
        scanf("%d", &array[i]);
    }
    for(a=0;a<n;a++)
    {
        for(i=0;i<n-1;i++)
        {
            if(array[i]>array[i+1])
            {
                dem=array[i];
                array[i]=array[i+1];
                array[i+1]=dem;
            }
        }
    }
    dem=1;
    for(i=0;i<n-1;i++)
    {
        if(array[i]==array[i+1])
        {
            dem++;
            if(dem>max)
            {
                max=dem;
            }
        }
        else
        {
            b++;
            dem=1;
        }
    }
    if(max<k)
    {
        somonan=1;
    }
    else
    {
        if(max%k==0)
        {
            somonan=max/k;
        }
        else
        {
            somonan=max%k+1;
        }
    }
    /*or(i=0;i<n;i++)
    {
        printf("array[%d]:%d\n",i,array[i]);
    }
    printf("somonan:%d\nmax:%d\nb:%d\n",somonan,max,b);*/
    mini=somonan*k*b-n;
    printf("%d",mini);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
   int main ()
 {
     int n=0,k=0,c=0,d=0,i=0,s=0,somonan=0,temp,m[1000];
     scanf("%d%d",&n,&k);
     for(i=0;i<n;i++)
     {
         scanf("%d",&m[i]);
     }
     for(i=0;i<n;i++)
     {
        for(c=0;c<n;c++)
        {
            if(m[c]>m[c+1])
            {
                temp=m[c];
                m[c]=m[c+1];
                m[c+1]=temp;
            }
        }
     }
     c=0,temp=1;
     for(i=0;i<n;i++)
     {
         if(m[i]==m[i+1])
         {
             temp++;
         }
         else
         {
             d++;
            if(temp>c)
            {
                c=temp;
            }
            temp=1;
         }
     }
     if(c<k)
     {
         somonan=1;
     }
     else if(c==k)
     {
         somonan=1;
     }
     else
     {
         somonan=c/k+1;
     }
     s=somonan*d*k-n;
     printf("%d",s);
 }

#include <stdio.h>

int
main(void)
{
	//freopen("input.txt", "r", stdin);
	int a[100];
	int cnt[100] = { 0, };
	for (int i = 0; i < 100; i++) {
		cnt[i] = 0;
	}
	int n, k;
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}

	// max # of array
	int max = 0;
	for (int i = 0; i < n; i++) {
		if (max < a[i]) {
			max = a[i];
		}
	}

	for (int i = 0; i < n; i++) {
		cnt[a[i]]++;
	}
	int f_max = 0;
	for (int i = 0; i < n; i++) {
		if (f_max < cnt[i]) {
			f_max = cnt[i];
		}
	}

	int num_type = 0;
	for (int i = 0; i < n; i++) {
		if (cnt[i] != 0) {
			num_type++;
		}
	}
	int num_dish = (f_max + k - 1) % k;

	int res = num_dish * k * num_type - n;
	printf("%d\n", res);
	return 0;
}

 #include<stdio.h>
#include<stdlib.h>
int main()
{
	int n ;
	int k;
	printf("donner le nombre de reamining utensels : ");
	scanf("%d",&n);
	printf("donner le nombre de guest");
	scanf("%d",&k);
	int* tab ;
	tab=malloc(n*sizeof(int));
	int i ;
	int inter[101]={0};
	int max=0 , out=0;
	for(i=0;i<n;i++)
	{
		printf("donner le type de utensel");
		scanf("%d",&tab[i]);
		inter[tab[i]]++;
		if(	inter[tab[i]]>max)
		{
			max=inter[tab[i]];
		}
	}
	while(max%k)
	{
		max++;
	}
	for(i=1;i<101;i++)
	{
		if(inter[i]!=0)
		{
		out+=max-inter[i];
		}
	}
	printf("\n%d",out);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,dem,max=0,z=0,i;
    scanf("%d%d",&n,&k);
    if (n==0)
        printf("%d",k);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[z]=a[i];
        z++;
    }
    for(i=0;i<n;i++)
    {   dem=0;
        for(int j=i;j<n;j++)
        {
            if (a[j]==a[i])
                dem++;
        }
        if(dem>max)
            max=dem;
    }
    int kq,c,sodoi,sopt=1;
    for (i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]<a[j])
            {
                sodoi=a[i];
                a[i]=a[j];
                a[j]=sodoi;
            }
        }
    }
    for (i=1;i<n;i++)
    {
        if (a[i] != a[i-1])
            sopt++;
    }
    kq=sopt*k-n;
    if (max>k)
    {
        c=max/k;
        if ((float)max/k>0)
            c++;
        kq=sopt*c*k-n;
    }
    printf("%d",kq);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,dem,max=0,z=0,i;
    scanf("%d%d",&n,&k);
    if (n==0)
        printf("%d",k);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[z]=a[i];
        z++;
    }
    for(i=0;i<n;i++)
    {   dem=0;
        for(int j=i;j<n;j++)
        {
            if (a[j]==a[i])
                dem++;
        }
        if(dem>max)
            max=dem;
    }
    int kq,c,sodoi,sopt=1;
    for (i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]<a[j])
            {
                sodoi=a[i];
                a[i]=a[j];
                a[j]=sodoi;
            }
        }
    }
    for (i=1;i<n;i++)
    {
        if (a[i] != a[i-1])
            sopt++;
    }
    kq=sopt*k-n;
    if (max>=k)
    {
        c=max/k;
        if ((float)max/k>0)
        {
            c++;
        kq=sopt*c*k-n;
        }
        kq=0;
    }
    printf("%d",kq);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,dem,max=0,z=0,i;
    scanf("%d%d",&n,&k);
    if (n=0)
        printf("%d",k);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[z]=a[i];
        z++;
    }
    for(i=0;i<n;i++)
    {   dem=0;
        for(int j=i;j<n;j++)
        {
            if (a[j]==a[i])
                dem++;
        }
        if(dem>max)
            max=dem;
    }
    int kq,c,sodoi,sopt=1;
    for (i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]<a[j])
            {
                sodoi=a[i];
                a[i]=a[j];
                a[j]=sodoi;
            }
        }
    }
    for (i=1;i<n;i++)
    {
        if (a[i] != a[i-1])
            sopt++;
    }
    kq=sopt*k-n;
    if (max>k)
    {
        c=max/k;
        if ((float)max/k>0)
            c++;
        kq=sopt*c*k-n;
    }
    printf("%d",kq);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,dem,max=0,z=0,i;
    scanf("%d%d",&n,&k);
    if (n==0)
        printf("%d",k);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[z]=a[i];
        z++;
    }
    for(i=0;i<n;i++)
    {   dem=0;
        for(int j=i;j<n;j++)
        {
            if (a[j]==a[i])
                dem++;
        }
        if(dem>max)
            max=dem;
    }
    int kq,c,sodoi,sopt=1;
    for (i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]<a[j])
            {
                sodoi=a[i];
                a[i]=a[j];
                a[j]=sodoi;
            }
        }
    }
    for (i=1;i<n;i++)
    {
        if (a[i] != a[i-1])
            sopt++;
    }
    c=max/k;
        if ((float)max/k>c)
        {
            c++;
        kq=sopt*c*k-n;
        }
    if (sopt==1 && (float)max/k==c)
        kq=0;
    printf("%d",kq);
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,k,dem,max=0,z=0,i;
    scanf("%d%d",&n,&k);
    if (n==0)
        printf("%d",k);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        b[z]=a[i];
        z++;
    }
    for(i=0;i<n;i++)
    {   dem=0;
        for(int j=i;j<n;j++)
        {
            if (a[j]==a[i])
                dem++;
        }
        if(dem>max)
            max=dem;
    }
    int kq,c,sodoi,sopt=1;
    for (i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]<a[j])
            {
                sodoi=a[i];
                a[i]=a[j];
                a[j]=sodoi;
            }
        }
    }
    for (i=1;i<n;i++)
    {
        if (a[i] != a[i-1])
            sopt++;
    }
    kq=sopt*k-n;
    if (max>=k)
    {
        c=max/k;
        if ((float)max/k>c)
        {
            c++;
        kq=sopt*c*k-n;
        }
    }
    if (sopt==1 && (float)max/k==c)
        kq=0;
    printf("%d",kq);
return 0;
}