URI ONLINE JUDGE SOLUTION 1291 - Online Judge

Latest

This is an Online Judge Solution Base Site. We can discuss & Solve any contest solution in Programming.

Friday, April 10, 2020

URI ONLINE JUDGE SOLUTION 1291

Problem Number: 1291
Problem Name: Is This Integration?
Author’s Name: By Shahriar Manzoor Bangladesh
Timelimit: 1
Problem Category: AD-HOC
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1291

Solution:

#include<bits/stdc++.h>


using namespace std;

int main()
{
    double a;
    double a1;
    double a2;
    double a3;

    while(scanf("%lf", &a) != EOF)
    {
        a3 = (-a) * a * (3 * (sqrt(3) - 4) + 2 * M_PI)/3.0;
        a2 = 4 * (a * a * (1 - M_PI/4) - (a3) / 2);
        a1 = a * a - a2 - a3;
        printf("%.3lf %.3lf %.3lfn",a1,a2,a3);
    }
    return 0;
}

No comments:

Post a Comment

Thanks..