#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;


int main()
{
	while (true)
	{
		char buf[256];
		cin.getline(buf, sizeof(buf));
		if (strlen(buf) == 0)
			break;

		istringstream is(buf);
		int len, r[16], n;
		is >> len;
		for (n = 0; is >> r[n]; ++n)
			;

		sort(r, r + n);
		int s[16];
		for (int i = 0; i < n / 2; ++i)
			s[i*2 + 1] = r[n-i-1];
		
		double ans = 1e6;
		do
		{
			for (int i = 0; i < (n+1)/2; ++i)
				s[i*2] = r[i];
			double res = 0;
			res += s[0] + s[n-1];
			for (int i = 1; i < n; ++i)
				res += sqrt((double)(((s[i-1]+s[i])*(s[i-1]+s[i]) - (s[i-1]-s[i])*(s[i-1]-s[i]))));

			ans = min(ans, res);
		} while (next_permutation(r, r+n/2));
		printf("%f\n", ans);
		if (ans <= len + 1e-4)
			printf("OK\n");
		else
			printf("NA\n");
	}

	return 0;
}