akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int main()
{
    long x,y;
    cin>>x>>y;
    if(4*x-y<0)
        cout<<"No";
    else
    {
        if((4*x-y)%2==0 && (4*x-y)/2<=x)
            cout<<"Yes";
        else
            cout<<"No";
    }
    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <limits>
#include <vector>
#include <map>
#include <cmath>
#include <limits>
#include <iomanip>
#include <queue>
#include <bitset>
#define ll long long int
#define ld long double
#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 cosp(x) cout << x << " "
#define all(x) x.begin(),x.end()
#define p pair<ll,ll>
#define pb push_back
#define mp make_pair
#define PI 3.14159265359

using namespace std;
int main(){
    int n;
    cin >> n;
    ll sum = 0;
    rep1(i,n+1) sum += i;
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
char a[1000];
int main()
{
  scanf("%s",a);
  for(int i=0;i<strlen(a);i++)
    if(a[i]=='C')
      for(int j=i+1;j<strlen(a);j++)
        if(a[j]=='F')
        {
          printf("Yes");
          return 0;
		}
  printf("No");
  return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
  int main(void){
      int a,b,c,temp;
      scanf("%d %d %d",&a,&b,&c);
      if(a>c){
        temp=a;
        a=c;
        c=temp;
      }
      if(b>c){
        temp=b;
        b=c;
        c=temp;
      }
      if(a>b){
        temp=a;
        a=b;
        b=temp;
      }
      printf("%d %d %d\n",a,b,c);
      return 0;
  }


Measured memory_bytes: 2128
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
const ll MOD = 1e9 + 7 ; 
const ll INF = 1e9 + 10;
ll n;
vector<double>h;
double dfs(ll i){
	if(i>=n)return 1;
	double choice1 = h[i] * dfs(i+1);
	double choice2 = (1-h[i]) * dfs(i+1);
	return choice1+choice2;
}
int main(){
	fastio;
	cin>>n;
	int ans=1;
	for(int i=0;i<3;i++){
		ans*=n;
	}
	cout<< ans<<endl;
}	

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }

ll n, a, b, c, d;

// { res, cost }
vector<pair<ll, ll>> step(ll x) {
	vector<pair<ll, ll>> res;

	res.push_back({ x/2, a+d*(x%2) }); // down+2
	if (x%2) res.push_back({ (x+1)/2, a+d*(2-x%2) }); //up+2
	res.push_back({ x/3, b+d*(x%3) }); // down+3
	if (x%3) res.push_back({ (x+2)/3, b+d*(3-x%3) }); //up+3
	res.push_back({ x/5, c+d*(x%5) }); // down+5
	if (x%5) res.push_back({ (x+4)/5, c+d*(5-x%5) }); //up+5
	if (x<=5'000'000'000ll) res.push_back({ 0, d*x }); // jt 0

	return res;
}

void solve() {
	map<ll, ll> mindist;
	priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq;
	
	read(n, a, b, c, d);

	mindist[n] = 0;
	pq.push({ 0, n });

	while (!pq.empty()) {
		ll st,cost;
		tie(cost,st) = pq.top(); pq.pop();

		if (cost > mindist[st]) {
			continue;
		}

		//printf("%lld = %lld\n", st,cost);
		
		for (auto [to,del] : step(st)) {
			if (mindist.find(to) == mindist.end() || cost+del < mindist[to]) {
				mindist[to] = cost+del;
				pq.push({ mindist[to], to });
			}
		}
	}

	write(mindist[0]);
}

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	int n; read(n);
	rep(i, 0, n) solve();
}


Measured memory_bytes: 4480
//Partition

#include <stdio.h>
#define MAX 100000

int Partition(int,int);

int A[MAX],length;


int main() {
	int i,q;


//input
	scanf("%d",&length);
	for(i=0;i<length;i++){
		scanf("%d",&A[i]);
	}


	q=Partition(0,length-1);


//output
	for(i=0;i<length;i++){
		if(i){
			printf(" ");
		}
		if(i==q){
			printf("[");
		}
		printf("%d",A[i]);
		if(i==q){
			printf("]");
		}
	}
	printf("\n");

	return 0;
}


int Partition(int p,int r){
	int x,i,j,ponpon;
	x=A[r];
	i=p-1;
	for(j=p;j<r;j++){
		if(A[j]<=x){
			i++;
			ponpon=A[i];
			A[i]=A[j];
			A[j]=ponpon;
		}
	}
	ponpon=A[i+1];
	A[i+1]=A[r];
	A[r]=ponpon;

	return i+1;
}



Measured memory_bytes: 2124
import java.util.ArrayList;
import java.util.Scanner;

// https://atcoder.jp/contests/abc081/tasks/abc081_b
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);

		int length = scanner.nextInt();

		// 値の取得
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i=0;i<length;i++) {
			list.add(scanner.nextInt());
		}

		boolean flag = true;
		int count = 0;
		do{
			// 値が全て偶数かの確認（trueの時、全て偶数）
			for(int i=0;(i<length)&&flag;i++){
				if(list.get(i)%2!=0) {
					flag = false;
				}
			}

			if(flag) {
				// 偶数の時、全ての値を割る2した値に更新する。
				for(int j=0;(j<length);j++){
					list.set(j,list.get(j)/2);
				}
				// 偶数の時、操作回数を足す。
				count++;
			}
		}while(flag);

		System.out.println(count);

		scanner.close();

	}

}


