QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 1024 MB Total points: 100

#3189. 寻找直线

Statistics

Annabel 和 Richard 喜欢发明新游戏并相互对战。有一天,Annabel 给 Richard 带来了一个新游戏。在这个游戏中,有一位游戏主持人和一名玩家。游戏主持人会在纸上画出 $n$ 个点。玩家的任务是找到一条直线,使得至少 $p$ 百分比的点恰好落在该直线上。Richard 和 Annabel 拥有非常精确的测量和绘图工具,因此他们可以检查一个点是否精确地落在某条直线上。如果玩家能找到这样一条直线,则玩家获胜。否则,游戏主持人获胜。

这里有一个问题。游戏主持人画点的方式可能使得根本无法画出符合要求的直线。他们需要一个独立的机制来检查是否存在一条包含至少 $p$ 百分比点的直线,即包含 $\lceil n \cdot p/100 \rceil$ 个点。现在轮到你来帮助他们编写程序解决这个问题了。

输入格式

输入包含: 一行一个整数 $n$ ($1 \le n \le 10^5$),表示游戏主持人画出的点数; 一行一个整数 $p$ ($20 \le p \le 100$),表示需要落在直线上的点的百分比; * $n$ 行,每行包含两个整数 $x$ 和 $y$ ($0 \le x, y \le 10^9$),表示一个点的坐标。

任意两点不会重合。

输出格式

输出一行,如果能找到符合要求的直线,输出 “possible”,否则输出 “impossible”。

图 F.1:样例输入说明

样例

输入 1

5
55
0 0
10 10
10 0
0 10
3 3

输出 1

possible

输入 2

5
45
0 0
10 10
10 0
0 10
3 4

输出 2

impossible

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.