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

}

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 < 53.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>
#include <stdio.h>
#include <utility>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
    double t5,t10;
	string ans;
	while(cin){
		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;
}