import math 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 scan().times: let a = scan() let b = scan() let xyz = b.float * log10(a.float) let z = xyz.int let xy = pow(10.0, xyz - z.float) let x = xy.int let y = (xy * 10).int mod 10 echo x," ",y," ",z # b*(log(a)) == z * log10 + log(XY)