QOJ.ac

QOJ

حد الوقت: 8.0 s حد الذاكرة: 512 MB مجموع النقاط: 100 قابلة للهجوم ✓

#12059. 分割苹果派

الإحصائيات

Hyon Il 是一位品学兼优的学生。他总是对同学非常友善,所有的朋友也都喜欢他。 有一天,他带来了一个美味的大苹果派,准备分给他的朋友们。 有趣的是,这个苹果派是椭圆形的。 他总是进行两种操作。 第一种操作是计算角度 $L$ 和 $R$ 之间剩余苹果派的面积。 第二种操作是分发角度 $L$ 和 $R$ 之间所有的苹果派。 Hyon Il 将苹果派放置在笛卡尔坐标系中,使得派位于椭圆 $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$ 的内部。 你是 Hyon Il 的兄弟,想要测试一下弟弟的计算能力,所以你必须计算所有的查询。 你能做到吗?好的。 哦,还有一个条件…… 设 $prev$ 为上一次输出的数字,那么真实的 $L$ 和 $R$ 按以下公式计算: $$L_{real} = (L_{given} + prev) \pmod{360}, R_{real} = (R_{given} + prev) \pmod{360}$$ 如果 $L_{real} > R_{real}$,则必须交换这两个值。 你必须使用这两个值 $L_{real}$ 和 $R_{real}$ 进行操作。 初始时 $prev = 0$。

输入格式

输入文件的第一行包含三个整数 $a, b, n$ ($1 \le a, b \le 100, n \le 300000$)。 $a$ 和 $b$ 是上述椭圆的参数,$n$ 是操作次数。 接下来的 $n$ 行包含三个值 type L R。 ($1 \le type \le 2$,且 $L$ 和 $R$ 为随机实数。) 保证 $0 \le L + prev$,$0 \le R + prev$。

输出格式

对于每个类型为 1 的操作,你必须计算结果。 请四舍五入保留小数点后 5 位。

样例

输入 1

10 10 3
1 10.00000 30.00000
2 40.00000 70.00000
1 10.00000 300.00000

输出 1

17.45329
226.89280

说明

为了简化问题,$L$ 和 $R$ 也以小数点后 5 位的形式给出。 $prev$ 是上一次类型为 1 的查询所输出的数字。 例如,$prev = 17.45329$,尽管真实答案是 $17.453297519943295769236907684886\dots$。

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.