Go: package main

import (
	"fmt"
)

func main() {
	for {
		var d, w, h, n int
		// var p1, p2, p3 float64
		var p1, p2, p3 int
		fmt.Scanf("%d %d %d", &d, &w, &h)

		if d == 0 && w == 0 && h == 0 {
			return
		} else {
			// p1 = math.Hypot(float64(d), float64(w))
			// p2 = math.Hypot(float64(w), float64(h))
			// p3 = math.Hypot(float64(d), float64(h))
			p1 = (d * d) + (w * w)
			p2 = (w * w) + (h * h)
			p3 = (d * d) + (h * h)
		}

		// fmt.Println("len:", p1, p2, p3)

		fmt.Scanf("%d", &n)
		for i := 0; i < n; i++ {
			var r int
			fmt.Scanf("%d", &r)

			if p1 < (r*2)*(r*2) || p2 < (r*2)*(r*2) || p3 < (r*2)*(r*2) {
				fmt.Println("OK")
			} else {
				fmt.Println("NA")
			}
		}
	}
}

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

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

  while (1) {
    scanf("%d %d %d", &x, &y, &z);
    if (!x && !y && !z) break;
    scanf("%d", &n);
    if (x>y && x>z) {
      a = y;
      b = z;
    } else if (y>z) {
      a = z;
      b = x;
    } else {
      a = x;
      b = y;
    }
    c = ceil(sqrt((a*a+b*b)*0.25));
    for (int i=0; i<n; i++) {
      scanf("%d", &r);
      if (r < c) {
        printf("NA\n");
      } else {
        printf("OK\n");
      }
    }
  }

  return 0;
}

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

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)

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

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+2);
    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 <iostream>
#include <list>
using namespace std;

//0107
int main(){
	int a, b, c;
	int n, r;
	int first, second;
	list<int> el(0);

	while(cin >> a >> b >> c){
		if(a==0 && b==0 && c==0)break;
		el.push_back(a);
		el.push_back(b);
		el.push_back(c);
		el.sort();
		list<int>::iterator ite = el.begin();
		first = *ite++;
		second = *ite;
		int line = (first*first)+(second*second);
		cin >> n;
		while(n--){
			cin >> r;		

			// 三平方の定理でチーズの対角線を求めて、
			// それが直径より大きいかで判定する
			if( (2*r)*(2*r) > line){
				cout << "OK" << endl;
			}else{
				cout << "NA" << endl;
			}
		}
	}

	return 0;
}

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

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

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];
  std::sort(size.begin(), size.end());
  
  while(size[0]==0 && size[1]==0 && size[2]==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;
      }
    }
    std::cin >> size[0];
    std::cin >> size[1];
    std::cin >> size[2];
    std::sort(size.begin(), size.end());
  }
  
  return 0;
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <string>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <set>
# include <map>
# include <stack>
using namespace std;
# define M_PI 3.141592
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define pri_max 60000
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;


int main()
{
	double x, y, z, v;
	while (cin >> x >> y >> z&&(x||y||z)) {
		v = min(max(x, y), min(max(x, z), max(y, z)));
		int n;
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			double r;
			cin >> r;
			if (v > r*sqrt(2.0))
				cout << "NA" << endl;
			else
				cout << "OK" << endl;
		}
	}
}

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

using namespace std;

int main(){

  int d,w,h;

  while(cin>>d>>w>>h,d||w||h){
	int n,r;
	cin>>n;

	for(int i=0;i<n;++i){
	  cin>>r;

	  if(2*r > sqrt(d*d + h*h) || 2*r > sqrt(h*h + w*w) || sqrt(2*r > d*d + w*w))
		cout<<"OK"<<endl;
	  else
		cout<<"NA"<<endl;
		
	}
	
  }
  
}

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

int main(){
    double tmp[3],a,b,mini,n;
    while(true){
        for(int i=0;i<3;i++){
            cin >> tmp[i];
            if(tmp[2] == 0 && tmp[1] == 0 && tmp[2] == 0) return 0;
        }
        sort(tmp,tmp+3); a = tmp[0]; b = tmp[1];
        mini = sqrt(a*a+b*b);
        cin >> n;
        while(n--){
            cin >> a;
            cout << ((a*2 > mini)? "OK" : "NA") << endl;
        }
    }
}

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

int main(){
	int s1,s2,b;
	while(cin >> s1 >> s2 >> b){
		if(s1 == 0 && s2 == 0 && b == 0) break;
		
		if(s1 >= s2) swap(s1,s2);
		if(s2 >= 	b) swap(s2,b);
		int n;
		cin >> n;
		for(int i = 0; i < n; i++){
			int r;
			cin >> r;
		 if(sqrt(s1*s1 + s2*s2) >= r*2) cout << "NA" << endl;
			else cout << "OK" << endl;
		}
	}
}

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

using namespace std;

int main(){
	int x[3];
	int num,hole;
	while(cin >> x[0] >> x[1] >> x[2]){
		if(x[0]+x[1]+x[2] == 0) break;
		sort(x,x+3);
//		cout << x[0];

		cin >> num;
		for(int i=0;i<num;i++){
			cin >> hole;
			if((4 * hole* hole) > (x[0] * x[0] + x[1] * x[1])){
				cout << "OK" << endl;
			}
			else{
				cout << "NA" << endl;
			}
		}
	}
}