Language: C

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

#define ll long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
//#define MOD 998244353
#define NUM 200010
 

int main(){
  ll N, M;
  ll A[100];
  ll sum=0, cnt=0;

  scanf("%lld%lld", &N, &M);

  for (int i = 0; i < N; i++)
  {
      scanf("%lld", A + i);
      sum += A[i];
  }
  
  for (int i = 0; i < N; i++)
  {
      if(A[i] * 4 * M >= sum) cnt++;
  }
  
  if (cnt < M)
  {
      printf("No\n");
  }
  else
  {
      printf("Yes\n");
  }
  
  return 0;
}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

int main(){
  ll N, M;
  ll A[1000];
  ll sum=0, cnt;

  scanf("%lld%lld", &N, &M);

  for (int i = 0; i < N; i++)
  {
      scanf("%lld", A + i);
      sum += A[i];
  }
  
  for (int i = 0; i < N; i++)
  {
      if(A[i] * 4 * M >= sum) cnt++;
  }
  
  if (cnt < M)
  {
      printf("Yes\n");
  }
  else
  {
      printf("No\n");
  }
  
  return 0;
}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

int main(){
  ll N, M;
  ll A[1000];
  ll sum=0, cnt;

  scanf("%lld%lld", &N, &M);

  for (int i = 0; i < N; i++)
  {
      scanf("%lld", A + i);
      sum += A[i];
  }
  
  for (int i = 0; i < N; i++)
  {
      if(A[i] * 4 * M >= sum) cnt++;
  }
  
  if (cnt < M)
  {
      printf("Yes\n");
  }
  else
  {
      printf("No\n");
  }
  
  return 0;
}

Compiler output:
main.c:51:5: error: redefinition of 'main'
   51 | int main(){
      |     ^~~~
main.c:17:5: note: previous definition of 'main' with type 'int()'
   17 | int main(){
      |     ^~~~
main.c:80:5: error: redefinition of 'upll'
   80 | int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
      |     ^~~~
main.c:46:5: note: previous definition of 'upll' with type 'int(const void *, const void *)'
   46 | int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
      |     ^~~~
main.c:81:5: error: redefinition of 'downll'
   81 | int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
      |     ^~~~~~
main.c:47:5: note: previous definition of 'downll' with type 'int(const void *, const void *)'
   47 | int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
      |     ^~~~~~
main.c:82:6: error: redefinition of 'sortup'
   82 | void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
      |      ^~~~~~
main.c:48:6: note: previous definition of 'sortup' with type 'void(long long int *, int)'
   48 | void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
      |      ^~~~~~
main.c:83:6: error: redefinition of 'sortdown'
   83 | void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
      |      ^~~~~~~~
main.c:49:6: note: previous definition of 'sortdown' with type 'void(long long int *, int)'
   49 | void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
      |      ^~~~~~~~
main.c:85:5: error: redefinition of 'main'
   85 | int main(){
      |     ^~~~
main.c:17:5: note: previous definition of 'main' with type 'int()'
   17 | int main(){
      |     ^~~~