#C8242. Counting Subplot Corners

    ID: 52203 Type: Default 1000ms 256MiB

Counting Subplot Corners

Counting Subplot Corners

In a rectangular garden divided into ( m \times n ) plots, each plot is surrounded by walkways. The walkways run along the edges of each plot, creating intersections at every corner. Your task is to calculate the total number of subplot corners where the walkways intersect.

Note that even though the dimensions of each plot ((a) and (b)) and the width of the walkway ((w)) are provided, the total number of intersections depends only on the number of plots. The formula to compute the number of subplot corners is given by:
( (m+1) \times (n+1) ).

inputFormat

The input consists of a single line containing five space-separated integers: ( m ), ( n ), ( a ), ( b ), ( w ).

Here, ( m ) and ( n ) represent the number of plots along the garden's length and width, respectively. Although ( a ) and ( b ) are the dimensions of each plot (in meters) and ( w ) is the width of the walkway (in meters), only ( m ) and ( n ) are needed to compute the answer.

outputFormat

Output a single integer representing the total number of subplot corners where the walkways intersect. The answer is computed as ( (m+1) \times (n+1) ).## sample

2 3 5 4 1
12