#K3941. Rectangle Operations: Perimeter, Area, and Scaling

    ID: 26414 Type: Default 1000ms 256MiB

Rectangle Operations: Perimeter, Area, and Scaling

Rectangle Operations: Perimeter, Area, and Scaling

Given the initial width and height of a rectangle and a scaling factor, compute the rectangle's perimeter and area. Then, scale the rectangle by the given factor and compute the new perimeter and area.

The perimeter, denoted by \(P\), is calculated by \(P = 2 \times (\text{width} + \text{height})\). The area, denoted by \(A\), is computed as \(A = \text{width} \times \text{height}\). Note that the rectangle dimensions can be negative, and the formulas apply as given.

inputFormat

The input consists of two lines:

  1. The first line contains two integers representing the width and height of the rectangle.
  2. The second line contains one integer representing the scaling factor.

outputFormat

Output exactly four lines:

  1. The first line is the perimeter of the original rectangle.
  2. The second line is the area of the original rectangle.
  3. The third line is the perimeter of the scaled rectangle.
  4. The fourth line is the area of the scaled rectangle.
## sample
2 3
2
10

6 20 24

</p>