akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

char s[2001][2000];
int k[2000];

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

    int h, w;
    cin >> h >> w;

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

    int r = 0;
    for (int i = 0; i < h; i++) {
        int l = 0;
        for (int j = 0; j < w; j++) {
            if (s[i][j] == '.') {
                if (k[j] == 0) {
                    int t = i + 1;
                    while (t < h && s[t][j] == '.') t++;
                    k[j] = t - i;
                }
                if (l == 0) {
                    int t = j + 1;
                    while (t < w && s[i][t] == '.') t++;
                    l = t - j;
                }
                r = max(r, k[j] + l);

            } else {
                k[j] = 0;
                l = 0;
            }
        }
    }

    cout << r - 1 << endl;

    return 0;
}

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

const int mod = 1e9 + 7;

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;
    cin >> n >> k;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vector<int> dp(k + 1);
    dp[0] = 1;
    for (int i = 0; i < n; ++i) {
        vector<int> sum(k + 2);
        for (int j = 0; j < k + 1; j++) {
            sum[j + 1] = sum[j] + dp[j];
            sum[j + 1] %= mod;
        }
        for (int j = 0; j < k + 1; j++) {
            dp[j] = (sum[j + 1] - sum[max(0ll, j - a[i])] + mod) % mod;
        }
    }
    cout << dp[k] << endl;
}


Measured memory_bytes: 4776
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstring>
#include <cstdio>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map> //pair is also included in this library
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define REP(i, s, n) for(int i = (int)(s); i < (int)(n); i++)
#define fst first
#define snd second
#define MP make_pair //incase c++11 or later is not available

using namespace std;

typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//prefer define statement
//for reason that const int ver. of INF will raise a silly warning (unused variable)
#define INF (INT_MAX/3)
#define LIM_INF (INT_MAX)
//const int INF = INT_MAX/3;
#define PI = 3.14159265358979323846
/*------------------------------------------------------------------------------*/

