akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <utility>
#include <algorithm>
#include <set>
#include <string>
#include <queue>
#include <functional>
#include <climits>
#include <string>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	long long k;
	string s;
	cin >> s;
	cin >> k;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] != '1') { cout << s[i]; break; }
		else {
			k -= 1;
			if (k == 0) {
				cout << s[i];
				break;
			}
		}
	}
	return 0;
}



Measured memory_bytes: 256
/* 
 * Project: AtCoder Beginners Contest 175 A - Rainy Season
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/08/29
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
using namespace std;

int main() {

    char c;
    unsigned int cnt = 0;
    unsigned int max_cnt = 0;
    for (int i=0;i<3;i++) {
        scanf("%c", &c);
        if (c == 'R') {
            cnt++;
        } else {
            cnt = 0;
        }
        if (cnt > max_cnt)
            max_cnt = cnt;
    }
    printf("%d\n", max_cnt);

}

Measured memory_bytes: 3200
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();

		if ((0<=a && a<= 8) && (0<=b && b<= 8)) {

			System.out.println("Yay!");

		} else {

			System.out.println(":(");
		}
	}
}


Measured memory_bytes: 23636
#include<iostream>
using namespace std;
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    
    if (a >= b && a >= c) {
      cout << b + c << endl;
    } else if (b >= a && b >= c) {
      cout << a + c << endl;
    } else {
      cout << a + b << endl;
    }
    return 0;
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ASC(x) sort(ALL((x)))
#define DESC(x) sort(ALL((x)),greater<ll>())
#define pb push_back

int main()
{
    ll N;
    cin >> N;
    vec A(N+1, 0);
    REP(i,1,N+1) cin >> A[i];

    vec B(N+1, 0), C((N+1)/2+1, 0), D((N-1)/2+1, 0);
    ll S = 0;
    for(ll i=1; i<=N; ++i) S += A[i];
    S /= 2;
    for(ll i=1; i<=(N+1)/2; ++i) C[i] = C[i-1] + A[2*i-1];
    for(ll i=1; i<=(N-1)/2; ++i) D[i] = D[i-1] + A[2*i];

    for(ll i=1; i<=(N+1)/2; ++i) B[2*i-1] = S - C[i-1] - D[(N-1)/2] + D[i-1];
    for(ll i=1; i<=(N-1)/2; ++i) B[2*i] = S - D[i-1] - C[(N+1)/2] + C[i];

    for(ll i=1; i<=N; ++i) PR(B[i]*2);

    return 0;
}

/*



*/

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

int main()
{
	int r, c,sum;
	
	cin >> r >> c;
	int num[101][101];

	for (int i = 0; i < r; i++) {
		for (int j = 0; j < c; j++) {
			cin >> num[i][j];
		}
	}

	for (int i = 0; i < r; i++) {
		num[i][c] = 0;
		for (int j = 0; j < c; j++) {
			cout << num[i][j] << " ";
			num[i][c] += num[i][j];
		}
		cout << num[i][c];
		cout << endl;
	}
	for (int i = 0; i < c + 1; i++) {
		sum = 0;
		for (int j = 0; j < r; j++) {
			sum += num[j][i];
		}
		cout << sum;
		if (i != c) {
			cout << " ";
		}
	}
	cout << endl;

	return 0;

}



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

int main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int n, k;
    cin>>n>>k;
    vector<int> s[n+1];
    for (int i=0; i<k; i++){
        int d;
        cin>>d;
        for (int j=0; j<d; j++){
            int sn;
            cin>>sn;
            s[sn].push_back(i);
        }
    }
    int ans = 0;
    for (int i=1; i<=n; i++){
        if (s[i].size()==0) ans++;
    }

    cout<<ans;
    return 0;
}



Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
  int N,K,x,sum;
  cin >> N >> K;
  sum = 0;
  for(int i=0;i<N;i++){
    cin >> x;
    if(x>=K){
      sum ++;
    }
  }
  cout << sum << endl;
}

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

typedef long long ll;

const int MAX_N = 100005;

int A[MAX_N], n;

int main() {
    cin >> n;
    for(int i = 1; i <= n; i++) {
        cin >> A[i];
    }
    
    sort(A + 1, A + 1 + n);
    reverse(A + 1, A + 1 + n);
    
    int nr = 1;
    
    while(nr < n && A[nr + 1] >= nr + 1) {
        nr++;
    }
    
    if((A[nr] - nr) % 2 == 1) {
        cout << "First";
        return 0;
    }
    
    int end = nr;
    while(end < n && A[end + 1] == nr) {
        end++;
    }
    
    if((end - nr) % 2 == 1) {
        cout << "First";
        return 0;
    }
    
    cout << "Second";
    
    return 0;
}