Measured memory_bytes: 21972
#include<bits/stdc++.h>
using namespace std;
#define ll long long
vector<ll>v(100001);
vector<ll> dp(100001,-1);
ll solve(ll n)
{
    if(n<=0) return 0;
    if(dp[n]!=-1) return dp[n];
    if(n==1)
    {
        return dp[n]=abs(v[n]-v[n-1])+solve(n-1);
    }
    return dp[n]=min(abs(v[n]-v[n-2])+solve(n-2),abs(v[n]-v[n-1])+solve(n-1));

}
int main()
{
    ll n;
    cin>>n;
    for(ll i=0;i<n;i++)
    {
        cin>>v[i];
    }
    cout<<solve(n-1);
}


Measured memory_bytes: 9540
#include <bits/stdc++.h>
using namespace std;
 
#define MOD 1000000007
#define INF  2000000000
//#define int ll
#define ll long long
#define ld long double
#define vi vector<int>
#define pa pair<int, int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest&...rest) { cin >> first; MACRO_VAR_Scan(rest...); }
#define VEC(type, c, n) vector<type> c(n);for(auto& i:c)cin>>i;
#define MAT(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
 
#define BR cout << "\n";
#define SP cout << " ";
#define ENDL cout<<endl;
#define OUT(d) cout<<(d);
#define OUTL(d) cout<<(d); BR;
#define YES OUTL("YES")
#define Yes OUTL("Yes")
#define NO OUTL("NO")
#define No OUTL("No")
#define RET return 0;
#define SUM(a, n) accumulate(a, a+n, 0)
#define VSUM(v) accumulate(ALL(v), 0);
 
#define REP(i, n) for(int i=0;i<(n);i++)
#define RREP(i, n) for(int i=n-1;i>=0;--i)
#define FOR(i, m, n) for(int i = m;i < n; i++)
#define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)
#define AREP(a, n) for(auto (a):(n))
#define ALL(a) (a).begin(),(a).end()
#define IN(n, a, b) ((a)<=(n)&&(n)<(b))

signed main(){ INIT;
    VAR(string, s);
    int ans = 0;
    FOR(i, 1, s.size()) ans += s[i-1]!=s[i];
    OUTL(ans);
RET;}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define ff first
#define ss second
#define pb push_back
#define all(s) (s).begin(), (s).end()
const ll mod = 1e9 + 7;

ll h, w, x;
vector<pair<ll,ll>> arr;
ll ans[3010], fact[(ll) 2e5 + 10];

ll binexp(ll a)
{
    ll res = 1, y = mod - 2;
    while (y > 0)
    {
        if (y & 1)
            res = ((res * a) % mod + mod) % mod;
        y >>= 1;
        a = ((a * a) % mod + mod) % mod;
    }
    return res % mod;
}

ll num(ll x1, ll y1, ll x2, ll y2)
{
    ll x = fact[x2 - x1 + y2 - y1];
    ll y = binexp(((fact[x2 - x1] * fact[y2 - y1]) % mod + mod) % mod);
    return ((x * y) % mod + mod) % mod;
}

void solve()
{
    for (int i = 2; i <= 2e5 + 10; i++)
        fact[i] = ((fact[i - 1] * i) % mod + mod) % mod;

    for (int i = 0; i <= x; i++)
    {
        ll ans_i = num(1, 1, arr[i].ff, arr[i].ss);
        ll ans_t = 0;
        for (int j = 0; j < i ; j++)
        {
            if (arr[j].ff <= arr[i].ff && arr[j].ss <= arr[i].ss)
            {
                ans_t += (ans[j] * num(arr[j].ff, arr[j].ss, arr[i].ff, arr[i].ss) + mod) % mod;
                ans_t %= mod;
            }
        }
        ans[i] = (ans_i - ans_t) % mod + mod;
        ans[i] %= mod;
    }    
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);

    cin >> h >> w >> x;
    arr.resize(x);
    fact[0] = fact[1] = 1;
    for (int i = 0; i < x; i++)
    {
        ll a, b;
        cin >> a >> b;
        arr[i] = make_pair(a, b);
    }
    sort(all(arr));
    arr.pb({h, w});
    solve();
    cout << ans[x] << endl;
    return 0;
}

