A8115 | Martian Food
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Have you ever tasted Martian food? Well, you should.
Their signature dish is served on a completely black plate with the radius of $R$ , flat as a pancake.
First, they put a perfectly circular portion of the Golden Honduras on the plate. It has the radius of $r$ and is located as close to the edge of the plate as possible staying entirely within the plate. I. e. Golden Honduras touches the edge of the plate from the inside. It is believed that the proximity of the portion of the Golden Honduras to the edge of a plate demonstrates the neatness and exactness of the Martians.
Then a perfectly round portion of Pink Guadeloupe is put on the plate. The Guadeloupe should not overlap with Honduras, should not go beyond the border of the plate, but should have the maximum radius. I. e. Pink Guadeloupe should touch the edge of the plate from the inside, and touch Golden Honduras from the outside. For it is the size of the Rose Guadeloupe that shows the generosity and the hospitality of the Martians.
Further, the first portion (of the same perfectly round shape) of Green Bull Terrier is put on the plate. It should come in contact with Honduras and Guadeloupe, should not go beyond the border of the plate and should have maximum radius.
Each of the following portions of the Green Bull Terrier must necessarily touch the Golden Honduras, the previous portion of the Green Bull Terrier and touch the edge of a plate, but should not go beyond the border.
To determine whether a stranger is worthy to touch the food, the Martians ask him to find the radius of the $k$ -th portion of the Green Bull Terrier knowing the radii of a plate and a portion of the Golden Honduras. And are you worthy?
Their signature dish is served on a completely black plate with the radius of $R$ , flat as a pancake.
First, they put a perfectly circular portion of the Golden Honduras on the plate. It has the radius of $r$ and is located as close to the edge of the plate as possible staying entirely within the plate. I. e. Golden Honduras touches the edge of the plate from the inside. It is believed that the proximity of the portion of the Golden Honduras to the edge of a plate demonstrates the neatness and exactness of the Martians.
Then a perfectly round portion of Pink Guadeloupe is put on the plate. The Guadeloupe should not overlap with Honduras, should not go beyond the border of the plate, but should have the maximum radius. I. e. Pink Guadeloupe should touch the edge of the plate from the inside, and touch Golden Honduras from the outside. For it is the size of the Rose Guadeloupe that shows the generosity and the hospitality of the Martians.
Further, the first portion (of the same perfectly round shape) of Green Bull Terrier is put on the plate. It should come in contact with Honduras and Guadeloupe, should not go beyond the border of the plate and should have maximum radius.
Each of the following portions of the Green Bull Terrier must necessarily touch the Golden Honduras, the previous portion of the Green Bull Terrier and touch the edge of a plate, but should not go beyond the border.
To determine whether a stranger is worthy to touch the food, the Martians ask him to find the radius of the $k$ -th portion of the Green Bull Terrier knowing the radii of a plate and a portion of the Golden Honduras. And are you worthy?
输入格式
The first line contains integer $t$ ( $1<=t<=10^{4}$ ) — amount of testcases.
Each of the following $t$ lines contain three positive integers: the radii of the plate and a portion of the Golden Honduras $R$ and $r$ ( $1<=r<R<=10^{4}$ ) and the number $k$ ( $1<=k<=10^{4}$ ).
In the pretests $1<=k<=2$ .
Each of the following $t$ lines contain three positive integers: the radii of the plate and a portion of the Golden Honduras $R$ and $r$ ( $1<=r<R<=10^{4}$ ) and the number $k$ ( $1<=k<=10^{4}$ ).
In the pretests $1<=k<=2$ .
输出格式
Print $t$ lines — the radius of the $k$ -th portion of the Green Bull Terrier for each test. The absolute or relative error of the answer should not exceed $10^{-6}$ .
输入输出样例
输入 #1
2 4 3 1 4 2 2
输出 #1
0.9230769231 0.6666666667
Dish from the first sample looks like this:

Dish from the second sample looks like this:


Dish from the second sample looks like this:

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted