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 iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

more:
  int a,b,c; cin >> a >> b >> c;
  if (!a && !b && !c) return 0;

  int A = a * a;
  int B = b * b;
  int C = c * c;
  int CHOCKEY2 = min(A+B, min(A+C, B+C));

  int n; cin >> n;
  rep(_, n) {
    int r; cin >> r;
    if (4 * r * r > CHOCKEY2) {
      cout << "OK" << endl;
    } else {
      cout << "NA" << endl;
    }
  }

  goto more;
}

C++: #include <cstdio>
int a,b,c,n,r;
int main(){while(scanf("%d%d%d",&a,&b,&c),a|b|c){a*=a;b*=b;c*=c;scanf("%d",&n);while(n--){scanf("%d",&r);r*=4*r;puts((a+b<r||b+c<r||c+a<r)?"OK":"NA");}}return 0;}

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

using namespace std;

int main()
{
    long long a, b, c, chk;


    while (cin >> a >> b >> c, a || b || c) {
        chk = min(a * a + b * b, min(b * b + c * c, a * a + c * c));

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

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

C++: #include<stdio.h>
#include<math.h>
#include<algorith>
//#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<=min(min(sqrt(a*a+b*b),sqrt(b*b+c*c)),sqrt(c*c+a*a)))?
				"OK":"NA"
			);
		}
	}
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>

using namespace std;


int tate,yoko,taka,n;

double naname(int x, int y){
    return sqrt(x*x+y*y);
}

int main(){
    while(cin>>tate>>yoko>>taka){
        if(tate==0&&yoko==0&&taka==0)break;
        double min_naname=min(min(naname(tate, yoko),naname(tate, taka)),naname(yoko,taka));
        
        cin>>n;
        for(int i=0; i<n; i++){
            double iriguchi;
            cin>>iriguchi;
            if(iriguchi*2>min_naname)cout<<"OK"<<endl;
            else cout<<"NA"<<endl;
        }
        
        
    }
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  int a, b, c;
  while (cin >> a >> b >> c, a) {
    int n;
    cin >> n;
    int x = min({a * a + b * b, b * b + a * a, c * c + a * a});
    while (n--) {
      int r;
      cin >> r;
      cout << (x < 4 * r * r ? "OK" : "NA") << endl;
    }
  }
}

C++: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(ll a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll in1, in2, in3;
	while (true) {
		cin >> in1 >> in2 >> in3;
		if (in1 == 0 && in2 == 0 && in3 == 0) { break; }
		vector<ll>a;
		a.pb(in1);
		a.pb(in2);
		a.pb(in3);

		Sort(a);
		ll n;
		cin >> n;
		double save = sqrt(a[0] * a[0] + a[1] * a[1]) / 2.00;
		rep(i, n) {
			double r;
			cin >> r;
			if (r > save) { cout << "OK" << endl; }
			else { cout << "NA" << endl; }
		}
		}return 0;

}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main() {

  int a[3];

  cin >> a[0] >> a[1] >> a[2];

  sort(a,a+3);
  int n;
  cin >> n;

  int s = a[0]*a[0] + a[1]*a[1];
  for(int i=0;i<n;i++) {
    int r;
    int c;
    cin >> r;
    c = 4*r*r;

    if(s < c) cout <<"OK"<<endl;
    else cout << "NA"<<endl;
  }

  return 0;
    
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	while (1) {

		vector<ld>ls(3);
		cin >> ls[0] >> ls[1] >> ls[2];
		sort(ls.begin(), ls.end());
		ld r = sqrt(ls[0] * ls[0] + ls[1] * ls[1]);
		if (abs(ls[0])<eps)break;
		int d; cin >> d;
		while (d--) {
			int n; cin >> n;
			if (ld(n*2) > r + eps)cout << "OK" << endl;
			else cout << "NO" << endl;
		}
	}
	return 0;
}