QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#22340. Building A Fence

İstatistikler

Industrious Farmer John wants a build a four-sided fence to enclose the cows. He has one plank of wood of integer length $N$ $(4 \le N \le 2,500)$ that he wants to cut at three points to make four integer-length pieces.

The four pieces can be of any positive integer length as long as Farmer John can form a quadrilateral fence with them. How many different ways can he cut the plank of wood so that he can make a complete fence?

NOTES:

  • Two ways of cutting are different if one has a cut at a spot that the other doesn't. Don't worry about eliminating symmetries or other complexities like that.

  • Do make sure, though, that the fence has greater than 0 area.

  • Rejoice that the answer will always fit into a signed 32-bit integer.

Input

  • Line 1: A single integer: $N$

Output

  • Line 1: A single integer that is the number of ways that Farmer John can cut the plank of wood into four pieces such that they form a valid quadrilateral.

Examples

Input 1

6

Output 1

6

The plank of wood has length 6.

Farmer John can cut the plank 10 ways into four pieces: (1, 1, 1, 3); (1, 1, 2, 2); (1, 1, 3, 1); (1, 2, 1, 2); (1, 2, 2, 1); (1, 3, 1, 1); (2, 1, 1, 2); (2, 1, 2, 1); (2, 2, 1, 1); or (3, 1, 1, 1). Four of these -- (1, 1, 1, 3), (1, 1, 3, 1), (1, 3, 1, 1), and (3, 1, 1, 1) -- cannot be used to form a quadrilateral, though.

Scoring

POINTS: 250

Problem credits: Jeffrey Wang, 2007

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.