Module: (Python) Practicum 4. Euclid's Algorithm


Problem

4 /6


Petit triangle

Theory Click to read/hide

 In Python, the math module contains a number of mathematical operations that can be performed fairly quickly. Starting from version 3.5, you can use the built-in function to calculate the gcd of any two integers - math.gcd(a, b).
GCD is short for Greatest Common Divisor.

Problem

Fifth-grader Petya likes to solve various mathematical problems. The last task was to find such integers a, b, x and y to help construct triangle ABC  minimum (non-zero) area. Petit's triangle should have the following coordinates \(A = (0, 0)\), \(B = (a , b)\)\(C = (x, y)\).
Help him determine what is the minimum area triangle ABC can have?

Input
Given two integers a and b, modulo not exceeding 109 (\(a^2 + b^2 > 0\)).

Imprint
Print a single number - the minimum possible area of ​​triangle ABC with precision 10 - 6
 
Examples
# Input Output
1 4 0 2.0