Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		line := strings.Split(stdin.Text(), " ")
		len := []int{}
		for i := 0; i < 3; i++ {
			tmp, _ := strconv.Atoi(line[i])
			len = append(len, tmp)
		}
		if len[0] == 0 && len[1] == 0 && len[2] == 0 {
			break
		}
		sort.Ints(len)
		d2 := len[0]*len[0] + len[1]*len[1]
		stdin.Scan()
		n, _ := strconv.Atoi(stdin.Text())
		for i := 0; i < n; i++ {
			stdin.Scan()
			r, _ := strconv.Atoi(stdin.Text())
			if 4*r*r > d2 {
				fmt.Println("OK")
			} else {
				fmt.Println("NA")
			}
		}
	}
}

C++: #include<stdio.h>
int i,j,k,temp;

int bouble_sort(int area[5]){	//ou\[gbox_area[2]ªÅ¬l
	
	temp=0;
	for(i=0;i<3-1;i++){						
		for(j=3-1;i<j;j--){
			if(area[j-1]>area[j]){
				temp=area[j];
				area[j]=area[j-1];
				area[j-1]=temp;
			}
		}
	}
	return 0;
}

int main(void){

	
	int hole[10000]={0},n,height,width,depth,box_area[5];
	int hantei[10000]={0};
	double hole_area[10000];

	
	height=0;
	width=0;
	depth=0;
	
	
	scanf("%d %d %d\n",&height,&width,&depth);
	scanf("%d",&n);

	for(i=0;i<n+1;i++){
		scanf("%d",&hole[i]);
		if(scanf("%d %d %d",&hole[i],&hole[i],&hole[i])){
			break;
		}
	}

	for(i=0;i<n;i++){
		hole_area[i]=(double)(hole[i]*hole[i]*3.14);
	}

	box_area[0]=height*width;	//¼ûÌÌ3ÊÌ»ê¼êÌÊÏ
	box_area[1]=height*depth;
	box_area[2]=width*depth;

	bouble_sort(box_area);

	/*for(i=0;i<5;i++){
		printf("area_box[%d]=%d\n",i,box_area[i]);
	}*/

	for(i=0;i<n;i++){
		if(hole_area[i]>box_area[2]){
			hantei[i]=1;
		}
		else{
			hantei[i]=0;
		}
	}

	for(i=0;i<n;i++){
		if(hantei[i]==1){
			printf("OK\n");
			}
		else{
			printf("NA\n");	
		}
	}
	
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int main(){
	double d,w,h;
	while(~scanf("%lf %lf %lf",&d,&w,&h)){
		if(d==w && w==h && h==0) break;
		int n;
		scanf("%d",&n);
		for(int i=0;i<n;i++){
			double r;
			scanf("%lf",&r);
			if((d/2.0)*(d/2.0) + (h/2.0)*(h/2.0) < r*r
				|| (d/2.0)*(d/2.0) + (w/2.0)*(w/2.0) < r*r
				|| (w/2.0)*(w/2.0) + (d/2.0)*(d/2.0) < r*r
				|| (w/2.0)*(w/2.0) + (h/2.0)*(h/2.0) < r*r
				|| (h/2.0)*(h/2.0) + (d/2.0)*(d/2.0) < r*r
				|| (h/2.0)*(h/2.0) + (w/2.0)*(w/2.0) < r*r)
			{
				cout << "OK" << endl;
			}
			else{
				cout << "NA" << endl;
			}
		}
	}
}

C++: #include<stdio.h>

int main(){
    int a, b, c, p, i;
    while(scanf("%d %d %d", &a, &b, &c), a | b | c){
	int m;
	if(a >= b && a >= c)m = b * b + c * c;
	if(b >= a && b >= c)m = a * a + c * c;
	if(c >= a && c >= b)m = a * a + b * b;
	scanf("%d", &p);
	for(i = 0;i < p;i++){
	    scanf("%d", &a);
	    if(a * a * 4 >= m)puts("OK");
	    else puts("NO");
	}
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int main() {
	int a, b, c, n;
	while (cin >> a >> b >> c, a || b || c) {
		cin >> n;
		int min1 = min(a, b), min2 = min(max(a, b), c);
		double d = hypot(min1, min2) / 2.0;
		cout << d << endl;
		REP(i, n) {
			double r;
			scanf("%lf", &r);
			if (d < r) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
int const MOD = 1000000007;
ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;}
int madd(int a, int b) {return (a + b) % MOD;}
int msub(int a, int b) {return (a - b + MOD) % MOD;}
int mmul(int a, int b) {return (a * b) % MOD;}
int minv(int a) {return mod_pow(a, MOD-2);}
int mdiv(int a, int b) {return mmul(a, minv(b));}

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int a[3];

signed main() {
    while(cin >> a[0] >> a[1] >> a[2], a[0] || a[1] || a[2]) {
        sort(a, a+3);
        int cheese = a[0] * a[0] + a[1] * a[1];
        int n; cin >> n;
        rep(i,0,n) {
            int inp; cin >> inp;
            if(4 * inp * inp > cheese) cout << "OK" << endl;
            else cout << "NA" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

int main(){
    int x,y,z;
    while(cin>>x>>y>>z, x|y|z){
        double mr=sqrt(min(x*x+y*y,min(y*y+z*z,z*z+x*x)));
        int n; cin>>n;
        while(n--){
            int r; cin>>r;
            if(mr<r*2) cout<<"OK"<<endl;
            else cout<<"NA"<<endl;
        }
    }
}

C++: #include<iostream>
#include<math.h>
using namespace std;

int main()
{
	int temp,c,i,f;
	double r,x,y,z;
	cin>>x>>y>>z;

	if(x>y){
		temp=x;
		x=y;
		y=temp;
	}
	if(y>z){
		temp=y;
		y=z;
		z=temp;
	}

	r=sqrt(pow(x/2,2)+pow(y/2,2));

	cin>>c;
	for(i=0;i<c;i++){
		cin>>f;
		if(r<f)
			cout<<"OK\n";
		else cout<<"NA\n";
	}
	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <iostream>

using namespace std;

int main() {

	double c[3];

	while(cin >> c[0] >> c[1] >> c[2]) {
		if(!c[0]&&!c[1]&&!c[2]) {
			break;
		}
		sort(c, c+3);
		double R=sqrt(pow(c[0], 2)+pow(c[1], 2));

		int n;
		cin >> n;
		while(n) {
			int r;
			cin >> r;
			cout << (2*r>R ? "OK" : "NA") << endl;
			n--;
		}
	}

	return 0;

}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
	int a[3], n, r;
	double max;
	while (1){
		cin >> a[0] >> a[1] >> a[2];
		if (!a[0] && !a[1] && !a[2]) break;
		sort(a, a + 3);
		max = sqrt(a[0] * a[0] + a[1] * a[1]) / 2.0;
		cin >> n;
		for (int i = 0; i < n; i++){
			cin >> r;
			if (r > max) cout << "OK" << endl;
			else cout << "NA" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(void){
	int a[3],n;
	while(cin>>a[0]>>a[1]>>a[2],a[0]||a[1]||a[2]){
		sort(a,a+3);
		int l=a[0]*a[0]+a[1]*a[1];
		cin>>n;
		for(int i=0,r;i<n;++i){
			cin>>r;
			cout<<(((2*r)*(2*r)>l)?"OK":"NA")<<endl;
		}
	}
	return 0;
}