Problem:


スピードスケートバッジテスト

スピードスケートバッジテストでは、2 種類の距離で規定されたタイムを上回った場合に級が認定されます。例えば A 級になるには 500 M で 40.0 秒未満、かつ 1000 M で 1 分 23 秒未満であることが求められます。

スピードスケート大会 (500 M と 1000 M) で記録したタイムを入力とし、スピードスケートバッジテストで何級に相当するかを出力するプログラムを作成して下さい。500 M と1000 M のバッジテスト規定タイムは下表のとおりです。 E 級に満たなかった場合には、NA と出力してください。

 500 M1000 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

Input

複数のデータセットが与えられます。各データセットとして、500 M タイムと 1000 M タイムをそれぞれ表す実数 t1, t2 (8.0 ≤ t1, t2 ≤ 360.0) が空白区切りで与えられます。t1, t2 は秒単位で小数点以下最大 2 桁までの数字を含む実数で与えられます。

データセットの数は 100 を超えません。

Output

各データセットごとに、判定結果 AAA ~ E または NA を１行に出力してください。

Sample Input

40.0 70.0
72.5 140.51

Output for the Sample Input

B
NA



Sample input:
40.0 70.0
72.5 140.51


Sample output:
B
NA

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

import sys

t = [
{"name":"AAA","a":35.5,"b":71.0},
{"name":"AA" ,"a":37.5,"b":77.0},
{"name":"A"  ,"a":40.0,"b":83.0},
{"name":"B"  ,"a":43.0,"b":89.0},
{"name":"C"  ,"a":50.0,"b":105.0},
{"name":"D"  ,"a":55.0,"b":116.0},
{"name":"E"  ,"a":70.5,"b":148.0},
]

while True:
	s = sys.stdin.readline()
	if not s: break
	a, b = [ float(x) for x in s.split() ]
	f = [ x for x in t if x["a"] > a and x["b"] > b ]
	if len(f) == 0 :
		print "NA"
	else:
		print f[0]["name"]

Submission status: Wrong Answer

Solution code:
while True:
	try:
		n,m = map(float,raw_input().split())
	except EOFError:
		break
	
	if n < 35.5 and m < 71:
		print "AAA"
	elif n < 37.5 and m < 77:
		print "AA"
	elif n < 40 and m < 83:
		print "A"
	elif n < 43 and m < 89:
		print "B"
	elif n < 50 and m < 105:
		print "C"
	elif n < 55 and m < 116:
		print "D"
	elif n < 70.002 and m < 148:
		print "E"
	else:
		print "NA"

Submission status: Wrong Answer

Solution code:
while True:
	try:
		n,m = map(float,raw_input().split())
	except EOFError:
		break
	
	if n < 35.5 and m < 71.0:
		print "AAA"
	elif n < 37.5 and m < 77.0:
		print "AA"
	elif n < 40.0 and m < 83.0:
		print "A"
	elif n < 43.0 and m < 89.0:
		print "B"
	elif n < 50.0 and m < 105.0:
		print "C"
	elif n < 55.0 and m < 116.0:
		print "D"
	elif n < 70.002 and m < 148.0:
		print "E"
	else:
		print "NA"

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
[a, b] = [float(num) for num in input().split()];

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');

Submission status: Wrong Answer

Solution code:
# -*- 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:])

Submission status: Wrong Answer

Solution code:
# -*- 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.strip().split()]
        result = solve(r500, r1000)
        print(result)


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

Submission status: Wrong Answer

Solution code:
# 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], [999, 999]]

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

Submission status: Wrong Answer

Solution code:
# 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

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
ans = []
while True:
    lst = []
    try:
        lst = raw_input().split()
    except EOFError:
        break
    
    if lst[0] < 35.5 and lst[1] < 71.0:
        ans.append("AAA")
    elif lst[0] < 37.5 and lst[1] < 77.0:
        ans.append("AA")
    elif lst[0] < 40.5 and lst[1] < 83.0:
        ans.append("A")
    elif lst[0] < 43.0 and lst[1] < 89.0:
        ans.append("B")
    elif lst[0] < 50.0 and lst[1] < 105.0:
        ans.append("C")
    elif lst[0] < 55.0 and lst[1] < 116.0:
        ans.append("D")
    elif lst[0] < 70.0 and lst[1] < 148.0:
        ans.append("E")
    else:
        ans.append("NA")
for i in ans:
    print i

Submission status: Wrong Answer

Solution code:
ans = []
while True:
    lst = []
    try:
        lst = raw_input().split()
    except EOFError:
        break
    lst[0] = float(lst[0])
    lst[1] = float(lst[1])
    if lst[0] < 35.5 and lst[1] < 71.0:
        ans.append("AAA")
    elif lst[0] < 37.5 and lst[1] < 77.0:
        ans.append("AA")
    elif lst[0] < 40.5 and lst[1] < 83.0:
        ans.append("A")
    elif lst[0] < 43.0 and lst[1] < 89.0:
        ans.append("B")
    elif lst[0] < 50.0 and lst[1] < 105.0:
        ans.append("C")
    elif lst[0] < 55.0 and lst[1] < 116.0:
        ans.append("D")
    elif lst[0] < 70.0 and lst[1] < 148.0:
        ans.append("E")
    else:
        ans.append("NA")
