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 <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)
#define EPS (1e-8)

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;
		
		REP(i, n) {
			double r;
			scanf("%lf", &r);
			if (r - d > EPS) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int d,w,h,n,i,r[10001];
	while(1){
		scanf("%d %d %d",&d,&w,&h);
		if(d==0&&w==0&&h==0) break;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d",&r[i]);
		}
		for(i=0;i<n;i++){
		    if(d<r[i]*2&&w<r[i]*2&&h<r[i]*2){
			    printf("OK\n");
			}
			else{
			    printf("NA\n");
			}
		}
	}
	return 0;
}

C++: #include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
int main(void){

    int x[3],n;
    while(cin>>x[0]>>x[1]>>x[2],x[0]){
        cin>>n;
        sort(x,x+3);
        x[0] /= 2;
        x[1] /= 2;
        double a = sqrt(x[0] * x[0] + x[1] * x[1]);
        while(n--){
            double r;
            cin>>r;
            if(r<=a)cout<<"NA"<<endl;
            else cout<<"OK"<<endl;
        }
    }


    return 0;
}

C++: #include <cmath>
#include <cstdio>
using namespace std;
 
int main(void){
  double a,b,c,min,tmp;
  int r,n;
 
  while(1){
    scanf("%lf%lf%lf",&a,&b,&c);
    if(!a && !b && !c) break;
 
    scanf("%d",&n);
    while(n--){
      scanf("%d",&r);
      min = 999999;
      if((tmp=sqrt(a*a+b*b)/2)<min) min=tmp;
      if((tmp=sqrt(a*a+c*c)/2)<min) min=tmp;
      if((tmp=sqrt(b*b+c*c)/2)<min) min=tmp;
 
      if(min<r) printf("OK\n");
      else printf("NA\n");
    }
  }
 
  return 0;
}

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

int main()
{
	double x,y,z;
	while(cin >> x >> y >> z){
		double r = min(sqrt(x*x+y*y),min(sqrt(y*y+z*z),sqrt(z*z+y*y)));
		if(!r)
			break;
		int n;
		cin >> n;
		for(int i=0;i<n;i++){
			double R;
			cin >> R;
			R += R;
			if(R >= r)
				cout << "OK" << endl;
			else
				cout << "NA" << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(void){
	std::ios_base::sync_with_stdio();
	int t,y,n;
	int data[3];
	double ja;
	int nn;
	int iri;

	while(cin>>t>>y>>n){
		if(t==0&&y==0&&n==0) break;
		data[0]=t,data[1]=y,data[2]=n;
		sort(data,data+3);
		ja=sqrt((data[1]*data[1])+(data[0]*data[0]));
		cin>>nn;
		for(int i=0;i<nn;i++){
			cin>>iri;
			if(2*iri>ja) cout<<"OK"<<endl;
			else cout<<"NA"<<endl;
		}
	}
	return 0;
}

C++: 
#include<iostream>

using namespace std;
int main(){
double w,h,d,r;
double pi=3.141592653,s;
int n;
while(1){
cin >> w >> h >> d;
if(w+h+d==0) break;
cin >> n;
while(n--){
cin >> r;
r*=2;
double dw.dh,dd;
dw=sqrt(w*w+h*h);
dh=sqrt(h*h+d*d);
dd=sqrt(d*d+w*w);
if(dw<r||dh<r||dd<r) cout<<"OK" << endl;
else cout << "NA" << endl;
}
}
return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int che[3];
	while(cin>>che[0]>>che[1]>>che[2],che[0]||che[1]||che[2]){
		sort(che,che+3);
		int R =che[0]*che[0]+che[1]*che[1];
		int n;
		cin>>n;
		rep(i, n){
			int r;
			cin>>r;
			r =2*r*2*r;
			if(r>R){
				cout <<"OK"<<endl;
			}else{
				cout <<"NA"<<endl;
			}
		}
		

	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>

using namespace std;

int R, n, data[3];

int main(void) {
    while(1) {
        scanf("%d%d%d", &data[0], &data[1], &data[2]);
        if(data[0] == 0 && data[1] == 0 && data[2] == 0) break;

        sort(data, data + 3);

        scanf("%d", &n);

        while(n > 0) {
            scanf("%d", &R);
            if(R * 2 > sqrt(data[0] * data[0] + data[1] * data[1])) {
                printf("OK\n");
            } else {
                printf("NA\n");
            }
            n--;
        }
    }
    return 0;
}

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

void cheese(int x,int y,int z){
    int number,tmp;
    list<int> hole;
    cin >> number;
    double xy = sqrt(x/2*x/2+y/2*y/2);
    double xz = sqrt(x/2*x/2+z/2*z/2);
    double zy = sqrt(z/2*z/2+y/2*y/2);
    
    for(int i=0;i<number;i++){
        cin >> tmp;
        hole.push_back(tmp);
    }
    list<int>::iterator it = hole.begin();
    for(;it != hole.end();it++){
        double r = (double)*it;
        //3つの面に対して原点を中心とした長方形を作る.
        if((r>xy)||(r>xz)||(r>zy))
            cout << "OK" << endl;
        else {
            cout << "NA"<< endl;
        }
    }
    
}

int main(){
    int x,y,z;
    cin >>x >> y>> z;
    while(x!=0 && y!=0&&z!=0){
        cheese(x,y,z);
        cin >> x>>y>>z;
    }
    return 0;
}

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

using namespace std; 

int main()
{
	vector<int> len(4);
	fill(len.begin(), len.end(), 1000000000);
	while(cin >> len[0] >> len[1] >> len[2])
	{
		if(!len[0] && !len[1] && !len[2])
			break;
		float rad;
		sort(len.begin(), len.end() );
		rad = sqrt(len[0]*len[0] + len[1]*len[1]);

		int num, enter[10100];
		cin >> num;

		for(int i = 0; i < num; i++)
		{
			cin >> enter[i];
		}

		for(int i = 0; i < num; i++)
		{
			if(2 * enter[i] > rad) cout << "OK" << endl;
			else cout << "NA" << endl; 
		}
	}
}

C++: #include<stdio.h>

int main(){

int x,y,z,N,r;
while(scanf("%d %d %d",&n[0],&n[1],&n[2])!=EOF){

for(int i=0;i<3;i++)
for(int j=2;j>i;j--)
if(n[j-1]>n[j]){int t=n[j];n[j]=n[j-1];n[j-1]=t;}

scanf("%d",&N);
for(int i=0;i<N;i++){

scanf("%d",&r);
if(n[1]>r*1.4141356)printf("NA\n");
else printf("OK\n");
}
}
return 0;
}