Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	m500 := []float64{35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0, 1000.0}
	m1000 := []float64{71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0, 1000.0}
	classes := []string{"AAA", "AA", "A", "B", "C", "D", "E", "NA"}
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), " ")
		t500, _ := strconv.ParseFloat(input[0], 64)
		t1000, _ := strconv.ParseFloat(input[1], 64)
		for i := 0; i < len(m500); i++ {
			if t500 < m500[i] && t1000 < m1000[i] {
				fmt.Println(classes[i])
				break
			}
		}
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    double a, b;
    int l, r;
    while(cin >> a >> b){
        if(a < 35.50){
            l = 1;
        }else if(a < 37.50){
            l = 2;
        }else if(a < 40.00){
            l = 3;
        }else if(a < 43.00){
            l = 4;
        }else if(a < 50.00){
            l = 5;
        }else if(a < 55.00){
            l = 6;
        }else if(a < 70.00){
            l = 7;
        }else{
            l = 8;
        }
        if(b < 71.00){
            r = 1;
        }else if(b < 77.00){
            r = 2;
        }else if(b < 83.00){
            r = 3;
        }else if(b < 89.00){
            r = 4;
        }else if(b < 105.00){
            r = 5;
        }else if(b < 116.00){
            r = 6;
        }else if(b < 148.00){
            r = 7;
        }else{
            r = 8;
        }
        int ans = max(l,r);
        if(ans == 1)
            cout << "AAA" << endl;
        if(ans == 2)
            cout << "AA" << endl;
        if(ans == 3)
            cout << "A" << endl;
        if(ans == 4)
            cout << "B" << endl;
        if(ans == 5)
            cout << "C" << endl;
        if(ans == 6)
            cout << "D" << endl;
        if(ans == 7)
            cout << "E" << endl;
        if(ans == 8)
            cout << "NA" << endl;
    }
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	while(scanf("%f %f",&a,&b)!=EOF){
		if(a<35.5 && b<71){
			printf("AAA\n");
		}
		else if(a<37.5 && b<77){
			printf("AA\n");
		}
		else if(a<40 && b<83){
			printf("A\n");
		}
		else if(a<43 && b<89){
			printf("B\n");
		}
		else if(a<50 && b<105){
			printf("C\n");
		}
		else if(a<55 && b<116){
			printf("D\n");
		}
		else if(a<70 && b<148){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
	//	scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	while(scanf("%f %f",&a,&b)!=EOF){
	if(a<35.5 && b<71.0){
			printf("AAA\n");
			}
	else if(a<37.5 && b<77.0){
			printf("AA\n");
			}
	else if(a<40.0 && b<83.0){
			printf("A\n");
			}
	else if(a<43.0 && b<89.0){
			printf("B\n");
			}
	else if(a<50.0 && b<105.0){
			printf("c\n");
			}
	else if(a<55.0 && b<116.0){
			printf("D\n");
			}
	else if(a<70.0 && b<148.0){
			printf("E\n");
			}
		else{
			printf("NA\n");
		}
		}
	return 0;
}

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

using namespace std;

int main(){

	double a,b;
	while(cin>>a>>b){
		if(a<35.5&&71.0<b){
			cout<<"AAA"<<endl;
		}
		else if(a<37.5&&77.0>b){
			cout<<"AA"<<endl;
		}
		else if(a<40.0&&83.0>b){
			cout<<"A"<<endl;
		}
		else if(a<43.0&&89.0>b){
			cout<<"B"<<endl;
		}
		else if(a<50.0&&105.0>b){
			cout<<"C"<<endl;
		}
		else if(a<55.0&&116.0>b){
			cout<<"D"<<endl;
		}
		else if(a<70.0&&148.0>b){
			cout<<"E"<<endl;
		}
		else
			cout<<"NA"<<endl;
	}

	return 0;
}

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

using namespace std;

int calc500(double record){
	if(record < 35.50){
		return 7;
	}else if(record < 37.50){
		return 6;
	}else if(record < 40.0){
		return 5;
	}else if(record < 43.0){
		return 4;
	}else if(record < 50.0){
		return 3;
	}else if(record < 55.0){
		return 2;
	}else if(record < 70.0){
		return 1;
	}else{
		return 0;
	}
}

