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>
using namespace std;
int main(){
	double a,b;
	cin>>a>>b;
	if(a<35.50&&b<71.00){
		cout<<"AAA"<<endl;
	}else if(a<37.50&&b<77.00){
		cout<<"AA"<<endl;
	}else if(a<40.00&&b<83.00){
		cout<<"A"<<endl;
	}else if(a<43.00&&b<89.00){
		cout<<"B"<<endl;
	}else if(a<50.00&&b<105.00){
		cout<<"C"<<endl;
	}else if(a<55.00&&b<116.00){
		cout<<"D"<<endl;
	}else if(a<70.00&&b<88.00){
		cout<<"E"<<endl;
	}else{
		cout<<"NA"<<endl;
	}
}

C++: #include<stdio.h>
int main(void)
{
	float t,t1;
	while(!(scanf("%f %f",&t,&t1)){
		if(t<35.50 && t1<71.00){
			printf("AAA\n");
		}
		else if(t<37.50 && t1<77.00){
			printf("AA\n");
		}
		else if(t<40.00 && t1<83.00){
			printf("A\n");
		}
		else if(t<43.00 && t1<89.00){
			printf("B\n");
		}
		else if(t<50.00 && t1<95.00){
			printf("C\n");
		}
		else if(t<55.00 && t1<116.00){
			printf("D\n");
		}
		else if(t<70.00 && t1<148.00){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
	}
	return 0;
}

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

int main(){

	int n;
	double five, ten;
	map<int, string> mp;
	double cls[7][2] = {{70.0, 148.0},
											{55.0, 116.0},
											{50.0, 105.0},
											{43.0, 89.0},
											{40.0, 83.0},
											{37.5, 77.0},
											{35.5, 71.0}};
	mp.insert(make_pair(0, "NA"));
	mp.insert(make_pair(1, "E"));
	mp.insert(make_pair(2, "D"));
	mp.insert(make_pair(3, "C"));
	mp.insert(make_pair(4, "B"));
	mp.insert(map<int, string>::value_type(5, "A"));
	mp.insert(pair<int, string>(6, "AA"));
	mp.insert(make_pair(7, "AAA"));
	
	while(cin >> five >> ten){
		n = 0;
		for(int i=0; i<7; i++){
			if(five < cls[i][0] && ten < cls[i][1]){
				 n++;
				 if(i == 6) cout << mp[n] << endl;
			}
			else{
				cout << mp[n] << endl;
				break;
			}
		}
	}

	return 0;

}

C++: #include <iostream>
using namespace std;
char c[8][8];
int main(){
for(int i=0;i<64;i++)cin>>c[i/8][i%8];
cout<<90<<endl;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
cout<<c[7-j][i];
}
cout<<endl;
}
cout<<180<<endl;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
cout<<c[7-i][7-j];
}
cout<<endl;
}
cout<<270<<endl;
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
cout<<c[j][7-i];
}
cout<<endl;
}
}

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,0},
    {148,116,105,89,83,77,71,0}
  };
  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>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

int chk500[8]={
  35, 37, 40, 43, 50, 55, 70, INT_MAX
};
int chk1000[8]={
  71, 77, 83, 89, 105, 116, 148, INT_MAX
};
const char *rank[8]={
  "AAA","AA","A","B","C","D","E","NA"
};

int main(){
  double a,b;
  while(~scanf("%lf%lf",&a,&b)){
    REP(i,8){
      if(a < (double)chk500[i] && b < (double)chk1000[i]){
        puts(rank[i]);
        break;
      }
    }
  }
  return 0;
}

C++: //41
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  for(double t,tt;cin>>t>>tt;){
    const char *cls[]={"AAA","AA","A","B","C","D","E","NA"};
    double rt[]={35.5,37.5,40,43,50,55,70};
    double rtt[]={71,77,83,89,105,116,148};
    cout<<cls[max(upper_bound(rt,rt+7,t)-rt,upper_bound(rtt,rtt+7,tt)-rtt)]<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	
		double m500,m1000;
		cin >> m500 >> m1000;
		if(m500 < 35.5 && m1000 < 71){
			cout << "AAA" << endl;
		}
		else if(m500 < 37.5 && 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(int argc, char **argv)
{
	float a, b;
	
	while(cin >> a >> b){
		if(a < 35.50 && b < 71.0){
			cout << "AAA" << endl;
		} else if(a < 37.50 && b < 77.0){
			cout << "AA" << endl;
		} else if(a < 40.00 && b < 83.0){
			cout << "A" << endl;
		} else if(a < 43.00 && b < 89.0){
			cout << "B" << endl;
		} else if(a < 50.00 && b < 105.0){
			cout << "C" << endl;
		} else if(a < 55.00 && b < 116.0){
			cout << "D" << endl;
		} else if(a < 70.00 && b < 148.0){
			cout << "E" << endl;
		} else {
			cout << "NA" << endl;
		}
	}
	
	return 0;
}

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.5 && 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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }

double light[] = {35.5, 37.5, 40, 43, 50, 55, 70};
double heavy[] = {71, 77, 83, 89, 105, 116, 148};
string cls[] = {"AAA", "AA", "A", "B", "C", "D", "E"};


string comp(double a, double b)
{
	rep(i, 7)
		if(a < light[i] && b < heavy[i])
			return cls[i];
	
	return "NA";
}

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