$<.map{|s|
	w,*r=s.split.map &:to_f;
	r.sort!;
	a=[];
	i=0;k=(r.size+1)/2;
	(a<<r[i];a<<r[k+i];i+=1)while i+k<r.size;
	a<<r[i]if k>i;
	d=a[0];
	(1...a.size).map{|i|d+=(a[i-1]*a[i])**0.5*2}
	d+=a[-1];
	puts d>w ? :NA: :OK
}
