Universal Cup Judging System

Universal Cup

Time Limit: 2.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

無限平面上に、$N \approx 10^{100}$ 匹のアリがいる蟻塚があります。それ以外に平面上にあるのは、中心が蟻塚から距離 $d$ の位置にある半径 $R$ の円形の蜜壺だけです。

最初、すべてのアリは蟻塚の中にいます。その後、すべてのアリは互いに独立に移動を始めます。各アリは移動方向をランダムに選び、その方向へ速さ $(\Delta t)^{-1/2}$ で $\Delta t$ 単位時間だけ移動します。つまり距離 $\sqrt{\Delta t}$ 単位だけ進みます。ここで $\Delta t \approx 10^{-100}$ は非常に小さな数です。そして各アリはこの過程を何度も繰り返します。アリが蜜壺の内部にいる間、内部で過ごした単位時間あたり1単位の蜂蜜を集めます。

あなたの仕事は、開始から $T$ 単位時間にわたって蟻塚と蜜壺をシミュレートし、2つの数値を計算することです。すなわち、$T$ 単位時間後に蜜壺の内部にいるアリの割合 $f$ と、各アリが集めた蜂蜜の平均量 $h$ です。

入力

入力の最初の行には、テストケースの個数を表す単一の整数 $k$ が与えられます($1 \le k \le 1000$)。

続く $k$ 行のそれぞれは1つのテストケースを表し、小数点以下最大4桁で与えられる3つの実数 $d$、$R$、$T$ を含みます($0 \le d \le 100$; $0.01 \le R \le 100$; $0.01 \le T \le 100$)。

出力

各テストケースに対して1行ずつ、合計 $k$ 行を出力してください。各行には $f$ と $h$ の値を1つ以上の空白で区切って出力してください。$f$ の出力値と真の値との差は高々 $10^{-8}$ でなければならず、$h$ の出力値と真の値との差は高々 $10^{-8} \cdot T$ でなければなりません。

入出力例

入力例 1

7
0 1 1
2 1 3
1 2 0.999
1 2 1
1 2 1.001
1 1 1
0 10 10

出力例 1

0.6321205588285579 0.8515044932240781
0.09157635496981011 0.1733100735950181
0.8767916692090618 0.9555113318223997
0.8766185521451777 0.9563880369284812
0.8764454902564369 0.9572645689450815
0.3457458387231645 0.4012213611982974
0.9999546000702375 9.999961697595344

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1212EditorialOpen题解jianglyView

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.