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>
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;
}

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

int main()
{
    double time1,time2;
    while(cin>>time1>>time2)
    {
        if(time1<35.5&&time2 <71){cout<<"AAA"<<endl;continue;}
        if(time1<37.5&&time2 <77){cout<<"AA"<<endl;continue;}
        if(time1<40&&time2 <83){cout<<"A"<<endl;continue;}
        if(time1<43&&time2 <89){cout<<"B"<<endl;continue;}
        if(time1<50&&time2 <105){cout<<"C"<<endl;continue;}
        if(time1<55&&time2 <116){cout<<"D"<<endl;continue;}
        if(time1<70&&time2 <148){cout<<"E"<<endl;continue;}
        cout <<"NA"<<endl;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

int main()
{
	double a,b;
	while(cin>>a>>b){
		if     (a<35.5 && b<71)	puts("AAA");
		else if(a<37.5 && b<77)	puts("AA");
		else if(a<40 && b<83)	puts("A");
		else if(a<43 && b<89)	puts("B");
		else if(a<50 && b<105)	puts("C");
		else if(a<55 && b<116)	puts("D");
		else if(a<70 && b<148)	puts("E");
		else	puts("NA");
	}
	return 0;
}

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

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

C++: #include <iostream>

using namespace std;

int main() {

	double ms, ml;
	double s[7]={35.50, 37.50, 40.00, 43.00, 50.00, 55.00, 70.00};
	double l[7]={71.00, 77.00, 83.00, 89.00, 105.00, 116.00, 148.00};
	char r[8][4]={"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

	while(cin >> ms >> ml) {
		int ss=7, ll=7;
		for(int i=6; i>=0; i--) {
			if(ms<s[i]) {
				ss=i;
			}
		}
		for(int i=6; i>=0; i--) {
			if(ml<l[i]) {
				ll=i;
			}
		}

		if(ss<ll) {
			ss=ll;
		}

		cout << r[ss] << endl;
	}
	
	return 0;

}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl;
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	double t1, t2;
	VS s = { "AAA","AA","A","B","C","D","E" ,"NA" };
	while (cin >> t1 >> t2) {
		int ty;
		if (t1 < 35.50&&t2 < 71.00)ty = 0;
		else if (t1 < 37.50&&t2 < 77.00)ty = 1;
		else if (t1 < 40.00&&t2 < 83.00)ty = 2;
		else if (t1 < 43.00&&t2 < 89.00)ty = 3;
		else if (t1 < 50.00&&t2 < 105.00)ty = 4;
		else if (t1 < 55.00&&t2 < 116.00)ty = 5;
		else if (t1 < 70.00&&t2 < 148.00)ty = 6;
		else ty = 7;

		Cout(s[ty]);
	}
}