akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, n) for(int i = 1; i < (int)(n); i++)
typedef long long ll;

int dp[100];

//最大公約数
int gcd(int x, int y){
  if(x % y == 0) return 1;
  return gcd(y, x % y);
}
//最小公倍数
int lcm(int x, int y){
  return x * y / gcd(x, y);
}
//フィボナッチ数列
//配列dpを-1で初期化する
int fib(int n){
  if(n == 0 || n == 1) return dp[n] = 1;
  if(dp[n] != -1) return dp[n];
  return dp[n] = fib(n - 1) + fib(n - 2);
}
//階乗計算(factorial)
int fact(int n){
  if(n = 1) return 1;
  return n * fact(n - 1);
}
//累乗計算(Exponentiation)
//x**y
ll expo(int x, int y){
  ll ans = 1;
  rep(i, y){
    ans *= x;
  }
  return ans;
}
//桁数
int keta(ll x){
  if(x == 0) return 1;
  int res = 0;
  while(x){
    x /= 10;
    res++;
  }
  return res;
}


int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  rep(i,n) cin >> p[i];

  int count = 0;
  rep(i, n){
    if(i+1 != p[i]) count ++;
  }
  if(count == 0 || count == 2) cout << "YES" << endl;
  else cout << "NO" << endl;
}


