stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int a[100005];



int main(){

	int n,i,j,win=0;cin>>n;

	for(i=1;i<=n;++i) cin>>a[i];

	sort(a+1,a+n+1,greater<int>());

	for(i=1;i<=n;++i){

		if(a[i+1]<i+1 && a[i]>=i){

			j=i+1;

			while(a[j]==i) j++,win^=1;

			win|=((a[i]-i)&1);

			if(win) puts("First");

			else puts("Second");

		}

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

int N,A[100010];

bool Cmp(const int &X,const int &Y){

	return X>Y;

}

int main(){

	scanf("%d",&N);

    for(int i=1;i<=N;i++){

    	scanf("%d",&A[i]);

	}

    sort(A+1,A+N+1,Cmp);

    /*

    for(int i=1;i<=N;i++){

    	printf("%d ",A[i]);

	}

	printf("\n");

	*/

    for(int i=1;i<=N;i++){

        if(i+1>A[i+1]){

            int Ans=0;

            for(int j=i+1;A[j]==i;j++){

            	Ans=Ans^1;

			}

            Ans=Ans|((A[i]-i)&1);

            if(Ans){

            	printf("First\n");

			}else{

				printf("Second\n");

			}

            return 0;

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define il inline

#define re register

#define debug printf("Now is Line : %d\n",__LINE__)

#define file(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)

//#define int long long

#define D double

#define inf 123456789

#define mod 1000000007

il int read() {

    re int x = 0, f = 1; re char c = getchar();

    while(c < '0' || c > '9') { if(c == '-') f = -1; c = getchar();}

    while(c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();

    return x * f;

}

#define rep(i, s, t) for(re int i = s; i <= t; ++ i)

#define drep(i, s, t) for(re int i = t; i >= s; -- i)

#define Next(i, u) for(re int i = head[u]; i; i = e[i].next)

#define mem(k, p) memset(k, p, sizeof(k))

#define lb(x) (x)&(-(x))

#define ls k * 2

#define rs k * 2 + 1

#define maxn 100005

int n, m, a[maxn];

il bool cmp(int a, int b) {

	return a > b;

}

il int doit(int x, int y) {

	int ans = 0;

	while(a[x + 1] == y) ans ^= 1, ++ x;

	return ans;

}

int main() {

	//file(a);

	n = read();

	rep(i, 1, n) a[i] = read();

	sort(a + 1, a + n + 1, cmp);

	int nx = 0;

	while(1) {

		if(a[nx + 1] < nx + 1) break;

		++ nx;

	}

	if(((a[nx] - nx) & 1) || doit(nx, nx)) printf("First");

	else printf("Second");

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;

int N,A[100010];

bool Cmp(const int &X,const int &Y){

	return X>Y;

}

int main(){

	scanf("%d",&N);

    for(int i=1;i<=N;i++){

    	scanf("%d",&A[i]);

	}

    sort(A+1,A+N+1,Cmp);

    /*

    for(int i=1;i<=N;i++){

    	printf("%d ",A[i]);

	}

	printf("\n");

	*/

    for(int i=1;i<=N;i++){

        if(i+1>A[i+1]){

            int Ans=0;

            for(int j=i+1;A[j]==i;j++){

            	Ans=Ans^1;

			}

            Ans=Ans|((A[i]-i)&1);

            if(Ans){

            	printf("First\n");

			}else{

				printf("Second\n");

			}

            return 0;

        }

    }

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <cctype>

#include <cstring>

#include <vector>

#include <list>

#include <queue>

#include <deque>

#include <stack>

#include <map>

#include <set>

#include <algorithm>

#include <iterator>

#include <bitset>

#include <ctime>

#include<complex>

using namespace std;



#define FOR(i,a,b) for (int i = (a); i < (b); i++)

#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)

#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)

#define FILL(a,value) memset(a, value, sizeof(a))



#define SZ(a) (int)a.size()

#define ALL(a) a.begin(), a.end()

#define PB push_back

#define MP make_pair



typedef long long LL;

//typedef long long LL;

typedef vector<int> VI;

typedef pair<int, int> PII;



const double PI = acos(-1.0);

const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = INF * (LL)INF;



const int MAX = 1000 * 100 + 47;

const int MAX1 = 1000 * 100 + 47;



int A[MAX];



int main()

{

	//freopen("in.txt", "r", stdin);

	//freopen("out.txt", "w", stdout);

	ios::sync_with_stdio(false); cin.tie(0);

	int n;

	cin >> n;

	FOR(i, 0, n) cin >> A[i];

	sort(A, A + n);

	reverse(A, A + n);

	int x = 0, y = 1;

	FOR(i, 0, n + 1)

	{

		if (i + 1 > A[i])

		{

			x = i - 1;

			y = i;

			break;

		}

	}



	//cout << "*" << x << " " << y << endl;



	bool v1 = (A[x] - y + 1) % 2;

	int cnt = 0;

	FOR(i, x + 1, n)

	{

		cnt += A[i] == y;

	}



	//cout << "!!" << cnt << endl;

	bool v2 = (cnt + 1) % 2;

	//cout << "!!" << v1 << " " << v2 << endl;

	if (!v1 || !v2)

	{

		cout << "First" << endl;

		return 0;

	}



	cout << "Second" << endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



int n,a[100010],ans;



int main()

{

	scanf("%d",&n);

	for(int i=1; i<=n; i++)

	{

		scanf("%d",&a[i]);

	}

	sort(a+1,a+n+1);

	reverse(a+1,a+n+1);

	for(int i=1; i<=n; i++)

	{

		if(i+1>a[i+1])

		{

			for(int j=i+1; a[j]==i; j++)ans^=1;

			ans|=(a[i]-i)&1;

			puts(ans?"First":"Second");

			return 0;

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//By Don4ick 

//#define _GLIBCXX_DEBUG



#include <bits/stdc++.h>



typedef long long ll;

typedef long double ld;

typedef unsigned int ui;



#define forn(i, n) for (int i = 1; i <= n; i++)

#define pb push_back

#define all(x) x.begin(), x.end()

#define y1 qewr1234



const double PI = acos(-1.0);

const int DIR = 4;

const int X[] = {1, 0, -1, 0};

const int Y[] = {0, 1, 0, -1};



const int N = (int)1e5 + 228;



using namespace std;



int n, a[N];



int main()

{

	//ios_base::sync_with_stdio(false);

	//cin.tie();

	//cout.tie();		



	//freopen(".in", "r", stdin);

	//freopen(".out", "w", stdout);



	//~read

	scanf("%d", &n);

	forn(i, n)

		scanf("%d", &a[i]);

	//~solve

	sort(a + 1, a + n + 1);

	int ptr = 1;

	while(ptr < n && a[n - ptr] >= ptr + 1)

		ptr++;

	if (a[n - ptr + 1] == ptr && (ptr == n || a[n - ptr + 1] > a[n - ptr]))

	{

		cout << "Second" << endl;

		return 0;

	}

	if (((a[n - ptr + 1] - ptr) & 1))

	{

		cout << "First" << endl;

		return 0;

	}

	if (ptr < n)

	{

		int cnt = ptr - a[n - ptr];

		for (int i = n - ptr; i >= 1; i--)

		{

			cnt++;

			if (i == 1 || a[i] > a[i - 1])

				break;

		}

		if ((cnt & 1))

		{

			cout << "First" << endl;

			return 0;

		}

	}

	cout << "Second" << endl;



	return 0;

}




// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int n, a[100005];

int main ()

{

	scanf ("%d", &n);

	for (int i=1; i<=n; i++)

		scanf ("%d", &a[i]);

	sort (a + 1, a + n + 1);

	reverse (a + 1, a + n + 1);

	int x = 0;

	a[0] = a[1];

	while (a[x + 2] > x + 1 && x + 1 < n) x ++;

	int right=0,up=0,k=x;

	while (x<a[k] && k<=n)

		right++,k++;

	up=a[x+1]-x;

	right--;

	if (up%2==1 && right%2==1)

		printf ("Second\n");

	else 

		printf ("First\n");

	return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<algorithm>

using namespace std;

const int maxn=1e5+5,inf=1e9+10;

int a[maxn];

int main(){

    int i,n,p,q;

    scanf("%d",&n);

    for (i=0;i<n;i++) scanf("%d",&a[i]);

    sort(a,a+n);

    q=a[n-1];

    for (i=n-1;i;i--) a[i]=a[i]-a[i-1]+1;

    a[0]=inf;

    for (i=1;i<n-1;i++) if (a[i]==1&&(a[i+1]&1)){

        a[i]++; a[i+1]--;

    }

    p=n-1;

    while (q>a[p]) q-=a[p--];

    if ((a[p]&1)&&q==a[p]) puts("First");

    else puts((q&1)?"Second":"First");

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<algorithm>

using namespace std;

int n,a[100002];

int main()

{

	scanf("%d",&n);

    for(int i=1;i<=n;i++)

    	scanf("%d",&a[i]);

    sort(a+1,a+n+1,greater<int>());

    for(int i=1;i<=n;i++)

        if(i+1>a[i+1]&&a[i]>=i)

		{

            int j=0;

            while(a[j+i+1]==i) j++;

            if((a[i]-i)%2==0&&j%2==0) printf("Second");

            else printf("First");   

    		return 0;

        }

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#define _CRT_SECURE_NO_WARNINGS



#include <unordered_map>

#include <string>

#include <math.h>

#include <vector>

#include <iostream>

#include <algorithm>

#include <stack>

#include <queue>

#define MAXN 1005

#define INF 0x3f3f3f3f

#define MOD 1000000007

#define PI acos(-1)

typedef long long ll;

typedef unsigned long long ull;



using namespace std;



int n, a[100005];



int cmp(int a, int b) {

	return a > b;

}



int main() {

	scanf("%d", &n);

	for (int i = 1; i <= n; ++i)

		scanf("%d", &a[i]);

	sort(a + 1, a + n + 1,cmp);

	int i = 1, j;

	while (a[i] >= i) ++i;

	--i;

	j = i + 1;

	while (a[j] == i) ++j;

	--j;

	if ((a[i] - i) % 2 || (j - i) % 2)

		cout << "First" << endl;

	else

		cout << "Second" << endl;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <algorithm>



#define Int register int



const int MAXN = 1e5;

int n, a[MAXN + 5];



inline void Work () {

	scanf ( "%d", &n );

	for ( Int i = 1; i <= n; ++ i ) scanf ( "%d", &a[i] );

	std :: sort ( a + 1, a + n + 1, []( const int x, const int y ) { return x > y; } );

	for ( Int i = 1; i <= n; ++ i ) {

		if ( i + 1 > a[i + 1] ) {

			int du = a[i] - i, dr = 0;

			for ( ; a[i + dr + 1] == i; ++ dr );

			puts ( du & 1 || dr & 1 ? "First" : "Second" );

			break;

		}

	}

}



int main () {

	Work ();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<vector>

#include<algorithm>

using namespace std;

const int max_n = 1e6 + 5;

bool cmp(int a,int b){return a > b;}



int main(){

    int n,a[max_n];

    memset(a,0,sizeof(a));

    scanf("%d",&n);

    for(int i =  1; i <= n; i++){

        scanf("%d",&a[i]);

    }

    sort(a+1 , a+ n+1,cmp);

    for(int x = 1; x <= n; x++){

        if(a[x + 1] < x + 1 && a[x] >= x){

            int j = 0;

            while(a[j + x + 1] == x) j++;//距离右边界距离

            if((a[x] -x) %2 == 0 && j % 2 == 0)printf("Second\n");

            else printf("First\n");

            break;

        }

    }



    return 0;

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

#define int long long

using namespace std;

const int N=1e5+5;

int n,a[N],k1,k2;

bool cmp(int x,int y){

	return x>y;

}

signed main(){

	scanf("%lld",&n);

	for(int i=1;i<=n;i++)

		scanf("%lld",&a[i]);

	sort(a+1,a+1+n,cmp);

	for(int i=1;i<=n;i++)

		if(i+1>a[i+1]){

			k1=a[i]-i,k2=0;

			for(int j=i+1;j<=n;j++)

				if(a[j]==i) k2++;

			break;

		}

	if(k1&1||k2&1) puts("First");

	else puts("Second");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <vector>

#include <iostream>

#include <algorithm>

using namespace std;



int main()

{

	int n = 0;

	int s = 0;

	

	cin >> n;

	

	vector <int> b;

	

	for (int i = 0; i < n - 1; i++) {

		cin >> s;

		b.push_back(s);

	}

	int result = b[0];

	for (int i = 1; i < n - 1; i++) {

		result += min(b[i - 1], b[i]);

	}

	result += b[n - 2];

	cout << result;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

const int maxd = 1e5+10;

int a[maxd];

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    int n;

    scanf("%d",&n);

    for(int i=1;i<n;i++) scanf("%d",&a[i]);

    int ans = a[1]+a[n-1];

    for(int i=1;i<n-1;i++)

        ans+= min(a[i],a[i+1]);

    printf("%d",ans);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

using namespace std;



int main() {

	int n;

	cin >> n;



	vector<int> b(n - 1), v(n);



	for (auto &t : b)cin >> t;



	v[0] = b[0];

	v[1] = b[0];

	

	for (int i = 2; i < n - 1; ++i) {

		if (v[i - 1] > b[i - 1]) {

			v[i - 1] = b[i - 1];

		}

			v[i] = b[i - 1];

	}



	if (v[n - 2] < b[n - 2]) {

		v[n - 1] = b[n - 2];

	}

	else {

		v[n - 1] = b[n - 2];

		v[n - 2] = b[n - 2];

	}



	int sum = 0;



	for (auto t : v) sum += t;



	cout << sum;



	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>

using namespace std;

const int maxd = 1e5+10;

int a[maxd];

int main()

{

    // freopen("a.in","r",stdin);

    // freopen("k.out","w",stdout);

    int n;

    scanf("%d",&n);

    for(int i=1;i<n;i++) scanf("%d",&a[i]);

    int ans = a[1]+a[n-1];

    for(int i=1;i<n-1;i++)

        ans+= min(a[i],a[i+1]);

    printf("%d",ans);

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>



const int MAXN = 400;

const int MOD = 998244353;



int pow_mod(int b, int p) {

	int ret = 1;

	for(int i=p;i;i>>=1,b=1LL*b*b%MOD)

		if( i & 1 ) ret = 1LL*ret*b%MOD;

	return ret;

}



int fct[MAXN + 5], ifct[MAXN + 5];

void init() {

	fct[0] = 1;

	for(int i=1;i<=MAXN;i++)

		fct[i] = 1LL*fct[i-1]*i%MOD;

	ifct[MAXN] = pow_mod(fct[MAXN], MOD-2);

	for(int i=MAXN-1;i>=0;i--)

		ifct[i] = 1LL*ifct[i+1]*(i+1)%MOD;

}



int A[MAXN + 5], B[MAXN + 5], SA, SB;



int f[2][2][MAXN + 5][MAXN + 5];



int main() {

	init();

	int N; scanf("%d", &N);

	for(int i=1;i<=N;i++)

		scanf("%d%d", &A[i], &B[i]), B[i];

	f[0][0][0][0] = 1;

	for(int i=1;i<=N;i++) {

		for(int j=0;j<=SA;j++)

			for(int k=0;k<=SB;k++)

				f[1][0][j][k] = f[0][0][j][k], f[1][1][j][k] = f[0][1][j][k];

		for(int j=0;j<=SA;j++)

			for(int k=0;k<=SB;k++) {

				int t = 1;

				for(int p=0;p<=B[i];p++,t=1LL*t*A[i]%MOD) {

					if( p == B[i] ) {

						int d = (MOD - 1LL*t*ifct[p-1]%MOD*f[1][0][j][k]%MOD)%MOD;

						f[0][1][j+A[i]][k+p] = (f[0][1][j+A[i]][k+p] + d)%MOD;

					}

					else {

						int d = (MOD - 1LL*t*ifct[p]%MOD*f[1][0][j][k]%MOD)%MOD;

						f[0][0][j+A[i]][k+p] = (f[0][0][j+A[i]][k+p] + d)%MOD;

						d = (MOD - 1LL*t*ifct[p]%MOD*f[1][1][j][k]%MOD)%MOD;

						f[0][1][j+A[i]][k+p] = (f[0][1][j+A[i]][k+p] + d)%MOD;

					}

				}

			}

		SA += A[i], SB += B[i];

	}

	int ans = 0;

	for(int i=1;i<=SA;i++)

		for(int j=1;j<=SB;j++) {

			int d = 1LL*f[0][1][i][j]*fct[j-1]%MOD*j%MOD*pow_mod(i,MOD-1-j-1)%MOD;

			ans = (ans + d)%MOD;

		}

	printf("%lld\n", 1LL*SA*(MOD - ans)%MOD);

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;



const int maxn = 405, mod = 998244353;

typedef long long ll;

int inv[maxn];



int fpow(int x, int k)

{

    int res = 1;

    while (k) {

        if (k & 1) res = (ll)res * x % mod;

        k >>= 1; x = (ll)x * x % mod;

    }

    return res;

}



int A[maxn], B[maxn], SA, SB, f[2][maxn][maxn];



int main()

{

    inv[1] = 1;

    for (int i = 2; i < maxn; i++) inv[i] = mod - 1LL * inv[mod % i] * (mod / i) % mod;

    int n;

    scanf("%d", &n);

    for (int i = 0; i < n; i++) scanf("%d%d", &A[i], &B[i]), SA += A[i], SB += B[i];

    f[0][0][0] = mod - 1;

    for (int i = 0; i < n; i++) {

        for (int j = 0; j <= SA; j++)

            for (int k = 0; k <= SB; k++)

                f[1][j][k] = f[0][j][k];

        int p = 1;

        for (int l = 0; l < B[i]; l++, p = (ll)p * A[i] % mod * inv[l] % mod)

            for (int j = A[i]; j <= SA; j++)

                for (int k = l; k <= SB; k++)

                    f[0][j][k] = (f[0][j][k] + (ll)(mod - f[1][j - A[i]][k - l]) * p) % mod;

    }

    int ans = 0;

    for (int j = 1; j <= SA; j++) {

        int p = 1, q = (ll)SA * inv[j] % mod;

        for (int k = 0; k <= SB; k++, p = (ll)p * k % mod * inv[j] % mod) ans = (ans + (ll)f[0][j][k] * p % mod * q) % mod;

    }

    printf("%d\n", ans);

	

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<algorithm>

#include<cstring>

using namespace std;

int a[100005],f[100005];

int main()

  {int n,k;

    cin >> n >> k;

   int i,Min = 0x7fffffff,num = 0;

   memset(a,0,sizeof(a));

   memset(f,0,sizeof(f));

   for(i = 1;i <= n;i ++)

          {cin >>a[i];Min = min(a[i],Min);

          }

   for(i = 1;i <= n;i ++)

   {  if(a[i] != Min)f[num]++;

      else num++;

   }

   int cnt = 0;

   if(a[n] == Min)num--;

   for(i = 0;i <= num;i ++)

   {

    while(f[i] > 0)

        {   cnt ++;

            f[i] -= k-1;

        }

    if(f[i] < 0)

       f[i+1] += f[i];

   }

   cout<<cnt<<endl;

  }


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



const int N = 1e5 + 10;



int a[N];



int main(){

	int n, k;

	scanf("%d %d",&n,&k);

	for (int i = 1; i <= n; i++) scanf("%d",&a[i]);

	printf("%d\n", (n - 2) / (k - 1) + 1);

	return 0;

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>          

using namespace std;

 

#define rep(i,n) for(int i=0;i<(n);++i)

#define reps(i,n) for(int i=1;i<=(n);++i)

#define all(x) (x).begin(),(x).end()

#define int long long

#define mk_p(a,b)	make_pair((a),(b))

using pii = pair<int,int>;

constexpr int INF  = 0x3f3f3f3f;

constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;



int gcd(int a,int b){return b ? gcd(b,a%b) : a;}

int lcm(int a,int b){return a/gcd(a,b)*b;}



vector<int> a(100500);

signed main(){

	cin.tie(0);

	ios::sync_with_stdio(false);

	int n,k;

	cin >> n >> k;

	int minv = INF;

	int pnt = 0;

	reps(i,n){

		cin >> a[i];

		if(a[i] == 1) pnt = i;

	}

	int cnt = 0;

	cnt = (n + k - 1) / k;

	cout << ((n - 1) + (k - 1) - 1)/ (k - 1) << '\n';

	return 0;

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>          

using namespace std;

 

#define rep(i,n) for(int i=0;i<(n);++i)

#define reps(i,n) for(int i=1;i<=(n);++i)

#define all(x) (x).begin(),(x).end()

#define int long long

#define mk_p(a,b)	make_pair((a),(b))

using pii = pair<int,int>;

constexpr int INF  = 0x3f3f3f3f;

constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;



int gcd(int a,int b){return b ? gcd(b,a%b) : a;}

int lcm(int a,int b){return a/gcd(a,b)*b;}



signed main(){

	cin.tie(0);

	ios::sync_with_stdio(false);

	int n,k;

	cin >> n >> k;

	cout << ((n - 1) + (k - 1) - 1)/ (k - 1) << '\n';

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define rint register int

inline int read(){int r;int s=0,c;for(;!isdigit(c=getchar());s=c);for(r=c^48;isdigit(c=getchar());(r*=10)+=c^48);return s^45?r:-r;}

int n, K; int main(){n = read(); K = read(); return !printf("%d\n",(n-2)/(K-1)+1);}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int K,N,ans;

int main(){

	scanf("%d%d",&N,&K);

	if(K==2)ans=N-1;

	else if(K>=N)ans=1;

	else {

		N-=K;

		ans=1;

		if(N%(K-1)==0)ans+=N/(K-1);

		else ans+=N/(K-1)+1;

	}

	printf("%d",ans);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n=0,m,k,i=0,s=1;

    cin>>n>>k;

    int a[100005]={0};

    for(i=0;i<n;i++)

        cin>>a[i];

    n-=k;

    k--;

    //cout<<n<<endl;

    while(n>0)

    {

        n-=k;

        s++;

    }

    cout<<s<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



int main(){

    int n, m;

    scanf("%d %d",&n,&m);

    for(int i=0;i<n;i++) {

        int num;

        scanf("%d",&num);

    }

    int ans=ceil((double)(n-1)/(m-1));

    printf("%d\n",ans);

    return 0;

}


// Fastest known solution for this problem: