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()
{
	float a, b;
	string r;
	while (1)
	{
		cin >> a;
		if (cin.eof()) break;
		cin >> b;
		if (a < 35.5 && b < 71.0)
			r = "AAA";
		else if (a < 37.5 && b < 77.0)
			r = "AA";
		else if (a < 40.0 && b < 83.0)
			r = "A";
		else if (a < 43.0 && b < 89.0)
			r = "B";
		else if (a < 50.0 && b < 105.0)
			r = "C";
		else if (a < 55.0 && b < 116.0)
			r = "D";
		else if (a < 70.0 && b < 148.0)
			r = "E";
		else
			r = "NA";
		cout << r << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <vector>
#include <sstream>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;

int main(void){

double a,b;
string nam[] = {"AAA","AA","A","B","C","D","E"};
double r05[] ={35.5,37.5,40.0,43.0,50.0,55.0,70.0}; 
double r10[] ={71.0,77.0,83.0,89.0,105.0,116.0,148.0}; 
	while(cin >> a >> b){
		if(a==0 && b==0 || cin.eof()) break;
		string ans = "NA";
		rep(i,7) 
			if( a<r05[i] && b<r10[i] ){
				ans = nam[i];
				break;
			}
		cout << ans << endl;
	}
	
	
	return 0;
	
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
string getRank(int idx)
{
    string res = "";
    if(idx == 0) res += "NA"; 
    if(idx == 1) res += "E";
    if(idx == 2) res += "D";
    if(idx == 3) res += "C";
    if(idx == 4) res += "B";
    if(idx == 5) res += "A";
    if(idx == 6) res += "AA";
    if(idx == 7) res += "AAA";
    return res;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    double a, b;
    pair<double, double> p[] = {{70, 148},{55, 116},{50, 105},{43, 89},{40, 83},{37.50, 77},{35.50, 71}};
    while(cin >> a >> b)
    {
        int i;
        for(i = 0; i < 7; i++)
        {
            if(a >= p[i].first || b >= p[i].second)
            {
                cout << getRank(i) << endl;
                break;
            }
        }
        if(i == 7) cout << getRank(i) << endl;
    }
    return 0;
}

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

int main()
{
	int i;
	double a, b;
	vector< vector<double> > Time(7, vector<double>(2));
	Time[0][0] = 35.50; Time[0][1] = 71.00;
	Time[1][0] = 37.50; Time[1][1] = 77.00;
	Time[2][0] = 40.00; Time[2][1] = 83.00;
	Time[3][0] = 43.00; Time[3][1] = 89.00;
	Time[4][0] = 50.00; Time[4][1] = 105.00;
	Time[5][0] = 55.00; Time[5][1] = 116.00;
	Time[6][0] = 70.00; Time[6][1] = 148.00;
	vector<string> Class(8);
	Class[0] = "AAA";
	Class[1] = "AA";
	Class[2] = "A";
	Class[3] = "B";
	Class[4] = "C";
	Class[5] = "D";
	Class[6] = "E";
	Class[7] = "NA";
	while (cin>>a>>b) {
		for (i = 0; i < 7; i++)
			if (a<Time[i][0] && b<Time[i][1]) break;
		cout<<Class[i]<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <utility>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
    double t5,t10;
	string ans;
	while(cin>>t5>>t10){
		if(t5<35.50&&t10<71.00){
			ans="AAA";
		}else if(t5<37.50&&t10<77.00){
			ans="AA";
		}else if(t5<40.00&&t10<83.00){
			ans="A";
		}else if(t5<43.00&&t10<89.00){
			ans="B";
		}else if(t5<50.00&&t10<105.00){
			ans="C";
		}else if(t5<55.00&&t10<116.00){
			ans="D";
		}else if(t5<70.00&&t10<148.00){
			ans="E";
		}else{
			ans="NA";
		}
		cout<<ans<<endl;
	}
    return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	double a = 0;
	double b = 0;
	while (cin >> a, cin >> b)
	{
		if (a > 35.5 && b > 71)
		{
			cout << "AAA" << endl;
		}
		else if (a > 37.5 && b > 77)
		{
			cout << "AA" << endl;
		}
		else if (a > 40 && b > 83)
		{
			cout << "A" << endl;
		}
		else if (a > 43 && b > 89)
		{
			cout << "B" << endl;
		}
		else if (a > 50 && b > 105)
		{
			cout << "C" << endl;
		}
		else if (a > 55 && b > 116)
		{
			cout << "D" << endl;
		}
		else if (a > 70 && b > 148)
		{
			cout << "E" << endl;
		}
		else
		{
			cout << "NA" << endl;
		}
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
  int t1,t2;
  char a;
  scanf("%d %d",&t1,&t2);

  if(t1<=35.5&&t2<=71){
    a='AAA';
  }else if(t1<=37.5&&t2<=77){
    a='AA';
  }else if(t1<=40&&t2<=83){
    a='A';
  }else if(t1<=43&&t2<=89){
    a='B';
  }else if(t1<=50&&t2<=105){
    a='C';
  }else if(t1<=55&&t2<=116){
    a='D';
  }else if(t1<=70&&t2<=148){
    a='E';
  }else{
    a='NA';
  }

  printf("%c\n",a);
}

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

int main()
{
    double a, b;

    while( cin >> a >> b )
    {
        if( a - 35.50 < 0 && b - 71 < 0 )
            cout << "AAA";
        else if( a - 37.50 < 0 && b - 77 < 0 )
            cout << "AA";
        else if( a - 40 < 0 && b - 83 < 0 )
            cout << "A";
        else if( a - 43 < 0 && b - 89 < 0 )
            cout << "B";
        else if( a - 50 < 0 && b - 105 < 0 )
            cout << "C";
        else if( a - 55 < 0 && b - 116 < 0 )
            cout << "D";
        else if( a - 70 < 0 && b - 148 < 0 )
            cout << "E";
        else
            cout << "NA";
        cout << endl;
    }
    return 0;
}

C++: /*************************************/
/*     ??\?????\?????\?????\??¬???????????±???006???????????????1?????? */
/*          coded by Y.Suganuma      */
/*************************************/
#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 <stdio.h>
int main(){
    double a,b;
    while(scanf("%lf%lf",&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<70&&b<148)printf("E\n");
        else printf("NA\n");
    }
}

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

int main(){
    double i,j;
    while(cin >> i >> j){
        if(i < 35.5 && j < 71.0) cout << "AAA\n";
        else if(i < 37.5 && j < 77.0) cout << "AA\n";
        else if(i < 40.0 && j < 83.0) cout << "A\n";
        else if(i < 43.0 && j < 89.0) cout << "B\n";
        else if(i < 50.0 && j < 105.0) cout << "C\n";
        else if(i < 55.0 && j < 116.0) cout << "D\n";
        else if(i < 70.0 && j < 148.0) cout << "E\n";
        else cout << "NA\n";
    }
}