akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

class Main {
        public static int check[][];
        public static int map[][][];

        public static void main(String args[]) {
                Scanner sc =new Scanner(System.in);
                while( true ){
                        int n = sc.nextInt();
                        if (n == 0) {
                                break;
                        }
                        map = new int[n][n][2];
                        check = new int[n][n];
                        for (int j = 0; j < n; j++) {
                                for (int i = 0; i < n; i++) {
                                        for (int k = 0; k < 2; k++) {
                                                map[i][j][k] = sc.nextInt();
                                        }
                                }
                        }
                        int num = 1;
                        for (int i = 0; i < n; i++) {
                                for (int j = 0; j < n; j++) {
                                        if (check[i][j] == 0) {
                                                int pair[] = new int[2];
                                                pair[0] = i;
                                                pair[1] = j;
                                                if(num == func(pair, num)){
                                                        num++;
                                                }
                                        }
                                }
                        }
                        System.out.println(num - 1);
                }
        }

        public static int func(int now[], int num){
                if (check[now[0]][now[1]] == 0) {
                        check[now[0]][now[1]] = num;
                        return check[now[0]][now[1]] = func(map[now[0]][now[1]], num);
                } else {
                        return check[now[0]][now[1]];
                }
        }
}

Measured memory_bytes: 68936
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";var n=r(1);r(2)(n.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";var n=r(3),i=r(5);t.exports=function(t){var e=new n(t);i(e)}},function(t,e,r){"use strict";var n=r(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new n(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,r){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,r){"use strict";t.exports=function(t){for(var e=t.in(),r=new Array(e),n=0;n<e;n++)r[n]=t.in();for(var i=0,o=0;o<e;o++)for(var s=e-1;s>o;s--)i+=r[o]*r[s];console.log(i)}}]);

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

int arr[] = {5,5,7};
int main(void)
{
  int ar[3];
  int a, b, c;
  bool flag = false;
  cin >> a >> b >> c;

  ar[0] = a;
  ar[1] = b;
  ar[2] = c;

  sort(ar, ar+3);

  //  for (int i = 0; i < 3 ; i++) cout << ar[i] << endl;
  if (ar[0] == 5 && ar[1] == 5 && ar[2] == 7) cout << "YES" << endl;
  else cout << "NO" << endl;

}

Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = 105;
int n;
vector<int> g[maxn];

int read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    g[i].clear();
  }
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  return true;
}

int dep[maxn], p[maxn];

void dfs(int v, int pr) {
  p[v] = pr;
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (u == pr) {
      continue;
    }
    dep[u] = dep[v] + 1;
    dfs(u, v);
  }
}

long long get(long long res0) {
  long long res = res0;
  for (int d = 1;; d++) {
    int deg = 0;
    for (int i = 0; i < n; i++) {
      if (dep[i] == d) {
        deg = max(deg, sz(g[i]) - 1);
      }
    }
    if (!deg) {
      break;
    }
    res *= deg;
  }
  return res;
}

void solve() {
  if (n == 2) {
    printf("1 2\n");
    return;
  }
  dep[0] = 0;
  dfs(0, -1);
  int v0 = 0;
  for (int i = 1; i < n; i++) {
    if (dep[i] > dep[v0]) {
      v0 = i;
    }
  }
  dep[v0] = 0;
  dfs(v0, -1);
  int v1 = 0;
  for (int i = 1; i < n; i++) {
    if (dep[i] > dep[v1]) {
      v1 = i;
    }
  }
  int maxd = dep[v1] / 2 + 1;
  long long res;
  if (dep[v1] & 1) {
    int v = v1;
    for (int i = 0; i < dep[v1] / 2; i++) {
      v = p[v];
    }
    int u = p[v];
    dep[v] = 0;
    dfs(v, u);
    dep[u] = 0;
    dfs(u, v);
    res = 2 * (max(sz(g[v]), sz(g[u])) - 1);
    res = get(res);
  } else {
    int v = v1;
    for (int i = 0; i < dep[v1] / 2; i++) {
      v = p[v];
    }
    dep[v] = 0;
    dfs(v, -1);
    res = sz(g[v]);
    res = get(res);
    for (int i = 0; i < sz(g[v]); i++) {
      int u = g[v][i];
      dep[v] = 0;
      dfs(v, u);
      dep[u] = 0;
      dfs(u, v);
      long long cur = 2 * (max(sz(g[v]), sz(g[u])) - 1);
      cur = get(cur);
      res = min(res, cur);
    }
  }
  printf("%d %lld\n", maxd, res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 256
# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <immintrin.h>
# include <cassert>
# include <array>
# include <tuple>
# include <unordered_set>
# include <unordered_map>
using namespace std;
const long long md = 1e9 + 7;

int n, m;
int a[405], b[405];
long long s[405][405];
long long dp[405][405];

inline int pw(long long x, long long y) {
    long long res = 1;
    while (y) {
        if (y & 1ll) res = (res * x) % md;
        x = (x * x) % md;
        y >>= 1;
    }
    return res;
}

inline void add(long long &x, const int y) {
    x += y;
    if (x >= md) x -= md;
    return;
}

int main(int argc, const char * argv[]) {
#ifdef __APPLE__
    freopen("/Users/danya.smelskiy/Documents/Danya/Resources/input.txt","r",stdin);
#endif
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= n; ++i)
        cin >> a[i];
    for (int i = 1; i <= n; ++i)
        cin >> b[i];
    for (int i = 0; i <= 400; ++i) {
        for (int j = 1; j <= 400; ++j) {
            s[i][j] = s[i][j - 1];
            add(s[i][j], pw(j, i));
        }
    }
    dp[0][0] = 1;
    long long cur, cur2;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= m; ++j) {
            for (int k = 0; k <= j; ++k) {
                cur = dp[i - 1][j - k];
                cur2 = s[k][b[i]] - s[k][a[i] - 1];
                if (cur2 < 0) cur2 += md;
                cur *= cur2;
                cur %= md;
                add(dp[i][j], cur);
            }
        }
    }
    cout << dp[n][m] << '\n';
    return 0;
}



