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<vector>
#include<algorithm>
#include<cstdio>
#include<map>
using namespace std;
int main(){
    string G[8]={
        "AAA",
        "AA",
        "A",
        "B",
        "C",
        "D",
        "E",
        "NA",
    };
    double a,b;
    while(cin>>a>>b){
        int p=(int)(a*1000),q=(int)(b*1000);
        int gp,gq;
        if(p<35500)gp=0;
        else if(p<37500)gp=1;
        else if(p<40000)gp=2;
        else if(p<43000)gp=3;
        else if(p<50000)gp=4;
        else if(p<55000)gp=5;
        else if(p<70000)gp=6;
        else gp=7;

        if(q<71000)gq=0;
        else if(q<77000)gq=1;
        else if(q<83000)gq=2;
        else if(q<89000)gq=3;
        else if(q<105000)gq=4;
        else if(q<116000)gq=5;
        else if(q<148000)gq=6;
        else gq=7;
        int g=max(gp,gq);
        cout<<G[g]<<endl;
    }

}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double t1,t2;
  double gm[7],sm[7];
  string ans[8]={"AAA","AA","A","B","C","D","E","NA"};
  gm[0]=35.5;gm[1]=37.5;gm[2]=40.0;gm[3]=43.0;gm[4]=50.0;gm[5]=55.0;gm[6]=70.0;
  sm[0]=71.0;sm[1]=77.0;sm[2]=83.0;sm[3]=89.0;sm[4]=105.0;sm[5]=116.0;sm[6]=148.0;
  while(cin>>t1>>t2){
    int i;
    for(i=0;i<7;i++){
      if(gm[i]>t1&&sm[i]>t2)
	break;
    }
    cout<<ans[i]<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
  double a, b;
  double A[]={35.50,37.50,40.00,43.00,50.00,55.00,70.00};
  double B[]={71,77,83,89,105,116,148};
  string C[]={"AAA","AA","A","B","C","D","E","NA"};
  while(cin >> a >> b) {
    int i;
    for(i=0; i<7; i++) {
      if(a<A[i] && b<B[i]) { break; }
    }
    cout << C[i] << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<set>
#include<queue>

using namespace std;

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

const double EPS = 1e-9;
int main(){

	string rank[8] = {"AAA","AA","A","B","C","D","E","NA"};
	double time500[8] = {35.50,37.50,40.00,43.00,50.00,55.00,70.00,0};
	double time1000[8] = {71.00,77.00,83.00,89.00,105.00,116.00,148.00,0};

	double n,m;
	while(cin>>n>>m){
		
		int r,rr;
		for(r=0;r<7;r++){
			if(n-time500[r] < -EPS)break;
		}
		for(rr = 0;rr<7;rr++){
			if(m-time1000[rr] < -EPS)break;
		}

		cout<<rank[max(r,rr)]<<endl;

	}

	return 0;
}

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