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>

using namespace std;

int main(void){

  double m500,m1000;

  while( cin >> m500 >> m1000 ){

    if( m500 < 35.5 && m1000 < 71 ) cout << "AAA" << endl;
    else if( m500 < 37 && m1000 < 77 ) cout << "AA" << endl;
    else if( m500 < 40 && m1000 < 83 ) cout << "A" << endl;
    else if( m500 < 43 && m1000 < 89 ) cout << "B" << endl;
    else if( m500 < 50 && m1000 < 105 ) cout << "C" << endl;
    else if( m500 < 55 && m1000 < 116 ) cout << "D" << endl;
    else if( m500 < 70 && m1000 < 148 ) cout << "E" << endl;
    else cout << "NA" << endl;

  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	double a, b;
	while (cin >> a >> b){
		if (a < 35.5 && b < 61)cout << "AAA";
		else if (a < 37.5 && b < 67)cout << "AA";
		else if (a < 40 && b < 73)cout << "A";
		else if (a < 43 && b < 79)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 <iostream>
#include <string>
using namespace std;

int main(){
	double tim1[] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0},tim2[] = {71.0,77.0,83.0,89.0,105.0,116.0,148.0};
	string rnk[] = {"AAA","AA","A","B","C","D","E"};
	double t1,t2;
	while(cin >> t1 >> t2){
		int i = 0;
		for(;i < 7;i++){
			if(t1 < tim1[i] && t2 < tim2[i]) break;
		}
		if(i == 7) cout << "NA" << endl;
		else cout << rnk[i] << endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	float q,p,c=0;
	while(c!=2){
		cin >> q >> p;
		if(35.50>=q&&71.00>=p)cout << "AAA";
		else if(37.50>=q&&77.00>=p)cout << "AA";
		else if(40.00>=q&&83.00>=p)cout << 'A';
		else if(43.00>=q&&89.00>=p)cout << 'B';
		else if(50.00>=q&&105.00>=p)cout << 'C';
		else if(55.00>=q&&116.00>=p)cout <<'D';
		else if(70.00>=q&&148.00>=p)cout <<'E';
		else {
			cout << "NA";
		}
		c++;
	}
	return 0;
}