Measured memory_bytes: 3916
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int[][] hap = new int[n][3];
		long[][] dp = new long[n+10][3];
		for(int i = 0; i < n; i++) {
			hap[i][0] = sc.nextInt();
			hap[i][1] = sc.nextInt();
			hap[i][2] = sc.nextInt();
		}
		
		for(int i = 0; i < n; i++) {
			for(int j = 0; j < 3; j++) {
				for(int k = 0; k < 3; k++) {
					if(j == k) continue;
					dp[i + 1][j] = Math.max(dp[i + 1][j], dp[i][k] + hap[i][j]);
					//System.out.println(dp[i+1][j]);
				}
			}
		}
		long max = 0;
		for(int i = 0; i < 3; i++) {
			if(dp[n][i] > max) {
				max = dp[n][i];
			}
		}
		System.out.println(max);
	}
}

Measured memory_bytes: 58404
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
int main(){
    int n;
    cin >> n;
    int count = 0;
    int temp=0;
    int ans=0;
    bool flag;
    for(int i=1;i<=n;i++){
        int n=i;
        flag = true;
    while(flag == true){
        if(n%2==0){
            count++;
            n=n/2;
        }else{
            flag = false;
        }
    }
    if(count>=temp){
        temp = count;
        ans = i;
    }
    count =0;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

int main() {
	int n;
	string s;
	vector<int> people(5, 0);

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s;
		switch (s[0]) {
			case 'M': people[0]++; break;
			case 'A': people[1]++; break;
			case 'R': people[2]++; break;
			case 'C': people[3]++; break;
			case 'H': people[4]++; break;
			default: continue;
		}
	}

	long long ans = 0;
	for (int i = 0;   i < 5; i++) {
	for (int j = i+1; j < 5; j++) {
	for (int k = j+1; k < 5; k++) {
		ans += 1LL * people[i] * people[j] * people[k];
	}}}

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


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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
#define FS              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll              long long int
#define ld              long double
#define pb              push_back
#define bp              __builtin_popcount
#define sz              size()
#define ff              first
#define ss              second
#define vll             vector<ll>
#define vbool           vector<bool>
#define vpll            vector<pair<ll,ll>>
#define pll             pair<ll,ll>
#define vllv            vector<vector<ll>>
#define setpri(x)       cout<<setprecision(x)<<fixed;
#define all(v)          v.begin(),v.end()
#define allr(v)         v.rbegin(),v.rend()
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
// getline (std::cin,name);
ll MOD=1e9+7;
ll ceil1(ll n,ll x){return (n-1)/x+(n>0);}

ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll pow1(ll n,ll m ,ll mod=MOD );
ll pow2(ll n,ll k);

ll modinv(ll n,ll mod=MOD){  return pow1(n,mod-2,mod);}

bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
        if(a.ff != b.ff)return a.ff < b.ff;
        return a.ss > b.ss;
}
ll const N=(ll)1e5+111;
ll const LG=(ll)log2(N)+1;


void solve(){
        ll i,j,k,l,n,m,x,y,z,r;
        
        cin>>n;
        m=1000;

        ll tt=m-n%m;
        cout<<tt%m<<endl;
        
}       
int main(){
        FS;
        
        ll i,j,k,n,m,x,y,z,q;
        q=1;
        // cin>>q;
        while(q--){
                solve();
        }
        return 0;
}


ll pow1(ll n,ll m,ll mod){
        if(m==0)return 1;
        
        if(m%2==0)return pow1((n*n)%mod,m/2,mod);
    	
    	return (pow1((n*n)%mod,m/2,mod)*n)%mod;
}

ll pow2(ll n,ll k){
        ll ans=1;
            while(k>0){
                if(k%2==1)ans=ans*n;
                n=n*n;
                k/=2;
            }
            return ans;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h> 
using namespace std;
using ll = long long;

const int sz = 2e5+5, MOD = 1e9+7;
int n, k;
pair<int, bool>a[sz];

#define F first
#define S second

inline int add(int a, int b){return (a+b)%MOD;}
inline int sub(int a, int b){return ((a-b)%MOD + MOD)%MOD;}
inline int mul(int a, int b){return ((ll)a*b)%MOD;}

void solve(){
    cin >> n >> k;
    for(int i = 0; i < n; ++i){
        cin >> a[i].F;
        a[i].S = a[i].F < 0;
        a[i].F = abs(a[i].F);
    }
    sort(a, a+n, greater<pair<int, bool>>());

    int mult = 1, negs = 0;
    int lastpos = -1, lastneg = -1;
    for(int i = 0; i < k; ++i){
        mult = mul(mult, a[i].F);
        if(a[i].S){
            negs++;
            lastneg = i;
        }
        else lastpos = i;
    } 

    if(negs%2==0){
        cout << mult << '\n';
    }
    else{
        bool gpos = true, gneg = true;
        int mult1, mult2;
        ll x, y, z, w;
        //take one more negative or one less
        if(lastpos != -1){
            int mult = 1;
            for(int i = 0; i < k; ++i){
                if(i != lastpos) mult = mul(mult, a[i].F);
            }
            int i = k;
            while(i < n && !a[i].S) i++;

            if(i==n){
                gpos = false;
            }
            else{
                x = a[lastpos].F;
                y = a[i].F;
                mult1 = mul(mult, a[i].F);
            }
        }
        else gpos = false;

        if(lastneg != -1){
            int mult = 1;
            for(int i = 0; i < k; ++i){
                if(i != lastneg) mult = mul(mult, a[i].F);
            }
            int i = k;
            while(i < n && a[i].S) i++;

            if(i==n){
                gneg = false;
            }
            else{
                z = a[lastneg].F;
                w = a[i].F;
                mult2 = mul(mult, a[i].F);
            }
        }
        else gneg = false;

        // cout << gpos << " " << gneg << '\n';

        if(!gpos && !gneg){
            int mult = 1;
            for(int i = 0; i < k; ++i){
                mult = mul(mult, a[n-1-i].F);
            }
            
            mult = (-mult + MOD)%MOD;
            cout << mult << '\n';
        }
        else if(!gpos){
            cout << mult2 << '\n';
        }
        else if(!gneg){
            cout << mult1 << '\n';
        }
        else{
            // y/x > z/w
           // cout << x << y<<z << w << '\n';
           //cout << x*w  << " " << y*z << '\n';
            if(x*w < y*z){
                cout << mult1 << '\n';
            }
            else{
                cout << mult2 << '\n';
            }
        }
    }

}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}

Measured memory_bytes: 5212
using System.Linq;
using System.Collections.Generic;
using System;

public class hello
{
    public static void Main()
    {
        var p = new int[10000];
        var pL = new List<int>(10000);
        GeneratePrime(p, pL, 10000);
        string line;
        for (; (line = Console.ReadLine()) != null;)
        {
            var a = int.Parse(line.Trim());
            var count = 0;
            foreach (var x in pL)
            {
                var x2 = a + 1 - x;
                if (x2 > x)
                {
                    if (p[x2] == 1) count += 2;
                }
                else if (x2 == x) count++;
                else break;
            }
            Console.WriteLine(count);
        }
    }
    public static void GeneratePrime(int[] p, List<int> pL ,  int m)
    {
        int prime;
        var sqrtMax = Math.Sqrt(m);
        var searchList = Enumerable.Range(2, m - 1).ToList();
        do
        {
            prime = searchList.First();
            p[prime] = 1;
            pL.Add(prime);
            searchList.RemoveAll(n => n % prime == 0);
        }
        while (prime < sqrtMax);
        foreach (var x in searchList) p[x] = 1;
        pL.AddRange(searchList);
    }
}

Measured memory_bytes: 9708
N = int(input())
A = list(map(int,input().split()))

flag = 0
for i in range(len(A)):
	if A[i]==0:
		flag =1

if flag == 1 :
	print("0")
else:
	x = 1
	for i in range(len(A)):
		x = x * A[i]
		if x > 10 ** 18:
			break
          
    
	if x > 10 ** 18:
		print("-1")
	else:
		print(x)

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

const int N = 1000005; int cnts[N];

vector<int> primefactors(int n) {
	vector<int> v;
    if (n == 1) {v.push_back(1); return v;}
    if (n == 2) {v.push_back(1); v.push_back(2); return v;}

	for (int k = 2; k <= sqrt(n); k ++) {
		if (k * k > n) break;
        if (n % k == 0) {
            v.push_back(k);
            while(n % k == 0) n /= k;
        }
	} if (n != 1) v.push_back(n);
	return v;
}

int gcd(int a, int b) {
	if (a == 0) return b;
	return gcd(b%a, a);
}

int main() {
    int n; cin >> n; int arr[n]; for (int i = 0; i < n; i ++) cin >> arr[i];
    bool coprime = true;
    for (int i = 0; i < n; i ++) {
        vector<int> v = primefactors(arr[i]);
        for (auto j : v) {
            if (j == 1) continue;
            if (cnts[j] > 0) coprime = false;
            else cnts[j] ++; 
        }
    } if (coprime) cout << "pairwise coprime" << endl;
    else {
        int currnum = arr[0];
        for (int i = 0; i < n; i ++) currnum = gcd(currnum, arr[i]);
        if (currnum == 1) cout << "setwise coprime" << endl;
        else cout << "not coprime" << endl;
    }
}

Measured memory_bytes: 11288
import math
A,B,H,M= map(int,input().split())
baseangle = abs(6*M -(60*H+M)/2)
angle = min(baseangle,360-baseangle)

cosine = math.cos(math.radians(angle))

ans = (A**2 + B**2 - 2*A*B*cosine)**0.5

print(ans)

Measured memory_bytes: 9508
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
#include <array>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

int a, b, c;
int solve(){
    for(int t=0; (60*t + c)<3600; t++){
        if((60*t + c) % (a+b) <= a)
            return 60*t + c;
    }
    return -1;
}

//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    //cout.precision(16);
    
    cin >> a >> b >> c;
    cout << solve() << endl;
    return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, M;
    cin >> N >> M;
    vector<long long> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    vector<long long> ruiseki(N + 1);
    for (int i = 0; i < A.size(); i++) {
        ruiseki[i + 1] = (A[i] + ruiseki[i]) % M;
    }
    long long ans = 0;
    map<int, int> m;
    for (int i = 0; i < ruiseki.size(); i++) {
        ans += m[ruiseki[i]];
        m[ruiseki[i]]++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4736
#include<stdio.h>
#include<stdlib.h>
#include<string.h>


int main(void){
	int l;
	char s[101];
	int i;
	int c;

	scanf("%s",s);

	l = strlen(s);

	c = 0;
	for(i=0;i<l/2;i++){
		if(s[i] != s[l-1-i]){
			c++;
		}
	}


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

	return 0;


}



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

using namespace std;

int n;
vector<pair<int,int> > G[100010];
long long dis[100010];
int ans[100010];

void f(int u, int p) {
    if(dis[u] % 2 == 0) ans[u] = 1;
    for (auto v: G[u]) {
        if(v.first == p) continue;
        dis[v.first] = dis[u] + v.second;
        f(v.first, u);
    }
}

int main() {
    
    cin >> n;

    for (int i = 0; i < n - 1; ++i) {
        int x,y,w;
        cin >> x >> y >> w;
        G[x].push_back({y,w});
        G[y].push_back({x,w});
    }
 
    f(1,1);

    for (int i = 1; i <= n; ++i)
        cout << ans[i] << "\n";

    return 0;
}


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

using namespace std;
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define rep(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)

typedef complex<ld> cplex;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int inf = 1000000007;
const int N = 1000000 + 7;
const int multipleTest = 0;

int A, B, C, D, E, F;

int dp[N], L[N];

void solve() {
    cin >> A >> B >> C >> D >> E >> F;
    A *= 100;
    B *= 100;
    int mx = 0;
    for (int i = 0; A * i <= F; ++i) {
        for (int j = 0; A * i + B * j <= F; ++j) dp[A * i + B * j] = 1;
    }
    rep(i, 0, F + 1) if (dp[i]) mx = i;
    for (int i = 0; C * i <= F; ++i) {
        for (int j = 0; C * i + D * j <= F; ++j) L[C * i + D * j] = 1;
    }

    int resa = 0, resb = 1;
    int ax = mx, ay = 0;
    for (int i = 1; i <= F; ++i) for (int j = 1; j <= F; ++j) if (dp[i] && L[j] && i + j <= F && j * 100 <= E * i) {
                //ld tmp = 1.0 * j / (i + j);
                if (resa * (i + j) < resb * j) {
                    resa = j;
                    resb = i + j;
                    ax = i + j;
                    ay = j;
                }
            }

    cout << ax << ' ' << ay ;
}

int main() {
#ifdef _LOCAL_
    freopen("in.txt", "r", stdin);
    //    freopen("out.txt", "w", stdout);
#endif
    int Test = 1;
    if (multipleTest) {
        cin >> Test;
    }
    for(int i = 0; i < Test; ++i) {
        solve();
    }
#ifdef _LOCAL_
    cout<<"\n" << 1.0 * clock() / CLOCKS_PER_SEC << endl;
#endif
}


Measured memory_bytes: 2304
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt();
 sc.close();
  if(a==b&&b==c&&c==a) {System.out.println("Yes");}
  else {System.out.println("No");}
		}

}

