Problem:


階級

ボクシングは体重によって階級が分けられています。体重を読み込んで、その階級を出力するプログラムを作成してください。階級と体重の関係は以下の表のとおりとします。

階級体重（kg）

light fly48.00kg 以下

fly48.00kg 超 51.00kg 以下

bantam51.00kg 超 54.00kg 以下

feather54.00kg 超 57.00kg 以下

light57.00kg 超 60.00kg 以下

light welter60.00kg 超 64.00kg 以下

welter64.00kg 超 69.00 kg 以下

light middle69.00kg 超 75.00 kg 以下

middle75.00kg 超 81.00 kg 以下

light heavy81.00kg 超 91.00 kg 以下

heavy91.00kg 超

Input

入力は複数のデータセットからなります。各データセットとして、体重を表す１つの実数 w (40 ≤ w ≤ 150) が１行に与えられます。データセットの数は 50 を超えません。

Output

データセットごとに、対応する階級を１行に出力します。

Sample Input

60.2
70.2
48.0
80.2

Output for the Sample Input

light welter
light middle
light fly
middle



Sample input:
60.2
70.2
48.0
80.2


Sample output:
light welter
light middle
light fly
middle

Submission status: Accepted

Solution code:
import bisect

WCLS = ["light fly","fly","bantam","feather","light","light welter","welter","light middle","middle","light heavy","heavy"]
WEIGHT = [48,51,54,57,60,64,69,75,81,91]
if __name__ == '__main__':

    while True:
        try:
            w = float(input())
            
            ind = bisect.bisect_left(WEIGHT,w)
            print(WCLS[ind])
        except EOFError:
            break

Submission status: Accepted

Solution code:
ww = [0, 48.0, 51.0, 54.0, 57.0, 60.0, 64.0, 69.0, 75.0, 81.0, 91.0, 200.0]
c = ["light fly", "fly", "bantam", "feather", "light", "light welter", "welter", "light middle", "middle", "light heavy", "heavy"]

while True:
  try:
    w = float(input())
  except:
    break
  for i in range(12):
    if w <= ww[i]:
      break
  i -= 1
  print(c[i])

Submission status: Accepted

Solution code:
r = [0.0,48.0,51.0,54.0,57.0,60.0,64.0,69.0,75.0,81.0,91.0,1000.0]
s = ["light fly","fly","bantam","feather","light","light welter","welter","light middle","middle","light heavy","heavy"]
 
while True:
    try:
        w = float(input())
    except:break
    for i in range(12):
        if r[i] < w and w <= r[i+1]:
           print(s[i])
           break

Submission status: Accepted

Solution code:
def rank(i):
    if i <= 48.00:
        return "light fly"
    elif 48.00 < i <= 51.00:
        return "fly"
    elif 51.00 < i <= 54.00:
        return "bantam"
    elif 54.00 < i <= 57.00:
        return "feather"
    elif 57.00 < i <= 60.00:
        return "light"
    elif 60.00 < i <= 64.00:
        return "light welter"
    elif 64.00 < i <= 69.00:
        return "welter"
    elif 69.00 < i <= 75.00:
        return "light middle"
    elif 75.00 < i <= 81.00:
        return "middle"
    elif 81.00 < i <= 91.00:
        return "light heavy"
    elif i > 91.00:
        return "heavy"

while(1):
    try:
        i = float(input())
        print(rank(i))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        weight = float(input())
    except:
        break

    if weight <= 48:
        print("light fly")
    elif 48 < weight <= 51:
        print("fly")
    elif 51 < weight <= 54:
        print("bantam")
    elif 54 < weight <= 57:
        print("feather")
    elif 57 < weight <= 60:
        print("light")
    elif 60 < weight <= 64:
        print("light welter")
    elif 64 < weight <= 69:
        print("welter")
    elif 69 < weight <= 75:
        print("light middle")
    elif 75 < weight <= 81:
        print("middle")
    elif 81 < weight <= 91:
        print("light heavy")
    else:
        print("heavy")

Submission status: Accepted

