No.80 Let's Draw a Rectangle
タグ : / 解いたユーザー数 419
作問者 :
nmnmnmnmnmnmnm
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もしくは右上の雲マークをクリックしてアカウントを作成してください。