from bisect import * from math import hypot, isclose # My first solution: horizontal "zig" to the right (+n, +0), diagonal "zag" to the left (-n, +1). (n, m), l = map(int, input().split()), float(input()) zigzag = [pos for sublist in [[(0, y), (n, y)] for y in range(int(m))] for pos in sublist] ds = [d for sublist in [[y * (n + hypot(n, 1)), y * (n + hypot(n, 1)) + n] for y in range(int(m))] for d in sublist] 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, so move to left (and one up) while not isclose(al, ah): a = (al + ah) / 2 if hypot(a, 1) + 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 one up), so move to right while not isclose(al, ah): a = (al + ah) / 2 if a + 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))))