Measured memory_bytes: 22868
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<cstring>

using namespace std;

int main(){

  int n,m,q;
  cin >> n >> m >> q;

  int s[n+1][n+1],a[n+1][n+1];
  memset(s,0,sizeof(s));
  memset(a,0,sizeof(a));

  for(int i=0;i<m;i++){
    int l,r;
    cin >> l >> r;
    a[l][r]++;
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      s[i+1][j+1]=s[i+1][j]+s[i][j+1]-s[i][j]+a[i+1][j+1];
    }
  }

  for(int i=0;i<q;i++){
    int l,r;
    cin >> l >> r;
    cout << s[n][r]-s[l-1][r] << endl;;
  }

}

Measured memory_bytes: 2816
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

X = I()

# def is_prime(X,n):
#     # if n == 1:
#     #     return False
#     # for i in range(2,int(n**0.5)+1):
#     for i in range(2,X):
#         if n % i == 0:
#             return False
#     return True
def is_prime(n):
    # if n == 1:
    #     return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
            
for i in range(X,100003+1):
    # print(i)
    if is_prime(i):
        print(i)
        break

#H,N = LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

# if ans:
#     print('Yes')
# else:
#     print('No')

Measured memory_bytes: 27084
#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; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int s, w;
    cin >> s >> w;
    if(w >= s) cout << "unsafe" << endl;
    else cout << "safe" << endl;
	return 0;
}


