t=int(input())
for i in range(t):
k,d0,d1 = map(int,input().split())
ls=[d0,d1]
s = d0 + d1
add=s
for i in range(0,k-2):
ls.append(((2**i)*s)%10)
add+=ls[i+2]
print(ls)
if add%3 == 0:
print("YES")
else:
print('NO')
Please share link of submission instead of copy pasting code to get reply from community.