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

Python: while True:
    try:
        t1,t2=map(float,input().split())
        if t1<35.5 and t2<71:
            print("AAA")
        elif t1<37.5 and t2<77:
            print("AA")
        elif t1<40 and t2<83:
            print("A")
        elif t1<43 and t2<89:
            print("B")
        elif t1<50 and t2<105:
            print("C")
        elif t1<55 and t2<116:
            print("D")
        elif t1<70 and t2<148:
            print("e")
        else:
            print("NA")
    except:break

Python: m500 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0, 1000.0]
m1000 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0, 1000.0]
category = ["AAA", "AA", "A", "B", "C", "D", "E", "NA"]
while True:
    try:t500, t1000 = list(map(float, input().split()))
    except:break
    for i in range(len(m500)):
        if t500 < m500[i] and t1000 < m1000[i]:print(category[i]);break

Python: from sys import stdin
readlines = stdin.readlines


badge = ['AAA', 'AA', 'A', 'B', 'C', 'D', 'E', 'NA']
limit = {500: [
    35.50,
    37.50,
    40.00,
    43.00,
    50.00,
    55.00,
    70.00,
    float('inf')],
    1000: [
    71.00,
    77.00,
    83.00,
    89.00,
    105.00,
    116.00,
    148.00,
    float('inf')]}


def rank(time, limit):
    for i, l in enumerate(limit):
        if time < l:
            return i

for line in readlines():
    t500, t1000 = map(float, line.split())
    print(badge[max(rank(t500, limit[500]), rank(t1000, limit[1000]))])

Python: import bisect
while 1:
    try:
        n,m=map(float,input().split())
        m500=[35.5,37.5,40,43,50,55,70]
        m1000=[71,77,83,89,105,116,148]
        r1=bisect.bisect_left(m500,n+0.001)
        r2=bisect.bisect_left(m1000,m+0.001)
        rank=["AAA","AA","A","B","C","D","E","NA"]
        print(rank[max(r1,r2)])
    except:break

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0123
"""
import sys


def solve(r500, r1000):
    criteria = [(35.0, 71.0, 'AAA'), (37.0, 77.0, 'AA'), (40.0, 83.0, 'A'), (43.0, 89.0, 'B'),
                (50.0, 105.0, 'C'), (55.0, 116.0, 'D'), (70.0, 148.0, 'E')]
    rank = None
    for c500, c1000, r in criteria:
        if r500 < c500 and r1000 < c1000:
            rank = r
            break
    if rank == None:
        rank = 'NA'
    return rank


def main(args):
    for line in sys.stdin:
        r500, r1000 = [float(x) for x in line.split(' ')]
        result = solve(r500, r1000)
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: import sys

judgeTable = {0: "AAA", 1: "AA", 2: "A",
              3: "B", 4: "C", 5: "D", 6: "E", 7: "NA"}


def Judge500(time):

    if time < 35.5:
        return 0
    elif time < 37.5:
        return 1
    elif time < 40.0:
        return 2
    elif time < 43.0:
        return 3
    elif time < 50.0:
        return 4
    elif time < 55.0:
        return 5
    elif time < 70.0:
        return 6
    else:
        return 7


def Judge1000(time):

    if time < 71.0:
        return 0
    elif time < 77.0:
        return 1
    elif time < 83.0:
        return 2
    elif time < 89.0:
        return 3
    elif time < 105.0:
        return 4
    elif time < 116.0:
        return 5
    elif time < 148.0:
        return 6
    else:
        return 7


for line in sys.stdin:
    line = line[:-1]

    time1, time2 = [float(item) for item in line.split(" ")]
    rank1, rank2 = Judge500(time1), Judge1000(time2)
    result = judgeTable[max(rank1, rank2)]
    print(result)

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

int main(void){
     double n,m;
     cin >> n >> m;
     if(n < 35 and m < 71){
	  cout << "AAA" << endl;
     }else if(n < 37 and m < 77){
	  cout << "AA" << endl;
     }else if(n < 40 and m < 83){
	  cout << "A" << endl;
     }else if(n < 43 and m < 89){
	  cout << "B" << endl;
     }else if(n < 50 and m < 105){
	  cout << "C" << endl;
     }else if(n < 55 and m < 116){
	  cout << "D" << endl;
     }else if(n < 70 and m < 148){
	  cout << "E" << endl;
     }else{
	  cout << "NA" << endl;
     }
     return 0;
}

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

C++: #include<stdio.h>
int main(main)
{
	int a,b;
	scanf("%d %d",&a,&b);
	if(a<=35.5 && b<=71){
		printf("AAA\n");
	}
	else if(a<37.5 && b<77){
		printf("AA\n");
	}
	else if(a<40 && b<83){
		printf("A\n");
	}
	else if(a<43 && b<89){
		printf("B\n");
	}
	else if(a<50 && b<105){
		printf("c\n");
	}
	else if(a<55 && b<116){
		printf("D\n");
	}
	else if(a<60 && b<148){
		printf("E\n");
	}
	else{
		printf("NA\n");
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); i++ )
#define UREP( i, m, n ) for ( unsigned int i = (unsigned int)( m ); i < (unsigned int)( n ); i++ )
#define ITER( c ) __typeof( (c).begin() )
#define IREP( c, it ) for ( ITER(c) it = (c).begin(); it != (c).end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define PB( n ) push_back( ( n ) )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define fst first
#define snd second

const double p500[] = { 70, 55, 50, 43, 40, 37.5, 35.5 };
const double p1000[] = { 148, 116, 105, 89, 83, 77, 61 };
const string rank[] = {	"NA", "E", "D", "C", "B", "A",	"AA", "AAA" };

int main()
{
	double t500, t1000;

	while ( cin >> t500 >> t1000 )
	{
		int rank1 = 0, rank2 = 0;

		REP( i, 0, 7 )
		{
			if ( t500 < p500[i] )
			{
				rank1++;
			}

			if ( t1000 < p1000[i] )
			{
				rank2++;
			}
		}

		cout << rank[ min( rank1, rank2 ) ] << endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	double s,l;
	while(cin>>s>>l){
		if(s<35.5&&l<71) o("AAA");
		else if(s<37.5&&l<77) o("AA");
		else if(s<40&&l<83) o("A");
		else if(s<43&&l<89) o("B");
		else if(s<50&&l<105) o("C");
		else if(s<55&&l<116) o("D");
		else if(s<70&&l<148) o("E");
		else o("NA");
	}
}