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<bits/stdc++.h>
using namespace std;
int main(){
  double a[3],b,n;
  cin >> a[0] >> a[1] >> a[2];
  while(a[0] != 0 && a[1] != 0 && a[2] != 0){
    sort(a,a+3);
    cin >> n;
    for(int i = 0;i < n;i++){
      cin >> b;
      if(a[1] > b+b) cout << "NA" << endl;
      else if( pow(b+b,2) > pow(a[0],2)+pow(a[1],2)) cout << "OK" << endl;
      else cout << "NA" << endl;
    }
    cin >> a[0] >> a[1] >> a[2];
  }
  return (0);
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
    int a[3],temp,n;
    bool f;
    while(1){
        f=true;
        for(int i=0;i<3;i++){
            scanf("%d",&a[i]);
            if(a[i]!=0)f=false;
        }
        sort(a,a+3);
        if(f)return 0;
        scanf("%d",&temp);
        for(int i=0;i<temp;i++){
            scanf("%d",&n);
            if(4*n*n>a[0]*a[0]+a[1]*a[1])printf("OK\n");
            else printf("NA\n");
        }
        
    }
}

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

int main()
{
    int CheeseHeight, CheeseWidth, CheeseLength;
    
    while (std::cin >> CheeseHeight >> CheeseWidth >> CheeseLength) {
        if (CheeseHeight == 0 && CheeseWidth == 0 && CheeseLength == 0) {
            break;
        }
        
        std::array<int, 3> CheeseData = {CheeseHeight, CheeseWidth, CheeseLength};
        std::sort(CheeseData.begin(), CheeseData.end());
        
        int exit_num;
        std::cin >> exit_num;
        
        for (int i = 0; i < exit_num; ++i) {
            int exit_radius;
            
            std::cin >> exit_radius;
            
            double exit_limit = std::sqrt(
                    static_cast<double>(CheeseData.at(0) * CheeseData.at(0) / 4.0 
                    + CheeseData.at(1) * CheeseData.at(1) / 4.0)
                    );
            
            if (exit_limit < exit_radius) {
                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[3];
  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;
}

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 && x[1]==0 && x[2]==0)
      break;
      
  for(i=0; i<3; i++){
    if(x[i]>x[i+1]){
      temp=x[i];
      x[i]=x[i+1];
      x[i+1]=temp;
    }
  }
  
  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 <algorithm>
#include <cstdio>

using namespace std;

int main() {
  int size[3];
  scanf("%d %d %d", size, size + 1, size + 2);
  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++: int a,b,c,n,r;main(){while(std::cin>>a>>b>>c,a|b|c){a*=a;b*=b;c*=c;std::cin>>n;while(n--)std::cin>>r,r*=4*r,puts(a+b<r|b+c<r|c+a<r?"OK":"NA");}}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

double circle (int x, int y) {
    return 1/2.0 * sqrt(x*x + y*y);
}

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int In[3];
    rep(i ,3) cin >> In[i];
    while (In[0] != 0 || In[1] != 0 || In[2] != 0) {
        sort(In, In + 3);
        double r = circle(In[0], In[1]);
        int n; cin >> n;
        for (int i = 0; i < n; i++) {
            int door; cin >> door;
            if (r < door) cout << "OK" << endl;
            else cout << "NA" << endl;
        }
        rep(i ,3) cin >> In[i];
    } 

    return 0;
}

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
 
int main(){
 
    double d,w,h,r,mind,dw,wh,hd;
    int n;
 
    while(true){
        scanf("%lf %lf %lf",&d,&w,&h);
        if(d == 0.0 && w == 0.0 && h == 0.0)break;
 
        scanf("%d",&n);
 
        for(int i=0; i < n; i++){
            scanf("%lf",&r);
            dw = (sqrt(d*d+w*w))/2.0;
            wh = (sqrt(w*w+h*h))/2.0;
            hd = (sqrt(d*d+h*h))/2.0;
            mind = min(dw,min(wh,hd));
            if(r > mind){
                printf("OK\n");
            }else{
                printf("NA\n");
            }
        }
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define EPS (1e-8)

int main() {
	int a, b, c, n;
	while (cin >> a >> b >> c, a || b || c) {
		cin >> n;
		int min1 = min(a, b), min2 = min(max(a, b), c);
		double d = hypot(min1, min2) / 2.0;
		
		REP(i, n) {
			double r;
			scanf("%lf", &r);
			if (r - d > EPS) puts("OK");
			else puts("NA");
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int d,w,h,n,i,r[10001];
	while(1){
		scanf("%d %d %d",&d,&w,&h);
		if(d==0&&w==0&&h==0) break;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d",&r[i]);
		}
		for(i=0;i<n;i++){
		    if(d<r[i]*2&&w<r[i]*2&&h<r[i]*2){
			    printf("OK\n");
			}
			else{
			    printf("NA\n");
			}
		}
	}
	return 0;
}

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


    return 0;
}

C++: #include <cmath>
#include <cstdio>
using namespace std;
 
int main(void){
  double a,b,c,min,tmp;
  int r,n;
 
  while(1){
    scanf("%lf%lf%lf",&a,&b,&c);
    if(!a && !b && !c) break;
 
    scanf("%d",&n);
    while(n--){
      scanf("%d",&r);
      min = 999999;
      if((tmp=sqrt(a*a+b*b)/2)<min) min=tmp;
      if((tmp=sqrt(a*a+c*c)/2)<min) min=tmp;
      if((tmp=sqrt(b*b+c*c)/2)<min) min=tmp;
 
      if(min<r) printf("OK\n");
      else printf("NA\n");
    }
  }
 
  return 0;
}