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>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)

int main() {
	double t1[] = {35.5, 37.5, 40, 43, 50, 55, 70};
	double t2[] = {71, 77, 83, 89, 105, 116, 148};
	string s[] = {"AAA", "AA", "A", "B", "C", "D", "E"};
	double a, b;
	while(cin >> a >> b) {
		bool f = 1;
		rep(i,7) {
			if(t1[i] > a && t2[i] > b) {
				cout << s[i] << endl;
				f = 0;
				break;
			}
		}
		if(f) cout << "NA" << endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




int main()
{
	double fh, om;
	while (scanf("%lf %lf", &fh, &om)) {
		if (fh < 35.5 && om < 71.0) {
			puts("AAA");
		}
		else if (fh < 37.5 && om < 77.0) {
			puts("AA");
		}
		else if (fh < 40.0 && om < 83.0) {
			puts("A");
		}
		else if (fh < 43.0 && om < 89.0) {
			puts("B");
		}
		else if (fh < 50.0 && om < 105.0) {
			puts("C");
		}
		else if (fh < 55.0 && om < 116.0) {
			puts("D");
		}
		else if (fh < 70.0 && om < 148.0) {
			puts("E");
		}
		else {
			puts("NA");
		}
	}
	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<iostream>

// ms
const int b1[7] = { 35500, 37500, 40000, 43000, 50000, 55000, 70000 },
		  b2[7] = { 71000, 77000, 83000, 89000, 105000, 116000, 148000 };

const char* cls [7] = { "AAA", "AA", "A", "B", "C", "D", "E" };

int main()
{
	double t1, t2;
	while( std::cin >> t1 >> t2 )
	{
		t1 *= 1000.0, t2 *= 1000.0;

		bool f = false;
		for( int i = 0; i != 7; ++i )
		{
			if( t1 < b1[i] && t2 < b2[i] )
			{
				std::cout << cls[i] << std::endl;
				f = true;
				break;
			}
		}

		if( !f )
			std::cout << "NA" << std::endl;
	}

	return 0;
}

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

string judge(double a, double b) {
    if (a < 35.50 && b < 71.00) {
        return "AAA";
    } if (a < 37.50 && b < 77.00) {
        return "AA";
    } if (a < 40.00 && b < 83.00) {
        return "A";
    } if (a < 43.00 && b < 89.00) {
        return "B";
    } if (a < 50.00 && b < 105.00) {
        return "C";
    } if (a < 55.00 && b < 116.00) {
        return "D";
    } if (a < 70.00 && b < 148.00) {
        return "E";
    }
    return "NA";
}

int main() {
    double a, b;
    while (cin >> a >> b) {
        cout << judge(a, b) << endl;
    }
    return 0;
}

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

using namespace std;

typedef pair<double, double> P2;
typedef pair<string, P2> P;

int main() {
	vector<P> st;
	st.push_back(  P("AAA", P2(35.50, 71.00) )   );
	st.push_back(  P("AA",  P2(37.50, 77.00) )   );
	st.push_back(  P("A",   P2(40.00, 83.00) )   );
	st.push_back(  P("B",   P2(43.00, 89.00) )   );
	st.push_back(  P("C",   P2(50.00, 105.00) )  );
	st.push_back(  P("D",   P2(55.00, 116.00) )  );
	st.push_back(  P("E",   P2(70.00, 148.00) )  );

	double a, b;
	while (scanf("%lf%lf", &a, &b) != EOF) {
		bool f = false;
		for (int i = 0; i < st.size(); ++i) {
			if (a < st[i].second.first && b < st[i].second.second) {
				cout << st[i].first << endl;
				f = true;
				break;
			}
		}
		if (!f) 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.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<stdio.h>
int main()
{
    float hideo, ruio;
    while (scanf("%f %f", &hideo, &ruio)!=EOF) {
        if (hideo < 35.50 && ruio < 71.00) {
            printf("AAA\n");
        }
        else if (hideo < 37.50 && ruio < 77.00) {
            printf("AA\n");
        }
        else if (hideo < 40.00 && ruio < 83.00) {
            printf("A\n");
        }
        else if (hideo < 43.00 && ruio < 89.00) {
            printf("B\n");
        }
        else if (hideo < 50.00 && ruio < 105.00) {
            printf("C\n");
        }
        else if (hideo < 55.00 && ruio < 116.00) {
            printf("D\n");
        }
        else if (hideo < 70.00 && ruio < 148.00) {
            printf("E\n");
        }
        else {
            printf("NA\n");
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
double time5M, time10M;

void score(){
	string rank="NA";
	if(time5M < 70.0 && time10M < 148.0) rank="E";
	if(time5M < 55.0 && time10M < 116.0) rank="D";
	if(time5M < 50.0 && time10M < 105.0) rank="C";
	if(time5M < 43.0 && time10M < 89.0) rank="B";
	if(time5M < 40.0 && time10M < 83.0) rank="A";
	if(time5M < 37.5 && time10M < 77.0) rank="AA";
	if(time5M < 35.5 && time10M < 71.0) rank="AAA";
	cout << rank << endl;
}

int main(){
	while(cin >> time5M >> time10M){
		score();
	}
	return 0;
}