LightOJ 1043 - Triangle Partitioning Solution

Explain:

 আজকে আমরা এমন একটা সমস্যার সমাধান করব যাতে আমাদের Previous Knowledge (Class 9-10) কাজে লাগবে । তাহলে চল শুরু করা যাক ।  


Problem Statement :
    You are given ABAC and BCDE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value of AD.

Solution Idea :
       1. Let tri-angle ADE / BDEC = m/n .        2 .  কাজেই ADE / ABC = m/(m+n)
       3. From উপপাদ্য 3.10 (Higher Geometry -class 9-10) we know that
 
                 ADE / ABC = DE^2 / BC ^ 2

                 বা , sqrt(m)/sqrt((m+n))  = DE/BC
          
                 বা , x = DE/BC 

       where x = sqrt(m)/sqrt((m+n))


      4.  As ADE and ABC are সদৃশকোণী ত্রিভুজ so

                      AD/AB = DE /BC

                   বা , AD = DE/BC* AB



                   বা , AD =   x * AB . 

Solve in C++:

///**********ALLAH IS ALMIGHTY************///
     ///AH Tonmoy
    ///Department of CSE,23rd batch
    ///Islamic University,Bangladesh
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double ab,ac,bc,de,r,x,ad;
    int t,i;
    cin>>t;
    for(i=1;i<=t;i++)
    {
        cin>>ab>>ac>>bc>>r;
        x=(r/(r+1));
        ad=ab*(sqrt(x));
        printf("Case %d: %lf\n",i,ad);
    }

}

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.