/*





















*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MOD_RATE 1000000007
#define MAX_N 100100

vector<lli> stairs_table(MAX_N, 1);
vector<lli> dp(MAX_N, 0);

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

  lli a;
  for(int i = 0; i < m; i++){
    cin >> a;
    stairs_table[a] = 0;
  }

  dp[0] = 1;
  for(int i = 0; i <= n; i++){
    dp[i] *= stairs_table[i];
    //cout << stairs_table[i] << endl;
    dp[i] %= MOD_RATE;
    dp[i+1] += dp[i];
    dp[i+2] += dp[i];
  }
  
  cout << dp[n] << endl;

}




Measured memory_bytes: 1792
import java.util.*;
import java.io.*;
public class Main{
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		PrintWriter ou = new PrintWriter(System.out);
		long n = Long.parseLong(sc.next());
		sc.close();
		if(n % 2 != 0) ou.print(0);
		else{
			long yono = 0;
			n /= 2;
			long five = 5;
			while(n / five != 0){
				yono += n / five;
				five *= 5;
			}
			ou.print(yono);
		}
		ou.print("\n");
		ou.flush();
    }
}

Measured memory_bytes: 35848
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop,heapify
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def b(i):
    # ord(i) -> Ascii value of i
    return ord(i)-ord('a')

file = 1


def solve():


    x=[599,799,999,1199,1399,1599,1799,1999]
 
    n=ii()
    for i in range(8):
        if n<=x[i]:
            print(8-i)
            break





        

        



    










        
if __name__ =="__main__":

    if(file):

        if path.exists('input.txt'):
            sys.stdin=open('input.txt', 'r')
            sys.stdout=open('output.txt','w')
        else:
            input=sys.stdin.readline
    solve()

Measured memory_bytes: 68296
package main

import "fmt"

func main() {
	var N, K int
	fmt.Scan(&N, &K)

	a := make([]int, N+1)
	for i := range a {
		a[i] = i
	}
	s := make([]int, N+2)
	for i := 0; i < N+1; i++ {
		s[i+1] = s[i] + a[i]
	}
	MOD := 1000000007
	count := 0
	for k := K; k <= N+1; k++ {
		max := s[N+1] - s[N+1-k]
		min := s[k]
		count += max - min + 1
		count %= MOD
	}
	fmt.Println(count)
}


Measured memory_bytes: 4996
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; }
template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; }
void debug_out() { cout << "\n"; }
template <class T, class... Args>
void debug_out(const T &x, const Args &... args) { cout << x << " "; debug_out(args...);}
#ifdef _DEBUG
  #define debug(...) debug_out(__VA_ARGS__)
#else
  #define debug(...) 
#endif

const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
  bool operator==(const mint rhs) const { return x == rhs.x; }
  bool operator!=(const mint rhs) const { return x != rhs.x; }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  int n;
  cin >> n;
  vector<ll> a(n),b(n);
  ll suma = 0,sumb = 0;
  rep(i,n) {
    cin >> a[i];
    suma += a[i];
  }
  rep(i,n) {
    cin >> b[i];
    sumb += b[i];
  }
  ll k = sumb - suma;
  if (k < 0) {
    cout << "No\n";
    return 0;
  }
  ll cntb = 0, cnta = 0;
  rep(i,n) {
    if (a[i] > b[i]) cntb += a[i]-b[i];
    else if (a[i] % 2 != b[i] % 2) {
      cntb++;
      b[i]++;
    }
  }
  rep(i,n) {
    if (a[i] < b[i]) cnta += (b[i] - a[i])/2;
  }
  debug(cnta, cntb);
  if (k >= cntb && k >= cnta) cout << "Yes\n";
  else cout << "No\n";
  return 0;
}

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

using namespace std;

typedef long long ll;

int main(){
  ll N,M; cin >> N >> M;
  
  
  vector<ll> vec;
  
  ll c = (ll)sqrt((double) M);
 
  for(ll a = 1; a <= c; a++){
    if( !( M % a )){ vec.push_back( a);  vec.push_back( M / a);}}
  
sort( vec.begin(),vec.end());
           
   reverse( vec.begin(),vec.end());
  
  for(int i = 0; i < (int) vec.size(); i++){
    ll g = vec[i];
    if( g * N <= M){ cout << g << endl; return 0;}}

  return 0;}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-9;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
int l[10];
random_device rnd;
mt19937 mt(rnd());
uniform_int_distribution<> rd(0, 65533);
void bogo_sort(int n) {
	bool f = true;
	bool used[10];
	while (f) {
		fill(used, used + n, false);
		vector<int> v; int cnt = 0;
		while (cnt<n) {
			int t = rd(mt) % n;
			if (used[t])continue;
			v.push_back(l[t]); used[t] = true; cnt++;
		}
		rep(i, n) {
			l[i] = v[i];
		}
		f = false;
		rep(i, n - 1) {
			if (l[i] > l[i + 1])f = true;
		}
	}
}
int main() {
	int n; cin >> n;
	rep(i, n) {
		cin >> l[i];
	}
	bogo_sort(n);
	int sum = 0;
	rep(i, n - 1) {
		sum += l[i];
	}
	if (sum > l[n - 1]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	//stop
	return 0;
}


Measured memory_bytes: 256
import collections

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

A.sort(reverse = True)
cnt = 0
for i in range(M):
    if A[i] >= sum(A) * (1/(4*M)):
        cnt += 1

if cnt >= M:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3436
#include<stdio.h>
int main(void)
{
  int i;
  int N,A[110];
  double a,b;
  scanf("%d",&N);
  for(i=0;i<N;i++)
    scanf("%d",&A[i]);
  for(i=0;i<N;i++)
    a += (double)1/A[i];
  b = 1/a;
  printf("%.5lf\n",b);
  return 0;
}

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

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();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<63;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

int main(void){
    int N,M,K; cin >> N >> M >> K;
    REP(i,N+1)REP(j,M+1){
        if(M*i + N*j - 2*i*j == K){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

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


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n,x,t; cin >> n >> x >> t;
    cout << (n+x-1)/x*t << endl;
}

Measured memory_bytes: 3632
#include<cstdio>
char isl[20][20];
int dy[]={-1,0,1,0},dx[]={0,1,0,-1};
void dfs(int y,int x){
    if(y<0||x<0||y>=12||x>=12)return;
    if(isl[y][x]=='1'){
        isl[y][x]='0';
        for(int i=0;i<4;i++)dfs(y+dy[i],x+dx[i]);
    }
}
int main(){
    while(scanf("%s",isl[0])!=EOF){
        for(int i=1;i<12;i++)scanf("%s",isl[i]);
        int cou=0;

        for(int i=0;i<12;i++){
            for(int j=0;j<12;j++){
                if(isl[i][j]=='1'){
                    cou++;
                    dfs(i,j);
                }
            }
        }
        printf("%d\n",cou);
    }
}

Measured memory_bytes: 972
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vs = vector<string>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vvp = vector<vector<pair<int,int>>>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;
template<typename T> bool chmax(T &a, T b) {if(a < b) {a = b;return 1;}return 0;}
template<typename T> bool chmin(T &a, T b) {if(a > b) {a = b;return 1;}return 0;}




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

    int N,M;
    cin >> N >> M;
    ll K;
    cin >> K;
    
    vl A(N+1),B(M+1);
    A[0] = 0, B[0] = 0;
    rep(i,N){
        ll a;
        cin >> a;
        
        A[i+1] = A[i] + a;
    }
    rep(i,M){
        ll b;
        cin >> b;
        
        B[i+1] = B[i]+b;
    }
    
    int ans = 0;
    rep(i,N+1){
        int an = i;
        if(K < A[i]) break;
        int j = upper_bound(all(B),K-A[i]) - B.begin() - 1;
        chmax(ans,an+j);
        //cout << i csp j << endl;
    }
    
    cout << ans << endl;
    
    
    

    return 0;
}


Measured memory_bytes: 6372
/*
ID: learnin7
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>

/*  Macros from Endagorion */
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;


