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<stdio.h>
int main(void)
{
    float n,m;
	while(scanf("%f %f",&n,&m)!=EOF){
	    if(n<35.50&&m<71.0){
		    printf("AAA\n");
		}
		else if(n<37.50&&m<77.0){
		    printf("AA\n");
		}
		else if(n<40.00&&m<83.0){
		    printf("A\n");
		}
		else if(n<43.00&&m<89.0){
		    printf("B\n");
		}
		else if(n<50.00&&m<105.0){
		    printf("C\n");
		}
		else if(n<55.00&&m<116.0){
		    printf("D\n");
		}
		else if(n<70.00&&m<148.0){
		    printf("E\n");
		}
		else printf("NA\n");
	}
	return 0;
}

C++: #include<stdio.h>

int main(void){
	float time5,time10;

	while(scanf("%f %f",&time5,&time10)!=EOF){
		if(time5<35.5 && time10<71.0)printf("AAA\n");
		
		else if(time5<37.5 && time10<77.0)printf("AA\n");
		
		else if(time5<40.0 && time10<83.0)printf("A\n");
		
		else if(time5<43.0 && time10<89.0)printf("B\n");
		
		else if(time5<50.0 && time10<105.0)printf("C\n");
		
		else if(time5<55.0 && time10<116.0)printf("D\n");
		
		else if(time5<70.0 && time10<148.0)printf("E\n");
		
		else printf("NA\n");
		
	}

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b;
	while(scanf("%d %d",&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>60 && b>148){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
	//	scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include <stdio.h>

int main(){
	double a,b;
	
	while(~scanf("%lf%lf",&a,&b)){
		if(a<35.5 && b<71){
			printf("AAA\n");
		}else if(a<37.5 && b<76){
			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");
		}
	}
	return 0;
}

C++: #include <stdio.h>

int main(){
	double a,b;
	
	while(~scanf("%lf%lf",&a,&b)){
		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");
		}
	}
	return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

int f(double x) {
  return (x < 70.0) + (x < 55.0) + (x < 50.0) + (x < 43.0) +
         (x < 40.0) + (x < 37.5) + (x < 35.5);
}

int g(double x) {
  return (x < 148.0) + (x < 116.0) + (x < 105.0) + (x < 89.0) +
         (x < 83.0) + (x < 77.0) + (x < 71.0);
}

void solve() {
  double t1, t2;
  string t[] = {"NA", "E", "D", "C", "B", "A", "AA", "AAA"};
  while (cin >> t1 >> t2) {
    cout << t[min(f(t1), g(t2))] << endl;
  }
}

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>
#include <string>
using namespace std;

int main(){
	double inp1,inp2;
	string opt="NA";
	cin >> inp1 >> inp2;
	
	if(inp1<35.5 && inp2<71.0){
		opt = "AAA";
	}else if(inp1<37.5 && inp2<77.0){
		opt = "AA";
	}else if(inp1<40.0 && inp2<83.0){
		opt = "A";
	}else if(inp1<43.0 && inp2<89.0){
		opt = "B";
	}else if(inp1<50.0 && inp2<105.0){
		opt = "C";
	}else if(inp1<55.0 && inp2<116.0){
		opt = "D";
	}else if(inp1<70.0 && inp2<148.0){
		opt = "E";
	}
	cout << opt << endl;
	return 0;
}

C++: #include<stdio.h>

int main(void){
	float time5,time10;

	while(scanf("%f %f",&time5,&time10)!=EOF){
		if(time5<35.0 && time10<71.0)printf("AAA\n");
		
		else if(time5<37.5 && time10<77.0)printf("AA\n");
		
		else if(time5<40.0 && time10<83.0)printf("A\n");
		
		else if(time5<43.0 && time10<89.0)printf("B\n");
		
		else if(time5<50.0 && time10<105.0)printf("C\n");
		
		else if(time5<55.0 && time10<116.0)printf("D\n");
		
		else if(time5<70.0 && time10<148.0)printf("E\n");
		
		else printf("NA\n");
		
	}

	return 0;
}

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

	double a,b;

	cin >> a >> b;

	if(a<35.50 && b<71.00){

		cout << "AAA" << endl;
	}

	else if(a<37.50 && b<77.00){
		cout << "AA" << endl;
	}

	else if(a<40.00 && b<83.00){

		cout << "A" << endl;
	}

	else if(a<43.00 && b<89.00){

		cout << "B" << endl;
	}
	else if(a<50.00 && b<105.00){
		cout << "C" << endl;
	}
	else if(a<55.00 && b<116.00){
		cout << "D" << endl;
	}
	else if(a<70.00 && b<148.00){

		cout << "E" << endl;
	}
	else{
		cout << "NA" << endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    float n[3],m[3];
	int i;
	for(i=0;i<2;i++){
	    scanf("%f %f",&n[i],&m[i]);
	}
	for(i=0;i<2;i++){
	    if(n[i]<35.50&&m[i]<71.0){
		    printf("AAA\n");
		}
		else if(n[i]<37.50&&m[i]<77.0){
		    printf("AA\n");
		}
		else if(n[i]<40.00&&m[i]<83.0){
		    printf("A\n");
		}
		else if(n[i]<43.00&&m[i]<89.0){
		    printf("B\n");
		}
		else if(n[i]<50.00&&m[i]<105.0){
		    printf("C\n");
		}
		else if(n[i]<55.00&&m[i]<116.0){
		    printf("D\n");
		}
		else if(n[i]<70.00&&m[i]<148.0){
		    printf("E\n");
		}
		else printf("NA\n");
	}
	return 0;
}