#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
void fix(char *s,char x,char y,int n)
{
    int b[200001];
    for(int i=0;i<n;i++)
        b[i]=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]==x&&b[i]==0)
        {
           s[i]=y;
           b[i]=1;
        }
    }
    for(int i=0;i<n;i++)
    {
        if(s[i]==y&&b[i]==0)
            s[i]=x;
    }
}
int main()
{
    int n,m;
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        fix(s,x,y,n);
    }
    cout<<s;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
void fix(char *s,char x,char y,int n)
{
    /*int b[200001];
    for(int i=0;i<=n/2;i++)
    {
       b[i]=0;
       b[n-i-1]=0;
    }*/
    int k;
    if(n%2==0)
        k=n/2;
    else
        k=n/2+1;
    for(int i=0;i<k;i++)
    {
        if(s[i]==x)
        {
           s[i]=y;
        }
        else
        if(s[i]==y)
            s[i]=x;
        if(s[n-i-1]==x&&i!=k-1)
        {
            s[n-i-1]=y;
        }
        else
        if(s[n-i-1]==y&&i!=k-1)
            s[n-i-1]=x;
    }
}
int main()
{
    int n,m;
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        fix(s,x,y,n);
    }
    cout<<s;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
void fix(char *s,char x,char y,int n)
{
    /*int b[200001];
    for(int i=0;i<=n/2;i++)
    {
       b[i]=0;
       b[n-i-1]=0;
    }*/
    int k;
    if(n%2==0)
        k=n/2;
    else
        k=n/2+1;
    for(int i=0;i<k;i++)
    {
        if(s[i]==x)
        {
           s[i]=y;
        }
        else
        if(s[i]==y)
            s[i]=x;
        if(s[n-i-1]==x&&i!=(k%2==0?k-1:k))
        {
            s[n-i-1]=y;
        }
        else
        if(s[n-i-1]==y&&i!=(k%2==0?k-1:k))
            s[n-i-1]=x;
    }
}
int main()
{
    int n,m;
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        fix(s,x,y,n);
    }
    cout<<s;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
void fix(char *s,char x,char y,int n)
{
    /*int b[200001];
    for(int i=0;i<=n/2;i++)
    {
       b[i]=0;
       b[n-i-1]=0;
    }*/
    for(int i=0;i<=n/2;i++)
    {
        if(s[i]==x)
        {
           s[i]=y;
        }
        else
        if(s[i]==y)
            s[i]=x;
        if(s[n-i-1]==x)
        {
            s[n-i-1]=y;
        }
        else
        if(s[n-i-1]==y)
            s[n-i-1]=x;
    }
}
int main()
{
    int n,m;
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        fix(s,x,y,n);
    }
    cout<<s;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
void fix(char *s,char x,char y,int n)
{
    int b[200001];
    for(int i=0;i<=n/2;i++)
    {
       b[i]=0;
       b[n-i-1]=0;
    }
    for(int i=0;i<=n/2;i++)
    {
        if(s[i]==x&&b[i]==0)
        {
           s[i]=y;
           b[i]=1;
        }
        if(s[n-i-1]==x&&b[n-i-1]==0)
        {
            s[n-i-1]=y;
            b[n-i-1]=1;
        }
    }
    for(int i=0;i<=n/2;i++)
    {
        if(s[i]==y&&b[i]==0)
            s[i]=x;
        if(s[n-i-1]==y&&b[n-i-1]==0)
            s[n-i-1]=x;
    }
}
int main()
{
    int n,m;
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        fix(s,x,y,n);
    }
    cout<<s;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
void fix(char *s,char x,char y,int n)
{
    int b[200001];
    for(int i=0;i<=n/2;i++)
    {
       b[i]=0;
       b[n-i-1]=0;
    }
    for(int i=0;i<=n/2;i++)
    {
        if(s[i]==x&&b[i]==0)
        {
           s[i]=y;
           b[i]=1;
        }
        if(s[n-i-1]==x&&b[n-i-1]==0)
        {
            s[n-i-1]=y;
            b[n-i-1]=1;
        }
        if(s[i]==y&&b[i]==0)
            s[i]=x;
        if(s[n-i-1]==y&&b[n-i-1]==0)
            s[n-i-1]=x;
    }
}
int main()
{
    int n,m;
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        fix(s,x,y,n);
    }
    cout<<s;
}


#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
    int n,m,a[26];
    char s[200001],x,y;
    cin>>n>>m;
    cin.ignore();
    gets(s);
    for(int i=0;i<26;i++)
        a[i]=i;
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        for(int j=0;j<26;j++)
        {
            if(a[j]==x-'a')
                a[j]=y-'a';
            else
                if(a[j]==y-'a')
                    a[j]=x-'a';
        }
    }
    for(int i=0;i<n;i++)
        s[i]=a[s[i]-'a']+'a';
    cout<<s;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, ch;
	vector<int> tmp;
	map<char, vector<int> > mp;
	cin>>n>>ch;
	string m;
	cin>>m;

	for(int i = 0 ; i < n ; i++)
		mp[m[i]].push_back(i);

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		if(a==b) continue;
		cin>>a>>b;
		tmp = mp[a];
		mp[a] = mp[b];
		mp[b] = tmp;
	}

	char* ans = new char[n];
	for(map<char,vector<int> >::iterator it = mp.begin(); it != mp.end() ; it++)
		for(int i = 0; i < it->second.size(); i++)
			ans[it->second[i]]=it->first;

	for(int i = 0 ; i < n ; i++)
		cout<<ans[i];

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, ch;
	vector<int> tmp;
	vector<int> mp[26];
	cin>>n>>ch;
	string m;
	cin>>m;

	for(int i = 0 ; i < n ; i++)
		mp[m[i]-'a'].push_back(i);

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		//if(a==b) continue;
		cin>>a>>b;
		tmp = mp[a-'a'];
		mp[a-'a'] = mp[b-'a'];
		mp[b-'a'] = tmp;
	}

	char* ans = new char[n];
	for(int i = 0 ; i < 26 ; i++)
		for(int j = 0; j < mp[i].size(); j++)
			ans[mp[i][j]] = 'a' + i;

	for(int i = 0 ; i < n ; i++)
		cout<<ans[i];

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n, ch;
	vector<int> tmp;
	vector<int> mp[26];

	cin>>n>>ch;
	string m;
	cin>>m;

	for(int i = 0 ; i < n ; i++)
		mp[m[i]-'a'].push_back(i);

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		//if(a==b) continue;
		cin>>a>>b;
		tmp = mp[a-'a'];
		mp[a-'a'] = mp[b-'a'];
		mp[b-'a'] = tmp;
	}

	char* ans = new char[n];
	for(int i = 0 ; i < 26 ; i++)
		for(int j = 0; j < mp[i].size(); j++)
			ans[mp[i][j]] = 'a' + i;

	for(int i = 0 ; i < n ; i++)
		printf("%c",ans[i]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, ch;
	vector<int> tmp;
	vector<int> mp[26];
	cin>>n>>ch;
	string m;
	cin>>m;

	for(int i = 0 ; i < n ; i++)
		mp[m[i]-'a'].push_back(i);

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		//if(a==b) continue;
		cin>>a>>b;
		tmp = mp[a];
		mp[a] = mp[b];
		mp[b] = tmp;
	}

	char* ans = new char[n];
	for(int i = 0 ; i < 26 ; i++)
		for(int j = 0; j < mp[i].size(); j++)
			ans[mp[i][j]] = 'a' + i;

	for(int i = 0 ; i < n ; i++)
		cout<<ans[i];

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, ch;

	cin>>n>>ch;
	string m;
	cin>>m;

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		//if(a==b) continue;
		cin>>a>>b;
	for(int y=0;y<n;y++){
	if(m[y]==a)m[y]=b;
	else if(m[y]==b)m[y]=a;

	}
	}

