UVA Problem 10522 Solution

Problem Solving, UVa

 

 

#include <bits/stdc++.h>

#include <cmath>



using namespace std;



int main()

{

  int tc;

  cin>>tc;

 

  while (tc) {

     

    double ha, hb, hc,a,b,c;//s,s1,a1,b1,c1,a,b,c;

    scanf("%lf%lf%lf", &ha, &hb, &hc);

    

     

         a=1/ha,b=1/hb,c=1/hc;

      double s1=(a + b + c);

      double a1=(-a + b + c);

      double b1=(a - b + c);

      double c1=(a + b - c);

      double s=s1*a1*b1*c1;

       if (s <= 0)

        {

        printf("These are invalid inputs!\n");

        tc--;

          }

       else if (ha == 0 || hb == 0 || hc == 0)

      {

       printf("These are invalid inputs!\n");

       tc--;   

      }

      else {

        printf("%.3f\n", 1 / sqrt(s));

      }

     

     

    }

 

  return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...