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<stdio.h>
int main(void)
{
	float t,t1;
	scanf("%f %f",&t,&t1);
	if(t<35.50 && t1<71.00){
		printf("AAA");
	}
	else if(t<37.50 && t1<77.00){
		printf("AA");
	}
	else if(t<40.00 && t1<83.00){
		printf("A");
	}
	else if(t<43.00 && t1<89.00){
		printf("B");
	}
	else if(t<50.00 && t1<105.00){
		printf("C");
	}
	else if(t<55.00 && t1<116.00){
		printf("D");
	}
	else if(t<70.00 && t1<148.00){
		printf("E");
	}
	else{
		printf("NA");
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
  int t1,t2;
  
  scanf("%d %d",&t1,&t2);

  if(t1<35.5&&t2<71){
    printf("AAA\n");   
  }else if(t1<37.5&&t2<77){
    printf("AA\n");
  }else if(t1<40&&t2<83){
    printf("A\n");
  }else if(t1<43&&t2<89){
    printf("B\n");
  }else if(t1<50&&t2<105){
    printf("C\n");
  }else if(t1<55&&t2<116){
    printf("D\n");
  }else if(t1<70&&t2<148){
    printf("E\n");
  }else{
    printf("NA\n");   
  }
  return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
double a, b;
double c[7] = { 35.5,37.5,40.0,43.0,50.0,55.0,70.0 };
double d[7] = { 71.0,77.0,83.0,89.0,105.0,116.0,148.0 };
string s[7] = { "AAA","AA","A","B","C","D","E" };
int main() {
	while (cin >> a >> b) {
		for (int i = 0; i < 7; i++) {
			if (a < c[i] && b < d[i]) {
				cout << s[i] << endl; goto E;
			}
		}
		cout << "NA" << endl;
	E:;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
	double m,k;
	while(cin>>m>>k){
		if(m<35.5&&k<71.0)
			cout<<"AAA"<<endl;
		else if(m<37.5&&k<77.0)
			cout<<"AA"<<endl;
		else if(m<40.0&&k<83.0)
			cout<<"A"<<endl;
		else if(m<43.0&&k<89.0)
			cout<<"B"<<endl;
		else if(m<50.0&&k<105.0)
			cout<<"C"<<endl;
		else if(m<55.0&&k<116.0)
			cout<<"D"<<endl;
		else if(m<70.002&&k<148.0)
			cout<<"E"<<endl;
		else
			cout<<"NA"<<endl;
	}
	return 0;
}

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