for i in ans:
    print i

Submission status: Wrong Answer

Solution code:
while True:
    try:
        t1, t2 = map(float, raw_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"
        else:
            print "NA"
    except (EOFError):
        break

Submission status: Accepted

Solution code:
import sys
A=[35.5,37.5,40,43,50,55,70,1e6]
B=[71,77,83,89,105,116,148,1e6]
C=["AAA","AA","A","B","C","D","E","NA"]
def f(t,X):
  i=0
  for e in X:
    if t<e: break
    i+=1
  return i
for s in sys.stdin:
  t1,t2=map(float,s.split(" "))
  x=max(f(t1,A),f(t2,B))
  print C[x]

Submission status: Accepted

Solution code:
import sys
A=[35.5,37.5,40,43,50,55,70,1e6]
B=[71,77,83,89,105,116,148,1e6]
C=["AAA","AA","A","B","C","D","E","NA"]

for s in sys.stdin:
  t1,t2=map(float,s.split(" "))
  c=0
  for e1,e2 in zip(A,B):
    if t1<e1 and t2<e2: break
    c+=1
  print C[c]

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

import sys

t = [
{"name":"AAA","a":35.5,"b":71.0},
{"name":"AA" ,"a":37.5,"b":77.0},
{"name":"A"  ,"a":40.0,"b":83.0},
{"name":"B"  ,"a":43.0,"b":89.0},
{"name":"C"  ,"a":50.0,"b":105.0},
{"name":"D"  ,"a":55.0,"b":116.0},
{"name":"E"  ,"a":70.0,"b":148.0},
]

while True:
	s = sys.stdin.readline()
	if not s: break
	a, b = [ float(x) for x in s.split() ]
	f = [ x for x in t if x["a"] > a and x["b"] > b ]
	if len(f) == 0 :
		print "NA"
	else:
		print f[0]["name"]

Submission status: Accepted

Solution code:
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]))])

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    a, b = map(float, line.rstrip().split())
    if a < 35.50 and b < 71.00:
        print 'AAA'
    elif a < 37.50 and b < 77.00:
        print 'AA'
    elif a < 40.00 and b < 83.00:
        print 'A'
    elif a < 43.00 and b < 89.00:
        print 'B'
    elif a < 50.00 and b < 105.00:
        print 'C'
    elif a < 55.00 and b < 116.00:
        print 'D'
    elif a < 70.00 and b < 148.00:
        print 'E'
    else:
        print 'NA'

Submission status: Accepted

Solution code:
t1 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
t2 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]
s = ["AAA", "AA", "A", "B", "C", "D", "E", "NA"]
while True:
    try:
        x1, x2 = map(float, raw_input().split())
        i = 0
        while i<7 and (t1[i]<=x1 or t2[i]<=x2):
            i += 1
        print s[i]
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
	try:
		n,m = map(float,raw_input().split())
	except EOFError:
		break
	
	if n < 35.5 and m < 71.0:
		print "AAA"
	elif n < 37.5 and m < 77.0:
		print "AA"
	elif n < 40.0 and m < 83.0:
		print "A"
	elif n < 43.0 and m < 89.0:
		print "B"
	elif n < 50.0 and m < 105.0:
		print "C"
	elif n < 55.0 and m < 116.0:
		print "D"
	elif n < 70.0 and m < 148.0:
		print "E"
	else:
		print "NA"

Submission status: Accepted

Solution code:
# -*- 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')

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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');

Submission status: Accepted

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


