-
Notifications
You must be signed in to change notification settings - Fork 0
/
contest6581.cpp
53 lines (52 loc) · 1.47 KB
/
contest6581.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define ll long long int
#define rep(i,n) for(ll i = 0; i < n; i++)
#define repp(i,x,y) for(ll i = x; i <= y; i++)
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define ss(s) scanf("%s",s)
#define pi(x) printf("%d\n",x)
#define pl(x) printf("%lld\n",x)
#define ps(s) printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
int main() {
ll t; cin >> t;
while(t--){
ll n; cin >> n;
vl a(n);
rep(i, n) cin >> a[i];
ll count = 0;
if(n == 1){
cout<<"First"<<"\n";
continue;
}
rep(i, n){
if((i != 0 and a[i] > 1) and n%(i+1) == 0) count++;
else if(a[i] > 1) count+=2;
else count++;
}
if(count%2 == 0) cout<<"Second"<<"\n";
else cout<<"First"<<"\n";
}
return 0;
}