akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 1e2 + 47;

int n, a[MAX_N];

signed main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  #ifdef _47
    freopen("4.cpp", "r", stdin), freopen("7.cpp", "w", stdout);
  #endif
  cin >> n;
  vector<int> kek;
  for (int i = 1; i <= n; i++)
  {
    int v;
    cin >> v;
    kek.push_back(v);
    if (a[i] > i)
    {
      cout << -1;
      exit(0);
    }
  }
  vector<int> ans;
  for (int iter = 1; iter <= n; iter++)
  {
    bool ok = false;
    for (int i = kek.size() - 1; i >= 0; i--)
    {
      if (kek[i] == i + 1)
      {
        ok = true;
        ans.push_back(kek[i]);
        kek.erase(kek.begin() + i);
        break;
      }
    }
    if (!ok)
    {
      cout << -1;
      exit(0);
    }
  }
  reverse(ans.begin(), ans.end());
  for (auto x : ans)
  {
    cout << x << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	double A[100][100];
	double b[100];
	long long c[100];

	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++){
			cin >> A[i][j];
		}
	}

	for (int i = 0; i < m; i++) cin >> b[i];

	for (int i = 0; i < n; i++) c[i] = 0;
	for (int i = 0; i <n ; i++){
		for (int j = 0; j < m; j++){
			c[i] += A[i][j] * b[j];
		}
	
	}
	for (int i = 0; i < n; i++)cout << c[i] << endl;
	return 0;
}




Measured memory_bytes: 3296
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int nn = sc.nextInt();
		double[] xx = new double[nn];
		double[] yy = new double[nn];
		double sum = 0;
		
		for (int i=0;i<nn;i++){
			xx[i] = sc.nextLong();
			yy[i] = sc.nextLong();
		}
		
		for(int s=0;s<nn;s++){
			for(int t=s+1;t<nn;t++){
				sum += (double)Math.sqrt(Math.pow(xx[s]-xx[t],2)+Math.pow(yy[s]-yy[t],2));
			}
		}
		
		sum = sum * 2 / nn ;
		
		System.out.print(sum);
				
	}
}

Measured memory_bytes: 23764
import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

int solve(int n, int s, int c)
{
    if(n<=0) return s?0:1;
    if(s<c || c>9) return 0;
    return iota(c,10).map!(i=>solve(n-1,s-i,i+1)).reduce!"a+b"();
}

void main()
{
    foreach(S;stdin.byLine())
    {
        auto m = S.split().map!(to!int);
        immutable n=m[0], s=m[1];
        if(n==0 && s==0) break;
        writeln(solve(n,s,0));
    }
}

Measured memory_bytes: 1056
#include<iostream>
#include<algorithm>
#include<map>
#include<string> 
#include<set>

using namespace std;
typedef long long ll;
int main()
{
	int n;
	cin>>n;
	map<string,int>mp;
	set<string>str;
	string s;
	for(int i=1;i<=n;i++){
		cin>>s;
		mp[s]++;
		str.insert(s);
	}
	int maxn=0;
	map<string,int>::iterator it=mp.begin();
	while(it!=mp.end()){
		maxn=max(maxn,it->second);
		it++;
	}
	it=mp.begin();
	while(it!=mp.end()){
	if(it->second==maxn)
		cout<<it->first<<endl;
		it++;
	}
	return 0;
 } 

Measured memory_bytes: 34560
#include <bits/stdc++.h>
using namespace std;

int main()
{
	string S;
	cin >> S;
	int ans = 1000;
	for (size_t i = 0; i < S.size() - 2; i++)
	{
		string s = { S[i], S[i + 1],S[i + 2] };
		int num = stoi(s);
		ans = min(ans, abs(num - 753));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//#pragma GCC optimize("-Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
//#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
//#pragma GCC target("avx2")  //Enable AVX
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//order_of_key(x) : number of items less than x
//find_by_order(x) : iterator to x

#define mem(dp,a)           memset(dp,a,sizeof dp)
#define rep(i,a,b)          for(ll i=a;i<b;i++)
#define pb(x)               push_back(x)
#define mp(x,y)             make_pair(x,y)
#define fastio              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define F                   first
#define S                   second
#define all(v)              (v).begin(),(v).end()

const ld pi=3.14159265359;
ll INF=1e18+10;
ll MOD=998244353;
ll mod=1e9+7;

inline ll add(ll a,ll b,ll m){
    if((a+b)>=m)return (a+b)%m;
    return a+b;
}

inline ll mul(ll a,ll b,ll m){
    if((a*b)<m)return a*b;
    return (a*b)%m;
}

int main()
{
    ll n,m,k;cin>>n>>m>>k;
    vector<ll> a(n),b(m);
    rep(i,0,n)cin>>a[i];
    rep(i,0,m)cin>>b[i];
    vector<ll>pa(n);
    rep(i,0,n)pa[i]=a[i];
    rep(i,1,n)pa[i]+=pa[i-1];
    vector<ll>pB(m);
    rep(i,0,m)pB[i]=b[i];
    rep(i,1,m)pB[i]+=pB[i-1];

    ll cnt=0;
    cnt = max(cnt, (ll)(lower_bound(all(pa),k+1)-pa.begin()));
    cnt = max(cnt, (ll)(lower_bound(all(pB),k+1)-pB.begin()));

    rep(i,0,n){
        ll tmp = i+1;
        if(k-pa[i]>=0)
        cnt = max(cnt, (ll)(tmp+lower_bound(all(pB),k-pa[i]+1)-pB.begin()));
    }
    rep(i,0,m){
        ll tmp = i+1;
        if(k-pB[i]>=0)
        cnt = max(cnt, (ll)(tmp+lower_bound(all(pa),k-pB[i]+1)-pa.begin()));
    }
    cout<<cnt;
}


Measured memory_bytes: 9592
#include<bits/stdc++.h>
using namespace std;

double mycalc(long N, long K){
  double ans = 1.0;
  while(N < K){ans/=2.0; N *= 2;}
  return ans;
}

//unsigned long long
int main()
{
    long N, K;
    cin >> N >> K;
    double a = 0, buf = 1.0 / (double)N;
    for(long i = 1; i <= N; i++){
      a += buf * mycalc(i, K);
    }
    printf("%.10lf\n", a);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;

int main(void) {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << (abs(b - a) <= d && abs(c - b) <= d ? "Yes" : (abs(a - c) <= d ? "Yes" : "No")) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

int main(void)
{
    int64_t N;
    std::cin >> N;

    for (int64_t i = 0; i < N; ++i) {
        int64_t a;
        std::cin >> a;
        if (a%2 == 1) continue;
        if (a%3 != 0 && a%5 != 0) {
            std::cout << "DENIED" << std::endl;
            return 0;
        }
    }

    std::cout << "APPROVED" << std::endl;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int sgd(int a, int b) {
	if (a < b) {
		// swap
		a = a + b;
		b = a - b;
		a = a - b;
	}
	return b == 0 ? a : sgd(b, a % b);
}


int main()
{
	int n;
	cin >> n;
	vector<int> als(n);
	for(auto& a : als) cin >> a;
	sort(als.begin(), als.end());
	
	int hpMin = als[0];
	for (auto& a : als) {
		if (a % hpMin != 0) {
			hpMin = sgd(a, hpMin);
		}
	}

	cout << hpMin << endl;
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>

int cal(int a[],int b[],char str[][1],int i)
{
        int s;

        if (str[i][0]=='+') { s=a[i]+b[i]; }
        else if (str[i][0]=='-') { s=a[i]-b[i]; }
        else if (str[i][0]=='*') { s=a[i]*b[i]; }
        else if (str[i][0]=='/') { s=a[i]/b[i]; }

        return s;
}

int main(void)
{
        int a[100],b[100];
        char str[100][1];
        int ans[100];
        int i,j;

        i=0;
        while(1) {
                scanf("%d",&a[i]);
                scanf("%s",str[i]);
                scanf("%d",&b[i]);
          if (str[i][0]=='?') { break; }
                ans[i]=cal(a,b,str,i);
          i++;
        }

  for (j=0; j<i; j++) {
    printf("%d\n",ans[j]);
  }
  return 0;
}

Measured memory_bytes: 600
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
points = {'r': P, 's': R, 'p': S}
is_changed = [False] * K + [False] * (N - K)
score = 0
for i in range(K):
    score += points[T[i]]

for i in range(K, N):
    if T[i] == T[i - K] and not is_changed[i - K]:
        is_changed[i] = True
    else:
        score += points[T[i]]

print(score)


Measured memory_bytes: 10564
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define dbgmint(n,arr) rep(i,n){cerr<<arr[i].x<<" ";}cerr<<endl;
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,v.size())i>>v[j];return i;}

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n;
    cin>>n;
    Vec f(n);
    VVi P(n,Vi(11));
    rep(i,n){
        rep(j,10){
            ll flag;
            cin>>flag;
            if(flag){
                f[i] += (1LL<<j);
            }
        }
    }
    rep(i,n){
        cin>>P[i];
    }
    ll ans = -INF;
    rep(x,(1LL<<10)){
        if(x==0)continue;
        ll tmp = 0;
        rep(i,n){
            ll bit = x&f[i];
            ll cnt = __builtin_popcount(bit);
            tmp += P[i][cnt];
        }
        chmax(ans,tmp);
    }

    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 256
# include <stdio.h>
# include <bits/stdc++.h>


#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

using namespace std;

inline bool isvowel (char c) {
	c = tolower(c);
    if (c == 'a' || c == 'e' || c == 'i' || c == 'y' || c == 'o' || c == 'u') return 1;
    return 0;
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int n, m, k;
int cnt[N];
string s;
int a[N];
vector < int > g[N];
int u[N];
int ans, res;
int cur;

int main () {
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a + 3);
	if (a[0] == a[2]) cout << "Yes";
	else cout << "No";
	return Accepted;
}

// B...a

Measured memory_bytes: 18688
#include <stdio.h>

int main(void){
int n, i, d,ninzu;
i=0;

scanf("%d %d",&n, &d);
d = 2*d + 1;            //一人一人が見える範囲

while(n>d){
/*樹の数から、見える範囲を何回引けるかカウント（i=木の数/範囲の商）*/
n -= d;                 
i++;
}

ninzu = i + 1;          //商の人数で見切れない分はあと一人必要

printf("%d\n", ninzu);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define rep(i,n) for (int i = 0; i < (n); ++i)

const int INF = 1001001001;
int main(){
	lint n,m;

	cin >> n >> m;
	vector<int> to[100005];//二次元配列
	rep(i,m){
		int a,b;
		cin >> a >> b;
		--a; --b;
		to[a].push_back(b);//道筋をtoに入れる
		to[b].push_back(a);//v[][]のi番目の末尾に入れる.つまり二次元配列	
	}
	//cout << to[2][1] << endl;
	queue<int> q;//先入先出
	vector<int> dist(n, INF);//最小の距離を求めるから初期値はINFに設定しておく
	vector<int> pre(n, -1);//直前の頂点.0があるから初期値は−１
	dist[0] = 0;//頂点０から０へのの距離は０
	q.push(0);
	while(!q.empty()){//qが空でない間 
		int v = q.front();//vにqの先頭を入れる
		q.pop();//先頭を消す
		for (int u : to[v]){//ex.)to[0] = [1,2,3] uに1,2,3が順に入る
			if (dist[u] != INF)
				continue;
			dist[u] = dist[v]+1;
			pre[u] = v;//一つ前の頂点を入れる
			q.push(u);
		}
	}
	cout << "Yes" << endl;
	rep(i,n){
		if(i == 0) continue;
		cout << ++pre[i] << endl;//インクリメント忘れずに
	}
	return 0;
}

Measured memory_bytes: 10528
/* ANTHOR KUMAR DAS
KUET ECE 2K18*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sc(a) scanf("%d",&a)
#define sc1(n) scanf("%lld",&n)
#define sc2(b,c) scanf("%lld%lld",&b,&c)
#define f(a,b) for(a=0;a<b;a++)
#define pb(a) push_back(a)
#define br break
int main()
{
    int n,m,k,i,l=0;
    cin>>n>>k;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if(a[i]>=k)
        {
            l++;
        }
    }
    cout<<l<<endl;


    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  string S;
  cin >> S;

  ll ans = 0;
  const int N = S.size() - 1;
  for (int s = 0; s < (int)(1 << N); ++s) {
    int j = -1;
    for (int i = 0; i < (int)N; ++i) {
      if ((s >> i) & 1) {
        ans += stoll(S.substr(j + 1, i - j));
        j = i;
      }
    }
    ans += stoll(S.substr(j + 1, N - j));
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<list>
using namespace std;

typedef long long ll;

#define MOD 1000000007

class Comb{
private:
  ll *fac,*finv,*inv;
public:
  Comb(){
    fac = new ll[1000000];
    finv = new ll[1000000];
    inv = new ll[1000000];
    fac[0] = 1;
    for(int i=1;i<1000000;i++){
      fac[i] = i*fac[i-1];
      fac[i] %= MOD;
    }
    inv[1] = 1;
    for(int i=2;i<1000000;i++){
      inv[i] = MOD-inv[MOD%i]*(MOD/i)%MOD;
    }
    finv[0] = 1;
    for(int i=1;i<1000000;i++){
      finv[i] = inv[i]*finv[i-1];
      finv[i] %= MOD;
    }
  }
  ll calc(ll n,ll k){
    ll c = fac[n];
    c *= finv[k];c %= MOD;
    c *= finv[n-k];c %= MOD;
    return c;
  }
};

int main(){
  int x,y,z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;
  return 0;
}


Measured memory_bytes: 256
#traveling salesman
k, n = map(int, input().split())
homes = list(map(int, input().split()))
d_list = []
for i in range(n-1):
    dist = homes[i+1] - homes[i]
    d_list.append(dist)
dist_0 = homes[0] + (k - homes[n-1])
d_list.append(dist_0)
print(k - max(d_list))

Measured memory_bytes: 26420
/*
 * a.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 2000000;
const int MAX_A = 10000;

/* typedef */

/* global variables */

int as[MAX_N], bs[MAX_N], cs[MAX_A + 1];

/* subroutines */

/* main */

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> as[i];

  //Counting-Sort(A, B, k)
  for (int i = 0; i <= MAX_A; i++) cs[i] = 0;
  for (int j = 0; j < n; j++) cs[as[j]]++;
  for (int i = 1; i <= MAX_A; i++) cs[i] += cs[i - 1];
  for (int j = n - 1; j >= 0; j--) {
    cs[as[j]]--;
    bs[cs[as[j]]] = as[j];
  }

  for (int i = 0; i < n; i++) {
    if (i) putchar(' ');
    printf("%d", bs[i]);
  }
  putchar('\n');
  return 0;
}

Measured memory_bytes: 16808
#include<iostream>
#include<string>
#include "stdio.h"
#include "stdlib.h"

using namespace std;

struct Node{
  int key;
  Node* parent;
  Node* left;
  Node* right;
};

Node* NIL;
Node* root;

void insert(int input){
  Node* node_now_parent = NIL;
  Node* node_now = root;

  Node* z;
  z = (Node*) malloc(sizeof(Node));
  z->key    = input;
  z->parent = NIL;
  z->left   = NIL;
  z->right  = NIL;

  while( node_now != NIL ){
    node_now_parent = node_now;

    if(z->key <=  node_now->key){
      node_now = node_now->left;
    }else{
      node_now = node_now->right;
    }
  }

  if(node_now_parent == NIL){
    root = z;
  }else{
    if( z->key <= node_now_parent->key ){
      node_now_parent->left = z;
    }else{
      node_now_parent->right = z;
    }
    z->parent = node_now_parent;
  }
};


void preOrder(Node* node){
  if(node == NIL){
    return;
  }
  printf(" %d", node->key);
  preOrder(node->left);
  preOrder(node->right);
}

void inOrder(Node* node){
  if(node == NIL){
    return;
  }
  inOrder(node->left);
  printf(" %d", node->key);
  inOrder(node->right);
}

void find(Node* node_start, int key){
  Node* node_now = node_start;
  while(node_now != NIL && node_now->key != key){
    if(key < node_now->key){
      node_now = node_now->left;
    }else{
      node_now = node_now->right;
    }   
  }

  if(node_now == NIL){
    printf("no\n");
  }else{
    printf("yes\n");
  }
}



void print(Node* node){
  inOrder(node);
  printf("\n");
  preOrder(node);
  printf("\n");
}

int main(void){
  int N;
  scanf("%d", &N);
  
  string command;
  int key;
  for(int i=0;i<N;i++){
    cin >> command;
    if(command == "insert"){
      cin >> key;
      insert(key);
    }else if(command == "print"){
      print(root);
    }else if(command == "find"){
      cin >> key;
      find(root, key);
    }else{
      printf("No command!");
    }
  }
  return 0;
}


Measured memory_bytes: 22064
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)
#define INF 1e10
#define maxn 2001
#define int ll
int N,K,Q;
int A[2001];



int32_t main(){
	fast;
	
	cin>>N>>K>>Q;
	
	FOR(i,0,N-1) cin>>A[i];
	

	int ans = INF;
	FOR(i,0,N-1){
		
		vi ranges[maxn];
		vi cur; int idx = 0;
		bool np = 0;
		FOR(j,0,N-1){
			if (A[j] < A[i]){
				aFOR(i,cur) ranges[idx].pb(i);
				idx++;
				while (!cur.empty()) cur.pop_back();
			}else cur.pb(A[j]);
		}
		
		ranges[idx] = cur;
	

		

		
		FOR(j,0,idx){
			if (ranges[j].empty()) continue;
			sort(all(ranges[j]));
			ranges[j].resize(max((int)0,(int)ranges[j].size() - K + 1));
			sort(all(ranges[j]),greater<int>());
		}
		
		multiset <pi> current;
		
		FOR(j,0,idx) if (!ranges[j].empty()) current.insert(pi(ranges[j][ranges[j].size() - 1],j));

		int mx = 0;
		FOR(j,0,Q-1){
			if (current.empty()){
				np = 1;
				break;
			}
			mx = max(mx,(*current.begin()).f);
			
			ranges[(*current.begin()).s].pop_back();
			int index = (*current.begin()).s;
			current.erase(*current.begin());
			if (!ranges[index].empty()) current.insert(pi(ranges[index][ranges[index].size()-1],index));
			
			
		}
		if (np) continue;
		
		//cout<<mx<<' '<<A[i]<<'\n';
		ans = min(ans,mx - A[i]);
		if (ans == 237958691){
			cout<<A[i]<<' '<<mx<<' ';
			break;
		}
		
	}
	
	cout<<ans;
		
}



Measured memory_bytes: 512
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
const ll MOD=1e9+7;

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int n;
  cin>>n;
  vector<int> a(n);
  rep(i,n) cin>>a[i];
  sort(rall(a));
  a.pb(0);
  //cout<<a;
  int d;
  rep(i,n){
    if(a[i]==i+1){
      //cout<<"yoko"<<endl;
      for(d=0;a[i]==a[i+1];++i) ++d;
      break;
    }else if(a[i]!=a[i+1]){
      if(a[i+1]==i+1){
	int f1=0,f2=0;
	d=0;
	if((a[i]-a[i+1])%2){
	  //cout<<"bokoA"<<endl;
	  d=1;
	}else{
	  //cout<<"bokoB"<<i<<endl;
	  for(++i;a[i]==a[i+1];++i) ++f2;
	  if(f2%2==0) d=1;
	}
	break;
      }else if(a[i+1]<i+1){
	//cout<<"tate"<<endl;
	d=a[i]-(i+1);
	break;
      }
    }
  }
  //cout<<d<<endl;
  cout<<(d%2?"First":"Second")<<endl;
  return 0;
}


Measured memory_bytes: 1024
/* h-ex9_1
   Ohshima */

#include <stdio.h>
#include <stdlib.h>
//スタックに格納するデータの最大数
#define SIZE 10

//スタックの定義
typedef struct stack{
  int size;
  int count;
  char data[SIZE];
  char *top;
}stack;

//スタックの初期化
void initialize_stack(stack *stk){
  stk->count = 0;
  stk->size = SIZE;
  stk->top = &(stk->data[SIZE]);
}

//データの追加
void push(stack *stk, char elem){
  if(stk->count >= stk->size){
    fprintf(stderr, "Error: stack overflow. (x=%c)\n", elem);
    exit(1);
  }else{
    stk->top--;
    *(stk->top) = elem;
    stk->count++;
  }
}

//データの取り出し
void pop(stack *stk){
  if(stk->count <= 0){
    fprintf(stdout, "Error: stack underflow.\n");
    exit(1);
  }else{
    stk->top++;
    stk->count--;
  }
}

int main(void){
  stack stk;
  char tmp;
  int i;
  //スタックを初期化（ポインタ渡しで関数にわたすこと）
  initialize_stack(&stk);
  //1文字ずつ標準入力から受け取り以下を実行
  while(scanf("%c", &tmp) != EOF && tmp != '\n'){
    //B以外の文字のときスタックにデータを追加
    if(tmp != 'B'){
      push(&stk, tmp);
    }else{
      //Bがきた場合、文字列が空でないならデータを取り出す
      if(stk.count > 0){
        pop(&stk);
      }
    }
  }
  //最後に、スタックに残っている文字を古いものから1文字ずつ出力
  for(i = 0; stk.count-- > 0; i++){
    putchar(stk.data[SIZE - 1 - i]);
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 1584
#include<stdio.h>
int fibo(int);


int fib[45];

int main(){
  int i, n;
    for(i = 0; i < 45; i++){
        fib[i] = 0;
    }
    scanf("%d", &n);
    printf("%d\n", fibo(n));
    return 0;
}

int fibo(int n){
    if(n == 0 || n == 1) return fib[n] = 1;
    if(fib[n] != 0) return fib[n];
    
    return fib[n] = fibo(n-2) + fibo(n-1);
}



Measured memory_bytes: 2100
N = int(input())
A = list(map(int,input().split()))
A.sort()
K = N-1
ans = []
while(K>1):
    if A[K-1] < 0:
        break
    l = A[0] - A[K]
    ans.append(str(A[0])+" "+str(A[K]))
    A[0] = l
    K -= 1
if K == 1:
    ans.append(str(A[1])+" "+str(A[0]))
    print(A[1]-A[0])
else:
    b = A[K]
    for i in range(K-1,0,-1):
        c = A[i]
        ans.append(str(b)+" "+str(c))
        b = b-c
    ans.append(str(b)+" "+str(A[0]))
    print(b-A[0])
for p in ans:
    print(p)

Measured memory_bytes: 17052
import scala.io.StdIn._

object Main extends App {


  val n = readInt()
  val s = readLine()

  def solve() = {
    s.map { char =>
      val c = char.toLower
      val num = alpha2Num(c)
      val move = if(n+num > 26) n+num-26 else n+num
      num2Alpha(move)
    }.toUpperCase()
  }

  def num2Alpha(n: Int): Char =
    ('a' + (n-1)).toChar

  def alpha2Num(c: Char): Int =
    ('a' to 'z').indexOf(c) + 1

  println(solve())

}



Measured memory_bytes: 55716
#include <iostream>
#include <vector>
#include <algorithm>
#include <ios>
#include <iomanip>

using namespace std;
typedef long long ll;

int main()
{
    int N;
    cin >> N;
    vector<ll> list;
    ll temp;
    ll sum = 0;
    ll ans = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> temp;
        sum += temp;
        list.push_back(sum);
        if (sum == 0)
            ans++;
    }
    sort(list.begin(), list.end());
    ll len = 1;
    temp = list[0];
    for (int i = 1; i < N; i++)
    {
        if (temp != list[i])
        {
            ans += len * (len - 1) / 2;
            temp = list[i];
            len = 1;
        }
        else
        {
            len++;
        }
    }
    ans += len * (len - 1) / 2;
    cout << ans << endl;
    // system("pause");
}

Measured memory_bytes: 2420
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
int H,W;
bool fld[50][50];
void del(int x,int y){
	fld[x][y]=0;
	for(int i=-1;i<=1;i++){
		for(int j=-1;j<=1;j++){
			int nx=x+i,ny=y+j;
			if(nx>=0 && nx<W && ny>=0 && ny<H && fld[nx][ny])del(nx,ny);
		}
	}
}
int main(){
	while(cin>>W>>H,W,H){
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				cin>>fld[j][i];
			}
		}
		int cnt=0;
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if(fld[j][i]){
					cnt++;
					fld[j][i]=0;
					del(j,i);
				}
			}
		}
		cout<<cnt<<endl;
	}
}

Measured memory_bytes: 1340
import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_1_D
 * 
 * @author Kyoro
 */
public class Main {

	int S;

	public void read() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		S = Integer.parseInt(reader.readLine());
	}

	public String solve() {
		return String.format("%d:%d:%d", S / 3600, S / 60 % 60, S % 60);
	}

	public static void main(String[] args) {
		Main main = new Main();
		try {
			main.read();
			out.println(main.solve());
		} catch (IOException e) {
			err.println(e);
		}
	}
}



Measured memory_bytes: 24600
#include<bits/stdc++.h>
using namespace std;
#define int long long

#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif

const int N = 200001 * 4;
struct edge{ int to,cost; };
vector< edge > G[N];

void dikstra(int s,int t){
  typedef pair<int, int> P;
  const int INF = 1 << 30;

  priority_queue<P,vector<P>,greater<P>> que;
  vector<int> d(N,INF); //sからの最短距離
  d[s] = 0;
  que.push({0,s}); //{最短距離,頂点}

  while( !que.empty() ){
    P p = que.top(); que.pop();
    int v = p.second;
    if(d[v] < p.first) continue;
    for(auto e : G[v]){
      if(d[e.to] > d[v] + e.cost){
        d[e.to] = d[v] + e.cost;
        que.push( {d[e.to],e.to} );
      }
    }
  }
  if(d[t] == INF) cout << -1 << endl;
  else cout << d[t] << endl;
}

using P = pair<int,int>;

signed main(){

  int n,m; cin >> n >> m;
  vector<int> p(m),q(m),c(m);
  vector<vector<int>> station(n);
  vector<P> v;
  for(int i = 0; i < m; i++){
    cin >> p[i] >> q[i] >> c[i];
    p[i]--,q[i]--,c[i]--;
    station[p[i]].push_back(c[i]);
    station[q[i]].push_back(c[i]);
    v.push_back({p[i],c[i]});
    v.push_back({q[i],c[i]});
  }

  for(int i = 0; i < n; i++){
    v.push_back({i,-1});
  }
  // sort(v.begin(),v.end());
  // v.erase(unique(v.begin(),v.end()),v.end());

  map<pair<int,int>,int> mp;
  for(int i = 0; i < v.size(); i++){
    mp[v[i]] = i;
  }

  for(int i = 0; i < n; i++){
    for(int c : station[i]){
      int u = mp[{i,c}];
      int v = mp[{i,-1}];
      G[v].push_back({u,0});
      G[u].push_back({v,1});
    }
  }

  for(int i = 0; i < m; i++){
    int u = mp[{p[i],c[i]}];
    int v = mp[{q[i],c[i]}];
    G[u].push_back({v,0});
    G[v].push_back({u,0});
  }
  dikstra(mp[{0,-1}],mp[{n-1,-1}]);

  return 0;
}


Measured memory_bytes: 111592
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<algorithm>
#include<functional>


using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;

	cout << (n - 1)*(m - 1) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

#define endl "\n"
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first 
#define ss second 
#define pii pair<int,int>
#define vi vector<int>
#define vc vector<char>
#define vii vector<pii>
#define vvi vector<vi>
#define fori(i,n) for(int i=1;i<=n;++i)
#define forn(i,n) for(int i=0;i<n;++i)
#define sz(x) int(x.size())
#define error(x) cout<<#x<<" "<<x<<endl
#define IOS  ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const int N=100*1000;
const int mod=1e9+7;

int min3(int a,int b,int c){return min(a,min(b,c));}
int max3(int a,int b,int c){return max(a,max(b,c));}
int min4(int a,int b,int c,int d){return min(min(a,b),min(c,d));}
int max4(int a,int b,int c,int d){return max(max(a,b),max(c,d));}

//#define int int64_t
//int a[N+2];

int32_t  main(){
	IOS;
  vector<string>v;
  int n,l;cin>>n>>l;
  fori(i,n){
    string va;cin>>va;
    v.pb(va);
  }
  sort(all(v));
  for(auto it:v)cout<<it;
  cout<<endl;

  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int D;
int C[26];
int S[365][26];

int64_t evaluate(const vector<int> &T) {
  int64_t res = 0;
  vector<int> last(26);
  for (int i = 0; i < T.size(); ++i) {
    res += S[i][T[i] - 1];
    last[T[i] - 1] = i + 1;
    for (int j = 0; j < 26; ++j) {
      res -= C[j] * (i + 1 - last[j]);
    }
  }
  return res;
}

int main() {
  cin >> D;
  for (int i = 0; i < 26; ++i) cin >> C[i];
  for (int i = 0; i < D; ++i) for (int j = 0; j < 26; ++j) cin >> S[i][j];

  vector<int> T;
  for (int _ = 0; _ < D; ++_) {
    pair<int64_t, int> best = make_pair(numeric_limits<int64_t>::min(), 0);
    for (int n = 1; n <= 26; ++n) {
      T.push_back(n);
      best = max(best, make_pair(evaluate(T), n));
      T.pop_back();
    }
    assert(best.second);
    T.push_back(best.second);
  }

  for (int i = 0; i < D; ++i) cout << T[i] << endl;

  return 0;
}



Measured memory_bytes: 3668
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int N = scanner.nextInt();
        long W = scanner.nextInt();
        long dp[] = new long[100001];
        Arrays.fill(dp, Long.MAX_VALUE/2);
        dp[0] = 0;
        for(int i= 0; i < N; i++) {
            long w = scanner.nextLong();
            int v = scanner.nextInt();
            for(int j = 100000-v; j>= 0; j--) {
                if (dp[j] != Long.MAX_VALUE) dp[j+v] = Math.min(dp[j+v], dp[j] + w);
            }
        }
        long ans = 0;
        for(int i = 100000; i >= 0; i--) {
            if (dp[i] <= W) {
                ans = i;
                break;
            }
        }
        out.println(ans);
        out.flush();
    }
    
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
    }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define LD long double
#define SC(t,x) static_cast<t>(x)
#define AR(t) vector < t >
#define PII pair < int, int >
#define PLL pair < LL, LL >
#define PIL pair < int, LL >
#define PLI pair < LL, int >
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define PRF first
#define PRS second
#define INIT(ar,val) memset ( ar, val, sizeof ( ar ) )
#define lp(loop,start,end) for ( int loop = start; loop < end; ++loop )
#define lpd(loop,start,end) for ( int loop = start; loop > end; --loop )
#define lpi(loop,start,end) for ( int loop = start; loop <= end; ++loop )
#define lpdi(loop,start,end) for ( int loop = start; loop >= end; --loop )
#define qmax(a,b) (((a)>(b))?(a):(b))
#define qmin(a,b) (((a)<(b))?(a):(b))
#define qabs(a) (((a)>=0)?(a):(-(a)))

const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;

int a, b, c;

void init ();
void input ();
void work ();



int main()
{
	init();
	input();
	work();
}



void init ()
{
	// Init Everything Here
	
	ios::sync_with_stdio ( false );
}

void input ()
{
	// input method
	
	cin >> a >> b >> c;
}

void work ()
{
	// main work
	
	if ( a == b && b == c && ( ! ( a & 1 ) ) ) cout << -1 << endl;
	else{
		int ans = 0;
		while ( ! ( ( a & 1 ) || ( b & 1 ) || ( c & 1 ) ) ){
			int ta = a, tb = b, tc = c;
			a = ( tb + tc ) >> 1;
			b = ( ta + tc ) >> 1;
			c = ( ta + tb ) >> 1;
			++ans;
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    String str_kn = scan.nextLine();
    String str_a = scan.nextLine();
    String[] kn = str_kn.split(" ");
    int k = Integer.parseInt(kn[0]);
    int n = Integer.parseInt(kn[1]);
    String[] str_a_array = str_a.split(" ");
    int[] a = new int[n];
    for(int i=0; i < n; i++){
      a[i] = Integer.parseInt(str_a_array[i]);
    }
    int dst = 0;
    for(int i=0; i < n-1; i++){
      if(dst < a[i+1]-a[i]) dst = a[i+1]-a[i];
    }
    if(dst < k - a[n-1] + a[0]) dst = k - a[n-1] + a[0];
    System.out.println(k-dst);
  }
}


Measured memory_bytes: 57192
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define MP(a,b) make_pair(a,b)
typedef long long LL;
typedef pair<int, int> PI;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
const LL MOD = 1000000007LL;

int main() {
	string S;
	cin >> S;
	int cnt = 0;
	rep(i, S.size()-1) {
		if (S[i] != S[i + 1]) cnt++;
	}
	cout << cnt << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(ll size) {
        size = max((int) sqrt(size) + 1, 101010);
        prime.resize(size, 1);
        prime[0] = 0;
        prime[1] = 0;
        for (size_t i = 2; i * i <= size; ++i)
            if (prime[i]) {
                for (size_t j = 2; i * j <= size; ++j)prime[i * j] = false;
            }
    }
};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


ll GCD(ll a, ll b) {
    if (b == 0)return a;
    return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    ll gcd = GCD(a, b);
    return a / gcd * b;
}

ll N;

int main() {
    cin >> N;
    vector<int> A(N), B(N), C(N);
    ll a = 0, b = 0;
    REP(i, N)cin >> A[i], a += A[i];
    REP(i, N)cin >> B[i], b += B[i];
    if (a < b) {
        cout << -1 << endl;
        return 0;
    }
    ll res = 0, c = 0;
    REP(i, N) {
        C[i] = A[i] - B[i];
        if (C[i] < 0) {
            res++;
            c += C[i];
        }
    }
    sort(C.begin(), C.end(), greater<>());
    int k = 0;
    while (c < 0) c += C[k], k++;
    cout << res + k << endl;
    return 0;
}

Measured memory_bytes: 1536
n,k,q = list(map(int, input().split()))
a = [int(input()) for i in range(q)]
pnt = [k]*n
for i in range(q):
    pnt[a[i]-1]+=1
for i in range(n):
    pnt[i]-=q
for i in range(n):
    if pnt[i]<=0:
        print('No')
    else:
        print('Yes')

Measured memory_bytes: 11836
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>

using namespace std;

char str[110000];

int main()
{
	cin>>str;
	int flag = 1;
	int len;
	len = strlen(str);
	for(int i = 0;i < len - 2;i++)
	{
		if(str[i] != str[i+2])
		{
			flag = 0;
			break;
		}
	}
	if(flag)
		cout<<"Second"<<endl;
	else if(str[0] == str[len-1] && len % 2)
		cout<<"Second"<<endl;
	else if(len % 2)
		cout<<"First"<<endl;
	else if(str[0] == str[len-1] && len % 2 == 0)
		cout<<"First"<<endl;
	else
		cout<<"Second"<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>

using namespace std;

int main(void)
{
    int64_t sum = 0;
    int32_t N;
    cin >> N;

    for (size_t i = 1; i <= N; i++)
    {
        if(i % 3 == 0 || i % 5 == 0)
        {

        }
        else{
            sum += i;
        }
    }
    

    cout << sum <<endl;
}

Measured memory_bytes: 3640
gyou,retu=map(int,input().split())
l=[input() for _ in range(gyou)]
d=[(0,1),(1,0),(-1,0),(0,-1)]
s=0
for g in range(gyou):
  for r in range(retu):
    if l[g][r]=="#":
      k=0
      for x,y in d:
        try:
          if l[g+x][r+y]=="#" and g+x>=0 and r+y>=0:
            k+=1
        except IndexError:
          pass
      if k==0:
        s+=1
        break
    if s==1:
      break
  if s==1:
    break
print("No") if s==1 else print("Yes")

Measured memory_bytes: 3064
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    long S[] = new long[3];
    S[0] = sc.nextLong();
    S[1] = sc.nextLong();
    S[2] = sc.nextLong();
    Arrays.sort(S);
    long s1 = (int)S[2] / 2 * S[1] * S[0];
    long sAll = S[0] * S[1] * S[2];
    long s2 = sAll - s1;
    System.out.print(s2 - s1);
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int,int> b;
  for(int i=0;i<n;i++){
    cin >> a.at(i);
    b[a.at(i)]++;
  }
  sort(a.begin(), a.end());
  int f=a.at(0);
  int l=a.at(n-1);
  int max=0;
  for(int i=f;i<=l;i++){
    if(b[i]+b[i+1]+b[i+2]>max)
      max=b[i]+b[i+1]+b[i+2];
  }
  cout << max << endl;
  
}

Measured memory_bytes: 5376
start_data = [18680908, 19120730, 19261225, 19890108, 99999999]
era = ["pre-meiji", "meiji", "taisho", "showa", "heisei"]

while 1:
    try:
        y, m, d = map(int, input().split(" "))
        data = y * 10000 + m * 100 + d
        for i in range(5):
            if data < start_data[i]:
                if i is 0:
                    print(era[0])
                    break
                else:
                    print(era[i], data // 10000 - start_data[i - 1] // 10000 + 1, m, d)
                    break
    except:
        break



Measured memory_bytes: 5600
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

//#include "atcoder/all"
//using namespace atcoder;

vector<int> parse(int n, string& s) {
    char c = s[0];
    int tmp = 1;
    vector<int> res;
    for (int i = 1; i < n; i++) {
        if (s[i] != c) {
            c = s[i];
            res.push_back(tmp);
            tmp = 1;
        } else {
            tmp++;
        }
    }
    res.push_back(tmp);
    return res;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	int ans = parse(s.size(), s).size() - 1;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4012
#include <bits/stdc++.h>

#include <iostream>
using namespace std;
int main() {
  int64_t n, m;
  cin >> n >> m;
  vector<vector<int64_t>> road(n);
  vector<int64_t> len(n - 1, 0);
  vector<int64_t> ans(n - 1, 0);
  vector<int64_t> temp_vec;
  for (size_t i = 0; i < m; i++) {
    int64_t temp1, temp2;
    cin >> temp1 >> temp2;
    road[temp1 - 1].push_back(temp2);
    road[temp2 - 1].push_back(temp1);
    if (temp1 == 1) {
      ans[temp2 - 2] = temp1;
      temp_vec.push_back(temp2);
    } else if (temp2 == 1) {
      ans[temp1 - 2] = temp2;
      temp_vec.push_back(temp1);
    }
  }

  while (
      !std::all_of(ans.begin(), ans.end(), [](int64_t x) { return x != 0; })) {
    vector<int64_t> temp_vec2;
    for (auto temp_i : temp_vec) {
      for (auto road_i : road[temp_i - 1]) {
        if (road_i > 1) {
          if (ans[road_i - 2] == 0) {
            ans[road_i - 2] = temp_i;
            temp_vec2.push_back(road_i);
          }
        }
      }
    }
    temp_vec = temp_vec2;
  }

  cout << "Yes" << endl;
  for (auto ans_i : ans) {
    cout << ans_i << endl;
  }
  return 0;
}


Measured memory_bytes: 14096
#include <iostream>
using namespace std;
#define MAX 2000000

int H,A[MAX+1];

void maxHeapify(int i){
    int l,r,largest;
    l=2*i;
    r=2*i+1;

    //????????????????????????????????????????????????????????§?????????
    if(l<=H&&A[l]>A[i])
        largest=l;
    else
        largest=i;
    if(r<=H&&A[r]>A[largest])
        largest=r;

    if(largest!=i){
        swap(A[i],A[largest]);
        maxHeapify(largest);
    }
}

int main(){
    cin>>H;
    for(int i=1;i<=H;i++)
        cin>>A[i];
    for(int i=H/2;i>=1;i--)
        maxHeapify(i);
    for(int i=1;i<=H;i++)
        cout<<" "<<A[i];
    cout<<endl;
}

Measured memory_bytes: 4924
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include<cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<list>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include <vector>

#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;

int main() {
	int N, K;
	ll ans = 0;
	cin >> N >> K;
	ans += pow(N / K, 3);
	if (K%2 == 0) {
		if (N%K < K / 2) {
			ans += pow(N / K, 3);
		}
		else {
			ans += pow(N / K + 1, 3);
		}
	}

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

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD (int)(1e9+7)
#define ceil(x, y) (x%y==0? (x/y) : (x/y+1))
#define FOR(i, N) for(int i = 0; i < N; ++i)
#define FOR1(i, N) for(int i = 1; i <= N; ++i)
#define vi vector <int>
#define pii pair <int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mset(a, v) memset(a, v, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define INF 2e9
#define EPS 1e-9
#define MAX 200009
#define PI 3.141592653589793238
#define int long long
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<int, int, hash<int>> ht; // while using, comment #define int long long  */

void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
using namespace std;

bool chk(vector<int> adj[], int h[], int i){
	for(int neigh : adj[i]){
		if(h[neigh] >= h[i]) return false;
	}
	return true;
}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    	freopen("in2.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif

	int T=1;
	//cin >> T;
	FOR1(tp, T)
	{
		//cout << "Case #" << tp << ": ";
		
		int n, m; cin >> n >> m;
		int h[n+1];
		FOR1(i, n) cin >> h[i];
		vector<int> adj[n+1];
		FOR1(i, m) {
			int a, b;
			cin >> a >> b;
			adj[a].pb(b);
			adj[b].pb(a);
		}
		int cnt = 0;
		FOR1(i, n){
			if(chk(adj, h, i)) cnt++;
		}
		cout << cnt;
		cout << '\n';
	}
	return 0;
}


Measured memory_bytes: 10252
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

fun solve() {
    val n = readInteger()
    val ans = readIntegerList().map { it - 1 }.sum()
    out.println(ans)
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


Measured memory_bytes: 36988