import sequtils,strutils,algorithm,math,future,macros template get*():string = stdin.readLine() #.strip() macro unpack*(arr: auto,cnt: static[int]): auto = let t = genSym(); result = quote do:(let `t` = `arr`;()) for i in 0.." .} macro scanints(cnt:static[int]): auto = var str = ""; for i in 0.." .} proc scan1[T](): T = var x:T var k:cint var minus = false while true: k = getchar_unlocked() if k == '-'.ord: (minus = true; break) if '0'.ord <= k and k <= '9'.ord: (x = k - '0'.ord; break) while true: k = getchar_unlocked() if k < '0'.ord or k > '9'.ord: break x = 10 * x + k - '0'.ord if minus : x *= -1 return x #proc scan3[T](x,y,z:var T):void = (x.scan1;y.scan1;z.scan1) #proc scan5[T](x,y,z,s,t:var T):void = (x.scan1;y.scan1;z.scan1;s.scan1;t.scan1) proc scan3[T]():array[3,T] = [scan1[T](),scan1[T](),scan1[T]()] proc scan5[T]():array[5,T] = [scan1[T](),scan1[T](),scan1[T](),scan1[T](),scan1[T]()] let (N,K) = get().split().map(parseInt).unpack(2) var field : array[-501..501,array[-501..501,int]] ene_XYHP : array[0..100_0001,array[3,int32]] for n in 0..