import sequtils,algorithm,math,tables,sugar import sets,intsets,queues,heapqueue,bitops,strutils template times*(n:int,body) = (for _ in 0.." .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord 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) var scores = newSeqWith(n,initTable[string,int]()) # id -> name -> score var names = initSet[string]() var lastSubmits = initTable[string,int]() for i in 0.. ( if x.sum != y.sum: -x.sum + y.sum else: lastSubmits[x.name] - lastSubmits[y.name])) for i,r in results: let (name,S,sum) = r stdout.write i+1," ",name," " for s in S: stdout.write s," " echo sum