int main(){
  string S;
  cin >> S;

  bool ans = false;

  REP(i, 0, S.size() - 1){
    if(S[i] == 'A' && S[i+1] == 'C'){
      ans = true;
    }
  }

  if(ans){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<tuple>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
	int a, b;
	cin >> a >> b;
	cout << (b - a)*(b - a + 1) / 2 - b << endl;
	return 0;
}

Measured memory_bytes: 256
'''
Created on 2020/09/14

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write

  S=int(pin())
  mod=10**9+7
  dp=[0]*(S+1)
  dp[0]=1
  for i in range(3,S+1):
    dp[i]=(dp[i-1]+dp[i-3])%mod 
  print(dp[S])
  return
main()
#解説AC

Measured memory_bytes: 9160
#include <iostream>

using namespace std;

int main() {
	bool prime[100010]{};
	int a[100010]{};
	fill(prime + 2, prime + 100000, true);
	for (int i = 2; i*i <= 100000; i++) {
		if (prime[i]) {
			for (int j = 2; i*j <= 100000; j++) {
				prime[i*j] = false;
			}
		}
	}
	for (int i = 3; i <= 100000; i++) {
		if (prime[i] && prime[(i + 1) / 2])a[i] = 1;
		a[i] += a[i - 1];
	}
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int l, r;
		cin >> l >> r;
		cout << a[r] - a[l - 1] << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
ll Max(ll(a), ll(b), ll(c)) {
	return max(max(a, b), c);
}
ll Min(ll(a), ll(b), ll(c)) {
	return min(min(a, b), c);
}





int main() {
	string SA, SB, SC;
	cin >> SA >> SB >> SC;
	ll NA = SA.size(), NB = SB.size(), NC = SC.size();
	ll a = 0, b = 0, c = 0;
	ll k = SA.at(a);
	a++;
	while(1) {
		if (k == 'a') {
			if (a == NA) {
				cout << "A" << endl; return 0;
			}
			k = SA.at(a);
			a++;
		}
		else if (k == 'b') {
			if (b == NB) {
				cout << "B" << endl; return 0;
			}
			k = SB.at(b);
			b++;
		}
		else if (k == 'c') {
			if (c == NC) {
				cout << "C" << endl; return 0;
			}
			k = SC.at(c);
			c++;
		}

	}

}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

const int mod = 1000000007;
ll R,R2,modash;
int logR;
ll MR(ll x){
    ll ret = (x + (((x&(R-1ll))*modash)&(R-1ll))*mod)>>(logR);
    return (ret>=mod ? ret-mod : ret);
}
int get_mod(ll x){return (int)MR(MR(x)*R2);}
void init(){
    R=1ll;logR=0;modash=0;
    while(R<mod){R<<=1;logR++;}
    R2=R*R%mod;
    int t=0,r=R,i=1;
    while(r>1){
        if((t&1)==0){t+=mod;modash+=i;}
        t>>=1;r>>=1;i<<=1;
    }
}

vector<vl> mul(vector<vl> a, vector<vl> b){
  int n = a.size();
  vector<vl> ret(n,vl(n,0));
  REP(k,n)REP(i,n)REP(j,n){
    ret[i][j] += get_mod(a[i][k]*b[k][j]);
    if(ret[i][j]>=mod) ret[i][j] -= mod;
  }
  return ret;
}

int main(){
  int n,k,c,t;
  scanf("%d%d%d%d",&n,&k,&c,&t);
  // ????§???????
  // 0?§???????1?§????...4?§????????£??????§??\?????????????????°t?????§?????¨?????????
  vector<vl> mat(5*n,vl(5*n,0));
  // ??????????§?
  REP(i,4){
    REP(j,n) mat[i*n+j][(i+1)*n+j] += 1;
  }
  // ?????????????§?
  REP(_,k){
    int a,b,tm;
    scanf("%d%d%d",&a,&b,&tm);
    // --a; --b;
    --tm;
    REP(i,n){
      int from;
      if(i<b) from = i+a-1;
      else if(i<b+a-1) from = i-b;
      else from = i;
      int to = i;
      mat[tm*n+to][from] += 1;
    }
  }
  // REP(po,5*n){
  //   DEBUG_VEC(mat[po]);
  // }
  // cout<<endl;
  init();
  // ?´????
  vector<vl> ans(5*n,vl(5*n,0));
  REP(i,5*n) ans[i][i]=1;
  while(t){
    if(t&1) ans = mul(ans,mat);
    mat = mul(mat,mat);
    t>>=1;
  }
  // DEBUG
  // REP(po,5*n){
  //   DEBUG_VEC(ans[po]);
  // }
  cout<<ans[0][c-1]<<endl;
  return 0;
}

Measured memory_bytes: 2712
#include "bits/stdc++.h"
 
using namespace std;
 
#define sp(x) cout<<setprecision(x);
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX*0.99
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define yes "Yes"
#define no "No"
#define divs 1000000007
#define dive 1000000009
#define pi 3.141592653589793238 
 
typedef pair<int, int> P;
 

void solve(string S){
    int n = S.length();
    int ans = 0;
    for(int bit = 0; bit<(1<<(n-1));bit++){
        int now = 0;
        REP(i,n){
            if(bit&(1<<i)){
              	ans += stol(S.substr(now,i-now+1));
              	//cout<<stol(S.substr(now,i-now+1))<<endl;
              	now = i+1;
            }
        }
      	ans+=stol(S.substr(now,n-now));
    }
    cout<<ans<<endl;
}
 
signed main(){
    // ios::sync_with_stdio(false);
    // cin.tie(0);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
    string S;
    cin>>S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
N = int(input())
s = [input() for _ in range(N)]

ht = []
h = []
t = []

cnt = 0

for i, ss in enumerate(s):
    cnt += ss.count('AB')

    a = ss[-1] == 'A'
    b = ss[0] == 'B'
    if a:
        if b:
            ht.append(i)
        else:
            t.append(i)
    else:
        if b:
            h.append(i)

len_h = len(h)
len_t = len(t)
len_ht = len(ht)

ans = cnt
if len_ht > 0:
    ans += len_ht - 1
    if len_t > 0:
        len_t -= 1
        ans += 1
    if len_h > 0:
        len_h -= 1
        ans += 1
ans += min(len_h, len_t)
print(ans)


Measured memory_bytes: 4084
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, X, a, ans = INF;
    cin >> n >> X;
    vector<ll> sum(n+1,0);
    for(int i=0;i<n;i++) cin >> a, sum[i+1] = sum[i] + a;
    for(int i=1;i<=n;i++){
    	ll num = X * i + (sum[n] - sum[n-i]) * 5;
    	for(int j=2; (j-1)*i < n && num < ans; j++) 
    		num += (j<<1|1) * (sum[n -(j-1)*i] - sum[max(n-j*i, 0LL)]);
    	ans = min(ans, num);
    }
    cout << ans + n * X << endl;
    return 0;
}



Measured memory_bytes: 1792
#include <iostream>

using namespace std;

int main() {
    int N, T;

    cin >> N >> T;

    int c, t;
    int min_c = 0;
    for (int i = 0; i < N; i++){
        cin >> c >> t;

        if (t <= T && (min_c == 0 || c < min_c)){
            min_c = c;
        }
    }

    if (min_c == 0){
        cout << "TLE" << endl;
    } else {
        cout << min_c << endl;
    }

    return 0;
}



Measured memory_bytes: 384
def mycounter(d,i):
    if i in d:
        d[i]+=1
    else:
        d[i]=1
    return d

n=int(input())
a=list(map(int,input().split()))
d=dict()
for i in a:
    d=mycounter(d,i)
#print(d)
l=sorted([[i,j] for i,j in d.items() if j>1])
#print(l)
if l==[] or (len(l)==1 and l[-1][1] < 4):
    print(0)
else:
    print(l[-1][0]**2 if l[-1][1]>3 else l[-1][0]*l[-2][0])

Measured memory_bytes: 18060
#include <bits/stdc++.h>
#define long long long
#define ull unsigned long long
#define up(i,a,b) for (int i=a; i<=b; i++)
#define down(i,a,b) for (int i=a; i>=b; i--)
#define endl '\n'
#define pb push_back
#define X first
#define Y second
#define II pair<int, int>
#define III pair<int, pair<int, int> >
#define V vector
#define debug(X) cerr<< #X << " = " <<X << endl
#define debug2(X,Y) cerr<< #X << " = " <<X << ","<<#Y<<" = "<<Y<<endl
#define show(X,a,b) {cerr << #X << " = "; up(__,a,b) cerr << X[__] << ' '; cerr << endl;}
#define gc getchar
#define pc putchar

using namespace std;

inline void read(int &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for (;((c<48 || c>57) && c != '-') ;c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}
inline void writeln(int x){

         char buffor[21];
         register int i=0;
         int neg=0; if (x<0) {neg=1; x= -x;}
         do{
               buffor[i++]=(x%10)+'0';
               x/=10;
            } while(x);
           i--;
           if (neg) pc('-');
           while(i>=0) pc(buffor[i--]);
           pc('\n');
       }

void input()
{
	int n;
	long t,res= 1;
	cin>>n;
	up(i,1,n)
	{
		cin>>t;
		long g= __gcd(res,t);
		res= res/ g * t;
	}
	cout<<res;
}

void solve()
{

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);// don't use when interactive
    #define TASK "tmp"
 //   freopen(TASK".inp","r",stdin);
  //  freopen(TASK".out","w",stdout);

    input();
    solve();

    return 0;
}


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

#define int long long
#define inf (int)1000000007

#define rep(i, n) for(int i = 0; i < (n); i++)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rrep(i, n) for(int i = (n); i >= 0; i--)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)
#define rfor(i, s, t) for(int i = (t) - 1; i >= (s); i--)

signed main() {
  int n;
  cin >> n;
  int k = 0;
  rep(i, n) {
    int w;
    cin >> w;
    if(w % 2 == 1) {
      k++;
    }
  }
  if(k % 2 == 0) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
}


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

        signed main() {
        int n;
        cin>>n;
       pair<int,int> x[n],y[n];
       int a,b,c,d;
       for(int i=0;i<n;i++){
           cin>>a>>b;
           x[i]=make_pair(a,b);
       }
       for(int i=0;i<n;i++){
           cin>>c>>d;
           y[i]=make_pair(c,d);
       }
       sort(x,x+n);sort(y,y+n);
       int ans=0,j=0;
       for(int i=0;i<n;i++){
           while(j<n&&x[j].first<y[i].first){
               x[j]=make_pair(-1*x[j].second,x[j].first);
               j++;
           }
           sort(x,x+j);
           for(int k=0;k<j;k++){
               if(x[k].first!=1&&-1*x[k].first<y[i].second){
                   x[k].first=1;
                   ans++;
                   //cerr<<x[k].second<<' '<<y[i].second<<endl;
                   break;
               }
           }
       }
       cout<<ans<<endl;
     //  for(int i=0;i<n;i++)cerr<<signed(used[i])<<endl;

        }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using Int = long long;  // clang-format off
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(v) std::begin(v), std::end(v)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io;
#ifndef dump
#define dump(...)
#endif  // clang-format on

/**
 *    author:  knshnb
 *    created: Sun Aug  2 21:01:23 JST 2020
 **/

/// @docs src/Helper/BinarySearch.md
template <class F> long long binary_search(long long ok, long long ng, F check) {
    while (std::abs(ok - ng) > 1) {
        long long mid = (ok + ng) / 2;
        (check(mid) ? ok : ng) = mid;
    }
    return ok;
}

signed main() {
    Int n, K;
    std::cin >> n >> K;
    std::vector<Int> a(n);
    REP(i, n) std::cin >> a[i], a[i] *= 2;
    Int ans = binary_search(1e10, 0, [&](Int mid) {
        Int num = 0;
        REP(i, n) { num += (a[i] + mid - 1) / mid; }
        return num <= K + n;
    });
    std::cout << (ans + 1) / 2 << std::endl;
}


Measured memory_bytes: 4724
public class Main {


  private static void solve() {
    long a = nl();
    long b = nl();
    a--;
    if (a < 0) a = 0;

    if (a % 4 == 1) {
      a = 1;
    } else if (a % 4 == 2) {
      a ++;
    } else if (a % 4 == 3) {
      a = 0;
    }

    if (b % 4 == 1) {
      b = 1;
    } else if (b % 4 == 2) {
      b ++;
    } else if (b % 4 == 3) {
      b = 0;
    }
    System.out.println(a ^ b);

  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
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++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int y, m, d;
    char c1, c2;
    cin >> y >> c1 >> m >> c2 >> d;
    if(m<=4) cout << "Heisei" << endl;
    else cout << "TBD" << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7704
#include<queue>
#include<cstdio>
#include<cctype>
#include<vector>
#include<cstring>
#include<functional>
namespace IO
{
    char ibuf[(1<<21)+1],obuf[(1<<21)+1],st[15],*iS,*iT,*oS=obuf,*oT=obuf+(1<<21);
    char Get(){return (iS==iT? (iT=(iS=ibuf)+fread(ibuf,1,(1<<21)+1,stdin),(iS==iT? EOF:*iS++)):*iS++);}
    void Flush(){fwrite(obuf,1,oS-obuf,stdout),oS=obuf;}
    void Put(char x){*oS++=x;if(oS==oT)Flush();}
    int read(){int x=0,c=Get();while(!isdigit(c))c=Get();while(isdigit(c))x=x*10+c-48,c=Get();return x;}
    void write(int x){int top=0;while(x)st[++top]=(x%10)+48,x/=10;while(top)Put(st[top--]);Put('\n');}
}using namespace IO;
using std::vector;
using std::priority_queue;
int min(int a,int b){return a<b? a:b;}
const int N=500007,inf=0x7f7f7f7f;
vector<int>e[N];priority_queue<int,vector<int>,std::greater<int>>Q;
int n,k,p[N],q[N],mn[N<<2],deg[N];
#define ls p<<1
#define rs p<<1|1
#define mid ((l+r)>>1)
void pushup(int p){mn[p]=min(mn[ls],mn[rs]);}
void update(int p,int l,int r,int x,int v)
{
    if(r==l) return (void)(mn[p]=v);
    (x<=mid? update(ls,l,mid,x,v):update(rs,mid+1,r,x,v)),pushup(p);
}
int query(int p,int l,int r,int L,int R)
{
    if(r<L||R<l) return inf;
    if(L<=l&&r<=R) return mn[p];
    return min(query(ls,l,mid,L,R),query(rs,mid+1,r,L,R));
}
int main()
{
    int n=read(),k=read(),m=0;memset(mn,0x7f,sizeof mn);
    for(int i=1;i<=n;++i) q[read()]=i;
    for(int i=n,j;i;--i)
    {
	if((j=query(1,1,n,q[i]+1,q[i]+k-1))^inf) ++deg[q[j]],e[q[i]].push_back(q[j]);
	if((j=query(1,1,n,q[i]-k+1,q[i]-1))^inf) ++deg[q[j]],e[q[i]].push_back(q[j]);
	update(1,1,n,q[i],i);
    }
    for(int i=1;i<=n;++i) if(!deg[i]) Q.push(i);
    for(int u;!Q.empty();)
    {
	q[++m]=u=Q.top(),Q.pop();
	for(int v:e[u]) if(!--deg[v]) Q.push(v);
    }
    for(int i=1;i<=n;++i) p[q[i]]=i;
    for(int i=1;i<=n;++i) write(p[i]);
    return Flush(),0;
}


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

int n, a, b;
vector<long long int> v, w;
long double ans;
vector<int> m;
long long int num;

long long int comb(int p, int q){
	if(q > p-q) return comb(p, p-q);
	long long int res = 1;
	for(int i=1; i<=q; ++i){
		res *= p-i+1;
		res /= i;
	}
	return res;
}

int main(){
	cin >> n >> a >> b;
	for(int i=0; i<n; ++i){
		long long int t;
		cin >> t;
		v.push_back(t);
	}
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());
	w = v;
	for(int i=1; i<n; ++i)
		w[i] += w[i-1];
//	for(int i=0; i<n; ++i)
//		cout << v[i] << "\t" << w[i] << endl;
	for(int i=a; i<=b; ++i){
		long double tmp = (long double)w[i-1]/i;
//		printf("%d\t%.6Lf\n", i, tmp);
		if(ans < tmp){
			ans = tmp;
			m.clear();
			m.push_back(i);
		}else if(abs(ans - tmp) < 1e-6){
			m.push_back(i);
		}
	}
/*	for(int i=a; i<=b; ++i)
		printf("%lld\n", v[i]);
	printf("%.6Lf\n", (long double)w[a-1]/a);
*/	for(int i=0; i<m.size(); ++i){
//		cout << m[i] << endl;
		int p = 0, q = 0;
		for(int j=0; j<n; ++j)
			if(v[m[i]-1] == v[j]){
				++p;
				if(j <= m[i]-1) ++q;
			}
		num += comb(p, q);
	}
	printf("%.6Lf\n", ans);
	cout << num << endl;
}

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

using namespace std;

int main(){
    long long int n;

    while(cin>>n){
        if(n==0)break;
        else{
            long long int ans=1000001;
            vector<long long int> v;

            for(int i=0;i<n;i++){
                long long int a;
                cin>>a;
                v.push_back(a);
            }

            sort(v.begin(),v.end());
            
            for(int i=0;i<n-1;i++){
                ans=min(ans,v[i+1]-v[i]);
            } 
            cout<<ans<<endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3076
#include<iostream>
#include<algorithm>

using namespace std;

#define NMAX 200
#define RMAX 1000
#define INF 100000000

typedef long long ll;

int main(void){

	ll N,M;
	ll x,y,t;
	char sl;
	ll R,zi;
	ll bzi;
	ll ans;
	ll ldp[NMAX+2][NMAX+2];
	ll sdp[NMAX+2][NMAX+2];
	ll dp[NMAX+2][RMAX+2];

	while(1){

		cin>>N>>M;
		if(N==0&&M==0) break;

		for(int i=0;i<=N;i++){
			for(int j=0;j<=N;j++){
				ldp[i][j]=INF;
				sdp[i][j]=INF;
			}
			ldp[i][i]=0;
			sdp[i][i]=0;
		}

		for(int i=0;i<M;i++){
			cin>>x>>y>>t>>sl;
			if(sl=='L'){
				ldp[x][y]=min(ldp[x][y],t);
				ldp[y][x]=min(ldp[y][x],t);
			}
			else{
				sdp[x][y]=min(sdp[x][y],t);
				sdp[y][x]=min(sdp[y][x],t);
			}
		}

		for(int k=1;k<=N;k++){
			for(int i=1;i<=N;i++){
				for(int j=1;j<=N;j++){
					ldp[i][j]=min(ldp[i][j],ldp[i][k]+ldp[k][j]);
					sdp[i][j]=min(sdp[i][j],sdp[i][k]+sdp[k][j]);
				}
			}
		}

		cin>>R;

		for(int i=0;i<=N;i++){
			for(int j=0;j<=R;j++){
				dp[i][j]=INF;
			}
		}

		cin>>bzi;

		for(int i=1;i<=N;i++){
			dp[i][0]=sdp[bzi][i]+ldp[i][bzi];
		}

		for(int i=1;i<R;i++){
			cin>>zi;
			for(int j=1;j<=N;j++){
				for(int k=1;k<=N;k++){
					//cout<<i<<","<<j<<","<<k<<","<<dp[j][i]<<","<<ldp[j][zi]<<","<<sdp[k][j]<<","<<ldp[bzi][k]<<","<<dp[k][i-1]<<","<<ldp[zi][bzi]<<endl;
					if(j!=k) dp[j][i]=min(dp[j][i],ldp[j][zi]+sdp[k][j]+ldp[bzi][k]+dp[k][i-1]);
					else dp[j][i]=min(dp[j][i],dp[k][i-1]+ldp[bzi][zi]);
				}
			}
			bzi=zi;
		}

		ans=dp[1][R-1];
		for(int i=2;i<=N;i++){
			ans=min(ans,dp[i][R-1]);
		}
		cout<<ans<<endl;
	}

}

Measured memory_bytes: 3372
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
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; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
const long long MOD = 1e9 + 7;
const int MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    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;
    }
}

// 二項係数計算
long long COM(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;
}

map<ll, ll> prime_factor(ll N)
{
    map<ll, ll> res;
    for (ll i = 2; i * i <= N; i++) {
        while(N % i == 0) {
            ++res[i];
            N /= i;
        }
    }
    if (N != 1) res[N] = 1;
    return res;
}

int main()
{
    ll N, M;
    cin >> N >> M;

    COMinit();
    map<ll, ll> prime = prime_factor(M);

    ll ans = 1;
    for (auto itr : prime) {
        ans *= COM(itr.second + N - 1, N - 1);
        ans %= MOD;
    }

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

Measured memory_bytes: 23808
#include<stdio.h>

int main(void)
{

    int a,b,c;
    
    scanf("%d %d %d",&a,&b,&c);
    
    if(a>=b&&a>=c){
        if(b>=c)printf("%d %d %d\n",c,b,a);
        else if(c>=b)printf("%d %d %d\n",b,c,a);
    }
    else if(b>=a&&b>=c){
        if(a>=c)printf("%d %d %d\n",c,a,b);
        else if(c>=a)printf("%d %d %d\n",a,c,b);
    }
    else if (c>=b&&c>=a){
        if(b>=a)printf("%d %d %d\n",a,b,c);
        else if(a>=b)printf("%d %d %d\n",b,a,c);
    }

    return 0;
}


Measured memory_bytes: 2036
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1000000007;
signed main(){
  int N;
  cin>>N;
  vector<int> A(N);
  A[0]=3;
  int ans=1;
  while(N--){
    int a;
    cin>>a;
    ans=ans*A[a]%mod;
    A[a]--,A[a+1]++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 4036
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> V;

int main() {
  int a, b;
  cin >> a >> b;
  dump(a%3 == 0 || b%3 == 0 || (a+b)%3 == 0 ? "Possible" : "Impossible");
  return 0;
}


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

int main(){
    int n;
    scanf("%d",&n);
    int a[100005];
    int i;
    for(i=0;i<=100004;i++)a[i]=0;
    for(i=1;i<=n;i++){
        int c;
        scanf("%d",&c);
        a[c]=1;
    }
    int ans=0;
    for(i=1;i<=100004;i++){
        if(a[i]==1)ans++;
    }
    if(ans%2==0)ans--;
    printf("%d",ans);
    return 0;
}

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

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

    ll t = 0;
    rep(i,m) t += b[i];

    int j = m;
    int ans = 0;
    rep(i,n+1){
        while(j>0 && t>k){
            --j;
            t -= b[j];
        }
        if(t>k) break;
        ans = max(ans,i+j);
        if(i==n) break;
        t += a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4840
package main

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

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	d := io.NextInt()
	for i := 0; i < d; i++ {
		io.Println(1)
	}
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 1780
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ve vector
#define chmin(x,y) x = min(x,y)

const int INF = 1e9 + 10;

int main(){
    int n,m,l;
    cin >> n >> m >> l;
    ve<ve<int>> dist(n,ve<int>(n,INF));
    rep(i,n) dist[i][i] = 0;
    rep(i,m){
        int a,b,c;
        cin >> a >> b >> c;
        a--; b--;
        dist[a][b] = c;
        dist[b][a] = c;
    }
    rep(k,n)rep(i,n)rep(j,n) chmin(dist[i][j], dist[i][k]+dist[k][j]);
    ve<ve<int>> dist2(n,ve<int>(n,INF));
    rep(i,n)rep(j,n){
        if(dist[i][j]<=l) dist2[i][j] = 1;
    }
    rep(k,n)rep(i,n)rep(j,n) chmin(dist2[i][j], dist2[i][k] + dist2[k][j]);
    int q;
    cin >> q;
    rep(Q,q){
        int s,t;
        cin >> s >> t;
        s--; t--;
        int ans = dist2[s][t]-1;
        if(ans == INF-1) ans = -1;
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 4312
using System;

class small
{
    public static void Main()
    {
        String a = Console.ReadLine();
        char b = ' ';
        String[] c = a.Split(b);

        int d = int.Parse(c[0]);
        int e = int.Parse(c[1]);

        if (d < e)
        {
            Console.WriteLine("a < b");
        } else if (d > e)
        {
            Console.WriteLine("a > b");
        }else 
        {
            Console.WriteLine("a == b");
        }

    }
}


Measured memory_bytes: 8884
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

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

    int n;
    cin >> n;

    map <int, int> mp;
    vector <int> vec;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        if (mp[a] == 0) vec.push_back(a);
        mp[a]++;
    }

    if (vec.size() == 1) {
        if (mp[0] == n) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
        return 0;
    }

    if (n % 3 != 0) {
        cout << "No\n";
        return 0;
    }

    if (vec.size() == 2) {
        if (mp[0] == n / 3) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    } else if (vec.size() == 3) {
        bool f = true;

        if ((vec[0] ^ vec[1]) != vec[2]) f = false;

        if (mp[vec[0]] != n / 3) f = false;
        if (mp[vec[1]] != n / 3) f = false;
        if (mp[vec[2]] != n / 3) f = false;

        if (f) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    } else {
        cout << "No\n";
    }

    return 0;
}

Measured memory_bytes: 4216
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n;
		int x;
		int a[];
		int mostRightColor;
		int index;
		int count;

		n = sc.nextInt();
		while (n != 0) {
			a = new int[n];
			count = 0;
			index = 0;
			mostRightColor = -1;
			for (int i = 0; i < n; i++) {
				x = sc.nextInt();
				if ((i + 1) % 2 == 0) {
					if (mostRightColor == x) {
						a[index - 1]++;
					} else {
						if (index == 1) {
							a[index - 1]++;
						} else {
							a[index - 2] += a[index - 1] + 1;
							index--;
						}
						mostRightColor = x;
					}
				} else {
					if (mostRightColor == x) {
						a[index - 1]++;
					} else {
						a[index++] = 1;
						mostRightColor = x;
					}
				}
			}
			int i = (mostRightColor + (index % 2) + 1) % 2;
			for (; i < index; i += 2) {
				count += a[i];
			}
			System.out.println(count);
			n = sc.nextInt();
		}
	}
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define LL long long
LL mod = 1000000007;
int n,m;
int a[100001];
LL dp[100001];
int main(){
  cin>>n>>m;
  REP(i,n+1)a[i]=0;
  REP(i,m){
    int tmp;
    cin>>tmp;
    a[tmp]=1;
  }
  REP(i,n+1){
    if(i>1 && a[i]!=1){
      dp[i] = (dp[i-1]+dp[i-2])%mod;
    }else if(i > 0 && a[i]!=1){
      dp[i] = (dp[i-1])%mod;
    }else{
      dp[0]=1;
    }
  }
  cout<<dp[n]<<endl;
  return 0;
}


Measured memory_bytes: 1408
#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 long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
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(iinclude<snt i=sta;i<=n;i++)
const ld eps = 1e-6;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;

typedef pair<int, P> speP;

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

int h, w;
char mp[50][50];
int d[50][50];
void solve() {
	cin >> h >> w;
	char a, b; cin >> a >> b;
	rep(i, h)rep(j, w) {
		cin >> mp[i][j];
		d[i][j] = mod;
	}
	priority_queue<speP, vector<speP>, greater<speP>> q;
	rep(i, h)rep(j, w)if (mp[i][j] == a) {
		q.push({ 0,{i,j} });
		d[i][j] = 0;
	}
	while (!q.empty()) {
		speP p = q.top(); q.pop();
		int x = p.second.first, y = p.second.second;
		rep(j, 4) {
			int nx = x + dx[j];
			int ny = y + dy[j];
			if (nx < 0 || ny < 0 || nx >= h || ny >= w)continue;
			if (mp[nx][ny] == '.')continue;
			int cost = 0;
			if (mp[x][y] == '|'&&mp[nx][ny]=='o') {
				if (j % 2 == 0)cost = 1;
				else cost = mod;
			}
			else if (mp[x][y] == '-'&&mp[nx][ny] == 'o') {
				if (j % 2)cost = 1;
				else cost = mod;
			}
			else if (mp[x][y] == 'o'&&mp[nx][ny] == '|'&&j%2) {
				cost = mod;
			}
			else if (mp[x][y] == 'o'&&mp[nx][ny] == '-'&&j%2==0) {
				cost = mod;
			}
			if (d[nx][ny] > cost + d[x][y]) {
				d[nx][ny] = cost + d[x][y];
				q.push({ d[nx][ny],{nx,ny} });
			}
		}

	}
	rep(i, h)rep(j, w)if (mp[i][j] == b)cout << d[i][j] << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
		return 0;
}


Measured memory_bytes: 3172
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;

signed main() {
    ll a, b;
    cin >> a >> b;
    if (a % 2 == 1 && b % 2 == 1) {
        mes("Yes");
        re0;
    }
    
    mes("No");
    
    
    
    
    

}
    
    
    
    
    


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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;

int main()
{
    string s;
    cin >> s;
    reverse(all(s));

    vector<string> t = {
        "dream",
        "dreamer",
        "erase",
        "eraser"};
    rep(i, t.size()) { reverse(all(t[i])); }

    int n = 0;
    bool ans = 1;
    while (n != s.size())
    {
        bool flag = 0;
        int tmp = 0;
        rep(i, 4)
        {
            if (s.substr(n, t[i].size()) == t[i])
            {
                flag = 1;
                tmp = i;
            }
        }
        if (flag)
        {
            n += t[tmp].size();
        }
        else
        {
            ans = 0;
            break;
        }
    }
    cout << (ans ? "YES" : "NO") << endl;
    return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> A(N);
    for (auto& a : A) {
        cin >> a;
    }
    vector<int> B(A);
    sort(all(B));
    map<int, int> pos_map;
    rep(i, 0, B.size()) {
        pos_map[B[i]] = i + 1;
    }
    vector<int> C(N);
    rep(i, 0, N) {
        C[i] = pos_map[A[i]];
    }
    int ans = 0;
    for (int i = 1; i < N; i += 2) {
        ans += C[i] % 2;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6144
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(int argc, char* argv[]){
    int A, B, K;
    vector<int> v;
    cin >> A >> B >> K;
    if(B - A < K * 2){
        for(int i = A; i <= B; i++){
            v.push_back(i);
        }
    } else {
        for(int i = 0; i < K; i++){
            v.push_back(A + i);
            v.push_back(B - i);
        }
    }
    sort(v.begin(), v.end());
    for(auto i : v){
        cout << i << endl;
    }
}

Measured memory_bytes: 256
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let input: Vec<i32> = s.split_whitespace().map(|x| x.parse::<i32>().unwrap()).collect();

    let base = input[0] % 1000;
    if input[0] / 1000 == 1 {
        println!("ABD");
    } else {
        println!("ABC");
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define ios; ios::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define ls(x) (x<<1)
#define rs(x) (ls(x)|1)
#define eps 1e-11
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef double db;
mt19937 rnd(random_device{}());
const int mod = 998244353;
const int N = 6e5 + 5;
const int M = 1e6 + 5;
inline ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
inline ll lcm(ll a,ll b){ return a*b/gcd(a,b); }
inline ll ksm(ll x,ll y){ ll res=1; while(y){if(y&1) res=res*x%mod;
x=x*x%mod; y>>=1;} return res; }
int n, m, k;
pii a[N];
pii vx[N], vy[N];
set<int> st[N];

int main(){
    ios;
    cin>>n>>m>>k;
    int tot=0;
    rep(i,1,k){
        int x,y;
        cin>>x>>y;
        a[i].fi=x, a[i].se=y;
        vx[x].fi++, vx[x].se=x;
        vy[y].fi++, vy[y].se=y;
        st[y].insert(x);
    }
    sort(vy+1,vy+1+300000,greater<pii>());
    vector<int> Y;
    rep(i,1,300000){
        if(vy[i].fi==vy[1].fi) Y.pb(vy[i].se);
    }
    int ans=0;
    pii tmp;
    sort(vx+1,vx+1+300000,greater<pii>());
    rep(i,1,300000){
        if(vx[i].fi!=vx[1].fi) break;
        tmp.fi=vx[i].se; tmp.se=vy[1].se;
        int res=1;
        for(int x:Y){
            if(st[x].count(tmp.fi)==0){
                res=0;
                break;
            }
        }
        ans=max(ans,vx[i].fi+vy[1].fi-res);
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 54560
/**********
Author: WLBKR5
Problem: ABC176 A
Date: 2020/08/22
**********/
#include<bits/stdc++.h>
using namespace std;
inline int getint(){
    int ans=0,f=1;
    char c=getchar();
    while(c>'9'||c<'0'){
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        ans=ans*10+c-'0';
        c=getchar();
    }
    return ans*f;
}
int main(){
    int a=getint(),b=getint(),c=getint();
    cout<<(long long)(ceil(a*1.0/b)*c);
}

Measured memory_bytes: 3644
package main

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

type pair struct {
	l, r int
}

func m() {
	n, q := getInt(), getInt()
	s := []rune(getString())
	ps := make([]pair, q)
	for i := range ps {
		ps[i].l = getInt() - 1
		ps[i].r = getInt() - 1
	}

	cSum := make([]int, n+1)
	for i := 0; i < n; i++ {
		cSum[i+1] = cSum[i]
		if i < n-1 {
			if (s[i] == 'A') && (s[i+1] == 'C') {
				cSum[i+1]++
			}
		}
	}

	for _, p := range ps {
		res := cSum[p.r] - cSum[p.l]
		puts(res)
	}
}

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

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
)

func main() {
	buf := 200001
	scanner.Buffer(make([]byte, buf), buf)
	scanner.Split(bufio.ScanWords)
	m()
	writer.Flush()
}

func getInt() int {
	scanner.Scan()
	i, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func getIntSlice(n int) []int {
	is := make([]int, n)
	for i := range is {
		is[i] = getInt()
	}
	return is
}

func getString() string {
	scanner.Scan()
	s := scanner.Text()
	return s
}

func puts(a ...interface{}) {
	if _, err := fmt.Fprintln(writer, a...); err != nil {
		panic(err)
	}
}


Measured memory_bytes: 5632
#include<stdio.h>
#include<stdlib.h>

int main(){
  int w,h,x,y,r;
  scanf("%d%d%d%d%d",&w,&h,&x,&y,&r);
  if(0<r && r<=h/2 && r<=w/2 && r<=y && r<=x && y+r<=h && x+r<=w ){
    printf("Yes\n");
  }else{
    printf("No\n");
  }

  return 0;
}


Measured memory_bytes: 2052
import java.util.Scanner;

public class Main{
    
    static void putArray(int[] array){
        System.out.print(array[0]);
        for(int i = 1; i < array.length; i++){
            System.out.print(" " + array[i]);
        }
        System.out.println();
    }
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] array = new int[num];
        for(int i = 0; i < array.length; i++){
            array[i] = sc.nextInt();
        }
        
        putArray(array);
        
        for(int i = 1; i < array.length; i++){
            int v = array[i];
            int j = i - 1;
            while(j >= 0 && array[j] > v){
                array[j + 1] = array[j];
                j--;
            }
            array[j + 1] = v;
            putArray(array);
        }
        
        
    }
}


Measured memory_bytes: 32292
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll num[200005];
ll pre[200005];
map<ll, ll> mp;
int main()
{
        //freopen("out.txt", "w", stdout);
        ll anser = 0;
        mp[0] = 1;
        int n;
        cin >> n;
        for (int i = 1; i <= n; i++)
        {
                cin >> num[i];
        }
        for (int i = 1; i <= n; i++)
        {
                pre[i] = pre[i - 1] + num[i];
                if (mp[pre[i]])
                {
                        anser += mp[pre[i]];
                }
                mp[pre[i]]++;
        }
        cout << anser << endl;
}


Measured memory_bytes: 15872
#include <stdio.h>

int main(void)
{
  int n, m, i, j;
  scanf("%d %d", &n, &m);
  int a[n][m], b[m], c[n];

  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%d", &a[i][j]);
    }
  }

  for (i = 0; i < m; i++) {
    scanf("%d", &b[i]);
  }

  for (i = 0; i < n; i++) {
    c[i] = 0;
    for (j = 0; j < m; j++) {
      c[i] += a[i][j] * b[j];
    }
    printf("%d\n", c[i]);
  }

  return 0;
}

Measured memory_bytes: 640