Minimal Distance to Pi

Here is a problem from Week of Code 29 hosted by Hackerrank. Problem. Given two integers and (), find and print a common fraction such that and is minimal. If there are several fractions having minimal distance to , choose the one with the smallest denominator. Note that checking all possible denominators does not work… Continue reading Minimal Distance to Pi