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 <iostream>
#include <cmath>

using namespace std;

int main(){
  double d,w,h;
  int x[3];
  int n;
  double r;
  while(1){
    cin >> d >> w >> h;
    if(d==0&&w==0&&h==0){
      return 0;
    }
    cin >> n;
    x[0]=pow((pow(d,2)+pow(w,2)),0.5)/2;
    x[1]=pow((pow(w,2)+pow(h,2)),0.5)/2;
    x[2]=pow((pow(d,2)+pow(h,2)),0.5)/2;
    int min=100000000;
    for(int i=0;i<3;i++){
      if(min>=x[i]){
        min=x[i];
      }
    }
    
    for(int i=0;i<n;i++){
      cin >> r;
      if(r>min){
        cout << "OK" <<endl;
      }else{
        cout << "NA" <<endl;
      }
    }
  }
}

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

using namespace std;

int main(void) {
	int h, w, d, n, r;
	int s, m, l;
	int i;

	while(true) {
		cin >> h >> w >> d;
		if(h == 0 && w == 0 && d == 0) { break; }
		cin >> n;
		for(i = 0; i < n; i++) {
			cin >> r;
			s = min(min(h,w),d);
			l = max(max(h,w),d);
			if(s == min(h,w) && l == max(h,w)) { m = d; }
			else if(s == min(h,d) && l == max(h,d)) { m = w; }
			else if(s == min(w,d) && l == max(w,d)) { m = h; }
			if(sqrt(s*s+m*m)/2 < r) {
				cout << "OK" << endl;
			} else {
				cout << "NA" << endl;
			}
		}
	}

	return 0;
}

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

int main(){
	int a,b,c,n,r;
	while(cin>>a>>b>>c,a|b|c){
		cin>>n;
		if(a>b)swap(a,b);
		if(b>c)swap(b,c);
		while(n--){
			cin>>r;
			cout<<(a*a+b*b<4*r*r?"OK":"NA")<<endl;
		}
	}
	return 0;
}

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