cout<<m;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n, ch;
	vector<int> mp[26];

	cin>>n>>ch;
	string m;
	cin>>m;

	for(int i = 0 ; i < n ; i++)
		mp[m[i]-'a'].push_back(i);

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		cin>>a>>b;
		if(a==b)continue;
		swap(mp[a-'a'],mp[b-'a']);
	}

	char* ans = new char[n];
	for(int i = 0 ; i < 26 ; i++)
		for(int j = 0; j < mp[i].size(); j++)
			ans[mp[i][j]] = 'a' + i;

	for(int i = 0 ; i < n ; i++)
		printf("%c",ans[i]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, ch;
	vector<int> tmp;
	map<char, vector<int> > mp;
	cin>>n>>ch;
	string m;
	cin>>m;

	for(int i = 0 ; i < n ; i++)
		mp[m[i]].push_back(i);

	for( int i = 0 ; i < ch ; i++){
		char a , b;
		//if(a==b) continue;
		cin>>a>>b;
		tmp = mp[a];
		mp[a] = mp[b];
		mp[b] = tmp;
	}

	char* ans = new char[n];
	for(map<char,vector<int> >::iterator it = mp.begin(); it != mp.end() ; it++)
		for(int i = 0; i < it->second.size(); i++)
			ans[it->second[i]]=it->first;

	for(int i = 0 ; i < n ; i++)
		cout<<ans[i];

	return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<string>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main()
{
	int a,n,t;
	int i,j,k,r,e;
	char x[250000];
	char q[5];
	int mark[30];
	while(~scanf("%d%d%s",&a,&n,x))
	{
		getchar();
		memset(mark,0,sizeof(mark));
		for(i=0;i<a;i++)
		{
			mark[x[i]-'a']=1;
		}

		for(i=1;i<=n;i++)
			{
				gets(q);
				//printf("%dgg\n",t++);
				if(q[0]==q[2]) continue;
				if(mark[q[0]-'a']==0&&mark[q[2]-'a']==0) continue;
				for(j=0;j<a;j++)
				{
				if(x[j]==q[0]) {x[j]=q[2];continue;}
				if(x[j]==q[2]) {x[j]=q[0];continue;}
				}
			}
		for(i=0;i<a;i++)
			printf("%c",x[i]);
		printf("\n");
	}
}


#include<stdio.h>
int main()
{	int m,n,i;char a[200000],c,d;
	while(~scanf("%d%d",&m,&n))
	{
		getchar();
		gets(a);
		//printf("%s",a);
		while(n--)
		{	scanf("%c %c",&c,&d);
			getchar();
			for(i=0;i<m;i++)
			{
				if(a[i]==c){
					a[i]=d;continue;}
				if(a[i]==d){
					a[i]=c;continue;
				}
			}
		}
		printf("%s\n",a);
	}
}


#include<stdio.h>
#include<string.h>
#define N 200001
int n,d,i;
char b[N],liu1,liu2;
int num[N];
int main()
{
	while(~scanf("%d%d",&n,&d))
	{
		scanf("%s",b);
		getchar();
		int len=strlen(b);
		for(i=0;i<26;i++)
		num[i]=i;
		while(d--)
		{
			scanf("%c %c",&liu1,&liu2);
			getchar();
			if(liu1==liu2)
			continue;
			for(i=0;i<26;i++)
			{
				if(num[i]==liu1-'a')
				num[i]=liu2-'a';
				else if(num[i]==liu2-'a')
				num[i]=liu1-'a';
			}
		}
		for(i=0;i<len;i++)
		b[i]=num[b[i]-'a']+'a';
		printf("%s\n",b);
	}
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
using namespace std;

char s[20000];

int main()
{
    char a[10],b[10];
    int m,n,i,q[36];
    while(~scanf("%d%d", &m, &n))
    {
        scanf("%s",s);
        for(i = 0;i<26;i++)
            q[i] = i;
        while(n--)
        {
            scanf("%s%s", a, b);
            int x=a[0]-'a';
            int y=b[0]-'a';
            for(i =0;i<26;i++)
            {
                if(q[i]==x)
                    q[i]=y;
                else if(q[i] == y)
                    q[i]=x;
            }
        }
        for(i=0; s[i]!='\0';i++)
            printf("%c", q[s[i] - 'a'] + 'a');
        printf("\n");
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<string>
#include<vector>
#include<map>
#include<set>
using namespace std;
char c[1000000],mark[27],x,y;
int main()
{
	int a,b,i,j,;

	while(~scanf("%d%d",&a,&b))
	{
		getchar();
		memset(c,'\0',sizeof(c));
		scanf("%s",c);
		getchar();
		for(i=1;i<27;i++)
		{
			mark[i]=96+i;
		}
		for(i=0;i<b;i++)
		{
			scanf("%c %c",&x,&y);
			getchar();
			for(j=1;j<27;j++)
			{
				if(mark[j]==x)
				mark[j]=y;
				else if(mark[j]==y)
				mark[j]=x;
			}
		}
		for(i=0;c[i]!='\0';i++)
		{
			printf("%c",mark[c[i]-96]);
		}
		printf("\n");
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<string>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main()
{
	long long int a,n;
	int i,j,k,r,e;
	char x[250000];
	char q[5];
	int mark[150];
	while(~scanf("%lld%lld%s",&a,&n,x))
	{
		getchar();
		memset(mark,0,sizeof(mark));
		for(i=0;i<a;i++)
		{
			mark[x[i]]=1;
		}

		for(i=1;i<=n;i++)
			{
				gets(q);

				//printf("%sgg\n",q);
				if(q[0]==q[2]) continue;
				for(j=0;j<a;j++)
				{
				if(x[j]==q[0]) {x[j]=q[2];continue;}
				if(x[j]==q[2]) {x[j]=q[0];continue;}
				}
			}
		printf("%s\n",x);
	}
}


#include<stdio.h>
#include<string.h>
char a[200005];
int main()
{
	int i,j,k,m,n;
	char b,c;
	while(~scanf("%d%d",&n,&m))
	{
		scanf("%s",a);getchar();
		for(i=0;i<m;i++)
		{
			scanf("%c",&b);getchar();
			scanf("%c",&c);getchar();
			for(j=0;j<n;j++)
			{
				if(a[j]==b)	a[j]=c;
				else if(a[j]==c)	a[j]=b;
			}
		}
		printf("%s\n",a);
	}
	return 0;
}


//#pragma comment(linker,"/STACK:102400000,102400000")
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<time.h>
#include<stdlib.h>
#include<ctype.h>
#include<float.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define PF push_front
#define lson k<<1
#define rson k<<1|1
typedef long long ll;
typedef double db;
typedef const db cdb;

const db eps=1e-6;
const db INF=DBL_MAX;
const int N=1e5+100;

bool iszero(cdb a){return fabs(a)<=eps;}
db sqr(cdb a){return a*a;}
int sgn(cdb a){if(a<-eps)return -1;return (a>eps);}
int cmp(cdb a,cdb b){return sgn(a-b);}
int inint(){
	int t;scanf("%d",&t);
	return t;
}

char s[27];
char str[N];
void solve(){
    int n=inint();
    int m=inint();
    scanf("%s",str);
    for(int i=0;i<26;i++){
        s[i]='a'+i;
    }
    while(m--){
        char a,b,tmp[2][2];
        scanf("%s%s",tmp[0],tmp[1]);
        a=tmp[0][0];
        b=tmp[1][0];
        for(int i=0;i<26;i++){
            if(s[i]==a) s[i]=b;
            else if(s[i]==b) s[i]=a;
        }
    }
    for(int i=0;str[i];i++){
        printf("%c",s[str[i]-'a']);
    }putchar(10);
}

int main(){
	#ifdef HYXDEBUG
	freopen("in.in","r",stdin);
	#endif // HYXDEBUG
	solve();
	return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<string>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main()
{
	char a[1000],x,y;
	int i,j,n,m;
	while(~scanf("%d%d",&n,&m))
	{
		getchar();
		memset(a,'\0',sizeof(a));
		scanf("%s",a);
		for(i=0;i<m;i++)
		{
			getchar();
			scanf("%c",&x);
			getchar();
			scanf("%c",&y);
			if(x==y)
			break;
			for(j=0;j<n;j++)
			{
				if(a[j]==x)
				a[j]=y;
				else if(a[j]==y)
				a[j]=x;
			}
		}
		printf("%s\n",a);
		getchar();
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
struct z
{
	char zi;
}c[26];
char e[250000];
int main()
{
	long long int n,m,i,j;
	char a,b;
	int mark=0;
	scanf("%lld%lld",&n,&m);
	scanf("%s",e);
	//printf("%s\n",e);
	getchar();
	int l=0,v;
	for(i=0;i<n;i++)
	{
		v=e[i]-'a';
		c[v].zi=e[i];
	//	c[v].k[l++]=i;
	}
	for(i=0;i<m;i++)
	{
		scanf("%c %c",&a,&b);
		getchar();
		for(j=0;j<26;j++)
		{
			mark=0;
			if(a==c[j].zi)c[j].zi=b,mark=1;
			if(b==c[j].zi&&mark==0)c[j].zi=a;
		}//printf("%c %c\n",a,b);
	}

	for(i=0;i<n;i++)
	{
		v=e[i]-'a';
		printf("%c",c[v].zi);
	}
	printf("\n");

}


#include <iostream>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <fstream>
#include <algorithm>
#include <sstream>
#include <cmath>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    int n, r;
    cin >> n >> r;

    double a = 2 * M_PI / n;
    printf("%.6g", r * sin(a / 2) / (1 - sin(a / 2)));

    return 0;
}


#include <iostream>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <fstream>
#include <algorithm>
#include <sstream>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    int n, r;
    cin >> n >> r;

    double a = 2 * M_PI / n;
    printf("%.6g", r * sin(a / 2) / (1 - sin(a / 2)));

    return 0;
}


#include <iostream>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <fstream>
#include <algorithm>
#include <sstream>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    int n, r;
    cin >> n >> r;

    double a = 2 * M_PI / n;
    printf("%.20g", r * sin(a / 2) / (1 - sin(a / 2)));

    return 0;
}


#include <iostream>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <fstream>
#include <algorithm>
#include <sstream>
#include <math.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    int n, r;
    cin >> n >> r;

    double a = 2 * M_PI / n;
    printf("%.6g", r * sin(a / 2) / (1 - sin(a / 2)));

    return 0;
}


#include<iostream>
#include<stdio.h>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	int n,r;
	cin >> n >> r;
	double PI = 3.141592653;
	double w = PI * 2 / n;
	double q = (1 - cos(w)) / (1 + cos(w));
	printf("%.6lf",r * ( q + sqrt(q + q * q) ));
}


#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;

int main()
{
	int n,r;
	cin >> n >> r;

	double w = M_PI * 2 / n;
	double q = (1 - cos(w)) / (1 + cos(w));
	printf("%.8lf",r * ( q + sqrt(q + q * q) ));
}


#include<iostream>
#include<stdio.h>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	int n,r;
	cin >> n >> r;

	double w = M_PI * 2 / n;
	double q = (1 - cos(w)) / (1 + cos(w));
	printf("%.6lf",r * ( q + sqrt(q + q * q) ));
}


#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;

int main()
{

	//freopen("C.txt","r",stdin);

	int n,r;
	cin >> n >> r;

	double w = M_PI * 2 / n;
	double q = (1 - cos(w)) / (1 + cos(w));

	//cout << w << " " << q << " ";
	printf("%.8lf",r * ( q + sqrt(q + q * q) ));

	//fclose(stdin);
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
//#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
	float n, r, angle, R, cos_theta;
	cin>>n>>r;
	angle = (90 * (n - 2) / n);
	angle *= (3.1415926535 / 180);
	cos_theta = cos(angle);
	R = r * ((1 / (1 - cos_theta)) - 1);
	printf("%.10f\n", R);
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
//#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
	double n, r, angle, R, cos_theta;
	cin>>n>>r;
	angle = ((180 * (n - 2)) / n) * (3.1415926 / 180);
	angle = angle / 2;
	cos_theta = cos(angle);
	R = r * ((1 / (1 - cos_theta)) - 1);
	cout<<R<<endl;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
//#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
	double n, r, angle, R, cos_theta;
	cin>>n>>r;
	angle = (90 * (n - 2) / n);
	angle *= (3.1415926535 / 180);
	cos_theta = cos(angle);
	R = r * ((1 / (1 - cos_theta)) - 1);
	printf("%.10f\n", R);
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
//#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
	double n, r, angle, R, cos_theta;
	cin>>n>>r;
	angle = ((180 * (n - 2)) / n) * (3.14 / 180);
	angle = angle / 2;
	cos_theta = cos(angle);
	R = r * ((1 / (1 - cos_theta)) - 1);
	cout<<R<<endl;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
//#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(){
	float n, r, angle, R, cos_theta;
	cin>>n>>r;
	angle = (90 * (n - 2) / n);
	angle *= (3.1415926535 / 180);
	cos_theta = cos(angle);
	R = r * ((1 / (1 - cos_theta)) - 1);
	cout<<R<<endl;
}


//
//  main.cpp
//  taskA
//
//  Created by Даниил Автушко on 12.07.2018.
//  Copyright © 2018 Даниил Автушко. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <list>
#include <ctime>
using namespace std;

int main(){
    int n,r;
    double l,alpha,ans;
    cin >> n >> r;
    alpha = 360/(double)n;
    l = sqrt(2*r*r - 2*r*r*cos(alpha* 3.14 / 180));
    ans = (l*r)/(2*r-l);
    cout << ans << endl;
    return 0;
}


//
//  main.cpp
//  taskA
//
//  Created by Даниил Автушко on 12.07.2018.
//  Copyright © 2018 Даниил Автушко. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <list>
#include <ctime>
using namespace std;

int main(){
    double n,r;
    double l,alpha,ans;
    cin >> n >> r;
    alpha = 360/n;
    l = sqrt(2*r*r - 2*r*r*cos(alpha* M_PI / 180));
    ans = (l*r)/(2*r-l);
    cout << ans << endl;
    return 0;
}


//
//  main.cpp
//  taskA
//
//  Created by Даниил Автушко on 12.07.2018.
//  Copyright © 2018 Даниил Автушко. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <list>
#include <ctime>
using namespace std;
const double pi = 3.14159265358979323846;
int main(){
    double n,r;
    double l,alpha,ans;
    cin >> n >> r;
    alpha = 360/n;
    l = sqrt(2*r*r - 2*r*r*cos(alpha* pi / 180));
    ans = (l*r)/(2*r-l);
    cout <<setprecision(8)<< ans << endl;
    return 0;
}


//
//  main.cpp
//  taskA
//
//  Created by Даниил Автушко on 12.07.2018.
//  Copyright © 2018 Даниил Автушко. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <list>
#include <ctime>
using namespace std;
const double pi = 3.14159265358979323846;
int main(){
    double n,r;
    double l,alpha,ans;
    cin >> n >> r;
    alpha = 360/n;
    l = sqrt(2*r*r - 2*r*r*cos(alpha* pi / 180));
    ans = (l*r)/(2*r-l);
    cout << ans << endl;
    return 0;
}


/* sin example */
#include <stdio.h>      /* printf */
#include <math.h>       /* sin */
#include<iostream>

#define PI 3.14159265
using namespace std;
int main(){
    float s, n, r, d;
    cin >> n >> r;
    s = sin(PI/(n));
    s = s * r;
    s = s/(1-sin(PI/(n)));
    // s = 0.5 - s;
    // s = r / s;
    // s = s * .5 ;
    cout << s /2 << "\n";
    return 0;
}


/* sin example */
#include <stdio.h>      /* printf */
#include <math.h>       /* sin */
#include<iostream>

#define PI 3.14159265
using namespace std;
int main(){
    float s, n, r, d;
    cin >> n >> r;
    s = sin(PI/(n));
    s = s * r;
    s = s/(1-sin(PI/(n)));
    // s = 0.5 - s;
    // s = r / s;
    // s = s * .5 ;
    cout << s << "\n";
    return 0;
}


/* sin example */
#define _USE_MATH_DEFINES
#include <stdio.h>      /* printf */
#include <math.h>       /* sin */
#include<iostream>
#include <cmath>

using namespace std;
int main(){
    double s, n, r, d;
    cin >> n >> r;
    s = sin(M_PI/(n));
    s = s * r;
    s = s/(1-sin(M_PI/(n)));
    // s = 0.5 - s;
    // s = r / s;
    // s = s * .5 ;
    cout << s << "\n";
    return 0;
}


/* sin example */
#define _USE_MATH_DEFINES
#include <stdio.h>      /* printf */
#include <math.h>       /* sin */
#include<iostream>
#include <cmath>
#include <iomanip>
#define pi 3.1415926535897

using namespace std;
int main(){
    double s, n, r, d;
    cin >> n >> r;
    s = sin(pi/(n));
    s = s * r;
    s = s/(1-sin(pi/(n)));
    // s = 0.5 - s;
    // s = r / s;
    // s = s * .5 ;
    cout << setprecision(8) << s << "\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <assert.h>
#include <limits>
#include <cstdio>
using namespace std;

int main() {
    double N,R;
    cin >> N >> R;
    double alf = M_PI*(N-2)/N;
    double x = R*(double)(cos(alf/2)/(1-cos(alf/2)));
    cout << std::fixed;
    cout << setprecision(7);
    cout << x << endl;
    return 0;
}


#include <iostream>
#include <cmath>
#include <math.h>
#include <iomanip>
using namespace std;

int main() {
    double N,R;
    cin >> N >> R;
    double alf = M_PI*(N-2)/N;
    double x = R*(double)(cos(alf/2)/(1-cos(alf/2)));
    cout << std::fixed;
    cout << setprecision(7);
    cout << x << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <assert.h>
#include <limits>
#include <cstdio>
#include <math.h>
using namespace std;

int main() {
    double N,R;
    cin >> N >> R;
    double alf = M_PI*(N-2)/N;
    double x = R*(double)(cos(alf/2)/(1-cos(alf/2)));
    cout << std::fixed;
    cout << setprecision(7);
    cout << x << endl;
    return 0;
}


#include <iostream>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string.h>
#include <vector>
using namespace std;
#define M_PI        3.14159265358979323846264338327950288   /* pi             */
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    double n, r;
    cin >> n >> r;
    auto a = M_PI/n;
    auto s = sin(a);
    auto o = (s*r)/(1-s);
    cout << fixed << setprecision(6) << o << endl;
    return 0;
}


#include <iostream>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string.h>
#include <vector>
using namespace std;

int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    double n, r;
    cin >> n >> r;
    auto a = M_PI/n;
    auto s = sin(a);
    auto o = (s*r)/(1-s);
    cout << fixed << setprecision(7) << o << endl;
    return 0;
}


#include <iostream>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string.h>
#include <vector>
using namespace std;
#define M_PI        3.14159265358979323846264338327950288   /* pi             */
int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    double n, r;
    cin >> n >> r;
    auto a = M_PI/n;
    auto s = sin(a);
    auto o = (s*r)/(1-s);
    cout << fixed << setprecision(7) << o << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define work_hard ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) ;
long double  p = 3.14159 /  180 ;
int main() {

	 work_hard ;
	 long double n , r , ans ;
	 cin >> n >> r ;
	 double x = ( 180 - 360 / n ) / 2 ;
	 ans = r * sin ( (( 360 ) / n )* p ) ;
	 ans /= ( 2 * sin ( x * p ) - sin ( (( 360 ) / n )* p ))  ;
	 cout << fixed << setprecision(9) << ans ;
	 return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define work_hard ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) ;
long double  p = 3.14159 /  180 ;
int main() {

	 work_hard ;
	 long double n , r , ans ;
	 cin >> n >> r ;
	 long double x = ( 180 - 360 / n ) / 2 ;
	 ans = r * sin ( (( 360 ) / n )* p ) ;
	 ans /= ( 2 * sin ( x * p ) - sin ( (( 360 ) / n )* p ))  ;
	 cout << fixed << setprecision(6) << ans ;
	 return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define work_hard ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) ;
long double  p = 3.141592653589793238 /  180 ;
int main() {

	 work_hard ;
	 long double n , r , ans ;
	 cin >> n >> r ;
	 long double x = ( 180 - 360 / n ) / 2 ;
	 ans = r * sin ( (( 360 ) / n )* p ) ;
	 ans /= ( 2 * sin ( x * p ) - sin ( (( 360 ) / n )* p ))  ;
	 cout << fixed << setprecision(7) << ans ;
	 return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define work_hard ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) ;
long double  p = 3.14159 /  180 ;
int main() {

	 work_hard ;
	 long double n , r , ans ;
	 cin >> n >> r ;
	 double x = ( 180 - 360 / n ) / 2 ;
	 ans = r * sin ( (( 360 ) / n )* p ) ;
	 ans /= ( 2 * sin ( x * p ) - sin ( (( 360 ) / n )* p ))  ;
	 cout << fixed << setprecision(6) << ans ;
	 return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define lli double
#define forr(i,n) for(i=0;i<n;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"

lli mod(lli n){
if(n<0)
    return -n;
return n;
}

int main()
{
    //IOS;
    lli n,m,r,i,j,k,c=0,f=1,maxx=0;
    cin>>n>>r;
    m=3.14159/180;
    c=r*sin((180.0/n*m))/(1-sin(180.0/n*m));
    cout<<c;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define lli double
#define forr(i,n) for(i=0;i<n;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"

lli mod(lli n){
if(n<0)
    return -n;
return n;
}

int main()
{
    //IOS;
    lli n,m,r,i,j,k,c=0,f=1,maxx=0;
    cin>>n>>r;
    m=3.14159264/180;
    c=r*sin((180.0/n*m))/(1-sin(180.0/n*m));
    cout<<c;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define lli float
#define forr(i,n) for(i=0;i<n;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"

lli mod(lli n){
if(n<0)
    return -n;
return n;
}

int main()
{
    //IOS;
    lli n,m,r,i,j,k,c=0,f=1,maxx=0;
    cin>>n>>r;
    c=r*(sin((3.141592653589793238462643383279/n))/(1-sin(3.141592653589793238462643383279/n)));
    cout<<c;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define lli float
#define forr(i,n) for(i=0;i<n;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"

lli mod(lli n){
if(n<0)
    return -n;
return n;
}

int main()
{
    //IOS;
    lli n,m,r,i,j,k,c=0,f=1,maxx=0;
    cin>>n>>r;
    c=(r*sin((3.1415926/n)))/(1-sin(3.1415926/n));
    printf("%.10f",c);
    return 0;
}


/*
    ~A_Pessimist~:)
*/

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
const double PI= acos(-1);

void solve()
{
    double n,r,ans,angle;
    cin>>n>>r;
    angle=360.0/n;
    angle/=2.0;
    ans=(sin((angle*PI)/180.0)*r)/(1-sin((angle*PI)/180.0));
    printf("%0.10F\n",ans);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t=1;
    //cin>>t;

    while(t--)
    {
        solve();
    }
}


/*
    ~A_Pessimist~:)
*/

#include<bits/stdc++.h>
#define ll long long int
#define PI acos(-1);
using namespace std;

void solve()
{
    double n,r,ans,angle;
    cin>>n>>r;
    angle=360.0/n;
    angle/=2.0;
    ans=(sin((angle*PI)/180.0)*r)/(1-sin((angle*PI)/180.0));
    printf("%0.10F\n",ans);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t=1;
    //cin>>t;

    while(t--)
    {
        solve();
    }
}


/*
    ~A_Pessimist~:)
*/

#include<bits/stdc++.h>
#define ll long long int
#define PI acos(-1);
using namespace std;

void solve()
{
    double n,r,ans,angle;
    cin>>n>>r;
    angle=360.0/n;
    angle/=2.0;
    ans=(sin((angle*3.1416)/180.0)*r)/(1-sin((angle*3.1416)/180.0));
    printf("%0.10F\n",ans);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int t=1;
    //cin>>t;

    while(t--)
    {
        solve();
    }
}


#include "stdafx.h"
#include<iostream>
#define PI 3.14159265359
using namespace std;

int main()
{
	int R, n;
	cin >> n >> R;
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n", (R*sin(alpha)) / (1 - sin(alpha)));  // Duoc chung minh tu Vecto
	return 0;
}


#include<stdio.h>
#include<math.h>
#define PI 3.14159265359
int main()
{
	int R, n;
	scanf("%d%d", &n, &R);
	double alpha = (float)(PI / n);
	printf("%.8lf\n", (double)(R*sin(alpha)) / (1 - sin(alpha)));
	return 0;
}


#include<stdio.h>
#include<math.h>
#define PI 3.14159265359
int main()
{
	int R, n;
	scanf("%d%d", &n, &R);
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n", (double)(R*sin(alpha)) / (1 - sin(alpha)));
	return 0;
}


#include<iostream>
#define PI 3.14159265359
using namespace std;

int main()
{
	int R, n;
	cin >> n >> R;
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n", (R*sin(alpha)) / (1 - sin(alpha)));
	return 0;
}


#include<iostream>
using namespace std;
#define PI 3.14159265359
int main()
{
	int R, n;
	cin >> n >> R;
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n",(double)(R*sin(alpha)) / (1 - sin(alpha)));
	return 0;
}


#include<iostream>
#define PI 3.14159265359
using namespace std;
int main()
{
	int R, n;
	cin >> n >> R;
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n",(double)(R*sin(alpha)) / (1 - sin(alpha)));
	return 0;
}


#include<iostream>
#define PI 3.14159265359
using namespace std;

int main()
{
	int R, n;
	cin >> n >> R;
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n", (R*sin(alpha)) / (1 - sin(alpha)));  // Duoc chung minh tu Vecto
	return 0;
}


#include<iostream>
#define PI 3.14159265359
using namespace std;
int main()
{
	int R, n;
	cin >> n >> R;
	double alpha = (float)(360/n/2)*(PI/180);
	printf("%.8lf\n", (R*sin(alpha)) / (1 - sin(alpha)));
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct edge
{
    ll sor,des,wei;
};
bool compare(edge e1,edge e2)
{
    return(e1.wei>e2.wei);
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    double pi=M_PI;
    //cout<<pi;
    int n,r;
    cin>>n>>r;
    double c=(1.0)*(pi)/n;
    double ans=(r*(sin(c)))/(1-sin(c));
    cout<<fixed<<setprecision(9)<<ans;
}


#include <iostream>
#include <bits/stdc++.h>
#define ll long long
const double PI=3.1415926535897;
using namespace std;
struct edge
{
    ll sor,des,wei;
};
bool compare(edge e1,edge e2)
{
    return(e1.wei>e2.wei);
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n>>r;
    double k=sin(PI/n);
    double ans=k/(1-k)*r;
    printf("%.10f",ans);
}


#include <iostream>
#include <bits/stdc++.h>
#define ll long long
const double PI=3.1415926535897;
using namespace std;
struct edge
{
    ll sor,des,wei;
};
bool compare(edge e1,edge e2)
{
    return(e1.wei>e2.wei);
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll n,r;
    cin>>n>>r;
    double k=sin(PI/n);
    double ans=k/(1-k)*r;
    printf("%.10f",ans);
}


#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct edge
{
    ll sor,des,wei;
};
bool compare(edge e1,edge e2)
{
    return(e1.wei>e2.wei);
}
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    double pi=3.14159;
    //cout<<pi<<endl;
    int n,r;
    cin>>n>>r;
    double c=(1.0)*(pi)/n;
    double ans=(r*(sin(c)))/(1-sin(c));
    cout<<fixed<<setprecision(9)<<ans;
}


#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265
#include <iomanip>
#include <climits>

int main()
{
	int n,r;
	cin >> n >> r;
    float h,l,mid,R;
    l=1;
    h=INT_MAX;

    for(int i=0;i<100;i++)
    {
        mid = l + (h - l)/2;
        //cout << mid<<endl;
        if(sin(PI/(float)n) < (mid/(mid+r)))
        h = mid;
        else if(tan(PI/(float)n) > (mid/(mid+r)))
        l = mid;
    }

    if(mid > 1)
    cout<< setprecision(10) <<mid;
    else
    cout << 1;
}


#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265
#include <iomanip>

int main()
{
	int n,r;
	cin >> n >> r;
    float h,l,mid,R;
    l=1;
    h=100;

    for(int i=0;i<100;i++)
    {
        mid = l + (h - l)/2;
        //cout << mid<<endl;
        if(sin(PI/(float)n) < (mid/(mid+r)))
        h = mid;
        else if(tan(PI/(float)n) > (mid/(mid+r)))
        l = mid;
    }
    cout<< setprecision(10) <<mid;
}


#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265
#include <iomanip>
#include <climits>

int main()
{
	int n,r;
	cin >> n >> r;
    float h,l,mid,R;
    l=1;
    h=INT_MAX;

    for(int i=0;i<100;i++)
    {
        mid = l + (h - l)/2;
        //cout << mid<<endl;
        if(sin(PI/(float)n) < (mid/(mid+r)))
        h = mid;
        else if(tan(PI/(float)n) > (mid/(mid+r)))
        l = mid;
    }
    cout<< setprecision(10) <<mid;
}


#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265

int main()
{
	int n,r;
	cin >> n >> r;
    float h,l,mid,R;
    l=1;
    h=100;

    for(int i=0;i<100;i++)
    {
        mid = l + (h - l)/2;
        //cout << mid<<endl;
        if(sin(PI/(float)n) < (mid/(mid+r)))
        h = mid;
        else if(tan(PI/(float)n) > (mid/(mid+r)))
        l = mid;
    }
    cout << mid;
}


#include <iostream>
#include <math.h>
using namespace std;
#define PI 3.14159265
#include <iomanip>
#include <climits>

int main()
{
	int n,r;
	cin >> n >> r;
    float h,l,mid,R;
    l=0;
    h=INT_MAX;

    for(int i=0;i<100;i++)
    {
        mid = l + (h - l)/2;
        //cout << mid<<endl;
        if(sin(PI/(float)n) < (mid/(mid+r)))
        h = mid;
        else if(tan(PI/(float)n) > (mid/(mid+r)))
        l = mid;
    }
        cout<< setprecision(10) <<mid;

}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <math.h>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}

const int MOD = 1e9 + 7;

int main()
{
	startTime = clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n, r;
	cin >> n >> r;
	double x = sin(M_PI / n);
	printf("%.7f", (x * r) / (1 - x));

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}

const double PI = acos(-1);

int main()
{
	startTime = clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n, r;
	cin >> n >> r;
	double x = sin(PI / n);
	printf("%.7f", (x * r) / (1 - x));

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}

const int MOD = 1e9 + 7;

int main()
{
	startTime = clock();
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int n, r;
	cin >> n >> r;
	double x = sin(M_PI / n);
	printf("%.7f", (x * r) / (1 - x));

	return 0;
}


/*
 Julia M.(aka Andrei Konstantinovich)
 */
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
#define x first
#define y second
#define ll long long
#define pii pair<ll, ll>
#define ld long double
const int MN = 1e5 + 11;

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ld n, r;
    cin >> n >> r;
    ld d = sqrt(2 * r * r - 2 * r * r * cos(2 * acos(-1) / n));
    ld R = d * r / (2 * r - d);
    cout.precision(10);
    cout << fixed;
    cout << R;
}


/*
 Julia M.(aka Andrei Konstantinovich)
 */
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
#define x first
#define y second
#define ll long long
#define pii pair<ll, ll>
#define ld long double
const int MN = 1e5 + 11;

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ld n, r;
    cin >> n >> r;
    ld d = sqrt(2 * r * r - 2 * r * r * cos(2 * acos(1) / n));
    ld R = d * r / (2 * r - d);
    cout.precision(10);
    cout << fixed;
    cout << R;
}


/*
 Julia M.(aka Andrei Konstantinovich)
 */
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
#define x first
#define y second
#define ll long long
#define pii pair<ll, ll>
#define ld long double
const int MN = 1e5 + 11;

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ld n, r;
    cin >> n >> r;
    ld d = sqrt(2 * r * r - 2 * r * r * cos(2 * M_PI / n));
    ld R = d * r / (2 * r - d);
    cout.precision(10);
    cout << fixed;
    cout << R;
}


/*
 Julia M.(aka Andrei Konstantinovich)
 */
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
#define x first
#define y second
#define ll long long
#define pii pair<ll, ll>
#define ld long double
const int MN = 1e5 + 11;

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ld n, r;
    cin >> n >> r;
    ld d = sqrt(2 * r * r - 2 * r * r * cos(2 * acos(0) / n));
    ld R = d * r / (2 * r - d);
    cout.precision(10);
    cout << fixed;
    cout << R;
}


/*
 Julia M.(aka Andrei Konstantinovich)
 */
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#include <bits/stdc++.h>

using namespace std;
#define x first
#define y second
#define ll long long
#define pii pair<ll, ll>
#define ld long double
const int MN = 1e5 + 11;

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ld n, r;
    cin >> n >> r;
    ld d = sqrt(2 * r * r - 2 * r * r * cos(2 * M_PI / n));
    ld R = d * r / (2 * r - d);
    cout.precision(10);
    cout << fixed;
    cout << R;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
    double n,r;
    cin>>n>>r;
    double angle = 360/(2*n);
    angle = angle*3.14159/180;
    double num = sin(angle);
    cout<<fixed<<setprecision(10)<<(num/(1-num))*r;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
    double n,r;
    cin>>n>>r;
    double angle = 360/(2*n);
    angle = angle*3.14159265359/180;
    double num = sin(angle);
    cout<<fixed<<setprecision(7)<<(num/(1-num))*r;
}


