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

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