Given an array of binary integers, suppose these values are kept on the circumference of a circle at an equal distance. The task is to tell whether is it possible to draw a regular polygon using only 1s as its vertices or not.
If yes then print 1 else -1.
First line consists of T test cases. First line of every test case consists of N, denoting the number of elements in an array. Second line of every test case consists of elements of array (only 0s and 1s).
Single line output, print "1" if it is possible to make a regular polygon else "-1".