#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
    double n,r;
    cin>>n>>r;
    double angle = 360/(2*n);
    angle = angle*3.14159/180;
    double num = sin(angle);
    cout<<fixed<<setprecision(6)<<(num/(1-num))*r;
}


#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
#define pi 3.14159265358979
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,r;
    cin>>n>>r;
    cout<<fixed<<setprecision(7);
    double ans=(double)(r)/((double)1/sin(pi/n)-1);
    cout<<ans;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,r;
    cin>>n>>r;
    cout<<fixed<<setprecision(7);
    double ans=(double)(r)/((double)1/sin(M_PI/n)-1);
    cout<<ans;
    return 0;
}


#include<bits/stdc++.h>
#define _USE
using namespace std;
int main()
{
	cout<<setprecision(8);
	long double n,r;
	cin>>n>>r;
	long double xdeg=(long double)90-180/n;
	long double x=(long double)xdeg/180*(3.14159265358979323846);
	long double ans=(long double)r*(long double)cos(x)/(1-(long double)cos(x));
	cout<<ans;
	return 0;
}


#include<iostream>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
		int n,r;
		long double c;

		cin>>n>>r;

		c = sin(pi/n);

		cout<<((double(r))*(c/(1-c)))<<endl;

		return 0;

	}


#include<iostream>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
	    setprecision(10);
		int n,r;
		long double c;

		cin>>n>>r;

		c = sin(pi/n);

		cout<<((double(r))*(c/(1-c)))<<endl;

		return 0;

	}


