Language: C

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

//============================================================================
#define pred(x) ((x)-1)
#define succ(x) ((x)+1)
//============================================================================
//============================================================================
//============================================================================
unsigned short *Array;//[]={1, 5, 7,10, 21};
long entered, minstack;
//============================================================================
//============================================================================
//============================================================================
int searchlist(unsigned short n, unsigned short m)
{
    unsigned short  ptr,top,btm,item,res;

    for (item=n, ptr = n/2, top=0,btm=n; item; item>>=1){
        if (Array[ptr]==m)
            return ptr;
        if (m<Array[ptr]){
            btm = ptr;
            ptr = (ptr+top)/2;
        }else{
            top = ptr;
            ptr = (btm+ptr)/2;
        }
    }
    return ptr;
}
//============================================================================
int BubbleSort(unsigned short *ary, int n)
{
    int i,j,k,l, cnt,val;

    for (k=cnt=0, l=n; k<n-1; k++, l--)
    for (i=0,j=1; j<l; i++, j++){
        if (ary[j]<ary[i])
            val=ary[i], ary[i]=ary[j], ary[j]=val, cnt++;
	}
    return cnt;
}
//============================================================================
/*
    n <= 20
    q <= 200
    1<= A <= 2000
    1<= mi <= 2000
*/
//----------------------------------------------------------------------------
int arrayvol(int n)
{
    int i,sum;

    for (i=sum=0; i<n; i++)
        sum+=Array[i];
    return sum;
}
//----------------------------------------------------------------------------
short makenum(unsigned short N, unsigned short M)
{
    unsigned short n,sum;

    if (arrayvol(N)<M)
        return 0;
    entered++;
    if (stackavail()<minstack)
        minstack=stackavail();
    while (N){
        sum=Array[n=searchlist(N,M)];
        if (sum==M)
            return 1;
        if (n &&  makenum(n, M-sum))
            return 1;
        N--;
    }
    return 0;
}
//----------------------------------------------------------------------------
void input(FILE *file)
{
    unsigned short Q,N,q,n;
    unsigned short *M;

    entered=0, minstack=stackavail();
    fscanf(file, "%d", &N);
    Array=malloc(N*sizeof(unsigned short));
    for (n=0; n<N; n++){
        fscanf(file, "%d", &Array[n]);
    }
    BubbleSort(Array, N);
    fscanf(file, "%d", &Q);
    M=malloc(Q*sizeof(unsigned short));
    for (q=0; q<Q; q++){
        fscanf(file, "%d", &M[q]);
    }
    for (q=0; q<Q; q++)
        printf("%s\n", (makenum(N, M[q]))?"yes":"no");
    free(Array);
    free(M);
}
//============================================================================
#ifndef DESKTOP
int main()
{
    input(stdin);
    return 0;
}
#endif

Compiler output:
main.c: In function 'makenum':
main.c:71:9: error: implicit declaration of function 'stackavail' [-Wimplicit-function-declaration]
   71 |     if (stackavail()<minstack)
      |         ^~~~~~~~~~