Go: package main

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

func main() {
	badge := []string{"AAA", "AA", "A", "B", "C", "D", "E"}
	badgeLen := len(badge)
	short := []float64{35.5, 37.5, 40, 43, 50, 55, 70}
	long := []float64{71, 77, 83, 89, 105, 116, 148}

	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		time := strings.Split(stdin.Text(), " ")

		sT, _ := strconv.ParseFloat(time[0], 64)
		lT, _ := strconv.ParseFloat(time[1], 64)

		sR, lR, t := 0, 0, 0.0
		for _, t = range short {
			if sT < t {
				break
			}
			sR++
		}
		for _, t = range long {
			if lT < t {
				break
			}
			lR++
		}
		rank := ""
		if sR >= badgeLen || lR >= badgeLen {
			rank = "NA"
		} else if sR >= lR {
			rank = badge[sR]
		} else {
			rank = badge[lR]
		}
		fmt.Println(rank)
	}
}

C++: #include <iostream>

using namespace std;

int result500=0,result1000=0;

void time500m(double time){
    if(time < 35.50){
        result500=0;
    }
    else if(time >= 35.50 && time < 37.50 ){
        result500=1;
    }
    else if(time >= 37.50 && time < 40 ){
        result500=2;
    }
    else if(time >= 40 && time < 43 ){
        result500=3;
    }
    else if(time >= 43 && time < 50 ){
        result500=4;
    }
    else if(time >= 50 && time < 55 ){
        result500=5;
    }
    else if(time >= 55 && time < 70 ){
        result500=6;
    }
    else if(time >= 70 ){
        result500=7;
    }
}

void time1000m(double time){
    if(time < 71){
        result1000=0;
    }
    else if(time >= 71 && time < 77 ){
        result1000=1;
    }
    else if(time >= 77 && time < 83 ){
        result1000=2;
    }
    else if(time >= 83 && time < 89 ){
        result1000=3;
    }
    else if(time >= 89 && time < 105 ){
        result1000=4;
    }
    else if(time >= 105 && time < 116 ){
        result1000=5;
    }
    else if(time >= 116 && time < 148 ){
        result1000=6;
    }
    else if(time >= 148){
        result1000=7;
    }
}

