博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
NN and the Optical Illusion(数学)
阅读量:3946 次
发布时间:2019-05-24

本文共 1661 字,大约阅读时间需要 5 分钟。

NN and the Optical Illusion(数学)

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

Input

The first and the only line of the input file contains two numbers n

and r (3≤n≤100, 1≤r≤100) — the number of the outer circles and the
radius of the inner circle respectively.

Output

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 |a−b|max(1,|b|)≤10−6.

Examples Input

3 1

标题Output

6.4641016

标题Input

6 1

Output

这里是引用

1.0000000

Input

100 100

Output

3.2429391

代码如下(数学计算):

#include 
#include
#include
#define pi 3.1415926535int main(){ double n,r; scanf("%lf%lf",&n,&r); double x=pi*(n-2)/n; printf("%.7f\n",r*cos(x/2)/(1-cos(x/2))); return 0;}

转载地址:http://jwhwi.baihongyu.com/

你可能感兴趣的文章
如何在JNI中抛异常
查看>>
Android应用程序的完全退出
查看>>
Task和Activity相关的一些属性
查看>>
JAVA系统属性之user.home
查看>>
Android代码截屏
查看>>
Android中打印代码的调用层次
查看>>
成功者十三个价值连城的习惯
查看>>
特别成功的人会做6件事
查看>>
Android: 用jni 获取MAC地址
查看>>
字符串列表的C语言实现:c_strlist
查看>>
客户沟通的方式:礼貌待客沟通方式,技巧推广沟通方式,个性服务沟通方式
查看>>
用弹性工作制留住员工
查看>>
知识=经验×反思2
查看>>
领导者如何发现关键问题
查看>>
学习无为领导力
查看>>
卓越领导看过程
查看>>
领导力与各种循环挑战
查看>>
达成谈判协议 - 避免操之过急
查看>>
销售人说话“十大忌”
查看>>
营销中的“战略非对称”
查看>>