int main()
{
	int x, y, z, ins, i;
	int *input;
	cin >> x >> y >> z;
	cin >> ins;
	input = new int[ins]();
	for(i = 0; i<ins+1; i++)
		cin >> input[i];
	for(i = 0; i<ins; i++)
	{
		if(input[i]*2 < sqrt(x*x+y*y))
		{
			cout << "NA" << endl;
		}
		else
			cout << "OK" << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
#define POW(u) ((u)*(u))
signed main(void){
	ios::sync_with_stdio(false);
	int a,b,c,n,x;
	while(cin>>a>>b>>c&&(a|b|c)){
		cin>>n;
		if(a>c)	swap(a,c);
		if(b>c)	swap(b,c);
		double MIN=POW((double)a/2.0)+POW((double)b/2.0);
		for(int i=1;i<=n;i++){
			cin>>x;
			if(POW(x)>MIN)
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}
}

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

using namespace std;

int SideLength[3];

bool judgeResult(int r) {
	int squareOfSide;

	sort(SideLength, SideLength + 3);
	squareOfSide = pow(SideLength[0], 2) + pow(SideLength[1], 2);
	
	if (squareOfSide < r*r * 4) {
		return true;
	}
	return false;
}

int main() {
	int n, r;

	while (1) {
		cin >> SideLength[0] >> SideLength[1] >> SideLength[2];
		if (SideLength[0] == 0 && SideLength[1] == 0 && SideLength[2] == 0) {
			break;
		}

		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> r;
			if (judgeResult(r)) {
				cout << "OK" << endl;
			}
			else {
				cout << "NA" << endl;
			}
			
		}
	}


	return 0;
}

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

using namespace std;


int main(){

	double d,w,h,r,min_dist,dist1,dist2,dist3;
	int n;

	while(true){
		scanf("%lf %lf %lf",&d,&w,&h);
		if(d == 0.0 && w == 0.0 && h == 0.0)break;

		scanf("%d",&n);

		for(int i=0; i < n; i++){
			scanf("%lf",&r);
			dist1 = (sqrt(d*d+w*w))/2.0;
			dist2 = (sqrt(w*w+h*h))/2.0;
			dist3 = (sqrt(d*d+h*h))/2.0;
			min_dist = min(dist1,min(dist2,dist3));
			if(r > min_dist){
				printf("OK\n");
			}else{
				printf("NA\n");
			}
		}
	}

    return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
//#define M(a,b) a<b?a:b
int main(){
	int a,b,c,n,r;
	for(;scanf("%d%d%d",&a,&b,&c),a|b|c;){
		for(scanf("%d",&n);n--;){
			scanf("%d",&r);
			puts(
				(2.*r<=std::min(std::min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?
				"OK":"NA"
			);
		}
	}
}

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

int main(){
  int d,w,h;int n;
  while(true){
    cin>>d>>w>>h;
    if(d==0&&w==0&&h==0)break;
    if(d>w)swap(w,d);
    if(w>h)swap(h,w);
    cin>>n;
    int r;
    for(int i=0;i<n;i++){
      cin>>r;
      if(sqrt(d*d+w*w)<r*2)cout<<"OK"<<endl;
      else cout<<"NA"<<endl;
    }
  }
}

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

using namespace std;

int main(int argc, char const* argv[])
{
	double a,b,c,d;

	while( cin >> a >> b >> c && a != 0 ){
		double h[3];
		h[0] = sqrt( a * a + b * b );
		h[1] = sqrt( a * a + c * c );
		h[2] = sqrt( b * b + c * c );

		cin >> d;
		for( int i = 0;i < d;i++ ){
			double n;
			cin >> n;
			n *= 2;

			int j;
			for( j = 0;j < 3;j++ ){
				if( n > h[j] ){ cout << "OK" << endl; break; }
			}
			if( j == 3 ) cout << "NA" << endl;
		}
	}


	return 0;

}

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

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs(a-b)<EPS)

int main(){

	int wide,height,length;
	while(cin>>height>>wide>>length&&!(wide==0&&height==0&&length==0)){
		priority_queue<int,vector<int> ,greater<int> > pq;
		pq.push(height);
		pq.push(wide);
		pq.push(length);

		int l1,l2;
		l1=pq.top(),pq.pop();
		l2=pq.top(),pq.pop();
		int n;
		cin>>n;
		double d=sqrt(((double)l1/2)*((double)l1/2)+((double)l2/2)*((double)l2/2));
		for(int i = 0; i < n; i++){
			int r;
			cin>>r;
			// ツ禿シツづィツ古サツつイツづづ可チツーツズツつェツ運ツづ堕つアツづ淞づゥツつゥツ計ツ算
			if(!EQ(d,r)&&r>d)
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}

	return 0;
}

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

int main(){

int x,y,z,N,r;
int n[1001]={};
while(1){
scanf("%d %d %d",&n[0],&n[1],&n[2]);if(n[0]==0&&n[1]==0&&n[2]==0)break;
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;}

//printf("%d %d %d\n",n[0],n[1],n[2]);

double rad=atan2( (double)(n[1]), (double)(n[0]));
//rad=rad*3.141592/180;
//printf("%lf\n",rad);

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

scanf("%d",&r);
//printf("%d %lf\n",n[1],(r*2*sin(rad)));



if(n[1]>=(int)(r*2*sin(rad)))printf("NA\n");
else printf("OK\n");
}
}
return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
using namespace std;

int main() {

    int a, b, c;
    while(cin >> a >> b >> c && (a || b || c) ) {
        int r = min( min(a * a + b * b, a * a + c * c), b * b + c * c);
        int n;
        cin >> n;
        for(int i = 0; i < n; i++) {
            int d;
            cin >> d;
            if ( r >= d * d * 4 ) {
                cout << "NA" << endl;
            } else {
                cout << "OK" << endl;
            }
        }
    }
     
    return 0;
}

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

int main(void)
{
	double len;
	double wid;
	double hei;
	double s[3];
	int n;
	int ent;
	int entd;
	int min;
	int i, j;
	
	while (1){
		scanf("%lf %lf %lf", &len, &wid, &hei);
		if (len == 0 && wid == 0 && hei == 0){
			break;
		}
		scanf("%d", &n);
		for (i = 0; i < n; i++){
			scanf("%d", &ent);
			entd = ent * 2;
			s[0] = sqrt(len * len + wid * wid);
			s[1] = sqrt(wid * wid + hei * hei);
			s[2] = sqrt(len * len + hei * hei);
			
			min = s[0];
			for (j = 1; j < 3; j++){
				if (min > s[j]){
					min = s[j];
				}
			}
			if (entd > min) printf("OK\n");
			else printf("NA\n");
		}
	}
	return (0);
}