int main() {

    int result;
    double time500,time1000;

    while(1){
        cin >> time500 >> time1000;

        time500m(time500);
        time1000m(time1000);

        if(result500>result1000){
            result=result500;
        }
        else{
            result=result1000;
        }

        switch(result){
        case 0 : cout << "AAA" << endl; break;
        case 1 : cout << "AA" << endl; break;
        case 2 : cout << "A" << endl; break;
        case 3 : cout << "B" << endl; break;
        case 4 : cout << "C" << endl; break;
        case 5 : cout << "D" << endl; break;
        case 6 : cout << "E" << endl; break;
        case 7 : cout << "NA" << endl; break;
        }
        
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	double t,ti;

	cin >> t >> ti;

	if(t <= 35.50 && ti <= 71.00)
	{
		cout << "AAA" << endl;
	}
	else if(t <= 37.50 && ti <= 77.00)
	{
		cout << "AA" << endl;
	}
	else if(t <= 40.00 && ti <= 83.00)
	{
		cout << "A" << endl;
	}
	else if(t <= 43.00 && ti <= 89.00)
	{
		cout << "B" << endl;
	}
	else if(t <= 50.00 && ti <= 105.00)
	{
		cout << "C" << endl;
	}
	else if(t <= 55.00 && ti <= 116.00)
	{
		cout << "D" << endl;
	}
	else if(t <= 70 && ti <= 148.00)
	{
		cout << "E" << endl;
	}

	else
		cout << "NA" << endl;

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	
	scanf("%f %f",&a,&b);
	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>
using namespace std;

double border[7][2] =
{
    {35.50, 71.00},
    {37.50, 77.00},
    {40.00, 83.00},
    {43.00, 89.00},
    {50.00, 105.00},
    {55.00, 116.00},
    {70.00, 148.00}
};
string name[8] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

int main(){
    double a, b;
    int i;
    while( cin >> a >> b ){
        for(i = 0; i < 7; i++){
            if( a < border[i][0] && b < border[i][1] ){
                break;
            }
        }
        cout << name[i] << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	double a,b;
	cin>>a>>b;
	if(a<35.5&&b<71.0){
		cout<<"AAA"<<endl;
	}else if(a<37.5&&b<77.0){
		cout<<"AA"<<endl;
	}else if(a<40.0&&b<83.0){
		cout<<"A"<<endl;
	}else if(a<43.0&&b<89.0){
		cout<<"B"<<endl;
	}else if(a<50.0&&b<105.0){
		cout<<"C"<<endl;
	}else if(a<55.0&&b<116.0){
		cout<<"D"<<endl;
	}else if(a<70.0&&b<88.0){
		cout<<"E"<<endl;
	}else{
		cout<<"NA"<<endl;
	}
}

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

int main() {
	string ra[8] = { "AAA","AA","A","B","C","D","E","NA" };
	int fr,tr,n;
	double fm, tm;
	while (cin >> fm >> tm) {
		if (fm < 35.5) { fr = 0; }
		else if (fm < 37.5) { fr = 1; }
		else if (fm < 40) { fr = 2; }
		else if (fm < 43) { fr = 3; }
		else if (fm < 50) { fr = 4; }
		else if (fm < 55) { fr = 5; }
		else if (fm < 70) { fr = 6; }
		else { fr = 7; }

		if (tm < 71) { tr = 0; }
		else if (tm < 77) { tr = 1; }
		else if (tm< 83) { tr = 2; }
		else if (tm < 89) { tr = 3; }
		else if (tm < 105) { tr = 4; }
		else if (tm < 116) { tr = 5; }
		else if (tm < 148) { tr = 6; }
		else { tr = 7; }

		if (fr <= tr) { n = tr; }
		else { n = fr; }

		cout << ra[n] << endl;
	}
	return 0;
}

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

int main()
{
	double t1, t2;
	
	int rank1,rank2;
	
	while(scanf("%lf %lf", &t1, &t2) != EOF){
		
		if (t1 < 35.50) rank1 = 1;
		else if (t1 < 37.50) rank1 = 2;
		else if (t1 < 40.0) rank1 = 3;
		else if (t1 < 43.0) rank1 = 4;
		else if (t1 < 50.0) rank1 = 5;
		else if (t1 < 55.0) rank1 = 6;
		else if (t1 < 70.0) rank1 = 7;
		else rank1 = 8;
		
		if (t2 < 71.0) rank2 = 1;
		else if(t2 < 77.0) rank2 = 2;
		else if(t2 < 83.0) rank2 = 3;
		else if(t2 < 89.0) rank2 = 4;
		else if(t2 < 105.0) rank2 = 5;
		else if(t2 < 116.0) rank2 = 6;
		else if(t2 < 148.0) rank2 = 7;
		else rank2 = 8;
		
		int rank = max(rank1, rank2);
		
		if(rank == 1) puts("AAA");
		if(rank == 2) puts("AA");
		if(rank == 3) puts("A");
		if(rank == 4) puts("B");
		if(rank == 5) puts("C");
		if(rank == 6) puts("D");
		if(rank == 7) puts("E");
		if(rank == 8) puts("NA");
		
	}
}

C++: #include<cstdio>
#include<string>
main(){
        using namespace std;
        string lv[8] = {"AAA","AA","A","B","C","D","E","NA"};
        double ind1,ind2,lvd5[7] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0};
        int i,j,lvd1[7] = {71,77,83,89,105,116,148};
        while(~scanf("%lf %lf",&ind1,&ind2)){
                i = j = -1;
                while(++i<7)
                  if(ind1 < lvd5[i])
                    break;
                while(++j<7)
                  if(ind2 < lvd1[j])
                    break;
                printf("%s\n", i <= j ? lv[j].c_str() : lv[i].c_str());
        }
        return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	float q,p;
	while(1){
		cin >> q >> p;
		if(35.50>=q&&71.00>=p)cout << "AAA";
		else if(37.50>=q&&77.00>=p)cout << "AA";
		else if(40.00>=q&&83.00>=p)cout << 'A';
		else if(43.00>=q&&89.00>=p)cout << 'B';
		else if(50.00>=q&&105.00>=p)cout << 'C';
		else if(55.00>=q&&116.00>=p)cout <<'D';
		else if(70.00>=q&&148.00>=p)cout <<'E';
		else {
			cout << "NA";
			break;
		}
	}
	return 0;
}