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;
typedef long long ll;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define REP(i,a,n) for(ll i=n;i>a;i--)
int main(void){
    double t_1,t_2;
    ll num1,num2;
    double judge_500[7]={35.50,37.50,40.00,43.00,50.00,55.00,70.00};
    double judge_1000[7]={71.00,77.00,83.00,89.00,105.00,116.00,148.00};
    string rank[8]={"AAA","AA","A","B","C","D","E","NA"};
    rep(j,0,100){
        t_1 = -1;
        t_2 = -1;
        num1=-1;
        num2=-1;
        cin>>t_1>>t_2;
        rep(i,0,7){
            if(t_1<judge_500[i]){
                num1=i;
                break;
            }
        }
        rep(i,0,7){
            if(t_2<judge_1000[i]){
                num2=i;
                break;
            }
        }
        if(num1==-1)num1=7;
        if(num2==-1)num2=7;
        
        if(t_1 == -1 && t_2 == -1) break;
        cout<<rank[max(num1,num2)]<<endl;
        
    }
    
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    double a, b;
    int l, r;
    while(cin >> a >> b){
        if(a < 35.50){
            l = 1;
        }else if(a < 37.50){
            l = 2;
        }else if(a < 40.00){
            l = 3;
        }else if(a < 43.00){
            l = 4;
        }else if(a < 50.00){
            l = 5;
        }else if(a < 55.00){
            l = 6;
        }else if(a < 70.00){
            l = 7;
        }else{
            l = 8;
        }
        if(b < 71.00){
            r = 1;
        }else if(b < 77.00){
            r = 2;
        }else if(b < 83.00){
            r = 3;
        }else if(b < 89.00){
            r = 4;
        }else if(b < 105.00){
            r = 5;
        }else if(b < 116.00){
            r = 6;
        }else if(148.00){
            r = 7;
        }else{
            r = 8;
        }
        int ans = max(l,r);
        if(ans == 1)
            cout << "AAA" << endl;
        if(ans == 2)
            cout << "AA" << endl;
        if(ans == 3)
            cout << "A" << endl;
        if(ans == 4)
            cout << "B" << endl;
        if(ans == 5)
            cout << "C" << endl;
        if(ans == 6)
            cout << "D" << endl;
        if(ans == 7)
            cout << "E" << endl;
        if(ans == 8)
            cout << "NA" << endl;
    }
}

C++: #include <iostream>
#include<iomanip>
#include<algorithm>
#define shosu(x) fixed<<setprecision(x)
using namespace std;

double x,y;

int main(){
	while(cin>>x>>y){
		if(x<35&&y<71) cout<<"AAA"<<endl;
		else{
			if(x<37&&y<77) cout<<"AA"<<endl;
			else{
				if(x<40&&y<83) cout<<"A"<<endl;
				else{
					if(x<43&&y<89) cout<<"B"<<endl;
					else{
						if(x<50&&y<105) cout<<"C"<<endl;
						else{
							if(x<55&&y<116) cout<<"D"<<endl;
							else{
								if(x<70&&y<148) cout<<"E"<<endl;
								else cout<<"NA"<<endl;
							}
						}
					}
				}
			}
		}
	}
}

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

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

int main() {
  while(cin >> a >> b) {
    int ra, rb;
    for(ra = 0; ra < 7 && !(a < A[ra]); ++ra);
    for(rb = 0; rb < 7 && !(b < B[rb]); ++rb);
        cout << S[max(ra,rb)] << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;
/*
jq	 500M	 1000M
AAA	 35b50	 1ª11b00
AA	 37b50	 1ª17b00
A	 40b00	 1ª23b00
B	 43b00	 1ª29b00
C	 50b00	 1ª45b00
D	 55b00	 1ª56b00
E	1ª10b00	2ª28b00
*/
int main()
{
	const double t500m[] = { 
		0.00, 35.50, 37.50, 40.00, 43.00, 50.00, 55.00, 70.00, DBL_MAX };
	const double t1000m[] = {
		0.00, 71.00, 77.00, 83.00, 89.00, 105.00, 116.00, 148.00, DBL_MAX };
	const string cname[] = { "AAA", "AA", "A", "B", "C", "D", "E", "NA" };

//	cut here before submit 
//	freopen ("testcase.speedskat", "r", stdin );

	string str = "";
	int i,j;
	while (getline (cin, str ) ){
		double time1, time2;
		stringstream ss(str);
		ss >> time1 >> time2;

		int c500 = -1;
		int c1000 = -1;
		for (i = 0; i < sizeof(t500m)/sizeof(t500m[0]) - 1; ++i){
			if (time1 >= t500m[i] && time1 < t500m[i+1] ){
				c500 = i;
				break;
			} // end if
		} // end for

		for (j = 0; j < sizeof(t1000m)/sizeof(t1000m[0]) - 1; ++j){
			if (time2 >= t1000m[j] && time2 < t1000m[j+1] ){
				c1000 = j;
				break;
			} // end if
		} // end for

		int decide_class = max (c500, c1000);
		cout << cname[decide_class] << endl;

	} // end loop
		
	return 0;
}

C++: /*
#include<stdio.h>
#include<iostream>
#include<string>
using namespace std;

struct IND{string str,int page;};
int main()
{

struct IND N1[101]={};
string R;
int x,i=0;
while(scanf("%s %d",&R,&x)!=EOF){
N1[i].str=R;N1[i].page=x;i++;
}
for(int j=0;j<i;j++)
{
	for(int k=i;k>=j;k--)
	{
	*/
#include<stdio.h>
#include<iostream>
using namespace std;
void TR(double x,double y,int K,int H)
{

double t;
t=x*100;
if(t<3550)K=0;
else if(t<3550)K=0;
else if(t<3750)K=1;
else if(t<4000)K=2;
else if(t<4300)K=3;
else if(t<5000)K=4;
else if(t<5500)K=5;
else if(t<7000)K=6;
else if(t>=7000)K=7;

t=y*100;
if(t<3550)K=0;
else if(t<7100)H=0;
else if(t<7700)H=1;
else if(t<8300)H=2;
else if(t<8900)H=3;
else if(t<10500)H=4;
else if(t<11600)H=5;
else if(t<14800)H=6;
else if(t>=14800)H=7;
cout<<t;
}



int main(){
int K=0,H=0;
double x,y;
while(scanf("%lf %lf",&x,&y)!=EOF)
{K=0,H=0;

//TR(x,y,K,H);cout<<H<<K;
double t=0;
double X;
t=x*100;//t=(int)X;

if(t<3550)K=0;
else if(t<3550)K=0;
else if(t<3750)K=1;
else if(t<4000)K=2;
else if(t<4300)K=3;
else if(t<5000)K=4;
else if(t<5500)K=5;
else if(t<7000)K=6;
else if(t>=7000)K=7;

t=y*100;//t=(int)X;
if(t<3550)K=0;
else if(t<7100)H=0;
else if(t<7700)H=1;
else if(t<8300)H=2;
else if(t<8900)H=3;
else if(t<10500)H=4;
else if(t<11600)H=5;
else if(t<14800)H=6;
else if(t>=14800)H=7;


if(H<K)H=K;

switch(H){
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;
}