defmodule Main do def main do IO.read(:line) |> String.trim() |> String.to_integer() |> interact() |> IO.puts() end def interact(n) do r = 1..n |> Enum.to_list() r |> Enum.filter(fn x -> i = x - 1 s = r |> List.delete_at(i) t = IO.gets("? #{(s |> length) - 1}\n#{s |> Enum.join(" ")}\n") :timer.sleep(1) t |> String.trim() == "0" end) |> (&"! #{&1 |> length}\n#{&1 |> Enum.join(" ")}\n").() end end