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

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <climits>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int N, K;

bool cmp(const pii &a, const pii &b){
    if(a.first == b.first) return a.second < b.second;
    return a.first < b.first;
}

struct Edge {
    int to, cost;
    Edge(int to, int cost): to(to), cost(cost) {}
};

typedef vector<vector<Edge>> AdjList;
AdjList graph;

const int INF = 100000000;

vi dist;
int d[110][110];

bool bellman_ford(int n, int s) { // nは頂点数、sは開始頂点
    dist = vector<int>(n, INF);
    dist[s] = 0; // 開始点の距離は0
    for (int i = 0; i < n; i++) {
        for (int v = 0; v < n; v++) {
            for (int u = 0; u < n; u++) {
                if (dist[v] != INF && dist[u] > dist[v] + d[v][u]) {
                    dist[u] = dist[v] + d[v][u];
                    if (i == n - 1) return true; // n回目にも更新があるなら負の閉路が存在
                }
            }
        }
    }
    return false;
}

int main() {
    //cout << fixed << setprecision(15);

    double a, b;
    while(cin >> a >> b){
        a *= 100;
        b *= 100;
        if(a<3500 && b < 7100){
            cout << "AAA" << endl;
        }else if(a < 3700 && b < 7700){
            cout << "AA" << endl;
        }else if(a < 4000 && b < 8300) {
            cout << "A" << endl;
        }else if(a < 4300 && b < 8900) {
            cout << "B" << endl;
        }else if(a < 5000 && b < 10500) {
            cout << "C" << endl;
        }else if(a < 5500 && b < 11600) {
            cout << "D" << endl;
        }else if(a < 7000 && b > 14800) {
            cout << "E" << endl;
        }else cout << "NA" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>

using namespace std;


double a, b;


int main()
{
	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>
#include <iostream>

using namespace std;

int main() {
	double 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(void) {

  double five,ten;


  while(scanf("%lf %lf",&five,&ten)!=EOF) {

    if(five<35.50 && ten<71.00) printf("AAA\n");

    else if(five<37.50 && ten<77.00) printf("AA\n");

    else if(five<40.00 && ten<83.00) printf("A\n");

    else if(five<43.00 && ten<89.00) printf("B\n");

    else if(five<50.00 && ten<95.00) printf("C\n");

    else if(five<55.00 && ten<116.00) printf("D\n");

    else if(five<70.00 && ten<148.00) printf("E\n");

    else printf("NA\n");

  }

  return 0;

}