fork download
  1. T=int(input())
  2. if T >= 1 and T <=10:
  3. N=[]
  4. for a in range(T):
  5. N.append([input(), ''])
  6. N[a][1]=input()
  7. rsp=[]
  8. for b in N:
  9. cs=b[1].split()
  10. n=int(b[0])
  11. if (len(cs) >= 0 and len(cs) <= 10**9) and len(cs)== n and (len(N) >= 1 and len(N) <=10**5):
  12. rsp.append(eval(' | '.join(cs)))
  13. for t in rsp:
  14. print(t)
Success #stdin #stdout 0.02s 28352KB
stdin
2
2
1 2
3
3 5 7
stdout
3
7