QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22340. Dựng hàng rào

Statistics

Farmer John chăm chỉ muốn hàng rào bốn cạnh cho bò. Ông cắt ván dài nguyên $N$ ($4\le N\le2,500$) tại ba điểm để có bốn đoạn dài nguyên.

Độ dài có thể là bất kỳ số nguyên dương nếu tạo được tứ giác. Có bao nhiêu cách cắt để làm hàng rào hoàn chỉnh?

Chú ý

  • Hai cách khác nếu một có điểm cắt mà cách kia không có. Không loại đối xứng hay lo phức tạp tương tự.
  • Nhưng diện tích phải lớn hơn $0$.
  • Vui thay đáp án vừa số nguyên có dấu 32 bit.

Dữ liệu vào

  • Dòng 1: số nguyên $N$.

Dữ liệu ra

  • Dòng 1: số nguyên, số cách cắt bốn đoạn tạo tứ giác hợp lệ.

Ví dụ

Dữ liệu vào 1

6

Dữ liệu ra 1

6

Ghi chú

Ván dài 6.

Có 10 cách cắt bốn đoạn: $(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)$; $(3,1,1,1)$. Nhưng bốn cách sau không tạo tứ giác: $(1,1,1,3)$, $(1,1,3,1)$, $(1,3,1,1)$, $(3,1,1,1)$.

Nhiệm vụ con

Điểm: 250.

Tác giả bài toán: 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.