#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
#define PB push_back
#define M 1000000007
#define B 500
double pi=3.1415926535;
int m,tt;
int judge(double t){
    double xk,yk,zk,xm,ym,zm;
    double arg;
    arg=pi/180*m;
    arg+=(t/41667*2*pi);
    zm=0;
    xm=cos(arg)*380000;
    ym=sin(arg)*380000;
    arg=t*2*pi/120;
    yk=ym;
    zk=zm+cos(arg)*1900;
    xk=xm-sin(arg)*1900;
    double k;
    k=(xk*xm+yk*ym+zk*zm)/(xk*xk+yk*yk+zk*zk);
    double xh,yh,zh;
    xh=xk*k;
    yh=yk*k;
    zh=zk*k;
    double xd,yd,zd;
    xd=xh-xm;
    yd=yh-ym;
    zd=zh-zm;
    if(k<=1&&xd*xd+yd*yd+zd*zd<1800*1800){
        return 1;
    }
    else return 0;
}
int main(void){
   scanf("%d%d",&m,&tt);
   double ans=0;
   for(int i=0;i<=tt*B;i++){
       ans+=judge(D(i)/B);
   }
   printf("%lf\n",ans/B);
}
