Language: C

double M[12][4096],r,t;D[N],n;
double dfs(p,f){if(M[p][f]<0){
int i=0;
for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t;
}return M[p][f];}
main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r<=l?"OK":"NA")){
for(d=n=0;getchar()!='\n';d+=D[n++]*2)scanf("%d",D+n);
for(i=0;i<n;i++)for(j=0;j<1<<n;j++)M[i][j]=-1;
for(r=i=0;i<n;i++)if(t=dfs(i,1<<i),r<t)r=t;
}exit(0);}

Compiler output:
main.c:1:26: error: 'N' undeclared here (not in a function)
    1 | double M[12][4096],r,t;D[N],n;
      |                          ^
main.c:1:24: warning: data definition has no type or storage class
    1 | double M[12][4096],r,t;D[N],n;
      |                        ^
main.c:1:24: error: type defaults to 'int' in declaration of 'D' [-Wimplicit-int]
main.c:1:29: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    1 | double M[12][4096],r,t;D[N],n;
      |                             ^
main.c: In function 'dfs':
main.c:2:8: error: type of 'p' defaults to 'int' [-Wimplicit-int]
    2 | double dfs(p,f){if(M[p][f]<0){
      |        ^~~
main.c:2:8: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:4:66: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    4 | for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t;
      |                                                                  ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | double M[12][4096],r,t;D[N],n;
main.c:4:66: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    4 | for(M[p][f]=0;i<n;i++)if(!(f&1<<i)&&(t=dfs(i,f|1<<i)+D[p]+D[i]-2*sqrt(D[p]*D[i]),M[p][f]<t))M[p][f]=t;
      |                                                                  ^~~~
main.c:4:66: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c: At top level:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r<=l?"OK":"NA")){
      | ^~~~
main.c: In function 'main':
main.c:6:1: error: type of 'l' defaults to 'int' [-Wimplicit-int]
main.c:6:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:6:1: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:6:1: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:6:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 | main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r<=l?"OK":"NA")){
      |                     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | double M[12][4096],r,t;D[N],n;
main.c:6:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 | main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r<=l?"OK":"NA")){
      |                     ^~~~~
main.c:6:21: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:36: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
    6 | main(l,i,j,d){for(;~scanf("%d",&l);puts(d-r<=l?"OK":"NA")){
      |                                    ^~~~
main.c:6:36: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:7:11: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
    7 | for(d=n=0;getchar()!='\n';d+=D[n++]*2)scanf("%d",D+n);
      |           ^~~~~~~
main.c:7:11: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:10:2: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   10 | }exit(0);}
      |  ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | double M[12][4096],r,t;D[N],n;
main.c:10:2: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   10 | }exit(0);}
      |  ^~~~
main.c:10:2: note: include '<stdlib.h>' or provide a declaration of 'exit'