A - Trapezoids Editorial /

Time Limit: 2 sec / Memory Limit: 256 MB

配点 : 100100

問題文

上底の長さが aa、下底の長さが bb、高さが hh の台形があります。

台形の例

この台形の面積を求めてください。

制約

  • 1a1001 \leq a \leq 100
  • 1b1001 \leq b \leq 100
  • 1h1001 \leq h \leq 100
  • 入力で与えられる値はすべて整数
  • hh は偶数

入力

入力は以下の形式で標準入力から与えられる。

aa
bb
hh

出力

台形の面積を整数で出力せよ。面積が整数になることは保障されている。


入力例 1Copy

Copy
3
4
2

出力例 1Copy

Copy
7

上底の長さ 33、下底の長さ 44、高さ 22 の台形の面積は、 (3+4)×2/2=7(3+4)×2/2 = 7 です。


入力例 2Copy

Copy
4
4
4

出力例 2Copy

Copy
16

この例で与えられるのは平行四辺形ですが、平行四辺形も台形です。

Score : 100100 points

Problem Statement

You are given a trapezoid. The lengths of its upper base, lower base, and height are aa, bb, and hh, respectively.

An example of a trapezoid

Find the area of this trapezoid.

Constraints

  • 1a1001≦a≦100
  • 1b1001≦b≦100
  • 1h1001≦h≦100
  • All input values are integers.
  • hh is even.

Input

The input is given from Standard Input in the following format:

aa
bb
hh

Output

Print the area of the given trapezoid. It is guaranteed that the area is an integer.


Sample Input 1Copy

Copy
3
4
2

Sample Output 1Copy

Copy
7

When the lengths of the upper base, lower base, and height are 33, 44, and 22, respectively, the area of the trapezoid is (3+4)×2/2=7(3+4)×2/2 = 7.


Sample Input 2Copy

Copy
4
4
4

Sample Output 2Copy

Copy
16

In this case, a parallelogram is given, which is also a trapezoid.



2025-04-26 (Sat)
18:40:02 +00:00