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>
#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]>=(r*2*sin(rad)))printf("NA\n");
else printf("OK\n");
}
}
return 0;
}

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

int main()
{
	int temp,c,i;
	double r,x,y,z,f;
	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<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;

int main(){

  int a,b,c;
  
  while(1){

    int n;
    int d;
  
    scanf("%d %d %d",&a,&b,&c);
    if(a==0 && b==0 && c==0) break;
    scanf("%d",&n);
    
    d = min(a*a+b*b , min(a*a+c*c , b*b+c*c));
    
    for(int i=0;i<n;i++){
      int r;
      int f=1;
      
      scanf("%d",&r);
      r = (2*r)*(2*r);
      if(r<=d) f=0;

      //printf("%d %d ",r,d);
      
      if(f) printf("OK\n");
      else printf("NA\n");
    }


  }
  return 0;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;

int main(){
	stringstream buf;
	int a,b,c,n;
	scanf("%d %d %d %d",&a,&b,&c,&n);
	vector<int> args;
	args.push_back(a);
	args.push_back(b);
	args.push_back(c);
	sort(args.begin(),args.end());
	for(int x=0;x<n;++x){
		int r;
		scanf("%d",&r);
		double l = sqrt(2)*r;
		if(l>args[0] && l>args[1]){
			buf<<"OK\n";
		}else{
			buf<<"NA\n";
		}
	}
	scanf("%d %d %d",&a,&b,&c);
	cout<<buf.str();
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
	while( true ){
		int n;
		int x,y,z;
		
		cin >> x >> y >> z;
		if( x==0&&y==0&&z==0 ) break;
		cin >> n;

		for(int i = 0; i < n; i++){
			int r;
			cin >> r;
			if( (x*x/4)+(y*y/4) < r*r ||
				(x*x/4)+(z*z/4) < r*r ||
				(y*y/4)+(z*z/4) < r*r ) cout << "OK\n";
			else cout << "NA\n";
		}
	}
	return 0;
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <string>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <set>
# include <map>
# include <stack>
using namespace std;
# define M_PI 3.141592
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define pri_max 60000
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;


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

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;

int main(){
    double x, y, z;
    while(cin >> x >> y >> z, x+y+z){
        vector<double> v;
        v.push_back(x); v.push_back(y); v.push_back(z);

        sort(all(v));
        int n;
        cin >> n;
        for(int i=0; i < n; i++){
            double r;
            cin >> r;
            if(r*2 > sqrt(pow(v[0], 2)+pow(v[1], 2))) cout << "OK" << endl;
            else cout << "NA" << endl;
        }
    }
}

C++: #include<stdio.h>
int main(void)
{
	int t,y,ts;
	int n;
	int h[10000],m;
	int i;
	scanf("%d %d %d",&t,&y,&ts);
		while(!(t==0 && y==0 && ts==0)){
			scanf("%d",&n);
				for(i=0;i<n;i++){
					scanf("%d",&h[i]);
					m=2*h[i];
					if((m>y) || (m>ts)){
						printf("OK\n");
					}
					else if((m>y) || (m>t)){
						printf("OK\n");
					}
					else if((m<=y) || (m<=ts)){
						printf("NA\n");
					}
					else if((m<=y) || (m<=t)){
						printf("NA\n");
					}
				}
				scanf("%d %d %d",&t,&y,&ts);
			}
		return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
#define PI 3.14159265358979323846264

using namespace std; 



int main(void){

	int n;
	double v,box_area[5],height,width,depth,min_area;
	
	vector<double> hole;
	vector<double> hole_area;
	
	while(1){
	
		height=0;
		width=0;
		depth=0;
		n=0;
		min_area=0;
		
		hole.clear();
		
		hole_area.clear();

		for(int i=0;i<5;i++){
			box_area[i]=0;
		}
		
		scanf("%lf %lf %lf",&height,&width,&depth);
		
		if(height==0 && width==0 && depth==0){
			break;
		}
		
		scanf("%d",&n);

		for(int i=0;i<n;i++){
			cin>>v;
			hole.push_back(v);
		}

		for(int i=0;i<n;i++){
			hole_area.push_back(hole[i]*2.0);
			//printf("hole_area[%d]=%lf\n",i,hole_area[i]);
		}

		box_area[0]=sqrt(1.0*height*height+1.0*width*width);	//¼ûÌÌ3ÊÌ»ê¼êÌÎpü
		box_area[1]=sqrt(1.0*height*height+1.0*depth*depth);
		box_area[2]=sqrt(1.0*width*width+1.0*depth*depth);

		/*for(int i=0;i<3;i++){
			printf("box_area[%d]=%lf\n",i,box_area[i]);
		}
		printf("hei=%lf wid=%lf dep=%lf\n",height,width,depth);*/
		
		min_area=min(box_area[0],min(box_area[1],box_area[2]));
		
		//printf("¼ûÌÌÅ¬ÊÏÍ:%lf\n",min_area);

	
		for(int i=0;i<n;i++){
			
			if(hole_area[i]>min_area){
				printf("OK\n");			
			}
			else{
				printf("NA\n");	
			}
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	int number;
	cin>>number;
int r[100];
int n=0;

while(true){
	int temp;
	cin>>temp;
	if(n==number+2&&temp==0&&r[n-1]==0&&r[n-2]==0){
		break;
	}
	else{
		r[n]=temp;
		n=n++;
	}
}
	int rec1,rec2,rec3;
	rec1=a*a+b*b;
	rec2=a*a+c*c;
	rec3=b*b+c*c;


	for (int i=0;i<(n-2);i++){
	 if (4*r[i]*r[i]>rec1||4*r[i]*r[i]>rec2||4*r[i]*r[i]>rec3){
		 cout<<"OK"<<endl;
	 }
	 else{
		 cout<<"NA"<<endl;
	 }
	}
return 0;

}