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>
#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<int> 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());
		int dis = v[0]*v[0] + v[1]*v[1];
		cout << dis << endl;

		int n;
		cin >> n;

		while(n--)
		{
			int 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>

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>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;

int main(){
	int a,b,c,d,x,y,n;
	while(cin>>a>>b>>c,a){
		x=a*a+b*b;
		if(b*b+c*c<x)x=b*b+c*c;
		if(c*c+a*a<x)x=c*c+a*a;
		cin>>n;
		for(int i=0;i<n;i++){
			cin>>y;
			if(x<y*y*4)cout<<"OK"<<endl;
			else cout<<"NA"<<endl;
		}
	}
}

C++: #include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
int main(void){

    int x[3],n;
    cin>>x[0]>>x[1]>>x[2]>>n;
    sort(x,x+3);
    x[0] /= 2;
    x[1] /= 2;
    double a = sqrt(x[0] * x[0] + x[1] * x[1]);
    while(n--){
        int r;
        cin>>r;
        if(r<=a)cout<<"NA"<<endl;
        else cout<<"OK"<<endl;
    }


    return 0;
}

C++: #include<iostream>

using namespace std;

typedef struct{
  int x;
  int y;
  int z;
}Cheeze;

double data[3];
Cheeze in;

void make(){
  data[0] = in.x*in.x + in.y*in.y;
  data[1] = in.y*in.y + in.z*in.z;
  data[2] = in.z*in.z + in.x*in.x;
}
int main(){
  
  while(cin >> in.x >> in.y >> in.z && in.z+in.y+in.z){
    make();
    int num;
    cin >> num;
    for(int i = 0; i < num; i++){
      int hole_r;
      cin >> hole_r;
      int status = 0;
      for(int i = 0; i < 3; i++){
	if(data[i] < 4*hole_r*hole_r) status = 1;
      }
      if(status) cout << "OK" << endl;
      else cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
int main(){
  int x,y,z,n,tmp,t;
  for(;;){
    cin>>x;
    cin>>y;
    cin>>z;
    if(x==0&&y==0&&z==0)
      break;
    cin>>n;
    vector<int> r;
    for(int i=0;i<n;i++){
      cin>>tmp;
      r.push_back(tmp*tmp*4);
    }
    t=min(min(x*x+y*y,y*y+z*z),x*x+z*z);
    for(vector<int>::iterator i=r.begin();i<r.end();i++){
      if(*i>t)
	cout<<"OK"<<endl;
      else
	cout<<"NA"<<endl;
    }
  }
  return 0;
}

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

int main(){

int x,y,z,N,r;
int n[1001]={};
while(1){
scanf("%d %d %d",&n[0],&n[1],&n[2]);if(n[0]==0&&n[1]==0&&n[2]==0)break;
for(int i=0;i<3;i++)
for(int j=2;j>i;j--)
if(n[j-1]>n[j]){int t=n[j];n[j]=n[j-1];n[j-1]=t;}

printf("%d %d %d\n",n[0],n[1],n[2]);

double rad=atan2( (double)(n[1]), (double)(n[0]));
//rad=rad*3.141592/180;
//printf("%lf\n",rad);

scanf("%d",&N);
for(int i=0;i<N;i++){

scanf("%d",&r);
//printf("%d %lf\n",n[1],(r*2*sin(rad)));



if(n[1]>=(int)(r*2*sin(rad)))printf("NA\n");
else printf("OK\n");
}
}
return 0;
}

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

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

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

    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<stack>
#include<queue>

using namespace std;

int main(){
	double d,w,h;
	int n,r;
	double dt;
	while(1){
		scanf("%lf %lf %lf",&d,&w,&h);
		if(d==0&&w==0&&h==0) break;
		dt=min(sqrt(d*d+w*w),min(sqrt(w*w+h*h),sqrt(h*h+d*d)));
		scanf("%d",&n);
		for(int i=0;i<n;i++){
			scanf("%d",&r);
			r*=2;
			if(r>dt) printf("OK\n");
			else printf("NA\n");
		}
	}
}

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

int main(){
	int a,b,c,n,r,R;
	while( cin >> a >> b >> c , a || b || c ){
		cin >> n;
		for(int i=0 ; i < n ; i++ ){
			bool ans = true;
			cin >> r;
			R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
			if( 2*r <= R ) ans = false;
			cout << (ans?"OK":"NA") << endl;
		}
	}
}

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

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

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

using namespace std;

int main(void){
  int a,b,c,n;
  double tmp, limit;
  
  while(cin >> a >> b >> c){
	if((a|b|c) == 0) break;
	vector<int> v;
	v.push_back(a);	v.push_back(b);	v.push_back(c);
	sort(v.begin(),v.end());
	limit = sqrt(v[0]*v[0]+v[1]*v[1])/2;
	cin >> n;
	for(int i=0;i<n;i++){
	  cin >> tmp;
	  if(tmp > limit){
		cout << "OK" << endl;
	  }else{
		cout << "NA" << endl;
	  }
	}
  }
}

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

using namespace std;

int main()
{
    int a[3], chk;

    while (cin >> a[0] >> a[1] >> a[2], a[0] || a[1] || a[2]) {
        sort(a, a + 3);
        chk = a[0] * a[0] + a[1] * a[1];

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

            cin >> r;
            if (4 * r * r > chk)
                cout << "OK" << endl;
            else
                cout << "NA" << endl;
        }
    }
    
    return 0;
}

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

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