akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define double long double
#define rep(i, a, n) for(int i = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int i = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int i = (int)(a);(x);++(i))
#define repr(i, a, n) for(int i = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int i = (int)(a);(i) >= (int)(n);--(i))
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), end(x))
#define gcd(x, y) __gcd(x, y)
#define lcm(x, y) ((x)/gcd(x,y)*(y))
#define isin(x, l, r) ((l) <= (x) and (x) < (r))
#define fcout(n) cout << fixed << setprecision(n)
#define rcout(n) cout << right << setw(n)
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define PI (acosl(-1))
#define EPS (1e-10)
#define INF LLONG_MAX
#define INF32 INT32_MAX
#define MOD 1000000007LL
using namespace std;
using VI = vector<int>;
using PII = pair<int, int>;
using TIII = tuple<int, int, int>;
using VPII = vector<PII>;
using VTIII = vector<TIII>;
using Complex = complex<double>;
template<typename T, template<typename> typename C = less> using PQ = priority_queue<T, vector<T>, C<T>>;
template<typename T> inline bool chmax(T& a, const T& b, bool t = false){ if(a<b or (t and a == b)){ a=b; return true; } return false; }
template<typename T> inline bool chmin(T& a, const T& b, bool t = false){ if(a>b or (t and a == b)){ a=b; return true; } return false; }


signed main(){
    int q;
    cin >> q;
    while(q--){
        string X, Y;
        cin >> X >> Y;
        vector<VI> dp(SZ(X)+1, VI(SZ(Y)+1));
        rep(i, 0, SZ(X)) rep(j, 0, SZ(Y)){
            if(X[i] == Y[j]) dp[i+1][j+1] = dp[i][j]+1;
            else chmax(dp[i+1][j+1], max(dp[i+1][j], dp[i][j+1]));
        }
        cout << dp[SZ(X)][SZ(Y)] << endl;
    }

    return 0;
}


Measured memory_bytes: 10784
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	ro := make([]pii, n)
	for i := 0; i < n; i++ {
		ro[i] = pii{scanInt(), scanInt()}
	}
	sort.Slice(ro, func(i, j int) bool { return ro[i].x < ro[j].x })

	f := make([]int, n)
	seg := segmentTreeInit(n)
	for i := 0; i < n; i++ {
		f[i] = sort.Search(n, func(idx int) bool { return ro[i].x+ro[i].d <= ro[idx].x })
		seg.update(i, f[i])
	}

	for i := 0; i < n; i++ {
		seg.update(i, f[i])
	}

	dp := make([]int, n+1)
	dp[n] = 1
	for i := 0; i < n; i++ {
		r := seg.query(n-1-i, f[n-1-i], 0, 0, seg.n)
		seg.update(n-1-i, r)
		dp[n-1-i] = dp[n-i] + dp[r]
		dp[n-1-i] %= mod
	}
	fmt.Fprintln(wr, dp[0])
}

const mod = 998244353

type pii struct{ x, d int }

type segmentTree struct {
	arr []int
	n   int
}

func segmentTreeInit(a int) segmentTree {
	n := 1
	for n < a {
		n <<= 1
	}
	res := segmentTree{make([]int, 2*n-1), n}
	return res
}

func (st segmentTree) update(k, a int) {
	k += st.n - 1
	st.arr[k] = a
	for k > 0 {
		k = (k - 1) / 2
		st.arr[k] = max(st.arr[2*k+1], st.arr[2*k+2])
	}
}

func (st segmentTree) query(a, b, k, l, r int) int {
	if r <= a || b <= l {
		return 0
	}
	if a <= l && r <= b {
		return st.arr[k]
	}
	return max(st.query(a, b, 2*k+1, l, (l+r)/2), st.query(a, b, 2*k+2, (l+r)/2, r))
}


Measured memory_bytes: 15004
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <float.h>
#include <random>

#define repeat(i,n) for (ll i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'
#define debugArrayP(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge].first<< " " << x[hoge].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = LLONG_MAX/10;
const ll MOD = 1e9+7;

template <ll mod>
struct ModCombination{
    ll N;
    vector<ll> fact,inv,finv;

    ModCombination(ll n):N(n){
        fact.assign(n+1, 1);
        inv.assign(n+1, 1);
        finv.assign(n+1,1);
        for(int i=1;i<n;i++){
            fact[i+1] = fact[i]*(i+1)%mod;
            inv[i+1] = inv[mod%(i+1)]*(mod-mod/(i+1))%mod;
            finv[i+1] = finv[i]*inv[i+1]%mod;
        }
    }

    ll Comb(ll n,ll k){
        if(k<0||n<k)return 0;
        return (fact[n]*finv[k]%mod)*finv[n-k]%mod;
    }
};

ll extgcd(ll a, ll b, ll &x, ll &y) {
    ll g = a; x = 1; y = 0;
    if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
    return g;
}

ll invMod(ll a, ll m) {
    ll x, y;
    if (extgcd(a, m, x, y) == 1) return (x + m) % m;
    else                         return 0; // unsolvable
}


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N,M,K;cin>>N>>M>>K;
  ModCombination<MOD> C(N*M);
  ll ans=0;
  repeat(i,N){
    repeat(j,M){
      ll a = ((((((N*(((j*(j+1))%MOD+((M-j-1)*(M-j))%MOD)%MOD))%MOD+(M*(((i*(i+1))%MOD+((N-i-1)*(N-i))%MOD))%MOD)%MOD)%MOD))%MOD))%MOD;
      //debug(a);
      ans = (ans+a)%MOD;
    }
  }
  ans = (ans*invMod(4,MOD))%MOD;
  ans =(ans*C.Comb(N*M-2,K-2))%MOD;
  cout<<ans<<endl;
  return 0;
}


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