Solution code:
while True:
    try: w = float(input())
    except: break

    if w <= 48.00:
        print('light fly')
    elif 48.00 < w <= 51.00:
        print('fly')
    elif 51.00 < w <= 54.00:
        print('bantam')
    elif 54.00 < w <= 57.00:
        print('feather')
    elif 57.00 < w <= 60.00:
        print('light')
    elif 60.00 < w <= 64.00:
        print('light welter')
    elif 64.00 < w <= 69.00:
        print('welter')
    elif 69.00 < w <= 75.00:
        print('light middle')
    elif 75.00 < w <= 81.00:
        print('middle')
    elif 81.00 < w <= 91.00:
        print('light heavy')
    else:
        print('heavy')

Submission status: Runtime Error

Solution code:
while(True):
    try:
        weight = float(input())

        if(weight <= 48.00):
            print("light fly")
        elif(weight <= 51.00):
            print("fly")
        elif(weight <= 54.00):
            print("bantam")
        elif(weight <= 57.00):
            print("feather")
        elif(weight <= 60.00):
            print("light")
        elif(weight <= 64.00):
            print("light welter")
        elif(weight <= 69.00):
            print("welter")
        elif(weight <= 75.00):
            print("light middle")
        elif(weight <= 81.00):
            print("middle")
        elif(weight <= 91.00):
            print("light heavy")
        else:
            print("heavy")
    except ValueError:
        break;

Submission status: Runtime Error

Solution code:
while 1:
    try:
        weight = float(input())

        if(weight <= 48.00):
            print("light fly")
        elif(weight <= 51.00):
            print("fly")
        elif(weight <= 54.00):
            print("bantam")
        elif(weight <= 57.00):
            print("feather")
        elif(weight <= 60.00):
            print("light")
        elif(weight <= 64.00):
            print("light welter")
        elif(weight <= 69.00):
            print("welter")
        elif(weight <= 75.00):
            print("light middle")
        elif(weight <= 81.00):
            print("middle")
        elif(weight <= 91.00):
            print("light heavy")
        else:
            print("heavy")
    except ValueError:
        break;

Submission status: Runtime Error

Solution code:
def Class(x):
	if x<=48.0:
		print("light fly")
	elif 48.0<x<=51.0:
		print("fly")
	elif 51.0<x<=54.0:
		print("bantam")
	elif 54.0<x<=57.0:
		print("feather")
	elif 57.0<x<=60.0:
		print("light")
	elif 60.0<x<=64.0:
		print("light welter")
	elif 64.0<x<=69.0:
		print("welter")
	elif 69.0<x<=75.0:
		print("light middle")
	elif 75.0<x<=81.0:
		print("middle")
	elif 81.0<x<=91.0:
		print("light heavy")
	else:
		ptinr("heavy")

while True:
	try:
		x=float(input())
		Class(x)
	except EOFError:
		break

Submission status: Runtime Error

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


def judge_class(s):
    if s <= 48.00:
        return 'light fly'
    elif 48.00 < s <= 51.00:
        return 'fly'
    elif 51.00 < s <= 54.00:
        return 'bantam'
    elif 54.00 < s <= 57.00:
        return 'feather'
    elif 57.00 < s <= 60.00:
        return 'light'
    elif 60.00 < s <= 64.00:
        return 'light welter'
    elif 64.00 < s <= 69.00:
        return 'welter'
    elif 69.00 < s <= 75.00:
        return 'light middle'
    elif 75.00 < s <= 81.00:
        return 'middle'
    elif 81.00 < s <= 91.00:
        return 'light heavy'
    elif 91.00 <= s:
        return 'heavy'


if __name__ == '__main__':
    s = input()
    print(judge_class(s))

Submission status: Runtime Error

Solution code:
while True:
 w=float(input())
 if w<=48:
   judge='light fly'
 elif 48<=w<=51:
   judge='fly'
 elif 51<=w<=54:
   judge='bantam'
 elif 54<=w<=57:
   judge='feather'
 elif 57<=w<=60:
   judge='light'
 elif 60<=w<=64:
   judge='light welter'
 elif 64<=w<=69:
   judge='welter'
 elif 69<=w<=75:
   judge='light middle'
 elif 75<=w<=81:
   judge='middle'
 elif 81<=w<=91:
   judge='light heavy'
 elif w>=91:
   judge='heavy'  

 print(judge)

