✅ 정답 공개
from abc import ABC, abstractmethod
class Shape(ABC):
@abstractmethod
def area(self): pass
class Circle(Shape):
def __init__(self, r): self.r = r
def area(self): return round(3.14*self.r**2, 2)
class Rect(Shape):
def __init__(self, w, h): self.w=w; self.h=h
def area(self): return round(self.w*self.h, 2)
class Triangle(Shape):
def __init__(self, b, h): self.b=b; self.h=h
def area(self): return round(0.5*self.b*self.h, 2)
parts = input().split()
if parts[0]=='circle': s=Circle(float(parts[1]))
elif parts[0]=='rect': s=Rect(float(parts[1]), float(parts[2]))
else: s=Triangle(float(parts[1]), float(parts[2]))
print(s.area())