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>

using namespace std;

typedef struct{
  int x;
  int y;
  int z;
}Cheeze;

double data[3];
Cheeze in;

void make(){
  data[0] = in.x*in.x + in.y*in.y;
  data[1] = in.y*in.y + in.z*in.z;
  data[2] = in.z*in.z + in.x*in.x;
}
int main(){
  
  while(cin >> in.x >> in.y >> in.z && in.z+in.y+in.z){
    make();
    int num;
    cin >> num;
    for(int i = 0; i < num; i++){
      int hole_r;
      cin >> hole_r;
      int status = 0;
      for(int i = 0; i < 3; i++){
	if(data[i] < 4*hole_r*hole_r) status = 1;
      }
      if(status) cout << "OK" << endl;
      else cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
int main(){
  int x,y,z,n,tmp,t;
  for(;;){
    cin>>x;
    cin>>y;
    cin>>z;
    if(x==0&&y==0&&z==0)
      break;
    cin>>n;
    vector<int> r;
    for(int i=0;i<n;i++){
      cin>>tmp;
      r.push_back(tmp*tmp*4);
    }
    t=min(min(x*x+y*y,y*y+z*z),x*x+z*z);
    for(vector<int>::iterator i=r.begin();i<r.end();i++){
      if(*i>t)
	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++: #include <iostream>
using namespace std;

int main(){
    int a,b,c,n,r;

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

    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<stack>
#include<queue>

using namespace std;

int main(){
	double d,w,h;
	int n,r;
	double dt;
	while(1){
		scanf("%lf %lf %lf",&d,&w,&h);
		if(d==0&&w==0&&h==0) break;
		dt=min(sqrt(d*d+w*w),min(sqrt(w*w+h*h),sqrt(h*h+d*d)));
		scanf("%d",&n);
		for(int i=0;i<n;i++){
			scanf("%d",&r);
			r*=2;
			if(r>dt) printf("OK\n");
			else printf("NA\n");
		}
	}
}

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

int main(){
	int a,b,c,n,r,R;
	while( cin >> a >> b >> c , a || b || c ){
		cin >> n;
		for(int i=0 ; i < n ; i++ ){
			bool ans = true;
			cin >> r;
			R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
			if( 2*r <= R ) ans = false;
			cout << (ans?"OK":"NA") << endl;
		}
	}
}

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

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

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

using namespace std;

int main(void){
  int a,b,c,n;
  double tmp, limit;
  
  while(cin >> a >> b >> c){
	if((a|b|c) == 0) break;
	vector<int> v;
	v.push_back(a);	v.push_back(b);	v.push_back(c);
	sort(v.begin(),v.end());
	limit = sqrt(v[0]*v[0]+v[1]*v[1])/2;
	cin >> n;
	for(int i=0;i<n;i++){
	  cin >> tmp;
	  if(tmp > limit){
		cout << "OK" << endl;
	  }else{
		cout << "NA" << endl;
	  }
	}
  }
}

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

using namespace std;

int main()
{
    int a[3], chk;

    while (cin >> a[0] >> a[1] >> a[2], a[0] || a[1] || a[2]) {
        sort(a, a + 3);
        chk = a[0] * a[0] + a[1] * a[1];

        int n;        
        cin >> n;
        while (n--) {
            int r;

            cin >> r;
            if (4 * r * r > chk)
                cout << "OK" << endl;
            else
                cout << "NA" << endl;
        }
    }
    
    return 0;
}

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

int main(){
	int data[3];
	while(std::cin>>data[0]>>data[1]>>data[2],data[0],data[1],data[2]){
		int n;
		double min;
		std::sort(data,data+3);
		std::cin>>n;
		min=sqrt(data[0]*data[0]+data[1]*data[1])/2;
		for(int i=0,r;i<n;i++){
			std::cin>>r;
			if(r>min)std::cout<<"OK"<<std::endl;
			else std::cout<<"NA"<<std::endl;
		}
	}
	return 0;
}

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

int main(){
  while(1){
    int d, w, h;
    scanf("%d %d %d", &d, &w, &h);
    if(d==0 && w==0 && h==0)
      break;
    int n;
    scanf("%d", &n);
    
    int max = (int)fmax((double)d, fmax((double)w, (double)h));
    double a = sqrt(d*d+w*w+h*h-max*max) / 2;

    int i;
    for(i=0;i<5;i++){
      int b;
      scanf("%d", &b);
      //printf("a:%lf b:%d", a, b);
      if((double)b <= a)
	printf("NA\n");
      else
	printf("OK\n");
    }
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

bool isenable (double r0, double r ){

//	cout << "r0: " << r0 << " r: " << r << endl;
	
	if (r0 > 0. && r0 < r ){
		return true;
	} // end if

	return false;
}

bool estimate (double a, double b, double r )
{
//	cout << "a: " << a << " b: " << b << " r: " << r << endl;

	if (a/2. > 0. && a/2. < r && b/2. > 0. && b/2. < r ){
		if (isenable ( (a/2.)*(a/2.) + (b/2.)*(b/2. ), r*r ) ){
			return true;
		} // end if
	} // end if

	return false;
}
 
int main()
{
//	cut here before submit 
//	freopen("testcase.carrycheese", "r", stdin);
	string str = "";
	vector <double> s(3, 0.0 );
	int i;

	while (getline (cin, str ) ){
		stringstream sss(str);
	
		for (i = 0; i < 3; ++i){
			sss >> s[i];
		} // end for
		if (s[0] == 0. && s[1] == 0. && s[2] == 0. ) {
			break;
		} // end if

		sort (s.begin(), s.end() );

		int n;		
		getline (cin, str );
		stringstream ssn(str);
		ssn >> n;

		for (i = 0; i < n; ++i ){
			double r = 0.0;
			getline (cin, str );
			stringstream ssr(str);
			ssr >> r;

			if (estimate (s[0], s[1], r ) ){
				cout << "OK" << endl;
			}else{
				cout << "NA" << endl;
			} // end if
		} // end for
	} // end loop

//	cout << res << endl;	
		
	return 0;
}