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
 
void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int abs(int a){if(a<0)return -a;return a;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}

void swapl(ll* a,ll* b){ll tmp=*a;*a=*b;*b=tmp;}
ll absl(ll a){if(a<0)return -a;return a;}
ll dupl(ll a,ll d){if(a%d==0)return a/d;else return a/d+1;}
ll modl(ll a,ll m){if(a<0)return a%m+m;else return a%m;}

ll GCD(ll a,ll b){ll c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
ll LCM(ll a,ll b){return a*b/GCD(a,b);}

ll factorial(ll n, ll m) {return n < m ? 1 : n*factorial(n-1, m);}

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[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:65:5: error: redefinition of 'upll'
   65 | int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
      |     ^~~~
main.c:31:5: note: previous definition of 'upll' with type 'int(const void *, const void *)'
   31 | int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
      |     ^~~~
main.c:66:5: error: redefinition of 'downll'
   66 | int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
      |     ^~~~~~
main.c:32:5: note: previous definition of 'downll' with type 'int(const void *, const void *)'
   32 | int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
      |     ^~~~~~
main.c:67:6: error: redefinition of 'sortup'
   67 | void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
      |      ^~~~~~
main.c:33:6: note: previous definition of 'sortup' with type 'void(long long int *, int)'
   33 | void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
      |      ^~~~~~
main.c:68:6: error: redefinition of 'sortdown'
   68 | void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
      |      ^~~~~~~~
main.c:34:6: note: previous definition of 'sortdown' with type 'void(long long int *, int)'
   34 | void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
      |      ^~~~~~~~
main.c:70:5: error: redefinition of 'main'
   70 | int main(){
      |     ^~~~
main.c:36:5: note: previous definition of 'main' with type 'int()'
   36 | int main(){
      |     ^~~~
main.c:99:5: error: redefinition of 'upll'
   99 | int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
      |     ^~~~
main.c:31:5: note: previous definition of 'upll' with type 'int(const void *, const void *)'
   31 | int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
      |     ^~~~
main.c:100:5: error: redefinition of 'downll'
  100 | int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
      |     ^~~~~~
main.c:32:5: note: previous definition of 'downll' with type 'int(const void *, const void *)'
   32 | int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
      |     ^~~~~~
main.c:101:6: error: redefinition of 'sortup'
  101 | void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
      |      ^~~~~~
main.c:33:6: note: previous definition of 'sortup' with type 'void(long long int *, int)'
   33 | void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
      |      ^~~~~~
main.c:102:6: error: redefinition of 'sortdown'
  102 | void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
      |      ^~~~~~~~
main.c:34:6: note: previous definition of 'sortdown' with type 'void(long long int *, int)'
   34 | void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
      |      ^~~~~~~~
main.c:104:5: error: redefinition of 'main'
  104 | int main(){
      |     ^~~~
main.c:36:5: note: previous definition of 'main' with type 'int()'
   36 | int main(){
      |     ^~~~