<GeeksforGeeks>Largest proper fraction | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

<GeeksforGeeks>Largest proper fraction

Largest proper fraction with sum of numerator and denominator equal to a given number We are provided with a number N. Find the biggest proper fraction a/b such that a + b = N. Following are constraints for fraction.a/b is a proper fraction if a<b and a and b are coprimes i.e no common factor of a and b.There can be multiple proper fractions with sum of numerator and denominator equal to a given number. The main task is to find the fraction having the maximum floating point value.E.g. In: N = 3 Out 1 2

13th Sep 2017, 6:56 PM
S Liu
S Liu - avatar
1 Answer
13th Sep 2017, 8:26 PM
S Liu
S Liu - avatar