int main(){
        
    ios_base::sync_with_stdio(0);
    
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    //fin >> a >> b;
    //fout << a+b << endl;
    int h,a;
    cin>>h>>a;
    cout<<(h+a-1)/a<<endl;
    return 0;
}



Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readInteger()
    val hs = readLongList()
    val dp = Array(n) { 10000000000 }
    dp[0] = 0
    for (i in 0 until (n - 1)) {
        dp[i + 1] = Math.min(dp[i + 1], dp[i] + Math.abs(hs[i + 1] - hs[i]))
        if (i < n - 2) {
            dp[i + 2] = Math.min(dp[i + 2], dp[i] + Math.abs(hs[i + 2] - hs[i]))
        }
    }
    println(dp[n - 1])
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


Measured memory_bytes: 55568
N, K, Q, = gets.split.map(&:to_i)
A = Q.times.map{gets.to_i}
result = Hash.new(0)
A.each do |a|
  result[a] += 1
end
N.times do |i|
  if (Q - result[i+1]) >= K
    puts 'No'
  else
    puts 'Yes'
  end
end


Measured memory_bytes: 7220
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
/*

int main() {
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    return 0;
}
*/
int gcd (int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}
int lcm (int x, int y) {
    return x*y / gcd(x,y);
}

int main() {
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];

    int bunbo; int LCM = a[0];
    rep(i,n) {
        LCM = lcm(a[i],LCM);
    }
    bunbo = LCM;

    int bunshi = 0;
    rep(i,n) {
        bunshi += LCM / a[i];
    }
    double ans = (double) bunbo / bunshi;
    cout << setprecision(6) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;

 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
  
 

ll sum(ll n) {
ll m=0;
  while(n){
    m+=n%10;
    n/=10;
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}




 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n,k;
    cin>>n>>k;
  vll A(n);
  FOR(i,0,n){
    cin>>A[i];
  }

  ll ans=INF;
  FOR(i,0,n-k+1){
    ll now;
    if(A[i]*A[i+k-1]<0){
      now=2*min(abs(A[i]),abs(A[i+k-1]))+max(abs(A[i]),abs(A[i+k-1]));
    }
    else{
      now=max(abs(A[i]),abs(A[i+k-1]));
    }
    chmin(ans,now);
  }

  cout<<ans<<endl;
}

Measured memory_bytes: 1024
import sys
input = sys.stdin.readline
def print_ans(A, B, T):
    """Test Case
    >>> print_ans(3, 5, 7)
    10
    >>> print_ans(3, 2, 9)
    6
    >>> print_ans(20, 20, 19)
    0
    """
    tmp, _ = divmod(T, A)
    print(tmp * B)

if __name__ == '__main__':
    A, B, T = map(int, input().rstrip().split())
    print_ans(A, B, T)




Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define REP(i,x,n) for(int i = (x); i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);


int main(void)
{
    ll n,cnt=0; cin>>n;
    vector<P> a(n);
    rep(i,n){
        ll x,l;
        cin>>x>>l;
        a[i] = {x+l,x-l};
    }
    sort(all(a));
    ll mini=-INF;
    rep(i,n) {
        if(mini <= a[i].second){
            cnt++;
            mini = a[i].first;
        }
    }
    cout<<cnt<<endl;
    return 0;
}

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


long long A[2];

int main(){
	int n;
	A[0]=2;
	A[1]=1;
	
	cin >> n;
	for(int i=2;i<=n;i++){
		A[i%2]=A[i%2]+A[(i+1)%2];
	}
	
	cout << A[n%2] << endl;
	return 0;
}

Measured memory_bytes: 256
# from pprint import pprint
# import math
# import collections

n = int(input())
# n, k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))

cnt = 0
for i in range(n):
    if (i + 1) % 2 == 1 and a[i] % 2 == 1:
        cnt += 1


print(cnt)

Measured memory_bytes: 9188
#include <iostream>
using namespace std;
int main(void){
    int a, b, c;
    cin >> a >> b >> c;
    if((c > a and c > b) or (c < a and c < b)){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
s=input()
K=int(input())
if len(s)<5:
    s_len = len(s)
else:
    s_len = 5
ans=list()
for length in range(1,s_len + 1):
    for pos in range(0,len(s)-length+1):
        tmp = s[pos:pos+length]
        if tmp not in ans:
            ans.append(tmp)
    ans.sort()
    if len(ans)>5:
        del ans[5:len(ans)+1]


print(ans[K-1])


Measured memory_bytes: 3328
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
count = Counter(a)
q = int(input())
ans = sum(a)

for i in range(q):
  b, c = map(int, input().split())
  ans += (c - b) * count[b]
  count[c] += count[b]
  count[b] = 0
  print(ans)

Measured memory_bytes: 24032
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		
		if(a>=1 && a<=100){
			if(b>=1 && b<=100){
				System.out.print(a*b+" ");
				System.out.println(a*2+b*2);
			}
		}
		
	}
	
}

Measured memory_bytes: 26092
N, M = map(int, input().split())
ks = [list(map(int, input().split())) for _ in range(M)]
p = list(map(int, input().split()))
ss = [[0 for _ in range(N)] for _ in range(M)]
for i, s in enumerate(ks):
    for j in range(len(s)-1):
        ss[i][s[j+1]-1] = 1
