QOJ.ac

QOJ

時間限制: 2.0 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓

#7796. 轴对齐面积

统计

Alex 有四根长度分别为 $a_1, a_2, a_3$ 和 $a_4$ 的正整数木棍(满足 $a_1 \le a_2 \le a_3 \le a_4$)。 她想将这些木棍放置在平面上,使得每根木棍都平行于坐标轴中的某一个,并使这些木棍所围成的面积尽可能大。 求这个最大的围成面积。

输入格式

输入包含四个正整数 $a_1, a_2, a_3$ 和 $a_4$,每个整数占一行,表示按非递减顺序排列的木棍长度($1 \le a_1 \le a_2 \le a_3 \le a_4 \le 100$)。

输出格式

输出可以围成的最大面积。

样例

样例输入 1

2
2
4
7

样例输出 1

8

样例输入 2

10
10
10
10

样例输出 2

100

说明

以下是第一个样例中在平面上放置木棍的一种最优方式:

围成的区域以灰色阴影显示。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.