시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 37 | 22 | 22 | 61.111% |
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 <= N <= 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:
6
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.