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".
1 1 1 0 1 0
1 0 1 0 1 0 1 0 1 1
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.