1043 লেবেলটি সহ পোস্টগুলি দেখানো হচ্ছে৷ সকল পোস্ট দেখান
1043 লেবেলটি সহ পোস্টগুলি দেখানো হচ্ছে৷ সকল পোস্ট দেখান

শনিবার, ১৭ নভেম্বর, ২০১২

Solution of Light Online Judge : 1043 - Triangle Partitioning

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


Problem Statement :
    You are given AB, AC and BC. DE 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 . 

 ৫ । Simply use this formula .

Code :

#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    int i,test;
    double AB,BC,CA,AD,DE,ratio;
    cin>>test;
    for(i=1;i<=test;i++)
    {
        cin>>AB>>CA>>BC>>ratio;
        ratio = ratio/(ratio+1);
        AD = AB*sqrt(ratio);
        printf("Case %d: %lf\n",i,AD);
    }
    return 0;
}