QOJ.ac

QOJ

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

#21153. פרות זועמות

Statistics

Bessie עיצבה משחק וידאו שלדעתה יהיה הלהיט הבא: "Angry Cows". הרעיון שהיא מאמינה שהוא מקורי לגמרי הוא ירי פרות ברוגטקה לתמונה חד־ממדית של חבילות חציר בנקודות על ציר המספרים. כל נחיתה חזקה מספיק לפוצץ את החבילות הקרובות. המטרה היא לפוצץ את כולן באמצעות פרות.

יש $N$ חבילות במיקומים שלמים שונים $x_1, x_2, \ldots, x_N$. פרה שנורתה בעוצמה $R$ ונחתה ב־$x$ יוצרת פיצוץ ברדיוס $R$, ההורס את כל החבילות בטווח $x-R \ldots x+R$.

זמינות $K$ פרות, כולן באותה עוצמה $R$. מצאו את הערך השלם המזערי של $R$ המאפשר ל־$K$ הפרות לפוצץ את כל החבילות.

קלט

השורה הראשונה מכילה $N$ ($1 \leq N \leq 50,000$) ו־$K$ ($1 \leq K \leq 10$). $N$ השורות הנותרות מכילות את השלמים $x_1 \ldots x_N$, כל אחד בטווח $0 \ldots 1,000,000,000$.

פלט

הדפיסו את עוצמת הירי המזערית $R$ לכל פרה כדי לפוצץ את כל החבילות.

דוגמאות

קלט 1

7 2
20
25
18
8
10
3
1

פלט 1

5

מחבר הבעיה: Brian Dean

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.