akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace b
{
    class Program
    {
        static void Main(string[] args)
        {

            (var humans, var itemCount) = IOUtils.Read2Ints();

            var humanSet = new HashSet<int>();

            for (int i = 0; i < itemCount; i++)
            {
                Console.ReadLine();

                foreach (var n in IOUtils.ReadInts())
                {
                    humanSet.Add(n);
                }
            }

            Console.WriteLine(humans - humanSet.Count);



        }
    }


    static class IOUtils
    {
        public static (int a, int b) Read2Ints()
        {
            var vals = ReadInts();
            return (vals[0], vals[1]);
        }
        public static (int a, int b, int c) Read3Ints()
        {
            var vals = ReadInts();
            return (vals[0], vals[1], vals[2]);
        }
        public static IEnumerable<int[]> ReadIntLines(int count)
        {
            for (int i = 0; i < count; i++)
            {
                yield return ReadInts();
            }
        }
        public static IEnumerable<long[]> ReadLongLines(int count)
        {
            for (int i = 0; i < count; i++)
            {
                yield return ReadLongs();
            }
        }
        public static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
        public static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        public static ulong ReadUlong()
        {
            return ulong.Parse(Console.ReadLine());
        }
        public static int[] ReadInts()
        {
            return Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
        }
        public static long[] ReadLongs()
        {
            return Console.ReadLine().Split(' ').Select(v => long.Parse(v)).ToArray();
        }

        public static void WriteNums(params int[] nums)
        {
            Console.WriteLine(string.Join(" ", nums));
        }
    }
}


Measured memory_bytes: 20632
public class Main {
	public static void main(String args[]){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			if(m == (-1) && f == (-1) && r == (-1)){
				break;
			}else if(m == (-1) || f == (-1)){
				System.out.println("F");
			}else if(m+f >= 80){
				System.out.println("A");
			}else if(65 <= m+f && m+f < 80){
				System.out.println("B");
			}else if(50 <= m+f && m+f <65){
				System.out.println("C");
			}else if(30<=m+f && m+f<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else {
				System.out.println("F");
			}
		}

	}

}

Measured memory_bytes: 26140
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include <tuple>
#include <cassert>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;

#define read_int(X) \
    ll X;           \
    scanf("%lld\n", &X);

#define read_two_int(X, Y) \
    ll X, Y;               \
    scanf("%lld %lld\n", &X, &Y);

#define read_three_int(X, Y, Z) \
    ll X, Y, Z;                 \
    scanf("%lld %lld %lld\n", &X, &Y, &Z);

#define read_four_int(X, Y, Z, W) \
    ll X, Y, Z, W;                \
    scanf("%lld %lld %lld %lld\n", &X, &Y, &Z, &W);

int main()
{
    read_four_int(a, b, c, d);

    ll ans = max(max(a * c, b * d), max(a * d, b * c));
    printf("%lld\n", ans);
}


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

int abs(int x) {
    if (x >= 0) return x;
    else return -x;
}

