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.

Input

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

Output

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

Examples

input

Copy

3 1

output

Copy

6.4641016

input

Copy

6 1

output

Copy

1.0000000

input

Copy

100 100

output

Copy

3.2429391

思路:利用公式计算,考虑一下精度就ok了(可以用acos(-1)来计算pi)

代码:

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#define PI 3.141592654
using namespace std; int main()
{ double n,r;
cin>>n>>r; printf("%.7f",r*sin(PI/n)/(1-sin(PI/n))); return 0;
}

Codeforces Round #532 (Div. 2)- C(公式计算)的更多相关文章

  1. Codeforces Round #532 (Div. 2)

    Codeforces Round #532 (Div. 2) A - Roman and Browser #include<bits/stdc++.h> #include<iostr ...

  2. Codeforces Round #532 (Div. 2) 题解

    Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出 ...

  3. Codeforces Round #532(Div. 2) C.NN and the Optical IIIusion

    链接:https://codeforces.com/contest/1100/problem/C 题意: 一个圆球外面由其他圆球包裹,两两相连. 给出n,r. n为外面圆球数量,r为内部圆球半径. 求 ...

  4. Codeforces Round #532 (Div. 2) F 线性基(新坑) + 贪心 + 离线处理

    https://codeforces.com/contest/1100/problem/F 题意 一个有n个数组c[],q次询问,每次询问一个区间的子集最大异或和 题解 单问区间子集最大异或和,线性基 ...

  5. Codeforces Round #532 (Div. 2):F. Ivan and Burgers(贪心+异或基)

    F. Ivan and Burgers 题目链接:https://codeforces.com/contest/1100/problem/F 题意: 给出n个数,然后有多个询问,每次回答询问所给出的区 ...

  6. Codeforces Round #532 (Div. 2)- B(思维)

    Arkady coordinates rounds on some not really famous competitive programming platform. Each round fea ...

  7. Codeforces Round #532(Div. 2) B.Build a Contest

    链接:https://codeforces.com/contest/1100/problem/B 题意: 给n,m. 给m个数,每个数代表一个等级,没给一个将其添加到题目池中,当题目池中有难度(1-n ...

  8. Codeforces Round #532(Div. 2) A.Roman and Browser

    链接:https://codeforces.com/contest/1100/problem/A 题意: 给定n,k. 给定一串由正负1组成的数. 任选b,c = b + i*k(i为任意整数).将c ...

  9. Codeforces Round #532 (Div. 2) E. Andrew and Taxi(二分+拓扑排序)

    题目链接:https://codeforces.com/contest/1100/problem/E 题意:给出 n 个点 m 条边的有向图,要翻转一些边,使得有向图中不存在环,问翻转的边中最大权值最 ...

随机推荐

  1. 使用myeclipse开发Servlet

    1.在myeclipse中创建一个web工程 2.在src目录下建立一个包并建立一个Servlet(myeclipse会自把Servlet映射到web.xml文件中) 3.发布工程,实际上就是把web ...

  2. pow求一个数的n次幂

    #!/usr/bin/env python i = pow(2,5) #求一个数的n次幂 print(i) C:\Python35\python3.exe F:/Python/2day/c6.py 3 ...

  3. 如何取消WIN7的共享密码

    如何取消WIN7的共享密码 把你的Guest帐号的密码设为空.如何设置呢? 1.右键“计算机”-“管理”-“本地用户和组”-“用户”-右键帐号“Guest”-“设置密码”,然后直接点击确定,不予设置密 ...

  4. apaache php 日记设计

    有个客户服务器是用apache搭建的,最近总是感觉站很慢,服务器很慢很卡,有时候甚至网 站都打不开,后来经过排查分析原来是里面的access.log和error.log这两个文件要经常上去看,和清理, ...

  5. 10.model/view实例(4)

    任务:给表单的每一列添加列名. 思考: 1.只需要添加一个函数 headerData(). 横向方面添加列名 代码如下: QVariant MyModel::headerData(int sectio ...

  6. javascript 准确的判断类型方法

    在 JavaScript 里使用 typeof 来判断数据类型,只能区分基本类型,即 “number”,”string”,”undefined”,”boolean”,”object” 五种. 对于数组 ...

  7. jquery 使用记录

    1.jquery 筛选一个属性符合多个条件  var myTag=$("input[id=myid][name=myname][type=button]").length; 2.j ...

  8. Android简单的monkey测试

    Android中的monkey测试是比较常用的工具了,设定好monkey之后,让手机跑一晚上,第二天分析日志,这样能更加有效率的工作. monkey测试的工具比较多,基本的方法都差不多. 抓取日志: ...

  9. Xshell连接linux(deepin)时提示ssh服务器拒绝了密码,请再试一次解决方法

    用Xshell root连接时显示ssh服务器拒绝了密码,应该是应该是sshd的设置不允许root用户用密码远程登录 修改 /etc/ssh/sshd_config文件,注意,安装了openssh才会 ...

  10. Dapper --Execute

    Dapper-Execute Ececute是一种可被任何IDbConnection类型的对象调用的扩展方法.它可以执行一次或多次命令, 并返回受影响的行数.此方法通常用于执行存储过程.插入.更新.删 ...