Measured memory_bytes: 3652
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;


namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
            Console.Read();
        }

        public void Solve(ConsoleInput cin)
        {
            var A = cin.ReadInt;
            var B = cin.ReadInt;

            //var 
            //            string[] N;

            //          N = Console.ReadLine().Split;

//            int A, B;
  //          A = int.Parse(N[0]);
    ///        B = int.Parse(N[1]);

            string result = "";

            if (A <= 8 && B <= 8) { result = "Yay!"; }
            else { result = ":("; }

            Console.WriteLine(result);
            Console.Read();

        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        ///
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

Measured memory_bytes: 11220
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
#define N 1010000
ll MOD=1e9+7;
vector<vec> G;
int g[1010][1010];
vec visited;
vec ans;
bool dfs(int x,int s,int t){
    if(x==s&&t)return 1;
    if(visited[x]){
        return 0;
    }
    visited[x]=1;
    for(auto e:G[x]){
        if(dfs(e,s,1)){
            ans.pb(x);
            return 1;
        }
    }
    return 0;
}
int main(){
    int n=in(),k=in();
    vec v;
    rep(i,n)v.pb(in());
    int ans=0;
    rep(i,n){
        if(v[i]>=k)ans++;
    }
    cout<<ans;
}

Measured memory_bytes: 892
m = 10**9 + 7
N = int(input())
A = sorted(list(map(int, input().split())))
flg = True
if N % 2 == 1:
    if A[0] != 0:
        flg = False
    else:
        for i in range(1, N-1, 2):
            if A[i] != A[i+1] or A[i] != A[i-1]+2:
                flg = False
                break
else:
    if A[0] != 1 or A[N-2] != A[N-1]:
        flg = False
    else:
        for i in range(1, N-2, 2):
            if A[i-1] != A[i] or A[i+1] != A[i]+2:
                flg = False
                break
if flg:
    print(2**(N//2)%m)
else:
    print(0)

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

#include <assert.h>    // LON
#include <math.h>    // sqrt()


using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;

int main() {

    string s1, s2;
    cin >> s1 >> s2;
    if (s1.size() < s2.size()) {
        cout << "LESS" << endl;
    } else if (s1.size() > s2.size()) {
        cout << "GREATER" << endl;
    } else {

        if (s1 < s2) {
            cout << "LESS" << endl;
        } else if (s1 > s2) {
            cout << "GREATER" << endl;

        } else {
            cout << "EQUAL" << endl;
        }

    }

}



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

int main()
{
	int N;
	int a,b;
	cin>>N;
	if(N==1)
		cout<<"Hello World\n";
	else if(N==2)
	{
		cin>>a>>b;
		cout<<a+b<<endl;
	 } 
	return 0;
 } 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define mem(a) memset(a,0,sizeof(a))
#define pd(a) printf("%.10f\n",a)
#define pb(a) push_back(a)
#define in(a) insert(a)
#define pi M_PI
#define R cin>>
#define F first
#define S second
#define C class
#define ll long long
#define ln cout<<'\n'
#define _(_1,_2,_3,N,...)N
#define pr(...) _(__VA_ARGS__,pr3,pr2,pr1)(__VA_ARGS__)
template<C T>void pr1(T a){cout<<a;ln;}
template<C T,C T2>void pr2(T a,T2 b){cout<<a<<' '<<b;ln;}
template<C T,C T2,C T3>void pr3(T a,T2 b,T3 c){cout<<a<<' '<<b<<' '<<c;ln;}
template<C T>void PR(T a,int n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

int N(char c) {
  if(isdigit(c)) return c-'0';
  if(c=='T') return 10;
  if(c=='J') return 11;
  if(c=='Q') return 12;
  if(c=='K') return 13;
  return 14;
}

void Main() {
  char c;
  while(R c && c!='#') {
    int NS=0,EW=0,k=0;
    string s[4][13];
    rep(i,4) {
      rep(j,13) R s[i][j];
    }
    rep(j,13) {
      int M=0,z;
      char c2=s[k][j][1];
      rep(i,4) {
        int x=N(s[i][j][0]);
        if(s[i][j][1]==c) x+=40;
        else if(s[i][j][1]==c2) x+=20;
        if(M<x) {
          M=x;
          z=i;
        }
      }
      if(z%2) EW++;
      else NS++;
      k=z;
    }
    if(NS>EW) pr("NS",NS-6);
    else pr("EW",EW-6);
  }
}

int main() {
  ios::sync_with_stdio(0);cin.tie(0);
  Main();return 0;
}


Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
ll mod = 1000000007;
ll INF = 1000000099;



signed main(){
    ll n,sf=0,ss=0,ans=INF;
    cin>>n;
    vector<ll> v(n);
    for(int i=0;i < n;i++)
    {
        cin>>v.at(i);
        ss+=v.at(i);
    }

    for(int i=0;i < n;i++)
    {
        sf+=v.at(i);
        ss-=v.at(i);
        ll x=fabs(ss-sf);
        ans=min(ans,x);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>

#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>

#define INF 100100100

typedef long long int llint;

using namespace std;

typedef pair<int, int>Pii;

int main() {
	char x, y;
	cin >> x >> y;
	if (x < y)puts("<");
	else if (x > y)puts(">");
	else puts("=");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll arr[2005],hell=pow(10,9)+7;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,k,res=0,sum=0;
    cin>>n>>k;
    for(ll i=0;i<n;i++)
    cin>>arr[i];
    for(ll i=0;i<n;i++)
    for(ll j=0;j<n;j++)
    if(arr[i]>arr[j])
    sum++;
    sum*=((k*(k-1)/2)%hell);
    sum%=hell;
    for(ll i=0;i<n;i++)
    for(ll j=i+1;j<n;j++)
    if(arr[i]>arr[j])
    res++;
    res*=k;
    res%=hell;
    res+=sum;
    res%=hell;
    cout<<res;
}


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int A, B, K;
    cin >> A >> B >> K;
    for(int i = 100; i >= 1; i--) {
        if(A % i != 0) continue;
        if(B % i != 0) continue;
        K--;
        if(K == 0) {
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
//author:luckYrat(twitter:@luckYrat_)
//#include <bits/stdc++.h>

//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <utility>
#include <climits>



using namespace std;

using ll = long long;
using P = pair<ll,ll>;

#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)


#define MAX 1000000000
const int mod = 1000000007;
#define EPS (1e-10)

#define pb push_back
#define fir first
#define scn second
#define ednl endl

#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")


P ar[4] = {{0,1},{0,-1},{1,0},{-1,0}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
vector.unique()は隣接した同じ要素を削除するので先にソートをする

計算量は変わらないが楽できるシリーズ
C++11以降でmin({a,b,c...})で複数個のmic,maxを処理できる
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる

*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
  int n;cin>>n;
  vector<long long> A(n);
  for(int i = 0; n > i; i++){
    cin>>A[i];
  }
  long long ans;
  for(long long i = 1; 101 > i; i++){
    long long tmp = 0;
    for(int j = 0; n > j; j++){
      tmp += (A[j]-i)*(A[j]-i);
    }
    if(i == 1)ans = tmp;
    else ans = min(ans,tmp);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
	int p[3],j[2],minp=2000,minj=2000;
	for(int i=0;i<3;++i){
		cin>>p[i];
		if(minp>p[i])minp=p[i];
	}
	for(int i=0;i<2;++i){
		cin>>j[i];
		if(minj>j[i])minj=j[i];
	}
	cout<<minp+minj-50<<endl;
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef vector<llong> LV;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};



int main() {
	int a,b,c,d,e,k;
    cin >> a >> b >> c >> d >> e>>k;
    // string S;
    // cin >> S;
    if(e-a>k){
        cout << ":("<<endl;
    }else{
        cout << "Yay!"<<endl;
    }






}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
typedef vector<ll>vi;
typedef pair<ll,ll>pi;
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
ll max(ll a,ll b){return (a>b?a:b);}
ll min(ll a,ll b){return (a<b?a:b);}
ll gcd(ll a,ll b)
{return (b?gcd(b,a%b):a);
}
void algo()
{
    ll a,b;
    cin>>a>>b;
    cout<<a*b;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout<<setprecision(20);
    ll t=1;//cin>>t;
    while(t--)
    {
        algo();
	cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define iter(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define riter(i, c) for (auto i = (c).rbegin(); i != (c).rend(); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S;
    cin >> N >> S;
    int ans = 0;
    rep(i, 0, 10) rep(j, 0, 10) rep(k, 0, 10) {
        // ijkの暗証番号を探す.
        int pos = 0;
        bool is_ok = false;
        rep(l, 0, N) {
            if (S[l] - '0' == i && pos == 0) ++pos;
            else if (S[l] - '0' == j && pos == 1) ++pos;
            else if (S[l] - '0' == k && pos == 2) {
                is_ok = true;
                break;
            }
        }
        if (is_ok) ++ans;
    }
    cout << ans << endl;
    return 0;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  string S; cin >> S;
  int ans = 0;
  for(int i = 0; i < S.size() / 2; ++i) {
    if(S[i] != S[S.size() - 1 - i]) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3600
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
Q = int(input())

x = Counter(A)
s = sum(A)

res = list()
for _ in range(Q):
    b, c = list(map(int, input().split()))
    s += (c - b) * x[b]
    x[c] = x[b] + x[c]
    x[b] = 0
    res.append(s)

for r in res:
    print(r)


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

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)


int main()
{
    int N;
    cin >> N;
    vector<long long> A(N);
    REP(i, N) cin >> A[i];

    // dp[i][j] = i 番目を選んで飛ばした個数が j のときの最大値
    vector<vector<long long>> dp(N, vector<long long>(3, -1e+18));
    dp[0][0] = A[0];
    dp[1][1] = A[1];
    if(N%2 == 1) dp[2][2] = A[2];
    REP(i, N){
        if(i >= 2) dp[i][0] = dp[i-2][0] + A[i];
        if(i >= 3) dp[i][1] = max(dp[i-2][1], dp[i-3][0]) + A[i];
        if(N%2 == 1 and i >= 4) dp[i][2] = max({dp[i-2][2], dp[i-3][1], dp[i-4][0]}) + A[i];
    }
    if(N%2 == 0) cout << max(dp[N-2][0], dp[N-1][1]) << endl;
    if(N%2 == 1) cout << max({dp[N-3][0], dp[N-2][1], dp[N-1][2]}) << endl;

    return 0;
}

Measured memory_bytes: 15660
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int mod = 1e9 + 7;
const int inf = 2e18;

signed main() {
    double R;
    cin >> R;
    cout << fixed << setprecision(10) << 2 * R * PI << endl;
}



Measured memory_bytes: 3784
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
typedef struct Node
{
    int x,y;
}node;
node a[100010];
bool cmp(Node u,Node v)
{
    return u.x<v.x;
}
int main()
{
    int n,i,j;
    long long s,m;
    scanf("%d%lld",&n,&m);
    for(i=0;i<n;i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }
    sort(a,a+n,cmp);
    s=0;
    for(i=0;i<n;i++)
    {
        s=s+a[i].y;
        if(s>=m)
            break;
    }
    printf("%d\n",a[i].x);
    return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
using ll=long long;

ll powll(ll a,ll n){
  if(n==0)
  {
    return 1;
  }
  return powll(a,n-1)*a;
}

int main() {
   ll i,j,k;
    string s;
    cin >> s;

    if(s[0]==s[1] && s[0]==s[2])
    {
      cout <<  "No" << endl;
    }else
    {
      cout << "Yes"<< endl;
    }
  
}


Measured memory_bytes: 256
// ARC61-C
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i,n) for(int i=0;i<int(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
namespace you {
    std::string to_string(char val) {
        return std::string(1, val);
        // return std::string{val};
        // you::to_string(char)
    }
}

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

    string s;
    cin>>s;
    int l=SZ(s);
    ll ans=0;
    int num=pow(2,l-1);
    for(int i=0;i<num;i++){
        ll now=0;
        for(int j=0;j<l;j++){
            now=now*10+(s[j]-'0');
            if((i>>j)&1){
                ans+=now;
                now=0;
            }
        }
        ans+=now;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static final PrintStream out = System.out;
	static final Scanner sc = new Scanner(System.in);
	static final long Mod = 1000_000_007L;
	int N,K;

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
		System.exit(0);
	}

	void solve() {
		N = nextInt();
		K = nextInt();
		long T = nextLong();

		long inf = 1000000000;
		if(T == inf) {
			inf--;
		}
		StringBuilder buf = new StringBuilder();

		for(int i=0;i<K;i++) {
			if(i!=0)buf.append(" ");

			buf.append(T);
		}
		for(int i=K;i<N;i++) {
			if(i!=0)buf.append(" ");

			buf.append(inf);
		}
		out.println(buf);
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)a[i] = nextInt();
		return a;
	}
	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)a[i] = nextLong();
		return a;
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String next() {
		return sc.next();
	}

	long gcd(long m,long n) {
		if (m<n) return gcd(n,m);
		if (n==0)return m;
		return gcd(n,m%n);
	}

	long lcm(long m, long n) {
	        return m * n / gcd(m, n);
	}
}

Measured memory_bytes: 32044
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using lubl=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint a,b,c;std::cin>>a>>b>>c; 
    std::swap(a,b);
    std::swap(a,c);
    std::cout<<a<<" "<<b<<" "<<c<<'\n';
}


Measured memory_bytes: 256
import java.math.*;
import java.util.*;

	public class Main {

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int m = sc.nextInt();
			
			if(n==m) {
				System.out.println("Yes");
			}
			else {
				System.out.println("No");
			}
			
		}

	}

Measured memory_bytes: 23252
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <map>
#include <string.h>
#define ll long long

using namespace std;

int k;
string s;

int main(){
	
	cin >> s;
	cin >> k;
	int idx = 1;
	for(int i = 0; i < s.length(); i ++){
		if(idx == k){
			cout << s[i] << endl;
			return 0;
		}
		idx++;
		if(s[i] != '1'){
			cout << s[i] << endl;
			return 0;
		}
	}

	return 0;
}

Measured memory_bytes: 256
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if a < b:
  if a + v * t >= b + w * t:
    print('YES')
  else:
    print('NO')

else:
  if a - v * t <= b - w * t:
    print('YES')
  else:
    print('NO')

Measured memory_bytes: 9188
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
typedef long long ll;
using namespace std;
int main()
{
	int a, b;
	string c;
	int count = 0;
	cin >> a >> b >> c;
	for (int i = 0; i < a + b; i++)
	{
		if (c[i] == '0' || c[i] == '1' || c[i] == '2' || c[i] == '3' || c[i] == '4' || c[i] == '5' || c[i] == '6' || c[i] == '7' || c[i] == '8' || c[i] == '9')
		{
			count++;
		}
	}
	if (c[a] == '-' && c.length() == a + b + 1 && count == a + b - 1) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

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

  const int MOD = 1000000007;
  const int INF = 1e9;

  //long long
  using ll = long long;

  //出力系
  #define print(x) cout << x << endl
  #define yes cout << "Yes" << endl
  #define YES cout << "YES" << endl
  #define no cout << "No" << endl
  #define NO cout << "NO" << endl
  
  // begin() end()
  #define all(x) (x).begin(),(x).end()

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

  //最大公約数 
  ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b,a%b);
  }

  //最小公倍数
  ll lcm(ll a,ll b){
  ll g = gcd(a,b);
  return a / g * b; // Be careful not to overflow  if(a < b) return gcd(b, a);
    unsigned r;
    while ((r=a%b)) {
      a = b;
      b = r;
    }
    return b;
  } 


  //  int X[8]={-1, 0, 1, -1, 1, -1, 0, 1};
  //  int Y[8]={1, 1, 1, 0, 0, -1, -1, -1};




int main() {
ll N, A, B;
cin >> N >> A >> B;

if(N == 1 && B != A){
  print(0);
  return 0;
}else if(N == 1 && A == B){
  print(1);
  return 0;
}else if(N > 1 && A > B){
  print(0);
  return 0;
}else{
  print((B - A) * (N - 2) + 1);
  return 0;
}
}


Measured memory_bytes: 256
#include<cstdio>

using namespace std;

typedef long long ll;

bool is_prime(ll a){
	if((a&1)==0) return a==2;
	for(ll i=3;i*i<=a;i+=2) if(a%i==0) return false;
	return a!=1;
}

bool is_Gaussian_prime(ll a,ll b){
	if(a<0) a=-a;
	if(b<0) b=-b;
	if(a==0) return (b&3)==3 && is_prime(b);
	if(b==0) return (a&3)==3 && is_prime(a);
	return is_prime(a*a+b*b);
}

int main(){
	int T; scanf("%d",&T);
	while(T--){
		int a,b; scanf("%d%d",&a,&b);
		puts(is_Gaussian_prime(a,b)?"P":"C");
	}
	return 0;
}

Measured memory_bytes: 1012
#include <iostream>

using namespace std;

int main(void) {
    char c[3][3];
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> c[i][j];
        }
    }
    cout << c[0][0] << c[1][1] << c[2][2] << endl;
    return 0;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define D 1000000007

int main(){
 ll n,m,x[100001]={},y[100001]={}; 
 cin>>n>>m;

 for(int i=0;i<n;i++)cin>>x[i];
 for(int i=0;i<m;i++)cin>>y[i];

ll X=0,Y=0;
 for(int i=0;i<n-1;i++)
  X+=((x[i+1]-x[i])*((i+1)*(n-i-1))%D)%D;

 for(int i=0;i<m-1;i++)
  Y+=((y[i+1]-y[i])*((i+1)*(m-i-1))%D)%D;
X%=D;
Y%=D;
 cout<<(X*Y)%D<<endl;
 return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int n,k;
int arr[109];
int dp[100009];
int main(){
	cin>>n>>k;
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	for(int i=1;i<=k;i++){
		for(int j=0;j<n;j++){
			if(i-arr[j] >= 0 && dp[i-arr[j]] == 0){
				dp[i] = 1;
			}
		}
	}	
	if(dp[k])cout<<"First"<<endl;
	else cout<<"Second"<<endl;
}


Measured memory_bytes: 640
#include<stdio.h>
int main(void)
{
	int n,c,i,p,sum,m;
	scanf("%d %d",&n,&c);
	sum=0;
	for(i=1;i<=c;i++){
		scanf("%d",&p);
		sum+=p;
	}
	m=sum/(n+1);
	if(sum%(n+1)>0){
		m+=1;
	}
	printf("%d\n",m);
	return 0;
}



Measured memory_bytes: 2112
#include "bits/stdc++.h"


// vector
#define MAX_ELE(vec) *max_element(vec.begin(), vec.end())

// ---------------------------------------

// string
#define TO_UP(str) transform(str.cbegin(), str.cend(), str.begin(), ::toupper)

// ---------------------------------------



using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
//  --------------------------------------

    int N, D, ans;
    int x[10][10];
    double aaa;

    cin >> N >> D;
    ans = 0;
    
    for(int i = 0; i < N; i++)
    {
        
        for(int j = 0; j < D; j++)
        {
            cin >> x[i][j];
        }
        
    }
    
    for(int i = 0; i < N; i++)
    {
        
        for(int j = 0; j < N; j++)
        {
            if(j>i){
                aaa = 0.0;
                
                for(int k = 0; k < D; k++)
                {
                    aaa += double(pow((x[i][k] - x[j][k]), 2.0));
                }
                
                
                if (ceil(sqrt(aaa)) == floor(sqrt(aaa))) {
                    ans += 1;
                }

            }
        }
        
    }

    cout << ans << "\n";

}

Measured memory_bytes: 256