QOJ.ac

QOJ

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

#22340. בניית גדר

Statistics

Farmer John החרוץ רוצה גדר בת ארבע צלעות לפרות. לוח באורך שלם $N$ ($4\le N\le2,500$) ייחתך בשלושה מקומות לארבעה קטעים באורכים שלמים.

כל אורך שלם חיובי מותר אם הקטעים יוצרים מרובע. כמה דרכי חיתוך מאפשרות גדר מלאה?

הערות

  • הדרכים שונות אם אחת חותכת במקום שבו השנייה אינה. אין לבטל סימטריות או סיבוכים דומים.
  • אך השטח חייב להיות גדול מ־$0$.
  • שמחו: התשובה נכנסת לשלם בעל סימן של 32 ביט.

קלט

  • שורה 1: שלם $N$.

פלט

  • שורה 1: שלם, מספר הדרכים לארבעה קטעים שיוצרים מרובע תקין.

דוגמאות

קלט 1

6

פלט 1

6

Note

אורך הלוח 6.

יש 10 דרכים לארבעה קטעים: $(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)$. אך ארבע אלו אינן יוצרות מרובע: $(1,1,1,3)$, $(1,1,3,1)$, $(1,3,1,1)$, $(3,1,1,1)$.

תתי־משימות

נקודות: 250.

מחבר הבעיה: 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.