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;

int main(void) {
	int size[3];

	while (cin >> size[0] >> size[1] >> size[2]) {
		if (size[0] == 0 && size[1] == 0 && size[2] == 0) {
			break;
		}
		std::sort(size, size + 3);

		// 直方体の最小面の対角線
		double diagonal = sqrt(pow(size[0], 2) + pow(size[1], 2));
		int num_entries, r;

		cin >> num_entries;

		for (int i = 0; i < num_entries; i++) {
			cin >> r;
			cout << (r * 2 > diagonal ? "OK" : "NA") << endl;
		}
	}
}

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

int main() {
  for (int x, y, z; cin >> x >> y >> z, x; ) {
      if (y > z) swap(y, z);
      if (x > y) swap(x, y);
      if (y > z) swap(y, z);

      int T; cin >> T;
      while(T--) {
          int r; cin >> r;
          if (4 * r * r > x * x + y * y)
              cout << "OK" << endl;
          else
              cout << "NA" << endl;
      }
  }
  return 0;
}

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

int main()
{
	int a,b,c,r,n,t;
	while(cin >> a >> b >> c, (a||b||c))
	{
		if(a>b) swap(a,b);
		if(a>c) swap(a,c);
		if(b>c) swap(b,c);

		r = a*a + b*b;

		cin >> n;
		while(n--)
		{
			cin >> t;
			t = t*t*4;
			cout << (r<t?"OK":"NA") << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    array<int, 3> v{};
    while(cin >> v[0] >> v[1] >> v[2], v[0]){
        int n;
        cin >> n;
        sort(v.begin(),v.end());
        for (int i = 0; i < n; ++i) {
            int r; cin >> r;
            if(v[0]*v[0]+v[1]*v[1] < 4*r*r) puts("OK");
            else puts("NA");
        }
    }
    return 0;
}

C++: #include<math.h>
#include<algorithm>
#include<iostream>

using namespace std;

int main(){
	int size[3];
	int n,r;
	int i;
	
	while(1){
	 for(i=0;i<3;i++){cin>>size[i];}
	 if(!(size[0]||size[1]||size[2])){break;}
	 sort(size,size+3);
	 
	 cin>>n;
	 for(i=0;i<n;i++){
	  cin>>r;
	  if(pow(size[0],2)+pow(size[1],2)<4*pow(r,2)){cout<<"OK\n";}else{cout<<"NA\n";}
	 }
	}
	
	return 0;
}

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

int 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>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, c, n;
	float tmp;
	
	while(1){
		cin >> a >> b >> c;
		if(a == 0){
			break;
		}
		cin >> n;
		for(int i = 0; i < n; i++){
			cin >> tmp;
			tmp = tmp*tmp*3.1415/2.0;
			if(tmp > a*b || tmp > b*c || tmp > c*a){
				cout << "OK" << endl;
			} else {
				cout << "NA" << endl;
			}
		}
	}
	
	return 0;
}

C++: #include <cstdio>
#include <cmath>
#include <iostream>

double CalcGr(int x,int  y);

class Cheese{
private:
	int x;
	int y;
	int z;
public:
	double gr[3];
	Cheese(){
//		scanf("%d %d %d", &x, &y, &z);
		std::cin >> x >> y >> z;
		gr[0] = CalcGr(x, z);
		gr[1] = CalcGr(x, y);
		gr[2] = CalcGr(y, z);
	}
};

int main(){
	Cheese c;
	
	int n;
//	scanf("%d", &n);
	std::cin >> n;

	int r;
	for (int i = 0; i < n; i++){
//		scanf("%d", &r);
		std::cin >> r;
		if (c.gr[0] < r || c.gr[1] < r || c.gr[2] < r){
			printf("OK\n");
		}
		else{
			printf("NA\n");
		}
	}

	return 0;
}

double CalcGr(int x, int y){
	return sqrt((double)(x*x + y*y)) / 2;
}

C++: 
#include<iostream>
using namespace std;
int main(){
double w,h,d,r;
double pi=3.141592653,s;

int n;
while(1){
cin >> w >> h >> d;
if(w+h+d==0) break;
cin >> n;
while(n--){
cin >> r;
s=r*r*pi;
if(w*h<s||h*d<s||d*w<r) cout<<"OK" << endl;
else cout << "NA" << endl;
}
}
return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define POW(u) ((u)*(u))
signed main(void){
	ios::sync_with_stdio(false);
	int a,b,c,n,x;
	while(cin>>a>>b>>c&&(a|b|c)){
		cin>>n;
		/*
		if(a>c)	swap(a,c);
		if(b>c)	swap(b,c);
		*/
		int v[3];
		v[0]=a,v[1]=b,v[2]=c;;
		sort(v,v+3);
		a=v[0],b=v[1];
		double MIN=POW((double)a/2.0)+POW((double)b/2.0);
		for(int i=1;i<=n;i++){
			cin>>x;
			if(POW(x)>MIN)
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
//#include <map>
#include <iomanip>
#include <vector>

using namespace std;



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

C++: #include<iostream>
#include<stdio.h>
#include<cmath>
#include<vector>

double getHypotenuse( double a , double b )
{
	return sqrt( pow(a , 2) + pow(b , 2) );
}

double getMin( double a , double b , double c )
{
	double min = a;
	if( b < min ){
		min = b;
	}
	if( c < min ){
		min = c;
	}
	return min;
}

int main(void)
{
	int x, y, z;

	while(1){
		std::cin >> x >> y >> z;
		if( x == 0 && y == 0 && z == 0 ){
			break;
		}
		double hypoXY = getHypotenuse( x , y );
		double hypoYZ = getHypotenuse( y , z );
		double hypoZX = getHypotenuse( z , x );

		double hypoMin = getMin( hypoXY , hypoYZ , hypoZX );

		int n;
		std::cin >> n;
		for( int i = 0 ; i < n ; i++ ){
			int radius;
			std::cin >> radius;
			std::cout << (hypoMin < 2 * radius ? "OK":"NA") << std::endl;
		}
	}

	return 0;
}

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

int main()
{
	int temp,c,i,f;
	double r,x,y,z;
	cin>>x>>y>>z;

	if(x>y){
		temp=x;
		x=y;
		y=temp;
	}
	if(y>z){
		temp=y;
		y=z;
		z=temp;
	}

	r=sqrt(pow(x/2,2)+pow(y/2,2));

	cout<<r;

	cin>>c;
	for(i=0;i<c;i++){
		cin>>f;
		if(r<=f)
			cout<<"OK\n";
		else cout<<"NA\n";
	}
}

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

int main(){
  std::vector<int> size;
  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;
}