# Codeforces round #172 (280a)-rectangle puzzle

Source: Internet
Author: User

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 ;}`
Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.