???Finding the Radius for an Inserted Circle
2017-09-25 22:34
246 查看
Three circles C_{a}Ca, C_{b}Cb,
and C_{c}Cc,
all with radius RR and
tangent to each other, are located in two-dimensional space as shown in Figure 11.
A smaller circle C_{1}C1 with
radius R_{1}R1 (R_{1}<RR1<R)
is then inserted into the blank area bounded by C_{a}Ca, C_{b}Cb,
and C_{c}Cc so
that C_{1}C1 is
tangent to the three outer circles, C_{a}Ca, C_{b}Cb,
and C_{c}
2354a
Cc.
Now, we keep inserting a number of smaller and smaller circles C_{k}\
(2 \leq k \leq N)Ck (2≤k≤N) with
the corresponding radius R_{k}Rk into
the blank area bounded by C_{a}Ca, C_{c}Cc and C_{k-1}Ck−1 (2
\leq k \leq N)(2≤k≤N),
so that every time when the insertion occurs, the inserted circle C_{k}Ck is
always tangent to the three outer circles C_{a}Ca, C_{c}Cc and C_{k-1}Ck−1,
as shown in Figure 11
![](https://res.jisuanke.com/img/upload/20170920/1944ff32865c0d3d9750980922f3811d1d3b81f0.png)
Figure 1.
(Left) Inserting a smaller circle C_{1}C1 into
a blank area bounded by the circle C_{a}Ca, C_{b}Cb and C_{c}Cc.
(Right) An enlarged view of inserting a smaller and smaller circle C_{k}Ck into
a blank area bounded by C_{a}Ca, C_{c}Cc and C_{k-1}Ck−1 (2
\leq k \leq N2≤k≤N),
so that the inserted circle C_{k}Ck is
always tangent to the three outer circles, C_{a}Ca, C_{c}Cc,
and C_{k-1}Ck−1.
Now, given the parameters RR and kk,
please write a program to calculate the value of R_{k}Rk,
i.e., the radius of the k-thk−th inserted
circle. Please note that since the value of R_kRk may
not be an integer, you only need to report the integer part of R_{k}Rk.
For example, if you find that R_{k}Rk = 1259.89981259.8998 for
some kk,
then the answer you should report is 12591259.
Another example, if R_{k}Rk = 39.102939.1029 for
some kk,
then the answer you should report is 3939.
Assume that the total number of the inserted circles is no more than 1010,
i.e., N
\leq 10N≤10.
Furthermore, you may assume \pi
= 3.14159π=3.14159.
The range of each parameter is as below:
1
\leq k \leq N1≤k≤N,
and 10^{4}
\leq R \leq 10^{7}104≤R≤107.
Contains l
+ 3l+3 lines.
Line 11: ll -----------------
the number of test cases, ll is
an integer.
Line 22: RR ---------------- RR is
a an integer followed by a decimal point,then followed by a digit.
Line 33: kk ----------------
test case #11, kk is
an integer.
\ldots…
Line i+2i+2: kk -----------------
test case # ii.
\ldots…
Line l
+2l+2: kk ------------
test case #ll.
Line l
+ 3l+3: -1−1 ----------
a constant -1−1 representing
the end of the input file.
Contains ll lines.
Line 11: kk R_{k}Rk ----------------output
for the value of kk and R_{k}Rk at
the test case #11,
each of which should be separated by a blank.
\ldots…
Line ii: kk R_{k}Rk ----------------output
for kk and
the value of R_{k}Rk at
the test case # ii,
each of which should be separated by a blank.
Line ll: kk R_{k}Rk ----------------output
for kk and
the value ofR_{k}Rk at
the test case # ll,
each of which should be separated by a blank.
2017
ACM-ICPC 亚洲区(南宁赛区)网络赛
and C_{c}Cc,
all with radius RR and
tangent to each other, are located in two-dimensional space as shown in Figure 11.
A smaller circle C_{1}C1 with
radius R_{1}R1 (R_{1}<RR1<R)
is then inserted into the blank area bounded by C_{a}Ca, C_{b}Cb,
and C_{c}Cc so
that C_{1}C1 is
tangent to the three outer circles, C_{a}Ca, C_{b}Cb,
and C_{c}
2354a
Cc.
Now, we keep inserting a number of smaller and smaller circles C_{k}\
(2 \leq k \leq N)Ck (2≤k≤N) with
the corresponding radius R_{k}Rk into
the blank area bounded by C_{a}Ca, C_{c}Cc and C_{k-1}Ck−1 (2
\leq k \leq N)(2≤k≤N),
so that every time when the insertion occurs, the inserted circle C_{k}Ck is
always tangent to the three outer circles C_{a}Ca, C_{c}Cc and C_{k-1}Ck−1,
as shown in Figure 11
![](https://res.jisuanke.com/img/upload/20170920/1944ff32865c0d3d9750980922f3811d1d3b81f0.png)
Figure 1.
(Left) Inserting a smaller circle C_{1}C1 into
a blank area bounded by the circle C_{a}Ca, C_{b}Cb and C_{c}Cc.
(Right) An enlarged view of inserting a smaller and smaller circle C_{k}Ck into
a blank area bounded by C_{a}Ca, C_{c}Cc and C_{k-1}Ck−1 (2
\leq k \leq N2≤k≤N),
so that the inserted circle C_{k}Ck is
always tangent to the three outer circles, C_{a}Ca, C_{c}Cc,
and C_{k-1}Ck−1.
Now, given the parameters RR and kk,
please write a program to calculate the value of R_{k}Rk,
i.e., the radius of the k-thk−th inserted
circle. Please note that since the value of R_kRk may
not be an integer, you only need to report the integer part of R_{k}Rk.
For example, if you find that R_{k}Rk = 1259.89981259.8998 for
some kk,
then the answer you should report is 12591259.
Another example, if R_{k}Rk = 39.102939.1029 for
some kk,
then the answer you should report is 3939.
Assume that the total number of the inserted circles is no more than 1010,
i.e., N
\leq 10N≤10.
Furthermore, you may assume \pi
= 3.14159π=3.14159.
The range of each parameter is as below:
1
\leq k \leq N1≤k≤N,
and 10^{4}
\leq R \leq 10^{7}104≤R≤107.
Input Format
Contains l+ 3l+3 lines.
Line 11: ll -----------------
the number of test cases, ll is
an integer.
Line 22: RR ---------------- RR is
a an integer followed by a decimal point,then followed by a digit.
Line 33: kk ----------------
test case #11, kk is
an integer.
\ldots…
Line i+2i+2: kk -----------------
test case # ii.
\ldots…
Line l
+2l+2: kk ------------
test case #ll.
Line l
+ 3l+3: -1−1 ----------
a constant -1−1 representing
the end of the input file.
Output Format
Contains ll lines.Line 11: kk R_{k}Rk ----------------output
for the value of kk and R_{k}Rk at
the test case #11,
each of which should be separated by a blank.
\ldots…
Line ii: kk R_{k}Rk ----------------output
for kk and
the value of R_{k}Rk at
the test case # ii,
each of which should be separated by a blank.
Line ll: kk R_{k}Rk ----------------output
for kk and
the value ofR_{k}Rk at
the test case # ll,
each of which should be separated by a blank.
样例输入
1 152973.6 1 -1
样例输出
1 23665
题目来源
2017ACM-ICPC 亚洲区(南宁赛区)网络赛
相关文章推荐
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 G. Finding the Radius for an Inserted Circle
- 【计算几何】【圆反演】计蒜客17314 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 G. Finding the Radius for an Inserted Circle
- hdu 6158 The Designer && 计蒜客 Finding the Radius for an Inserted Circle 笛卡尔定理应用+韦达定理
- G.Finding the Radius for an Inserted Circle 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- Finding the Radius for an Inserted Circle 笛卡尔定理 - 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- 2017 ACM-ICPC南宁网络赛: G. Finding the Radius for an Inserted Circle
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 G. Finding the Radius for an Inserted Circle
- Finding the Radius for an Inserted Circle--2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
- hdu 6158 The Designer && 计蒜客 Finding the Radius for an Inserted Circle 笛卡尔定理应用
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛: G. Finding the Radius for an Inserted Circle(笛卡尔定理)
- How to calculate the SVG Path for an arc (of a circle)
- The Entity Health monitor for an Operations Manager 2007 management server displays "Critical"
- The package needs to be reinstalled, but I can't find an archive for it.
- Choosing an I/O Scheduler for Red Hat Enterprise Linux and the 2.6 Kernel
- Add an onclick event in the DataGrid for any Column
- 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
- 104.View the Exhibit to examine the details for an incident.
- 使用apt导入时报警告:Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
- Looking for an example for inserting content into the response using a servlet filter
- An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more informat