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 <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const int IMAX=((1<<30)-1)*2+1;
const double EPS=1e-10;
//int mod=1000000007;




int main(){
	vi v(3);
	int n,r;
	while(cin>>v[0]>>v[1]>>v[2]){
		if(v[0]==0&&v[1]==0&&v[2]==0)break;
		sort(all(v));
		double d=0.250*(v[0]*v[0]+v[1]*v[1]);
		cin>>n;
		rep(i,n){
			cin>>r;
			r*=r;
			if(r>d)cout<<"OK"<<endl;
			else cout<<"NA"<<endl;
		}
	}
}

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

int main()
{
  int d[3];
  while( cin >> d[0] >> d[1] >> d[2], d[0]+d[1]+d[2] ) {
    int n;
    cin >> n;
    sort(d, d+3);

    while( n-- ) {
      int r;
      cin >> r;
      if( sqrt(d[0]*d[0] + d[1]*d[1]) < 2*r ) cout << "OK" << endl;
      else cout << "NA" << endl;
    }

  }

}

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

using namespace std;

int main() {
  while (true) {
    int size[3];
    scanf("%d %d %d", size, size + 1, size + 2);
    if (size[0] == 0 && size[1] == 0 && size[2] == 0) { break; }
    sort(size, size + 3);
    int squared_chord = size[0] * size[0] + size[1] * size[1];

    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
      int radius;
      scanf("%d", &radius);
      int squared_diameter = 4 * radius * radius;
      puts(squared_diameter > squared_chord ? "OK" : "NA");
    }
  }

  return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main(void)
{
  int i;
  double temp;
  double x[3];
  int y, z;
  int n;
  double t;

  while(1){
    for(i=0; i<3; i++)
      scanf("%d", &x[i]);
    if(x[0]==0)
      return 0;
      
    if(x[0]>x[1]){
      temp=x[0];
      x[0]=x[1];
      x[1]=x[0];
    }

    if(x[1]>x[2]){
      temp=x[1];
      x[1]=x[2];
      x[2]=x[1];
    }   
    if(x[0]>x[2]){
      temp=x[0];
      x[0]=x[2];
      x[2]=x[0];
    }
  
  t=x[0]*x[0]+x[1]*x[1];
  t=sqrt(t);
  
  scanf("%d", &n);
  
  for(i=0; i<n; i++){
    scanf("%d", &y);
    
    if(2*y>t)
      printf("OK\n");
    else
      printf("NA\n");
    
  }
  }
  return 0;
}

C++: #include <iostream>
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<cmath>
using namespace std;
int main() {
	double r[3];
	while (cin >> r[0] >> r[1] >> r[2]){
		if (r[0] == 0 && r[1] == 0 && r[2] == 0){break;}
		sort(r, r + 3);
		double n = sqrt(r[0] * r[0] + r[1] * r[1]) / 2;
		int num; cin >> num;
		for (int i = 0; i < num; i++){
			double a; cin >> a;
			if (a > n)
				cout << "OK";
			else cout << "NA";
			cout << endl;
		}
	}
	return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 int main()
 {
   int A,B,C;
   while(cin>>A>>B>>C)
   {
     if(A==0&&B==0&&C==0) break;
     int num;
     int a=A*A+B*B;
     int b=A*A+C*C;
     int c=B*B+C*C;
     double kk=min(a,min(b,c));
     kk=sqrt(1.0/4*kk); 
     cin>>num;
     while(num--)      
     {
       int n;
       cin>>n;
       if(n>kk) cout<<"OK"<<endl;
       else cout<<"NA"<<endl;                  
     }             
   }
   //while(1);
   return 0;
 }

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
using namespace std;

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

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