import sequtils,algorithm proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord proc find*[T](arr: seq[T],item: T,start,fin:int): int {.inline.}= for i in start..