Egyption Fractions
CodeChefOpen on judge ↗
A fraction a/b is called in its lowest form if gcd(a, b) = 1. It is possible to express a/b using the sum of a finite number of reciprocals of natural numbers. For example, 2/7 can be written as 1/4 + 1/28. Such a representation is called an Egyptian fraction representation of a/b. For each fraction, there could be multiple Egyptian fraction representations. Let two sets of reciprocals be (p1, p2
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start