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>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  double a,b;
  double h[2][8]={
    {70,55,50,43,40,37,35,-1},
    {148,116,105,89,83,77,71,-1}
  };
  string s[8]={"NA","E","D","C","B","A","AA","AAA"};
  while(cin>>a>>b){
    int i;
    rep(i,8)if(a>=h[0][i]||b>=h[1][i])break;
      cout<<s[i]<<endl;
  }
}

C++: #include<iostream>
using namespace std;
int main(){
	float a,b;
	while(cin>>a>>b){
		if(a<35.5&&b<71.0){
			cout<<"AAA"<<endl;
		}
		else if(a<37.5&&b<77.0){
			cout<<"AA"<<endl;
		}
		else if(a<40.0&&b<83.0){
			cout<<'A'<<endl;
		}
		else if(a<43.0&&b<89.0){
			cout<<'B'<<endl;
		}
		else if(a<50.0&&b<105.0){
			cout<<'C'<<endl;
		}
		else if(a<55.0&&b<116.0){
			cout<<'D'<<endl;
		}
		else if(a<70.0&&b<148.0){
			cout<<'E'<<endl;
		}
		else{
			cout<<"NA"<<endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
	double a,b;
	while(scanf("%lf%lf",&a,&b)!=EOF){
		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>
using namespace std;
int main(){
		double l[7][2];
		l[0][0]=35.5;l[0][1]=71;l[1][0]=37.5;l[1][1]=77;
		l[2][0]=40;l[2][1]=83;l[3][0]=43;l[3][1]=89;
		l[4][0]=50;l[4][1]=105;l[5][0]=55;l[5][1]=116;
		l[6][0]=70;l[6][1]=148;
		string c[7];
		c[0]="AAA";c[1]="AA";c[2]="A";c[3]="B";c[4]="C";c[5]="D";c[6]="E";
		double a,b;
		while(cin>>a>>b){
			string d;
			for(int i=0;i<7;i++){
				if(a<l[i][0]&&b<l[i][1]){
					d=c[i];
					goto stop;
				}
			}
			d="NA";
			stop:;
			cout<<d<<endl;
		}
	}

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

int main() {
	double s, g;
	string out;
	scanf(" %lf %lf", &s, &g);
	if(s < 35.50 && g < 71.00) out = "AAA";
	else if(s < 37.0 && g < 77.00) out = "AA";
	else if(s < 40.0 && g < 83.00) out = "A";
	else if(s < 43.0 && g < 89.00) out = "B";
	else if(s < 50.0 && g < 105.00) out = "C";
	else if(s < 55.0 && g < 116.00) out = "D";
	else if(s < 70.0 && g < 148.00) out = "E";
	else out = "NA";
	printf("%s\n", out.c_str());
	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<3500)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.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 <iostream>
using namespace std;

int main()
{

	double time5, time10;

	while( cin >> time5 >> time10 ) {

		if( time5 < 35.50 && time10 < 71.00 ) cout << "AAA";
		else if( time5 < 37.50 && time10 < 77.00 ) cout << "AA";
		else if( time5 < 40.00 && time10 < 83.00 ) cout << "A";
		else if( time5 < 43.00 && time10 < 89.00 ) cout << "B";
		else if( time5 < 50.00 && time10 < 105.00 ) cout << "C";
		else if( time5 < 55.00 && time10 < 116.00 ) cout << "D";
		else if( time5 < 70.00 && time10 < 148.00 ) cout << "E";
		else cout << "NA";

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

C++: #include <stdio.h>
int main()
{
	float n500,n1000;
	while(scanf("%f %f",&n500,&n1000)!=EOF){
		if(n500<35.5&&n1000<71)
			printf("AAA\n");
		else if(n500<37.5&&n1000<77)
			printf("AA\n");
		else if(n500<40&&n1000<83)
			printf("A\n");
		else if(n500<43&&n1000<89)
			printf("B\n");
		else if(n500<50&&n1000<105)
			printf("C\n");
		else if(n500<55&&n1000<116)
			printf("D\n");
		else if(n500<70.002&&n1000<148)
			printf("E\n");
		else
			printf("NA\n");
	}
}

C++: #include <iostream>

// AAA=0, AA=1, A=2, B=3, C=4, D=5, E=6, NA=7
int getClass500(float t)
{
	if (t < 35.50) return 0;
	else if (t < 37.50) return 1;
	else if (t < 40.00) return 2;
	else if (t < 43.00) return 3;
	else if (t < 50.00) return 4;
	else if (t < 55.00) return 5;
	else if (t < 70.00) return 6;
	else return 7;
}

int getClass1000(float t)
{
	if (t < 71.00) return 0;
	else if (t < 77.00) return 1;
	else if (t < 83.00) return 2;
	else if (t < 89.00) return 3;
	else if (t < 105.00) return 4;
	else if (t < 116.00) return 5;
	else if (t < 148.00) return 6;
	else return 7;
}

int main()
{
	float t1, t2;
	while (std::cin >> t1 >> t2) {
		int c1 = getClass500(t1);
		int c2 = getClass1000(t2);
		int c = std::max(c1, c2);
		switch (c) {
		case 0:
			std::cout << "AAA" << std::endl; break;
		case 1:
			std::cout << "AA" << std::endl; break;
		case 2:
			std::cout << "A" << std::endl; break;
		case 3:
			std::cout << "B" << std::endl; break;
		case 4:
			std::cout << "C" << std::endl; break;
		case 5:
			std::cout << "D" << std::endl; break;
		case 6:
			std::cout << "E" << std::endl; break;
		case 7:
			std::cout << "NA" << std::endl; break;
		}
	}
	return 0;
}