import sequtils,algorithm proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0' or k > '9': break result = 10 * result + k.ord - '0'.ord proc parseLine(): tuple[x,y:int] = let (x1,x2,x3) = (scan(),scan(),scan()) let (y1,y2,y3) = (scan(),scan(),scan()) result.x = x3 + x2 * 60 + x1 * 1440 result.y = y3 + y2 * 60 + y1 * 1440 proc swapSortDescending(arr:var seq[int],index:int) = # 10-9-6-3-7-2-1 を直す for i in 0..= arr[index] : continue for j in i..= u.x : continue for i in 0..= u.x: continue preY[i] = u.y ans += 1 preY.swapSortDescending(i) break echo ans