def solve(r500, r1000):
    criteria = [(35.50,  71.0, 'AAA'),
                (37.50,  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.strip().split()]
        result = solve(r500, r1000)
        print(result)


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

Submission status: Accepted

Solution code:
# 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.5, 71], [37.5, 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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
# 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

Submission status: Accepted

Solution code:
ans = []
while True:
    lst = []
    try:
        lst = raw_input().split()
    except EOFError:
        break
    lst[0] = float(lst[0])
    lst[1] = float(lst[1])
    if lst[0] < 35.5 and lst[1] < 71.0:
        ans.append("AAA")
    elif lst[0] < 37.5 and lst[1] < 77.0:
        ans.append("AA")
    elif lst[0] < 40.0 and lst[1] < 83.0:
        ans.append("A")
    elif lst[0] < 43.0 and lst[1] < 89.0:
        ans.append("B")
    elif lst[0] < 50.0 and lst[1] < 105.0:
        ans.append("C")
    elif lst[0] < 55.0 and lst[1] < 116.0:
        ans.append("D")
    elif lst[0] < 70.0 and lst[1] < 148.0:
        ans.append("E")
    else:
        ans.append("NA")
for i in ans:
    print i

Submission status: Accepted

Solution code:
while True:
    try:
        t1, t2 = map(float, raw_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 (EOFError):
        break

Submission status: Accepted

Solution code:
d={1:"AAA",2:"AA",3:"A",4:"B",5:"C",6:"D",7:"E",8:"NA"}
while True:
    try:
        f,t=map(float,raw_input().split())
    except EOFError:
        break
    if f<35.5:d1=1
    elif f<37.5:d1=2
    elif f<40.0:d1=3
    elif f<43.0:d1=4
    elif f<50.0:d1=5
    elif f<55.0:d1=6
    elif f<70.0:d1=7
    else:d1=8

    if t<71.0:d2=1
    elif t<77.0:d2=2
    elif t<83.0:d2=3
    elif t<89.0:d2=4
    elif t<105.0:d2=5
    elif t<116.0:d2=6
    elif t<148.0:d2=7
    else:d2=8

    print d[max(d1,d2)]

Submission status: Accepted

Solution code:
from bisect import bisect
GRADE = ["AAA","AA","A","B","C","D","E","NA"]
_500M = [3550,3750,4000,4300,5000,5500,7000]
_1000M = [7100,7700,8300,8900,10500,11600,14800]

while True:
    try:
        a,b = map(lambda a:int(float(a)*100),raw_input().split())
    except:
        break
    print GRADE[max(bisect(_500M,a),bisect(_1000M,b))]

Submission status: Accepted

Solution code:
from bisect import bisect
GRADE = ["AAA","AA","A","B","C","D","E","NA"]
_500M = [35.5,37.5,40.0,43.0,50.0,55.0,70.0]
_1000M = [71.0,77.0,83.0,89.0,105.0,116.0,148.0]

while True:
    try:
        a,b = map(float,raw_input().split())
    except:
        break
    print GRADE[max(bisect(_500M,a),bisect(_1000M,b))]

Submission status: Accepted

Solution code:

while True:
  try:
    a,b = map(float,raw_input().split())
    if a < 35.5 and b < 60+11:
      print"AAA"
    elif a < 37.5 and b < 60+17:
      print "AA"
    elif a < 40 and b < 60+23:
      print "A"
    elif a < 43 and b < 60+29:
      print "B"
    elif a < 50 and b < 60+45:
      print "C"
    elif a < 55 and b < 60+56:
      print "D"
    elif a < 60+10 and b < 60+60+28:
      print "E"
    else:
      print "NA"
  except EOFError:
    break

Submission status: Accepted

Solution code:
rank = ["AAA","AA","A","B","C","D","E"]
ref1 = [35.5,37.5,40.0,43.0,50.0,55.0,70.0]
ref2 = [71.0,77.0,83.0,89.0,105.0,116.0,148.0]
while True:
	try:
		time = map(float, raw_input().split())
		for i in range(7):
			if time[0]<ref1[i] and time[1]<ref2[i]:
				print rank[i]
				break
		else:
			print "NA"
	except:
		break

Submission status: Accepted

Solution code:
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:
		t = map(float, raw_input().split())
		for i in range(7):
			if t[0]<ref0[i] and t[1]<ref1[i]:
				print rank[i]
				break
		else:
			print "NA"
	except:
		break

Submission status: Accepted

Solution code:
# -*- 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,raw_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"

Submission status: Accepted

Solution code:
import sys

R = ["AAA","AA","A","B","C","D","E","NA"]


for i in sys.stdin:
    t1,t2 = map(float,i.split())
    t5 = t10 = 0
    if   t1 < 35.5: t5 = 0
    elif t1 < 37.5: t5 = 1
    elif t1 < 40  : t5 = 2
    elif t1 < 43  : t5 = 3
    elif t1 < 50  : t5 = 4
    elif t1 < 55  : t5 = 5
    elif t1 < 70  : t5 = 6
    else          : t5 = 7

    if   t2 < 71  : t10 = 0
    elif t2 < 77  : t10 = 1
    elif t2 < 83  : t10 = 2
    elif t2 < 89  : t10 = 3
    elif t2 < 105 : t10 = 4
    elif t2 < 116 : t10 = 5
    elif t2 < 148 : t10 = 6
    else          : t10 = 7

    t = max(t5,t10)
    print(R[t])

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:

# 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

Submission status: Accepted

Solution code:
times = [["AAA",35.50,71.00],["AA",37.50,77.00],["A",40.00,83.00],["B",43.00,89.00],["C",50.00,105.00],["D",55.00,116.00],["E",70.00,148.00]]
while True:
    try:
        a,b = map(float,input().split())
    except:
        break
    for time in times:
        if a < time[1] and b < time[2]:
            print(time[0])
            break
        if time[0] == "E":
            print("NA")

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
while 1:
    try:
        t500, t1000 = map(float, input().split())
    except EOFError:
        break

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

Submission status: Accepted

Solution code:
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')

Submission status: Runtime Error

Solution code:
# -*- 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")