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 <algorithm>
#include <cmath>
using namespace std;

double m[3];
void solve(){

}
int main(){
  while(cin >> m[0] >> m[1] >> m[2], m[0]||m[1]||m[2]){
    sort(m, m+3);
    double d = sqrt(m[0]*m[0]+m[1]*m[1]);
    int n;
    cin >> n;
    while(n--){
      double r;
      cin >> r;
      cout << (d<(r*2.)?"OK":"NA") << endl;
    }
  }
  return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  while(true) {
    int d[3];
    cin >> d[0] >> d[1] >> d[2];
    if(!d[0] && !d[1] && !d[2]) break;
    int n;
    cin >> n;

    sort(d, d+3);
    long double l = sqrt(d[0]*d[0]+d[1]*d[1]);
    REP(i, n) {
      int r;
      cin >> r;
      if(2*r > l) cout << "OK" << endl;
      else cout << "NA" << endl;
    }
  }

  return 0;
}

C++: #include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>
#include<map>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int h[3],r,n;
	double t;
	for(;;){
		rep(i,3)scanf("%d",h+i);
		sort(h,h+3);
		if(h[0]==0)break;
		t=(h[0]*h[0]+h[1]*h[1])/4.0;
		scanf("%d",&n);
		rep(i,n){
			scanf("%d",&r);
			puts(r*r>t?"OK":"NA");
		}
	}
	return 0;
}

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

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
    int a[3],temp,n;
    bool f;
    while(1){
        f=true;
        for(int i=0;i<3;i++){
            scanf("%d",&a[i]);
            if(a[i]!=0)f=false;
        }
        sort(a,a+3);
        if(f)return 0;
        scanf("%d",&temp);
        for(int i=0;i<temp;i++){
            scanf("%d",&n);
            if(4*n*n>a[0]*a[0]+a[1]*a[1])printf("OK\n");
            else printf("NA\n");
        }
        
    }
}

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

int main()
{
    int CheeseHeight, CheeseWidth, CheeseLength;
    
    while (std::cin >> CheeseHeight >> CheeseWidth >> CheeseLength) {
        if (CheeseHeight == 0 && CheeseWidth == 0 && CheeseLength == 0) {
            break;
        }
        
        std::array<int, 3> CheeseData = {CheeseHeight, CheeseWidth, CheeseLength};
        std::sort(CheeseData.begin(), CheeseData.end());
        
        int exit_num;
        std::cin >> exit_num;
        
        for (int i = 0; i < exit_num; ++i) {
            int exit_radius;
            
            std::cin >> exit_radius;
            
            double exit_limit = std::sqrt(
                    static_cast<double>(CheeseData.at(0) * CheeseData.at(0) / 4.0 
                    + CheeseData.at(1) * CheeseData.at(1) / 4.0)
                    );
            
            if (exit_limit < exit_radius) {
                std::cout << "OK" << std::endl;
            } else {
                std::cout << "NA" << std::endl;
            }
        }
    }

    return 0;
}

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

int main(){
  std::vector<int> size[3];
  int x, n, r;
  
  std::cin >> x;
  size.insert(0, x);
  std::cin >> x;
  size.insert(1, x);
  std::cin >> x;
  size.insert(2, x);
  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 <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;
      
  for(i=0; i<3; i++){
    if(x[i]>x[i+1]){
      temp=x[i];
      x[i]=x[i+1];
      x[i+1]=temp;
    }
  }
  
  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;
}

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

using namespace std;

int main() {
  int size[3];
  scanf("%d %d %d", size, size + 1, size + 2);
  sort(size, size + 3);
  int squared_chord = size[0] * size[0] + size[1] * size[1];

  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int radius;
    scanf("%d", &radius);
    int squared_diameter = 4 * radius * radius;
    puts(squared_diameter > squared_chord ? "OK" : "NA");
  }

  return 0;
}

C++: int a,b,c,n,r;main(){while(std::cin>>a>>b>>c,a|b|c){a*=a;b*=b;c*=c;std::cin>>n;while(n--)std::cin>>r,r*=4*r,puts(a+b<r|b+c<r|c+a<r?"OK":"NA");}}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

double circle (int x, int y) {
    return 1/2.0 * sqrt(x*x + y*y);
}

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int In[3];
    rep(i ,3) cin >> In[i];
    while (In[0] != 0 || In[1] != 0 || In[2] != 0) {
        sort(In, In + 3);
        double r = circle(In[0], In[1]);
        int n; cin >> n;
        for (int i = 0; i < n; i++) {
            int door; cin >> door;
            if (r < door) cout << "OK" << endl;
            else cout << "NA" << endl;
        }
        rep(i ,3) cin >> In[i];
    } 

    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
 
int main(){
 
    double d,w,h,r,mind,dw,wh,hd;
    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);
            dw = (sqrt(d*d+w*w))/2.0;
            wh = (sqrt(w*w+h*h))/2.0;
            hd = (sqrt(d*d+h*h))/2.0;
            mind = min(dw,min(wh,hd));
            if(r > mind){
                printf("OK\n");
            }else{
                printf("NA\n");
            }
        }
    }
    return 0;
}