Rectangle Function

Lab Python Beginner 10 points

Write area(w, h) and perimeter(w, h). Read width and height on one line and print both results.

Input

Two integers.

Output

Two lines: area, then perimeter.

Example

Input

3 4

Output

12
14
Sample input available Sample output available
Editor
Python

Hints

Each function returns one calculation.

Solution explanation

Small, single-purpose functions are easy to test and reuse.

Show solution
def area(w, h):
    return w * h


def perimeter(w, h):
    return 2 * (w + h)


w, h = map(int, input().split())
print(area(w, h))
print(perimeter(w, h))
Output
Answer
HOME LEARN COMMUNITY DASHBOARD