from bisect import * from math import hypot, isclose # My second (cleaner) solution: diagonal "zig" to the right (+n, +0.5), diagonal "zag" to the left (-n, +0.5). (n, m), l = map(int, input().split()), float(input()) if isclose(l, hypot(n, m)): print(f"2\n0 0\n{n} {m}"), exit() zigzag = [(i * n % (2 * n), i / 2) for i in range(int(m) * 2)] ds = [i * hypot(n, 0.5) for i in range(int(m) * 2)] split = bisect([d + hypot(n - x, m - y) for (x, y), d in zip(zigzag, ds)], l) l -= ds[split - 1] res, new_y = zigzag[:split], zigzag[split][1] al, ah = 0, n # Binary search for the in-between point to finish the cable if split % 2 == 0: # Just moved from left to right and half up, so move to left (and half up) while not isclose(al, ah): a = (al + ah) / 2 if hypot(a, 0.5) + hypot(a, m - new_y) < l: al = a else: ah = a res.append((n - a, new_y)) if split % 2 == 1: # Just moved from right to left (and half up), so move to right (and half up) while not isclose(al, ah): a = (al + ah) / 2 if hypot(a, 0.5) + hypot(n - a, m - new_y) < l: al = a else: ah = a res.append((a, new_y)) print(str(len(res) + 1) + "\n" + "\n".join(f"{a} {b}" for a, b in (*res, (n, m))))