template times*(n:int,body) = (for _ in 0.." .} proc scan(): int = while true: var k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord proc printf(formatstr: cstring){.header: "", varargs.} proc impl() = template OK() = printf("AC\n") return template NG() = printf("ZETUBOU\n") return let d = scan() # 深さ let x = scan() let t = scan() if t == 0: NG() if d == 1: OK() var ans = 1 for i in 1..(d-1): ans = ans * (x+i) div i if ans <= t : continue NG() OK() let q = scan() q.times: impl()