Try our Free Online Math Solver!
From Rational to Factorial
A factorial number N denoted by N = [, a, b] consists of three parts.
• the sign part which is either 0 or 1,
• the whole part a = [an, . . . , a1, a0], where ak = 0, 1, . . . , k + 1, for k = 0, 1, . . . , n and,
• the fractional part b = [b1, b2, . . . , bm], where bk = 0, 1, . . . , k for k = 1, 2, . . . ,m
such that N is equivalent to the decimal number
Write a program that converts a rational number to a factorial number.
One line of output per test case. The line represents the factorial number that corresponds
to the rational number in the input. It must have the form