第 045 场 AtCoder Beginner Contest
A
梯形
Trapezoids
AtCoder
⌀ 0
原题
←B →

梯形AI (CI翻译)

Problem Statement

题目描述

AI (CI翻译)

You are given a trapezoid. The lengths of its upper base, lower base, and height are $a$, $b$, and $h$, respectively.

给定一个梯形。其上底、下底和高的长度分别为 $a$、$b$ 和 $h$。AI (CI翻译)

image An example of a trapezoid

image 梯形示例AI (CI翻译)

Find the area of this trapezoid.

请你求出这个梯形的面积。AI (CI翻译)

Constraints

约束条件

AI (CI翻译)
  • $1≦a≦100$
  • $1≦b≦100$
  • $1≦h≦100$
  • All input values are integers.
  • $h$ is even.
  • $1≦a≦100$
  • $1≦b≦100$
  • $1≦h≦100$
  • 所有输入值均为整数。
  • $h$ 是偶数。
AI (CI翻译)

Input

输入格式

AI (CI翻译)

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

输入从标准输入按以下格式给出:AI (CI翻译)

a
b
h

a
b
h
AI (CI翻译)

Output

输出格式

AI (CI翻译)

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

输出给定梯形的面积。可以保证面积为整数。AI (CI翻译)

样例

Input #1
3
4
2
Output #1
7
When the lengths of the upper base, lower base, and height are $3$, $4$, and $2$, respectively, the area of the trapezoid is $(3+4)×2/2 = 7$.
Input #2
4
4
4
Output #2
16
In this case, a parallelogram is given, which is also a trapezoid.
题目信息
题号
abc045_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。