import sequtils,algorithm,math,tables,sugar import sets,intsets,queues,heapqueue,bitops,strutils proc printf(formatstr: cstring){.header: "", varargs.} 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 scanName(): string = result = "" while true: let k = getchar_unlocked() if k == ' ': return result &= k proc calcScore(star:int,ac:int):int = 50 * star + (50 * star) * 5 div (4 + ac) let n = scan() let L = newSeqWith(n,scan()) var AC = newSeqWith(n,1) type User = tuple[ name: string, scores : seq[int], lastSubmit: int, sum:int ] var maxID = 0 var userIDs = newTable[string,int]() var users = newSeq[User]() for i in 0..