ans = 0
for i in range(2**N):
    tmp = 0
    for j in range(M):
        total = 0
        for k in range(N):
            if (i >> k) & 1 and ss[j][k] == 1:
                total += 1
        if total % 2 == p[j]:
            tmp += 1
    if tmp == M:
        ans += 1
print(ans)

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 1000000007

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define part(v, s, e) v.begin() + s, v.begin() + e
#define print(v) for (auto i: v) cout << i << " ";

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


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
string a;
int main()
{
	int n;
	cin>>a;
	cin>>n;
	for(int i=0;i<a.length();i++)
	{
		if(i%n==0) cout<<a[i];
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		System.out.println(calcMaximumProfit());
	}

	static int calcMaximumProfit() {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int min = scanner.nextInt();
		int max = Integer.MIN_VALUE;
		for (int i = 1; i < n; i++) {
			int a = scanner.nextInt();
			max = Integer.max(max, a - min);
			min = Integer.min(min, a);
		}
		scanner.close();
		return max;
	}

}



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

using namespace std;

int main(){
    int n, m;
    cin>>n>>m;
    vector <bool> ac(n);
    vector <int> pe(n);
    for(int i=0;i<n;i++){
        ac[i]=false;
        pe[i]=0;
    }
    for(int i=0;i<m;i++){
        int p;
        string s;
        cin>>p>>s;
        if(s=="AC"){
            ac[p-1]=true;
        }
        else if(s=="WA"){
            if(!ac[p-1]){
                pe[p-1]++;
            }
        }
    }
    int ans=0, ans2=0;
    for(int i=0;i<n;i++){
        if(ac[i]){
            ans++;
            ans2+=pe[i];
        }
    }
    cout<<ans<<" "<<ans2<<endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5+10;
int t;
string s;
map<string,int>mp;
map<string,int>::iterator it;
ll vis[N];
void init()
{
	for(ll i=1;i<=100000;i++)
	vis[i]=i*(i-1)/2;
}
int main()
{
	init();
	cin>>t;
	while(t--)
	{
		cin>>s;
		sort(s.begin(),s.end());
		mp[s]++;
	}
	ll ans=0;
	for(it=mp.begin();it!=mp.end();it++)
	ans+=vis[it->second];
	cout<<ans<<endl;
}

Measured memory_bytes: 11904
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
int main()
{
    int a,b;
    cin >> a>>b;

    int ans = 0;
    if(a==1) ans+=300000;
    if(a==2) ans+=200000;
    if(a==3) ans+=100000;
    if(b==1) ans+=300000;
    if(b==2) ans+=200000;
    if(b==3) ans+=100000;
    if(a==1&&b==1) ans+=400000;

    cout << ans<< endl;

   return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main() {
	int n;
	while (cin >> n){
		int ans=0;
		int i=0;
		while(i<600){
		ans+=(i*i)*n;
		i+=n;
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 3000
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
int main(void) {
    int n, l; cin >> n >> l;
    int ans = 0;
    int min = 1000000;
    rep(i, n) {
        if(min>abs(l+i)) min = abs(l+i);
    }bool flag = true;
    rep(i, n) {
        if(abs(l+i)==min&&flag) {flag=false; continue;}
        ans += l+i;
    }
    cout <<  ans;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LL long long
#define lc (x << 1)
#define rc (x << 1 | 1)
#define INF 0x3f3f3f3f
using namespace std;

template<class T> inline
void read(T& x) {
	int f = 1; x = 0;
	char ch = getchar();
	while (ch < '0' || ch > '9')   {if (ch == '-') f = -1; ch = getchar();}
	while (ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}

/*============ Header Template ============*/

const int N = 5000 + 5;
const int M = 200 + 5;

int n, m;
int q[N][M], top[M];
LL A[N];
LL B[N][M];
LL mx[N << 2], tag[N << 2];

void upd(int x) {mx[x] = max(mx[lc], mx[rc]);}
void make_tag(int x, LL val) {mx[x] += val; tag[x] += val;}
void push_down(int x) {
	if (tag[x]) {
		make_tag(lc, tag[x]);
		make_tag(rc, tag[x]);
		tag[x] = 0;
	}
}

void modify(int x, int l, int r, int s, int t, LL val) {
	if (s <= l && r <= t) return void(make_tag(x, val));
	push_down(x);
	int m = (l + r) >> 1;
	if (s <= m) modify(lc, l, m, s, t, val);
	if (m < t)  modify(rc, m + 1, r, s, t, val);
	upd(x);
}

LL getmax(int x, int l, int r, int s, int t) {
	if (s <= l && r <= t) return mx[x];
	push_down(x);
	int m = (l + r) >> 1; LL ans = -(1LL << 60);
	if (s <= m) ans = max(ans, getmax(lc, l, m, s, t));
	if (m < t)  ans = max(ans, getmax(rc, m + 1, r, s, t));
	return ans;
}

int main() {
	read(n), read(m);
	for (int i = 2; i <= n; i++) read(A[i]), A[i] += A[i - 1];
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= m; j++) read(B[i][j]);
	// printf("fuck\n");
	for (int i = 1; i <= m; i++) B[n + 1][i] = (1LL << 60);
	for (int i = 1; i <= m; i++) q[++top[i]][i] = n + 1;
	LL ans = 0;
	for (int i = n; i; i--) {
		modify(1, 1, n, i, i, -A[i]);
		for (int j = 1; j <= m; j++) {
			while (top[j] && B[i][j] > B[q[top[j]][j]][j]) {
				modify(1, 1, n, q[top[j]][j], q[top[j] - 1][j] - 1, -B[q[top[j]][j]][j]);
				top[j]--;
			}
			modify(1, 1, n, i, q[top[j]][j] - 1, B[i][j]);
			q[++top[j]][j] = i;
		}
		ans = max(ans, getmax(1, 1, n, i, n) + A[i]);
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 10368
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,y;
  cin >> n >> y;
  for(int i=0;i<=n;i++){
    for(int l=0;l<=n;l++){
      if((i*10000)+(l*5000)+(y-i*10000-l*5000) == y && i+l+((y-i*10000-l*5000)/1000) == n && !((y-i*10000-l*5000) < 0)){
        cout << i << ' ' << l << ' ' << (y-i*10000-l*5000)/1000;
        return 0;
      }
    }
  }
    cout << "-1 -1 -1";
}


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

using namespace std;
using ll = long long;

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define RS(N) resize(N)
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);
#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);

#define MOD 1000000007

void init();
void solve();

signed main()
{
	init();
	solve();
}

int N;
vector<int> A;

void init()
{
	cin >> N;
	CINV(A, N);
}

int X;

inline void add(int x, map<int, int>& m)
{
	m[x]++;
	if (m[x] == X) {
		m.erase(x);
		add(x-1, m);
	}
}

inline bool isok(int x)
{
	X = x;
	int pre = 0;
	map<int, int> m;
	rep(i, N) {
		if (pre < A[i]) {
			pre = A[i];
			continue;
		}
		pre = A[i];
		add(A[i], m);
		while (1) {
			auto itr = m.end();
			itr--;
			int x = (*itr).first;
			if (x > A[i]) m.erase(itr);
			else break;
		}
		if (m.count(0)) return false;
	}
	return true;
}

void solve()
{
	bool f = true;
	rep(i, N-1) {
		f &= A[i] < A[i+1];
	}
	if (f) {
		cout << 1 << endl;
		return;
	}
	int ok = 1000000000;
	int ng = 1;
	while (abs(ok - ng) > 1) {
		int mid = (ok + ng) / 2;
		if (isok(mid)) ok = mid;
		else ng = mid;
	}
	cout << ok << endl;
}





Measured memory_bytes: 1024
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  var n = sc.nextLong()
  var i: Long = 2
  var ans = 0
  while (i * i <= n) {
    var cnt = 0;
    while (n % i == 0) {
      cnt += 1
      n /= i
    }
    if (cnt > 0) {
      var k = 1;
      while (k * (k + 1) / 2 <= cnt) k += 1
      ans += k - 1
    }
    i += 1
  }
  if (n != 1) ans += 1
  println(ans)
}


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

int N;

string A,B,C;

int cnt;

int main(void)
{

    cin >> N >> A >> B >> C;

    for(int i=0;i<N;i++)
    {
        if(A[i]!=B[i]&&A[i]!=C[i])
        {
            cnt++;
        }

        if(B[i]!=C[i])
        {
            cnt++;
        }
    }

    cout << cnt << endl;
   
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
static const int mod = 1e9+7;
const Int Inf = 1e17;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int(i)=0; i<n; i++)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(pri2i,n-1)cout<<a[pri2i]<<' '; cout<<a[n-1]<<'\n';}
#define prip(p) cout<<p.fi<<' '<<p.se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char cf,cb;

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

  cin>>n; int d[n]={}; rep(i,n){cin>>x; d[x]++; cmax(m,x);} string ans="Impossible";
  for(int i=m; i>=m/2+1; i--)if(d[i]<2)END
  if(m%2&&d[(m+1)/2]!=2)END
  if(!(m%2)&&d[m/2]!=1)END
  rep(i,(m+1)/2)if(d[i])END
  pri1("Possible");
}

Measured memory_bytes: 256
#define debug 0
#define test 0
#define CPLUS 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#if CPLUS
#include <iostream>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <iterator>
#include <queue>
#include <map>
#include <unordered_map>
#include <functional>
#include <iomanip>
using namespace std;
#endif


int c[60];
int c1[60];
int c2[60];

int main(void)
{
#if debug
	freopen("in.txt", "r", stdin);
#endif
	string s, t;
	cin >> s >> t;
	int s_len = s.length();
	int equal = 0;
	for (int i = 0; i < s_len; i++) {
		if (s == t) {
			equal = 1;
			break;
		}
		char c = s[0];
		for (int j = 1; j < s_len; j++) {
			s[j - 1] = s[j];
		}
		s[s_len - 1] = c;
	}
	if (equal)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,c,n,i;
cin>>n;
for(i=0;i<n;i++){
cin>>a>>b>>c;
if(a*a==b*b+c*c){
cout<<"YES"<<endl;
}
else if(b*b==c*c+a*a){
cout<<"YES"<<endl;
}
else if(c*c==a*a+b*b){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
     return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
using namespace std;

const int mod = 1e9 + 7;
const int maxn = 4040;
long long f[2 * maxn], finv[2 * maxn];
long long dp[maxn + 1][maxn + 1];

long long binpow(long long a, int n) {
	if(n == 0) return 1;
	if(n & 1) return a * binpow(a % mod, n - 1) % mod;
	return binpow(a * a % mod, n / 2) % mod;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	f[0] = finv[0] = 1;
	for(int i = 1; i < 2 * maxn; i++) {
		f[i] = f[i - 1] * i % mod;
		finv[i] = binpow(f[i], mod - 2) % mod;
	}
	int n;
	cin >> n;
	int a[n], b[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
		dp[2000 - a[i]][2000 - b[i]]++;
	}
	for(int i = 0; i < maxn; i++) {
		for(int j = 0; j < maxn; j++) {
			(dp[i + 1][j] += dp[i][j]) %= mod;
			(dp[i][j + 1] += dp[i][j]) %= mod;
		}
	}
	long long ans = 0;
	for(int i = 0; i < n; i++) {
		ans += dp[a[i] + 2000][b[i] + 2000]; 
		ans %= mod;
		long long fa = f[2 * a[i] + 2 * b[i]] * finv[2 * a[i]] % mod;
		(fa *= finv[2 * b[i]]) %= mod;
		ans -= fa;
		ans %= mod;
		if(ans < 0) ans += mod;
	}
	cout << (ans + (ans & 1) * mod) / 2 << endl;
	return 0;
}

Measured memory_bytes: 132880
#include<cstdio>
main()
{
	int A,B,C,D,S1,S2;
	scanf("%d %d %d %d",&A,&B,&C,&D);
    A>=1&&A<=10-1e4;
    B>=1&&B<=10-1e4;
    C>=1&&B<=10-1e4;
    D>=1&&B<=10-1e4;
    S1=A*B;S2=C*D;
    if(S1<S2) printf("%d\n",S2);
    else if(S1>S2) printf("%d\n",S1);
    else printf("%d\n",S1);
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin>>h>>w;
  string s[100];
  for(int i=0;i<h;i++) cin>>s[i];

  int x[4]={0,1,0,-1};
  int y[4]={1,0,-1,0};

  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]=='.') continue;
      bool flag=false;
      for(int k=0;k<4;k++){
        int dx=x[k]+i;
        int dy=y[k]+j;
        if(dx<0 || dy<0 || h<=dx || w<=dy) continue;
        if(s[dx][dy]=='#') flag=true;
      }
      if(!flag){ cout<<"No"; return 0; }
    }
  }
  cout<<"Yes";

}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;

int main(){
  long long n,d;
  long long x,y,ans = 0;

  cin >> n >> d;

  for(int i=0;i<n;i++){
    cin >> x >> y;
    if(x*x + y*y <= d*d) ans++;
  }
  cout << ans;
  return 0;
}


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

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>


using namespace std;

template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {
    if (v.empty()) {
        ostr << "{ }";
        return ostr;
    }
    ostr << "{" << v.front();
    for (auto itr = ++v.begin(); itr != v.end(); itr++) {
        ostr << ", " << *itr;
    }
    ostr << "}";
    return ostr;
}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL<<60;


int main(void){

  long long N, W;
  cin >> N >> W;

  long long weight[N], value[N];
  for (int i = 0; i < N; ++i){cin >> weight[i] >> value[i];}

  long long dp[N+1][100100] = {0};

  for (int i = 0; i < N; ++i){
    for (int sum_w = 0; sum_w <= W; ++sum_w){
      if (sum_w >= weight[i]){
        chmax(dp[i+1][sum_w], dp[i][sum_w - weight[i]] + value[i]);
      }

      chmax(dp[i+1][sum_w], dp[i][sum_w]);
    }
  }


  cout << dp[N][W] << endl;

  return 0;
}


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

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  ll ans = a[0];
  ll i = 1, cnt = 1;
  while(cnt < n-1){
    ans += a[i]*2;
    i ++;
    cnt += 2;
    if(cnt == n) ans -= a[i-1];
  }
  cout << ans << endl;
}


Measured memory_bytes: 4800
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
ll mod = 1000000007, oo = 1000000009;

void Emsawy() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

#define clr(v,d)     memset(v, d, sizeof(v))
#define sz(v)	     ((int)((v).size()))
#define all(v)	     ((v).begin()), ((v).end())
#define allr(v)	     ((v).rbegin()), ((v).rend())
#define V	         vector
#define MP	         make_pair
#define bug(n)           cout<< #n <<" = "<< n << endl;
int dx[] = { 1, -1, 0, 0, 1, -1, 1, -1 };
int dy[] = { 0, 0, 1, -1, 1, -1, -1, 1 };

V<V<int> > adj;
const ll N = 1000 + 5;
int n, m, k, w;


int main() {

	//Emsawy(); 
	while (cin >> n) {
		if (n < 1000) cout << "ABC" << endl;
		else cout << "ABD" << endl;

	}
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
int cnt;
void insertionSort(int *a, int n, int g) {
	int i, v, j;
	for (int i = g; i < n; i++) {
		v = a[i];
		j = i - g;
		while (j >= 0 && a[j] > v) {
			a[j + g] = a[j];
			j = j - g;
			cnt++;
		}
		a[j + g] = v;
	}
}
int a[1000000];
int main() {
	cnt = 0;
	int g = 1, i, n, m = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)scanf("%d", &a[i]);
	while (g <= n)g = 3 * g + 1;
	while (true) {
		g = (g - 1) / 3;
		if (g == 0)break;
		m++;
		insertionSort(a, n, g);
	}
	g = 1;
	while (g <= n)g = 3 * g + 1;
	g = (g - 1) / 3;
	printf("%d\n%d", m, g);
	while (true) {
		g = (g - 1) / 3;
		if (g == 0)break;
		printf(" %d", g);
	}
	printf("\n%d\n", cnt);
	for (i = 0; i < n; i++)printf("%d\n", a[i]);
	return 0;
}


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

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

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

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1) ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1); return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e) return Mod(1);
        Mod r = *this ^ (e / 2); r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