int main(){
  int N;
  cin >> N;

  vector<int> A(N);
  for(auto& x: A){
    cin >> x;
  }

  long long ans = 1;
  for(int i = 0; i < N; i++){
    ans *= 3;
  }
  long long ans_comp = 1;
  for(auto x: A){
    if(x % 2 == 0){
      ans_comp *= 2;
    }
  }
  cout << ans - ans_comp << endl;
}



Measured memory_bytes: 256
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int N, K;
  int count=0;
  cin >> N;
  cin >> K;
  vector<int> h(N);
  REP(i,N) cin >> h[i];
  REP(i,N) if(h[i]>=K) ++count;
  cout << count << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int,int> P;

int main() {
  int n;
  cin>>n;
  int p[50];
  for (int i=0; i<n; i++) {
    cin>>p[i];
  }
  int cnt=0;
  for (int i=1; i<n-1; i++) {
    if (p[i-1]<p[i]&&p[i+1]>p[i]||p[i+1]<p[i]&&p[i-1]>p[i]) cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	var (
		a = ReadLineInt()[0]
		s = ReadLine()
	)

	if a >= 3200 {
		fmt.Println(s)
	} else {
		fmt.Println("red")
	}
}

/////////////////////////////////////////

func fln(format string, elements ...interface{}) {
	fmt.Printf(format+"\n", elements...)
}

var BufReader = bufio.NewReaderSize(os.Stdin, 1e6)

func ReadLine() string {
	a, _, _ := BufReader.ReadLine()
	return string(a)
}

func ReadLineInt() (result []int) {
	in := strings.Split(ReadLine(), " ")
	result = make([]int, 0, 2)
	for _, v := range in {
		t, _ := strconv.Atoi(v)
		result = append(result, t)
	}
	return
}

Measured memory_bytes: 640
import math
import sys


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


input = sys.stdin.readline

N, K = map(int, input().strip().split(' '))
div = 1000000000 + 7

for i in range(K):
    if i > N - K:
        print(0)
    else:
        perm = comb(N - K + 1, i + 1) * comb(K - 1, i)
        print(perm % div)


Measured memory_bytes: 3316
{-# LANGUAGE TupleSections #-}
import           Control.Arrow     (second)
import           Control.Exception (assert)
import           Control.Monad     (unless)
import           Data.Char         (isLower)
import           Data.Function     (on)
import qualified Data.Map          as Map (foldl', fromListWith,
                                           intersectionWith)

main :: IO ()
main = do
  n <- readLn :: IO Int
  unless (n >= 1 && n <= 18) $ error "1 <= n <= 18"
  s <- getLine
  assert (all isLower s && length s == 2 * n) $ print $ f s

f :: String -> Int
f s = Map.foldl' (+) 0 $ (Map.intersectionWith (*) `on` toMap . partitions) front rear
  where
    toMap = Map.fromListWith (+) . map (,1)
    (front, rear) = twoFold s

partitions :: [a] -> [([a], [a])]
partitions []     = [([], [])]
partitions (x:xs) = partitions xs >>= \(ys, zs) -> [(x:ys, zs), (ys, x:zs)]

twoFold :: [a] -> ([a], [a])
twoFold xs = second reverse $ splitAt (length xs `div` 2) xs


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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define l_l pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

int main() {
  // std::cout << std::fixed << std::setprecision(10);

  // 1000 15 80
  ll D, T, S;
  scanf("%lld %lld %lld", &D, &T, &S);

   if (T * S >= D) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3656
#include <stdio.h>
 
int main(){

    int n;
    char dead; // \n absorber
    scanf("%d", &n);
    scanf("%c", &dead);

    char f; // mark finder
    int num; // card number

    int j, k;

    int array[4][13] = {};

    for (int i=0; i<n; i++) {
        scanf("%c %d%c", &f, &num, &dead);
        switch (f) {
            case 'S': j=0; break;
            case 'H': j=1; break;
            case 'C': j=2; break;
            case 'D': j=3; break;
        }
        array[j][num-1] = num;
    }

    for (int j=0; j<4; j++) {
        switch (j) {
            case 0: f='S'; break;
            case 1: f='H'; break;
            case 2: f='C'; break;
            case 3: f='D'; break;
        }
        for (int k=0; k<13; k++) {
            if (array[j][k] == 0) {
                printf("%c %d\n", f, k+1);
            }
        }
    }
    return 0;
}


Measured memory_bytes: 2688
n=int(input())
f=[]
p=[]
for i in range(n):
    f_i=list(map(int,input().split()))
    f.append(f_i)
for i in range(n):
    p_i=list(map(int,input().split()))
    p.append(p_i)
ans=-10000000*n
for i in range(1,1024):
    i_bin=((bin(i))[2:]).zfill(10)
    temp=0
    for j in range(n):
        buf=0
        for k in range(10):
            if f[j][k]==1 and i_bin[k]=="1":
                buf+=1
        temp+=p[j][buf]
    if ans<temp:
        ans=temp
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
int main(){
    int a[3],t,i,j,k=3;
    scanf("%d%d%d",&a[0],&a[1],&a[2]);
    for(i=0;i<3;i++){
        for(j=0;j<2;j++){
            if(a[j]>a[j+1]){
                t=a[j];
                a[j]=a[j+1];
                a[j+1]=t;
            }
        }
    }
    for(i=0;i<2;i++){
        if(a[i]==a[i+1]){
            k--;
        }
    }
    printf("%d\n",k);
    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
int gcd(int,int);
  int main()
{
  int a,b;
  scanf("%d %d",&a,&b);
  printf("%d\n",gcd(a,b));

  return 0;
}
gcd(a,b)
{
  int r;
  while(b>0)
    {
      r=a%b;
      a=b;
      b=r;
    }
      return a;
}

Measured memory_bytes: 592
#include<stdio.h> 
#include<iostream> 
#include<string.h>
#include<cstring>
#include<string>
#include<math.h>
#include<algorithm>
#include<bits/stdc++.h>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<set>
#define cuttime ios::sync_with_stdio(false)
#define swap(x, y) x ^= y, y ^= x, x^= y
#define INF 0x3f3f3f3f
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dep(i,a,b) for(int i=(a);i>=(b);--i)
#define scan1(x) scanf("%d",&x)
#define scan2(x,y) scanf("%d%d",&x,&y)
#define scan3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define scanll1(x) scanf("%lld",&x)
#define scanll2(x,y) scanf("%lld%lld",&x,&y)
#define scanll3(x,y,z) scanf("%lld%lld%lld",&x,&y,&z)
#define lowbit(x) (x&(-x))
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define debug(x) cout <<#x<<": "<<x<<endl
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const int N=2e5+20;
const int MAX=10000007;
inline ll read() {
    char c=getchar();ll x=0,f=1;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0',c=getchar();}
    return x*f;
}
inline void out(ll x) {   
    if(x>9) out(x/10);   
    putchar(x%10+'0'); 
}
int q[N];
map<int,int>mp,vis;

int main(){
    int n;
    n=read();
    rep(i,1,n){
        q[i]=read();
    }
    ll sum=q[1];
    rep(i,2,n){
        sum^=q[i];
    }
    rep(i,1,n){
        cout<<(sum^q[i])<<" ";
    }
    return 0;
}
/*

 */

Measured memory_bytes: 4284
#include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef vector<int > vecint;
typedef vector<bool > vecbool;
typedef vector<string > vecstr;
////////////////////////////////////////////////
ll pow_mod(ll x, ll n){
  //x^n (mod M)
  ll pow = 1;
  while(n != 0){
    if(n&1) pow = pow * x % MOD;
    x = x * x % MOD;
    n = n >> 1;
  }
  return pow;
}
////////////////////////////////////////////////
ll inv_mod(ll x){
  //y = x^{MOD - 2} (mod MOD)
  //x*y = 1 (mod MOD) // Fermart's little theorem
  return pow_mod(x, MOD - 2);
}
////////////////////////////////////////////////
bool isprime(int n){
  if(n == 1)return false;
  else if(n == 2) return true;
  else if(n == 3) return true;
  else if(n == 5) return true;
  else if(n%6 != 1&&n%6 != 5) return false;
  else{
    for(int i = 2; i <= sqrt(n) + 1; i++){
      if(n%i == 0)return false;
    }
    return true;
  }
}
////////////////////////////////////////////////
ll comb(ll a, ll b){
  if(b > a - b)return comb(a, a - b);
  ll X = 1;
  ll Y = 1;
  for(ll i = 0; i < b; i ++){
    X *= a - i;
    Y *= b - i;
    X %= MOD;
    Y %= MOD;
  }
  return X*inv_mod(Y)%MOD;
}
////////////////////////////////////////////////
int main()
{
  int n, m;
  cin >> n >> m;
  vecint b, p;
  int i = 2;
  // REP(i,n){
  //   if(i == 0)continue;
  //   cout << i<<" " << isprime(i) << endl;
  // }
  while(m > 1){
    // while(!isprime(i)) i++;
    int tmp = 0;
    while(m % i == 0){
      m /= i;
      tmp++;
      // cout << tmp << " " << m << endl;
    }
    if(tmp > 0){
      p.push_back(i);
      b.push_back(tmp);
    }
    i++;
  }
  
  // REP(i,p.size()){
  //   cout << p[i] << " " << b[i] << " " << pow(p[i],b[i]) << endl;
  // }
  ll ans =1;
  REP(i, b.size()){
    ans *= comb(b[i] + n - 1, n - 1);
    ans %= MOD;
  }
  cout << ans << endl;
}



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

using namespace std;

int main()
{
    int n;
    long long sum=0;
    scanf("%d",&n);
    int x[n];
    for(int i=0;i<n;i++)
    {
        scanf("%d",&x[i]);
        sum+=x[i];
    }
    int maxn=sum;
//cout<<"sum = "<<sum<<endl;
    int m,l,u;
    scanf("%d",&m);
    for(int i=0;i<m;i++)
    {
        sum=maxn;
        scanf("%d %d",&l,&u);
       // cout<<"x[i] = "<<x[l-1]<<endl;
        sum-=x[l-1];
      //  cout<<"sum="<<sum<<"  ";
        printf("%lld\n",sum+u);
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
const int MOD=1e9+7,MAXN=1005;
struct matrix
{
	ll p[5][5];
	matrix(){memset(p,0,sizeof(p));}
	void init(){p[0][0]=p[1][1]=1;}
	friend matrix operator * (const matrix &a,const matrix &b)
	{
		matrix ret;
		for(int i=0;i<2;i++)
			for(int j=0;j<2;j++)
				for(int k=0;k<2;k++)
					(ret.p[i][j]+=a.p[i][k]*b.p[k][j]%MOD)%=MOD;
		return ret;
	}
	friend matrix quick_pow(matrix a,ll b)
	{
		matrix ret;ret.init();
		for(;b;b>>=1,a=a*a)
			if(b&1) ret=ret*a;
		return ret;
	}
};

char s[MAXN][MAXN];
ll k;
int n,m,cnt,pv,ph,sv,sh;
ll quick_pow(ll a,ll b)
{
	ll ret=1;
	for(;b;b>>=1,a=a*a%MOD)
		if(b&1) ret=ret*a%MOD;
	return ret;
}

int main()
{
	scanf("%d%d%lld",&n,&m,&k);
	if(k<=1) return puts("1"),0;
	for(int i=1;i<=n;i++) scanf("%s",s[i]+1);
	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++)
		if(s[i][j]=='#')
		{
			cnt++;
			pv+=(s[i][j]==s[i+1][j]);
			ph+=(s[i][j]==s[i][j+1]);
		}
	for(int i=1;i<=m;i++) sv+=(s[1][i]=='#'&&s[n][i]=='#');
	for(int i=1;i<=n;i++) sh+=(s[i][1]=='#'&&s[i][m]=='#');
	
	if(sv&&sh) return puts("1"),0;
	else if(!sv&&!sh) return printf("%lld",quick_pow(cnt,k-1)),0;
	else
	{//¶Ô³ÆµÄÉÏÈý½Ç¾ØÕóºÍÏÂÈý½Ç¾ØÕóµÄ´Î·½¶¼ÏàÍ¬£¿ 
		matrix t;t.p[0][0]=cnt;t.p[1][0]=(sv?pv:0)+(sh?ph:0);t.p[1][1]=sv+sh;
		t=quick_pow(t,k-1);printf("%lld",(t.p[0][0]-t.p[1][0]+MOD)%MOD);
	}
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <deque>
#include <stack>
#include <iomanip>
#include <cmath>


using namespace std;


typedef long long ll;
typedef long double ld;


const int MAXN = 5001;
const ll MOD = 1000000007ll;;


int N, L;
ll memo[MAXN][MAXN];


ll modSum(ll a, ll b) {
  return ((a % MOD) + (b % MOD)) % MOD;
}


ll modProd(ll a, ll b) {
  return ((a % MOD) * (b % MOD)) % MOD;
}


ll getPow(ll x, ll e) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    ll tmp = getPow(x, e/2);
    return modProd(tmp, tmp);
  } else {
    ll tmp = getPow(x, e-1);
    return modProd(tmp, x);
  }
}


ll DP(int keys, int len) {
  if (keys == len) return getPow(2, keys);
  if (keys < len) return 0;
  if (memo[keys][len] != -1) {
    return memo[keys][len];
  }
  ll v = DP(keys-1, len+1);
  if (len != 0) {
    v = modSum(v, modProd(2, DP(keys-1, len-1)));
  } else {
    v = modSum(v, DP(keys-1, len));
  }
  return memo[keys][len] = v;
}


void input() {
  cin >> N;
  string tmp;
  cin >> tmp;
  L = (int)tmp.size();
}


void preprocess() {
  for (int i = 0 ; i < MAXN ; i++) {
    for (int j = 0 ; j < MAXN ; j++) {
      memo[i][j] = -1;
    }
  }
}


ll getAns() {
  if (N < L) {
    return 0;
  }
  if (N == L) {
    return 1;
  }
  return modProd(DP(N, L), getPow(2, L * (MOD - 2)));
}


void solve() {
  cout << getAns();
  //cerr << "DP = " << DP(N, L) << "\n";
}






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

  int T;
//  cin >> T;
  T = 1;

  for (int i = 0 ; i < T ; i++) {
    input();
    preprocess();
    solve();
  }

  return 0;
}


Measured memory_bytes: 195840
#include <stdio.h>

int main() {
    float a, b, c, d, e, f;
    while(scanf("%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f) != EOF) {
        float det = a*e - b*d;
        float x = (c*e-b*f)/det;
        float y = (-c*d+a*f)/det;
        x = x==-0.0f?0.0f:x;
        y = y==-0.0f?0.0f:y;
        printf("%.3f %.3f\n", x, y);
    }
    return 0;
}

Measured memory_bytes: 2608
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);

int main()
{
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if ((i + 1) % 2 != 0 && a % 2 != 0) ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3632
A,B,C,D=map(int,input().split())
ali='0'*101
bob='0'*101
ali=ali[:A]+'1'*(B-A)+ali[B+1:]
bob=bob[:C]+'1'*(D-C)+bob[D+1:]
ans=int(ali,2)&int(bob,2)
print(bin(ans).count('1'))


Measured memory_bytes: 9108
#include "bits/stdc++.h"
using namespace std;

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf = 1000000001;
const ll INF = 1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

#define int ll
// 辺を表す構造体 {行先、容量、逆辺}
struct edge { int to, cap, rev; };
#define V 1010
vector< vector<edge> > G(V, vector<edge>()); //グラフの隣接リスト表現
vi level(V); //sからの距離
vi iter(V); //どこまで調べ終わったか

//fromからtoへ向かう容量capの辺をグラフに追加する
void add_edge(int from, int to, int cap) {
  edge a;
  a.to = to; a.cap = cap; a.rev = G[to].size();
  G[from].push_back(a);
  a.to = from; a.cap = 0; a.rev = G[from].size() - 1;
  G[to].push_back(a);
}

//sからの最短距離をBFSで計算する
void bfs(int s) {
  fill(level.begin(), level.end(), -1);
  queue<int> que;
  level[s] = 0;
  que.push(s);
  while (!que.empty()) {
    int v = que.front(); que.pop();
    for (int i = 0; i < G[v].size(); i++) {
      edge &e = G[v][i];
      if (e.cap > 0 && level[e.to] < 0) {
	level[e.to] = level[v] + 1;
	que.push(e.to);
      }
    }
  }
}

//増加パスをDFSで探す
int dfs(int v, int t, int f) {
  if (v == t) return f;
  for (int &i = iter[v]; i < G[v].size(); i++) {
    edge &e = G[v][i];
    if (e.cap > 0 && level[v] < level[e.to]) {
      int d = dfs(e.to, t, min(f, e.cap));
      if (d > 0) {
	e.cap -= d;
	G[e.to][e.rev].cap += d;
	return d;
      }
    }
  }
  return 0;
}

//sからtへの最大流を調べる
int max_flow(int s, int t) {
  int flow = 0;
  for (;;) {
    bfs(s);
    if (level[t] < 0) return flow;
    fill(iter.begin(), iter.end(), 0);
    int f;
    while ((f = dfs(s, t, INF)) > 0) {
      flow += f;
    }
  }
}

signed main() {
  int n, i, j;
  cin >> n;
  vl a(n);
  ll sum = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += max(a[i], 0LL);
  }
  for (i = 1; i <= n; i++) {
    for (j = 2; i*j <= n; j++) {
      add_edge(i, i*j, INF);
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] < 0) {
      add_edge(0, i + 1, -a[i]);
    }
    else {
      add_edge(i + 1, n + 1, a[i]);
    }
  }
  cout << sum - max_flow(0, n + 1) << endl;
}


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

int main(){
    int a,b;
    cin >> a >> b;
    int count=0;
    for(int i=a;i<=b;i++){
        if(i/10000==i%10){
            if((i/10)%10==(i/1000)%10){
                count++;
            }
        }
    }
    cout << count << endl;
}


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

int main() 
{
    int n;
    cin >> n;
    vector<int> A(n);
    rep(i,n) cin >> A[i];
    sort(A.begin(), A.end());
    
    int B[1000005] = {0};
    int before = 0;
    for (auto a : A) {
        if(before == a) {
            B[a]++;
            continue;
        }
        for(int j=a; j<1000005; j+=a) {
            B[j]++;
        }
        before = a;
    }

    int ans = 0;
    for(auto a : A) {
        if (B[a] == 1) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 7992
n, q = map(int, input().split())
s = input()
k = 0
sum_c = [0 for _ in range(n)]
cnt = 0
for i in range(n-1):
    if s[i:i+2] == 'AC':
        cnt += 1
    sum_c[i+1] = cnt

while True:
    l, r = map(int, input().split())
    print(sum_c[r-1]-sum_c[l-1])
    k += 1
    if q <= k:
        break


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

using namespace std;

int main()
{
    int N;
    cin>>N;
    int d=N%10;
    if(d==2 || d==4 || d==5 || d==7 || d==9)
        cout<<"hon"<<endl;
    else if(d==0 || d==1 || d==6 || d==8)
        cout<<"pon"<<endl;
    else
        cout<<"bon"<<endl;

    return 0;    

}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define repr(i, n) for(int i = n;i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define PI 3.141592653589793
#define MOD 1000000007

typedef long long ll;

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

    int n,max,min;
    cin >> n;

    int a[n];

    rep(i,n){
        cin >> a[i];
    }
    max = a[0];
    min = a[0];

    rep(i,n){
        if(a[i] < min) min = a[i];
        if(a[i] > max) max = a[i]; 
    }

    cout << max - min << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    long long n, k; cin >> n >> k;
    vector<long long> as(n);
    for(int i=0; i<n; ++i){
        cin >> as[i];
    }

    vector<long long> masks;
    masks.push_back(k);
    for(long long i=1; i<=k; i<<=1){
        if(i & k) masks.push_back((k & ~i) | (i-1));
    }

    vector<int> num_bits(63);
    for(int i=0; i<63; ++i){
        for(int j=0; j<n; ++j){
            num_bits[i]+=bool(as[j] & (1LL<<i));
        }
    }

    long long ans=0;
    for(auto mask : masks){
        long long t=0;
        for(int i=0; i<63; ++i){
            if(mask & (1LL<<i)) t+=(1LL<<i)*max((long long)num_bits[i], n-(long long)num_bits[i]);
            else t+=(1LL<<i)*num_bits[i];
        }
        ans=max(ans, t);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Stack;

public class Main {

	static char[][] matrix;
	static boolean[][] visited;

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

		while(true){
			String[] tmpArray = br.readLine().split(" ");

			int h = Integer.parseInt(tmpArray[0]);
			int w = Integer.parseInt(tmpArray[1]);

			if(w == 0 && h == 0){
				break;
			}

			matrix = new char[h][w];
			visited = new boolean[h][w];

			for(int i = 0; i < h; i++){
				Arrays.fill(matrix[i], '\0');
				Arrays.fill(visited[i], false);
			}

			for(int i = 0; i < h; i++){
				String tmpStr = br.readLine();
				for(int j = 0; j < w; j++){
					matrix[i][j] = tmpStr.charAt(j);
				}
			}
//			System.out.println("Start from "+x+" "+y);

			int areas = 0;
			for(int i = 0; i < h; i++){
				for(int j = 0; j < w; j++){
					if(!visited[i][j]){
						dfsWithStack(j, i, matrix[i][j]);
						areas++;
					}
				}
			}

			System.out.println(areas);
		}
	}

//	static int depth = 0;
	static void dfsWithStack(int x, int y, char type){
		int h = matrix.length;
		int w = matrix[0].length;

		Stack<Point> stack = new Stack<Point>();

		visited[y][x] = true;
		stack.add(new Point(x, y));

		while(!stack.isEmpty()){
			Point p = stack.pop();

//			visited[p.y][p.x] = true;
			//???
			if(p.x > 0 && matrix[p.y][p.x - 1] == type && !visited[p.y][p.x - 1]){
				stack.push(new Point(p.x-1, p.y));
				visited[p.y][p.x-1] = true;
			}

			//???
			if(p.y < h - 1 && matrix[p.y+1][p.x] == type && !visited[p.y+1][p.x]){
				stack.push(new Point(p.x, p.y+1));
				visited[p.y+1][p.x] = true;
			}

			//???
			if(p.x < w - 1 && matrix[p.y][p.x + 1] == type && !visited[p.y][p.x + 1]){
				stack.push(new Point(p.x+1, p.y));
				visited[p.y][p.x+1] = true;
			}

			//???
			if(p.y > 0 && matrix[p.y-1][p.x] == type && !visited[p.y-1][p.x]){
				stack.push(new Point(p.x, p.y-1));
				visited[p.y-1][p.x] = true;
			}

		}
	}
}

class Point{
	int x; int y;

	public Point(int x, int y){
		this.x = x;
		this.y = y;
	}
}

Measured memory_bytes: 26476
#include <iostream>
#include <map>
#include <cmath>
using namespace std;

int euclid(int x, int y){
	int t;
	while (x % y){
		x %= y;
		t = x;
		x = y;
		y = t;
	}
	return y;
}
int main(){
	int p, q, n, m, t = 2, ans = 1;
	cin >> p >> q;
	n = q / euclid(p, q);
	m = n;
	map<int, int> f;
	while (n > 1 && t < sqrt(m) + 1){
		if (! (n % t)){
			n /= t;
			f[t] = 1;
		}
		while (! (n % t)){
			++f[t];
			n /= t;
		}
		++t;
	}
	if (n != 1) f[n] = 1;

	for (map<int,int>::iterator itr = f.begin(); itr != f.end(); ++itr){
		ans *= itr->first;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N=0,M=0,X=0,a=0,ans=0,b=0,c=0,bsum=0,asum=0;
    string str;
    vector<int> vec(105);

    cin>>N>>M>>X;

    for(int i=1;i<=M;i++){
        cin>>vec[i];
        if(vec[i]<X){
            bsum++;
        }else{
            asum++;
        }
    }


    cout<<min(asum,bsum)<<endl;
}

Measured memory_bytes: 384
import sys
input = sys.stdin.readline
INF = float('inf')

N, M, L = map(int, input().split())
ABC = [tuple(map(int, input().split())) for _ in range(M)]
Q = int(input())
ST = [tuple(map(int, input().split())) for _ in range(Q)]

dist = [[INF] * N for _ in range(N)]
fuel = [[INF] * N for _ in range(N)]

for i in range(N):
    dist[i][i] = 0
    fuel[i][i] = 0

for fr, to, cost in ABC:
    if cost > L:
        continue
    fr -= 1
    to -= 1
    dist[fr][to] = cost
    dist[to][fr] = cost

for k in range(N):
    for i in range(N):
        for j in range(N):
            d = dist[i][k] + dist[k][j]
            if dist[i][j] > d:
                dist[i][j] = d
            if d <= L:
                fuel[i][j] = 1

for k in range(N):
    for i in range(N):
        for j in range(N):
            d = fuel[i][k] + fuel[k][j]
            if fuel[i][j] > d:
                fuel[i][j] = d

for start, end in ST:
    print(fuel[start - 1][end - 1] - 1 if fuel[start - 1][end - 1] != INF else -1)


Measured memory_bytes: 91356
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include<stack>
#include<sstream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<list>
#include<numeric>
typedef long long ll;

#define pi 3.14159265358979323846
#define VI vector<int>
#define VLL vector<long long>
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
const ll MOD = 1e9 + 7;
using namespace std;
template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}

template<typename T>
T binarysearch(vector<T> A, T key) {
	ll left = 0;ll right = 4;ll mid;
	while (left < right) {
		mid = (left + right) / 2;
		if (key == A[mid]) return 1;
		if (key > A[mid]) left = mid + 1;
		else if (key < A[mid]) right = mid;
	}
	return 0;
}

template<typename T>
T finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}
ll frac(ll n)//階乗
{
	if (n == 0) {
		return 1;
	}
	return (n * frac(n - 1)) % MOD;
}

template<typename T>
T keta(T a) {
	ll kazu = 1;
	while (1) {
		if (a / 10 != 0) { a /= 10;kazu++; }
		else break;
	}
	return kazu;
}//桁数


template<typename T>
T nCr(ll n, T r) {
	ll ans = 1;
	for (int i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (int i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
/*char r[4];
int yaju[4];
char op[3];
int sum = 0;
scanf("%s", r);
for (int i = 0;i < 4;i++) {
	yaju[i] = r[i] - '0';
}
*/

int main() {
	ll X;cin >> X;
	bool ok = false;
	vector<ll> a(121);
	for (ll i = 0;i <= 120;i++) {
		a[i] = i*i*i*i*i;
	}
	//for (int i = 0;i < 120; i++)cout << a[i] << endl;
	for (ll i = 0;i<121;i++) {
		for (ll j = i;j<121;j++) {
			if (a[j]+a[i]==X) {
				cout << j << " " << -i << endl;
				ok = true;
				break;
			}
			if (a[j]-a[i]==X) {
				cout << j << " " << i << endl;
				ok = true;
				break;
			}
		}
		if (ok) break;
	}
}

Measured memory_bytes: 3592
n = int(input())
if 400<=n<=599:
  print('8')
elif 600<=n<=799:
  print('7')
elif 800<=n<=999:
  print('6')
elif 1000<=n<=1199:
  print('5')
elif 1200<=n<=1399:
  print('4')  
elif 1400<=n<=1599:
  print('3')    
elif 1600<=n<=1799:
  print('2')  
elif 1800<=n<=1999:
  print('1')  

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

int main() {
	int k;
	cin>>k;
	if(k%7==0) k/=7;
	if(__gcd(10,k)!=1) {
		cout<<-1;
		return 0;
	}
	long v=1%k;
	int len=1;
	while (v != 0) {
    v = (10 * v + 1) % k;
    len++;
}
cout<<len;
	return 0;
}

Measured memory_bytes: 3648
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void){
  string s;
  cin >> s;
  int st = 0;
  REP(i,0,s.length()){
    if(st==0){
      if(s[i]=='C')st=1;
    } else if (st==1) {
      if(s[i]=='F')st=2;
    }
  }
  cout << (st == 2 ? "Yes" : "No") << endl;
}


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

int mn[100010];

int main() {
	int N;
	cin >> N;
	for(int i=1; i<=N; ++i) mn[i]=1e6;
	mn[0]=0;
	deque<int> dq{0};
	while(mn[N]==1e6){
		if(mn[dq[0]+1]==1e6){
			dq.emplace_back(dq[0]+1);
			mn[dq[0]+1]=mn[dq[0]]+1;
		}
		for(int i=6; dq[0]+i<=N; i *= 6){
			if(mn[dq[0]+i]==1e6){
				dq.emplace_back(dq[0]+i);
				mn[dq[0]+i]=mn[dq[0]]+1;
			}
		}
		for(int i=9; dq[0]+i<=N; i *= 9){
			if(mn[dq[0]+i]==1e6){
				dq.emplace_back(dq[0]+i);
				mn[dq[0]+i]=mn[dq[0]]+1;
			}
		}
		dq.pop_front();
	}
	cout << mn[N] << endl;
	return 0;
}

Measured memory_bytes: 768
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <unordered_map>
#include <iterator>
#include <functional>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

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 (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;


int n, L;
int dp[5005][5005];
int x[5001], a[5001];

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	cin >> n >> L;
	REP(i, n) cin >> x[i];
	REP(i, n) cin >> a[i];
	REP(i, L) dp[0][i] = 1;
	REP(i, n){
		for(int j=x[i];j<L;j+=a[i]){
			dp[i+1][j+1] = dp[i][j];
			if(a[i] == 0) break;
		}
		REP(j, L){
			dp[i+1][j+1] += dp[i+1][j];
			if(dp[i+1][j+1] >= MOD) dp[i+1][j+1] -= MOD;
		}
	}
	cout << dp[n][L] << endl;
	return 0;
}

Measured memory_bytes: 99008
#include "bits/stdc++.h"
using namespace std;

int sumXor(const vector<int> &a, const vector<int> &b){
    int foo = 0;
    int n = a.size();
    vector<int> c(n, 0);
    for(int k=0; k<=28; k++){
        const int msk = (1<<(k+1))-1;
        for(int i=0; i<n; i++){
            c[i] = b[i] & msk;
        }
        sort(c.begin(), c.end());
        for(int i=0; i<n; i++){
            const int sup = a[i] & msk;
            if((distance(lower_bound(c.begin(), c.end(), (1<<k)-sup), lower_bound(c.begin(), c.end(), (1<<(k+1))-sup)) + distance(lower_bound(c.begin(), c.end(), (3<<k)-sup), lower_bound(c.begin(), c.end(), (1<<(k+2))-sup))) & 1){
                //fprintf(stderr, "k=%d, a[i]=%d, cnt=%ld\n", k, a[i], (distance(lower_bound(c.begin(), c.end(), (1<<k)-sup), lower_bound(c.begin(), c.end(), (1<<(k+1))-sup)) + distance(lower_bound(c.begin(), c.end(), (3<<k)-sup), lower_bound(c.begin(), c.end(), (1<<(k+2))-sup))));
                foo ^= 1<<k;
            }
        }
    }
    return foo;
}

int main(){
    int n;
    while(scanf("%d", &n)!=EOF){
        vector<int> a(n, 0);
        vector<int> b(n, 0);
        for(int i=0; i<n; i++)scanf("%d", &a[i]);
        for(int i=0; i<n; i++)scanf("%d", &b[i]);
        printf("%d\n", sumXor(a, b));
    }
    return 0;
}

Measured memory_bytes: 2560
#include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

typedef struct{
    double x;
    double y;
}vec;

int main(){
    int n;
    vec p[4],e[2];
    cin >> n;
    while(n--){
        for(int i=0;i<4;i++)
            cin >> p[i].x >> p[i].y;
        e[0].x=p[1].x-p[0].x;
        e[0].y=p[1].y-p[0].y;
        e[1].x=p[3].x-p[2].x;
        e[1].y=p[3].y-p[2].y;
        if(fabs(e[0].x*e[1].y-e[0].y*e[1].x)<(1e-10)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 1224
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void solve() {
        int n;
        double sum = 0.0;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            Int tmp;
            cin >> tmp;
            sum += 1. / tmp;
        }

        double ans = 1. / sum;
        cout << ans << endl;

    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll inf= 2e18;
ll ar[100002],n;
ll br[100002];

ll dp(ll i,ll val)
{
    if(i==n){
        return abs(ar[n]-val);
    }
    if(i>n){
        return abs(inf-val);
    }
    if(br[i]!=-1){
        return br[i]+abs(ar[i]-val);
    }
    ll v1,v2;
    v1=dp(i+1,ar[i]);
    v2=dp(i+2,ar[i]);
    br[i]=min(v1,v2);//cout<<br[i]<<endl;
    return br[i]+abs(ar[i]-val);
}
int main()
{
    ll a,m;
    memset(br,-1,sizeof(br));
    cin>>n;
    for(ll i=1;i<=n;i++){
        scanf("%lld",&ar[i]);
    }
    cout<<dp(1,ar[1])<<endl;
    return 0;
}


Measured memory_bytes: 4992
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Edge=pair<int,int>;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
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;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  int N;
  cin>>N;
  
  int T=(N+999)/1000;
  
  co(T*1000-N);
  return 0;
}

Measured memory_bytes: 3632
#include<stdio.h>

int main(){
  int x,y;

  while(1){
    scanf("%d %d",&x,&y);

    if(x + y == 0) break;

    if(x > y){
      printf("%d %d\n",y,x);
    }else{
      printf("%d %d\n",x,y);
    }
  }

  
  return 0;
}



Measured memory_bytes: 2048
#include<iostream>
#include<cmath>
#include<algorithm>
//#include<bitset>

using namespace std;

int n, m;

void add(int &i, int j)
{
	i += j;
	if (i <= 0)
	{
		i = n;
	}
	if (i > n)
	{
		i -= n;
	}
}

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

	int i = 1;
	int j = n - 1;
	bool flg = n % 2 == 0;
	for (int c = 0; c < m; c++)
	{
		if (flg && (j - i <= n/2))
		{
			flg = false;
			add(i, 1);
		}
		cout << i << " " << j <<  endl;
		//cout << ":  " << min(abs(j - i), 1000 - abs(j - i)) << endl;
		add(i, 1);
		add(j, -1);
	}
	return 0;
	
}

Measured memory_bytes: 3596
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
#define N 400102
const int p=998244353,iv=499122177;
int n,ps[N],m,a[N];
inline int ksm(int d,int k){int ret=1;while(k){if(k&1)ret=1ll*ret*d%p;d=1ll*d*d%p;k>>=1;}return ret;}
inline void fwt(int x[],int len,int mde)
{
    for(int i=2;i<=len;i<<=1)for(int j=0,stp=i>>1;j<len;j+=i)for(int k=j;k<j+stp;k++)
    {
        int t1=x[k],t2=x[k+stp];x[k]=(t1+t2)%p,x[k+stp]=(t1-t2+p)%p;
        if(mde<0)x[k]=1ll*x[k]*iv%p,x[k+stp]=1ll*x[k+stp]*iv%p;
    }
}
int main()
{
    scanf("%d",&n);m=(1<<n);int sum=0;
    for(int i=0;i<m;i++)scanf("%d",&ps[i]),sum=(sum+ps[i])%p;sum=ksm(sum,p-2)%p;
    for(int i=0;i<m;i++)ps[i]=1ll*ps[i]*sum%p;
    a[0]=m-1;for(int i=1;i<m;i++)a[i]=p-1;
    ps[0]=(ps[0]+p-1)%p;
    fwt(a,m,1);fwt(ps,m,1);
    for(int i=0;i<m;i++)a[i]=1ll*a[i]*ksm(ps[i],p-2)%p;
    a[0]=0;
    fwt(a,m,-1);
    for(int i=1;i<m;i++)a[i]=(a[i]-a[0]+p)%p;
    a[0]=0;
    for(int i=0;i<m;i++)printf("%d\n",a[i]);
}


Measured memory_bytes: 5740
H, W = list(map(int,input().split()))
s = []
for i in range(H):
    s.append(input())
r = "Yes"
for i in range(H):
    for j in range(W):
        if s[i][j]==".":
            continue
        p = False
        for y,x in [[i-1,j],[i+1,j],[i,j-1],[i,j+1],]:
            if 0<=y<H and 0<=x<W and s[y][x]=="#":
                p = True
        if not p:
            r = "No"
print(r)

Measured memory_bytes: 9044
#include<bits/stdc++.h>
using namespace std;
#define pb push_back

int N, val;
int res = 0;
vector<int> L;

int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> val;
        L.pb(val);
    }

    sort(L.begin(), L.end());
    for(int i = 0; i < N; i++){
        for(int j = i+1; j < N; j++){
            if(L[i] == L[j]) continue;
            for(int k = N-1; k > j; k--){
                if(L[k] == L[j]) break;
                if(L[i]+L[j] > L[k]) ++res;
            }
        }
    }

    cout << res << endl;
    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
const int maxn = 10000 + 10;
string s;

int main()
{
    cin >> s;
    int len = s.length();
    for(int i = 0; i < len / 2; i++)
    {
        if(s[i] != s[len-1-i])
        {
            cout << "No" << "\n";
            return 0;
        }
    }
    cout << "Yes" << "\n";
    return 0;
}


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

int main() {
  int N, i;
  string ss;
  cin >> N;
  vector<int> P(N);
  vector<string> S(N);
  vector<tuple<string,int,int>> r1(N);
  vector<tuple<int,string,int>> r2(N);
  
  for(i=0; i<N; i++) {
    cin >> S.at(i) >> P.at(i);
    r1.at(i) = make_tuple(S.at(i), P.at(i), i+1);
    r2.at(i) = make_tuple(P.at(i), S.at(i), i+1);
  }
 
  sort(r1.begin(), r1.end());
  sort(r2.begin(), r2.end());
  reverse(r2.begin(), r2.end());
  
  for(i=0; i<N; i++) {
    tie(ss, ignore, ignore) = r1.at(i);
  	for(auto &e : r2)
      if(ss == get<1>(e)) {
        get<1>(e) = "*";
        get<1>(r1.at(i)) = get<0>(e);
        get<2>(r1.at(i)) = get<2>(e);
        break;
      }
  }
  
  for(auto e : r1)
    cout << get<2>(e) << endl;
}

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

int main() {

int n ;
cin >> n ;
int s[n] ;
int SUM = 0;

for(int i=0;i<n;i++)
{
    cin >> s[i];
    SUM+=s[i] ;
} 

sort(s,s+n) ;
  if(SUM%10!=0){
    cout << SUM << endl ;
    return 0 ;
  } 

int ans = 0 ;
for(int i=0;i<n;i++){
    if(s[i]%10!=0){
    ans = SUM-s[i] ;
    break ;
    }
}

cout << ans << endl ;

return 0 ;
}  

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
 
#include <vector>
#include <cmath>
#include <limits>
#include <functional>
using namespace std;
 
int main()
{
    int N,X;
    cin >> N;
    int f = 0;
    int ans = 0, amari;
 
    X = N;
 
    while (N != 0)
    {
        amari = N % 10;
        f += amari;
        N = N / 10;
    }
 
    if (X % f==0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
 
    
 
    return 0;
}

Measured memory_bytes: 3604