Measured memory_bytes: 1920
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            double n = ndouble(sc);
            double m = ndouble(sc);
            long d = nlong(sc);
            if (d == 0 ){
                out.println((m-1) / n);
            }else {
                out.println(2*(n-d)*(m-1) / Math.pow(n,2));
            }

        }
    }


    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 10000;
#define INF 0x3f3f3f3f

int main() {
  int n;
  int x;
  int t;
  cin>>n>>x>>t;
  int m = ceil(1.0*n/x)*t;
  cout<<m<<endl;
 	return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef queue<pii> qp;

const int X = 1e9+1;

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

    int n, m;
    cin >> n >> m;
    int a[n], b[n], c[n];
    vi mx, my;
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i] >> c[i];
        mx.push_back(a[i]);
        mx.push_back(b[i]);
        my.push_back(c[i]);
    }
    int d[m], e[m], f[m];
    for (int i = 0; i < m; i++) {
        cin >> d[i] >> e[i] >> f[i];
        mx.push_back(d[i]);
        my.push_back(e[i]);
        my.push_back(f[i]);
    }

    mx.push_back(-X);
    mx.push_back(0);
    mx.push_back(X);
    my.push_back(-X);
    my.push_back(0);
    my.push_back(X);

    sort(mx.begin(), mx.end());
    mx.resize(unique(mx.begin(), mx.end()) - mx.begin());
    sort(my.begin(), my.end());
    my.resize(unique(my.begin(), my.end()) - my.begin());

    int xsz = mx.size() - 1, ysz = my.size() - 1;
    bool s[xsz][ysz], down[xsz][ysz], right[xsz][ysz];
    fill(s[0], s[xsz], false);
    fill(down[0], down[xsz], false);
    fill(right[0], right[xsz], false);

    for (int i = 0; i < n; i++) {
        int xa = lower_bound(mx.begin(), mx.end(), a[i]) - mx.begin();
        int xb = lower_bound(mx.begin(), mx.end(), b[i]) - mx.begin();
        int yc = lower_bound(my.begin(), my.end(), c[i]) - my.begin();

        for (int j = xa; j < xb; j++) {
            down[j][yc-1] = true;
        }
    }

    for (int i = 0; i < m; i++) {
        int xd = lower_bound(mx.begin(), mx.end(), d[i]) - mx.begin();
        int ye = lower_bound(my.begin(), my.end(), e[i]) - my.begin();
        int yf = lower_bound(my.begin(), my.end(), f[i]) - my.begin();

        for (int j = ye; j < yf; j++) {
            right[xd-1][j] = true;
        }
    }

    int x0 = lower_bound(mx.begin(), mx.end(), 0) - mx.begin();
    int y0 = lower_bound(my.begin(), my.end(), 0) - my.begin();

    qp q;
    q.emplace(x0, y0);
    s[x0][y0] = true;
    while (!q.empty()) {
        int x = q.front().first, y = q.front().second;
        q.pop();

        if (x < xsz - 1 && !right[x][y] && !s[x+1][y]) {
            s[x+1][y] = true;
            q.emplace(x + 1, y);
        }
        if (x >= 1 && !right[x-1][y] && !s[x-1][y]) {
            s[x-1][y] = true;
            q.emplace(x - 1, y);
        }
        if (y < ysz - 1 && !down[x][y] && !s[x][y+1]) {
            s[x][y+1] = true;
            q.emplace(x, y + 1);
        }
        if (y >= 1 && !down[x][y-1] && !s[x][y-1]) {
            s[x][y-1] = true;
            q.emplace(x, y - 1);
        }
    }

    ll ans = 0;
    for (int i = 0; i < xsz; i++) {
        for (int j = 0; j < ysz; j++) {
            if (s[i][j]) {
                if (i == 0 || i == xsz - 1 || j == 0 || j == ysz - 1) {
                    cout << "INF" << endl;
                    return 0;
                }

                ans += 1ll * (mx[i+1] - mx[i]) * (my[j+1] - my[j]);
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 30096
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <sstream>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <limits>
#include <unordered_map>
#include <unordered_set>
#include <math.h>
#include <fstream>
#include <iterator>
#include <random>
#include <chrono>


#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s

typedef long long ll;

using namespace std;

long long gcd(long long a, long long b) { 
    if (a == 0)  {   return b;  }
    return gcd(b % a, a); 
};

class Factorial {
    public:
      ll modd = 1000 * 1000 * 1000 + 7;
      vector<ll> bin;

      Factorial(int n) : bin(n+1, 0) {
          bin[0] = 1;
          forr(i,1,n) {
              bin[i] = i*bin[i-1]; bin[i] = bin[i] % modd;
          }
      }

      ll val(int i) {  return bin[i];  }
};


int main()   {
    cout.precision(17);
    ll modd = 1000 * 1000 * 1000 + 7;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no
    ll infinit = 10000000000000000;


//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readint(n);
        readstring(s);
        ll ret = 1;
        ll continuing_intervals = 0;
        forr(i,0,s.size()) {
            bool need_one = (s[i] == 'B');
            if (need_one == continuing_intervals % 2) {
                ret *= continuing_intervals;
                ret = ret % modd;
                continuing_intervals--;
                if (continuing_intervals < 0) { ret = 0; break;  }
            } else {
                continuing_intervals++;
            }
        }
        if (continuing_intervals != 0) {ret = 0;}
        Factorial fa(n+1);
        ret *= fa.val(n); ret = ret % modd;
        
        cout << ret << endl;
    }
    return 0;
}


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

#define ll long long
#define ld long double
#define ii pair<int ,int >
#define S second
#define F first
#define PI 3.1415926535897932384626
#define SPEED std::ios_base::sync_with_stdio(false);
const int N = 1e5+107;
int n,a[N],b[N],c[N],mem[N][3],k;

int dp(int i,int last){
    if(i==n)return 0;
    int &ret = mem[i][last];
    if(ret != -1)return ret;

    int p1,p2;
    p1=p2=0;
    if(last==0){
        p1=b[i]+dp(i+1,1);
        p2=c[i]+dp(i+1,2);
    }
    if(last==1){
        p1=a[i]+dp(i+1,0);
        p2=c[i]+dp(i+1,2);
    }
    if(last==2){
        p1=a[i]+dp(i+1,0);
        p2=b[i]+dp(i+1,1);
    }

    return ret = max(p1,p2);

}

int main(){
    SPEED
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d%d%d",&a[i],&b[i],&c[i]);
    }
    memset(mem,-1,sizeof mem);
    cout<<max({a[0]+dp(1,0),b[0]+dp(1,1),c[0]+dp(1,2)});

}


Measured memory_bytes: 7296
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int T = scan.nextInt();
        long answer = Integer.MAX_VALUE;
        for (int i = 0; i < N; i++) {
            int c = scan.nextInt();
            int t = scan.nextInt();
            if (T < t) {
                continue;
            }
            if (c < answer) {
                answer = c;
            }
        }
        if (answer == Integer.MAX_VALUE) {
            System.out.println("TLE");
        } else {
            System.out.println(answer);
        }
    }
}


