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<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
	int p,a,b,c,i,n,x;
	while(1)
	{
	scanf("%d %d %d",&a,&b,&c);
	if(a==0)return 0;
	if(a<c){
		p=a;
		a=c;
		c=a;
	}
	if(a<b){
		p=a;
		a=b;
		b=a;
	}
	double r=sqrt(b*b+c*c);
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&x);
		if(r<(double)x*2)printf("OK\n");
		else printf("NA\n");
	}
	}
}

C++: #include<stdio.h>

int main(){
    int a, b, c, p, i;
    while(scanf("%d %d %d", &a, &b, &c), a | b | c){
	int m;
	if(a >= b && a >= c)m = b * b + c * c;
	if(b >= a && b >= c)m = a * a + c * c;
	if(c >= a && c >= b)m = a * a + b * b;
	scanf("%d", &p);
	for(i = 0;i < p;i++){
	    scanf("%d", &a);
	    if(a * a * 4 > m)puts("OK");
	    else puts("NO");
	}
    }
    return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define EQ(a,b) (abs((a)-(b))<EPS)
vector<int> vec;
int main()
{
	while(1)
	{
		double p,q,r;
		vec.clear();
		int x,y,z;
		cin >> x >> y >> z;
		if(x==0&&y==0&&z==0)break;
		vec.pb(x);
		vec.pb(y);
		vec.pb(z);
		sort(vec.begin(),vec.end());
		p=((double)vec[0])/2.0;
		q=((double)vec[1])/2.0;
		r=sqrt(p*p+q*q);
		int m;
		cin >> m;
		for(int i=0;i<m;i++)
		{
			int t;
			cin >> t;
			if(r<t)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NA" << endl;
			}
		}
	}
	return 0;
}

C++: #include<stdio.h>

int main(){
    int a, b, c, p, i;
    while(scanf("%d %d %d", &a, &b, &c), a | b | c){
	int m;
	if(a >= b && a >= c)m = b * b + c * c;
	if(b >= a && b >= c)m = a * a + c * c;
	if(c >= a && c >= b)m = a * a + b * b;
	scanf("%d", &p);
	for(i = 0;i < p;i++){
	    scanf("%d", &a);
	    if(a * a * 4 > m)puts("OK");
	    else puts("NA");
	}
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,tate,yoko,high,hole,large;
  while(1){
    cin >> tate >> yoko >> high;
    if(tate==0 && yoko==0 && high==0){
      break;
    }
    cin >> n;
    if(tate>=yoko && tate>=high){
      large=tate;
    }
    else if(yoko>=tate && yoko>=high){
      large=yoko;
    }
    else if(high>=tate && high>=yoko){
      large=high;
    }
    for(int i=0;i<n;i++){
      cin >> hole;
      hole=hole*2;
      if(hole>large){
	cout << "OK" << endl;
      }
      else{
	cout << "NA" << endl;
      }
    }
  }
  return (0);
}

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

int main() {
 long long int a,b,c,n,r;
  cin >> a >> b >> c;
  cin >> n;
  for(int i=0;i<n;i++) {
    cin >> r;
    if((a*a + b*b < 4*r*r) || (b*b + c*c < 4*r*r) || (c*c + a*a < 4*r*r)) {
      cout << "OK" << endl;
    }
    else
      cout << "NA" << endl;
  }
  cin >> a >> b >> c;
  return 0;
}

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

int main(){
    double tmp[3],a,b,mini,n;
    for(int i=0;i<3;i++) cin >> tmp[i];
    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<vector>
#include<cmath>
int main(){
	int a,b,c;
	std::cin>>a>>b>>c;
	int d;
	std::cin>>d;
	int p,q;
	if(a>b&&a>c){
		p=b*b+c*c;
	}else if(b>a&&b>c){
		p=a*a+c*c;
	}else if(c>a&&c>b){
		p=a*a+b*b;
	}
	q=sqrt(p);
	for(int i=0;i<d;i++){
		int n;
		std::cin>>n;
		if(2*n>q){
			std::cout<<"OK"<<std::endl;
		}else{
			std::cout<<"NA"<<std::endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
long a,b,c,n,x,i;
while(cin>>a){
cin>>b>>c>>n;
if(a==0)break;
a=min(min(a,b),c);
for(i=0;i<n;i++){
cin>>x;
if(x>=a)cout<<"OK"<<endl;
else cout<<"NA"<<endl;
}
}
return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
int r[100];
int n=0;

while(true){
	int temp;
	cin>>temp;
	if(n>=2&&temp==0&&r[n-1]==0&&r[n-2]==0){
		break;
	}
	else{
		r[n]=temp;
		n=n++;
	}
}
	int rec1,rec2,rec3;
	rec1=a*a+b*b;
	rec2=a*a+c*c;
	rec3=b*b+c*c;


	for (int i=0;i<n;i++){
	 if (4*r[i]*r[i]>rec1||4*r[i]*r[i]>rec2||4*r[i]*r[i]>rec3){
		 cout<<"OK"<<endl;
	 }
	 else{
		 cout<<"NA"<<endl;
	 }
	}
return 0;

}

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

int main(){
  std::vector<int> size[3];
  int n, r;
  
  std::cin >> size[0];
  std::cin >> size[1];
  std::cin >> size[2];
  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;
}

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

int main(){
  std::vector<int> size;
  int x, n, r;
  
  //std::cin >> x;
  //size[0] = x;
  //std::cin >> x;
  //size[1] = x;
  //std::cin >> x;
  //size[2] = x;
  //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 >> x;
    //size[0] = x;
    //std::cin >> x;
    //size[1] = x;
    //std::cin >> x;
    //size[2] = x;
    //std::sort(size.begin(), size.end());
  }
  
  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]>>n;
	if(!a[0])return 0;
	sort(a,a+3);
	cout<<a[0]*a[0]+a[1]/2*a[1]/2<<endl;
	for(;i<n;i++){
		cin>>r;
		cout<<((a[0]*a[0]+a[1]*a[1]<=4*r*r)?"OK":"NA")<<endl;
	}
}

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

int main(){
	int a[3];
	while(scanf("%d%d%d",a,a+1,a+2),a[0]){
		int b,c;
		scanf("%d",&b);
		std::sort(a,a+3);
		int d=a[0]*a[0]+a[1]*a[1];
		for(int i=0;i<b;i++){
			scanf("%d",&c);
			if(d<c*c*4)printf("OK\n");
			else printf("NA\n");
		}
	}
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
const lld MAXN = 1e4;

int main()
{
	lld d,w,h,n;
	double r=0;

	cin >> d >> w >> h;
	if (d == 0 && w == 0 && h == 0)
	{
		return 0;
	}

	cin >> n;


	double di[3] = {sqrt(d*d + w*w), sqrt(w*w + h*h), sqrt(h*h + d*d)};

	for(int i = 0; i < n; i++)
	{
		cin >>r;
		for(int j = 0; j < 3; j++)
		{
			if (2*r > di[j])
			{
				cout << "OK" << endl;
				break;
			}

			if (j == 2)
			{
				cout << "NA" << endl;
			}
		}
	}

	return 0;
}