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 <iostream>
using namespace std;
int main(){
    int i;
    int size[3];
    cin >> size[0] >> size[1] >> size[2];
    int NumOfHole;
    cin >> NumOfHole;
    int *radius;
    radius = new int[NumOfHole];
    for(i=0;i<NumOfHole;i++){
        cin >> radius[i];
    }
    int check[3];
    cin >> check[0] >> check[1] >> check[2];
    if(check[0]!=0 || check[1]!=0 || check[2]!=0){
        cout << "Misloading\n";
        return 0;
    }
    int max;
    int vmax=0;
    for(i=0;i<3;i++){
        if(vmax < size[i]){
            vmax=size[i];
            max=i;
        }
    }
    int obst=0;
    for(i=0;i<3;i++){
        if(i!=max){
            obst += size[i]*size[i];
        }
    }
    for(i=0;i<NumOfHole;i++){
        if(obst < 4*radius[i]*radius[i]){
            cout << "OK" << endl;
        }else{
            cout << "NA" << endl;
        }
    }
    return 0;
}

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

int main(){
	while(1){
		vector<double> x(3);
		cin>>x[0]>>x[1]>>x[2];
		if(x[0]==0&&x[1]==0&&x[2]==0)break;
		int n;
		cin>>n;
		sort(x.begin(),x.end());
		for(int i=0;i<n;i++){
			double r;
			cin>>r;
			r=sqrt(2)*r;
			//cout<<r<<" "<<x[1]<<endl;
			if(r>=x[1]){
				cout<<"OK"<<endl;
			}else{
				cout<<"NA"<<endl;
			}
		}
	}
	return 0;
}

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

int main()
{
	int h, w, d, n, r;
	bool f;
	while (cin>>h>>w>>d, h||w||d) {
		cin>>n;
		while (n-- >  0) {
			cin>>r;
			f = 0;
			if (h*h+w*w < 4*r*r) f = 1;
			if (w*w+d*d < 4*r*r) f = 1;
			if (d*d+h*h < 4*r*r) f = 1;
			if (f) cout<<"OK"<<endl;
			else cout<<"NA"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
#define MAX 10000
using namespace std;



int main(void){

  
  int  a ,b, h , n , hankei[MAX] , r[MAX] , nagai1 = MAX ,nagai2 = MAX ;
  
  string hantei[MAX];
  

  while(1){

    cin >> a >> b >> h ;

    if ( nagai1 > a ) nagai1 = a; 
    if ( nagai1 > b ){
      nagai1 = b; 
      nagai2 = a;
    }
    else nagai2 = b;

      if( nagai1 > h ){ 
      nagai2 = nagai1;
      nagai1 = h;
    }
      else if( nagai2 > h) nagai2 = h ;

 

    if ( a == 0 && b == 0 && h ==0) break;


    cin >> n;


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


    
      cin >> r[i] ;


      // テδづつセテδεつイテδづつキテδεつッテδ暗つステδεつδεつェテδづつ、テδ偲つキテδ療つサテδづつサ

      if ( nagai1 * nagai1 + nagai2 * nagai2  < 4 * r[i] * r[i]  ) hantei[i] = "OK";
      

 


      else hantei[i] = "NA";



      

      //

      cout << hantei[i] << endl ;

    }


      

  }


  return 0;

}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[3],n,i=0,r;
	cin>>a[0]>>a[1]>>a[2];
	if(!a[0])return 0;cin>>n;sort(a,a+3);
	for(;i<n;i++){
		cin>>r;
		cout<<((a[0]*a[0]+a[1]*a[1]<4*r*r)?"OK":"NA")<<endl;
	}
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
  double a,b,c,r,n;
  while(cin >> a >> b >> c, a+b+c){
    cin >> n;
    while(n--){
    cin >> r;
    if(sqrt(a*a + b*b) < 2*r ||
       sqrt(c*c + b*b) < 2*r ||
       sqrt(a*a + c*c) < 2*r)cout << "OK" << endl;
    else cout << "NA" << endl;
    }
  }
  return 0;
}

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

int main(){
	int a,b,c,n,r,x;
	cin>>a>>b>>c>>n;
	if(a>b)swap(a,b);
	if(b>c)swap(b,c);
	while(n--){
		cin>>r;
		cout<<(a*a+b*b<4*r*r?"OK":"NA")<<endl;
	}
	return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define EPS 1e-6
using namespace std;

int main()
{
	vector<double> v;
	int a[3];
	while(true)
	{
		cin >> a[0] >> a[1] >> a[2];
		if(a[0] == 0 && a[1] == 0 && a[2] == 0)
		{
			break;
		}

		rep(i,3)
		{
			v.push_back(a[i]);
		}

		sort(v.begin(),v.end());
		double dis = v[0]*v[0] + v[1]*v[1];

		int n;
		cin >> n;

		while(n--)
		{
			double r;
			cin >> r;

			r *= 2;

			if(dis < r*r)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NA" << endl;
			}

		}
	}
	return 0;
}

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

using namespace std;

void solve()
{
	vector<double> a(3);
	while(cin >> a[0] >> a[1] >> a[2], a[0] || a[1] || a[2])
	{
		sort(a.begin(), a.end());
		double Length = sqrt(a[0] * a[0] + a[1] * a[1]);
		int N;
		cin >> N;
		while(N--)
		{
			int hole;
			cin >> hole;
			if(hole * 2 > Length)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NA" << endl;
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define EPS 1e-6
using namespace std;

int main()
{
	vector<double> v;
	int a[3];
	while(true)
	{
		cin >> a[0] >> a[1] >> a[2];
		if(a[0] == 0 && a[1] == 0 && a[2] == 0)
		{
			break;
		}

		rep(i,3)
		{
			v.push_back(a[i]);
		}

		sort(v.begin(),v.end());
		double dis = sqrt(v[0]*v[0] + v[1]*v[1]);

		int n;
		cin >> n;

		while(n--)
		{
			double r;
			cin >> r;

			r *= 2;

			if(dis < r)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NA" << endl;
			}

		}
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

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

int main()
{
	for(vi s(3);cin>>s[0]>>s[1]>>s[2],s[0]|s[1]|s[2];){
		sort(allof(s));
		int n;
		cin>>n;
		rep(i,n){
			int r;
			cin>>r;
			cout<<(4*r*r>s[0]*s[0]+s[1]*s[1]?"OK":"NA")<<endl;
		}
	}
	
	return 0;
}

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