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 <cstdio>

using namespace std;

int main(void) {
    double a, b;
    while (scanf("%lf %lf", &a, &b) != EOF) {
        if (a < 35.5 && b < 61.0) {
            puts("AAA");
        } else if (a < 37.5 && b < 77.0) {
            puts("AA");
        } else if (a < 40.0 && b < 83.0) {
            puts("A");
        } else if (a < 43.0 && b < 89.0) {
            puts("B");
        } else if (a < 50.0 && b < 105.0) {
            puts("C");
        } else if (a < 55.0 && b < 116.0) {
            puts("D");
        } else if (a < 70.0 && b < 148.0) {
            puts("E");
        } else {
            puts("NA");
        }
    }
    return 0;
}

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

int grade500m(double t1) {
  if(t1 < 35.50)
    return 0;
  if(t1 < 37.50)
    return 1;
  if(t1 < 40.00)
    return 2;
  if(t1 < 43.00)
    return 3;
  if(t1 < 50.00)
    return 4;
  if(t1 < 55.00)
    return 5;
  if(t1 < 70.00)
    return 6;

  return 7;
}

int grade1000m(double t2) {
  if(t2 < 71.00)
    return 0;
  if(t2 < 77.00)
    return 1;
  if(t2 < 83.00)
    return 2;
  if(t2 < 89.00)
    return 3;
  if(t2 < 105.00)
    return 4;
  if(t2 < 116.00)
    return 5;
  if(t2 < 148.00)
    return 6;

  return 7;
}

int main() {
  double t1,t2;
  while(cin >> t1 >> t2) {
    int rank1 = grade500m(t1);
    int rank2 = grade1000m(t2);
    int rank = max(rank1,rank2);
    if(rank == 0)
      cout << "AAA" << endl;
    if(rank == 1)
      cout << "AA" << endl;
    if(rank == 2)
      cout << "A" << endl;
    if(rank == 3)
      cout << "B" << endl;
    if(rank == 4)
      cout << "C" << endl;
    if(rank == 5)
      cout << "D" << endl;
    if(rank == 6)
      cout << "E" << endl;
    if(rank == 7)
      cout << "NA" << endl;
  }
}

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

	double a,b;
	while(cin>>a>>b){

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

		cout << "AAA";
		}

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

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

		cout << "A";
		}

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

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

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

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

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

int main() {
    double a, b;
    while (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 << "D" << endl;
        else cout << "NA" << endl;
    }

    return 0;
}

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

int main(){
	double a, b;
	
	while(1){
	cin >> a >> b;
	    if(a<35.50 && b< 71.00) cout << "AAA";
        else if(a<37.50 && b< 77.00) cout << "AA";
        else if(a<40.00 && b< 83.00) cout << "A";
        else if(a<43.00 && b< 89.00) cout << "B";
        else if(a<50.00 && b<105.00) cout << "C";
        else if(a<55.00 && b<116.00) cout << "D";
        else if(a<70.00 && b<148.00) cout << "E";
        else                         cout << "NA";
        cout << endl;
	}
	
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    double t1, t2;

    while (cin >> t1 >> t2) {
        if (t1 < 35.5 && t2 < 71.0)
            puts("AAA");
        else if (t1 < 37.5 && t2 < 77.0)
            puts("AA");
        else if (t1 < 40.0 && t2 < 83.0)
            puts("A");
        else if (t1 < 43.0 && t2 < 89.0)
            puts("B");
        else if (t1 < 50.0 && t2 < 105.0)
            puts("C");
        else if (t1 < 55.0 && t2 < 116.0)
            puts("D");
        else if (t1 < 70.0 && t2 < 148.0)
            puts("E");
        else
            puts("NA");
    }
}

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

int main()
{
    double ft,st;
    while(cin>>ft>>st)
    {
        int fr=0,sr=0;
        if(ft<70.0)fr++;
        if(ft<55.0)fr++;
        if(ft<50.0)fr++;
        if(ft<43.0)fr++;
        if(ft<40.0)fr++;
        if(ft<37.5)fr++;
        if(ft<35.5)fr++;
        if(st<148.0)sr++;
        if(st<116.0)sr++;
        if(st<105.0)sr++;
        if(st<89.0)sr++;
        if(st<83.0)sr++;
        if(st<77.0)sr++;
        if(st<71.0)sr++;
        int r;
        r=min(fr,sr);
        if(r==0)cout<<"NA"<<endl;
        if(r==1)cout<<"E"<<endl;
        if(r==2)cout<<"D"<<endl;
        if(r==3)cout<<"C"<<endl;
        if(r==4)cout<<"B"<<endl;
        if(r==5)cout<<"A"<<endl;
        if(r==6)cout<<"AA"<<endl;
        if(r==7)cout<<"AAA"<<endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float t,t1;
	scanf("%f %f",&t,&t1);
	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<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*100),q=(int)(b*100);
        int gp,gq;
        if(p<3550)gp=0;
        else if(p<3750)gp=1;
        else if(p<4000)gp=2;
        else if(p<4300)gp=3;
        else if(p<5000)gp=4;
        else if(p<5500)gp=5;
        else if(p<7000)gp=6;
        else gp=7;

        if(q<7100)gq=0;
        else if(q<7700)gq=1;
        else if(q<8300)gq=2;
        else if(q<8900)gq=3;
        else if(q<10500)gq=4;
        else if(q<11600)gq=5;
        else if(q<14800)gq=6;
        else gq=7;
        int g=max(gp,gq);
        cout<<G[g];
    }

}