Submission status: Runtime Error

Solution code:
while True:
  w=float(input())
  if w<=48:
   judge='light fly'
  elif 48<=w<=51:
   judge='fly'
  elif 51<=w<=54:
   judge='bantam'
  elif 54<=w<=57:
   judge='feather'
  elif 57<=w<=60:
   judge='light'
  elif 60<=w<=64:
   judge='light welter'
  elif 64<=w<=69:
   judge='welter'
  elif 69<=w<=75:
   judge='light middle'
  elif 75<=w<=81:
   judge='middle'
  elif 81<=w<=91:
   judge='light heavy'
  elif w>91:
   judge='heavy'  
  print(judge)

Submission status: Runtime Error

Solution code:
while True:
  w=int(input())
  if w<=48:
   judge='light fly'
  elif 48<=w<=51:
   judge='fly'
  elif 51<=w<=54:
   judge='bantam'
  elif 54<=w<=57:
   judge='feather'
  elif 57<=w<=60:
   judge='light'
  elif 60<=w<=64:
   judge='light welter'
  elif 64<=w<=69:
   judge='welter'
  elif 69<=w<=75:
   judge='light middle'
  elif 75<=w<=81:
   judge='middle'
  elif 81<=w<=91:
   judge='light heavy'
  elif w>91:
   judge='heavy'  
  print(judge)

Submission status: Runtime Error

Solution code:
import sys

c=["light fly", "fly", "bantam", "feather", "light", "light welter",
   "welter", "light middle", "middle", "light heavy", "heavy"]
w=[48,51,54,57,60,64,69,75,81,91]
for s in map(float,sys.stdin):
    i=0;
    while w[i]<s:
        i+=1
    print c[i]

Submission status: Runtime Error

Solution code:
import sys

c=["light fly", "fly", "bantam", "feather", "light", "light welter",
   "welter", "light middle", "middle", "light heavy", "heavy"]
w=[48,51,54,57,60,64,69,75,81,91]
for s in map(float,sys.stdin):
    i=0
    while w[i]<s:
        i+=1
    print c[i]

Submission status: Runtime Error

Solution code:
while True:
    try:
        w = float(raw_input())
        if w <= 48.0:
            print  "light fly"
        elif w <= 51.0:
            print "fly"
        elif w <= 54.0:
            print "bantam"
        elif w <= 57.0:
            print "feather"
        elif w <= 60:
            print "light"
        elif w <= 64.0:
            print "light welter"
        elif w <= 69.0:
            print "welter"
        elif w <= 75.0:
            print "light middle"
        elif w <= 81.0
            print "middle"
        elif w <= 91.0:
            print "light heavy"
        else:
            print "heavy"
    except:
        break

Submission status: WA: Presentation Error

Solution code:
while True:
    try:
        a=float(input())
        if a<=48:
            print("light fly")
        if a>48 and a<=51:
            print("fly")
        if a>51 and a<=54:
            print("bantam")
        if a>54 and a<=57:
            print("feather")
        if a>57 and a<=60:
            print("light")
        if a>60 and a<=64:
            print("light welter")
        if a>64 and a<=69:
            print("welter")
        if a>69 and a<=75:
            print("light middle	")
        if a>75 and a<=81:
            print("middle")
        if a>81 and a<=91:
            print("light heavy	")
        if a>91:
            print("heavy")
    except:break

Submission status: WA: Presentation Error

Solution code:
while True:
    try:
        a=float(input())
        if a<=48:
            print("light fly")
        elif a>48 and a<=51:
            print("fly")
        elif a>51 and a<=54:
            print("bantam")
        elif a>54 and a<=57:
            print("feather")
        elif a>57 and a<=60:
            print("light")
        elif a>60 and a<=64:
            print("light welter")
        elif a>64 and a<=69:
            print("welter")
        elif a>69 and a<=75:
            print("light middle	")
        elif a>75 and a<=81:
            print("middle")
        elif a>81 and a<=91:
            print("light heavy	")
        elif a>91:
            print("heavy")
    except:break