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. springboot启动异常java.lang.NoSuchFieldError: DEFAULT_INCOMPATIBLE_IMPROVEMENTS

    解决办法一 yml或者Properties文件中配置 spring.freemarker.check-template-location=false 解决办法二 @SpringBootApplicat ...

  2. mysql in 方法查询 按照 in队列里的顺序排序

    String sql ' GROUP BY comm " + "order by field(comm,?,?,?,?,?,?,?,?)"; stmt = conn.pr ...

  3. 浅谈时钟的生成(js手写代码)(非原创)

    在生成时钟的过程中自己想到布置表盘的写法由这么几种: 当然利用那种模式都可以实现,所以我们要用一个最好理解,代码有相对简便的方法实现 1.利用三角函数 用js在三角函数布置表盘的过程中有遇见到这种情况 ...

  4. winform 对话框控件

    ColorDialog 可以调节颜色的控件,如果给一个按钮点击事件 ColorDialog.showdialog();就会弹出这个 返回值是个枚举类 然后定义一个这个类的变量 接收一下它的返回值 Di ...

  5. 389. Find the Difference 找出两个字符串中多余的一个字符

    [抄题]: Given two strings s and t which consist of only lowercase letters. String t is generated by ra ...

  6. K-D TREE算法原理及实现

    博客转载自:https://leileiluoluo.com/posts/kdtree-algorithm-and-implementation.html k-d tree即k-dimensional ...

  7. linux安装thrift

    安装配置Thrift Thrift的编译器使用C++编写的,在安装编译器之前,首先应该保证操作系统基本环境支持C++的编译,安装相关依赖的软件包,如下所示 sudo yum install autom ...

  8. 100725B Banal Tickets

    传送门 题目大意 有2*n个位置,这些位置有的已经填上了数,有的还没有(用?表示),现在让你在还没有填上数的填0~9中的任意数,使得前n个数的乘积等于后n个数的乘积,问有多少种方案. 分析 首先这个题 ...

  9. CF1030F Putting Boxes Together

    昨晚的比赛题.(像我这种蒟蒻只能打打div2) 题意 给你$n$个物品,每一个物品$i$,有一个权值$w_i$和一个位置$a_i$,定义移动一个物品$i$到位置$t$的代价为$w_i * \left ...

  10. Python如何打包EXE可执行文件

    一.安装Pyinstaller 使用Python打包EXE可执行文件时,需要使用Pyinstaller,使用命令pip install PyInstaller进行安装,如下图: 安装成功后的效果如下图 ...