Keep W small h large... keep a <= 90 degrees .. there are roughly two kinds of intersection between the entire graph .. one is given by the topic diagram .. the other is that when a is large, the area of the intersection is parallelogram .. the critical condition is the intersection of two corners of two rectangles... tan (A/2) = H/W
It is possible to calculate the number of brute force settings in two cases. It is too troublesome to add a helper line.
Program:
# Include <iostream> # include <string. h> # include <algorithm> # include <cmath> # include <queue> # include <stdio. h >#include <stack> # define oo 1000000007 # define ll long # define PI ACOs (-1.0) using namespace STD; double W, H, A, T, X, y, Z, ans; int main () {While (~ Scanf ("% lf", & W, & H, & A) {if (a> 90) A = 180-a; If (h> W) T = H, H = W, W = T; if (a> 89.5) {printf ("%. 9f ", H * H); continue;} if (a <0.5) {printf (" %. 9f ", H * w); continue;} A = A/180 * PI; If (TAN (A/2)> (H/W )) {x = H/TAN (a); y = (H/2) * Tan (A/2); Z = (W/2-x-y ); ans = (2 * z + x) * h; printf ("%. 9f \ n ", w * H-ans);} else {x = W/2-(H/2) * Tan (A/2 ); y = x * Tan (a); ans = x * Y; X = W-x-y/sin (a); y = x/TAN (); ans + = x * Y; printf ("%. 9f \ n ", w * H-ans) ;}} return 0 ;}