P, Q = map(int, input().split()) LR=P/Q L = 0 R = 0 qL, pL, pR, qR = 0, 0, 0, 0 minR = 100000 maxL = 0 #for p in range(1, 2): p=1 for q in range(1, int(Q**0.5)): RL = p/q if RLmaxL: maxL = RL pL, qL= p, q else: if RL