Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		line := strings.Split(stdin.Text(), " ")
		len := []int{}
		for i := 0; i < 3; i++ {
			tmp, _ := strconv.Atoi(line[i])
			len = append(len, tmp)
		}
		if len[0] == 0 && len[1] == 0 && len[2] == 0 {
			break
		}
		sort.Ints(len)
		d2 := len[0]*len[0] + len[1]*len[1]
		stdin.Scan()
		n, _ := strconv.Atoi(stdin.Text())
		for i := 0; i < n; i++ {
			stdin.Scan()
			r, _ := strconv.Atoi(stdin.Text())
			if 4*r*r > d2 {
				fmt.Println("OK")
			} else {
				fmt.Println("NA")
			}
		}
	}
}

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

using namespace std;

int main() {
	long long int x,y,z,d,r[10001];
	int n,i;
	while(cin >> x >> y >> z) {
		if (x+y+z==0) break;
		cin >> n;
		for (i=0;i<n;i++) cin >> r[i];
        d=min(x*x+z*z,min(x*x+y*y,y*y+z*z));
        for (i=0;i<n;i++) if (4*r[i]*r[i]>d) cout << "OK" << endl; else cout << "NA" << endl;
	} 
    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){
	long int a[3],n;
	long 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){
		long int r;
		cin >> r;
		if (r>d)
			cout << "OK" << endl;
		else
			cout << "NA" << endl;
	}


	return 0;
}

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

		int n;
		cin >> n;

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

			r *= 2;
			r *= r;

			if((r-dis) > EPS)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NO" << 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[0] = x;
  std::cin >> x;
  size[1] = x;
  std::cin >> x;
  size[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 <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <cfloat>
using namespace std;
int main(){
	
	vector<int> s(3);
	int n;
	int r;
	while(cin>>s[0]>>s[1]>>s[2],s[0]!=0&&s[1]!=0&&s[2]!=0){
		sort(s.begin(),s.end());
		double a=sqrt(pow(s[0],2)+pow(s[1],2));
		cin>>n;
		double r;
		for(int i=0;i<n;i++){
			cin>>r;
			if(a<2*r)
				cout<<"OK"<<endl;
			else
				cout<<"NA"<<endl;
		}
	}
}

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

using namespace std;

int mini_1(int i, int j, int k){
	if(i <= j && i <= k){
		return i;
	}else if(j <= i && j <= k){
		return j;
	}else{
		return k;
	}
}

int mini_2(int i, int j, int k){
	if(i <= j && j <= k){
		return j;
	}else if(k <= j && j <= i){
		return j;
	}else if(i <= j && k <= i){
		return i;
	}else if(j <= i && i <= k){
		return i;
	}else{
		return k;
	}
}

int main(){
	
	int a, b, c, n, min1, min2, r;
	
	cin >> a >> b >> c;
	
	while(a != 0 || b != 0 || c != 0){
		
		min1 = mini_1(a, b, c);
		min2 = mini_2(a, b, c);
		
		cin >> n;
		
		for(int i = 0; i < n; i++){
			cin >> r;
			if(4 * r * r > min1 * min1 + min2 * min2){
				printf("OK\n");
			}else{
				printf("NG\n");
			}
		}
		
		cin >> a >> b >> c;
	}
	
	return 0;
}

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

int a, b, c;
int n, r;

int main() {
  while(cin >> a >> b >> c && (a|b|c)) {
    cin >> n;
    int br = min(min(a*a+b*b, b*b+c*c), c*c+a*a);
    while(n--) {
      cin >> r;
      if(r*r*4 > br) {
        cout << "OK" << endl;
      } else {
        cout << "NA" << endl;
      }
    }
  }
  return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int a[3],k,min1,min2,r,i,j,t;

	while(0==0)
	{
		scanf("%d %d %d",&a[0],&a[1],&a[2]);
		if(a[0]==0 && a[1]==0 && a[2]==0)break;//終了条件
		for(i=0;i<2;i++){
			for(j=i+1;j<3;j++){
			if(a[i]>a[j]){
				t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
			}
		}
	    scanf("%d",&k);
		while(k!=0)
		{
			scanf("%d",&r);
			if((r*r) > (a[0]*a[0])+(a[1]*a[1])/4)//対角線の長さは√（縦＾２＋横＾２）
				printf("OK\n");//半径がチーズの中心から角の距離よりも短い
			else
				printf("NA\n");
			k--;
		}
	}
	return 0;
}

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

int main()
{
	int temp,c,i,f;
	double r,x,y,z;
	cin>>x>>y>>z;

	if(x>y){
		temp=x;
		x=y;
		y=temp;
	}
	if(y>z){
		temp=y;
		y=z;
		z=temp;
	}

	r=sqrt(pow(x/2,2)+pow(y/2,2));

	cin>>c;
	for(i=0;i<c;i++){
		cin>>f;
		if(r<=f)
			cout<<"OK\n";
		else cout<<"NA\n";
	}
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[3],n,i=0,r;
	cin>>a[0]>>a[1]>>a[2];
	if(!a[0])return 0;
	cin>>n;
	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++: #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

int main()
{
	long long int a[3];
	for (size_t i = 0; i < 3; i++)
	{
		cin >> a[i];
	}
	sort(a,a+3);
	a[2] = a[0] * a[0] + a[1] * a[1];
	int N;
	cin >> N;
	long long int x;
	for (size_t i = 0; i < N; i++)
	{
		cin >> x;
		x *= 2;
		if (x*x>a[2])
		{
			cout << "OK" << endl;
		} else
		{
			cout << "NA" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
int main(){

  int t=0,y=0,h=0,k,i,n,r;
  double c;
  while(cin>>t>>y>>h){
    if(t==0&&y==0&&h==0)break;
    if(t<y){
      n=t;
      t=y;
      y=n;
    }
    if(y<h){
      n=t;
      t=y;
      y=n;
    }
    if(t<y){
      n=t;
      t=y;
      y=n;
    }
    c=sqrt((t/2)*(t/2)+(y/2)*(y/2));
    cin>>k;
    for(i=0;i<k;i++){
      cin>>r;
      if(r>c){
	cout<<"OK"<<endl;
      }
      else{
	cout<<"NA"<<endl;
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int a[3],n,r;
	while(cin>>a[0]>>a[1]>>a[2],a[0]){
		cin>>n;sort(a,a+3);
		for(int i=0;i<n;i++){
			cin>>r;
			cout<<((a[0]*a[0]+a[1]*a[1]<4*r*r)?"OK":"NA")<<endl;
		}
	}
}