Find amount of heads and tails from percentages Note: as this question has been marked as a duplicate, I have accepted an answer. However, I will still check this question if users can find a shorter way of doing it, and accept that answer.

Given two numbers (which are multiples of 0.5) representing heads-percentage and tails-percentage from a series of coin-flipping, output the minimum amounts of heads and tails to produce percentages such as those. Input and output can be in any form. However, output must be in a readable format (Good examples are x y, [x y], etc).

Examples:


Input: 25 75 (25% heads, 75% tails) Output: 1 3 (an output of 25 75 is invalid since that is not the minimum amounts of heads and tails to produce those percentages)
Input: 30 70 (30% heads, 70% tails) Output: 3 7
Input: 99.5 0.5 (99.5% heads, 0.5% tails) Output: 199 1


You may assume that there will always be a digit before and after a decimal point in an input (no .5s or 15.s). You may also assume the input adds up to 100%. This is code-golf, shortest code in bytes wins!
Dyalog APL, 3 bytes

,÷∨


This is a dyadic function train that accepts the percentages as left and right arguments:

┌─┼─┐
, ÷ ∨


It is equivalent to the following, train-less function:

{(⍺,⍵)÷⍺∨⍵}


Try it online on TryAPL.

How it works

  ∨  Compute the GCD of both arguments.
,    Concatenate both arguments.
 ÷   Divide the latter by the former.