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>
using namespace std;

float half[7] = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
float full[7] = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
string rank[8] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

int main(){
	float t1, t2;
	int i, j;
	
	while(cin >> t1 >> t2){
		
		for(i = 0; i < 7; ++i){
			if(t1 < half[i]) break;
		}
		
		for(j = 0; j < 7; ++j){
			if(t2 < full[j]) break;
		}
		cout << rank[max(i, j)] << endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main(void)
{
	float a,b;
	while(1){
	if( -1 == scanf("%f %f",&a,&b) )
		break ;
	
	if(a<35.50&&b<71.00){
		printf("AAA\n");
	}
	else if(a<37.50&&b<77.00){
		printf("AA\n");
	}
	else if(a<40.00&&b<83.00){
		printf("A\n");
	}
	else if(a<43.00&&b<89.00){
		printf("B\n");
	}
	else if(a<50.00&&b<105.00){
		printf("C\n");
	}
	else if(a<55.00&&b<116.00){
		printf("D\n");
	}
	else if(a<70.00&&b<148.00){
		printf("E\n");
	}
	else{
		printf("NA\n");
	}
	}
	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>
#include <algorithm>
using namespace std;

int cnt_500(double f){
    
    if(f < 35.5) return 1;
    else if(f < 37.5) return 2;
    else if(f < 40) return 3;
    else if(f < 43) return 4;
    else if(f < 50) return 5;
    else if(f < 55) return 6;
    else if(f < 70) return 7;
    
    return 8;
}

int cnt_1000(double t){
    if(t < 71) return 1;
    else if(t < 77) return 2;
    else if(t < 83) return 3;
    else if(t < 89) return 4;
    else if(t < 105) return 5;
    else if(t < 116) return 6;
    else if(t < 148) return 7;
    
    return 8;
}

int main(){
    double f,t;
    
    while(cin >> f >> t){
        int grade = max(cnt_500(f),cnt_1000(t));
        
        switch(grade){
            case 1:
                cout << "AAA" << endl;
                break;
            case 2:
                cout << "AA" << endl;
                break;
            case 3:
                cout << 'A' << endl;
                break;
            case 4:
                cout << 'B' << endl;
                break;
            case 5:
                cout << 'C' << endl;
                break;
            case 6:
                cout << 'D' << endl;
                break;
            case 7:
                cout << 'E' << endl;
                break;
            case 8:
                cout << "NA" << endl;
                break;
        }
        
    }
    
    return 0;
}

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

string judge(int a, int b) {
    if (a < 35.50 && b < 71.00) {
        return "AAA";
    } if (a < 37.50 && b < 77.00) {
        return "AA";
    } if (a < 40.00 && b < 83.00) {
        return "A";
    } if (a < 43.00 && b < 89.00) {
        return "B";
    } if (a < 50.00 && b < 105.00) {
        return "C";
    } if (a < 55.00 && b < 116.00) {
        return "D";
    } if (a < 70.00 && b < 148.00) {
        return "E";
    }
    return "NA";
}

int main() {
    double a, b;
    while (cin >> a >> b) {
        cout << judge(a, b) << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;

int main(void){
  double t500,t1000;
  int r500,r1000,rank;
  while(cin>>t500>>t1000){
    if(t500<35.5)r500=0;
    else if(t500<37.5)r500=1;
    else if(t500<40)r500=2;
    else if(t500<43)r500=3;
    else if(t500<50)r500=4;
    else if(t500<55)r500=5;
    else if(t500<70)r500=6;
    else r500=7;
    if(t1000<71)r1000=0;
    else if(t1000<77)r1000=1;
    else if(t1000<83)r1000=2;
    else if(t1000<89)r1000=3;
    else if(t1000<105)r1000=4;
    else if(t1000<116)r1000=5;
    else if(t1000<148)r1000=6;
    else r1000=7;
    rank=max(r500,r1000);
    switch (rank) {
      case 0:
        cout<<"AAA"<<endl;
        break;
      case 1:
        cout<<"AA"<<endl;
        break;
      case 2:
        cout<<"A"<<endl;
        break;
      case 3:
        cout<<"B"<<endl;
        break;
      case 4:
        cout<<"C"<<endl;
        break;
      case 5:
        cout<<"D"<<endl;
        break;
      case 6:
        cout<<"E"<<endl;
        break;
      case 7:
        cout<<"NA"<<endl;
        break;
    }
  }
  return 0;
}