#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define PI 3.14159265358979323846 struct S { double x,y,r; double v,a; } s[12]; double limit=2000; double dp[1<<12][12]; static inline double sq(double x){ return x*x; } static inline double f(double ix,double iy,double it,double lo,double hi,int j){ for(int k=0;k<18;++k){ double mid=(lo+hi)*.5; double jt=it+mid; double ja=s[j].a+s[j].v*jt; double jx=s[j].x+s[j].r*cos(ja); double jy=s[j].y+s[j].r*sin(ja); if(sq(jx-ix)+sq(jy-iy)it+lo){ double r=f(ix,iy,it,lo,hi,j); if(dp[m|1<r){ dp[m|1<r){ z=r; } } printf("%f",z); }