from collections import deque A, B = map(int, input().split()) Closed = {(1, 1)} ans = 0.25 Dx = [A,A,-A,-A,B,B,-B,-B] Dy = [B,-B,B,B,A,-A,A,-A] q = deque([(1, 1)]) for i in range(10**5): if not q: break x, y = q.popleft() for dx, dy in zip(Dx, Dy): ux, uy = x+dx, y+dy if (ux, uy) not in Closed: Closed.add((ux, uy)) q.append((ux, uy)) if 1 <= ux < 50 and 1 <= uy < 50: ans += 1 / ((ux+uy)**(ux+uy)) #print(ux, uy) print(ans)