PRAC - Editorial

PROBLEM LINK:

Practice

Contest

Author: Ranjan Kumar Singh

Tester: Ved Prakash

Editorialist: Sudipto Roy

DIFFICULTY:

Simple

PRE-REQUISITES:

Basic Maths

PROBLEM:

To find the radius of the circumcircle from the given sides of the triangle.

EXPLANATION:

If a,b and c are the three sides of a triangle then, from the given sides of the triangle, radius of the circumcircle is found by a &times b &times c/{sqrt((a+b+c)&times(b+c-a)&times(c+a-b)&times(a+b-c))}.

Pseudo Code:

r=(a*b*c)/sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c))

Complexity: O(1).

SOLUTIONS:

Setter’s solution

Tester’s solution

1 Like