$<.map{|s|
	w,*r=s.split.map &:to_f;
	r.sort!;
	a=[];
	i=0;
	(a<<r[i];a<<r[r.size-i-1]if i<r.size-i-1;i+=1)while i<=r.size/2;
	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
}

