m=int(input())for t in range(m): n=int(input()) a=list(map(int,input().split())) s=a[0] for i in range(n): s=s&a[i] print(s)
4 2 3 10 3 1 1 3 4 3 11 3 7 5 11 7 15 3 7
2 1 3 3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!