vector<int> childs[1005];
vector<string> msg(1005);

void dfs(int x, int d) {
    rep(i, 0, d) cout << '.';
    cout << msg[x] << endl;
    for (int h : childs[x]) dfs(h, d + 1);
}

int x[10][10];

int op(int a, int b) {
    return x[a][b];
}

int check(int a, int b, int c, int d) {
    return op(op(op(op(0, a), b), c), d);
}
int check2(int a, int b, int c, int d, int e) {
    int v = op(op(op(op(op(0, a), b), c), d), e);
    // if (!v) {
    //     printf("%d%d%d%d%d\n", a, b, c, d, e);
    // }
    return v;
}

int main() {
    rep(i, 0, 10) rep(j, 0, 10) cin >> x[i][j];
    int ans = 0;
    rep(a, 0, 10) rep(b, 0, 10) rep(c, 0, 10) rep(d, 0, 10) {
        int e = check(a, b, c, d);
        bool bad = false;
        rep(i, 0, 10) {
            if (i != a) bad |= !check2(i, b, c, d, e);
            if (i != b) bad |= !check2(a, i, c, d, e);
            if (i != c) bad |= !check2(a, b, i, d, e);
            if (i != d) bad |= !check2(a, b, c, i, e);
            if (i != e) bad |= !check2(a, b, c, d, i);
        }
        if (a != b) bad |= !check2(b, a, c, d, e);
        if (b != c) bad |= !check2(a, c, b, d, e);
        if (c != d) bad |= !check2(a, b, d, c, e);
        if (d != e) bad |= !check2(a, b, c, e, d);
        ans += !!bad;
    }
    cout << ans << endl;
}


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

