QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#3450. 坠落的马克杯

Statistics

Susan 正在制作咖啡杯坠落的高速视频。在分析视频时,她想知道杯子有多大,但不幸的是,它们在拍摄过程中都损坏了。不过,Susan 懂一些物理知识,因此她计算出了它们在不同视频帧之间移动的距离。摄像机的拍摄速度为每秒 70 帧,这意味着从杯子释放开始计算,在第 $n$ 帧时,它移动的距离为 $d = n^2$ 毫米。帧的计数从 0 开始。

Susan 认为某个杯子的高度为 $D$ 毫米,但为了验证这一点,她需要找到两个帧,使得杯子在这两帧之间移动的距离恰好为这个数值。你能帮她完成这个任务吗?

输入格式

输入包含一个正整数 $D \le 200\,000$,即需要测量的距离。

输出格式

输出两个非负整数 $n_1$ 和 $n_2$,即 Susan 应该比较的帧编号。它们应该满足 $n_2^2 - n_1^2 = D$。如果不存在这样的两个整数,则输出 “impossible”。

样例

输入格式 1

88

输出格式 1

9 13

输入格式 2

86

输出格式 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.