0 #include using namespace std; #define pi acos(-1.0) pair< double, double> rot(pair< double, double> i, double theta) { return {i.first*cos(theta)+i.second*sin(theta),-i.first*sin(theta)+i.second*cos(theta)}; } int main() { int t; cin>>t; while(t--) { long long a,b,m,n,theta; cin>>a>>b>>m>>n>>theta; vector>pp; long long g=gcd(m,n); m/=g; n/=g; pp.emplace_back(0,0); pp.emplace_back(b,0); pp.emplace_back(b,a); pp.emplace_back(0,a); for(auto &i:pp) { i=rot(i,pi*theta/180.0); } double d1=1e10, d2=1e10; for(auto i:pp) { d1=min(d1,i.first); d2=min(d2,i.second); } double wd=0,hd=0; for(auto &i:pp) { i.first-=d1; i.second-=d2; wd=max(i.first,wd); hd=max(i.second,hd); } long long lo=0,hi=1e10,ans=0; while(lo<=hi) { long long mi=(lo+hi)/2; long long w=n*mi,h=m*mi; if(wd-w<=1e-6 and hd-h<=1e-6) { hi=mi-1; ans=mi; } else lo=mi+1; } cout<1e-6 i got an WA . And how someone possibly know that he will got an WA for that ?
 On ThinkAgain → Google Kickstart Round B Solutions, 3 years ago 0 have you read the problem statement?An arithmetic array is an array that contains at least two integers and the differences between consecutive integers are equal. and you have to find the length of the longest possible arithmetic subarray.here 5 5 4 5so, the differences are 0 1 -1