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 <iostream>
#include <string>

using namespace std;

int main(){
	double m[] = {70.0,55.0,50.0,43.0,40.0,37.5,35.5};
	double mm[] = {148.0,116.0,105.0,89.0,83.0,77.0,71.0};
	string award[] = {"NA","E","D","C","B","A","AA","AAA"};
	double t,tt;
	
	while(cin >> t >> tt){
	int g1,g2,min;
	if(m[0] <= t) g1 = -1;
	else {
		for(int i=0;i < 6;i++){
			if(m[i] > t && m[i+1] <= t) g1 = i;
		}
		if(t < m[6]) g1 =6;
	}
	if(mm[0] <= tt) g2 = -1;
	else {
		for(int i=0;i < 6;i++){
			if(mm[i] > tt && mm[i+1] <= tt) g2 = i;
		}
		if(tt < mm[6]) g2 =6;
	}
	if(g1 > g2) min = g2;
	else min = g1;
	cout << award[min+1] << endl;
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    double time[2];
    while(cin>>time[0]>>time[1]){
        if(time[0]<35.5&&time[1]<71)cout<<"AAA\n";
        else if(time[0]<37.5&&time[1]<77)cout<<"AA\n";
        else if(time[0]<40.0&&time[1]<83)cout<<"A\n";
        else if(time[0]<43.0&&time[1]<89)cout<<"B\n";
        else if(time[0]<50.0&&time[1]<105)cout<<"C\n";
        else if(time[0]<55.0&&time[1]<116)cout<<"D\n";
        else if(time[0]<70&&time[1]<148)cout<<"E\n";
        else cout<<"NA\n";
    }
}

C++: #include<stdio.h>
int main()
{
    float hideo, ruio;
    while (scanf("%f %f", &hideo, &ruio)) {
        if (hideo < 35.50 && ruio < 71.00) {
            printf("AAA\n");
        }
        else if (hideo < 37.50 && ruio < 77.00) {
            printf("AA\n");
        }
        else if (hideo < 40.00 && ruio < 83.00) {
            printf("A\n");
        }
        else if (hideo < 43.00 && ruio < 89.00) {
            printf("B\n");
        }
        else if (hideo < 50.00 && ruio < 105.00) {
            printf("C\n");
        }
        else if (hideo < 55.00 && ruio < 116.00) {
            printf("D\n");
        }
        else if (hideo < 70.00 && ruio < 148.00) {
            printf("E\n");
        }
        else {
            printf("NA\n");
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	double a, b;
	while (cin >> a >> b){
		if (a < 35.5 && b < 71)cout << "AAA";
		else if (a < 37.5 && b < 77)cout << "AA";
		else if (a < 40 && b < 83)cout << "A";
		else if (a < 43 && b < 89)cout << "B";
		else if (a < 50 && b < 105)cout << "C";
		else if (a < 55 && b < 116)cout << "D";
		else if (a < 70 && b < 148)cout << "E";
		else cout << "NA";
		cout << endl;
	}
}

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<95.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 <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< pairint , string> P;
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.first.first!= secondElof.first.first)    return firstElof.first.first< secondElof.first.first;
else if(firstElof.first.second != secondElof.first.second)    return firstElof.first.second< secondElof.first.second;
else return false;
}
signed main() {
double x=0,y=0,z=0,w=0,n=0,m=0;
int a[4]={0,0,0,0},b[4]={0,0,0,0};
while(std::cin >> x>>y){
if(35.50>x&&71>y)std::cout << "AAA" << '\n';
else if(37.50>x&&77>y)std::cout << "AA" << '\n';
else if(40>x&&83>y)std::cout << "A" << '\n';
else if(43>x&&89>y)std::cout << "B" << '\n';
else if(50>x&&105>y)std::cout << "C" << '\n';
else if(55>x&&116>y)std::cout << "D" << '\n';
else if(70>x&&148>y)std::cout << "E" << '\n';
else std::cout << "NA" << '\n';
}
}

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;gm[1]=37.5;gm[2]=40;gm[3]=43;gm[4]=50;gm[5]=55;gm[6]=70;
  sm[0]=71;sm[1]=77;sm[2]=83;sm[3]=89;sm[4]=105;sm[5]=116;sm[6]=148;
  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 <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 << "E" << endl;
        else cout << "NA" << endl;
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
char c[8][8];
int main(){
while(cin>>a>>b){
for(int i=0;i<64;i++)cin>>c[i/8][i%8];
cout<<90<<endl;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
cout<<c[7-j][i];
}
cout<<endl;
}
cout<<180<<endl;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
cout<<c[7-i][7-j];
}
cout<<endl;
}
cout<<270<<endl;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
cout<<c[j][7-i];
}
cout<<endl;
}
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

const float m500[] = {
  35.5f, 37.5f, 40.0f, 43.0f, 50.0f, 55.0f, 70.0f, (float)(1<<30)
};
const float m1k[] = {
  71.0f, 77.0f, 83.0f, 89.0f, 105.f, 116.f, 148.0f, (float)(1<<30)
};
const string rank[] = {
  "AAA", "AA", "A", "B", "C", "D", "E", "NA"
};

int main() {
  const int sz = 8;
  float l, r;
  while (cin >> l >> r) {
    int ll = upper_bound(m500, m500 + sz, l) - m500;
    int rl = upper_bound(m1k, m1k + sz, r) - m1k;
    cout << rank[max(rl,ll)] << endl;
  }
  return 0;
}