Ultraviolet A 10573-geometry Paradox

Source: Internet
Author: User

Question: We know the radius of two tangent circles R1 and R2, which are switched to a large circle R at the same time,

The length of the cut line segment intercepted by a large circle after two small circles is t, and the area of the large circle minus the area of the two small circles is calculated.

Analysis: calculates the ry. The question shows the following equations:

R = R1 + R2;

T ^ 2 = 4 (R ^ 2-(r2-r1) ^ 2) = 4r1r2;

Sort and obtain:

S = π (R ^ 2-R1 ^ 2-R2 ^ 2) = π 2r1r2 = π t ^ 2/8.

Note: There seems to be no invalid data (⊙ _ ⊙ ).

#include <iostream> #include <cstdlib>#include <cstdio>#include <cmath>using namespace std;double pi = 2.0*acos(0.0),a,b;char   buf[101];int main(){int n;while (cin >> n) {getchar();while (n --) {gets(buf);if (sscanf(buf, "%lf%lf", &a,&b) == 1) {if (a >= 0)printf("%.4lf\n",pi*a*a*0.125);else printf("Impossible.\n");}else {if (a >= 0 && b >= 0)printf("%.4lf\n",pi*a*b*2.0);else printf("Impossible.\n");}}}return 0;}


S = π (R ^ 2-R1 ^ 2-R2 ^ 2 );

Ultraviolet A 10573-geometry Paradox

Contact Us

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.