CF1100C.NN and the Optical Illusion

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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:

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 nn and the radius of the inner circle rr. NN thinks that, using this information, you can exactly determine the radius of the outer circles RR 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.

NN 是一位经验丰富的互联网用户,这意味着他每天都会花费大量时间在社交媒体上。一次,他在网上发现了如下图片,要求比较内部圆的大小:

结果发现这些内部圆大小相等。NN 对这一事实感到非常惊讶,于是决定自己动手绘制一幅类似的图。

他成功计算出了外部圆的个数 nn 以及内部圆的半径 rr。NN 认为,利用这些信息,可以精确确定外部圆的半径 RR,使得:

  • 内部圆与所有外部圆均外切;
  • 每一对相邻的外部圆也彼此外切。

尽管 NN 尽了最大努力去猜测所需的半径 RR,却始终未能成功。

请帮助 NN 找出构建该图形所需的半径 RR。

输入格式

The first and the only line of the input file contains two numbers nn and rr (3≤n≤1003 \leq n \leq 100, 1≤r≤1001 \leq r \leq 100) — the number of the outer circles and the radius of the inner circle respectively.

输入文件的第一行且唯一一行包含两个数 nn 和 rr(3≤n≤1003 \leq n \leq 100,1≤r≤1001 \leq r \leq 100),分别表示外圆的个数和内圆的半径。

输出格式

Output a single number RR — 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−610^{-6}.

Formally, if your answer is aa and the jury's answer is bb. Your answer is accepted if and only when ∣a−b∣max(1,∣b∣)≤10−6\frac{|a-b|}{max(1, |b|)} \le 10^{-6}.

输出一个数字 RR —— 构建所需图形所需的外圆半径。

若你的答案的相对误差或绝对误差不超过 10−610^{-6},则该答案将被接受。

形式化地,设你的答案为 aa,评测机的答案为 bb,则当且仅当 ∣a−b∣max⁡(1,∣b∣)≤10−6\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

输入解题思路,AI测评打分。不知道怎么写?

首页