Challenge: Find the Egyptian Fraction's Denominators

Given a positive fraction, break it down into its Egyptian fraction's denominators.

Problem statement

Every positive fraction can be represented as the sum of its unique unit fractions. A fraction is a unit fraction, if the numerator is 1 and the denominator is a positive integer. For example, 1/3 is a unit fraction. Such a representation is called an Egyptian Fraction.

Input

Two variables numerator and denominator

Output

A list in the format [d1, d2, ..., dn]

Sample input

  numerator = 2
  denominator = 3

Sample output

  result = [2, 6]

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.