Problem:
Problem Statement

There are N piles of candies on the table. The piles are numbered 1 through N. At first, pile i contains a_i candies.

Snuke and Ciel are playing a game. They take alternating turns. Snuke goes first. In each turn, the current player must perform one of the following two operations:

Choose a pile with the largest number of candies remaining, then eat all candies of that pile.

From each pile with one or more candies remaining, eat one candy.

The player who eats the last candy on the table, loses the game. Determine which player will win if both players play the game optimally.

Constraints

1≤N≤10^5

1≤a_i≤10^9

Input

The input is given from Standard Input in the following format:

N
a_1 a_2 … a_N

Output

If Snuke will win, print First. If Ciel will win, print Second.

Sample Input 1

2
1 3

Sample Output 1

First

At the beginning of the game, pile 2 contains the most candies. If Snuke eats all candies of this pile, Ciel has no choice but to eat the last candy.

Sample Input 2

3
1 2 1

Sample Output 2

First

If Snuke eats one candy from each pile, Ciel is again left with the last candy.

Sample Input 3

3
1 2 3

Sample Output 3

Second

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
#include <assert.h>
typedef long long ll;
using namespace std;
const ll MAXN=1e5+4;
const ll INF=1e18;
ll a[MAXN];
map<ll,char> b[MAXN];
char gett(ll x,ll y) {
	auto it=b[x].find(y);
	if (it==b[x].end()) return '!';
	else return it->second;
}
const ll MAXK=5;
int main() {
	ll n; scanf("%lld",&n);
	for (ll i=0;i<n;i++) scanf("%lld",&a[i]);
	sort(a,a+n); reverse(a,a+n);
	for (ll y=a[n-1],k=0;y>=1&&k<MAXK;y--,k++) {
		b[n-1][y]=(0==k%2)?'L':'W';
		//printf("%d %d:%c\n",n-1,y,b[n-1][y]);
	}
	for (ll x=n-2;x>=0;x--) {
		ll t=a[x];
		for (ll y=t,k=0;y>=1&&k<MAXK;y--,k++) {
			char c1=gett(x+1,y);
			char c2=gett(x,y+1);
			if (c1=='L'||c2=='L') b[x][y]='W';
			else b[x][y]='L';
		}
		t=a[x+1];
		for (ll y=min(a[x],t+2),k=0;y>=1&&k<MAXK;y--,k++) {
			char c1=gett(x+1,y);
			char c2=gett(x,y+1);
			if (c1=='L'||c2=='L') b[x][y]='W';
			else b[x][y]='L';
		}
	}
	ll lo=INF;
	for (ll x=0;x<n;x++) {
		ll prevwy=-1;
		for (auto &w:b[x]) {
			if (w.second=='W') {
				if (prevwy==w.first-1) {
					ll y0=w.first-x;
					//printf("Found %d %d. y0:%d\n",x,w.first,y0);
					if (y0>0) lo=min(lo,y0);
				}
				prevwy=w.first;
			}
		}
	}
	if (lo==INF) {
		auto it=b[0].begin();
		ll y=it->first;
		char c=it->second;
		if (0==y%2) {
			if (c=='W') c='L';
			else c='W';
		}
		if (c=='L') printf("Second\n");
		else printf("First\n");
	}
	else {
		if (lo==1) printf("First\n");
		else {
			if (1==lo%2) printf("Second\n");
			else printf("First\n");
		}
	}
}