Measured memory_bytes: 2816
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int main(){
IOS;
int a,b,c,k,flag=0;
cin>>a>>b>>c>>k;
    for(int i=0;i<k;i++){
        if(a<b*pow(2,i)&&a<c*pow(2,k-i)&&b*pow(2,i)<c*pow(2,k-i)){
            flag=1;
            break;
        }
    }
    if(flag==1)
        cout<<"Yes"<<"\n";
    else
        cout<<"No\n";
return 0;
}


Measured memory_bytes: 4024
int main(void)
{
    int n,i;
    scanf("%d",&n);
    
    int r[3];
    
    for(i = 0;i < n;i++){
    	scanf("%d %d %d",&r[0],&r[1],&r[2]);
	    if(r[0]*r[0]+r[1]*r[1] == r[2]*r[2])printf("YES\n");
    	else if(r[1]*r[1]+r[2]*r[2] == r[0]*r[0])printf("YES\n");
    	else if(r[2]*r[2]+r[0]*r[0] == r[1]*r[1])printf("YES\n");
    	else printf("NO\n");
    }
    return 0;
}

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

typedef long long ll;

int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  for(int i=0; i<N; i++) cin >> d[i];
  int cnt=0;
  for(int i=0; i+2<N; i++){
    if(max(d[i], d[i+2])>d[i+1] && min(d[i], d[i+2])<d[i+1]) cnt++;
  }
  cout << cnt <<endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define  pb push_back
#define nl "\n"
#define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL);
using namespace std;
vector<int>adj[123456];
int indeg[123456];
int dp[123456];
vector<int>topo;
queue<int>q;
int main()
{
	fastScan;
	int n,m;cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		int x,y;cin>>x>>y;
		adj[x].pb(y);
		indeg[y]++;
	}
	for(int i=1;i<=n;i++)
	{
		if(indeg[i]==0)
			q.push(i);
	}
	while(!q.empty())
	{
		int v1=q.front();
		q.pop();
		topo.pb(v1);
		for(int i=0;i<adj[v1].size();i++)
		{
			int a1=adj[v1][i];
			indeg[a1]--;
			if(indeg[a1]==0)
				q.push(a1);
		}
	}
	int rt=topo[0],ans=0;
	dp[rt]=0;
	for(auto x:topo)
	{
		for(int i=0;i<adj[x].size();i++)
		{
			int a1=adj[x][i];
			dp[a1]=max(dp[a1],dp[x]+1);
			ans=max(ans,dp[a1]);
		}
	}
	cout<<ans<<nl;
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, a[2][101], dp[2][101];

int main() {
	cin >> n;
	inc(i, 2) {
	inc1(j, n) {
		cin >> a[i][j];
	}
	}
	
	inc1(j, n) {
		dp[0][j] =     dp[0][j - 1]            + a[0][j];
		dp[1][j] = max(dp[1][j - 1], dp[0][j]) + a[1][j];
	}
	
	cout << dp[1][n] << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define fst first
#define scd second
signed main()
{
	int n, m = 0, a[200000], ans[200000];
	scanf("%d", &n);
	for(int i = 0; i < n; ++i)
	{
		scanf("%d", &a[i]);
	}
	for(int i = 0; i < n - 2; ++i)
	{
		m ^= a[i];
	}
	ans[n - 1] = m ^ a[n - 2];
	for(int i = 0; i < n - 1; ++i)
	{
		ans[i] = a[i] ^ a[n - 1] ^ ans[n - 1];
	}
	for(int i = 0; i < n; ++i)
	{
		printf("%d ", ans[i]);
	}
	printf("\n");
}


Measured memory_bytes: 5380
def e_crested_ibis_vs_monster():
    H, N = [int(i) for i in input().split()]
    Damage, Cost = [], []
    for _ in range(N):
        a, b = [int(i) for i in input().split()]
        Damage.append(a)
        Cost.append(b)

    # dp[i][j]: 最初の i 種類の魔法でモンスターに j ダメージ与える場合の消費魔力の最小値
    dp = [[float('inf')] * (H + 1) for _ in range(N + 1)]
    dp[0][0] = 0
    for i in range(N):
        for j in range(H + 1):
            # i 番目の魔法を使わない場合
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
            # i 番目の魔法を使う場合
            dp[i + 1][min(j + Damage[i], H)] = min(dp[i + 1][min(j + Damage[i], H)],
                                                   dp[i + 1][j] + Cost[i])
    return dp[N][H]

print(e_crested_ibis_vs_monster())

Measured memory_bytes: 286344
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define mod 1000000007
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define inp_vecN for(int i=0;i<n;i++)cin>>v[i]; 
vector<int> get_Factors(ll n)
{
      vector <int> v;
      for(ll i=2; i<=sqrt(n)+1; i++)
      {
            if(n%i==0)
            {
                  v.push_back(i);
                  v.push_back(n/i);
            }
      }

      v.push_back(1);

      return v;
}
string get_bin(ll n)
{
    string s = "";
    while(n > 0)
    {
        s += ('0' + n%2);
        n /= 2;
    }
    reverse(s.begin(), s.end());
    return s;
}

ll bin_to_dec(string s)
{
    ll ans = 0;
    for(auto ch: s)
    {
        ans *= 2;
        ans += (ch - '0');
    }
    return ans;
}
void PrintVector(vector<ll> v,int n)
{

    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<" ";
    }
    cout<<endl;
}
int no_of_primeFactors(int n)  
{ 
    int count=0;
    while (n % 2 == 0)  
    {  
        count++;
        n = n/2;  
    }  
   
    for (int i = 3; i <= sqrt(n); i = i + 2)  
    { 
        while (n % i == 0)  
        {  
           count++;
            n = n/i;  
        }  
        
    }  
    if (n > 2)  
        count++;
    return count;
} 
 ll gcd(int a, int b)
{ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
} 
   
  ll lcm(int a, int b)  
{  
    return (a/gcd(a, b)*b);  
}  



ll pwr(ll base,ll expo,ll m)
{
    if(base==0) return 0LL;
    if(expo==0) return (1LL%m);
    if((expo&1)==0) {ll temp=pwr(base,expo>>1,m); return (temp*temp)%m;}
    return ((base%m)*pwr(base,expo-1,m))%m;
}

int main(int argc, char const *argv[])
{
    ios;

    int a,b,c,k;
    cin>>a>>b>>c>>k;
    ll sum=0;
    while(k>0)
    {
      if(k>=a)
      {
            sum+=a;
            
            k=k-a;
            a=0;
      }
      else
      {
            sum=k;
            break;
      }
      if(k==0)
            break;


     // cout<<"k="<<k<<" sum="<<sum<<endl;
      if(k>=b)
      {
            
            k=k-b;
            b=0;
      }
      else
      {
            break;
      }

      if(k==0)
            break;

      if(c>=k)
      {
            sum=sum-k;
            k=0;
            break;
      }
      else
      {
            sum=sum-c;
            break;
      }
    }

    cout<<sum;
    





    



    return 0;
}

Measured memory_bytes: 3672
using System;
using System.Linq;

namespace AtCoder.Abc
{
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            long k = long.Parse(Console.ReadLine());

            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            var a = inputLongArray[0];
            var b = inputLongArray[1];

            var ba = a == (a / k * k);
            var bb = b == (b / k * k);
            var bc = (a / k) != (b / k);

            Console.WriteLine((ba||bb|bc)?"OK":"NG");

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 28252
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>

char S[11];

int main()
{
	scanf("%s", S);
	for(int i=0; i<strlen(S); i+=2)
	{
		if(S[i] == 'h')
		{
			if(S[i+1] != 'i')
			{
				printf("No");
				return 0;
			}
		}
		else
		{
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}

Measured memory_bytes: 256
n = int(input())
l = list(map(int, input().split()))

for i in range(n):
    if l[i] > i+1:
        print(-1)
        exit()

ans = []
while len(l) > 0:
    for i, x in enumerate(l[::-1]):
        if len(l) - i == x:
            ans.append(x)
            l.pop(len(l)-i-1)
            break
for i, x in enumerate(ans[::-1]):
    print(x)



Measured memory_bytes: 9188
import java.util.*;
import java.math.BigInteger;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    BigInteger A = sc.nextBigInteger();
    BigInteger B = sc.nextBigInteger();
    
    if(B.compareTo(A)<0){
      System.out.println("GREATER");
    }else if(B.compareTo(A)>0){
      System.out.println("LESS");
    }else if(A.compareTo(B)==0){
      System.out.println("EQUAL");
    }
  }
}   

Measured memory_bytes: 23636
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	long A,B;
	int N;
	public void solve() {
		A = nextLong();
		B = nextLong();
		N = nextInt();

		long ans = Math.abs(A - B);
		for(int i = 1;i <= N;i++){
			for(int j = 1;j <= N;j++){
				if(i * B % j != 0)continue;
				ans = Math.min(ans, Math.abs(A - i * B / j));
			}
		}

		out.println(ans);

	}

	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

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

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef set<ll> si;
typedef map<string, ll> msi;
#define hell 1000000007
#define MAX 1000000000
#define max_int 1000000
#define F first
#define re 15000000
#define S second
#define pb push_back
#define all(a)  (a).begin(),(a).end()
#define rep(i,a,b) for(ll i = a;i<b;i++)
#define pi 3.1415926536
#define r0 return 0
#define rep(i,a,b) for(ll i = a;i<b;i++)


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

    string s,t;
    cin>>s>>t;
    if(t.substr(0,t.size()-1)==s)  
        cout<<"Yes";
    else cout<<"No";

    r0;
}
 

Measured memory_bytes: 3648
{-# LANGUAGE BangPatterns #-}

module Main
  ( main
  )
where

import           Control.Applicative
import           Control.Monad
import           Data.Bits
import qualified Data.ByteString.Char8         as BS
import           Data.Char
import           Data.List
import           Data.Maybe
import qualified Data.Vector                   as V
import qualified Data.Vector.Mutable           as MV
import           Control.Monad.ST
import           Data.Ord
import qualified Data.Vector.Unboxed           as UV

parse = fst . fromJust
parseInt = parse . BS.readInt
parseInteger = parse . BS.readInteger
readInt = parseInt <$> BS.getLine
readInteger = parseInteger <$> BS.getLine
readIntList = map parseInt . BS.words <$> BS.getLine
readIntegerList = map parseInteger . BS.words <$> BS.getLine

main = do
  [n, m] <- readIntList
  arr <- readIntList
  let threshold = (sum arr + 4 * m - 1) `div` (4 * m)
      selected = length . filter (>= threshold) $ arr
  putStrLn $ if selected >= m then "Yes" else "No"



Measured memory_bytes: 508
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;

int main() {
    int N, M;
    cin >> N;
    map<string, int> m;
    for (int i = 0; i < N; i++) {
        string s;
        cin >> s;
        m[s]++;
    }
    cin >> M;
    for (int i = 0; i < M; i++) {
        string s;
        cin >> s;
        m[s]--;
    }
    int ans = 0;
    for (auto p : m) {
        chmax(ans, p.second);
    }
    cout << ans << endl;
}


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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define Yes "Yes"
#define No "No"
#define YES "YES"
#define NO "NO"

int main()
{
int N, M;
	map<int, int> K;
	cin >> N;
	fx(N) {
		int d;
		cin >> d;
		K[d]++;
	}
	cin >> M;
	bool flag = true;
	fx(M) {
		int t;
		cin >> t;
		if (K[t]>0) {
			K[t]--;
		}
		else {
			flag = false;
			break;
		}
	}
	if (flag) {
		ce(YES)
	}
	else {
		ce(NO)
	}
    return 0;
}



Measured memory_bytes: 9600
#ifdef Prateek
  #include "Prateek.h"
#else
  #include <bits/stdc++.h>
  using namespace std;
  #define debug(...) 42
#endif
#define F first
#define S second
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define int ll
using ll = long long;
const int MOD = 1e9+7, N = 1e6 + 10; 

int prime[N];
int done[N];

int32_t main(){
   ios::sync_with_stdio(false);
   cin.tie(NULL);
   for(int i = 2; i < N; ++i){
      if(prime[i] == 0){
         prime[i] = i;
         for(int j = i*i; j < N; j += i){
            prime[j] = i;
         }
      }
   }
   int n;
   cin >> n;
   vector<int> A(n);
   for(int i = 0; i < n; ++i){
      cin >> A[i];
   }
   int chk = 1;
   for(int i = n-1; i >= 0; --i){
      int v = A[i];
      // vector<int> R;
      while(prime[v]){
         // R.push_back(prime[v]);
         if(done[prime[v]]) break;
         v /= prime[v];
      }
      // debug(R);
      if(v != 1){
         chk = 0;
         break;
      }      
      v = A[i];
      while(prime[v]){
         done[prime[v]] = 1;
         v /= prime[v];
      }
   }
   if(chk){
      cout << "pairwise coprime\n";
      return 0;
   }
   int gc = A[0];
   for(int i = 1; i < n; ++i){
      gc = __gcd(gc,A[i]);
   }
   if(gc == 1){
      cout << "setwise coprime\n";
   }else{
      cout << "not coprime\n";
   }

   return 0;
} 

Measured memory_bytes: 19496
#include <stdio.h>

int main(void){
   int x, y, n, i, j, k;

   do {
      scanf("%d %d", &n, &x);


      if (n == 0&&x == 0){
         break;
      }

   y = 0;

   for(i = 1; i <= n; i++) {
      for(j = i + 1; j <= n; j++) {
         for(k = j + 1; k <= n; k++) {
            if (i + j + k == x){
               y++;
            }
         }
      }
   }



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

   } while(n != 0||x != 0);

   return 0;
}




Measured memory_bytes: 2060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		String oct;
		StringBuilder sb;
		while (!(line = br.readLine()).equals("0")) {
			oct = Integer.toOctalString(Integer.parseInt(line));
			sb = new StringBuilder();
			for (char c : oct.toCharArray()) {
				if (c == '4')
					sb.append('5');
				else if (c > '4')
					sb.append((char) ((int) c + 2));
				else
					sb.append(c);
			}
			System.out.println(sb.toString());
		}
	}
}

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

struct Card { char suit, value; };

void bubble(struct Card A[], int N) {
  for(int i = 0; i < N; i++) {
    for(int j = N - 1; j > i; j--) {
      if (A[j - 1].value > A[j].value) {
        swap(A[j - 1], A[j]);
      }
    }
  }
}

void selection(struct Card A[], int N) {
  for(int i = 0; i < N; i++) {
    int minj = i;
    for(int j = i; j < N; j++) {
      if (A[j].value < A[minj].value) minj = j;
    }
    swap(A[i], A[minj]);
  }
}

void print(struct Card A[], int N) {
  for(int i = 0; i < N; i++) {
    if (i > 0) cout << " ";
    cout << A[i].suit << A[i].value;
  }

  cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int N) {
  for(int i = 0; i < N; i++) {
    if (C1[i].suit != C2[i].suit) return false;
  }
  return true;
}

int main() {
  Card C1[100], C2[100];
  int N;
  char ch;

  cin >> N;

  for(int i = 0; i < N; i++) {
    cin >> C1[i].suit >> C1[i].value;
  }

  for ( int i = 0; i < N; i++) C2[i] = C1[i];

  bubble(C1, N);
  selection(C2, N);

  print(C1, N);
  cout << "Stable" << endl;

  print(C2, N);
  if (isStable(C1, C2, N)) {
    cout << "Stable" << endl;
  } else {
    cout << "Not stable" << endl;
  }

  return 0;
}


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

using i64 = int64_t;

int main(){
    int n;
    cin >> n;
    vector<int> v;
    for(int i=0;i<n;++i){
        int tmp;
        cin >> tmp;
        v.push_back(tmp);
    }
    int ans = 1e9;
    for(int i=1;i<=100;++i){
        int sum = 0;
        for(auto e: v){
            sum += (e-i)*(e-i);
        }
        ans = min(ans, sum);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<set>
#include <bitset>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string>
#include<string.h>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
#include <limits>
#include <numeric>
#include <type_traits>
#define int long long
#define ll long long
#define mod  1000000007
#define inf 1e17
#define rep(i,j,n) for(int i=j;i<n;i++)
#define P pair<int,int>
double pi = 3.141592653589793;
using namespace std;
//ここから始めよう
signed main(){
    int x,y;cin>>x>>y;
    int h=y/x;
    int ans=0;
    while(h){
        ans++;h=h/2;
    }cout<<ans<<endl;
    return 0;
}

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

int main() {
    int H,W,D;
    cin >> H >> W >> D;
    vector<pair<int, int>> A(H * W + 1);
    int a;
    for(int h = 1; h <= H; h++)
    {
        for(int w = 1; w <= W; w++)
        {
            cin >> a;
            A.at(a) = make_pair(h, w);
        }
    }
    
    vector<vector<long long>> sum(D, vector<long long>(1)); 
    long long s;
    a = 1;
    long long magic;
    for(int d = 0; d < D; d++)
    {
        s = 0;
        int ai = a;
        while (ai + D <= (H * W)) {
            magic = abs(A.at(ai).first - A.at(ai + D).first) + abs(A.at(ai).second - A.at(ai + D).second);
            s += magic;
            sum.at(d).push_back(s);
            ai += D;
        }
        a++;
    }
    
    int Q;
    cin >> Q;
    int l, r;
    long long ans;
    for(int q = 0; q < Q; q++)
    {
        cin >> l >> r;
        int ri = r / D;
        int li = l / D;
        if (r % D == 0) {
            ri--;
            li--;
        } 
        ans = sum.at(((l % D) + (D - 1)) % D).at(ri) - sum.at(((l % D) + (D - 1)) % D).at(li);
        
        cout << ans << endl;
    }
    
}

Measured memory_bytes: 6016
#include<bits/stdc++.h>
#define mn(a,b) (a<b?a:b)
#define LL long long
LL ans,n,a,b,i,x[100001];
int main()
{
	
	scanf("%lld%lld%lld",&n,&a,&b);
	for(i=1;i<=n;i++)scanf("%lld",&x[i]);
	for(i=2;i<=n;i++)
		ans+=mn((x[i]-x[i-1])*a,b);
	printf("%lld\n",ans);
}

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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





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






int main()
{
    FAST();

//    freopen("input.txt","r",stdin);
//    freopen("input.txt","w",stdout);

    LL n;
    cin >> n;
    cout << (n*(n-1))/2;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int x,y,i,a,b,ans[31];
	scanf("%d%d",&x,&y);
	for(i=1;i<=x;i++)
		ans[i]=i;
	for(i=0;i<y;i++)
	{
		scanf("%d,%d",&a,&b);
		ans[a]^=ans[b];
		ans[b]^=ans[a];
		ans[a]^=ans[b];
	}
	for(i=1;i<=x;i++)
		printf("%d\n",ans[i]);
	return 0;
}

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

int main(){
  char b[100100];
  int a,c=0;
  cin >> a ;
  for(int i=0;i<a;i++){
    cin >> b[i];
  }
  for(int i=0;i<a;i++){
    if(b[i]!=b[i+1]){
      c=c+1;   
    }
  }

  cout << c << endl;
}

Measured memory_bytes: 384
import math


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


numbers = input().split()

evens, odds = int(numbers[0]), int(numbers[1])

# result is even if picked [even, even], [odd, odd]
combs = 0
for i in [evens, odds]:
    if i >= 2:
        combs += combinations_count(i, 2)
print(combs)

Measured memory_bytes: 3060
import java.util.Scanner;


public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] cnt = new int[N+1];
        int temp = 0;

        for (int i = 1; i <= 100; i++) {
            for (int j = 1; j <= 100; j++) {
                for (int k = 1; k <= 100; k++) {
                    temp = i * i + j * j + k * k + i * j + j * k + k * i;
                    if (temp > N) {
                        continue;
                    }
                    cnt[temp]++;
                }
            }
        }

        for (int i = 1; i <= N; i++) {
            System.out.println(cnt[i]);
        }
    }

}


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

int main()
{
    int m1,d1,m2,d2;

    cin >> m1 >> d1 >> m2 >> d2;

    if(d2==1) cout << 1;

    else cout << 0;



    return 0;
}


Measured memory_bytes: 256
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const a = parseInt(args[0][0], 10)
	const b = parseInt(args[0][1], 10)
	if (b % a === 0) console.log(a + b)
	else console.log(b - a)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 21064
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int vetor[110];
    int n;
    
    cin>>n;
    int i = 0;
    for(i; i<n; i++){
        cin>>vetor[i];
    }
    
    sort(vetor,vetor+n);
    cout<<vetor[n-1]-vetor[0]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    double a,b,c,C,s;
    cin>>a>>b>>c;
    C=c/180*acos(-1);
    s=a*b*sin(C)/2;
    printf("%.5f\n%.5f\n%.5f\n",s,a+b+sqrt(a*a+b*b-2*a*b*cos(C)),2*s/a);
}


Measured memory_bytes: 3536
import math

def is_prime(x):
    if x < 2: return False # 2未満に素数はない
    if x == 2 or x == 3 or x == 5: return True # 2,3,5は素数
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False # 2,3,5の倍数は合成数

    # ためし割り: 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True
	

N = int(input())
count = 0
a_list = []

for i in range(5550):
	a = 10 * i + 1
	if is_prime(a):
		a_list.append(a)
		count += 1
		if count == N:
			break

print (' '.join(map(str, a_list)))

Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<set>
#include<algorithm>
#include<utility>
#include<map>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1001001001;

ll pow_mod(ll p, ll n, ll m) {
	if (n == 0) return 1;
	else if (n == 1) return p % m;
	else if (n % 2 == 1) return p * pow_mod(p, n - 1, m) % m;
	else {
		ll tmp = pow_mod(p, n / 2, m);
		return (tmp * tmp) % m;
	}
}

ll gcd(ll x, ll y) {
	if (y == 0) {
		return x;
	}
	return gcd(y, x % y);
}

ll com_mod(ll n, ll k, ll m) {
	if (k == 0) return 1;
	else {
		ll x = 1;
		ll y = 1;
		for (ll i = 0; i < k; i++) {
			x = (x * (n - i)) % m;
			y = (y * (i + 1)) % m;
		}
		ll res = (x * pow_mod(y, m - 2, m)) % m;
		return res;
	}
}

int main() {
	ll n; cin >> n;
	ll ans = n;
	while (1) {
		if (ans % 2 == 0 && ans % n == 0) {
			cout << ans << endl;
			return 0;
		}
		else {
			ans += n;
		}
	}
	return 0;
}

Measured memory_bytes: 3616
#include <iostream>
using namespace std;
int main()
{
	int a[100],i,j;
	cin >> i;
	for (j = 0; j < i; j++) {
		cin >> a[j];
	}

	for (j = i - 1; 0 <= j; j--) {
		cout << a[j];
		if (j != 0) {
			cout << ' ';
		}
	}
	cout << endl;
    return 0;
}

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

using namespace std;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int x;
    for(int i =1 ; i <= 5; i++){
        cin >> x;
        if(x == 0)
            cout << i;
    }

}

Measured memory_bytes: 3596
import std.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

void main() {
    const EPS = 1e-9;
    int a, b, c, d, e, f;
    while (true) {
        if (stdin.eof) break;
        scanf("%d %d %d %d %d %d\n", &a, &b, &c, &d, &e, &f);
        double z = 1.0 / (a * e - b * d);
        double x = (e * c - b * f) * z + EPS;
        double y = (-d * c + a * f) * z + EPS;
        writefln("%.3f %.3f", x, y);
    }
    
}

Measured memory_bytes: 1120
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>

using namespace std;

int main(){

  int N, Q; cin >> N >> Q;

  vector < vector<int> > graph(N);

  for (int i = 0; i < N - 1; i++){
    int a, b; cin >> a >> b; 
    a--; b--;
    graph[a].push_back(b);
  }
  
  vector <int> ans(N);
  for (int i = 0; i < Q; i++){
    int p, x; cin >> p >> x; p--;
    ans[p] = ans[p] + x;
  }

  for (int i = 0; i < N; i++){
      for (int j = 0; j < graph[i].size(); j++){
        ans[graph[i][j]] = ans[graph[i][j]] + ans[i];
      }
  }
  
  for (int i = 0; i < N; i++){
    cout << ans[i];
    if (i != N - 1) cout << " ";
    else cout << endl;
  }
  

  return 0;
}


Measured memory_bytes: 14080
import sys
N = int(input())
if N == -1:
  print('11')
  sys.exit()
if N == 0:
  print('0')
  sys.exit()
if N == 1:
  print('1')
  sys.exit()

def num(N):
  mi = 0
  ma = 1
  k = 1
  while mi > N or ma < N:
    mi = min(mi,mi+(-2)**k)
    ma = max(ma,ma+(-2)**k)
    k += 1
  return k-1
rem = 0
ansli = []
def ans(N):
  while abs(N)>0:
    ansli.append(num(N))
    N = N-(-2)**num(N)
  return ansli

ans(N)
answer = ''
m = max(ansli)
while m >= 0:
  if m in ansli:
    answer += '1'
  else:
    answer += '0'
  m += -1
  
print(answer)

Measured memory_bytes: 3064
#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
ll a,b,c,k;
ll pos;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	cin>>a>>b>>k;
	c=gcd(a,b);
	for(int i=c;i>0;i--){
		if(c%i==0)pos++;
		if(pos==k){
			cout<<i;
			return 0;
		}
	}
	return 0;
}



Measured memory_bytes: 256
n = int(input())
data = list(map(int, input().split()))

nb_exchange = 0
for i in range(n):
    minj = i
    for j in range(i, n):
        if data[j] < data[minj]:
            minj = j

    if i != minj:
        nb_exchange += 1
        data[i], data[minj] = data[minj], data[i]

print(" ".join(map(str, data)))
print(nb_exchange)

Measured memory_bytes: 7672
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

// 2のx乗をmodで割る
long powermod(long x, long mod) {
  if (x == 0) return 1;
  if (x == 1) return 2;
  else return 2 * powermod((x-1), mod) % mod;
}

int main() {
  int N;
  int A[100000], tb[100000] = {0};
  cin >> N;
  for (int i = 0; i < N; i++) {
    int input_num;
    cin >> input_num;
    tb[input_num]++;
  }

  if (N % 2 == 0) {
    // 偶数
    for (int i = 0; i < N; i++) {
      if ((i % 2 == 1 && tb[i] != 2) || (i % 2 == 0 &&tb[i] != 0) ) {
        cout << 0 << endl;
        return 0;
      }
    }
  } else {
    // 奇数
    if (tb[0] != 1) {
        cout << 0 << endl;
        return 0;
    }
    for (int i = 1; i < N; i++) {
      if ((i % 2 == 0 && tb[i] != 2) || (i % 2 == 1 && tb[i] != 0) ) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  cout << powermod(N/2, MOD) << endl;
  return 0;
}


Measured memory_bytes: 1536
#include<cstdio>
#include<string>
#include<cstring>
#include<utility>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<algorithm>
#include<vector>
#include<iostream>
#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define inf 0x7fffffff
using namespace std;
int main()
{
	int i,j,k,n,m,x,y;
	scanf("%d%d",&n,&m);
	if(n<=5)
	{
		printf("0");
	}
	else if(n<13)
	{
		printf("%d",m/2);
	}
	else
	{
		printf("%d",m);
	}
	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;

int main() {
  int64 n, m;
  scanf("%lld%lld", &n, &m);
  int64 sum = n - m;
  int64 ret = 1LL << 60;
  if (n == m) ret = min(ret, n + 1);
  for (int64 p = 1; p * p <= sum; ++p) {
    if (sum % p == 0) {
      int64 b = p + 1;
      int64 x = sum / p, y = m - x;
      if (y == n % b && x == n / b &&
          x >= 0 && x < b &&
          y >= 0 && y < b) {
        ret = min(ret, b);
      }
      b = sum / p + 1;
      x = p, y = m - x;
      if (y == n % b && x == n / b &&
          x >= 0 && x < b &&
          y >= 0 && y < b) {
        ret = min(ret, b);
      }
    }
  }
  for (int64 b = 2; b * b <= n; ++b) {
    int64 sum = 0;
    for (int64 k = n; k; k /= b) sum += k % b;
    if (sum == m) {
      ret = min(ret, b);
    }
  }
  if (ret == 1LL << 60) ret = -1;
  printf("%lld\n", ret);
  return 0;
}


Measured memory_bytes: 256
fn main() {
    let mut sc = cin();
    while sc.read() {
        println!("{}", (sc.next::<i32>() + sc.next::<i32>()) % 24)
    }
}

#[allow(dead_code)]
fn cin() -> Scanner<std::io::Stdin> {
    Scanner::new(std::io::stdin())
}

#[allow(dead_code)]
pub struct Scanner<T> {
    buf: Vec<u8>,
    len: usize,
    idx: usize,
    next: Option<String>,
    reader: T,
}

#[allow(dead_code)]
impl<Reader: std::io::Read> Scanner<Reader> {
    fn new(r: Reader) -> Scanner<Reader> {
        Scanner {
            buf: vec![0; 8192],
            len: 0,
            idx: 0,
            next: None,
            reader: r,
        }
    }

    fn next<T: std::str::FromStr>(&mut self) -> T {
        self.wrapped::<T>().unwrap()
    }

    fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next()).collect()
    }

    fn mat<T: std::str::FromStr>(&mut self, r: usize, c: usize) -> Vec<Vec<T>> {
        (0..r).map(|_| self.vec(c)).collect()
    }

    fn vec_char(&mut self) -> Vec<char> {
        self.read();
        self.next.take().unwrap().chars().collect()
    }

    fn mat_char(&mut self, r: usize) -> Vec<Vec<char>> {
        (0..r).map(|_| self.vec_char()).collect()
    }

    fn wrapped<T: std::str::FromStr>(&mut self) -> Option<T> {
        self.read();
        self.next.take().and_then(|s| s.parse::<T>().ok())
    }

    fn read(&mut self) -> bool {
        if self.next.is_some() {
            return true;
        }
        let mut s = String::with_capacity(16);
        while let Some(c) = self.get_char() {
            if !c.is_whitespace() {
                s.push(c);
            } else if !s.is_empty() {
                break;
            }
        }
        self.next = if !s.is_empty() { Some(s) } else { None };
        self.next.is_some()
    }

    fn get_char(&mut self) -> Option<char> {
        if self.idx == self.len {
            match self.reader.read(&mut self.buf[..]) {
                Ok(l) if l > 0 => {
                    self.idx = 0;
                    self.len = l;
                }
                _ => return None,
            }
        }
        self.idx += 1;
        Some(self.buf[self.idx - 1] as char)
    }
}


Measured memory_bytes: 4352
function main(input) {
    const args = input.split('');
    const sen = args[0];
    const hyaku = args[1];
    const jyu = args[2];
    const ichi = args[3];

    if (sen === hyaku) {
        if (hyaku === jyu) {
            console.log('Yes');
        } else {
            console.log('No');
        }
    } else if (hyaku === jyu) {
        if (jyu === ichi) {
            console.log('Yes');
        } else {
            console.log('No');
        }
    } else {
        console.log('No');
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

using namespace std;
using ll = unsigned long long int;

int main()
{
    double x;
    cin >> x;

    double current = 100;
    int year = 0;
    while (true)
    {
        year++;
        current = floor(current * 101 / 100);
        if (current >= x)
        {
            cout << year << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;


int main() {
  vector<int> a(3);
  rep(i,3) cin >> a[i];
  sort(all(a));
  if (a[0]==a[1] && a[1]==a[2]) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256