you give positive integer xyn your task find near fraction fraction denominator n formally find pair integer ab 1bn0a value minimal possibleif multiple near fraction choose minimum denominator if multiple near fraction minimum denominator choose minimum numerator