akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;
typedef pair<double, double > pi; 
typedef pair<pair<double, double >, double > pii; 

int main(){

    ll N, C;
    cin >> N >> C;
    vector<vector<ll > > memo(C, vector<ll >(100010, 0));
    for(ll i = 0; i < N; i++){
        ll S, T, C; cin >> S >> T >> C;
        //どこから始まったかどこ以降で終わったかを記録
        for(ll j = S; j <= T; j++){
            memo[C-1][j] = 1;
        }
        /* 
        //始点に1加算
        memo[C-1][S]++;
        //終点から1つ後に1減算
        memo[C-1][T + 1]--; 
        */
    }

    vector<ll > t_ans(100010, 0);
    for(ll i = 1; i < 100010; i++){
        //ll count = 0;
        ll sum = 0;
        for(ll j = 0; j < C; j++){
            sum += memo[j][i];
        }
        //sum += t_ans[i-1];
        t_ans[i] = sum;
    }

    //重なりが一番多いところを探す
    ll mx = 0;
    for(ll i = 1; i <100010; i++){
        mx = max(mx, t_ans[i]);
    }

    cout << mx << endl;

}

Measured memory_bytes: 24576
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main(){
  int length, q;
  scanf("%d %d", &length, &q);
  char a[length+1];
  scanf("%s", a);
  
  int l[q], r[q];
  for (int i=0; i<q; i++) scanf("%d %d", &l[i], &r[i]);
  
  int bits[length] = {};
  for (int i=1; i<length; i++){
    if (a[i] == 'C' && a[i-1] == 'A') {
      for(int j=i; j<length; j++) bits[j]++;
    }
  }
  for(int i=0; i<q; i++){
    printf("%d\n", bits[r[i]-1] - bits[l[i]-1]);
  }
  return 0;
}

Measured memory_bytes: 2048
N , K = map( int , input().strip().split(" ") ) ; 
LL = [] ;
for x in input().strip().split(" " ) :
	k = int(x ) ;
	LL.append(  ( k * ( k + 1 ) ) / k / 2 ) ;

LL2 = [] ;
LL2.append( LL[0] ) ;
for x in range ( 1 , len( LL ) ) :
	LL2.append( LL2[-1] + LL[x] ) ;



v0 = 0 ;
for x in range ( K-1 , N  ) : 
	d = 0. if x - K < 0 else LL2[x-K];
	v = LL2[x] -d ;
	v0 = max ( v , v0 ) ;
print ( "{0:.8f}".format(  v0 ) ) ;
		

	


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

int RoundUp(int Integer, int Power)
{
	double Place = pow(10, Power);
	return Place * ceil(Integer / Place);
}

int main()
{
	int Debt = 100000;
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		Debt = RoundUp(1.05 * Debt, 3);//?????¬???????????????????????±????????§??????????????????????????????????????????
	}
	cout << Debt << endl;
	return 0;
}

Measured memory_bytes: 3136
# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

# input = sys.stdin.readline

# N個整数
# a, b, c = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
# b = list(map(int, input().split()))

# 空白区切り文字列
# t, d = input().split()
s = list(input())
#s = s[:-1]
m = {}
for c in s:
    if c in m:
        m[c] = m[c] + 1
    else:
        m[c] = 1
# print(m)
for k in m:
    if m[k] % 2 == 1:
        print("No")
        exit(0)
print("Yes")


