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

int main()
{
    double ft,st;
    while(cin>>ft>>st)
    {
        int fr=0,sr=0;
        if(ft<70.00)fr++;
        if(ft<55.00)fr++;
        if(ft<50.00)fr++;
        if(ft<43.00)fr++;
        if(ft<40.00)fr++;
        if(ft<37.50)fr++;
        if(ft<35.50)fr++;
        if(sr<148.00)sr++;
        if(sr<116.00)sr++;
        if(sr<105.00)sr++;
        if(sr<89.00)sr++;
        if(sr<83.00)sr++;
        if(sr<77.00)sr++;
        if(sr<71.00)sr++;
        int r;
        r=min(fr,sr);
        if(r==0)cout<<"NA"<<endl;
        if(r==1)cout<<'E'<<endl;
        if(r==2)cout<<'D'<<endl;
        if(r==3)cout<<'C'<<endl;
        if(r==4)cout<<'B'<<endl;
        if(r==5)cout<<'A'<<endl;
        if(r==6)cout<<"AA"<<endl;
        if(r==7)cout<<"AAA"<<endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main()
{
	double t500,t1000;
	int i,j;
	int r500,r1000;
	int re;
	while(scanf("%lf",&t500)!=EOF){
		scanf("%lf",&t1000);
		if	   (t500<35.50)r500=0;
		else if(t500<37.50)r500=1;
		else if(t500<40.00)r500=2;
		else if(t500<43.00)r500=3;
		else if(t500<50.00)r500=4;
		else if(t500<55.00)r500=5;
		else if(t500<70.00)r500=6;
		else r500=7;
		
		if	   (t1000<71.00)r1000=0;
		else if(t1000<77.00)r1000=1;
		else if(t1000<83.00)r1000=2;
		else if(t1000<89.00)r1000=3;
		else if(t1000<105.00)r1000=4;
		else if(t1000<116.00)r1000=5;
		else if(t1000<148.00)r1000=6;
		else r1000=7;
		
		if(r500<r1000)re=r1000;
		else if(r500>r1000)re=r500;
		else if(r500==r1000)re=r500;
		
		switch(re){
			case 0:
				puts("AAA");
				break;
			case 1:
				puts("AA");
				break;
			case 2:
				puts("A");
				break;
			case 3:
				puts("B");
				break;
			case 4:
				puts("C");
				break;
			case 5:
				puts("D");
				break;
			case 6:
				puts("E");
				break;
			case 7:
				puts("NA");
				break;
			default :
				break;
		}
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
  int t1,t2;
  while(1){
  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");   
  }
}
}

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

string solve(double a, double b){
    if(a < 35.5 && b <  71.0) return "AAA";
    if(a < 37.5 && b <  77.0) return "AA";
    if(a < 40.0 && b <  83.0) return "A";
    if(a < 43.0 && b <  89.0) return "B";
    if(a < 50.0 && b < 105.0) return "C";
    if(a < 55.0 && b < 116.0) return "D";
    if(a < 70.0 && b < 148.0) return "E";
    return "NA";
}

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

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

int main() {
  double data[7][2] = {{35.50, 71.0},
		       {37.50, 77.0},
		       {40.0 , 83.0},
		       {43.0 , 89.0},
		       {50.0 , 105.0},
		       {55.0 , 116.0},
		       {70.0 , 148.0}};
  string level[7] = {"AAA", "AA", "A", "B", "C", "D", "E"};
  double t500, t1000;
  while(cin >> t500 >> t1000) {
    for(int i = 0; i < 7; i++) {
      if(t500 < data[i][0] && t1000 < data[i][1]) {
	cout << level[i] << endl;
	break;
      }
      if(i+1 == 7) cout << "NA" << endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
	double time1, time2;
	while(scanf("%lf %lf",&time1,&time2) != EOF){
		if(time1<35.50 && time2<71.00){
			cout<<"AAA"<<endl;
		}else if(time1<37.50 && time2<77.00){
			cout<<"AA"<<endl;
		}else if(time1<40.00 && time2<83.00){
			cout<<"A"<<endl;
		}else if(time1<43.00 && time2<89.00){
			cout<<"B"<<endl;
		}else if(time1<50.00 && time2<105.00){
			cout<<"C"<<endl;
		}else if(time1<55.00 && time2<116.00){
			cout<<"D"<<endl;
		}else if(time1<70.00 && time2<148.00){
			cout<<"E"<<endl;
		}else{
			cout<<"NA"<<endl;
		}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
long i,j;
double a,b,aa[7]={35.5,37.5,40,43,50,55,70},bb[7]={71,77,83,89,105,116,148};
while(cin>>a>>b){
for(i=0;i<7;i++)if(a<aa[i])break;j=i;
for(i=j;i<7;i++)if(b<bb[i])break;
if(i==0)cout<<"AA";
if(i==1)cout<<"A";
cout<<"AAABCDEN"[i];
if(i==7)cout<<"A";
cout<<endl;
}
return 0;
}

C++: #include<cstdio>
#include<string>
main(){
        using namespace std;
        int i,j;
        string lv[8] = {"AAA","AA","A","B","C","D","E","NA"};
        double lvd5[7] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0};
        int lvd1[7] = {71,77,83,89,105,116,148};
        double ind1,ind2;
        while(~scanf("%lf %lf",&ind1,&ind2)){
                i = j = 0;
                while(i<7){
                        if(ind1 < lvd5[i])
                                break;
                        i++;
                }
                while(j<7){
                        if(ind2 < lvd1[j])
                                break;
                        j++;
                }
                printf("%s\n", i <= j ? lv[i].c_str() : lv[j].c_str());
        }
        return 0;
}

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

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

double a,b;

int main(){
  while(cin>>a>>b){
    for(int i=0;i<8;i++){
      if(a<t[i]&&b<u[i]){cout<<str[i]<<endl;break;}
    }
  }
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
    float masatoy1, masatoy2, koutay1, koutay2, a, b;
    scanf("%f %f", &masatoy1, &koutay1);
    if (masatoy1 <= 35.5&&koutay1 <= 71.0) {
        printf("AAA\n");
    }
    else if (masatoy1 <=37.5&&koutay1 <77.0) {
        printf("AA\n");
    }
    else if (masatoy1 < 40.0&&koutay1 < 83.0) {
        printf("A\n");
    }
    else if (masatoy1 < 43.0&&koutay1 < 89.0) {
        printf("B\n");
    }
    else if (masatoy1 < 50.0&&koutay1 <=105.0) {
        printf("C\n");
    }
    else if (masatoy1 < 55.0&&koutay1 < 116.0) {
        printf("D\n");
    }
    else if (masatoy1 < 70.0&&koutay1 < 148.0) {

        printf("E\n");
    }
    else {
        printf("NA\n");
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int main(){
  string ans[8]={"AAA","AA","A","B","C","D","E","NA"};
  double a,b;
  while(cin>>a>>b){
    int aa,bb;
    if(a<35.50)aa=0;
    else if(a<37.50)aa=1;
    else if(a<40.00)aa=2;
    else if(a<43.00)aa=3;
    else if(a<50.00)aa=4;
    else if(a<55.00)aa=5;
    else if(a<70.00)aa=6;
    else aa=7;
    if(b<71.00)bb=0;
    else if(b<77.00)bb=1;
    else if(b<83.00)bb=2;
    else if(b<89.00)bb=3;
    else if(b<105.00)bb=4;
    else if(b<116.00)bb=5;
    else if(b<148.00)bb=6;
    else bb=7;
    int res=max(aa,bb);
    cout<<ans[res]<<endl;
  }
}