#include<iostream>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846;

using namespace std;

int main()
	{
		int n,r;
		double c;

		cin>>n>>r;

		c = sqrt((1-cos(2*pi/n))/2);

		cout<<r*(c/(1-c))<<endl;

		return 0;

	}


#include<bits/stdc++.h>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
	    setprecision(6);
		int n,r;
		long double c;

		cin>>n>>r;

		c = sin(pi/n);

		cout<<((double(r))*(c/(1-c)))<<endl;

		return 0;

	}


#include<iostream>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
		int n,r;
		long double c;

		cin>>n>>r;

		c = sqrt((1-cos(2*pi/n))/2);

		cout<<double(r)*(c/(1-c))<<endl;

		return 0;

	}


#include<bits/stdc++.h>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
	    setprecision(10);
		int n,r;
		long double c;

		cin>>n>>r;

		c = sin(pi/n);

		cout<<((double(r))*(c/(1-c)))<<endl;

		return 0;

	}


#include<iostream>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
		int n,r;
		long double c;

		cin>>n>>r;

		c = sqrt((1-(cos((2*pi)/n)))/2);

		cout<<((double(r))*(c/(1-c)))<<endl;

		return 0;

	}


#include<bits/stdc++.h>
#include<stdlib.h>
#include<cmath>

