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()
{
	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;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double m5,m10;
  while(cin>>m5>>m10){
    if(m5 < 35.50 && m10 < 71.0){
      cout << "AAA"<<endl;
    }
    else if(m5 < 37.50 && m10 < 77.0){
      cout << "AA"<<endl;
    }
    else if(m5 < 40.0 && m10 < 83.0){
      cout << "A"<<endl;
    }
    else if(m5 < 43.0 && m10 < 89.0){
      cout << "B" <<endl;
    }
    else if(m5 < 50.0 && m10 < 105.0){
      cout << "C"<<endl;
    }
    else if(m5 < 55.0 && m10 < 116.0){
      cout << "D"<<endl;
    }
    else if(m5 < 70.0 && m10 < 148.0){
      cout << "E"<<endl;
    }
    else cout << "NA"<<endl;
  }
  return 0;
}