int main(void) {
    int x, n;
    int p[110];
    cin >> x >> n;
    for (int i = 0; i < n; ++i) {
        cin >> p[i];
    }

    int ans = 0;
    for (int i = 1; i <= 105; ++i) {
        bool isExist = false;
        for (int j = 0; j < n; ++j) {
            if (p[j] == i) isExist = true;
        }
        if (isExist) continue;
        else {
            if (abs(i - x) < abs(ans - x)) {
                ans = i;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3192
/* Author: Dhruv Rastogi */
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<int, int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int> 
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second
const long double PI = acos(-1.0);

void solve(){  
  	int a,b;
  	cin>>a>>b;
  	cout<<a*b<<endl;
}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3656
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		if (a*b%2==0) {
			System.out.println("Even");
		} else {
			System.out.println("Odd");
		}
	}
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
 
int main(void){

	int n, l;
	cin >> n >> l;
	
	vector<string>s(n);
	
	for(int i = 0; i < n; i++) cin >> s[i];
	sort(s.begin(), s.end());
	for(int i = 0; i < n; i++) cout << s[i];
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 #define int long long

#define all(X) (X).begin(), (X).end()
#define reset(X) memset(X, 0, sizeof(X))
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define endl '\n'
#define fi first
#define se second


using namespace __gnu_pbds;
using namespace std;
const int mod=1e9+7;
 // const int mod=998244353;
 // const int mod=1e9+9;
// const int INF=4e18+10;
const int INF=4e18+10;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define read(n) int n; cin>>n;
#define readv(x, n) vector<int> x(n); for(auto &i:x) cin>>i;


typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

template<typename T1,typename T2>
void set_min(T1& a, T2 b)
{
    a=min(a, (T1)b);
}


int multiply(int a, int b, int in_mod){return (a*b)%in_mod;}
int mult_identity(int a){return 1;}


auto power(auto a, int b, int in_mod)
{
    auto prod=mult_identity(a);
    auto mult=a%in_mod;
    while(b!=0)
    {
        if(b%2)
        {
            prod=multiply(prod,mult, in_mod);

        }
        mult=multiply(mult, mult,in_mod);
        b/=2;
    }
    return prod;
}
int mod_inv(int q, int in_mod)
{

    return power(q, in_mod-2,in_mod);
}


void solve()
{

    int n;
    cin>>n;
    vector<int> l(n), r(n);
    for(int i=0;i<n;i++)
    cin>>l[i]>>r[i];

    if(n%2==1)

    {
    sort(all(l));
    sort(all(r));


    cout<<r[n/2]-l[n/2]+1<<endl;
    }
    else
    {
        sort(all(l));
        sort(all(r));
        int ans= (r[n/2] + r[n/2-1])- (l[n/2]+l[n/2-1])+1;
        cout<<ans<<endl;
    }

}

signed main()

{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
        freopen ("INPUT.txt" , "r" , stdin);
        freopen ("OUTPUT.txt" , "w" , stdout);
    }
    #endif
    auto clk=clock();
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    // -------------------------------------Code starts here---------------------------------------------------------------------
    int t=1;
    // cin>>t;
    for(int test=1;test<=t;test++)
    {
        // cout<<"Case #"<<test<<": ";
        // cout<<endl;
        solve();
        // cout<<endl;

    }

    // -------------------------------------Code ends here------------------------------------------------------------------


    clk = clock() - clk;
    cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
    return 0;
}


Measured memory_bytes: 6404
#include "bits/stdc++.h"
using namespace std;
int main(){
    string a, b, c;
    cin >> a >> b >> c;
    bool A = true;
    if(a.at(a.size() - 1) != b.at(0))
    A = false;
    if(b.at(b.size() - 1) != c.at(0))
    A = false;
    if(A == true)
    cout << "YES" << endl;
    else 
    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main()
{
    char s[101],t[101];

    scanf("%s %s",s,t);

    int l=strlen(s);
    int l2=strlen(t);
    //printf("%d %d",l,l2);
    char str[101];
    int c=0,sum=0;
    if (l==l2)
    {
        for (int i=0;i<l;i++)
        {
            if (s[i]==t[i])
                c++;
            else
                break;
        }
        if (c!=l)
        {
            for (int j=0;j<=l;j++)
            {
                sum=0;
                str[0]=s[l-1];
                for (int i=1;i<l;i++)
                {
                    str[i]=s[i-1];
                }
                for (int i=0;i<l;i++)
                {
                    s[i]=str[i];
                }
                for (int i=0;i<l;i++)
                {
                    if (s[i]==t[i])
                        sum++;
                    else
                        break;
                }
                if (sum==l)
                {
                    printf("Yes\n");
                    break;
                }
                else if (j==l)
                {
                    printf("No\n");
                }
            }
        }
        else
        {
            printf("Yes\n");
        }

    }
    else
    {
        printf("No\n");
    }
    return 0;

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL //デバッグ出力系
#define dout cout
#define debug() if(true)
#else
#define dout if(false) cout
#define debug() if(false)
#endif//
#define next asdnext
#define prev asdprev
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define vrep(i, v) for(auto &i : v)
#define all(x) (x).begin(),(x).end()
#define vout(v) for(auto &i:v){cout<<i<<" ";}cout<<"\n"; //配列出力
#define vin(v) for(auto &i:v)cin>>i; //配列入力
#define vec(v,n) vector<int> v(n,0);
typedef long long ll;
typedef unsigned long long ull;

void Main() {
	int X, A;
	cin >> X >> A;
	cout << ((X<A) ? "0" : "10") << "\n";
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << std::fixed << std::setprecision(15);
	Main();
	return 0;
}


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

// @@ !! LIM()

int main(/* int argc, char *argv[] */) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N; cin >> N;
  vector<ll> vec(13);
  vec[0] = 1;
  for (ll i = 0; i < N; i++) {
    ll d; cin >> d;
    vec[d]++;
  }
  if (vec[0] >= 2 || vec[12] >= 2) {
    cout << 0 << endl;
    return 0;
  }
  vector<ll> cl(25);
  vector<ll> ones;
  cl[0] = cl[24] = 1;
  if (vec[12] == 1) cl[12] = 1;
  for (ll i = 1; i < 12; i++) {
    if (vec[i] >= 3) {
      cout << 0 << endl;
      return 0;
    }else if (vec[i] == 2) {
      cl[i] = 1;
      cl[24 - i] = 1;
    }else if (vec[i] == 1) {
      ones.push_back(i);
    }
  }
  auto eval = [&](const auto& clock) -> ll {
    ll eret = 100;
    ll prev = 0;
    for (ll i = 1; i <= 24; i++) {
      if (clock[i] == 0) continue;
      eret = min(eret, i - prev);
      prev = i;
    }
    return eret;
  };

  ll n = ones.size();
  ll ret = 0;
  vector<ll> clock;
  if (n == 0) {
    clock = cl;
    ret = eval(clock);
  }
  for (ll x = 0; x < (1 << n); x++) {
    clock = cl;
    for (ll i = 0; i < n; i++) {
      if ((x >> i) & 1) {
	clock[ones[i]] = 1;
      }else {
	clock[24 - ones[i]] = 1;
      }
    }
    ret = max(ret, eval(clock));
  }
  cout << ret << endl;

  return 0;
}



Measured memory_bytes: 3664
S = gets.chomp.split('/')

if S[0].to_i >= 2020 then
    print 'TBD'
elsif S[0].to_i <= 2018 then
    print 'Heisei'
elsif S[0].to_i == 2019 then
    if S[1].to_i >= 5 then
        print 'TBD'
    elsif
        print 'Heisei'
    end 
end

Measured memory_bytes: 1788
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{
  ll to,cost;
};
ll color[100010];
vector<vector<edge>>G(100010);
vector<bool>used(100010,false);
bool dfs(ll v,ll c){
  color[v]=c;
  used[v]=true;
  rep(i,G[v].size()){
    if(used[G[v][i].to])continue;
    if(G[v][i].cost%2==0)dfs(G[v][i].to,c);
    else dfs(G[v][i].to,-c);
  }
}
    
int main(){
  ll n;cin>>n;
  rep(i,n-1){
    ll u,v,w;cin>>u>>v>>w;
    edge A,B;
    u--;v--;
    A.to=u;A.cost=w;
    B.to=v;B.cost=w;
    G[v].push_back(A);
    G[u].push_back(B);
  }
  rep(i,n){
    if(used[i])continue;
    dfs(i,1);
  }
  rep(i,n){
    //rep(j,G[i].size())cout<<G[i][j].to<<" "<<G[i][j].cost<<" ";
    //cout<<used[i]<<endl;
    //cout<<endl;
  }
  rep(i,n){
    if(color[i]==1)cout<<1<<endl;
    else cout<<0<<endl;
  }
}
  

Measured memory_bytes: 10240
#include <iostream>

using namespace std;
int main(){
    int d, n;
    cin >> d >> n;
    int ans = 1;
    for(int i = 0; i < d; i++){
        ans *= 100; 
    }
    if(n == 100){
        cout << ans * (n + 1) << endl;
    } else {
        cout << ans * n << endl;
    }
    return 0;
}

Measured memory_bytes: 256
// Code By H~$~C
#include <bits/stdc++.h>
using namespace std;

int n, m, k;
int a[100005];
int b[100005];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cin >> n >> m >> k;
  int mna = 1000000000, mnb = 1000000000;
  for (int i = 1; i <= n; ++i) cin >> a[i], mna = min(mna, a[i]);
  for (int i = 1; i <= m; ++i) cin >> b[i], mnb = min(mnb, b[i]);
  int ans = mna + mnb;
  while (k--) {
    int x, y, c;
    cin >> x >> y >> c;
    ans = min(ans, a[x] + b[y] - c);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N;
int32_t A[10];
int32_t L[10];
std::bitset<8> used;
int32_t min = 10001000;
void func(int i, int32_t cost)
{
	if (i == 3) {
		min = std::min(min, cost-30);
		return;
	}
	for (size_t j = 0; j < N; j++)
	{
		if (!used[j]) {
			used[j] = true;
			A[i] -= L[j];
			func(i, 10+cost);
			func(i + 1, 10 + cost + std::abs(A[i]));
			A[i] += L[j];
			used[j] = false;
		}
	}
}


int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	for (size_t i = 0; i < 3; i++)
	{
		in >> A[i];
	}
	for (size_t i = 0; i < N; i++)
	{
		in >> L[i];
	}

	func(0, 0);
	out << min << endl;

	return 0;
}
#endif


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

int main(){
    int a, b;
    char op;

    while(1){
        cin >> a >> op >> b;
        if(op == '+') cout << a + b << endl;
        if(op == '-') cout << a - b << endl;
        if(op == '*') cout << a * b << endl;
        if(op == '/') cout << a / b << endl;
        if(op == '?') break;
    }

    return 0;
}


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

int main() {
  long long n,m;
  long long ans;
  cin>>n>>m;
  if(n==1 && m==1) cout<<1<<endl;
  else if(n==1) cout<<m-2<<endl;
  else if(m==1) cout<<n-2<<endl;
  else {
    ans=(n-2)*(m-2);
    cout<<ans<<endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cmath>
#include <ctime>
#define rg register
#define min(a,b) (a)<(b)?(a):(b)
#define max(a,b) (a)>(b)?(a):(b)
#define abs(a) ((a)>0?(a):-(a))
#define ll long long 
#define maxn 250000
#pragma GCC optimize(3)
#pragma -fcrossjumping
#pragma -fdefer-pop
#pragma -fmerge-constans
#pragma -fthread-jumps
#pragma -floop-optimize
#pragma -fif-conversion
#pragma -fif-conversion2
#pragma -fdelayed-branch
#pragma -fguess-branch-probability
#pragma -fcprop-registers
#pragma -fforce-mem
#pragma -foptimize-sibling-calls
#pragma -fstrength-reduce
#pragma -fgcse
#pragma -fcse-follow-jumps
#pragma -frerun-cse-after-loop
#pragma -fdelete-null-pointer-checks
#pragma -fextensive-optimizations
#pragma -fregmove
#pragma -fschedule-insns
#pragma -fsched-interblock
#pragma -fcaller-saves
#pragma -fpeephole2
#pragma -freorder-blocks
#pragma -fstrict-aliasing
#pragma -funit-at-a-time
#pragma -falign-functions
#pragma -fcrossjumping
#pragma -finline-functions
#pragma -fweb
using namespace std;
inline ll read()
{
	ll x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c<='9'&&c>='0')
	{
		x=(x<<1)+(x<<3)+(c^48);
		c=getchar();
	}
	return x*f;
}
ll n;
ll a[maxn];
ll b[maxn];
ll ans;
int main()
{
	n=read();
	for(rg int i=1;i<=n+1;++i) a[i]=read();
	for(rg int i=1;i<=n;++i) b[i]=read();
	for(rg int i=n+1;i>=1;--i)
	{
		if(b[i]>=a[i]) 
		{
			ans+=a[i];
			b[i]-=a[i];
			a[i]=0;
		}
		else
		{	
			a[i]-=b[i];
			ans+=b[i]; 
			b[i]=0;
			if(b[i-1]>=a[i])
			{
				ans+=a[i];
				
				b[i-1]-=a[i];
				a[i]=0;
			}
			else
			{
				
				a[i]-=b[i-1];
				ans+=b[i-1]; 
				b[i-1]=0;
			}
		}
	}
	cout<<ans;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    string s;
    cin >> s;
    cout << ((s == "ABC") ? "ARC" : "ABC") << endl;

    return 0;
}

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

int main ()
{
    int N;
    std::cin >> N;
    
    int a[11000]; // a <= 10^10
    for (int i = 0; i < N; i++) 
    {
        std::cin >> a[i];
    }
    
    long long counter = 0;
    for (int i = 0; i < N; i++) 
    {
        while (a[i] % 2 == 0)
        {
            counter++;
            a[i] /= 2;
        }
    }
    
    std::cout << counter << std::endl;
    
    return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	x := readInt64() // count of animals
	y := readInt64() // count of legs

	turu := int64(2)
	kame := int64(4)
	deltaTuruKame := kame - turu

	allTuruLegs := x * turu
	allKameLegs := x * kame

	delta := y - allTuruLegs

	if delta < 0 {
		fmt.Println("No")
		return
	}

	//奇数
	if y%2 != 0 {
		fmt.Println("No")
		return
	}

	//鶴のみ
	if delta == 0 {
		fmt.Println("Yes")
		return
	}

	//亀のみ
	if y-allKameLegs == 0 {
		fmt.Println("Yes")
		return
	}

	countOfSwap := delta / deltaTuruKame

	if countOfSwap > x {
		fmt.Println("No")
		return
	}

	if kame*countOfSwap+turu*(x-countOfSwap) == y {
		fmt.Println("Yes")
		return
	} else {
		fmt.Println("No")
		return
	}
}

var (
	scanner *bufio.Scanner
)

func init() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
}

func readInt64() int64 {
	var t string

	if scanner.Scan() {
		t = scanner.Text()
	}

	n, err := strconv.ParseInt(t, 10, 64)
	if err != nil {
		log.Fatal(err)
	}

	return n

}


Measured memory_bytes: 1816
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
def main():
    N, K = map(int, input().split())
    p_lsit = list(map(int, input().split()))

    p_lsit.sort()
    print(sum(p_lsit[:K]))

if __name__ == "__main__":
    main()



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

using namespace std;

int main () {

    int n;
    cin >> n;
    vector <int> h(n);

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

    vector<int> dp(n, INT_MAX);

    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        if (i+1 < n) {
            dp[i+1] = min(dp[i+1], dp[i] + abs(h[i] - h[i+1]));
        }

        if (i+2 < n) {
            dp[i+2] = min(dp[i+2], dp[i] + abs(h[i] - h[i+2]));
        }
    }

    cout << dp[n-1]<< endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
const int mod = (int)1e9 + 7;
const int maxN = 2e5+5;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	lli d, t, s;
	cin >> d >> t >> s;
	if(s*t >= d) cout << "Yes\n";
	else cout << "No\n";
	
	
	return 0;
}

Measured memory_bytes: 3636
from sys import stdin

def main():
    word = stdin.readline()
    max = 0
    count = 0
    for i in range(len(word)):
        if word[i] == "A" or word[i] == "C" or word[i] == "G" or word[i] == "T":
            count += 1
        elif max < count:
            max = count
            count = 0
    print(max)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#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 ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  int sx,sy,tx,ty;
  cin >> sx >> sy >> tx >> ty;
  
  REP(i,ty-sy) cout << 'U';
  REP(i,tx-sx) cout << 'R';
  REP(i,ty-sy) cout << 'D';
  REP(i,tx-sx) cout << 'L';
  
  cout << 'L';
  REP(i,ty-sy+1) cout << 'U';
  REP(i,tx-sx+1) cout << 'R';
  cout << 'D' << 'R';
  REP(i,ty-sy+1) cout << 'D';
  REP(i,tx-sx+1) cout << 'L';
  cout << 'U';

  return 0;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

bool is_prime(int a){
	for(int i=2;i*i<=a;i++){
		if(a%i==0) return false;
	}
	return true;
}
void mainmain(){
	
	int n;
	while(cin>>n,n){
		if(is_prime(n)){
			cout<<0<<endl;
			continue;
		}
		int x=n-1,y=n+1;
		while(!is_prime(x--));
		while(!is_prime(y++));
		cout<<y-x-2<<endl;
	}
}



}
main() try{
    mainmain();
}
catch(...){
}

Measured memory_bytes: 1160
target = input()
total_text = ""
while True:
 text = input()
 if(text=="END_OF_TEXT"):
  break
 total_text+=" "
 total_text+=text
#text2 = text.replace('\n',' ')
sentenceList = total_text.split()
count = 0
for word in sentenceList:
 if(word.lower() == target):
  count+=1
print(count)


Measured memory_bytes: 5552
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
   int N,M;
   cin >> N >> M;
   
   int x = 0;
   int y = 0;
   
   int X = 0;
   int Y = 0;
   int Z = 0;
   
   for(x=0;x<=N;x++){
       for(y=0;y<=(N-x);y++){
           if(M == x*10000+y*5000+(N-x-y)*1000){
               goto out;
           }
       }
   }
out:
   if(M == x*10000+y*5000+(N-x-y)*1000){
       
       X = x;
       Y = y;
       Z = (N-x-y);
   }else{
       X = -1;
       Y = -1;
       Z = -1;
   }
   
   cout << X << " " << Y << " " << Z << endl;
   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 0x3f3f3f3f;
typedef vector<ll> vll;
typedef pair<ll, ll> Pll;

const int MAXN = 100000 + 10;

int main() {
    ll N, K;
    cin >> N >> K;
    unordered_map<ll, ll> hashMap;
    ll x;
    for (int i = 0; i < N; ++i) {
        cin >> x;
        ++hashMap[x];
    }
    ll capacity = hashMap.size() - K;
    if (capacity <= 0) {
        cout << 0 << endl;
        return 0;
    }
    priority_queue<pair<ll, ll>> que;
    for (auto p = hashMap.begin(); p != hashMap.end(); ++p) {
        if (que.size() == capacity) {
            if (que.top().first <= p->second) continue;
            que.pop();
        }
        que.push(pair<ll, ll>(p->second, p->first));
    }
    ll ans = 0;
    while (!que.empty()) {
        ans += que.top().first;
        que.pop();
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 15684
#include <iostream>
#include <algorithm>
#include <vector>
int main() {
	int  a[3];
	std::cin >> a[0] >> a[1] >> a[2];

	std::sort(a, a+3);

	std::cout << a[0] <<" "<< a[1]<<" " << a[2] << std::endl;

 }


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

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T>
vector<vector<T> > make_v(size_t a,size_t b){
  return vector<vector<T> >(a,make_v<T>(b));
}
template<typename T>
vector<vector<vector<T> > > make_v(size_t a,size_t b,size_t c){
  return vector<vector<vector<T> > > (a,make_v<T>(b,c));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//INSERT ABOVE HERE
signed main(){
  Int h,w;
  while(cin>>w>>h,w){
    Int n;
    cin>>n;
    
    vector<Int> x1(n),y1(n),x2(n),y2(n);
    for(Int i=0;i<n;i++) cin>>x1[i]>>y1[i]>>x2[i]>>y2[i];

    vector<Int> vx,vy;
    vx.emplace_back(0);
    vx.emplace_back(w);
    vy.emplace_back(0);
    vy.emplace_back(h);

    for(Int i=0;i<n;i++){
      vx.emplace_back(x1[i]);
      vx.emplace_back(x2[i]);

      vy.emplace_back(y1[i]);
      vy.emplace_back(y2[i]);
    }

    auto comp=[](auto &v){
      sort(v.begin(),v.end());
      v.erase(unique(v.begin(),v.end()),v.end());
      map<Int, Int> m;
      for(Int i=0;i<(Int)v.size();i++) m[v[i]]=i;
      return m;
    };

    auto mx=comp(vx);
    auto my=comp(vy);

    //cout<<vy.size()<<" "<<vx.size()<<endl;
    
    auto dp=make_v<signed>(vy.size(),vx.size());
    fill_v(dp,0);
    
    for(Int i=0;i<n;i++){
      dp[my[y1[i]]][mx[x1[i]]]++;
      dp[my[y2[i]]][mx[x2[i]]]++;
      dp[my[y1[i]]][mx[x2[i]]]--;
      dp[my[y2[i]]][mx[x1[i]]]--;
    }
    
    for(Int i=0;i<(Int)vy.size();i++)
      for(Int j=1;j<(Int)vx.size();j++)
	dp[i][j]+=dp[i][j-1];

    for(Int i=1;i<(Int)vy.size();i++)
      for(Int j=0;j<(Int)vx.size();j++)
	dp[i][j]+=dp[i-1][j];
      
    auto used=make_v<signed>(vy.size(),vx.size());
    fill_v(used,0);

    auto show=[&]{
      return;
      for(int i=0;i<(int)vy.size();i++){
	for(int j=0;j<(int)vx.size();j++)
	  cout<<(dp[i][j]||used[i][j]?"#":" ");
	cout<<endl;
      }
      cout<<endl;
    };

    show();
    
    Int ans=0;
    auto bfs=[&](Int y,Int x){
      //cout<<y<<" "<<x<<endl;
      ans++; 
      using P = pair<Int, Int>;
      queue<P> q;
      used[y][x]=1;
      q.emplace(y,x);

      Int dy[]={0,0,1,-1};
      Int dx[]={1,-1,0,0};
      auto in=[&](Int y,Int x){
	return 0<=y&&y<(Int)vy.size()-1&&0<=x&&x<(Int)vx.size()-1;};
      
      while(!q.empty()){
	tie(y,x)=q.front();q.pop();
	for(Int k=0;k<4;k++){
	  Int ny=y+dy[k],nx=x+dx[k];
	  if(!in(ny,nx)||dp[ny][nx]||used[ny][nx]) continue;
	  used[ny][nx]=1;
	  q.emplace(ny,nx);
	}
      }

      show();
    };

    
    for(Int i=0;i<(Int)vy.size()-1;i++)
      for(Int j=0;j<(Int)vx.size()-1;j++)
	if(!dp[i][j]&&!used[i][j]) bfs(i,j);
    

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



Measured memory_bytes: 5348
s = input()
top = ''
q = int(input())
isReverse = False
for i in range(q):
    que = input().split()
    if(que[0] == '1'):
        isReverse = not isReverse
    else:
        if que[1] == '1':
            if isReverse:
                s += que[2]
            else:
                top += que[2]
        else:
            if isReverse:
                top += que[2]
            else:
                s += que[2]
if isReverse:
    s = s[::-1] + top
else:
    s = top[::-1] + s

print(s)

Measured memory_bytes: 4192
x,y = map(int, input().split())
ans = 0

dic = {1:300000, 2:200000, 3:100000}
if x in dic:
  ans = dic[x]
if y in dic:
  ans += dic[y]
  
if x==1 and y==1:
  ans += 400000
  
print(ans)

Measured memory_bytes: 3060
use std::io;
use std::io::prelude::*;
use std::iter::{once, repeat};

struct SegTree {
    n: usize,
    nodes: Vec<Option<i32>>,
}

impl SegTree {
    fn init(n: usize) -> SegTree {
        let n = 1 << f64::log2(n as f64).ceil() as usize;
        SegTree {
            n,
            nodes: once(Some(std::i32::MAX)).chain(repeat(None)).take(2 * n - 1).collect(),
        }
    }

    fn update(&mut self, s: usize, t: usize, x: i32, ni: usize, l: usize, r: usize) {
        if r <= s || t <= l {
            return;
        }
        if s <= l && r <= t {
            self.nodes[ni] = Some(x);
            return;
        }
        let m = (l + r) / 2;
        if let Some(y) = self.nodes[ni] {
            self.nodes[2*ni+1] = Some(y);
            self.nodes[2*ni+2] = Some(y);
            self.nodes[ni] = None;
        }
        self.update(s, t, x, 2 * ni + 1, l, m);
        self.update(s, t, x, 2 * ni + 2, m, r);
    }

    fn find(&self, i: usize, ni: usize, l: usize, r: usize) -> i32 {
        self.nodes[ni].unwrap_or_else(||{
            let m = (l + r) / 2;
            if i < m {
                self.find(i, 2 * ni + 1, l, m)
            } else {
                self.find(i, 2 * ni + 2, m, r)
            }
        })
    }
}

fn main() {
    let stdin = io::stdin();
    let mut lines = stdin.lock().lines();

    let line0 = lines.next().unwrap().unwrap();
    let n = line0.split_whitespace().next().unwrap().parse().unwrap();

    let mut mst = SegTree::init(n);

    for l in lines.map(Result::unwrap) {
        let mut words = l.split_whitespace();
        let com = words.next().unwrap().parse().unwrap();
        match com {
            0 => {
                let s: usize = words.next().unwrap().parse().unwrap();
                let t: usize = words.next().unwrap().parse().unwrap();
                let x = words.next().unwrap().parse().unwrap();
                let n = mst.n;
                mst.update(s, t + 1, x, 0, 0, n);
            }
            1 => {
                let i = words.next().unwrap().parse().unwrap();
                println!("{}", mst.find(i, 0, 0, mst.n));
            }
            _ => (),
        }
    }
}



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

typedef long long ll;
#define ALL(a) a, a+sizeof(a)/sizeof(a[0])
#define all(a) a.begin(),a.end()
#define MOD 1000000007
using namespace std;
ll gcd(ll n, ll m) {
	if (m == 0) return n;
	return gcd(m, n % m);
}
ll lcm(ll n, ll m) {return m / gcd(n, m) * n;}

int main(void) {
	ll d, l;
	cin >> d >> l;
	cout << d % l + d / l << endl;
	return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
const int64_t INF=9999999999999999;

int main() {
   int N;
   cin>>N;
   int a[N];
   for(int i=0;i<N;i++){
       cin>>a[i];
   }
   int count=0;
   for(int i=0;i<N;i++){
    if(a[a[i]-1]-1==i){count++;}
   }
   cout<<count/2<<endl;
return 0;}

Measured memory_bytes: 640
def cmp(A, B, i, j, N, M):
    for y in range(M):
        for x in range(M):
            if A[i+y][j+x] != B[y][x]:
                return False
    return True

def main():
    A = []
    B = []
    [N, M] = list(map(int, input().split()))
    for i in range(N):
        A.append(input())
    for i in range(M):
        B.append(input())

    for i in range(N-M+1):
        for j in range(N-M+1):
            if cmp(A, B, i, j, N, M):
                print("Yes")
                return
    print("No")
    return

main()


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

#define lim 100100
struct point {int x, y, t; };

int main() {
	int N;
	int x[lim], y[lim], t[lim];
	cin >> N;
	for (int i = 0; i < N; i++)cin >> t[i] >> x[i] >> y[i];

	//移動する絶対量が十分にあるうえで余りが偶数ならば移動可能
	point start = {};
	for (int i = 0; i < N; i++) {
		int delta_t = t[i] - start.t;
		int delta_x = abs(x[i] - start.x);
		int delta_y = abs(y[i] - start.y);
		int margin = delta_t - (delta_x + delta_y);
		if (margin >= 0 && margin % 2 == 0) {
			start = {x[i], y[i], t[i]};
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 1408
o=list(input())
m=list(input())
"""
ans=[]
for i in range(len(o)-1):
            ans.append(o[i])
            ans.append(m[i])
ans.append(o[-1])
if len(o)==len(m):
            ans.append(m[-1])
print("".join(ans))
"""
ans=' '
for i in range(len(o)-1):
            ans +=o[i]
            ans +=m[i]
ans +=o[-1]
if len(o)==len(m):
            ans+=m[-1]
print(ans)



Measured memory_bytes: 3064
def get_num(n, x):
    ans = 0
    for n3 in range(min(n, x), (x + 2) / 3, -1):
        for n2 in range(min(n3 - 1, x - n3), (x - n3 + 1) / 2 - 1, -1):
            for n1 in range(n2 - 1, 0, -1):
                if n1 + n2 + n3 == x:
                    ans += 1
                    break
    return ans


data = []
while True:
    [n, x] = [int(m) for m in raw_input().split()]
    if [n, x] == [0, 0]:
        break
    if x < 3:
        data.append(0)
        # print(0)
    else:
        data.append(get_num(n, x))
        # print(get_num(n, x))

for n in data:
    print(n)

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

#define ll long long
#define ar array
 
using namespace std;

int main() {
	
	int a,b,c,n;
	
	cin >> a >> b >> c;
	
	n = max(max(a,b),c);
	
	n= a+b+c-n;
	
	cout << n << endl;
	
   	return 0;
}
   

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v){stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modpow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isprime(ll n){if(n<2)return 0;if(!(n%2))return !(n-2);lll d=n-1,t,y;while(!(d%2))d>>=1;vl al={2,325,9375,28178,450775,9780504,1795265022};for(ll a:al){if(n<=a)break;t=d,y=modpow(a,t,n);while(t!=n-1&&y!=1&&y!=n-1)y=y*y%n,t<<=1;if(y!=n-1&&!(t%2))return 0;}return 1;}
void dout(double d){printf("%.12f\n",d);}
void YN(bool z){cout<<(z?"YES\n":"NO\n");}
void Yn(bool z){cout<<(z?"Yes\n":"No\n");}
void yn(bool z){cout<<(z?"yes\n":"no\n");}
mt19937 rnd; void set_rnd(){random_device r;rnd=mt19937(r());}
vl fact, rfact; void set_fact(int n, ll m){fact.pb(1);rfact.pb(1);FOR(i,1,n+1)fact.pb(fact[i-1]*i%m),rfact.pb(modpow(fact[i],m,m-2));}
const int iinf = 1e9+6;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 2e5;
void init(){
  set_rnd();
//  set_fact(N);
}
int n, a[N];
multiset<int> s;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  init();
  cin >> n;
  FOR(i, 0, n){
    cin >> a[i];
    s.insert(a[i]);
  }
  sort(a, a+n);
  int ans = 0;
  FORR(i, n-1, 0){
    if(s.find(a[i]) == s.end()) continue;
    s.erase(s.find(a[i]));
    FORR(j, 30, 0){
      if(1<<j <= a[i]){
        int b = (1<<(j+1)) - a[i];
        if(s.find(b) != s.end()){
          ans++;
          s.erase(s.find(b));
        }
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

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

typedef long long ll;

int N;
int A[4010];
char C[4010];
ll bit[2010];
ll dp[2010][2010];
ll cost[2][2010][2010];
ll INF = 1001001001001;

ll unit(int a,int b)
{
    if(a == N && b == N)return 0;
    if(a == N + 1 || b == N + 1)return INF;
    if(dp[a][b] != -1)return dp[a][b];
    dp[a][b] = min(unit(a + 1,b) + cost[0][a + 1][b],unit(a,b + 1) + cost[1][b + 1][a]);
    return dp[a][b];
}

void init()
{
    for(int i = 0; i <= N; i++)bit[i] = 0;
    return;
}

void add(int i)
{
    while(i <= N)
    {
        bit[i]++;
        i += i & -i;
    }
    return;
}

ll sum(int i)
{
    ll res = 0;
    while(i)
    {
        res += bit[i];
        i -= i & -i;
    }
    return res;
}



int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N * 2; i++)scanf(" %c%d",C + i,A + i);

    memset(dp,-1,sizeof(dp));

    init();
    for(int i = 0; i < N * 2; i++)
    {
        if(C[i] == 'W')
        {
            for(int j = 0; j <= N; j++)cost[0][A[i]][j] += sum(N) - sum(A[i]);
            add(A[i]);
        }
    }
    init();
    for(int i = 0; i < N * 2; i++)
    {
        if(C[i] == 'B')
        {
            for(int j = 0; j <= N; j++)cost[1][A[i]][j] += sum(N) - sum(A[i]);
            add(A[i]);
        }
    }

    init();
    for(int i = 0; i < N * 2; i++)
    {
        if(C[i] == 'W')
        {
            for(int j = 0; j <= N; j++)cost[0][A[i]][j] += sum(N) - sum(j);
        }
        else
        {
            add(A[i]);
        }
    }
    init();
    for(int i = 0; i < N * 2; i++)
    {
        if(C[i] == 'B')
        {
            for(int j = 0; j <= N; j++)cost[1][A[i]][j] += sum(N) - sum(j);
        }
        else
        {
            add(A[i]);
        }
    }

    printf("%lld\n",unit(0,0));

    return 0;
}


Measured memory_bytes: 95232
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const int INF = 1001001001;
const ll LINF = 1001001001001001001;

int main(){
    ll n , x, y; cin >> n>>x>>y;
    x--; y--;
    vector<ll> kosuu(n);
    kosuu.at(0) = INF;
    for(int i=1;i<=n-1;i++){
        kosuu.at(i) = n - i;
    }


    for(int i=0;i<=n-2;i++){
        for(int j=i+1;j<=n-1;j++){
            //バイパスを通らない
            ll p1 = j-i;
            //xを経由する場合
            ll p2 = abs(x-i) + abs(j-y) + 1;
            //yを経由する場合
            ll p3 = abs(y-i) + abs(j-x) + 1;
            ll bypass = min(p2,p3);
            if(p1>bypass){
                kosuu.at(p1)--;
                kosuu.at(bypass)++;
            }
            //cout << i << " " << j << " " << p1 << " " << bypass << endl;
        }
    }

    for(int i=1;i<=n-1;i++){
        cout << kosuu.at(i) << endl; 
    }
}

Measured memory_bytes: 256
def announce_winner(player):
    if player == 'a':
        print("A")
    elif player == 'b':
        print("B")
    else:
        print("C")

sa = input().strip()
sb = input().strip()
sc = input().strip()

a = []
b = []
c = []
for s in sa:
    a.append(s)
for s in sb:
    b.append(s)
for s in sc:
    c.append(s)

player = 'a'
p = a

while True:

    
    if p == []:
        announce_winner(player)
        break
    
    player = p[0]
    del(p[0])
    if player == 'a':
        p = a
    elif player == 'b':
        p = b
    elif player == 'c':
        p = c
    else:
        break


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
const int inf = 1e9;

int a[maxn];

int main(){
	ios_base::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	int cnt = 0;
	for (int i = 0; i < m; i++){
		cin >> a[i];
		if (a[i] & 1)
			cnt ++;
	}
	if (m == 1){
		if (n == 1)
			return cout << "1\n1\n1", 0;
		cout << a[0] << '\n' << 2 << '\n' << a[0]-1 << " " << 1 << '\n';
		return 0;
	}
	if (cnt > 2)
		return cout << "Impossible\n", 0;
	for (int i = 1; i < m; i++)
		if (a[i] & 1)
			swap(a[0], a[i]);
	for (int i = 1; i < m-1; i++)
		if (a[i] & 1)
			swap(a[i], a[m-1]);
	for (int i = 0; i < m; i++)
		cout << a[i] << " \n"[i == m-1];
	a[0] ++, a[m-1] --;
	if (a[m-1] == 0)
		m --;
	cout << m << '\n';
	for (int i = 0; i < m; i++)
		cout << a[i] << " \n"[i == m-1];
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include<iomanip>
#include <string>
using namespace std;

int main() {
    int N;
    cin >> N;
    int A[1000];

    for (int i=0;i<N;i++) cin >> A[i];

    for (int i=0;i<N-1;i++){
        cout << A[i] << " ";
    }
    cout << A[N-1] << endl;

    for (int i=1;i<N;i++){
        int v = A[i];
        int j = i - 1;
        while(j>=0 && A[j]>v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        for (int k=0;k<N-1;k++){
            cout << A[k] << " ";
        }
        cout << A[N-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 3072
///============================================================================
/// Name        : Faisal.cpp
/// Author      : Faisal Ahmed
/// Version     :
/// Copyright   : Your copyright notice
/// Description : C++, Ansi-style
///============================================================================

#include <bits/stdc++.h>

using namespace std;

#define M 1000000007

typedef long long int ll;
typedef long double ld;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int n;
	set<int> s;

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

        if(s.find(x) == s.end()){
            s.insert(x);
        }
        else{
            s.erase(x);
        }
	}

	cout << s.size() << endl;

	return 0;
}



Measured memory_bytes: 4992
#include <bits/stdc++.h>
typedef long long int lli;
#define mp make_pair

using namespace std;

int main()
{
	int n; cin>>n;
	
	int a[205];
	for ( int i=0 ; i<2*n ; i++ ) cin>>a[i];
	sort( a , a+2*n );
	
	int ans = 0;
	for ( int i=0 ; i<2*n ; i++ )
		ans += (i%2 ? 0 : a[i]);
	
	cout<<ans<<"\n";
	
	return 0;
}

Measured memory_bytes: 256
package main

import "fmt"
import "bufio"
import "os"
import "strconv"
import "sort"
import "math"

var _sw = bufio.NewScanner(os.Stdin)

func main() {
	N := NextInt()
	V := make([]int, N)
	for i := range V {
		V[i] = NextInt()
	}

	ReverseSortInts(V)
	sum := 0.0
	for i, v := range V {
		n := i + 1
		if n == len(V) {
			n = len(V) - 1
		}
		sum += float64(v) / math.Pow(2, float64(n))
	}
	fmt.Println(sum)
}

func init() {
	_sw.Split(bufio.ScanWords)
}

func NextInt() int {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	i, e := strconv.Atoi(_sw.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func NextString() string {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	return _sw.Text()
}

func Max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func Min(x, y int) int {
	if x > y {
		return y
	}
	return x
}

func SortInts(xs []int) {
	sort.Sort(sort.IntSlice(xs))
}

func ReverseSortInts(xs []int) {
	sort.Sort(sort.Reverse(sort.IntSlice(xs)))
}


Measured memory_bytes: 640
import numpy as np

def count(s):
    prev = ""
    cnt = 0
    dp = np.zeros(len(s)+1, dtype=int)
    for i, c in enumerate(s):
        if (prev == "A") and (c == "C"):
            cnt += 1
        prev = c
        dp[i+1] = cnt
    return dp

def solve(n, q, s, l, r):
    dp = count(s)
    for i in range(q):
        print(dp[r[i]] - dp[l[i]])

n, q = map(int, input().split())
s = input()
l = np.zeros(q, dtype=int)
r = np.zeros(q, dtype=int)
for i in range(q):
    l[i], r[i] = map(int, input().split())
solve(n, q, s, l, r)

Measured memory_bytes: 15848
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (auto &e : a) std::cin >> e;

    bool ret = std::all_of(a.begin(), a.end(), [](int i) {
        return i % 2 || i % 3 == 0 || i % 5 == 0;
    });

    std::cout << (ret ? "APPROVED" : "DENIED") << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main() {
  int n,m,x1,y1,x2,y2,mod=100000007;
  cin >> n >> m >> x1 >> y1 >> x2 >> y2;
  ll d[n][m],c[n][m];
  memset(c,0,sizeof(c));
  for(int i=0;i<n;i++)for(int j=0;j<m;j++)d[i][j]=mod;
  d[x1][y1]=0;
  c[x1][y1]=1;
  priority_queue<PP,vector<PP>,greater<PP> > que;
  que.push(PP(0,P(x1,y1)));
  while(!que.empty()) {
    PP p=que.top();que.pop();
    int xx=p.S.F,yy=p.S.S,cc=p.F;
    if(d[xx][yy]<cc) continue;
    for(int i=0; i<4; i++) {
      int x=xx+dx[i],y=yy+dy[i];
      if(x<0) x=n-1;
      if(x>=n) x=0;
      if(y<0) y=m-1;
      if(y>=m) y=0;
      if(d[x][y]>d[xx][yy]+1) {
        c[x][y]=c[xx][yy];
        d[x][y]=d[xx][yy]+1;
        que.push(PP(d[x][y],P(x,y)));
      } else if(d[x][y]==d[xx][yy]+1) {
        c[x][y]+=c[xx][yy];
        c[x][y]%=mod;
      }
    }
  }
  cout << c[x2][y2] << endl;
  return 0;
}

Measured memory_bytes: 18760
notice = int(input())
record = [[[0] * 10 for i in range(3)] for j in range(4)]

for _ in range(notice):
    b, f, r, v = map(int, input().split())
    record[b-1][f-1][r-1] += v

ans = ('\n' + '#' * 20 + '\n').join([ '\n'.join([' ' + ' '.join(map(str, floor)) for floor in building]) for building in record])
print(ans)


Measured memory_bytes: 5612
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def comb(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

n, a, b = list(map(int, input().split()))
mod = 10**9+7
print(int(pow(2, n, mod) - 1 - comb(n, a, mod) - comb(n, b, mod)) % mod)

Measured memory_bytes: 3064