import sequtils proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = result = 0 while true: var k = getchar_unlocked() if k < '0' or k > '9': break else: result = 10 * result + k.ord - '0'.ord # type # NodeObj[T] = object # next : ref NodeObj[T] # value : T # Node[T] = ref NodeObj[T] # ConstantList[T] = ref object # nodes: seq[Node[T]] # proc initConstantList[T](arr:seq[T]) : List[T] = # new(result) # for a in arr: # result.nodes = let n = scan() let m = scan() var C = toSeq(1..n) for _ in 0..