int calc1000(double record){
	if(record < 71.0){
		return 7;
	}else if(record < 77.0){
		return 6;
	}else if(record < 83.0){
		return 5;
	}else if(record < 89.0){
		return 4;
	}else if(record < 105.0){
		return 3;
	}else if(record < 116.0){
		return 2;
	}else if(record < 148.0){
		return 1;
	}else{
		return 0;
	}
}

int main(){

	double t_500,t_1000;
	int rank500,rank1000,rank;

	while(scanf("%lf %lf",&t_500,&t_1000)!=EOF){
		rank500 = calc500(t_500);
		rank1000 = calc1000(t_1000);
		rank = min(rank500,rank1000);

		switch(rank){
		case 7:
			printf("AAA\n");
			break;
		case 6:
			printf("AA\n");
			break;
		case 5:
			printf("A\n");
			break;
		case 4:
			printf("B\n");
			break;
		case 3:
			printf("C\n");
			break;
		case 2:
			printf("D\n");
			break;
		case 1:
			printf("E\n");
			break;
		case 0:
			printf("NA\n");
			break;
		}
	}

    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	while(scanf("%f %f",&a,&b)!=EOF){
		if(a<35.5 && b<71){
			printf("AAA\n");
		}
		else if(a<=7.5 && b<77){
			printf("AA\n");
		}
		else if(a<40 && b<83){
			printf("A\n");
		}
		else if(a<43 && b<89){
			printf("B\n");
		}
		else if(a<50 && b<105){
			printf("C\n");
		}
		else if(a<55 && b<116){
			printf("D\n");
		}
		else if(a>60 && b>148){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
	//	scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
#define MAX_CLASS 8

int check(double m, int type);

int main(){
    double m500, m1000;
    string cls[MAX_CLASS] = {"AAA", "AA", "A", "B", "C", "D", "D", "NA"};
    while(cin >>m500 >>m1000){
        cout <<cls[max(check(m500, 0), check(m1000, 1))] <<endl;
    }
    return 0;
}

int check(double m, int type){
    double dx[2][MAX_CLASS] = {{35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0}, {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0}};
    int ret = 7;
    for(int i = 0; i < MAX_CLASS - 1; i++){
        if(m < dx[type][i]){
            ret = i;
            break;
        }
    }
    return ret;
}

C++: #include <iostream>

using namespace std;

int main()
{
    double f, s;
    
    while (cin >> f >> s) {
        if (f < 35 && s < 71)
            cout << "AAA";
        else if (f < 37 && s < 77)
            cout << "AA";
        else if (f < 40 && s < 83)
            cout << "A";
        else if (f < 43 && s < 89)
            cout << "B";
        else if (f < 50 && s < 105)
            cout << "C";
        else if (f < 55 && s < 116)
            cout << "D";
        else if (f < 70 && s < 148)
            cout << "E";
        else
            cout << "NA";
        
        cout << endl;
    }

    return 0;
}

C++: #include <stdio.h>

int main()
{
	double t1, t2;
	double t[7][2] = {{35.5, 71.0}, {37.5, 77.0}, {40.0, 83.0}, {43.0, 89.0},
                      {50.0, 105.0}, {55.0, 116.0}, {70.0, 148.0}};
	int i1, k = -1;
	char kyu[8][5] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};
					// ??\?????\?????\??¨???????£???????
	scanf("%lf %lf", &t1, &t2);
					// ????¬¢????????????	for (i1 = 0; i1 < 7 && k < 0; i1++) {
		if (t1 < t[i1][0] && t2 < t[i1][1])
			k = i1;
	}

	if (k < 0)
		k = 7;

	printf("%s\n", kyu[k]);

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	while(scanf("%f %f",&a,&b)!=EOF){
		if(a<35.5 && b<71){
			printf("AAA\n");
		}
		else if(a<=7.5 && b<77){
			printf("AA\n");
		}
		else if(a<40 && b<83){
			printf("A\n");
		}
		else if(a<43 && b<89){
			printf("B\n");
		}
		else if(a<50 && b<105){
			printf("C\n");
		}
		else if(a<55 && b<116){
			printf("D\n");
		}
		else if(a<60 && b<148){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
	//	scanf("%d %d",&a,&b);
	}
	return 0;
}