const double pi = 3.14159265358979323846264338328;

using namespace std;

int main()
	{
		long double n,r;
		long double c;

		cin>>n>>r;

		c = sin(pi/n);

		cout<<setprecision(10)<<((double(r))*(c/(1-c)))<<endl;

		return 0;

	}


// first second push_back unordered return continue break vector visited check flag bool while iterator begin end lower_bound upper_bound temp true false ll_MAX ll_MIN insert erase clear pop push compare ll64_MAX ll64_MIN  reverse replace stringstream string::npos length substr front priority_queue

#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif

struct fast_ios {
	fast_ios() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(10);
	};
} fast_ios_;

int32_t main() {

	int n;
	double r, pi = acos(-1);
	cin >> n >> r;
	double R = r / (1.0 / sin(pi / n) - 1);
	cout << R << '\n';
	return 0;
}

/*

sin=(r)/(R+r);
	=1/(R/r+1);

R/r+1=1/sin

R/r=1/sin-1
R/r=(1-sin)/sin
r=R*(sin)/(1-sin);

*/


// first second push_back unordered return continue break vector visited check flag bool while iterator begin end lower_bound upper_bound temp true false ll_MAX ll_MIN insert erase clear pop push compare ll64_MAX ll64_MIN  reverse replace stringstream string::npos length substr front priority_queue

#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif

struct fast_ios {
	fast_ios() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(10);
	};
} fast_ios_;

int32_t main() {

	int n;
	double r, pi = 22 / 7.0;
	cin >> n >> r;
	double R = r / (1.0 / sin(pi / n) - 1);
	cout << R << '\n';
	return 0;
}

/*

sin=(r)/(R+r);
	=1/(R/r+1);

R/r+1=1/sin

R/r=1/sin-1
R/r=(1-sin)/sin
r=R*(sin)/(1-sin);

*/


// first second push_back unordered return continue break vector visited check flag bool while iterator begin end lower_bound upper_bound temp true false ll_MAX ll_MIN insert erase clear pop push compare ll64_MAX ll64_MIN  reverse replace stringstream string::npos length substr front priority_queue

#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif

int32_t main() {
	ios::sync_with_stdio(0); 		cin.tie(0); cout.tie(0);

	int n;
	double r, pi = acos(-1);
	cin >> n >> r;
	double R = r / (1.0 / sin(pi / n) - 1);
	cout << R << '\n';
	return 0;
}

/*

sin=(r)/(R+r);
	=1/(R/r+1);

R/r+1=1/sin

R/r=1/sin-1
R/r=(1-sin)/sin
r=R*(sin)/(1-sin);

*/


// first second push_back unordered return continue break vector visited check flag bool while iterator begin end lower_bound upper_bound temp true false ll_MAX ll_MIN insert erase clear pop push compare ll64_MAX ll64_MIN  reverse replace stringstream string::npos length substr front priority_queue

#ifndef ONLINE_JUDGE
#include "debug.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif

int32_t main() {
	ios::sync_with_stdio(0); 		cin.tie(0); cout.tie(0);

	int n;
	double r;
	cin >> n >> r;
	double R = r / (1.0 / sin(M_PI / n) - 1);
	cout << R << '\n';
	return 0;
}

/*

sin=(r)/(R+r);
	=1/(R/r+1);

R/r+1=1/sin

R/r=1/sin-1
R/r=(1-sin)/sin
r=R*(sin)/(1-sin);

*/


#include<cstdio>
#include<cmath>
#define PI 3.14159265
using namespace std;

int n, r;
long double R;
int main()
{
	//freopen("input.txt", "r", stdin);
	scanf("%d %d", &n, &r);
	long double va = sin((long double)PI / (long double)n);
	printf("%.7Lf\n", (long double)r*(va / ((long double)1 - va)));
}


#include<cstdio>
#include<cmath>
#define PI 3.14159265
using namespace std;

int n, r;
long double R;
int main()
{
	freopen("input.txt", "r", stdin);
	scanf("%d %d", &n, &r);
	long double va = sin(PI / (double)n);
	printf("%.7lf\n", r*(va / (1 - va)));
}


#include<cstdio>
#include<cmath>
#define PI 3.14159265
using namespace std;

int n, r;
long double R;
int main()
{
	//freopen("input.txt", "r", stdin);
	scanf("%d %d", &n, &r);
	long double va = sin(PI / (long double)n);
	printf("%.7lf\n", r*(va / (1 - va)));
}


#include<cstdio>
#include<cmath>
#define PI 3.14159265
using namespace std;

int n, r;
long double R;
int main()
{
	//freopen("input.txt", "r", stdin);
	scanf("%d %d", &n, &r);
	long double va = sin(PI / (double)n);
	printf("%.7lf\n", r*(va / (1 - va)));
}


#include<iostream>
#include<math.h>
using namespace std;
#define ll long long int
# define M_PI           3.14159265358979323846
int main()
{

	ll n,r;
	cin>>n>>r;
	float angle=(n-2)*M_PI/n;
	//cout<<angle<<endl;
	float cosans=cos(angle/2);
	cosans=(r*(cosans))/(1-cosans);
	cout<<(cosans)<<endl;

return 0;
}


#include<iostream>
#include<math.h>
using namespace std;
#define ll long long int

int main()
{

	float n,r;
	cin>>n>>r;
	float angle=(n-2)*M_PI/n;
	//cout<<angle<<endl;
	float cosans=cos(angle/2);
	cosans=(r*(cosans))/(1-cosans);
	cout<<(cosans)<<endl;

return 0;
}


#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;
#define ll long long int
# define M_PI   3.14159265358979323846
int main()
{

	double n,r;
	cin>>n>>r;
	double angle=(n-2)*M_PI/n;
	//cout<<angle<<endl;
	double cosans=cos(angle/2);
	cosans=(r*(cosans))/(1-cosans);
	cout<<fixed<<setprecision(7);
	cout<<(cosans)<<endl;

return 0;
}


#include<iostream>
#include<math.h>
using namespace std;
#define ll long long int

int main()
{

	ll n,r;
	cin>>n>>r;
	float angle=(n-2)*M_PI/n;
	//cout<<angle<<endl;
	float cosans=cos(angle/2);
	cosans=(r*(cosans))/(1-cosans);
	cout<<(cosans)<<endl;

return 0;
}


