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

Python: 
# 500 M	1000 M
# AAA 級	35 秒 50	1 分 11 秒 00
# AA 級	37 秒 50	1 分 17 秒 00
# A 級	40 秒 00	1 分 23 秒 00
# B 級	43 秒 00	1 分 29 秒 00
# C 級	50 秒 00	1 分 45 秒 00
# D 級	55 秒 00	1 分 56 秒 00
# E 級	1分10 秒 00	2 分 28 秒 00

ranks = ["AAA","AA","A","B","C","D","E","NA"]
timesA = [35.50,37.50,40,43,50,55,70]
timesB = [71,77,83,89,105,116,148]

while(1):
    try:
        a,b = (float(x) for x in input().split())
        rankA = rankB = 7
        # checkA
        for i in range(0,7):
            if timesA[i] > a:
                rankA = i
                break
        # checkB
        for i in range(rankA,7):
            if timesB[i] > b:
                rankB = max(rankA,i)
                break
        print(ranks[rankB])
    except:
        break

Python: while True:
    try:
        tt = [f.split('.') for f in input().split()]
        t1, t2 = int(tt[0][0]+tt[0][1][0]), int(tt[1][0]+tt[1][1][0])
        if t1 < 355 and t2 < 710:   print("AAA")
        elif t1 < 375 and t2 < 770: print("AA")
        elif t1 < 400 and t2 < 830: print("A")
        elif t1 < 430 and t2 < 890: print("B")
        elif t1 < 500 and t2 < 1050:print("C")
        elif t1 < 550 and t2 < 1160:print("D")
        elif t1 < 700 and t2 < 1280:print("E")
        else:                       print("NA")
    except: break

Python: # -*- coding: utf-8 -*- 

rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]

while True:
  try:
    t1,t2 = map(float,input().split())
  except EOFError:
    break
  
  #print(len(rank))
  
  for i in range(len(rank)):
    if t1 < ref0[i] and t2 < ref1[i]:
      print(rank[i])
      break
  else:
    print("NA")

Python: def judge(t1, t2):
  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")

while True:
  try:
   t1, t2 = map(float, input().split())
   judge(t1, t2)
  except EOFError:
    break

Python: def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())

for l in range(len(N)):
    t1, t2 = [float(i) for i in N[l].split()]
    if t1 < 35.5 and t2 < 71.0:
        print("AAA")
    elif t1 < 37.5 and t2 < 77.0:
        print("AA")
    elif t1 < 40.0 and t2 < 83.0:
        print("A")
    elif t1 < 43.0 and t2 < 89.0:
        print("B")
    elif t1 < 50.0 and t2 < 105.0:
        print("C")
    elif t1 < 55.0 and t2 < 116.0:
        print("D")
    elif t1 < 70.0 and t2 < 148.0:
        print("E")
    else:
        print("NA")

Python: while True:
    try:
        t1,t2=map(float,input().split())
    except:break
    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")

Python: # -*- coding: utf-8 -*-

import sys
import os
import math

for s in sys.stdin:
    a, b = map(float, s.split())

    if a < 35.5 and b < 71:
        print('AAA')
    elif a < 37.5 and b < 77:
        print('AA')
    elif a < 40 and b < 83:
        print('A')
    elif a < 43 and b < 89:
        print('B')
    elif a < 50 and b < 105:
        print('C')
    elif a < 55 and b < 116:
        print('D')
    elif a < 70 and b < 148:
        print('E')
    else:
        print('NA')

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: # Aizu Problem 00123: Speed Skating Badge Test
#
import sys, math, os, copy

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


grades = ["AAA", "AA", "A", "B", "C", "D", "E", "NA"]
limits = [[35, 71], [37, 77], [40, 83], [43, 89], [50, 105],
          [55, 116], [70, 148], [99999999, 999999999]]

for line in sys.stdin:
    t1, t2 = [float(_) for _ in line.split()]
    for k in range(8):
        if t1 < limits[k][0] and t2 < limits[k][1]:
            print(grades[k])
            break

Python: # AOJ 0123 Speed Skating Badge Test
# Python3 2018.6.18 bal4u

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 ]
clas = [ "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(clas[i])
			break

Python: while True:
    try: n = input().split()
    except: break
    
    m5, m10 = map(float, n)
    if m5 < 35.50 and m10 < 71.0:
        print('AAA')
    elif m5 < 37.50 and m10 < 77.0:
        print('AA')
    elif m5 < 40.0 and m10 < 83.0:
        print('A')
    elif m5 < 43.0 and m10 < 89.0:
        print('B')
    elif m5 < 50.0 and m10 < 105.0:
        print('C')
    elif m5 < 55.0 and m10 < 116.0:
        print('D')
    elif m5 < 70.0 and m10 < 148.0:
        print('E')
    else:
        print('NA')

Python: import sys
for line in sys.stdin.readlines():
    t1,t2 = list(map(float, line.split()))

    if t1 < 35.5 and t2 < 71.0:   print("AAA")
    elif t1 < 37.5 and t2 < 77.0: print("AA")
    elif t1 < 40.0 and t2 < 83.0: print("A")
    elif t1 < 43.0 and t2 < 89.0: print("B")
    elif t1 < 50.0 and t2 < 105.0: print("C")
    elif t1 < 55.0 and t2 < 116.0: print("D")
    elif t1 < 70.0 and t2 < 148.0: print("E")
    else: print("NA")

Python: while True:
    try:
        t1, t2 = map(float, input().split())
    except:
        break
    t1, t2 = int(t1*100), int(t2*100)
    if t1 < 3550 and t2 < 7100:
        print("AAA")
    elif t1 < 3750 and t2 < 7700:
        print("AA")
    elif t1 < 4000 and t2 < 8300:
        print("A")
    elif t1 < 4300 and t2 < 8900:
        print("B")
    elif t1 < 5000 and t2 < 10500:
        print("C")
    elif t1 < 5500 and t2 < 11600:
        print("D")
    elif t1 < 7000 and t2 < 14800:
        print("E")
    else:
        print("NA")

Python: import sys

for line in sys.stdin:
	[p, q] = line.split();
	a = float(p);
	b = float(q);
	
	if (a < 35.5) & (b < 71.0):
		print('AAA');
	elif (a < 37.5) & (b < 77.0):
		print('AA');
	elif (a < 40.0) & (b < 83.0):
		print('A');
	elif (a < 43.0) & (b < 89.0):
		print('B');
	elif (a < 50.0) & (b < 105.0):
		print('C');
	elif (a < 55.0) & (b < 116.0):
		print('D');
	elif (a < 70.0) & (b < 148.0):
		print('E');
	else:
		print('NA');