int r, g, b;
int n, R, G, B;
int ans;
int main(){
  cin >> R >> G >> B >> n;
  for(int r = 0; r*R <= n; r++){
    for(int g = 0; r*R + g*G <= n; g++){
      if((n - (r*R + g*G)) % B == 0) ans ++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
/**
 * @author      : cromarmot (yexiaorain@gmail.com)
 * @license     : GPL
 * @created     : 星期六 11月 23, 2019 20:04:24 CST
 */

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define ten5 100000+10
#define MOD 1000000007
#define rep(i,a,n) for (int i=a;i<n;i++)
#define iif(c,t,f) ((c)?(t):(f))
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
const double pi = acos(-1.0);

int x;

int y;
int f(int v){
  if(v==1)return 300000;
  if(v==2)return 200000;
  if(v==3)return 100000;
  return 0;
}

int main(){
  cin>>x>>y;
  int ans = f(x)+f(y);
  if(x==y && x==1){
    ans+=400000;
  }
  cout<<ans<<endl;

  return 0;
}

/*
 *
 * hash prime
   61,83,113,151,211,281,379,509683,911
   1217,1627,2179,2909,3881,6907,9209
   12281,16381,21841,29123,38833,51787,69061,92083
   122777,163729,218357,291143,388211,517619,690163,999983
   1226959,1635947,2181271,2908361,3877817,5170427,6893911,9191891
   12255871,16341163,21788233,29050993,38734667,51646229,68861641,91815541
   122420729,163227661,217636919,290182597,386910137,515880193,687840301,917120411
   1000000007,1000000009
 * */



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define A first
#define B second
using namespace std;

typedef long long ll;
typedef pair <int, int> pi;
constexpr double PI = atan(1) * 4;
constexpr int inf = 0x3f3f3f3f;
inline int LSB(int i) {return (i & -i);}

int n, pt[100005][3], h[100005][3], ans;

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

	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> pt[i][0] >> pt[i][1] >> pt[i][2];
	}    
	h[0][0] = pt[0][0];
	h[0][1] = pt[0][1];
	h[0][2] = pt[0][2];
	for(int i = 1; i < n; i++){
		for(int j = 0; j < 3; j++){
			h[i][j] = max(h[i-1][(j+1)%3], h[i-1][(j+2)%3]) + pt[i][j];
		}
	}
	ans = max(h[n-1][0], h[n-1][1]);
	ans = max(ans, h[n-1][2]);
	cout << ans << endl;
    return 0;
}



Measured memory_bytes: 5936
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(ll i=0;i<(n);++i)
#define Fr(i,n) for(long long i=1;i<=(n);++i)
#define ifr(i,n) for(long long i=(n)-1;i>=0;--i)
#define iFr(i,n) for(long long i=(n);i>0;--i)

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s,t;
  cin>>s>>t;
  reverse(s.begin(),s.end());
  if(s==t){
    cout<<"YES";
  }
  else{
    cout<<"NO";
  }
}

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

