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 PI 3.1415926535
 
int main()
{
    double a, b, c, d;
    int n;
     
    while (1) {
        cin >> a >> b >> c;
        if (a == 0 && b == 0 && c == 0) break;

        double e = min(min(sqrt(pow(a, 2) + pow(b, 2)),
			   sqrt(pow(a, 2) + pow(c, 2))),
                           sqrt(pow(b, 2) + pow(c, 2)));
         
        cin >> n;
        for (int i = 0; i < n; i++) {
            cin >> d;
            cout << (d * 2 <= e ? "NA" : "OK") << endl;
        }
    }     
    return 0;
}

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

int main()
{
  int m[3];
  int n;

  while (cin >> m[0] >> m[1] >> m[2], m[0] || m[1] || m[2]){
    sort(m, m + 3);
    int S = m[0] * m[0] + m[1] * m[1];
    int n, num;
    cin >> n;
    while (n--){
      cin >> num;
      int size = num * num * 4;
      cout << (S < size ? "OK" : "NA") << endl;
    }
  }
  return (0);
}

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	int t,y,h,n;
	int a,b,c;
	int s,s1,s2[10000],i;
	int r[10000];

	scanf("%d %d %d",&t,&y,&h);
	while(t!=0 && y!=0 && h!=0){
		a=t+y;
		b=t+h;
		c=y+h;
		if(a<b && a<c){
			s=t*t+y*y;
			s1=sqrt(s);
		}
		else if(b<a && b<c){
			s=t*t+h*h;
			s1=sqrt(s);
		}
		else if(c<a && c<b){
			s=y*y+h*h;
			s1=sqrt(s);
		}

		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d",&r[i]);
			s2[i]=r[i]*2;
			if(s1<s2[i]){
				printf("OK\n");
			}
			else {
				printf("NA\n");
			}
		}
		scanf("%d %d %d",&t,&y,&h);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

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

C++: #include <iostream>
#include <vector>
#include <math.h>

using namespace std;

int main(){
  while(1){
    int d,w,h,n;
    vector<int> r;
    int a,b,c;
    int small;

    cin>>d>>w>>h>>n;

    if(d==0 && w==0 && h==0)
      break;
    
    r.resize(n);

    a=d*d+w*w;
    a=sqrt(a);
    b=w*w+h*h;
    b=sqrt(b);
    c=d*d+h*h;
    c=sqrt(c);
    
    for(int i=0;i<r.size();i++){
      cin>>r[i];
      if(r[i]*2>a || r[i]*2>b || r[i]>c)
        cout<<"OK"<<endl;
      else if(r[i]*2<=a && r[i]*2<=b && r[i]*2<=c)
        cout<<"NA"<<endl;
    }
  }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  vector<double> d(3);
  while(cin>>d[0]>>d[1]>>d[2],d[0]+d[1]+d[2]){
    int n;cin>>n;
    sort(d.begin(),d.end());
    double taikaku;
    taikaku=sqrt(((d[0]*d[0])+(d[1]*d[1])));
    //   cout<<d[0]<<" "<<d[1]<<endl;
    for(int i=0;i<n;i++){
      double a;cin>>a;
      a*=2;
      if(a>taikaku)
	cout<<"OK"<<endl;
      else
	cout<<"NA"<<endl;
    }
  }
  return 0;
}

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

int main(){
    int csize[3], n, t;
    bool f;
    while(1){
        f = false;
        for(int i = 0;i < 3;++i){
            cin >> csize[i];
            f = f || csize[i] != 0;
        }
        if(!f) break;
        cin >> n;
        for(int k = 0;k < n;++k){
            cin >> t;
            f = false;
            for(int i = 0;i < 3 && !f;++i){
                for(int j = i + 1;j < 3 && !f;++j){
                    f = f || csize[i] * csize[i] + csize[j] * csize[j] < 4 * t * t;
                }
            }
            if(f) cout << "OK" << endl;
            else cout << "NA" << endl;
        }
    }
}

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

int main(){
  std::vector<int> size;
  int x, n, r;
  
  std::cin >> size[0];
  std::cin >> size[1];
  std::cin >> size[2];
  size.sort(size.begin(), size.end());
  
  while(d!=0 && w!=0 && h!=0){
    std::cin >> n;
    for(int i=0; i<n; i++){
      std;;cin >> r;
      if(r>size[1]){
        std::cout << "OK" << std::endl;
      }else{
        std::cout << "NA" << std::endl;
      }
    }
  }
  
  return 0;
}

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

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


const string NA = "NA";
const string OK = "OK";

double sq( double x ) {
    return x * x;
}

string solve( int r, int R[3] ) {
    for ( int i = 0; i < 3; ++ i ) {
        for ( int j = i + 1; j < 3; ++ j ) {
            if ( sqrt( sq( R[i] ) + sq( R[j] ) ) < 2 * r ) return OK;
        }
    }
    return NA;
}

int main() {
    int x, y, z;
    while ( cin >> x >> y >> z ) {
        if ( x == 0 && y == 0 && z == 0 ) break;
        int R[3] = { x, y, z };
        int n;
        cin >> n;
        for ( int i = 0; i < n; ++ i ) {
            int r;
            cin >> r;
            cout << solve( r, R ) << endl;
        }
    }
    return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <string>

using namespace std;

int Min(int a, int b, int c) {
	int min = a;
	if(b < min) min = b;
	if(c < min) min = c;

	return min;
}

int main() {
	int x, y, z;
	int n;

	while(1) {
		cin >> x >> y >> z;
		if(x == 0 && y == 0 && z == 0) {
			break;
		}
		double min = Min((x * x + y * y), (y * y + z * z), (z * z + x * x));  

		cin >> n;
		while(n--) {
			int r;
			cin >> r;
			r = 4 * r * r;
			
			cout << (min < r ? "OK" : "NA") << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main(void)
{
  int i;
  double temp;
  double x[3];
  int y, z;
  int n;
  double t;

  while(1){
    for(i=0; i<3; i++)
      scanf("%d", &x[i]);
    if(x[0]==0 && x[1]==0 && x[2]==0)
      break;
      
    if(x[0]>x[1]){
      temp=x[0];
      x[0]=x[1];
      x[1]=x[0];
    }

    if(x[1]>x[2]){
      temp=x[1];
      x[1]=x[2];
      x[2]=x[1];
    }   
    if(x[0]>x[2]){
      temp=x[0];
      x[0]=x[2];
      x[2]=x[0];
    }
  
  t=x[0]*x[0]+x[1]*x[1];
  t=sqrt(t);
  
  scanf("%d", &n);
  
  for(i=0; i<n; i++){
    scanf("%d", &y);
    
    if(2*y>t)
      printf("OK\n");
    else
      printf("NA\n");
    
  }
  }
  return 0;
}