Measured memory_bytes: 4188
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
using namespace std;
const long long INF = 1LL<<60; // 仮想的な無限大の値;
using ll = long long;
using P  = pair<int, int>;
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
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; }
//"Yes"   "No"
int main()
{
    string s;
    cin >> s;
    if(s.back() == 's')
    {
        cout << s + "es" << endl;
    }
    else{
        cout << s + "s" << endl;
    }
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
 
using namespace std;
 
char ans[5]={'a','i','u','e','o'};
 
int main(){
  string c;
  cin>>c;
  for(int i=0;i<5;i++){
    if(c[0]==ans[i]){
      cout<<"vowel"<<endl;
      return 0;
    }
  }
  cout<<"consonant"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int xx[8] = {1, 1, 1, 1, -1, -1, -1, -1};
int yy[8] = {1, 1, -1, -1, -1, -1, 1, 1};
int zz[8] = {1, -1, 1, -1, 1, -1, 1, -1};

struct N {
  long long x, y, z;
};

int main() {
  int n, m;
  cin >> n >> m;
  vector<N> ns(n);
  for (int i = 0; i < n; i++)
    cin >> ns[i].x >> ns[i].y >> ns[i].z;
  long long ans = -100000000000;
  for (int i = 0; i < 8; i++) {
    sort(ns.begin(), ns.end(), [&i](const N &lhs, const N &rhs) {
      return lhs.x * xx[i] + lhs.y * yy[i] + lhs.z * zz[i] >
             rhs.x * xx[i] + rhs.y * yy[i] + rhs.z * zz[i];
    });
    long long sum = 0;
    for (int j = 0; j < m; j++)
      sum += ns[j].x * xx[i] + ns[j].y * yy[i] + ns[j].z * zz[i];
    ans = max(ans, sum);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#define REP(i,n) for (int i=0;i<(n);i++)

using namespace std;
struct com{
	int t,s,d;
};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int n,m;
	while(cin>>n>>m,n){
		vector<com> computer(m);
		vector<char> infected(n,0);
		infected[0] = 1;
		REP(i,m){
			int t,s,d;
			cin >> t >> s >> d;
			computer[i] = {--t,--s,--d};
		}
		sort(computer.begin(),computer.end(),[](com a,com b){
				return a.t < b.t;
			});
		REP(i,m){
			infected[computer[i].d] |= infected[computer[i].s];
		}
		cout << accumulate(infected.begin(),infected.end(),0) << endl;
	}
  return 0;
}

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

#define MAX_NUM (1000000000 + 7)

typedef uint64_t u64;
typedef int64_t i64;
typedef uint32_t u32;
typedef int32_t i32;

using namespace std;

template <typename T>
static inline void ArrayInput(vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr;
}

template <typename T>
static inline void ArrayPut(const vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cout << *itr << " ";
  cout << endl;
}

bool Sec_compare(pair<uint64_t, uint64_t> a, pair<uint64_t, uint64_t> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

u64 dec_dig(u64 num) {
  u64 res = 0;
  while (num > 0) {
    num /= 10;
    ++res;
  }
  return res;
}

u64 gcd(u64 a, u64 b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }

  return b ? gcd(b, a % b) : a;
}

int main() {
  cout << setprecision(18);
  u64 H, W;
  cin >> H >> W;
  u64 tmp = H * W;
  if (H == 1 || W == 1) {
    cout << 1 << endl;
  } else {
    if (tmp & 0x01)
      cout << (tmp / 2) + 1 << endl;
    else
      cout << tmp / 2 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
<?php
//$N = (int)trim(fgets(STDIN));
//$S = trim(fgets(STDIN));
list($A,$B,$C,$K) = array_map('intval',explode(" ",trim(fgets(STDIN))));
//$s = trim(fgets(STDIN));
//$A = array_map('intval',explode(" ",trim(fgets(STDIN))));

printf("%d\n",min($A,$K)-max($K-($A+$B),0));


Measured memory_bytes: 16108
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define mp make_pair
#define pb push_back
#define pf push_front
#define ss second
#define ff first
#define sz(x) (int)x.size()
#define newl "\n"
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vll vector<pll>
#define coutp cout << fixed << setprecision(12)
#define mem(x, val) memset(x, val, sizeof(x))
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define all(v) (v).begin(), (v).end()

const ld pi = 3.14159265359;
ll INF = 1e18 + 10;
ll MOD = 998244353;
ll mod = 1e9 + 7;

inline ll add(ll a, ll b, ll m)
{
    if ((a + b) >= m)
        return (a + b) % m;
    return a + b;
}

inline ll mul(ll a, ll b, ll m)
{
    if ((a * b) < m)
        return a * b;
    return (a * b) % m;
}

ll power(ll x, ll y, ll m)
{
    ll res = 1;
    x = x % m;
    if (x == 0)
        return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % m;
        y = y >> 1;
        x = (x * x) % m;
    }
    return res;
}

void solve()
{
    int n;
    cin>>n;
    vl a(n);
    map<ll,ll> m;
    ll sum=0;
    for(int i=0;i<n;i++) {
        cin>>a[i];
        m[a[i]]++;
        sum+=a[i];
    }
    int q;
    cin>>q;
    while(q-->0) {
        ll x,y;
        cin>>x>>y;
        sum-=m[x]*x-m[x]*y;
        m[y]+=m[x];
        m.erase(x);
        cout<<sum<<newl;
    }


}

int main()
{
    fastio;
    int t;

    t = 1;
    //cin >> t;
    //int test=t;
    
    while (t-- > 0)
    {
        //cout<<"Case #"<<(test-t)<<": ";
        solve();
        cout << newl;
    }

    return 0;
}

Measured memory_bytes: 7928
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<limits>
using namespace std;
const int maxn=110;
const long long int max_inf=numeric_limits<long long>::max();
int n,m;
long long edge[maxn][maxn];

bool floyed()
{
    for(int k=0;k<n;++k)
      for(int i=0;i<n;++i)
      {
          for(int j=0;j<n;++j)
            if(edge[i][k] != max_inf && edge[k][j] != max_inf)
              if(edge[i][k]+edge[k][j]<edge[i][j])
                edge[i][j]=edge[i][k]+edge[k][j];
          if(edge[i][i] < 0)
            return true;
      }
    return false;
}

int main()
{
    // freopen("in.txt","r",stdin);
    // freopen("out.txt","w",stdout);
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;++i)
      for(int j=0;j<n;++j)
        if(i==j) edge[i][j]=0;
        else edge[i][j]=max_inf;
    for(int i=0;i<m;++i)
    {
        int u,v;
        long long w;
        scanf("%d%d%lld",&u,&v,&w);
        edge[u][v]=w;
    }
    if(floyed()) printf("NEGATIVE CYCLE\n");
    else
    {
        for(int i=0;i<n;++i)
        {
            if(edge[i][0] == max_inf)
              printf("INF");
            else
              printf("%lld",edge[i][0]);
            for(int j=1;j<n;++j)
            {
                if(edge[i][j] == max_inf)
                printf(" INF");
                else
                printf(" %lld",edge[i][j]);
            }
            printf("\n");
        }
    }
    return 0;
}

Measured memory_bytes: 3320
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr<<#x<<'='<<x<<' '
typedef long long ll;
typedef pair<int,int> pi;

const int MAXN = 1e5+5;
ll dp[MAXN];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int N,W;
	cin >> N >> W;
	vector<ll> value(N), weight(N);
	for (int i = 0; i < N; i++) cin >> weight[i] >> value[i];
	for (int i = 0; i < N; i++) {
		for (int j = W; j >= weight[i]; j--) {
			dp[j] = max(dp[j],value[i]+dp[j-weight[i]]);
		}
	}
	cout << dp[W];
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <utility>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <istream>
#include <ostream>

#include <cstdlib>
#include <cmath>
#include <cstdio>

using namespace std;

#define fi first
#define se second
#define mkp make_pair
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define rep(i,n) for(ll i=0; i < (n); ++i)
#define rrep(i,n) for(ll i=((n)-1); i >= 0; --i)

#define OPLT(T) bool operator<(const T & lop_, const T & rop_)
#define OPEQ(T) bool operator==(const T & lop_, const T & rop_)

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

istream& operator>>(istream& istr, __float128& obj) { double d; istr >> d; obj = d; return istr; };
ostream& operator<<(ostream& ostr, __float128& obj) { ostr << static_cast<double>(obj); return ostr; };

ll gcd(ll a, ll b) {
	return a % b ? gcd(b, a % b) : b;
}

int main() {
	const string ok = "POSSIBLE", ng = "IMPOSSIBLE";
	int N, K;
	cin >> N >> K;
	vector<ll> A(N);
	rep(i,N) cin >> A[i];
	ll t = A[0];
	ll mx = A[0];
	for(int i = 1; i < N; i++) {
		t = gcd(t, A[i]);
		mx = max(mx, A[i]);
	}
	if(K % t || mx < K)
		cout << ng << endl;
	else
		cout << ok << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;



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

	string s;
	cin >> s;
	sort(s.begin(), s.end());
	if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) cout << "Yes\n";
	else cout << "No\n";

	return 0;
}


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


int main() {
	int n;
	string s;
	while(cin >> n >> s){
		int ans = 0;
		for(int i = 0; i <= 9; i++){
			int t = 0;
			while(t < n){
//				cout << t << endl;
				if(s[t++] == i + '0') break;
			}
			if(t < n){
				for(int j = 0; j <= 9; j++){
					int y = t; 
					while(y < n)
						if(s[y++] == j + '0') break;
					if(y < n){
						for(int k = 0; k <= 9; k++){
							int z = y;
							while(z < n)
								if(s[z++] == k + '0') break;					
							if(z <= n && s[z-1] == k + '0'){
								ans++;
		//						cout << i <<" " << j << " " << k << endl;
							} 
						}				
					}
				}				
			}

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


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main () {
	int b, f, r, v, n, x[4][3][10]={0};
	cin >> n;
	for(int i=0; i<n; i++) {
		cin>>b>>f>>r>>v;
		x[b-1][f-1][r-1]+=v;
	}
	for(int j=0;j<4;j++){
		for(int k=0;k<3;k++){
			for(int l=0;l<10;l++) cout<<' '<<x[j][k][l];
			cout<<endl;
		}
		if (j<3) cout<<"####################\n";
	}
	return 0;
}


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

int main(){
  int k;
  cin >> k;
  int base = 7;
  int cnt = 1;
  
  while(base<k){
    base*=10;
    base+=7;
    cnt++;
  }
  
  int mod = base%k;
  for(int i = 0; i <= 10000000; i++){
    if(mod==0) break;
    mod = (mod*10+7)%k;
    cnt++;
    if(i==10000000){
      cout << -1 << endl;
      return 0;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3616
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

#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()

typedef long long lint;

using namespace std;

int main(){
  int A[3];
  REP(i,3)cin>>A[i];
  int ans=999;
  sort(A,A+3);
  cout<<A[2]-A[0]<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] d = new int[n];
		for(int i=0;i<n;i++) {
			d[i]=sc.nextInt();
		}
		Arrays.parallelSort(d);
		int abc=d[n/2-1];
		int agc=d[n/2];
		int count=0;
		for(int i=abc+1;i<=agc;i++) {
			count++;
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 50836
def main():
    N = int(input())
    num_mal = []

    for i in range(9):
        for j in range(9):
            num_mal.append((i + 1) * (j + 1))

    if N in num_mal:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
N,K = map(int,input().split())
A = list(map(int,input().split()))
s = sum(A)
if s < N:
    print(0)
    exit()

MOD = 10**9+7

MAXN = N+5
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def ncr(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

dp = [[0]*(N+1) for i in range(K+1)]
dp[0][0] = 1
for i,a in enumerate(A):
    for j in range(N+1):
        for k in range(j,N+1):
            if k-j > a: break
            dp[i+1][k] += dp[i][j] * ncr(N-j, k-j) * ncr(N-(k-j), a-(k-j))
            dp[i+1][k] %= MOD
print(dp[-1][-1])

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

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()

const double eps=1e-5;
const long long INF=(LL)(1e9)*(LL)(1e9);


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,w;
    cin>>h>>w;

    vector<int> cc(26);
    REP(j,h)
    {
        string s;
        cin>>s;
        REP(i,w)
        {
            cc[s[i]-'a']++;
        }
    }
    bool flag=1;
    vector<vector<char>> ans(w,vector<char>(h));
    REP(i,w/2)
    REP(j, h/2)
    {
        bool can=0;
        REP(k,26)
        if(cc[k]>=4)
        {
            ans[i][j]=k+'a';
            cc[k]-=4;
            can=1;
            break;
        }
        if(!can)
            flag=0;
    }
    if(w%2==1)
    REP(j,h/2)
    {
        int i=w/2;
        bool can=0;
        REP(k,26)
        if(cc[k]>=2)
        {
            ans[i][j]=k+'a';
            cc[k]-=2;
            can=1;
            break;
        }
        if(!can)
            flag=0;
    }
    
    if(h%2==1)
    REP(i,w/2)
    {
        int j=h/2;
        bool can=0;
        REP(k,26)
        if(cc[k]>=2)
        {
            ans[i][j]=k+'a';
            cc[k]-=2;
            can=1;
            break;
        }
        if(!can)
            flag=0;
    }

    if(w%2==1 && h%2==1)
    {
        int i=w/2,j=h/2;
        bool can=0;
        REP(k,26)
        if(cc[k]>=1)
        {
            ans[i][j]=k+'a';
            cc[k]-=1;
            can=1;
            break;
        }
        if(!can)
            flag=0;
    }

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


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

int main() {
	int Q; int H; int S; int D;
	while (~scanf("%d%d%d%d", &Q, &H, &S, &D)) {
		int N;
		scanf("%d", &N);
		amin(H, Q * 2);
		amin(S, H * 2);
		amin(D, S * 2);
		ll ans = (ll)(N / 2) * D + (N % 2) * S;
		printf("%lld\n", ans);
	}
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int number[5];
	int i,j;
	scanf("%d %d %d %d %d",&number[0],&number[1],&number[2],&number[3],&number[4]);


	for(i=0;i<5;i++)
	{
		for(j=4;j>i;j--)
		{
			if(number[j] > number[j-1])
			{
				int temp = number[j];
				number[j] = number[j-1];
				number[j-1] = temp;
			}
		}
	}
	for(i=0;i<4;i++)
	{
		printf("%d ",number[i]);
	}
	printf("%d\n",number[4]);

	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <numeric>
#include <algorithm>
#include <functional>

using namespace std;

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

	int A, B;
	cin >> A >> B;

	if (A <= 8 && B <= 8)
	{
		cout << "Yay!";
	}
	else
	{
		cout << ":(";
	}

	return 0;
}


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

using namespace std;

int main()
{
  int n,k;
  cin>>n>>k;
  int ar[n];
  int dp[n];
  for(int i=0;i<n;i++)
  {
    cin>>ar[i];
    dp[i]=INT_MAX;
  }
  if(n-1<=k)
  {
    cout<< abs(ar[n-1]-ar[0])<<endl;
    return 0;
  }
  dp[0]=0;
  for(int i=1;i<k;i++)
    dp[i]=abs(ar[i]-ar[0]);
  //dp[2]=abs(ar[2]-ar[1]);
  for(int i=k;i<n;i++)
  {
    for(int j=i-1;j>=i-k;j--)
      dp[i]=min(abs(ar[i]-ar[j])+dp[j],dp[i]);
  }
  cout<<dp[n-1]<<endl;
  
  return 0;
}

Measured memory_bytes: 1024
//coded by dsingh_24
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<long long,long long>
#define vll          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (long long)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	ios
    ll n,i,j,ans=1,f=0;
    cin>>n;
    string a,b;
    cin>>a>>b;
    if(a[0]==b[0])
    {
    	ans=3;j=1;f=0;
	}else
	{
		ans=6;j=2;f=1;
	}
    for(i=j;i<n;i++)
    {
    	if(a[i]!=b[i])
    	{
    		if(f==0)
    		ans*=2;else
    		ans*=3;
    		ans%=hell;
    		i++;
    		f=1;
		}else
		{
			if(f==0)
			ans*=2;else
			ans*=1;
			ans%=hell;
			f=0;
		}
	}
	cout<<ans%hell;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline int my_getchar_unlocked(){
  static char buf[1048576];
  static int s = 1048576;
  static int e = 1048576;
  if(s == e && e == 1048576){
    e = fread_unlocked(buf, 1, 1048576, stdin);
    s = 0;
  }
  if(s == e){
    return EOF;
  }
  return buf[s++];
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = my_getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = my_getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
struct MY_WRITER{
  char buf[1048576];
  int s;
  int e;
  MY_WRITER(){
    s = 0;
    e = 1048576;
  }
  ~MY_WRITER(){
    if(s){
      fwrite_unlocked(buf, 1, s, stdout);
    }
  }
}
;
MY_WRITER MY_WRITER_VAR;
void my_putchar_unlocked(int a){
  if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
    fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
    MY_WRITER_VAR.s = 0;
  }
  MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
}
inline void wt_L(char a){
  my_putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    my_putchar_unlocked(c[i]);
  }
}
int A;
int B;
int C;
int K;
int main(){
  rd(A);
  rd(B);
  rd(C);
  rd(K);
  for(;;){
    if(A < B  &&  B < C){
      wt_L("Yes");
      wt_L('\n');
      break;
    }
    if(K==0){
      wt_L("No");
      wt_L('\n');
      break;
    }
    K--;
    if(C <= B){
      C *= 2;
      continue;
    }
    if(B <= A){
      B *= 2;
      continue;
    }
  }
  return 0;
}
// cLay varsion 20200509-1

// --- original code ---
// int A, B, C, K;
// {
//   rd(A,B,C,K);
//   for(;;){
//     if(A < B < C) wt("Yes"), break;
//     if(K==0) wt("No"), break;
//     K--;
//     if(C <= B) C *= 2, continue;
//     if(B <= A) B *= 2, continue;
//   }
// }


Measured memory_bytes: 3580
N,M = map(int,input().split())
if N >=2 and M >= 2:
    print(N*M -((N-1)*2+(M-1)*2))
elif N == 1 and M ==1:
    print(1)
elif N ==1:
    print(M-2)
elif M ==1:
    print(N-2)

Measured memory_bytes: 3060
import java.util.Scanner;

/**
 *
 * @author chuan
 */
public class Main {
      
      public static void main(String[] args) {
            Scanner sc = new Scanner(System.in) ;
            String s = sc.nextLine().trim() ;
            char c = s.charAt( s.length()-1);
            switch(c){
                  case '2':
                  case '4':
                  case '5':
                  case '7':
                  case '9':
                        System.out.println("hon");
                        break ;
                  case '0':
                  case '1':
                  case '6':
                  case '8':
                        System.out.println("pon");
                        break;
                  case '3':
                        System.out.println("bon");
                        
            }
            
      }
      
}


Measured memory_bytes: 35512
import itertools

N = int(input())
MOD = 10**9 + 7

base = ['A', 'C', 'G', 'T']
base3 = list(itertools.product(base, repeat=3))
index_dict = dict(zip(base3, range(64)))

s0 = set((('A', 'G', 'C'), ('A', 'C', 'G'), ('G', 'A', 'C')))
s1 = set((('A', 'A', 'G'), ('C', 'A', 'G'), ('G', 'A', 'G'), ('T', 'A', 'G')))
s2 = set((('A', 'A', 'G'), ('A', 'C', 'G'), ('A', 'G', 'G'), ('A', 'T', 'G')))
s3 = set((('A', 'G', 'A'), ('C', 'G', 'A'), ('G', 'G', 'A'), ('T', 'G', 'A')))
s4 = set((('A', 'G', 'A'), ('A', 'G', 'C'), ('A', 'G', 'G'), ('A', 'G', 'T')))
s5 = set((('A', 'A', 'C'), ('C', 'A', 'C'), ('G', 'A', 'C'), ('T', 'A', 'C')))

# 0:A->A->A, 1:A->A->C, 2:A->A->G, 3:A->A->T, ...
dp = [[0]*64 for i in range(N)]

for j in range(64):
  if base3[j] in s0:
    continue
  
  dp[2][j] = 1


for i in range(3, N):
  for j in range(64):
    b = base3[j]
    idx_b = index_dict[b]
    if b in s1 or b in s2 or b in s3 or b in s4:
      for s in ['A', 'G', 'T']:
        idx = index_dict[(b[1], b[2], s)]
        dp[i][idx] += dp[i-1][idx_b]
        dp[i][idx] %= MOD
    elif b in s5:
      for s in ['A', 'C', 'T']:
        idx = index_dict[('A', 'C', s)]
        dp[i][idx] += dp[i-1][idx_b]
    else:
      for s in ['A', 'C', 'G', 'T']:
        idx = index_dict[(b[1], b[2], s)]
        dp[i][idx] += dp[i-1][index_dict[b]]
        dp[i][idx] %= MOD
        

ans = sum(dp[-1]) % MOD
print(ans)

Measured memory_bytes: 3316
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int sum(int a) {
  int ans = 0;
  while (a > 0) {
    ans += a % 10;
    a /= 10;
  }
  return ans;
}

int f(int a, int b) {
  return (sum(a) + sum(b));
}

int main() {
  int n;
  cin >> n;
  int ans = 2e9;
  for (int i = 1; i < n; i++) {
    int a = i, b = n - i;
    ans = min(ans, f(a, b));
  }
  cout << ans << endl;
  return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <vector>
#include <unordered_map>
#include <map>

using namespace std;

int main(void) {
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;
    std::vector<pair<int,int>> v(n);
    for (auto& el : v) {
        cin >> el.first >> el.second;
    }

    int64_t ad = 0;
    for (int i = n - 1; i >= 0; i--) {
        int64_t cur = (v[i].second - (v[i].first + ad) % v[i].second) % v[i].second;
        ad += cur;
    }
    cout << ad << endl;
}


Measured memory_bytes: 1024
# Acceptance of input

import sys

file_input = sys.stdin

V, E = map(int, file_input.readline().split())

adj_mat = [[0] * V for i in range(V)]

for line in file_input:
    u, v, c = map(int, line.split())
    adj_mat[u][v] = c

# Dinic's algorithm

import collections

# BFS for residual capacity network to construct level graph
def bfs(start, goal, parent):
    level = [V] * V
    unvisited = [True] * V
    queue = collections.deque()
    queue.append(start)
    level[start] = 0
    unvisited[start] = False
    while queue:
        u = queue.popleft()
        next_level = level[u] + 1
        for v, r_capacity in enumerate(adj_mat[u]):
            if (level[v] >= next_level) and (r_capacity > 0):
                level[v] = next_level
                parent[v].append(u)
                if unvisited[v]:
                    queue.append(v)
                    unvisited[v] = False
    return level[goal]

# DFS for level graph and construct blocking flow
def dfs(goal, path, parent, blocking_flow):
    v = path[-1]
    if v == goal:
        aug_path_flow = 10000
        for x, y in zip(path[1:], path[:-1]):
            aug_path_flow = min(aug_path_flow, adj_mat[x][y])
        for x, y in zip(path[1:], path[:-1]):
            adj_mat[x][y] -= aug_path_flow
            adj_mat[y][x] += aug_path_flow
        blocking_flow[0] += aug_path_flow
    else:
        for u in parent[v]:
            path.append(u)
            dfs(goal, path, parent, blocking_flow)
            path.pop()

def dinic(source, sink):
    max_flow = 0
    parent = [[] for i in range(V)]
    while bfs(source, sink, parent) != V:
        blocking_flow = [0]
        path = [sink]
        # search in reverse direction from sink
        dfs(source, path, parent, blocking_flow)
        max_flow += blocking_flow[0]
        parent = [[] for i in range(V)]
    return max_flow

# output
print(dinic(0, V - 1))

Measured memory_bytes: 8120
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int tmp = 0;
  int m = 0;
  for (int i = 0; i < S.size(); i++) {
    char c = S.at(i);
    if (c == 'A' || c == 'G' || c == 'C' || c == 'T')  tmp++; 
    
    else if (tmp > m) {
      m = tmp;
      tmp = 0;
    }
  }
  m = max(m, tmp);
  cout << m << endl;
}


Measured memory_bytes: 256
n = int(input())
s = list(input())

alphabet = [chr(i) for i in range(65, 65+26)]*2
l = []
for i in range(len(s)):
    k = alphabet.index(s[i])
    l.append(k)
    
ans = []
for j in range(len(l)):
    ans.append(alphabet[l[j]+n])
    
for a in range(len(ans)):
    print(ans[a], end='')

Measured memory_bytes: 4724
//Author - Rahil Malhotra
#include <bits/stdc++.h>
using namespace std;
 
template <typename T> void print(T t) { cout<<t<<endl; }
template<typename T, typename... Args> void print(T t, Args... args) { cout<<t<<" "; print(args...); }
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define double long double

int32_t main()
{
    IOS;
    int d,t,s;
    cin>>d>>t>>s;
    if(d>s*t)
        print("No");
    else
        print("Yes");
}


Measured memory_bytes: 3636
#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

constexpr ll INF = 1e16;

#define rep(i, N) for(ll i=0; i<N; ++i)

ll max(ll a, ll b) {return a < b ? b : a; }
ll min(ll a, ll b) {return a > b ? b : a; }
double maxf(double a, double b) { return a < b ? b : a; }

int main() {
  int n;
  string s, t;
  cin>>n;
  cin>>s>>t;

  for(int i = 0; i<n; i++){
    cout<<s[i]<<t[i];
  }

  return 0;
}

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

using namespace std;


int main(int argc, char *argv[])
{
	int N;
	deque<int> d;

	cin >> N;
	vector<int> v(N);

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

	for (int i = 0; i < N; i++) {
		int p = lower_bound(d.begin(), d.end(), v[i]) - d.begin();
		if (p == 0) {
			d.push_front(v[i]);
		} else {
			d[p - 1] = v[i];
		}
	}

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

	return 0;
}

Measured memory_bytes: 1024
n = int(input()) 
a = [int(x) for x in input().split()]
cnt = 0
isAllEven = True

while isAllEven:
    for i in range(n):
        if a[i]%2 == 1:
            isAllEven = False
        else:
            a[i] = a[i]/2
    if isAllEven == False:
        break
    cnt += 1
print(cnt)

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, K;
    cin >> N >> K;
    vector<int> P(N);
    for(int i=0; i<N; i++) cin >> P.at(i);

    sort(P.begin(), P.end());
    int ans = 0;
    for(int i=0; i<K; i++)
    {
        ans += P[i];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3652
#define rep(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
template<class T> inline void chmax(T &a, const T &b) {if(a < b) a = b;}
template<class T> inline void chmin(T &a, const T &b) {if(a > b) a = b;}
const long long INF = 1LL<<60;

const ll MAXN = (ll)2e3+10;
const ll DIV = (ll)1e9+7;


int main(void) {
   ll N;
   cin>>N;
   ll ans = ceil(log2(N));
   // cout<<ans<<endl;
   ll A[N][N];
   rep(i,0,N) rep(j,0,N) A[i][j] = 0;
   rep(i,0,N) rep(j,0,N) {
      rep(k,1,ans+1) {
         if (i%(int)pow(2,k) != j%(int)pow(2,k)) {
            A[i][j] = k;
            break;
         }
      }
   }
   rep(i,0,N) {
      rep(j,0,N) {
         if (i>=j) continue;
         cout<<A[i][j]<<" ";
      }
      cout<<endl;
   }



   return 0;
}

Measured memory_bytes: 2432
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
class Program
{
    static void Main()
    {
        string input = ReadLine();
        string[] a = input.Split(' ');
        int[] b = new int[a.Length];
        for (int i = 0; i < a.Length; i++){
            b[i] = int.Parse(a[i]);
        }

        int total = 0;
        for (int i = 0; i <= b[0]; i++){
            int num = i;
            int sum = 0;
            while(num / 10 > 0){
                sum += num % 10;
                num -= num % 10;
                num /= 10;
            }
            sum += num;

            if(sum >= b[1] && sum <= b[2]){
                total += i;
            }
            
        }
        WriteLine(total.ToString());
    }
}

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

const long long INF = 1000000000;

typedef long long ll;

#define writeln(n) cout<<n<<"\n";

typedef pair<int, int> P;
typedef pair<string, int> Psi;

int d[100010];



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

	int n,k,q;cin>>n>>k>>q;

	for(int i=0; i<q; i++){
		int tmp; cin>>tmp;

		d[tmp]++;
	}

	for(int i=1; i<=n; i++){
		if(q-d[i] >=k){
			writeln("No");
		}else {
			writeln("Yes");
		}
	}



}




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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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

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

ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

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

    int N, K;
    cin >> N >> K;
    vector<int> cnt_A(N);

    int tmp = 0;
    for(int i = 0; i < N; i++){
        cin >> tmp;
        tmp--;//0indexed
        cnt_A[tmp]++;
    }

    vector<int> cnt_n0;
    for(int i = 0; i < N; i++){
        if(cnt_A[i] > 0){
            cnt_n0.push_back(cnt_A[i]);
        }
    }

    sort(cnt_n0.begin(), cnt_n0.end(), greater<int>());

    int sum_k = 0;
    for(int i = 0; i < min(K, int(cnt_n0.size()) ); i++){
        sum_k += cnt_n0[i];
    }

    cout << (N - sum_k) << endl;


    return 0;
}



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

int main(){
  int k,s,count=0;
  cin >> k >> s;
  if(k*3<s)cout << 0 <<endl;
  else{
    r(i,k+1){
      r(j,k+1){
          if((s-i-j)>=0&&(s-i-j)<=k)count++;
      }
    }
    cout << count << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll t;
ll ret = 0;
ll A = 0, B = 0, C = 0;
string s;


void input() {
  IN(A);
  IN(B);
  IN(C);
}

void solve() {
  bool ok = false;
  ok |= (A == B) && (B != C);
  ok |= (B == C) && (C != A);
  ok |= (C == A) && (A != B);
  PRINT(ok?"Yes":"No");
}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <unordered_map>
#include <assert.h>
using namespace std;

#define ran(i, a, b) for ((i) = (a); (i) < (b); (i)++)
#define rep(i, a) ran ((i), 0, (a))
#define rep1(i, a) ran ((i), 1, (a)+1)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long long ll;
#define _0 first
#define _1 second
#define _pb(x) push_back(x)
#define _mp(x, y) make_pair(x, y)
#if defined(SHIROKO1_LOCAL) && !defined(NDEBUG)
#define DEBUG(...) fprintf(stderr, "[DEBUG] " __VA_ARGS__)
#else
#define DEBUG(...) ((void)0)
#endif

static vi swaps;
static vii queries;
static bool A_is_upper;
static int X;

static struct trans {
	int h, l, m;
	void identity() { h = 0; l = 0; m = X; }
	int operator()(int i)
	{
		if (i <= l)
			return h;
		else if (i <= m)
			return h+i-l;
		else
			return h+m-l;
	}
	void down(int i)
	{
		h -= i;
		if (h < 0) {
			l += -h;
			m = max(m, l);
			h = 0;
		}
		DEBUG("DOWN %i\n", i);
		DEBUG("TR %i %i %i\n", h, l, m);
	}
	void up(int i)
	{
		h += i;
		if (h > X) {
			h = X;
			l = X;
			m = X;
		} else if (m-l+h > X) {
			m = X+l-h;
		}
		DEBUG("UP %i\n", i);
		DEBUG("TR %i %i %i\n", h, l, m);
	}
} Tr;

static int gtime;

static void run_to(int time)
{
	assert(time >= gtime);
	time -= gtime;
	gtime += time;
	if (A_is_upper)
		Tr.down(time);
	else
		Tr.up(time);
}

static void solve()
{
	auto si = swaps.begin();
	auto qi = queries.begin();
	Tr.identity();
	A_is_upper = 1;
	gtime = 0;
	for (;;) {
		if (si != swaps.end() && qi != queries.end()) {
			if (*si <= qi->_0) {
				DEBUG("SWAP %i\n", *si);
				run_to(*si);
				A_is_upper ^= 1;
				si++;
			} else {
				DEBUG("ANSWER %i %i\n", qi->_0, qi->_1);
				run_to(qi->_0);
				cout << Tr(qi->_1) << endl;
				qi++;
			}
		} else if (qi != queries.end()) {
			DEBUG("ANSWER %i %i\n", qi->_0, qi->_1);
			run_to(qi->_0);
			cout << Tr(qi->_1) << endl;
			qi++;
		} else // don't care about traling swaps
			break;
	}
}

int main()
{
	int k, q, r, t, a;
	cin >> X;
	cin >> k;
	while (k--) {
		cin >> r;
		swaps._pb(r);
	}
	cin >> q;
	while (q--) {
		cin >> t >> a;
		queries._pb(_mp(t, a));
	}
	solve();
	return 0;
}


Measured memory_bytes: 2548
#include <iostream>
#include <cstdint>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

const int M = 1e5;
int grid[M] = {0};
int dp[M] = {0};

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

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

    dp[1] = abs(grid[0] - grid[1]);

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

    cout << dp[n - 1];

    return 0;
}



Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <cmath>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1145141919
typedef long long int ll;
using namespace std;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
    for (T &x : vec)
        is >> x;
    return is;
}

ll gcd(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    while (m != n)
    {
        if (m > n)
            m = m - n;
        else
            n = n - m;
    }
    return m;
}

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

int ctoi(const char c)
{
    if ('0' <= c && c <= '9')
        return (c - '0');
    return -1;
}


int main(){
    int a,b,c;
    cin >> a >> b >> c;

    if(a+b>=c){
        cout << b+c << endl;
    }else{
        cout << b + (a+b+1) << endl;
    }

    return 0;
}

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

void prians(bool answer) {
  if(answer)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
string s, t;
int same[27][27] = {0};

bool solve();

int main() {
  cin >> s >> t;

  prians(solve());
  return 0;
}

bool solve() {
  for(int i = 0; i < s.size(); ++i) {
    if(!same[t[i] - 'a'][s[i] - 'a']) {
      ++same[t[i] - 'a'][26];
      ++same[t[i] - 'a'][s[i] - 'a'];
      ++same[26][s[i] - 'a'];
    }
  }
  for(int i = 0; i < 26; ++i)
    if(same[i][26] > 1 || same[26][i] > 1) return 0;
  return 1;
}

Measured memory_bytes: 776
#include <stdio.h>
int main(){
    int N,i,count=0;
    scanf("%d",&N);
    char S[N+1];
    scanf("%s",S);
    if(N%2==1){
        printf("%s\n","No");
    }else{
        for (i=0;i<N/2;i++){
            if(S[N/2+i] == S[i]){
                count++;
            }
        }
        if(count == N/2){
            printf("%s\n","Yes");
        }else{
            printf("%s\n","No");
        }
    }
    return 0;
}

Measured memory_bytes: 128
program prob3
    implicit none
    real(8)::tmp
    integer::n, i, j
    integer, allocatable::x(:,:)
    read*, n
    tmp = dble(0)
    allocate(x(n,2))
    do i = 1, n
        read(*,*) x(i,1), x(i,2)
    end do
    do i = 2, n
        do j = 1, i-1
            tmp = tmp + sqrt(dble(x(i,1) - x(j,1))**2 + dble(x(i,2) - x(j,2))**2)
        end do
    end do
    tmp = tmp * dble(2) / dble(n)
    write(*,*) tmp
    stop
end program

Measured memory_bytes: 3012
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kein Yukiyoshi
 */

#include "bits/stdc++.h"
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define inv(i, a, b) for (int i = (int)(a); i >= (int)(b); i--)
#define ALL(obj) begin(obj), end(obj)
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
const int MOD = (int)(1e9 + 7);
const int INF = (int)(1e13 + 7);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); }
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }
int bpm(int x, unsigned int y) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  int ans   = 1;
  int digit = (int)((log((double)y) / log((double)2) / 1 + 1));
  x %= MOD;
  for (int i = 0; i < digit; i++) {
    if (((y >> i) & 1u) == 1) ans = ans * x % MOD;
    x = x * x % MOD;
  }
  return ans;
}
template <class T>
void cumulative_sum(T &container) {
  for (int i = 0; i < container.size() - 1; i++) container[i + 1] += container[i];
}

class DDecreaseContestantVer {
public:
  static void solve(std::istream &cin, std::ostream &cout) {
    int K;
    cin >> K;
    int N = 50;
    vector<int> ans(N, (N - 1) + N * (K / N));
    rep(i, N) ans[i] -= (K / N * (N - 1));
    rep(i, N) ans[i] -= K % N;
    rep(i, K % N) ans[i] += N + 1;
    cout << N << endl;
    rep(i, N - 1) {
      cout << ans[i] << " ";
    }
    cout<<ans[N-1]<<endl;
  }
};


signed main() {
  DDecreaseContestantVer solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 256
n=int(input())
h=list(map(int,input().split()))
dp=[0]*(len(h))
dp[1]+=abs(h[1]-h[0])
for i in range(len(h)-2):
  dp[i+2]+=min((abs(h[i+2]-h[i+1])+dp[i+1]),(dp[i]+abs(h[i+2]-h[i])))
print(dp[-1])
               



Measured memory_bytes: 20492
package main

import (
	"fmt"
)

const (
	A  = "GREATER"
	B  = "LESS"
	AB = "EQUAL"
)

func main() {
	var a, b string
	fmt.Scan(&a, &b)

	if len(a) > len(b) {
		fmt.Println(A)
		return
	} else if len(a) < len(b) {
		fmt.Println(B)
		return
	}
  	ans := AB
	if a > b {
		ans = A
	} else if a < b {
		ans = B
	}
	fmt.Println(ans)
	return
}

Measured memory_bytes: 512
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long m = sc.nextLong();
        long k = sc.nextLong();
        for (long i = 0; i <= n; i++) {
            for (long j = 0; j <= m; j++) {
                if (i * (m - j) + j * (n - i) == k) {
                    System.out.println("Yes");
                    return;
                }
            }
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
//make_tuple emplace_back next_permutation push_back make_pair second first setprecision

#if MYDEBUG
#include "lib/cp_debug.h"
#else
#define DBG(...) ;
#endif

using LL = long long;
constexpr LL LINF=334ll<<53;
constexpr int INF=15<<26;
constexpr LL  MOD=1E9+7;

struct Problem{
    LL k,n;
    void solve(){
        cin >> k >> n;
        vector<LL> ans(n);
        if(k%2==0){
            ans[0]=k/2;
            for(int i=1; i<n; ++i){
                ans[i]=k;
            }
        }else{
            for(int i=0; i<n; ++i){
                ans[i]=(k+1)/2;
            }
            LL backstep = n/2;
            vector<LL> s(n);
            s[0]=1;
            LL dig = 1,diff=k;
            while(1){
                s[dig]=s[dig-1]+diff;
                if(s[dig]>backstep)break;
                diff*=k;
                dig++;
            }
            for(int i=dig-1; i>=0; --i){
                LL tmp = min(ans[n-1-i]-1,backstep/s[i]);
                ans[n-1-i]-=tmp;
                backstep-=tmp*s[i];
            }
            for(int i=0; i<backstep; ++i){
                if(ans.back()==1){
                    ans.pop_back();
                }else if((int)ans.size()<n){
                    ans.back()--;
                    while((int)ans.size()<n)ans.push_back(k);
                }else{
                    ans[n-1]--;
                }
            }
        }
        for(int i=0; i<ans.size(); ++i){
            cout << ans[i] <<' ';
        }
        cout <<"\n";
    }
};

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

    Problem p;
    p.solve();
    return 0;
}



Measured memory_bytes: 4992
#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const long long INF=1LL << 60;
long long a,b;
long long dp[100200][110];
long long w[110],v[110];

int main() {
   int a,b,c,d;
   cin>>a>>b>>c>>d;
   cout<<max(a*b,c*d)<<endl;
}


Measured memory_bytes: 256