vector<int> graph[101];
int n;

void bfs(int start){
	vector<int> d(n+1,-1);
	d[1]=0;

	queue<int> Q;
	Q.push(start);

	while(Q.size()){
		int u=Q.front();	Q.pop();
		for(int v:graph[u]){
			if(d[v]>=0)continue;

			d[v]=d[u]+1;
			Q.push(v);
		}
	}

	for(int i=1;i<=n;i++){
		cout<<i<<" "<<d[i]<<endl;
	}

	return;
}

int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		int u,k;	cin>>u>>k;
		for(int j=0;j<k;j++){
			int v;	cin>>v;
			graph[u].push_back(v);
		}
	}


	bfs(1);

	return 0;
}



Measured memory_bytes: 3152
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <iomanip>
#include <queue>

#define rep(i,n) for(int i = 0; i < n; i++)
#define rep1(i,n) for(int i = 1; i <= n; i++)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
using namespace std;

int main()
{
	int N, M;
	cin >> N >> M;
	vector<int> X(M);
	rep(i, M) cin >> X[i];
	sort(ALL(X));
	int ans = 0;
	if (N < M)
	{
		vector<int> d(M - 1);
		rep(i, M - 1) d[i] = X[i + 1] - X[i];
		sort(ALL(d),greater<int>());
		for (int i = N-1; i < d.size(); i++)
		{
			ans += d[i];
		}
	}
	co(ans);
	return 0;
}

