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 <stdio.h>
#include <stdlib.h>
#include<string.h>
#define pi 3.1415926535
int 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;
}

NN and the Optical Illusion(数学)相关推荐

  1. CF 1100C NN and the Optical Illusion(数学)

    题目意思:用n个外圆将半径为r的內圆包围起来,使得彼此之间能够相切,问外圆的半径为多少? 解题思路:这是一道几何题,我们需要引入辅助线 我们设外圆的半径为R 我们可以得到左边(左右其实都一样)那个等腰 ...

  2. CodeForces-1100C NN and the Optical Illusion 简单数学

    题目链接:https://vjudge.net/problem/CodeForces-1100C 题意: 题目给出外部圆的数目n和内部圆的半径r,要求求出外部圆的半径以满足图片要求. 显然这是一道数学 ...

  3. CF1100C - NN and the Optical Illusion

    题意:给你n和r,n为围着中间的圆的外面的圆的个数(有点绕口?),R为中间的圆的半径,问外面的圆的半径r. 题解:数学问题,易得r=R*sin(360/2/n)/(1-sin(360/2/n)). # ...

  4. 1100C NN and the Optical Illusion

    推公式,水题.cos()函数是默认弧度制的 1 #include <iostream> 2 #include <cstring> 3 #include <string&g ...

  5. C. NN and the Optical Illusion(几何)

    题目链接:http://codeforces.com/contest/1100/problem/C 题目大意:给你n和r,n指的是有n个圆围在里面的圆的外面,r指的是里面的圆的半径,然后让你求外面的圆 ...

  6. NN and the Optical Illusion-光学幻觉 CodeForce1100C 几何

    题目链接:NN and the Optical Illusion 题目原文 NN is an experienced internet user and that means he spends a ...

  7. 阴影错觉Optical illusion

    阴影错觉(Optical illusion)的例子有很多,我们这里列举一个edward adelson的例子,首先观察下面的图像 请问棋盘上A和B两个方格哪个更亮? 相信大家的答案都是A方格更亮,毕竟 ...

  8. 如何使数学语言精确化

    提示:本文是<数学思维导论-学会像数学家一样思考>的读书笔记. 引言:自然语言和数学语言的不同    在我们的日常生活中,语言是人与人的交流的基本工具.语言以文字和语音的形式将信息传递给他 ...

  9. 保持危机感和紧迫感_什么是紧迫的:您需要知道的一切

    保持危机感和紧迫感 Putting the finishing touches on a graphic design project calls for a keen eye. But you al ...

最新文章

  1. MindSpore基本原理
  2. 为什么edge AI是一个无需大脑的人
  3. 网络名称空间 实例研究 veth处于不同网络的路由问题
  4. SharePoint 2007/2010 的SPGridView 控件常见的两个问题
  5. nginx 查看 $1,$2,$3
  6. 如何解决error message Data cannot be maintained for set type COM_TA_R3_ID
  7. AtCoder Beginner Contest 177总结
  8. C/C++ OpenCV直方图均衡化
  9. 【今日CS 视觉论文速览】Mon, 7 Jan 2019
  10. leecode - 入门 -- 双指针秒杀数组/链表题目
  11. MySQL5.7多实例自动化部署脚本
  12. ASP.NET实现简单的聊天室
  13. SSH学习(一)—— 基础概念篇
  14. 玩转多元化主播打法,扶持达人红出圈,火山小视频的运营方法论
  15. J-link 报错解决方法
  16. mysql 分析explain命令执行sql的计划
  17. Scrapy教程经典实战【新概念英语】
  18. MongoDB中balancer操作
  19. 程序包清单签名验证失败
  20. 深度神经网络与人脑神经网络哪些区域有一定联系?

热门文章

  1. 《J2SE 回炉再造09》-------溺水狗
  2. 图片加水印后下载(满屏水印,单个水印,可自定义角度)
  3. 在淘宝上买一元夺宝代码受骗记
  4. Excel函数——计算统计类
  5. 「Leakcanary 源码分析」看这一篇就够了
  6. 北京大学王立威教授:机器学习理论的回顾与展望
  7. Allegro 17.4打开文件后崩溃闪退的解决
  8. 打开eclipse出现Incompatible JVM解决方法
  9. 使用scrapy爬取伯乐在线多线程存为MySQL数据库
  10. docker学习2--centos7下安装