from collections import deque
if __name__ == "__main__":
    new_lines = deque([[[0.0, 0.0], [100.0, 0.0]]])
    n = int(input())
    sin60 = 3**0.5/2.0
    cos60 = 1.0/2.0
    for _ in range(n):
        lines = new_lines
        new_lines = deque()
        while lines:
            t1, t2 = lines.popleft()
            n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0]
            n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0]
            x, y = [n3[0]-n1[0], n3[1]-n1[1]]
            x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y]
            n2 = [n1[0]+x60, n1[1]+y60]
            new_lines.append([t1, n1])
            new_lines.append([n1, n2])
            new_lines.append([n2, n3])
            new_lines.append([n3, t2])
    coordinates = list(zip(*new_lines))[0] + ([100.0, 0.0],)
    for coordinate in coordinates:
        print(*coordinate) from collections import deque if __name__ == "__main__":
    new_lines = deque([[[0.0, 0.0], [100.0, 0.0]]])
    n = int(input())
    sin60 = 3**0.5/2.0
    cos60 = 1.0/2.0
    for _ in range(n):
        lines = new_lines
        new_lines = deque()
        while lines:
            t1, t2 = lines.popleft()
            n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0]
            n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0]
            x, y = [n3[0]-n1[0], n3[1]-n1[1]]
            x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y]
            n2 = [n1[0]+x60, n1[1]+y60]
            new_lines.append([t1, n1])
            new_lines.append([n1, n2])
            new_lines.append([n2, n3])
            new_lines.append([n3, t2])
    coordinates = list(zip(*new_lines))[0] + ([100.0, 0.0],)
    for coordinate in coordinates:
        print(*coordinate) __name__ == "__main__" __name__ "__main__" new_lines = deque([[[0.0, 0.0], [100.0, 0.0]]]) new_lines deque([[[0.0, 0.0], [100.0, 0.0]]]) deque [[[0.0, 0.0], [100.0, 0.0]]] [[0.0, 0.0], [100.0, 0.0]] [0.0, 0.0] 0.0 0.0 [100.0, 0.0] 100.0 0.0 n = int(input()) n int(input()) int input() input sin60 = 3**0.5/2.0 sin60 3**0.5/2.0 3**0.5 3 0.5 2.0 cos60 = 1.0/2.0 cos60 1.0/2.0 1.0 2.0 for _ in range(n):
        lines = new_lines
        new_lines = deque()
        while lines:
            t1, t2 = lines.popleft()
            n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0]
            n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0]
            x, y = [n3[0]-n1[0], n3[1]-n1[1]]
            x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y]
            n2 = [n1[0]+x60, n1[1]+y60]
            new_lines.append([t1, n1])
            new_lines.append([n1, n2])
            new_lines.append([n2, n3])
            new_lines.append([n3, t2])
     _ range(n) range n lines = new_lines lines new_lines new_lines = deque() new_lines deque() deque while lines:
            t1, t2 = lines.popleft()
            n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0]
            n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0]
            x, y = [n3[0]-n1[0], n3[1]-n1[1]]
            x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y]
            n2 = [n1[0]+x60, n1[1]+y60]
            new_lines.append([t1, n1])
            new_lines.append([n1, n2])
            new_lines.append([n2, n3])
            new_lines.append([n3, t2])
     lines t1, t2 = lines.popleft() t1 lines.popleft() lines.popleft lines popleft t2 n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0] n1 [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0] (2.0*t1[0]+t2[0])/3.0 2.0*t1[0]+t2[0] 2.0*t1[0] 2.0 t1[0] t1 0 t2[0] t2 0 3.0 (2.0*t1[1]+t2[1])/3.0 2.0*t1[1]+t2[1] 2.0*t1[1] 2.0 t1[1] t1 1 t2[1] t2 1 3.0 n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0] n3 [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0] (t1[0]+2.0*t2[0])/3.0 t1[0]+2.0*t2[0] t1[0] t1 0 2.0*t2[0] 2.0 t2[0] t2 0 3.0 (t1[1]+2.0*t2[1])/3.0 t1[1]+2.0*t2[1] t1[1] t1 1 2.0*t2[1] 2.0 t2[1] t2 1 3.0 x, y = [n3[0]-n1[0], n3[1]-n1[1]] x [n3[0]-n1[0], n3[1]-n1[1]] n3[0]-n1[0] n3[0] n3 0 n1[0] n1 0 n3[1]-n1[1] n3[1] n3 1 n1[1] n1 1 y x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y] x60 [cos60*x - sin60*y ,sin60*x + cos60*y] cos60*x - sin60*y cos60*x cos60 x sin60*y sin60 y sin60*x + cos60*y sin60*x sin60 x cos60*y cos60 y y60 n2 = [n1[0]+x60, n1[1]+y60] n2 [n1[0]+x60, n1[1]+y60] n1[0]+x60 n1[0] n1 0 x60 n1[1]+y60 n1[1] n1 1 y60 new_lines.append([t1, n1]) new_lines.append new_lines append [t1, n1] t1 n1 new_lines.append([n1, n2]) new_lines.append new_lines append [n1, n2] n1 n2 new_lines.append([n2, n3]) new_lines.append new_lines append [n2, n3] n2 n3 new_lines.append([n3, t2]) new_lines.append new_lines append [n3, t2] n3 t2 coordinates = list(zip(*new_lines))[0] + ([100.0, 0.0],) coordinates list(zip(*new_lines))[0] + ([100.0, 0.0],) list(zip(*new_lines))[0] (zip(*new_lines)) list zip(*new_lines) zip *new_lines new_lines 0 [100.0, 0.0] 100.0 0.0 for coordinate in coordinates:
        print(*coordinate) coordinate coordinates print(*coordinate) print *coordinate coordinate n = int(input()) int(input()) n x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y] [cos60*x - sin60*y ,sin60*x + cos60*y] x60 y = [n3[0]-n1[0], n3[1]-n1[1]] [n3[0]-n1[0], n3[1]-n1[1]] y n2 = [n1[0]+x60, n1[1]+y60] [n1[0]+x60, n1[1]+y60] n2 lines = new_lines new_lines lines new_lines = deque([[[0.0, 0.0], [100.0, 0.0]]]) deque([[[0.0, 0.0], [100.0, 0.0]]]) new_lines n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0] [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0] n1 x, y = [n3[0]-n1[0], n3[1]-n1[1]] [n3[0]-n1[0], n3[1]-n1[1]] x n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0] [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0] n3 t1, t2 = lines.popleft() lines.popleft() t1 y60 = [cos60*x - sin60*y ,sin60*x + cos60*y] [cos60*x - sin60*y ,sin60*x + cos60*y] y60 sin60 = 3**0.5/2.0 3**0.5/2.0 sin60 cos60 = 1.0/2.0 1.0/2.0 cos60 t2 = lines.popleft() lines.popleft() t2 new_lines = deque() deque() new_lines coordinates = list(zip(*new_lines))[0] + ([100.0, 0.0],) list(zip(*new_lines))[0] + ([100.0, 0.0],) coordinates
from collections import deque
if __name__ == "__main__":
    new_lines = deque([[[0.0, 0.0], [100.0, 0.0]]])
    n = int(input())
    sin60 = 3**0.5/2.0
    cos60 = 1.0/2.0
    for _ in range(n):
        lines = new_lines
        new_lines = deque()
        while lines:
            t1, t2 = lines.popleft()
            n1 = [(2.0*t1[0]+t2[0])/3.0, (2.0*t1[1]+t2[1])/3.0]
            n3 = [(t1[0]+2.0*t2[0])/3.0, (t1[1]+2.0*t2[1])/3.0]
            x, y = [n3[0]-n1[0], n3[1]-n1[1]]
            x60, y60 = [cos60*x - sin60*y ,sin60*x + cos60*y]
            n2 = [n1[0]+x60, n1[1]+y60]
            new_lines.append([t1, n1])
            new_lines.append([n1, n2])
            new_lines.append([n2, n3])
            new_lines.append([n3, t2])
    coordinates = list(zip(*new_lines))[0] + ([100.0, 0.0],)
    for coordinate in coordinates:
        print(*coordinate)
