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<stdio.h>
int main(void)
{
	float t,t1;
	while(scanf("%f %f",&t,&t1)!=EOF){
	if(t<35.50 && t1<71.00){
		printf("AAA\n");
	}
	else if(t<37.50 && t1<77.00){
		printf("AA\n");
	}
	else if(t<40.00 && t1<83.00){
		printf("A\n");
	}
	else if(t<43.00 && t1<89.00){
		printf("B\n");
	}
	else if(t<50.00 && t1<105.00){
		printf("C\n");
	}
	else if(t<55.00 && t1<116.00){
		printf("D\n");
	}
	else if(t<70.00 && t1<148.00){
		printf("E\n");
	}
	else{
		printf("NA\n");
	}
}
	return 0;
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> VI;
typedef pair<int,int> PII;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define PB push_back
#define sz size()

const double EPS = 1e-10;
const int INF = 100000000;

int main(){
    string hoge[]={"NA","E","D","C","B","A","AA","AAA"};
    double a,b;
    while(cin>>a>>b){
        int s=-1,x=-1;
        
        if(a<70.0)s=0;
        if(a<55.0)s=1;
        if(a<50.0)s=2;
        if(a<43.0)s=3;
        if(a<40.0)s=4;
        if(a<37.5)s=5;
        if(a<35.5)s=6;
        
        if(b<148.0)x=0;
        if(b<116.0)x=1;
        if(b<105.0)x=2;
        if(b<89.0)x=3;
        if(b<83.0)x=4;
        if(b<77.5)x=5;
        if(b<71.5)x=6;

        cout<<hoge[min(s,x)+1]<<endl;
    }
    
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    double time1,time2;
    while(scanf("%lf %lf",&time1,&time2) != EOF){
        if(time1 < 35.5 && time2 < 71) cout << "AAA" << endl;
        else if(time1 < 37.5 && time2 < 77) cout << "AA" << endl;
        else if(time1 < 40 && time2 < 83) cout << "A" << endl;
        else if(time1 < 43 && time2 < 89) cout << "B" << endl;
        else if(time1 < 50 && time2 < 105) cout << "C" << endl;
        else if(time1 < 55 && time2 < 116) cout << "D" << endl;
        else if(time1 < 70 && time2 < 148) cout << "E" << endl;
        else cout << "NA" << endl;
    }

	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
double table5[7]={35.0,37.0,40.0,43.0,50.0,55.0,70};
double table1[7]={71.0,77.0,83.0,89.0,105.0,116.0,148.0};
string score[7]={"AAA","AA","A","B","C","D","E"};
int main(){
	double a,b;
	while(cin>>a>>b){
		int t5 = 100;
		int t1 = 100;
		for(int i =0;i < 7;i++){
			if(a<table5[i]){
				t5 = i;
				break;
			}
		}
		for(int j =0;j < 7;j++){
			if(b<table1[j]){
				t1 =j;
				break;
			}
		}
		int ans = max(t1,t5);
		if(ans==100){
			cout <<"NA"<<endl;
		}else{
			cout <<score[ans]<<endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	
	scanf("%f %f",&a,&b);
	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;
}
#include<stdio.h>
int main(void)
{
	float a,b;
	
	scanf("%f %f",&a,&b);
	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<bits/stdc++.h>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define ll long long int
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int>pii;
typedef pair<ll,ll>pll;
typedef pair<double,double>pdd;
using namespace std;
#define MAX  999999
int main(){
	double tiya,rize;
	while(cin>>tiya>>rize){
		 if(tiya<35.5&&rize<71)
			cout<<"AAA"<<endl;
		else if(tiya<37.5&&rize<77)
			cout<<"AA"<<endl;
		else if(tiya<40&&rize<83)
			cout<<"A"<<endl;
		else if(tiya<43.0&&rize<89)
			cout<<"B"<<endl;
		else if(tiya<50&&rize<105)
			cout<<"C"<<endl;
		else if(tiya<55&&rize<116)
			cout<<"D"<<endl;
		else if(tiya<70&&rize<148)
			cout<<"E"<<endl;
		else cout<<"NA"<<endl;
	}
}

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

int main(){
	double s,l;
	while(cin>>s>>l){
		if(s<35.5 && l<71)cout<<"AAA";
		else if(s<37.5 && l<60*1+17)cout<<"AA";
		else if(s<40.0 && l<60*1+23)cout<<"A";
		else if(s<43.0 && l<60*1+29)cout<<"B";
		else if(s<50.0 && l<60*1+45)cout<<"C";
		else if(s<55.0 && l<60*1+56)cout<<"D";
		else if(s<70.0 && l<50*2+28)cout<<"E";
		else cout<<"NA";
		cout<<endl;
	}

}

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

int main(){
	double inp1,inp2;
	while(cin >> inp1 >> inp2){
		string opt="NA";
		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 <iostream>
#include <string>
using namespace std;

int main()
{
	double t1, t2;
	string s;

	while (cin >> t1 >> t2)
	{
		if (t1 < 35.50 && t2 < 60 + 11) s = "AAA";
		else if (t1 < 37.50 && t2 < 60 + 17) s = "AA";
		else if (t1 < 40.0 && t2 < 60 + 23) s = "A";
		else if (t1 < 43.0 && t2 < 60 + 29) s = "B";
		else if (t1 < 50.0 && t2 < 60 + 45) s = "C";
		else if (t1 < 55.0 && t2 < 60 + 56) s = "D";
		else if (t1 < 60 + 10 && t2 < 60 * 2 + 28) s = "E";
		else s = "NA";

		cout << s << endl;
	}
}