Universal Cup Judging System

Universal Cup

Límite de tiempo: 2.0 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓
Estadísticas

An anthill with $N \approx 10^{100}$ ants is located on an infinite plane. Apart from that, the plane contains only a circular honeypot of radius $R$ with center at a distance $d$ from the anthill.

All ants are originally located in the anthill. Then all of them start moving independently of each other. Each ant randomly selects the direction of its movement and moves in the chosen direction with speed $(\Delta t)^{-1/2}$ for $\Delta t$ units of time, thus traveling for a distance of $\sqrt{\Delta t}$ units, where $\Delta t \approx 10^{-100}$ is a very small number. Then each ant repeats the whole process again and again. Whenever an ant is located inside the honeypot, it collects one unit of honey per each unit of time spent inside.

Your task is to simulate the anthill and the honeypot for $T$ units of time after the start and compute two numbers: the fraction $f$ of ants that end up inside the honeypot after $T$ units of time and the average amount $h$ of honey collected by each ant.

Input

The first line of input contains a single integer $k$, the number of test cases ($1 \le k \le 1000$).

Each of the next $k$ lines describes a test case and contains three real numbers, $d$, $R$, and $T$, given with at most four digits after the decimal point ($0 \le d \le 100$; $0.01 \le R \le 100$; $0.01 \le T \le 100$).

Output

You have to output $k$ lines, one line for each test case. Each line should contain the values of $f$ and $h$, separated by one or several spaces. You have to output a value of $f$ that differs from the correct value by at most $10^{-8}$, and a value of $h$ that differs from the correct value by at most $10^{-8} \cdot T$.

Example

Input 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

Output 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.