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>

int main(){
  std::vector<int> size;
  int x, d, w, h, 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());
  d = size[0];
  w = size[1];
  h = size[2];
  
  while(d==0 && w==0 && h==0){
    std::cin >> n;
    for(int i=0; i<n; i++){
      std::cin >> r;
      if(r>w){
        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());
  d = size[0];
  w = size[1];
  h = size[2];
  }
  
  return 0;
}

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 <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<2; 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 <iostream>
#include <algorithm>
using namespace std;
int main(){
  int a, b, c, n, r, p;
  while(true){
    cin >> a >> b >> c;
    if(a==0 && b==0 && c==0)
      break;
    p = max(a, b);
    p = max(p, c);
    cin >> n;
    while(n--){
      cin >> r;
      if(2*r > p)
	cout << "OK\n";
      else
	cout << "NA\n";
    }
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

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


	return 0;
}

C++: #include<stdio.h>
int i,j,k,temp;

int bouble_sort(int area[5]){	//ou\[gbox_area[0]ªÅ¬l
	
	temp=0;
	for(i=0;i<3-1;i++){						
		for(j=3-1;i<j;j--){
			if(area[j-1]>area[j]){
				temp=area[j];
				area[j]=area[j-1];
				area[j-1]=temp;
			}
		}
	}
	return area[2];
}

int main(void){

	
	int n,height,width,depth,box_area[5],max_area;
	int hantei[10000]={0};
	double hole_area[10000],hole[10010]={0};

	
	height=0;
	width=0;
	depth=0;
	
	
	scanf("%d %d %d\n",&height,&width,&depth);
	scanf("%d",&n);

	
	for(i=0;i<n+1;i++){
		
		scanf("%lf",&hole[i]);
	
	if(hole[i]==0){
			break;
		}
	}

	
	for(i=0;i<n;i++){
		hole_area[i]=hole[i]*hole[i]*3.14;
	}

	box_area[0]=height*width;	//¼ûÌÌ3ÊÌ»ê¼êÌÊÏ
	box_area[1]=height*depth;
	box_area[2]=width*depth;

	
	bouble_sort(box_area);
	max_area=bouble_sort(box_area);
	
	
	/*for(i=0;i<5;i++){
		printf("box_area[%d]=%d\n",i,box_area[i]);
	}

	for(i=0;i<n;i++){
		printf("hole_area[%d]=%lf\n",i,hole_area[i]);
	}*/

	
	for(i=0;i<n;i++){
		if(hole_area[i]>max_area){
			hantei[i]=1;
		}
		else{
			hantei[i]=0;
		}
	}

	for(i=0;i<n;i++){
		if(hantei[i]==1){
			printf("OK\n");
			}
		else{
			printf("NA\n");	
		}
	}
	
	return 0;
}

C++: #include<iostream>

int a, b, c;
int n;

int main()
{
	while( std::cin >> a >> b >> c, a | b | c )
	{
		std::cin >> n;

		int mi = std::min( a, std::min( b, c ) );
		int ma = std::max( a, std::max( b, c ) );
		int snd = a + b + c - mi - ma;

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

			if( mi * mi + snd * snd < 4 * r * r )
				std::cout << "OK" << std::endl;
			else
				std::cout << "NA" << std::endl;
		}
	}

	return 0;
}

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

using namespace std;

int main() {
	double W, H, D, a, b, r, ab;

	while (cin >> W >> H >> D) {
		int n;
		if (W == 0 && H == 0 && D == 0) break;

		a = min(min(W, H), D);
		b = min(max(W, H), D);

		ab = a*a + b*b;

		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> r;

			r = (r * 2) * (r * 2);

			if (ab < r)
				cout << "OK" << endl;
			else
				cout << "NA" << endl;
		}
	}
}

C++: 
#include<iostream>
#include<cmath>
using namespace std;
int main(){
  while(1){
    int a,b,c,d[10010],n,i,j,temp;
    cin >> a >> b >> c;
    temp=c*c+b*b;
    if(a == 0 && b== 0 && c == 0){
      break;
    }
    cin >> n;
    for(i=0;i<n;i++){
      cin >> d[i];
      if(sqrt(temp) < d[i]*2){
	cout << "OK" << endl;
      }
      else if(c >= d[i]*2 || b >= d[i]*2){
	cout << "NA" << endl;
      }
      else{
	cout << "NA" << endl;
      }
    }
  }
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(){
	int d,w,h,r,n,rd,rs,rw;
	while(cin>>d>>w>>h){
		if(d==0&&w==0&&h==0)break;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>r;
		rd=r*2;
		if(d<rd&&w<rd&&h<rd){
			rs=rd*r;
			rw=sqrt((double)rs);
			rw=rw*4;
			if((d+w+h)<rw)cout<<"OK"<<endl;
		}
		else cout<<"NA"<<endl;
	}
	}
	return 0;
}

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

int main(){
  int a,b,c,n;
  int ent,flag;

  while(1){
    cin >> a >> b >> c;
    if(!a && !b && !c)break;

    cin >> n;
    for(int i=0;i<n;i++){
      cin >> ent;
      ent *= 2;
      flag = 0;
      if(a*a + b*b < ent*ent)flag = 1;
      if(b*b + c*c < ent*ent)flag = 1;
      if(c*c + a*a < ent*ent)flag = 1;
      if(flag)cout << "OK" << endl;
      else cout << "NA" << endl;
    }

  }
}

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

int main()
{
	double x,y,z;
	while(cin >> x >> y >> z){
		double r = min(sqrt(x*x+y*y),min(sqrt(y*y+z*z),sqrt(z*z+y*y)));
		if(!r)
			break;
		int n;
		cin >> n;
		for(int i=0;i<n;i++){
			int R;
			cin >> R;
			R += R;
			if(R >= r)
				cout << "OK" << endl;
			else
				cout << "NA" << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main()
{
	int x,y,z;
	while(cin >> y >> x >> z && x)
	{
		double set=sqrt(x*x+z*z)/2;
		int n,r;
		cin >> n;
		while(n--)
		{
			cin >> r;
			if(set<r)cout<<"OK"<<endl;
			else cout<<"NA"<<endl;
		}
	}
}

C++: //============================================================================
// Name        : aoj0107.cpp
// Author      : afterCmidday
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cmath>
using namespace std;

int main() {
	int a, b, c, n, r;
	while(1){
		cin >> a >> b >> c;
		if(a == 0 && b == 0 && c == 0){
			break;
		}
		cin >> n;
		while(n--){
			cin >> r;
			double x = sqrt(2.0) * r;
			if(x >= a && x >= b || x >= b && x >= c || x >= c && x >= a){
				cout << "OK" << endl;
			}else{
				cout << "NA" << endl;
			}
		}
	}
	return 0;
}