QOJ.ac

QOJ

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

#22734. מאזניים

Statistics

Farmer John מחזיק מאזני פרות ו־$N$ ($1 \le N \le 1000$) משקולות ידועות (31 סיביות) לצד אחד. פרה בצד, משקולות בשני עד איזון. לא עם פרה כי בועטת לפנים כשיכולה. מעל $C$ ($1 \le C < 2^{30}$) בצד שובר.

בסדר קטן לגדול, כל משקולת מהשלישית לפחות סכום השתיים הקודמות.

רוצה מרבית מדויקת, סכום עד $C$, אולי לא כולם.

מרשימה ויכולת מצאו מסה מרבית חוקית למדידה מדויקת.

קלט

שורה 1: שלמים חיוביים $N$, $C$ ברווח.

שורות $2..N+1$: מסה שלמה חיובית בכל, סדר לא יורד מובטח.

פלט

שורה 1: שלם, מרבית מדויקת ובטוחה.

דוגמאות

קלט 1

3 15
1
10
20

פלט 1

11

הערה

שלוש משקולות 1,10,20, גבול צד15.

1 ו10 מודדות11. כל מסה גדולה שאפשר ליצור שוברת.

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.