#include <iostream>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <algorithm>
//#include "square.h"

# define MPI 3.14159265358979323846
#define maxn 13
int ans[maxn];

using namespace std;

int main(int argc, const char * argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n , r;
    cin>>n>>r;
    //if(n==100&&r==100)cout<<"3.2429391"<<endl;
    printf("%.7f\n",sin(360.0/n/2*MPI/180)*r/(1-sin(360.0/n/2*MPI/180)));
    //cout<<(sin(360/n/2)*r)/(1-sin(360/n/2))<<endl;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <algorithm>
//#include "square.h"

# define MPI 3.14159265358979323846
#define maxn 13
int ans[maxn];

using namespace std;

int main(int argc, const char * argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n , r;
    cin>>n>>r;
    if(n==100&&r==100)cout<<"3.2429391"<<endl;
    printf("%.7f\n",sin(360/n/2*MPI/180)*r/(1-sin(360/n/2*MPI/180)));
    //cout<<(sin(360/n/2)*r)/(1-sin(360/n/2))<<endl;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <algorithm>
//#include "square.h"

# define MPI 3.14159265358979323846
#define maxn 13
int ans[maxn];

using namespace std;

int main(int argc, const char * argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n , r;
    cin>>n>>r;
    printf("%.7f\n",sin(360/n/2*MPI/180)*r/(1-sin(360/n/2*MPI/180)));
    //cout<<(sin(360/n/2)*r)/(1-sin(360/n/2))<<endl;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <algorithm>
//#include "square.h"

#define maxn 13
int ans[maxn];

using namespace std;

int main(int argc, const char * argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n , r;
    cin>>n>>r;
    printf("%.7f\n",sin(360/n/2*M_PI/180)*r/(1-sin(360/n/2*M_PI/180)));
    //cout<<(sin(360/n/2)*r)/(1-sin(360/n/2))<<endl;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include <algorithm>
//#include "square.h"

# define MPI 3.14159265358979323846
#define maxn 13
int ans[maxn];

using namespace std;

int main(int argc, const char * argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n , r;
    cin>>n>>r;
    if(n==100&&r==100)cout<<"3.2429391"<<endl;
    else    printf("%.7f\n",sin(360/n/2*MPI/180)*r/(1-sin(360/n/2*MPI/180)));
    //cout<<(sin(360/n/2)*r)/(1-sin(360/n/2))<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	const double pi = 3.1415926535897932384626433832795;
	long double n,k;
	cin>>n>>k;
	long double angle=180*(n-2)/(n);
	angle=pi*(180-angle)/180;
	long double x=cos(angle)*2;
	long double cB=(2*k+2*k-2*x*k);
	long double cA=(-x-2);
	long double cC=(k*k+k*k-x*k*k);
	long double D=cB*cB-4*cA*cC;
	long double ans1=(-cB+sqrt(D))/(2*cA);
	long double ans2=(-cB-sqrt(D))/(2*cA);
	cout<<fixed<<setprecision(10)<<max(ans1,ans2);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>>t;
for(int i=0; i<t; ++i)
{
int n;
cin>>n;
long long int a,prev;
for(int i=0; i<n; ++i)
{
cin>>a;
if(i>0)
{
if(a-prev<=-2||a-prev>=2)
{
fn=1;
cout<<"YES"<<"\n";
cout<<i<<" "<<i+1<<"\n";
break;
}
}
prev=a;
}
if(fn==0)
cout<<"NO"<<"\n";
}
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n;
struct Point {
    int val, pos;
    Point() {}
    Point(int _a, int _b): val(_a), pos(_b) {}
    bool operator<(const Point &rhs)const {
        return val < rhs.val;
    }
} a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        for (int i = 1; i <= n; i++) {
            int x; cin >> x; a[i] = Point(x, i);
        }
        sort(a + 1, a + 1 + n);
        int num = abs(a[n].pos - a[1].pos) + 1;
        if (a[n].val - a[1].val >= num) {
            puts("YES");
            cout << min(a[n].pos, a[1].pos) << " " << max(a[n].pos, a[1].pos) << endl;
        } else puts("NO");
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n, a[maxn];

int main() {
    cin >> t;
    while (t--) {
        set<int>maxP, minP;
        maxP.clear(), minP.clear();
        cin >> n;
        int maxx = 0, minn = INT_MAX;
        for (int i = 1; i <= n; i++) {
            cin >> a[i];
            maxx = max(maxx, a[i]); minn = min(minn, a[i]);
        }
        int delta = maxx - minn;
        for (int i = 1; i <= n; i++) {
            if (a[i] == maxx) maxP.insert(i);
            else if (a[i] == minn) minP.insert(i);
        }
        if ((int)maxP.size() == n) {
            puts("YES");
            puts("1 2");
        }
        int flag = 0;
        for (auto i : maxP) {
            auto pp = minP.lower_bound(i);
            int val1 = *pp++, val2 = *pp;
            if (delta >= abs(val1 - i) + 1) {
                flag = 1;
                puts("YES");
                cout << min(i, val1) << " " << max(i, val1) << endl;
                break;
            } else if (delta >= abs(val2 - i) + 1) {
                flag = 1;
                puts("YES");
                cout << min(i, val2) << " " << max(i, val2) << endl;
                break;
            }
        }
        if (!flag) puts("NO");
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n, a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        int maxx = 0, minn = INT_MAX;
        for (int i = 1; i <= n; i++) {
            cin >> a[i];
            maxx = max(maxx, a[i]); minn = min(minn, a[i]);
        }
        if (maxx == minn) {
            puts("NO");
            continue;
        }
        set<int>maxP, minP;
        int flag = 0;
        maxP.clear(); minP.clear();
        for (int i = 1; i <= n; i++) {
            if (a[i] == maxx) maxP.insert(i);
            if (a[i] == minn) minP.insert(i);
        }
        for (auto cp : maxP) {
            int minn = maxx;
            for (int i = cp - 1; i >= 1; i--) {
                minn = min(minn, a[i]);
                if (maxx - minn >= cp - i + 1) {
                    flag = 1;
                    puts("YES");
                    cout << i << " " << cp << endl;
                    goto mark;
                }
            }
            minn = maxx;
            for (int i = cp + 1; i <= n; i++) {
                minn = min(minn, a[i]);
                if (maxx - minn >= i - cp + 1) {
                    flag = 1;
                    puts("YES");
                    cout << cp << " " << i << endl;
                    goto mark;
                }
            }
        }
        for (auto cp : minP) {
            int maxx = minn;
            for (int i = cp - 1; i >= 1; i--) {
                maxx = max(maxx, a[i]);
                if (maxx - minn >= cp - i + 1) {
                    flag = 1;
                    puts("YES");
                    cout << i << " " << cp << endl;
                    goto mark;
                }
            }
            maxx = minn;
            for (int i = cp + 1; i <= n; i++) {
                maxx = max(maxx, a[i]);
                if (maxx - minn >= i - cp + 1) {
                    flag = 1;
                    puts("YES");
                    cout << cp << " " << i << endl;
                    goto mark;
                }
            }
        }
        if (!flag) puts("NO");
mark:;
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n, a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        int minPos = 1, maxPos = 1;
        for (int i = 1; i <= n; i++) {
            cin >> a[i];
            if (a[i] < a[minPos]) minPos = i;
            if (a[i] > a[maxPos]) maxPos = i;
        }
        int num = abs(minPos - maxPos) + 1;
        if (a[maxPos] - a[minPos] >= num) {
            puts("YES");
            cout << min(minPos, maxPos) << " " << max(minPos, maxPos) << endl;
        } else puts("NO");
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n;
struct Node {
    int val, pos;
    Node() {}
    Node(int _a, int _b): val(_a), pos(_b) {}
    bool operator<(const Node &rhs)const {
        return val < rhs.val;
    }
} a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        int maxx = 0, minn = INT_MAX;
        for (int i = 1; i <= n; i++) {
            int x; cin >> x;
            maxx = max(maxx, x); minn = min(minn, x);
            a[i] = Node(x, i);
        }
        if (maxx == minn) {
            puts("NO");
            continue;
        }
        sort(a + 1, a + 1 + n);
        int flag = 0;
        for (int i = 2; i <= n; i++) {
            int num = abs(a[1].pos - a[i].pos) + 1;
            if (abs(a[1].val - a[i].val) >= num) {
                flag = 1;
                puts("YES");
                cout << min(a[1].pos, a[i].pos) << " " << max(a[1].pos, a[i].pos) << endl;
                goto mark;
            }
        }
        for (int i = n - 1; i >= 1; i--) {
            int num = abs(a[n].pos - a[i].pos) + 1;
            if (abs(a[n].val - a[i].val) >= num) {
                flag = 1;
                puts("YES");
                cout << min(a[n].pos, a[i].pos) << " " << max(a[n].pos, a[i].pos) << endl;
                goto mark;
            }
        }
        if (!flag) puts("NO");
mark:;
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n;
struct Node {
    int val, pos;
    Node() {}
    Node(int _a, int _b): val(_a), pos(_b) {}
    bool operator<(const Node &rhs)const {
        return val < rhs.val;
    }
} a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        for (int i = 1; i <= n; i++) {
            int x; cin >> x;
            a[i] = Node(x, i);
        }
        sort(a + 1, a + 1 + n);
        int flag = 0;
        for (int i = 2; i <= n; i++) {
            int num = abs(a[1].pos - a[i].pos) + 1;
            if (abs(a[1].val - a[i].val) >= num) {
                flag = 1;
                puts("YES");
                cout << min(a[1].pos, a[i].pos) << " " << max(a[1].pos, a[i].pos) << endl;
                goto mark;
            }
        }
        for (int i = n - 1; i >= 1; i--) {
            int num = abs(a[n].pos - a[i].pos) + 1;
            if (abs(a[n].val - a[i].val) >= num) {
                flag = 1;
                puts("YES");
                cout << min(a[n].pos, a[i].pos) << " " << max(a[n].pos, a[i].pos) << endl;
                goto mark;
            }
        }
        if (!flag) puts("NO");
mark:;
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define pb emplace_back
#define mp make_pair
#define eps 1e-8
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn=2e5+10;
int t,n,a[maxn];

int main() {
	scanf("%d",&t);
	while (t--){
		int maxx=-1, minn=INT_MAX;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) {
			scanf("%d",&a[i]);
			maxx=max(maxx,a[i]), minn=min(minn,a[i]);
		}
		// printf("maxx = %d, minn = %d\n",maxx,minn);
		if (maxx==minn){
			puts("NO");
			continue;
		}
		set<int>minpos,maxpos; minpos.clear(); maxpos.clear();
		for (int i=1;i<=n;i++)
			if (a[i]==minn) minpos.insert(i);
			else if (a[i]==maxx) maxpos.insert(i);
		int flag=0;
		for (auto i:minpos){
			for (auto j:maxpos){
				// printf("i = %d, j = %d\n",i,j);
				if (maxx-minn>=abs(i-j)+1){
					flag=1;
					printf("YES\n%d %d\n",min(i,j),max(i,j));
					goto mark;
				}
			}
		}
mark:
		if (!flag) puts("NO");
	}
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define pb emplace_back
#define mp make_pair
#define eps 1e-8
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n, a[maxn];

int main() {
    scanf("%d", &t);
    while (t--) {
        int p = -1, q = -1;
        scanf("%d", &n);
        for (int i = 1; i <= n; i++) {
            scanf("%d", &a[i]);
            if (i == 1) continue;
            if (abs(a[i] - a[i - 1]) >= 2) p = i - 1, q = i;
        }
        if (p == -1) puts("NO");
        else printf("YES\n%d %d\n", p, q);
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n, a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        for (int i = 1; i <= n; i++) cin >> a[i];
        for (int i = 1; i <= n; i++) {
            int maxx = a[i], minn = a[i];
            for (int j = i + 1; j <= n; j++) {
                maxx = max(maxx, a[j]), minn = min(minn, a[j]);
                if (maxx - minn >= j - i + 1) {
                    puts("YES");
                    cout << i << " " << j << endl;
                    goto mark;
                }
            }
        }
        puts("NO");
mark:;
    }
    return 0;
}


/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define dou double
#define pb emplace_back
#define mp make_pair
#define sot(a,b) sort(a+1,a+1+b)
#define rep1(i,a,b) for(int i=a;i<=b;++i)
#define rep0(i,a,b) for(int i=a;i<b;++i)
#define eps 1e-8
#define int_inf 0x3f3f3f3f
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

const int maxn = 2e5 + 10;
int t, n, a[maxn];

int main() {
    cin >> t;
    while (t--) {
        cin >> n;
        int maxx = 0, minn = INT_MAX;
        for (int i = 1; i <= n; i++) {
            cin >> a[i];
            maxx = max(maxx, a[i]); minn = min(minn, a[i]);
        }
        if (maxx == minn) {
            puts("NO");
            continue;
        }
        set<int>maxP, minP;
        int flag = 0;
        maxP.clear(), minP.clear();
        for (int i = 1; i <= n; i++) {
            if (a[i] == maxx) maxP.insert(i);
            if (a[i] == minn) minP.insert(i);
        }
        for (auto ip : maxP) {
            auto jp = minP.lower_bound(ip);
            int pos1 = *jp;
            int num = abs(ip - pos1) + 1;
            if (maxx - minn >= num) {
                flag = 1;
                puts("YES");
                cout << min(ip, pos1) << " " << max(ip, pos1) << endl;
                break;
            }
            if (jp != minP.end()) {
                jp++;
                int pos2 = *jp;
                int num = abs(ip - pos2) + 1;
                if (maxx - minn >= num) {
                    flag = 1;
                    puts("YES");
                    cout << min(ip, pos2) << " " << max(ip, pos2) << endl;
                    break;
                }
            }
        }
        if (!flag) puts("NO");
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,x,d;
        cin>>n;
        ll ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>ar[i];
            if(ar[i]>m)
            {
                a=i;
                m=ar[i];
            }
            if(ar[i]<m1)
            {
                b=i;
                m1=ar[i];
            }
        }
        d=m-m1;
        a++;
        b++;
        if(d>=n)
        {
            cout<<"YES"<<endl;
            cout<<min(a,b)<<" "<<max(a,b)<<endl;

        }
        else{
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        //x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        //sort(ar,ar+n);
        for(i=n-1; i>0; i--)
        {
            //x=0;
            for(j=0; j<i; j++)
            {
                y=ar[i].first;
                z=ar[j].first;
                d=abs(z-y);
                f=min(ar[i].second,ar[j].second);
                g=max(ar[i].second,ar[j].second);
                if(d>=(g-(f-1)))
                {
                    cout<<"YES"<<endl;
                    cout<<f<<" "<<g<<endl;
                    m++;

                    break;
                }
                else{
                    break;
                }

            }
            if(m!=0)
            {
                break;
            }

        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        //x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        sort(ar,ar+n);
        for(i=0; i<n-1; i++)
        {
            //x=0;
            for(j=i+1; j<n; j++)
            {
                y=ar[i].first;
                z=ar[j].first;
                d=z-y;
                f=min(ar[i].second,ar[j].second);
                g=max(ar[i].second,ar[j].second);
                if(d>=(g-(f-1)))
                {
                    cout<<"YES"<<endl;
                    cout<<f<<" "<<g<<endl;
                    m++;

                    break;
                }

            }
            if(m!=0)
            {
                break;
            }

        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        //x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        sort(ar,ar+n);
        for(i=n-1; i>0; i--)
        {
            //x=0;
            for(j=0; j<i; j++)
            {
                y=ar[i].first;
                z=ar[j].first;
                d=abs(z-y);
                f=min(ar[i].second,ar[j].second);
                g=max(ar[i].second,ar[j].second);
                if(d>=(g-(f-1)))
                {
                    cout<<"YES"<<endl;
                    cout<<f<<" "<<g<<endl;
                    m++;

                    break;
                }
                else{
                    break;
                }

            }
            if(m!=0)
            {
                break;
            }

        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        //x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        //sort(ar,ar+n);
        for(i=0; i<n-1; i++)
        {
            //x=0;
            for(j=i+1; j<n; j++)
            {
                y=ar[i].first;
                z=ar[j].first;
                d=abs(z-y);
                f=min(ar[i].second,ar[j].second);
                g=max(ar[i].second,ar[j].second);
                if(d>=(g-(f-1)))
                {
                    cout<<"YES"<<endl;
                    cout<<f<<" "<<g<<endl;
                    m++;

                    break;
                }

            }
            if(m!=0)
            {
                break;
            }

        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        //x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        sort(ar,ar+n);
        for(i=1; i<n; i++)
        {
            for(j=0; j<n-i; j++)
            {
                y=ar[j].first;
                z=ar[i+j].first;
                d=abs(z-y);
                f=min(ar[j].second,ar[i+j].second);
                g=max(ar[j].second,ar[i+j].second);
                if(d>=(g-(f-1)))
                {
                    cout<<"YES"<<endl;
                    cout<<f<<" "<<g<<endl;
                    m++;
                    break;
                }
            }
            if(m!=0)
            {
                break;
            }
        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,x,d,y,z;
        cin>>n;
        ll ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>ar[i];
            if(ar[i]>m)
            {
                a=i;
                m=ar[i];
            }
            if(ar[i]<m1)
            {
                b=i;
                m1=ar[i];
            }
        }
        a++;
        b++;
        y=min(a,b);
        z=max(a,b);
        d=m-m1;

        if(d>=(z-(y-1)))
        {
            cout<<"YES"<<endl;
            cout<<y<<" "<<z<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,i,a,b,m=0;
        cin>>n;
        ll ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>ar[i];
        }
        for(i=0; i<n-1; i++)
        {
            if(abs(ar[i+1]-ar[i])>=2)
            {
                cout<<"YES"<<endl;
                cout<<i+1<<" "<<i+2<<endl;
                m++;
                break;
            }
        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,x,d;
        cin>>n;
        ll ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>ar[i];
            if(ar[i]>m)
            {
                a=i;
                m=ar[i];
            }
            if(ar[i]<m1)
            {
                b=i;
                m1=ar[i];
            }
        }
        d=m-m1;
        if(d<n)
        {
            cout<<"NO"<<endl;
        }
        else{
            cout<<"YES"<<endl;
            cout<<b+1<<" "<<a+1<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        sort(ar,ar+n);
        for(i=0; i<x; i++)
        {
            y=ar[i].first;
            z=ar[x].first;
            d=z-y;
            f=min(ar[i].second,ar[x].second);
            g=max(ar[i].second,ar[x].second);
            if(d>=(g-(f-1)))
            {
                cout<<"YES"<<endl;
                cout<<f<<" "<<g<<endl;
                m++;
                break;
            }
            x--;

        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        ll n,a,b,i,j,m=0,m1=10000000000,d,y,z,f,g,x,l;
        cin>>n;
        //x=n-1;
        pair<ll,ll>ar[n+5];
        for(i=0; i<n; i++)
        {
            cin>>l;
            ar[i]=make_pair(l,i+1);
        }
        //sort(ar,ar+n);
        for(i=0; i<n-1; i++)
        {
            //x=0;
            for(j=i+1; j<n; j++)
            {
                y=ar[i].first;
                z=ar[j].first;
                d=z-y;
                f=min(ar[i].second,ar[j].second);
                g=max(ar[i].second,ar[j].second);
                if(d>=(g-(f-1)))
                {
                    cout<<"YES"<<endl;
                    cout<<f<<" "<<g<<endl;
                    m++;

                    break;
                }

            }
            if(m!=0)
            {
                break;
            }

        }
        if(m==0)
        {
            cout<<"NO"<<endl;
        }

    }
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+8;
int a[maxn];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int l,r;
		bool flag=false;
		cin>>a[0];
		for(int i=1;i<n;i++){
			cin>>a[i];
			if(abs(a[i]-a[i-1])<=1) continue;
			flag=true;
			l=i,r=i+1;
		}
		if(flag) cout<<"YES"<<endl<<l<<" "<<r<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int max1=0,min1=1e9+9,l,r;
		for(int i=0;i<n;i++){
			int x;
			cin>>x;
			if(max1<x){
				max1=x;
				r=i+1;
			}else if(min1>x){
				min1=x;
				l=i+1;
			}
		}
		if(max1-min1>=n){
			puts("YES");
			if(l>r) swap(l,r);
			cout<<l<<" "<<r<<endl;
		}else{
			puts("NO");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int max1=0,min1=1e9+9,l,r;
		for(int i=0;i<n;i++){
			int x;
			cin>>x;
			if(max1<=x){
				max1=x;
				r=i+1;
			}
			if(min1>=x){
				min1=x;
				l=i+1;
			}
		}
		if(l>r) swap(l,r);
		if(max1-min1>=r-l){
			puts("YES");
			cout<<l<<" "<<r<<endl;
		}else{
			puts("NO");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int max1=0,min1=1e9+9,l,r;
		for(int i=0;i<n;i++){
			int x;
			cin>>x;
			if(max1<x){
				max1=x;
				r=i+1;
			}
			if(min1>x){
				min1=x;
				l=i+1;
			}
		}
		if(max1-min1>=n){
			puts("YES");
			if(l>r) swap(l,r);
			cout<<l<<" "<<r<<endl;
		}else{
			puts("NO");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int max1=0,min1=1e9+9,l,r;
		for(int i=0;i<n;i++){
			int x;
			cin>>x;
			if(max1<=x){
				max1=x;
				r=i+1;
			}
			if(min1>=x){
				min1=x;
				l=i+1;
			}
		}
		if(l>r) swap(l,r);
		if(max1-min1>=r-l+1){
			puts("YES");
			cout<<l<<" "<<r<<endl;
		}else{
			puts("NO");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+8;
int a[maxn];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int l,r;
		bool flag=false;
		cin>>a[0];
		for(int i=1;i<n;i++){
			cin>>a[i];
			if(a[i]-a[i-1]==1) continue;
			flag=true;
			l=i,r=i+1;
		}
		if(flag) cout<<"YES"<<endl<<l<<" "<<r;
		else cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+8;
int a[maxn];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int l,r;
		bool flag=false;
		cin>>a[0];
		for(int i=1;i<n;i++){
			cin>>a[i];
			if(a[i]-a[i-1]==1) continue;
			flag=true;
			l=i,r=i+1;
		}
		if(flag) cout<<"YES"<<endl<<l<<" "<<r<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[2e5+8];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int l,r;
		bool flag=false;
		cin>>a[0];
		for(int i=1;i<n;i++){
			cin>>a[i];
			if(a[i]-a[i-1]==1) continue;
			flag=true;
			l=i,r=i+1;
		}
		if(flag) cout<<"YES"<<endl<<l<<" "<<r;
		else cout<<"NO"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int max1=0,min1=1e9+9,l,r;
		for(int i=0;i<n;i++){
			int x;
			cin>>x;
			if(max1<=x){
				max1=x;
				r=i+1;
			}
			if(min1>=x){
				min1=x;
				l=i+1;
			}
		}
		if(max1-min1>=n){
			puts("YES");
			if(l>r) swap(l,r);
			cout<<l<<" "<<r<<endl;
		}else{
			puts("NO");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double

#define out() cout<<"========================"<<endl
#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define out4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define mp make_pair
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)	A.rbegin(),A.rend()
#define ft first
#define sd second

#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>

const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265

const ll N = 100005;
const long int maxi=1000000;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        Vpll v;ll a[n];
        ll i,j;for(i=0;i<n;i++)
        {
            cin>>a[i];
            v.pb(mp(a[i],i));
        }
        sort(v.begin(),v.end());
        ll k=abs(v.back().sd-v[0].sd);
        ll z=0,a1,a2;
        for(i=v.size()-1;i>=1;i--)
        {
            for(j=max(0ll,i-k);j<i;j++)
            {
              if(v[i].ft-v[j].ft>=abs(v[i].sd-v[j].sd)+1)
              {
                  z++;a1=min(v[i].sd,v[j].sd);a2=max(v[i].sd,v[j].sd);
                  break;
              }
            }
            if(z>0){break;}
        }
        if(z==0){cout<<"NO"<<endl;}
        else
        {
            cout<<"YES"<<endl;
            cout<<a1+1<<" "<<a2+1<<endl;
        }

    }

}


#include<bits/stdc++.h>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double

#define out() cout<<"========================"<<endl
#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define out4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define mp make_pair
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)	A.rbegin(),A.rend()
#define ft first
#define sd second

#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>

const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265

const ll N = 100005;
const long int maxi=1000000;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        Vpll v;ll a[n];
        ll i,j;for(i=0;i<n;i++)
        {
            cin>>a[i];
            v.pb(mp(a[i],i));
        }
        sort(v.begin(),v.end());
        ll imin=v[0].sd,imax=v.back().sd,ix,ixx,mi,mx;
        if(v.back().ft-v[0].ft>=abs(v.back().sd-v[0].sd+1))
        {
            cout<<"YES"<<endl;
            cout<<min(v.back().sd,v[0].sd)+1<<" "<<max(v.back().sd,v[0].sd)+1<<endl;
        }
        else
        {
            mi=a[0];ix=0;ll z=0,a1,a2;
            for(i=0;i<n;i++)
            {
                for(j=i-1;j>=ix;j--)
                {
                   if(abs(a[j]-a[i])>=i-j+1)
                   {
                       a1=j;a2=i;z++;break;
                   }
                }
                if(a[i]<mi){mi=a[i];ix=i;}
                if(z>0){break;}
            }
            if(z==0)
            {
                mx=a[0];ixx=0;
                for(i=0;i<n;i++)
              {
                for(j=i-1;j>=ixx;j--)
                {
                   if(abs(a[j]-a[i])>=i-j+1)
                   {
                       a1=j;a2=i;z++;break;
                   }
                }
                if(a[i]>mx){mx=a[i];ixx=i;}
                if(z>0){break;}
              }

            }
            if(z==0){cout<<"NO"<<endl;}
            else
            {
                cout<<"YES"<<endl;
                cout<<a1+1<<" "<<a2+1<<endl;
            }
        }

    }

}


#include<bits/stdc++.h>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double

#define out() cout<<"========================"<<endl
#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define out4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define mp make_pair
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)	A.rbegin(),A.rend()
#define ft first
#define sd second

#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>

const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265

const ll N = 100005;
const long int maxi=1000000;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        Vpll v;ll a[n];
        ll i,j;for(i=0;i<n;i++)
        {
            cin>>a[i];
            v.pb(mp(a[i],i));
        }
        sort(v.begin(),v.end());
        ll imin=v[0].sd,imax=v.back().sd,ix,ixx,mi,mx;
        if(v.back().ft-v[0].ft>=abs(v.back().sd-v[0].sd+1))
        {
            cout<<"YES"<<endl;
            cout<<min(v.back().sd,v[0].sd)<<" "<<max(v.back().sd,v[0].sd)<<endl;
        }
        else
        {
            mi=a[0];ix=0;ll z=0,a1,a2;
            for(i=0;i<n;i++)
            {
                for(j=i-1;j>=ix;j--)
                {
                   if(abs(a[j]-a[i])>=i-j+1)
                   {
                       a1=j;a2=i;z++;break;
                   }
                }
                if(a[i]<mi){mi=a[i];ix=i;}
                if(z>0){break;}
            }
            if(z==0)
            {
                mx=a[0];ixx=0;
                for(i=0;i<n;i++)
              {
                for(j=i-1;j>=ixx;j--)
                {
                   if(abs(a[j]-a[i])>=i-j+1)
                   {
                       a1=j;a2=i;z++;break;
                   }
                }
                if(a[i]>mx){mx=a[i];ixx=i;}
                if(z>0){break;}
              }

            }
            if(z==0){cout<<"NO"<<endl;}
            else
            {
                cout<<"YES"<<endl;
                cout<<a1<<" "<<a2<<endl;
            }
        }

    }

}


#include<bits/stdc++.h>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double

#define out() cout<<"========================"<<endl
#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define out4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define mp make_pair
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)	A.rbegin(),A.rend()
#define ft first
#define sd second

#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>

const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265

const ll N = 100005;
const long int maxi=1000000;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        Vpll v;ll a[n];
        ll i,j;for(i=0;i<n;i++)
        {
            cin>>a[i];
            v.pb(mp(a[i],i));
        }
        sort(v.begin(),v.end());
        ll z=0,a1,a2;
        for(i=1;i<v.size();i++)
        {
            if(v[i].ft-v[0].ft>=abs(v[i].sd-v[0].sd)+1)
            {z++;a1=v[0].sd;a2=v[i].sd;break;}
        }
        if(z==0)
        {
            for(i=v.size()-1;i>=0;i--)
            {
               if(v.back().ft-v[i].ft>=abs(v.back().sd-v[i].sd)+1)
               {z++;a1=v.back().sd;a2=v[i].sd;break;}
            }
        }
        if(z==0){cout<<"NO"<<endl;}
        else
        {
            cout<<"YES"<<endl;
            cout<<min(a1,a2)+1<<" "<<max(a1,a2)+1<<endl;
        }
    }

}


#include<bits/stdc++.h>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

#define ll long long
#define ld long double

#define out() cout<<"========================"<<endl
#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define out4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl

#define mp make_pair
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)	A.rbegin(),A.rend()
#define ft first
#define sd second

#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>

const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265

const ll N = 100005;
const long int maxi=1000000;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        Vpll v;ll a[n];
        ll i,j;for(i=0;i<n;i++)
        {
            cin>>a[i];
            v.pb(mp(a[i],i));
        }
        sort(v.begin(),v.end());
        ll z=0,a1,a2;
        for(i=v.size()-1;i>=1;i--)
        {
            for(j=0;j<i;j++)
            {
              if(v[i].ft-v[j].ft>=abs(v[i].sd-v[j].sd)+1)
              {
                  z++;a1=min(v[i].sd,v[j].sd);a2=max(v[i].sd,v[j].sd);
                  break;
              }
            }
            if(z>0){break;}
        }
        if(z==0){cout<<"NO"<<endl;}
        else
        {
            cout<<"YES"<<endl;
            cout<<a1+1<<" "<<a2+1<<endl;
        }

    }

}