305857: CF1100C. NN and the Optical Illusion
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
NN and the Optical Illusion
题意翻译
## 题目描述 有一个圆,在其周围摆一圈圆,如图所示: ![](https://cdn.luogu.org/upload/vjudge_pic/CF1100C/a0c9f6bd15b532673873e8a75fb88103ad5b8775.png) 现已知**内圆半径**$r$,和**外圆个数**$n$,你要求出**外圆半径**$R$。 假设你输出的答案是$a$,标准答案为$b$;若$\frac{|a-b|}{\max(1,|b|)}\le10^{-6}$,你的答案被算作正确。 ## 输入输出格式: ### 输入格式: 一行两个数,$n$和$r$,表示**外圆数量**和**内圆半径** ### 输出格式: 一行一个数$R$,表示**外圆半径**。 ## 说明 ### 数据范围: $3\le n\le100,n\in\mathbb{Z}$ $1\le r\le 100$题目描述
NN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1100C/a0c9f6bd15b532673873e8a75fb88103ad5b8775.png)It turned out that the circles are equal. NN was very surprised by this fact, so he decided to create a similar picture himself. He managed to calculate the number of outer circles $ n $ and the radius of the inner circle $ r $ . NN thinks that, using this information, you can exactly determine the radius of the outer circles $ R $ so that the inner circle touches all of the outer ones externally and each pair of neighboring outer circles also touches each other. While NN tried very hard to guess the required radius, he didn't manage to do that. Help NN find the required radius for building the required picture.输入输出格式
输入格式
The first and the only line of the input file contains two numbers $ n $ and $ r $ ( $ 3 \leq n \leq 100 $ , $ 1 \leq r \leq 100 $ ) — the number of the outer circles and the radius of the inner circle respectively.
输出格式
Output a single number $ R $ — the radius of the outer circle required for building the required picture. Your answer will be accepted if its relative or absolute error does not exceed $ 10^{-6} $ . Formally, if your answer is $ a $ and the jury's answer is $ b $ . Your answer is accepted if and only when $ \frac{|a-b|}{max(1, |b|)} \le 10^{-6} $ .
输入输出样例
输入样例 #1
3 1
输出样例 #1
6.4641016
输入样例 #2
6 1
输出样例 #2
1.0000000
输入样例 #3
100 100
输出样例 #3
3.2429391