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 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;
}

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

int main(){
doIt();
}
void doIt(){
	int a,b,c,n,i;
	cin >> a >> b >> c;
	while(a + b + c > 0){
		cin >> n;
		int r[n];
		//cout << sqrt(a*a + b*b) / 2 << ", " << sqrt(b*b + c*c) / 2 << "," << sqrt(a*a + c*c) / 2;
		for(i = 0; i < n; i++){
			std::cin >> r[i];
			//斜辺を計算する
			bool bOK = false;
			if(sqrt(a*a + b*b) / 2 < r[i] || sqrt(b*b + c*c) / 2 < r[i] || sqrt(c*c + a*a) / 2 < r[i]){
				bOK = true;
			}
			if(bOK){
				cout << "OK" << endl;
			}
			else{
				cout << "NA" << endl;
			}
		}
		cin >> a >> b >> c;
	}
}

C++: #include<iostream>
using namespace std;
int a,d,w,h,x;
main()
{
    while(cin>>d>>w>>h,d)
    {
        if(d>=w&&d>=h)x=w*w+h*h;
        else if(w>=d&&w>=h)x=d*d+h*h;
        else x=d*d+w*w;
        int n;cin>>n;
        while(n--)
        {
            cin>>a;
            a=a*a*4;
            cout<<(a>x?"OK":"NA")<<endl;
        }
    }
}

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

int main(){
	int x, y, z;
	while(cin >>x >>y >>z){
		if(x == 0 && y == 0 && z == 0) break;
		int n;
		cin >>n;
		for(int i = 0; i < n; i++){
			int door;
			cin >>door;
			if(door >= x || door >= y || door >= z){
				cout <<"OK" <<endl;
			} else{
				cout <<"NA" <<endl;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
#define REP(i,a,n) for(int i = a ; i < n ; i++)
#define rep(i,n) REP(i,0,n)

typedef long long ll;

void solve(){
}

int main(){
  double a,b,c;

  while(cin>>a>>b>>c,a||b||c){
    double len = min(a*a+b*b, min(a*a+c*c, b*b+c*c));
    int n;
    cin>>n;

    rep(i,n){
      double r;
      cin>>r;
      r *= 2;
      if(len > r*r){
        cout<<"NA\n";
      }
      else{
        cout<<"OK\n";
      }
    }
  }
}