Measured memory_bytes: 21844
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {
	final int _intMax = Integer.MAX_VALUE; // =2147483647>10^9
	final int _intMin = Integer.MIN_VALUE;
	final long _longMax = Long.MAX_VALUE; // =9223372036854775807L>10^18
	final long _longMin = Long.MIN_VALUE;
	static boolean bElapsed = false;

	void solve() {
		int n = readNum();
		int ans = 0;
		for (int i = 0; i < n; i++) {
			int[] ia = readNums();
			int l = ia[0];
			int r = ia[1];
			ans += r - l + 1;
		}
		pln(ans);
	}

	int pint(String s) {
		return Integer.parseInt(s);
	}

	long plong(String s) {
		return Long.parseLong(s);
	}

	String readLine() {
		try {
			return _in.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	int readNum() {
		String line = readLine();
		return pint(line);
	}

	String[] readFlds() {
		String line = readLine();
		return line.split(" ");
	}

	int[] readNums() {
		String[] flds = readFlds();
		int[] nums = new int[flds.length];
		for (int i = 0; i < flds.length; i++) {
			nums[i] = pint(flds[i]);
		}
		return nums;
	}

	void p(char c) {
		_out.print(c);
	}

	void pln(char c) {
		_out.println(c);
	}

	void p(double d) {
		_out.print(d);
	}

	void pln(double d) {
		_out.println(d);
	}

	void p(long l) {
		_out.print(l);
	}

	void pln(long l) {
		_out.println(l);
	}

	void p(String s) {
		_out.print(s);
	}

	void pln(String s) {
		_out.println(s);
	}

	static BufferedReader _in;
	static PrintWriter _out;

	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		_in = new BufferedReader(new InputStreamReader(System.in));
		_out = new PrintWriter(System.out);
		new Main().solve();
		_out.flush();
		long end = System.currentTimeMillis();
		if (bElapsed) {
			System.err.println((end - start) + "ms");
		}
	}
}


Measured memory_bytes: 21844
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A
{
    class Program
    {
        /// <summary>
        ///   The main entry point for the application
        /// </summary>
        [STAThread]
        public static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int use = 0;
            int now = 1;
            while(true) {
                if(b <= now) {
                    Console.Write("{0}", use);
                    break;
                }
                now = now - 1 + a;
                use++;
            }
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <vector>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> p;
    for(int i=0; i <= n; i++){
        int x;
        cin >> x;
        p.push_back(x);
    }

    int count = 0;
    for(int i=0; i < n; i++){
        if(p[i]!=i+1){
            count+=1;
        }
    }
	
    bool res = false;
    if(count == 2 || count == 0){
        res = true;
    }

    if(res){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;
typedef pair<ll  ,ll > pll;

const ll maxn =2e6;
const ll mod = 1e9+7;
const ld PI = 4 * atan((ld) 1);

#define pb(x) push_back(x);
#define endl '\n'
#define dokme(x) cout << x ;  return(0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
#define ms(x , y) memset(x , y , sizeof x);
ll pw(ll a, ll b) {
    return (!b ? 1 : (b & 1 ? a * pw(a * a % mod, b / 2) % mod : pw(a * a % mod, b / 2) % mod));
}

int k , x;

int main(){
    migmig
    cin >> k >> x;
    if(k * 500 >= x){
        dokme("Yes");
    }
    cout << "No";


    return(0);
}


//When we hit our lowest point, we are open to the greatest change.
//If I try, I fail. If I don't try, I'm NEVER GOING TO GET IT.
//Sometimes, life is like this dark tunnel. You can't always see the light at the end of the tunnel. But if you just keep moving... you will come to a better place.
//It is important to draw wisdom from diffrent places. If you take it from only one place it becomes rigid and stale.


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


int main() {
  int N;
  cin >> N;
  vector<int> FB;
  
  ll sum = 0;
  for (int i = 1; i <= N; i++) {
    if (i % 15 == 0) {
      continue;
    }
    else if (i % 3 == 0) {
      continue;
    }
    else if (i % 5 == 0) {
      continue;
    }
    else {
      sum += i;
    }
  }
  cout << sum << endl;
}

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

const int maxn = 3e5 + 3;
int n, d[maxn];
std::queue<int> q[2];

int main() {
	scanf("%d", &n);
	memset(d, 0x7f, sizeof(int) * n);
	for(int i = 0, u = 1 % n; i < n; ++i, u = u * 10 % n) {
		if(d[u] <= 1)
			break;
		d[u] = 1;
		q[0].push(u);
	}
	int s = 0;
	while(!q[s].empty()) {
		int u = q[s].front();
		q[s].pop();
		if(u == 0) {
			break;
		}
		if(d[u * 10 % n] > d[u]) {
			d[u * 10 % n] = d[u];
			q[s].push(u * 10 % n);
		}
		if(d[(u + 1) % n] > d[u] + 1) {
			d[(u + 1) % n] = d[u] + 1;
			q[s ^ 1].push((u + 1) % n);
		}
		if(q[s].empty()) {
			s ^= 1;
		}
	}
	printf("%d\n", d[0]);
	return 0;
}


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

using namespace std;

typedef long long lo;
typedef pair< lo,lo > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 100005;
const lo mod = 1000000007;

lo n,m,b[li],a[li],k,flag,t,dp[103][li];
lo cev;
string s;
vector<lo> v;

int main(void){
	scanf("%lld %lld",&n,&k);
	FOR{
		scanf("%lld %lld",&b[i],&a[i]);
	}
	FOR{
		for(int j=k;j>=0;j--){
			if(j-b[i]<0)dp[i][j]=dp[i-1][j];
			else dp[i][j]=max(dp[i-1][j],dp[i-1][j-b[i]]+a[i]);
		}
	}
	lo mx=0;
	//~ cout<<dp[3][8]<<endl;
	for(int i=0;i<=k;i++)mx=max(mx,dp[n][i]);
	printf("%lld\n",mx);
	return 0;
}


Measured memory_bytes: 81408
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      String[] nyu=sc.nextLine().split("");

  //   String nyu=sc.nextLine();
//int A=Integer.parseInt(nyu[0]);
//int B=Integer.parseInt(nyu[1]);
//int C=Integer.parseInt(nyu[2]);
//int D=Integer.parseInt(nyu[3]);


//double A=Double.parseDouble(nyu[0]);
//double B=Double.parseDouble(nyu[1]);
/*
switch(C){
case 7:
case 5:
case 3:
System.out.println("YES") ;
break;
default:
System.out.println("NO") ;

break;
}
*/
Arrays.sort(nyu);

if((nyu[0]+nyu[1]+nyu[2]).equals("abc")){
System.out.println("Yes");
}else{
System.out.println("No");

}





	}
}

Measured memory_bytes: 23124
s = input()

back_home = True

if 'N' in s:
    if 'S' not in s:
        back_home = False
        
if 'S' in s:
    if 'N' not in s:
        back_home = False
        
if 'E' in s:
    if 'W' not in s:
        back_home = False
        
if 'W' in s:
    if 'E' not in s:
        back_home = False
        
if back_home:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
using System;using System.Collections.Generic; public class p0013{    p0013(){        string str;        Stack<string> stk = new Stack<string>();                 while((str=Console.ReadLine()) != null){            if(str != "0") stk.Push(str);            else if(stk.Count > 0) Console.WriteLine(stk.Pop());        }    }         public static int Main(string[] args){        new p0013();        return 0;    }} 

Measured memory_bytes: 5544
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,j,n) for(int i = j; i < n; i++)
#define rrep(i,j,n) for(int i = j-1; i >= n; i--)
#define prec(n) fixed << setprecision(n)
#define print_array(v) rep(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define fi first
#define se second
#define endl "\n"
using namespace std;

constexpr int inf = 2147483647;
constexpr int64_t inf64 = 9223372036854775807;
constexpr int mod = 1e9+7;

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

  int n;
  cin >> n;
  vector<int64_t> a(3*n);
  rep(i,3*n) cin >> a[i];

  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int64_t res = 0;
  rep(i,n) res += a[i*2+1];
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 2560
/**********************************************************************/
/********                                                      ********/
/********                     Writer:孙~~                      ********/
/********                       Lang:C++                       ********/
/********                     Status:Unknow                    ********/
/********                                                      ********/
/**********************************************************************/
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <cstring>
#include <cmath>
//#include<bits/stdc++.h>
using namespace std;

const int INF=0x3f3f3f3f;
const int SIZE=100005;
const double EPS=1e-6;

int dp[SIZE],h[SIZE];

int main(){
	/*main function start*/
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",h+i);
	}
	dp[0]=0;
	dp[1]=abs(h[1]-h[0]);
	for(int i=2;i<n;i++){
		dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
	}
	printf("%d\n",dp[n-1]);
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
const int maxn=100005;
int n,p,a[maxn];
int main()
{
	int n,p;
	cin>>n>>p;
	vector<int>a(n);
	int odd=0,even=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]%2==1)
		{
			odd++;
		}
		else
		{
			even++;
		}
	}
	long long ans=1;
	if(odd==0)
	{
		if(p==0)
		{
			for(int i=0;i<n;i++)
			{
				ans*=2;
			}
		}
		else ans=0;
	}
	else
	{
		for(int i=0;i<n-1;i++)
		{
			ans*=2;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cassert>
#include <climits>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

const int INF = 1e9;
const long long LINF = 1e18;

const double PI = 3.14159265359;

int main() {
    int A, B, H, M;
    cin >> A >> B >> H >> M;

    double aTheta = 2.0 * PI * (static_cast<double>(H * 60 + M) / (12.0 * 60.0));
    double bTheta = 2.0 * PI * (static_cast<double>(M) / 60.0);
    // cout << cos(aTheta) << ", " << sin(aTheta) << endl;
    // cout << cos(bTheta) << ", " << sin(bTheta) << endl;
    double x = static_cast<double>(A) * cos(aTheta) - static_cast<double>(B) * cos(bTheta);
    double y = static_cast<double>(A) * sin(aTheta) - static_cast<double>(B) * sin(bTheta);
    // cout << x << endl;
    // cout << y << endl;
    double pq2 = x * x + y * y;

    printf("%.10f\n", sqrt(pq2));
    // cout << sqrt(pq2) << endl;
    return 0;
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long int lli;
const int inf = 1e9;
const lli mod = 1e9 +7;
typedef pair<lli, lli> pll;
typedef pair<int, int> pii;

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

int main(){
    int h,w;
    cin >> h >> w;
    vector<vector<char>> s(h+2, vector<char>(w+2, '#'));
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            cin >> s[i][j];
        }
    }

    vector<vector<int>> adj(h*w, vector<int>(h*w, inf));
    for(int i=0; i<h*w; i++){
        adj[i][i] = 0;
    }
    for(int i=1; i<=h; i++){
        for(int j=1; j<=w; j++){
            if(s[i][j] == '#') continue;
            int a = (i-1)*w +(j-1);
            for(int d=0; d<4; d++){
                int ni=i+dx[d], nj=j+dy[d];
                int b = (ni-1)*w +(nj-1);
                if(s[ni][nj] == '.'){
                    adj[a][b] = adj[b][a] = 1;
                }
            }
        }
    }
    for(int k=0; k<h*w; k++){
        for(int i=0; i<h*w; i++){
            for(int j=0; j<h*w; j++){
                adj[i][j] = min(adj[i][j], adj[i][k]+adj[k][j]);
            }
        }
    }

    int ans = 0;
    for(int i=0; i<h*w; i++){
        for(int j=0; j<h*w; j++){
            if(adj[i][j] != inf){
                ans = max(ans, adj[i][j]);
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

const int INF = 1e9 + 10;
const ll MOD = 1e9 + 7;

void printv(vector<ll> v) {
  for (ll i : v)
    cout << i << " ";
  cout << endl;
}

bool operator<(pair<bool, ll> p1, pair<bool, ll> p2) {
  return (p1.second == p2.second ? p1.first < p2.first : p1.second < p2.second);
}

int main() {
  ll n;
  cin >> n;
  ll ans = 0;
  for (ll i = 1; i <= n; i++) {
    ans += i*(i+1)/2;
  }
  for (ll i = 0; i < n-1; i++){
    ll u, v;
    cin >> u>>v;
    if (u<v){
      ans -= u*(n-v+1);
    }else{
      ans -= v*(n-u+1);
    }
  }
  cout << ans <<endl;
}


Measured memory_bytes: 3608
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    let (a, b, c) = (io.chars(), io.chars(), io.chars());
    if a.last() == b.first() && b.last() == c.first() {
        io.writeln("YES");
    } else {
        io.writeln("NO");
    }
}

static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


Measured memory_bytes: 4352
num = int(input())
numbers = list(map(int,input().split()))

count = 0
flag = 0
while flag == 0:
    i = 0
    for i in range(num):
        if numbers[i] % 2 == 0:
            numbers[i] = numbers[i]/2
        else:
            flag += 1
    count += 1
print(count-1)

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

int main() {
  int n;
  cin>>n;
  
  vector<int> vec(9);
  
  int rate;
  int u;
  
  for(int i=0;i<n;i++){
    cin >>rate;
    if(rate>3200){
      rate=3200;
    }
    u=rate/400;
    vec.at(u)++;
  }
  
  int iro=0;
  
  for(int i=0;i<8;i++){
    if(vec.at(i)>0){
      iro++;
    }
  }
  
  if(iro==0){
  cout <<iro+1<<" "<<iro+vec.at(8)<<endl;
  }
  else{
    cout <<iro<<" "<<iro+vec.at(8)<<endl;
  }
  
}


Measured memory_bytes: 256
#include<cstdio>
#include<queue>
#include<map>
#include<vector>
#define INF 10000000
using namespace std;

typedef pair<int,int> P;
typedef pair<int,P> P2;

int main(){
  int n,a[2][100],dis[2][100];

  while(scanf("%d",&n) && n){
    for(int i=0;i<2;i++)
      for(int j=0;j<n;j++){
	scanf("%d",&a[i][j]);
	dis[i][j] = INF;
      }

    priority_queue<P2 ,vector<P2>, greater<P2> > q;
    for(int i=0;i<2;i++){
      int f = 0;
      if(a[i][f] == 1){
	while(f<n && a[i][f]==1)f++;
	f--;
      }
      q.push(P2(0,P(i,f)));
      dis[i][f] = 0;
    }

    while(q.size()){
      P2 p = q.top();q.pop();

      for(int i=0;i<3;i++){
	int c = p.first, b = p.second.first, s = p.second.second;
	if(a[1-b][s+i] == 1){
	  while(s+i<n && a[1-b][s+i] == 1)s++;
	  s--;
	}else if(a[1-b][s+i] == 2){
	  while(0<=s+i && a[1-b][s+i] == 2)s--;
	}
	if(dis[1-b][s+i] > c+1){
	  dis[1-b][s+i] = c+1;
	  q.push(P2(c+1,P(1-b,s+i)));
	}
      }
    }

    int ans = min(dis[0][n-1],dis[1][n-1]);
    if(ans == INF)printf("NA\n");
    else printf("%d\n",ans);
  }
}

      

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll maxl (ll x , ll y)
{
    if (x>y)
        return x;
    return y;
}
ll minl (ll x,ll y)
{
    if (x>y)return y;
    return x;
}
int main () {
ll a,b,k;
cin>>a>>b>>k;
cout<<maxl(a-k,0)<<" " <<maxl(0,minl(a+b-k , b));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define co(n) cout << n << endl
using namespace std;
int main(){
  int a, b;
  cin >> a;
  co((a/2)*(a/2+a%2));
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define reps(i,s,n) for(ll (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define All(x) (x).begin(),(x).end()
using namespace std;

int main() {
  double t,x;
  cin >> t >> x;
  printf("%f\n",t/x);
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdlib>

using namespace std;

int main(void) {

	string b;

	cin >> b;

	if (b == "A")cout << "T\n";
	if (b == "T")cout << "A\n";
	if (b == "G")cout << "C\n";
	if (b == "C")cout << "G\n";
	



	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#include <limits>
using namespace std;


int main(){
    long long a, b, x;
    cin >> a >> b >> x;
    long long c = a/x;
    long long d = b/x;
    long long ans = d-c;
    if(a%x==0) ans++;
    cout << ans << endl;    
    return 0;
}

Measured memory_bytes: 256
// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
int dp[101][101][303],a[101],b[101],n,w,i,j,h,ans;
int main()
{
     scanf("%d%d",&n,&w);
     for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
     for(i=0;i<n;i++)
         {
             for(j=0;j<=i;j++)
                 {
                     for(h=0;h<=3*j;h++)
                         {
                             dp[i+1][j][h]=max(dp[i+1][j][h],dp[i][j][h]);
                             dp[i+1][j+1][h+a[i]-a[0]]=max(dp[i+1][j+1][h+a[i]-a[0]],dp[i][j][h]+b[i]);
                         }
                 }
         }
     for(i=0;i<=n;i++)
         {
             for(j=0;j<=3*i;j++)
                 {
                     long long s=(long long)a[0]*i+j;
                     if(s<=w)ans=max(ans,dp[n][i][j]);
                 }
         }
     printf("%d\n",ans);return 0;
}

Measured memory_bytes: 10368
#include <iostream>
#include <string>
#include <sstream>
#include <climits>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <cassert>

using namespace std;

#define    watch(x); cout << "\n" <<  #x << " is: " << x << "\n";
#define    all(a) (a).begin(), (a).end()
#define    fi first
#define    se second

template<class A, class B>
ostream& operator << (ostream& output, const pair<A, B>& p) {
    output << "(" << p.first << ", " << p.second << ")";
    return output;
}

template<class A>
ostream& operator << (ostream& output, const vector<A>& a) {
    output << "[";
    for(auto it = a.begin(); it != a.end(); ++it) {
        if(it != a.begin()) {
            output << ", ";
        }
        output << *it;
    }
    output << "]";
    return output;
}

using lld = long long;
using pii = pair<int, int>;
using pll = pair<lld, lld>;

//const int inf = 1e9;
//const int mod = 1e9 + 7;
//const double PI = acos(-1.0);
//const int mx = 1e5 + 5;



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#endif

    string str;
    cin >> str;
    if(str > "2019/04/30") cout << "TBD" << endl;
    else cout << "Heisei" << endl;
    return 0;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N, A = 0, B = 0;
  cin >> N;
  
  vector<int> a(N);
  for(int i = 0; i < N; i++){
    cin >> a.at(i);
  }
  
  for(int i = 0; i < (N + 1) / 2; i++){
    int max1 = 0, max2 = 0;
    
    for(int j = 0; j < N; j++){
      max1 = max(a.at(j), max1);
    }
    
    for(int j = 0; j < N; j++){
      if(max1 == a.at(j)){
        a.at(j) = 0;
        break;
      }
    }
    
    for(int j = 0; j < N; j++){
      if(max2 < a.at(j)){
        max2 = a.at(j);
      }
    }
    
    for(int j = 0; j < N; j++){
      if(max2 == a.at(j)){
        a.at(j) = 0;
        break;
      }
    }
    
    A += max1;
    B += max2;
  }
  
  cout << A - B << endl;
  
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{

    class Program
    {
        static void Main()
        {
            Solve();

            Console.ReadKey();
        }

        static void Solve()
        {
            var s = GetIntArray();
            var K = GetInt();
            var ans = s.Sum() + s.Max() * (Math.Pow(2, K) - 1);

            Console.Write(ans);
        }



        static public string GetStr() { return Console.ReadLine(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
    }
}

Measured memory_bytes: 11348
/*************************************************************************
  >         File: Main.java
  >       Author: Riho.Yoshioka
  >         Mail: riho.yoshioka@yandex.com
  > Created Time: Sun 21 Aug 2016 07:54:49 PM CST
*************************************************************************/
import java.io.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    
    TaskA solver = new TaskA();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
      char[] str = new char[1001];
      str = in.next().toCharArray();
      int has = 0;
      for (int i = 0; i < str.length; i++) {
        if (str[i] == 'N') has |= 1;
        else if (str[i] == 'S') has |= 2;
        else if (str[i] == 'W') has |= 4;
        else has |= 8;
      }
      if (has == 3 || has == 12 || has == 15) {
        out.println("Yes");
      }
      else {
        out.println("No");
      }
    }
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

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

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

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

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


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

int main() {
	int H, W;
	while (1) {
		cin >> H >> W;
		if (H == 0 && W == 0)break;
		else {
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					if (i % 2 == 0 && j % 2 == 0 || i % 2 != 0 && j % 2 != 0) {
						printf("#");
					}
					else {
						printf(".");
					}
				}
				printf("\n");
			}
		}
		printf("\n");

	}
	return 0;
}

Measured memory_bytes: 2976
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a;
    std::deque<int> deq;
    for (int i=0;i<3;i++) {
        cin>>a;
        deq.emplace_back(a);
    }
    sort(deq.begin(),deq.end());
    int count=0;
    while (1) {
        if (deq[0]==deq[1]&&deq[1]==deq[2]) {
            cout<<count<<endl;
            break;
        } else if (deq[0]==deq[1]&&deq[0]+1==deq[2]) {
            deq[0]++;
            deq[1]++;
            count++;
        } else if (deq[1]!=deq[2]) {
            deq[0]+=2;
            count++;
        } else if (deq[1]==deq[2]) {
            if (deq[0]+2<deq[2]) {
                deq[0]+=2;
                count++;
            } else if (deq[0]+2>deq[2]) {
                deq[1]++;
                deq[2]++;
                count++;
            }else if (deq[0]+2==deq[2]) {
                deq[0]+=2;
                count++;
            }
        }
        sort(deq.begin(),deq.end());
    }
}

Measured memory_bytes: 256