func main() var n: int :: cui@inputInt() var k: int :: cui@inputInt() var x: int :: 0 for i(1, n) if(i <= n - 2 - k) do cui@print("\{x}\{i = n ?("\n", " ")}") else do cui@print("\{x}\{i = n ?("\n", " ")}") if(x = 0) do x :: 1 elif(x > 0) do x :: -x else do x :: -x + 1 end if end if end for end func