問題一覧 > 通常問題

No.80 Let's Draw a Rectangle

レベル : / AI推定難易度 : 167 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 419
作問者 : nmnmnmnmnmnmnm
お気に入りにしたユーザー ProblemId : 203 / 自分の提出
問題文最終更新日: 2026-06-25 10:50:22
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 59 (順位表) の他の問題:

Problem Statement

A-kun is going to draw a quadrilateral.
The quadrilateral he draws must be a square or a rectangle.
Also, every side length must be an integer number of cm.
It seems that A-kun's pencil can draw lines of only exactly $D$cm more.
Find the largest area of a quadrilateral that A-kun can draw.
If no quadrilateral can be drawn, the area is taken to be 0.

Input

D

$D$ is the length of line that A-kun can draw. ($0 \le D \le 10000=10^4$)

Output

Output on one line the largest area of a quadrilateral that A-kun can draw.
Do not forget the newline at the end.

Sample

Sample 1
Input
14
Output
12

The largest quadrilateral is a rectangle 4cm wide and 3cm tall.
The area is 4×3, so the answer is 12.

Sample 2
Input
15
Output
12

This is the same as Sample 1.
A-kun does not have to use up the pencil.

Sample 3
Input
16
Output
16

A square with side length 4cm can be drawn. Its area is 16.

Sample 4
Input
3
Output
0

When no quadrilateral can be drawn, the area is 0.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。