Measured memory_bytes: 1024
Scanf.scanf "%d" (fun n ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in

    let rec loop l r cur acc =
        if l = n then acc else
            if r = n || cur land a.(r) <> 0
                then loop (l + 1) r (cur lxor a.(l)) (acc + r - l)
                else loop l (r + 1) (cur lxor a.(r)) acc
    in
    loop 0 1 a.(0) 0 |> Printf.printf "%d\n"
)

Measured memory_bytes: 6144
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <utility>

using namespace std;
typedef long long ll;
inline int getint(){
  char c; int res = 0;
  for(c = getchar();c < '0' || c > '9';c = getchar());
  for(;c >= '0' && c <= '9';c = getchar()) res = res * 10 + (c - '0');
  return res;
}

int main(){
	int a = getint(),b = getint();
	if(b % a == 0) printf("%d\n",a + b);
	else printf("%d\n",b - a);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	int *A = new int[N];
	for(int i = 0; i < N; i++) {
		cin >> A[i];
		A[i]--;
	}
	int C = 0;
	for(int i = 0; i < N; i++) {
		if(A[A[i]] == i) C++;
	}
	cout << C / 2 << endl;
}

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

int main() {
    int n, k, h, ans = 0;
    cin >> n >> k;
    rep(i, n) {
        cin >> h;
        if(h >= k) ans++;
    }
    cout << ans << endl;
}

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

using namespace std;

typedef pair<int,int> pii;
typedef long long ll;

int main()
{
	string D;
	cin >> D;
	if( D.size() >= 4 && D.substr(0, 4) == "YAKI" ) printf("Yes\n");
	else printf("No\n");
	return 0;
}


Measured memory_bytes: 256