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 <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;

int main(void){
	int a[3];
	while(1){
		rep(i,3)
			cin >> a[i];
		if(!(a[0]|a[1]|a[2]))
			break;
		sort(a,a+3);
		int n;
		cin >> n;
		rep(i,n){
			int tmp;
			cin >> tmp;
			int r2=(2*tmp)*(2*tmp);
			int d2=a[0]*a[0]+a[1]*a[1];
			if(d2<r2)
				cout <<"OK" << endl;
			else
				cout <<"NA" << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
int a,temp,n;
while(1){
scanf("%d",&a);
if(a==0)return 0;
for(int i=0;i<2;i++){
scanf("%d",&temp);
if(temp<a)a=temp;
}
for(int i=0;i<temp;i++){
scanf("%d",&n);
if(n>=a)printf("OK\n");
else printf("NA\n");
}

}
}

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

void judge(int x, int y, int z, int r);

int main(void)
{
    int cheese_x, cheese_y, cheese_z;
    scanf("%d", &cheese_x);
    scanf("%d", &cheese_y);
    scanf("%d", &cheese_z);
    int n;
    int cnt;
    scanf("%d", &n);
    for(cnt = 0; cnt < n; cnt++){
        int hole_size;
        scanf("%d", &hole_size);
        judge(cheese_x, cheese_y, cheese_z, hole_size);
    }
    return 0;
}

void judge(int x, int y, int z, int r)
{
    int t = r * r;
    int d_1, d_2, d_3;
    d_1 = (x / 2) * (x / 2) + (y / 2) * (y / 2);
    d_2 = (y / 2) * (y / 2) + (z / 2) * (z / 2);
    d_3 = (z / 2) * (z / 2) + (x / 2) * (x / 2);
    if(d_1 > t || d_2 > t || d_3 > t){
        printf("OK\n");
    } else {
        printf("NA\n");
    }
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int x,y,z;
  while(true){
  cin>>x>>y>>z;
  if(!x&&!y&&!z)
    break;
  double l = sqrt(x*x+y*y+z*z-max(x,max(y,z))*max(x,max(y,z)));
  int n,r;
  for(cin>>n;n>0;n--){
    cin>>r;
    if(l<2*r)
      cout<<"OK"<<endl;
    else
      cout<<"NA"<<endl;
  }
  }
  return 0;
}

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

int main(){
	double en;
	double i,y,k;
	int n;
	while(cin >> i >> y >> k , i * y * k){
		double min = sqrt (i * i + y * y);
		if(min > sqrt (k * k + y * y) ) min = sqrt (k * k + y * y);
		if(min > sqrt (i * i + k * k) ) min = sqrt (i * i + k * k);
		cin>>n;
		for(int i = 0 ; i < n ; i++){
			double m;
			cin>>m;
			//cout<<1.0*2*m<<" "<<min<<endl;
			 if(1.0*min<1.0*m*2)cout << "OK" << endl;
			 else cout << "NO" << endl; 
		}
		
	}

}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

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

	cin >> d >> d >> d;


	return 0;
}

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

int main()
{
	long long a,b,c,sum;
	long long aa,bb;
	long long n;
	while(1){
		cin>>a>>b>>c;
		if(a==0&&b==0&&c==0)break;
		if(a<b){aa=a;if(b<c){bb=b;}else{bb=c;}}else{aa=b;if(a<c){bb=a;}else{bb=c;}}

		cin>>n;
		for (int i = 0; i < n; ++i) {
			cin>>sum;
			if(sqrt(aa*aa+bb*bb)<sum*2){cout<<"OK"<<endl;}
			else{cout<<"NA"<<endl;}
		}
	}
	return 0;
}

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

using namespace std;

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

C++: #include<stdio.h>
#include<string.h>
#include<math.h>
int main(void)
{
	long long int a,s,d,f,g[100000],h,i,j,z,x,c,q[4];
	while(1){
			scanf("%lld %lld %lld",&a,&s,&d);
			if(a==0&&s==0&&d==0)	break;
		scanf("%lld",&f);
		for(i=0;i<f;i++)	scanf("%lld",&g[i]);
		q[0]=a*a+s*s;
		q[1]=a*a+d*d;
		q[2]=s*s+d*d;
		for(i=0;i<f;i++){
			j=(g[i]*2)*(g[i]*2);
			if(j<=q[0]&&j<=q[1]&&j<=q[1])	printf("NA\n");
			else	printf("OK\n");
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int d,w,h,x,n;
    while(cin>>d>>w>>h,d||w||h){
        cin>>n;
        for(int i=0;i<n;i++){
            cin>>x;
            x=x*2;
            if(d<x&&w<x&&h<x){
                cout<<"OK"<<endl;
            }else{
                cout<<"NA"<<endl;
            }
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define CC puts("-------ok--------");
#define all(in) in.begin(), in.end()
#define bv vector<bool>
using namespace std;
typedef pair<int, int>PA;
using namespace std;
#define MAX 1e7
int main(){
    ll d,w,h;
    while(cin >> d >> w >> h,d+w+h){
        int n; cin>>n;
        vi v (n+1,0);
        double pi = acos(-1.0);
        ll s = min(w*h,w*d);
        s = min(d*h,s);
        rep(i,n){
            cin >>v[i];
            double temp = v[i]*v[i]*pi;
            int r = 2*v[i];
            //cout << "temp : " << temp << "s :" << s << endl;
            if( d<r && w<r && h<r  && temp>s)
                cout << "OK" << endl;
            else
                cout << "NA" << endl;
            }
        }
    return 0;
}

C++: #include <iostream>

int main()
{
	int d,w,h;
	int n;
	int r;
	while (true) {
		std::cin >> d >> w >> h;
		if (d==0 && w==0 && h==0) break;
		
		int a,b;
		if (d>w && d>h) {a = w; b = h;}
		else if (w>d && w>h) {a = d; b = h;}
		else {a = w; b = d;}
		
		std::cin >> n;
		for (int i=0; i<n; i++) {
			std::cin >> r;
			if (4*r*r > a*a + b*b) {
				std::cout << "OK" << std::endl;
			} else {
				std::cout << "NA" << std::endl;
			}
		}
	}

	return 0;
}