akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ull = unsigned long long;

int main(){
    int n; cin >> n;
    vector<string> s(100000);
    set<char> march;
    march.insert('M'); march.insert('A'); march.insert('R');
    march.insert('C'); march.insert('H');
    map<char, ull> memo;
    memo['M']=0; memo['A']=0; memo['R']=0;
    memo['C']=0; memo['H']=0;
    for(int i=0; i<n; i++){
        cin >> s[i];
        char init = s[i].at(0);
        if(march.count(init)){
            memo[init]++;
        }
    }

    ull ans=0;
    vector<ull> num(5, 0);
    num[0] = memo['M']; num[1]=memo['A']; num[2]=memo['R'];
    num[3] = memo['C']; num[4]=memo['H'];
    int P [10]={0 ,0 ,0 ,0 ,0 ,0 ,1 ,1 ,1 ,2};
    int Q [10]={1 ,1 ,1 ,2 ,2 ,3 ,2 ,2 ,3 ,3};
    int R [10]={2 ,3 ,4 ,3 ,4 ,4 ,3 ,4 ,4 ,4};

    for(int i=0; i<10; i++){
        ans += num[P[i]]*num[Q[i]]*num[R[i]];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6436
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
int main(){
    int n;cin >> n;
    ll m;cin >> m;
    vector<ll> a(n);
    for(int i=0;i<n;i++) cin >> a[i];
    map<ll,ll> mp;
    mp[0]++;
    for(int i=0;i<n;i++){
        a[i]%=m;
    }
    vector<ll> sum(n+1);
    for(int i=0;i<n;i++){
        sum[i+1]+=(sum[i]+a[i])%m;
        sum[i+1]%=m;
    }
    for(int i=1;i<=n;i++){
        mp[sum[i]]++;
    }
    ll ans=0;
    for(auto p:mp){
        ans+=p.second*(p.second-1)/2;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5760
#include<stdio.h>

int main(void) {
	int N;
	scanf("%d",&N);
	
	int a[N];
	int i;
	for(i = 0; i < N; i++) {
		scanf("%d",&a[i]);
	}
	
	int max = a[0];
	int min = a[0];
	for(i = 1; i < N; i++) {
		if(a[i] > max) {
			max = a[i];
		}
		if(a[i] < min) {
			min = a[i];
		}
	}
	
	printf("%d\n",max-min);
	
	return 0;
}

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

int main()
{
	int n;
	cin >> n;
	long long int A[300001];
	for (int i = 0; i < n * 3; ++i)
	{
		cin >> A[i];
	}
	sort(A, A + 3 * n);
	long long int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		ans += A[n + 2 * i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2560
N = int(input())

N = N % 10

if N == 2 or N == 4 or N == 5 or N == 7 or N == 9:
  print("hon")
  
elif N == 0 or N == 1 or N == 6 or N == 8:
  print("pon")
  
else:
  print("bon")


Measured memory_bytes: 9076
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <cmath>
#include <iomanip>

using namespace std;

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

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            if(i == j) continue;
            int p = x[j] - x[i];
            int q = y[j] - y[i];
            int cost = N;
            for(int k = 0; k < N; k++) {
                for(int l = 0; l < N; l++) {
                    if(x[k] - p == x[l] && y[k] - q == y[l]) --cost;
                }
            }
            if (cost < minCost) minCost = cost;
        }
    }

    cout << minCost << endl;
    

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
int cook[30];
bool dp[1000001],prime[1000001];
int main() {
	for(int i=2;i*i<=1000000;i++) {
		if(prime[i]) continue;
		for(int j=i*2;j<=1000000;j+=i) prime[j]=true;
	}
	int n,x;
	while(scanf("%d %d",&n,&x),n) {
		for(int i=0;i<n;i++) {
			scanf("%d",&cook[i]);
		}
		memset(dp,0,sizeof(dp));
		dp[0]=true;
		for(int i=0;i<n;i++) {
			for(int j=0;j<=x;j++) {
				if((j-cook[i])>=0) dp[j]|=dp[j-cook[i]];
			}
		}
		bool NA=true;
		for(int i=x;i>0;i--) {
			if(dp[i]&&!prime[i]) {
				printf("%d\n",i);
				NA=false;
				break;
			}
		}
		if(NA) printf("NA\n");
	}
}

Measured memory_bytes: 3000
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
int main()
{
    ll H, W;
    cin >> H >> W;

    ll ans = INF;
    repd(i, 0, H + 1) {
        ll A = i * W;
        ll w = W / 2;
        ll B = (H - i) * w;
        ll C = H * W - A - B;
        ll max_D = max(A, max(B, C));
        ll min_D = min(A, min(B, C));
        ans = min(ans, max_D - min_D);
    }

    repd(i, 0, W + 1) {
        ll A = i * H;
        ll h = H / 2;
        ll B = (W - i) * h;
        ll C = H * W - A - B;
        ll max_D = max(A, max(B, C));
        ll min_D = min(A, min(B, C));
        ans = min(ans, max_D - min_D);
    }

    if (H % 3 == 0) ans = 0;
    else ans = min(ans, W);

    if (W % 3 == 0) ans = 0;
    else ans = min(ans, H);

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

Measured memory_bytes: 256
#include <iostream>

int main()
{
    int H, W;
    std::cin >> H;
    std::cin >> W;
    int h, w;
    std::cin >> h;
    std::cin >> w;

    int a;
    a = (H-h)*(W-w);
    std::cout << a << std::endl;

    return 0;
}

Measured memory_bytes: 256
//
//  main.cpp
//  HelloWorld
//
//  Created by purple on 2020/04/13.
//  Copyright © 2020 Purple. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <regex>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    #define PI 3.14159265359


    
    int r;
    
    cin >> r;
    
    cout << 2*r*PI;
    
    return 0;
    
}


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

int main(void){
  int a, b;

  cin >> a >> b;

  if(a > b){
    cout << "a > b\n";

  } else if (a < b) {
    cout << "a < b\n";

  } else {
    cout << "a == b\n";

  }

  return 0;
}

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

int N, M;
const int MAX_N = 1.0e5 + 100;
ll A[MAX_N], B[MAX_N];

int main() {
    cin >> N >> M;
    for (int i = 0; i < M; i++) {
        cin >> A[i] >> B[i];
    }

    int cnt[N+1];
    memset(cnt, 0, sizeof(cnt));

    for (int i = 0; i < M; i++) {
        cnt[A[i]]++;
        cnt[B[i]]++;
    }

    bool f = true; 
    for (int i = 0; i < N; i++) {
        if (cnt[i] % 2 == 1) {
            f = false;
            break;
        }
    }

    cout << (f ? "YES" : "NO") << endl;

    return 0;
}


Measured memory_bytes: 2176
#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>  
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 1e9+7;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 1e17
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
 
ll mpow(ll a, ll b){
	if(b >= (MOD-1)) b %= (MOD-1);
	if(b==0) return 1;
	ll t1 = mpow(a,b/2);
	t1 *= t1;
	t1 %= MOD;
	if(b%2) t1 *= a;
	t1 %= MOD;
	return t1;
}
 
ll mpow(ll a, ll b, ll p){
	if(b==0) return 1;
	ll t1 = mpow(a,b/2,p);
	t1 *= t1;
	t1 %= p;
	if(b%2) t1 *= a;
	t1 %= p;
	return t1;
}
 
ll modinverse(ll a, ll m){
	ll m0 = m; 
    ll y = 0, x = 1; 
    if (m == 1) return 0; 
    while (a > 1){
        ll q = a / m; 
        ll t = m; 
        m = a % m, a = t; 
        t = y; 
        y = x - q * y; 
        x = t; 
    }
    if (x < 0) x += m0; 
    return x; 
}
 
ll range(ll l, ll r){
	return l + rand()%(r-l+1);
}

void solve(){
	string s;
	cin >> s;
	bool bo = 1;
	ll k;
	cin >> k;
	forsn(i,1,sz(s)){
		if(s[i]!=s[0]) bo=0;
	}
	if(bo){
		cout << (k*sz(s))/2 << ln;
		return;
	}
	ll ans = 0;
	forsn(i,1,sz(s)){
		if(s[i]==s[i-1]){
			ans++;
			i++;
		}
	}
	if(s[0] == s[sz(s)-1]){
		ll st = 1;
		ll en = 1;
		forsn(i,1,sz(s)){
			if(s[i]!=s[0]) break;
			st++;
		}
		rforn(i,sz(s)-2){
			if(s[i]!=s[sz(s)-1]) break;
			en++;
		}
		if(st%2 && en%2) cout << k*ans + k - 1 << ln;
		else cout << ans*k << ln;
	}
	else{
		cout << ans*k << ln;
	}
}
 
int main()
{
	fast_cin();
    ll t=1;
    // cin>>t;
    forn(i,t) {
    	// cout << "Case #" << i+1 << ": ";
    	solve();
    }
    return 0;
}

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

int main(){
    long n;
    cin>>n;
    deque<long> que;
    rep(i, n){
        long a; cin>>a;
        if(i%2 == 0) que.push_back(a);
        else que.push_front(a);
    }

    rep(i, n){
        if(n%2 == 1){
            cout << que.back();
            que.pop_back();
        }else{
            cout << que.front();
            que.pop_front();
        }

        if(i != n-1){
            cout << " ";
        }else{
            cout << endl;
        }
    }
}


Measured memory_bytes: 5248
<?php
//error_reporting(0);
//$S = trim(fgets(STDIN));
list($N,$M) =  explode(" ",trim(fgets(STDIN)));
$A = explode(" ",trim(fgets(STDIN)));

$q = new SplPriorityQueue();
$q->setExtractFlags(SplPriorityQueue::EXTR_BOTH);
foreach($A as $k=>$v) {
  $q->insert($k,$v);
  //printf("%d\n",intdiv($v,2));
}
for($i=0;$i<$M;$i++) {
  $v = $q->extract();
  $v['priority'] = intdiv($v['priority'],2);
  $q->insert($v['data'],$v['priority']);
}
$res = 0;
while(!$q->isEmpty()) {
  $v = $q->extract();
  $res += $v['priority'];
}
printf("%d\n",$res);


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

#define MAXN 2010
typedef long long LL;

int a[MAXN << 1], b[MAXN << 1], p0[MAXN], p1[MAXN];
int dp[MAXN][MAXN], big0[MAXN << 1][MAXN], big1[MAXN << 1][MAXN];
const int INF = 1e9;


int main()
{
	//freopen("in.txt", "r", stdin);
	
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= 2 * n; ++i)
	{
		char c;
		scanf(" %c", &c);
		if (c == 'B') a[i] = 1;
		else a[i] = 0;
		scanf("%d", &b[i]);
	}
	vector<pair<int, int> > v;
 	for (int i = 1; i <= 2 * n; ++i)
	{
		if (a[i] == 0)
		{
			v.push_back(make_pair(b[i], i));
		}
	}
	sort(v.begin(), v.end());
	for (int i = 0; i < v.size(); ++i)
	{
		b[v[i].second] = i + 1;
		p0[i + 1] = v[i].second;
	}
	v.clear();
 	for (int i = 1; i <= 2 * n; ++i)
	{
		if (a[i] == 1)
		{
			v.push_back(make_pair(b[i], i));
		}
	}
	sort(v.begin(), v.end());
	for (int i = 0; i < v.size(); ++i)
	{
		b[v[i].second] = i + 1;
		p1[i + 1] = v[i].second;
	}
	v.clear();
	
	for (int i = 1; i <= 2 * n; ++i)
	{
		for (int j = 1; j <= n; ++j)
		{
			big0[i][j] = big0[i - 1][j];
			big1[i][j] = big1[i - 1][j];
			if (a[i] == 0 && b[i] >= j) ++big0[i][j];
			if (a[i] == 1 && b[i] >= j) ++big1[i][j];
		}
	}
	
	for (int i = 0; i <= n; ++i)
		for (int j = 0; j <= n; ++j)
			dp[i][j] = INF;
	
	//for (int i = 1; i <= n; ++i)
	//	cout << p0[i] << " " << p1[i] <<endl;
	dp[0][0] = 0;
	for (int len = 0; len < 2 * n; ++len)
	{
		for (int i = 0; i <= len; ++i)
		{
			int j = len - i;
			if (i > n || j > n) continue;
			if (dp[i][j] == INF) continue;
			//cout << i << " " << j << " " << dp[i][j] << endl;
			if (i < n)
			{
				int pos = p0[i + 1];
				dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + big0[pos - 1][i + 1] + big1[pos - 1][j + 1]);
			}
			if (j < n)
			{
				int pos = p1[j + 1];
				dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + big1[pos - 1][j + 1] + big0[pos - 1][i + 1]);
			}
		}
	}
	cout << dp[n][n] << endl;
	return 0;
}
 

Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  int fx = 0;
  
  for (int i = 0; i < 8; i++) {
    
    int keta = 10;
    
    for (int j = 0; j < i; j++) {
      keta *=  10;
    }
    
    fx += (N % keta) / (keta / 10);
  
  }
  
  if (N % fx == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

}

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

int main(){
    ll N;  cin >> N;
    vector<ll> div;
    for(ll i=1; i*i<=N; i++){
        if(N%i==0){
            div.push_back(i);
            if(i*i!=N){
                div.push_back(N/i);
            }
        }
    }

    ll ans = 0;
    int n = div.size();
    for(int i=0; i<n; i++){
        if(div[i]==1) continue;
        ll m = div[i]-1;
        if(N/m==N%m){
            ans += m;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
#include<iostream>
using namespace std;
using ll=long long;
int main(){

  ll A,B,C;
  cin>>A>>B>>C;
  ll K;
  cin>>K;
  int ans=0;
  if(K%2==0)cout<<A-B;
  else cout<<B-A;
  return 0;
}

Measured memory_bytes: 3588
#include <iostream>

using namespace std;
const int N = 1e5 + 5;
int arr[N];
int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    int ans , beg;
    ans = beg = 0;
    for(int i = 1; i < n; i++)
    {
        if(arr[i] > arr[i - 1])
        {
            beg = i;
        }
        ans = max(ans, i - beg);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#pragma once
#include <stdio.h>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define bit(x,v) ((ll)x << v)

const ll INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}

// res[i][c] := i 文字目以降で最初に文字 c が登場する index (存在しないときは n)
vector<vector<int> > calcNext(const string & S) {
	int n = (int)S.size();
	vector<vector<int> > res(n + 1, vector<int>(26, n));
	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < 26; ++j) res[i][j] = res[i + 1][j];
		res[i][S[i] - 'a'] = i;
	}
	return res;
}
// mod 1000000007 の世界で a += b する関数
void add(long long& a, long long b) {
	a += b;
	if (a >= MOD) a -= MOD;
}

ll f(ll b, ll n) {
	if (b > n) return n;
	return f(b, n / b) + (n % b);
}
ll x[35], y[35];
ll memo[35][35][35][35];
int n;
ll calc(int x1, int y1, int x2, int y2) {

	ll &res = memo[x1][y1][x2][y2];
	if (~res) return res;
	res = 0;
	ll xl = x[x1];
	ll yu = y[y1];
	ll xr = x[x2];
	ll yd = y[y2];
	for (size_t i = 0; i < n; i++)
	{
		if (x[i] <= xl || xr <= x[i] || y[i] <= yu || yd <= y[i]) continue;
		ll sum = (xr - xl - 1) + (yd - yu - 1) - 1;
		sum += calc(x1, y1, i, i);
		sum += calc(i, y1,x2,i);
		sum += calc(x1, i, i, y2);
		sum += calc(i, i, x2, y2);
		res = max(res, sum);
	}
	return res;
}
void solv() {

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

	int p = n - k;
	if (k == 1) {
		cout << 0 << endl;
	}else 
		cout << p << endl;

}

int main() {
//	COMinit();
	solv();

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
   int n,temp,min,cnt=1;
   scanf("%d",&n);
   scanf("%d",&min);
   for(int i=1;i<n;i++){
      scanf("%d",&temp);
      if(temp >= min){
         cnt++;
         if(temp>min) min = temp;
      }
   }
   printf("%d\n",cnt);
}

Measured memory_bytes: 128
N = int(input())
S = [int(input()) for _ in range(N)]

ans = sum(S)
S = [s for s in S if s % 10 != 0]
S.sort()
if ans % 10 == 0 and len(S) > 0:
    ans -= S[0]
elif ans % 10 == 0 and len(S) == 0:
    ans = 0
print(ans)


Measured memory_bytes: 38384
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(
			new InputStreamReader(System.in));
		try {
			String nandk[] = br.readLine().split(" ");
			int n = Integer.parseInt(nandk[0]);
			int k = Integer.parseInt(nandk[1]);
			String[] h = br.readLine().split(" ");
			int count = 0;

			for(int i = 0; i < n; i++) {
				if(Integer.parseInt(h[i]) >= k) {
					count++;
				}
			}

			System.out.println(count);
			br.close();
		} catch(IOException e) {
			e.printStackTrace();
		}
	}
}


Measured memory_bytes: 32104
using System;
using System.Text;

namespace AOJ.Volume0
{
    public class RunLength
    {
        public static int Main()
        {
            var output = new StringBuilder();

            while (true)
            {
                var input = Console.ReadLine();
                if (string.IsNullOrEmpty(input)) { break; }

                string exp = "";
                for(int i = 0; i < input.Length; i++)
                {
                    if(input[i] == '@')
                    {
                        int len = int.Parse(input[i + 1].ToString());
                        exp += new string(input[i + 2], len);
                        i += 2;
                    }
                    else { exp += input[i]; }
                }

                output.AppendLine(exp);
            }
            Console.Write(output);
            return 0;
        }
    }
}

Measured memory_bytes: 8912
n = int(input())
A = [int(a) for a in input().split()]
M = max(A)
ans = 0
for i in range(0,n):
    ans = max(ans, min(A[i], M - A[i]))
if ans in A:
    print(M,ans)
else:
    print(M,M - ans)
    

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

string S;

int main(){
  cin >> S;
  if (S == "A") cout << 'T' << endl;
  else if (S == "T") cout << 'A' << endl;
  else if (S == "G") cout << 'C' << endl;
  else cout << 'G' << endl;
}


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

using namespace std;

int main()
{
    int sx,sy,tx,ty;
    
    scanf("%d%d%d%d",&sx,&sy,&tx,&ty);
    
    int curr_x=sx-1,curr_y=sy;
    
    printf("L");
    
    while(curr_y<=ty)
    {
        printf("U");
        curr_y++;
    }
    
    while(curr_x<tx)
    {
        printf("R");
        curr_x++;
    }
    
    printf("D");
    
    curr_x=tx;
    curr_y=ty;
    
    while(curr_x>sx)
    {
        printf("L");
        curr_x--;
    }
    
    while(curr_y>sy)
    {
        printf("D");
        curr_y--;
    }
    
    printf("D");
    curr_y--;
    
    while(curr_x<=tx)
    {
        printf("R");
        curr_x++;
    }
    
    while(curr_y<ty)
    {
        printf("U");
        curr_y++;
    }
    
    printf("L");
    curr_x--;
    
    while(curr_y>sy)
    {
        printf("D");
        curr_y--;
    }
    
    while(curr_x>sx)
    {
        printf("L");
        curr_x--;
    }

    return 0;
}

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

double MIN(double a,double b){
    if(a<b){
        return a;
    }else{
        return b;
    }
}
int main()
{
    double n,sum=0,chk=10000;
    int ans;
    cin >> n;
    vector<double> a(n);
    for(int i=0;i<n;i++){
        cin >> a.at(i);
        sum+=a.at(i);
    }
    double avr=sum/n;
    for(int i=0;i<n;i++){
        a.at(i)=abs(a.at(i)-avr);
        chk=MIN(chk,a.at(i));
    }
    for(int i=0;i<n;i++){
        if(a.at(i)==chk){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}

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

using namespace std;

int T;

int main() {
  cin >> T;
  vector<double> es;
  for (int i = 0; i < T; i++) {
	int n, m;
	cin >> n >> m;
	vector<int> fs;
	vector<double> ps;
	double q = 0;
	for (int j = 0; j < m; j++) {
	  int face;
	  double p;
	  cin >> face >> p;
	  fs.push_back(face);
	  ps.push_back(p);
	  q += p;
	}
	q = 1 - q;
	double e = 0;
	double p = 1;
	for (int j = 0; j < 100; j++) {
	  for (int k = 0; k < m; k++) {
		e += p * ps[k] * fs[k];
	  }
	  p *= q;
	}
	es.push_back(e);
  }
  int P, Q;
  cin >> P >> Q;
  vector<int> fs;
  vector<double> ps;
  double q = 0;
  for (int i = 0; i < Q; i++) {
	int face;
	double p;
	cin >> face >> p;
	q += p;
	fs.push_back(face);
	ps.push_back(p);
  }
  q = 1 - q;
  double p = 1;
  double e = 0;
  for (int i = 0; i < 100; i++) {
	for (int k = 0; k < Q; k++) {
	  e += p * ps[k] * fs[k];
	}
	p *= q;
  }
  for (int i = 0; i < T; i++) {
	if ((es[i] - e) > 0.0000001) {
	  cout << "YES" << endl;
	  return 0;
	}
  }
  cout << "NO" << endl;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef vector<P> G;
inline double dot(const P& a, const P& b) { return real(conj(a)*b);}
inline double cross(const P& a, const P& b) { return imag(conj(a)*b);}

#define curr(g, i) g[i]
#define next(g, i) g[(i+1)%g.size()]
enum { OUT, ON, IN };
int contains(const G& g, const P& p) {
    bool in = false;
    for (int i = 0; i < g.size(); ++i) {
        P a = curr(g,i) - p, b = next(g,i) - p;
        if (imag(a) > imag(b)) swap(a, b);
        if (imag(a) <= 0 && 0 < imag(b))
            if (cross(a, b) < 0) in = !in;
        if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
    }
    return in ? IN : OUT;
}

int main(){
    G g(3);
    P p;
    while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
                 &g[0].real(), &g[0].imag(), &g[1].real(), &g[1].imag(), &g[2].real(), &g[2].imag(),
                 &p.real(), &p.imag())){
        cout << (contains(g,p)==IN? "YES": "NO") << endl;
    }
}

Measured memory_bytes: 1228
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    d = int(ipt())
    c = [int(i) for i in ipt().split()]
    s = [[int(i) for i in ipt().split()] for _ in range(d)]
    ld = [-1]*26
    edval = [0]*26

    for i in range(d):
        edval = s[i]*1
        for j in range(26):
            dl = i-ld[j]
            edval[j] += c[j]*dl*(dl+1)//2*0.75
        v = edval.index(max(edval))
        ld[v] = i
        print(v+1)

    return

if __name__ == '__main__':
    main()


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

typedef long long ll;
int main(){
    int n;
    cin >> n;
    ll a[210000];
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    
    ll x=a[0], y=0;
    for(int i=1; i<n; i++){
        y += a[i];
    }
    ll ans = abs(x-y);
    for(int i=1; i<n-1; i++){
        x += a[i];
        y -= a[i];
        ans = min(ans, abs(x-y));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val a,b = sc.nextLong
  
  def loop(p: Long, q: Long): Long = {
    val r = p % q
    if (r == 0) q
    else loop(q, r)
  }
  
  val koyakusu = if (a >= b) loop(a, b) else loop(b, a)
  
  println(a * b / loop(a, b))
}

Measured memory_bytes: 25532
#include<cstdio>
#include<algorithm>

using namespace std;
int main(void)
{
	int n,a[101],i,cnt,flg,max;
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	sort(a,a+n);
	cnt=0; max=0; flg=0;
	for(i=0;i<n;i++){
		if(flg==a[i]) a[i]=-1;
		if(max<a[i]){
			flg=a[i]; a[i]=0;
			cnt++;
		}
		//printf("%d\n",flg);
	}
	//for(i=0;i<n;i++) printf("%d\n",a[i]);
	printf("%d\n",cnt);
	return 0;
}	

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


int main()
{
	long long n, m, l, a[100][100] = {}, b[100][100] = {}, c[100][100] = {};
	cin >> n >> m >> l;
	for (int i = 0;i < n;i++) {
		for (int j = 0;j < m;j++)
			cin >> a[i][j];
	}
	for (int I = 0;I < m;I++) {
		for (int J = 0;J < l;J++)
			cin >> b[I][J];
	}

	for (int z = 0;z < n;z++) {
		for (int y = 0;y < l;y++) {
			for (int x = 0;x <m ;x++) {
				c[z][y] = c[z][y] + a[z][x] * b[x][y];
			}
		}
	}

	
	for (int d = 0;d < n;d++) {
		for (int e = 0;e < l;e++) {
			if (e != l - 1)
				cout << c[d][e] << " ";
			else
				cout << c[d][e];
		}
		cout << endl;
	}
    return 0;
}



Measured memory_bytes: 3360
use std::io;
fn main() {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).expect("input error");
    let mut splitted = buffer.split_whitespace();
    let a = splitted.next().unwrap().parse::<i32>().unwrap();
    let op = splitted.next().unwrap();
    let b = splitted.next().unwrap().parse::<i32>().unwrap();
    let result = if op == "+" {
        a + b
    } else {
        a - b
    };
    println!("{}", result);
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long int
#define INF 1000000007
#define llINF 1000000000000000007
#define v(i) vector<i>
#define vv(i) vector<vector<i>>
// cin.eof() 入力個数の問題
// int num = atoi(string.c_str()); 文字列の整数変換
int keta(ll n){int ans=0;while(n>0){n /= 10; ans++;}return ans;}
ll _pow(ll a,ll b){ll ans = 1;rep(i,b){ ans *= a;}return ans;}

int main() {
string s; cin>>s;
s.pop_back();
while(1){
    //cout<<s<<endl;
    if(s.size() % 2 == 1){
        s.pop_back();//一文字へらす
        continue;
    }//奇数列はない
    bool flag = true;
    for(int i = 0; i < s.size()/2; i++){
        if(s[i] != s[s.size()/2 + i]){
            flag = false;//前と真ん中から見て違ったらだめ
        }
    }
    if(flag){
    cout<<s.size()<<endl;//上が通れば大丈夫
    return 0;
    }else
    {
        s.pop_back();
    }
}
    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    ll k,n,D,p;
    cin>>k>>n;
    deque<ll>home;
    for(ll i=0;i<n;i++)
    {
        ll x; cin>>x;
        home.push_back(x);
    }
    ll dis = home.back() - home.front();
    for(ll i=1;i<n;i++)
    {
        p=home.back(); home.pop_back();
        home.push_front(p);

        if(home.back() > home.front()) D = home.back() - home.front();
        else D = (k + home.back()) - home.front();

        if(dis<=D) dis=dis;
        else dis=D;
    }
    cout<<dis<<"\n";
return 0;
}


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

const int maxn = 1e5 + 10;
int n, V, v[maxn], w[maxn], f[maxn];

int main() {
	scanf("%d %d", &n, &V); int S = 0;
	for (int i = 1; i <= n; i++) {
		scanf("%d %d", v + i, w + i), S += w[i];
	}
	memset(f, 0x3f, sizeof f), f[0] = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = S; j >= w[i]; j--) {
			f[j] = min(f[j], f[j - w[i]] + v[i]);
		}
	}
	for (int i = S; ~i; i--) {
		if (f[i] <= V) return printf("%d", i), 0;
	}
	return 0;
}

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

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORTASC(c) sort((c).begin(),(c).end())
#define SORTDESC(c,t) sort((c).begin(),(c).end(), std::greater<t>());
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define VMAX(a) *max_element(ALL(a))
#define VMIN(a) *min_element(ALL(a))
#define OUT(a) cout << (a) << endl;
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double PI  = acos(-1.0);

template <class T, class S>
using umap = std::unordered_map<T, S>;
using ll = long long;
using namespace std;

int main() {
    string s;

    cin >> s;

    ll year = stoi(s.substr(0, 4));
    ll month = stoi(s.substr(5, 2));
    ll day = stoi(s.substr(8, 2));

    if (year >= 2020){
        cout << "TBD" << endl;
        return 0;
    }

    if (year == 2019) {
        if (month >= 5){
            cout << "TBD" << endl;
            return 0;
        } else if (month == 4){
            if (day > 30){
                cout << "TBD" << endl;
                return 0;
            }
        }
    }

    cout << "Heisei" << endl;

    return 0;
}

Measured memory_bytes: 384
n = int(input())
aList = map(int, input().split())

useList = [0] * 3
result = 1

for i, a in enumerate(aList):
  result = (result * useList.count(a)) % 1000000007
  if useList[0] == a:
    useList[0] += 1
  elif useList[1] == a:
    useList[1] += 1
  else:
    useList[2] += 1

print(result)


Measured memory_bytes: 10644
import java.util.*;

class Main {
    public static void main(String[] args) throws java.lang.Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        PriorityQueue<Integer> pq = new PriorityQueue<>(Collections.reverseOrder());
        for (int i = 0; i < n; i++) {
            pq.add(sc.nextInt());
        }
        sc.close();

        for (int i = 0; i < m; i++) {
            pq.add(pq.poll() / 2);
        }

        long ret = 0;
        for (int i : pq) {
            ret += i;
        }
        System.out.println(ret);
    }
}


Measured memory_bytes: 60924
#include <iostream>
#include <stdio.h>

using namespace std; 

int gcd( int a, int b )
{
    int temp;

    if( a < b ) { temp = a; a = b; b = temp; }
    if( b < 1 ) return -1;

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


int main(){
  int a,b;
  while(1){
    cin >> a >> b;
    if(cin.eof())
      break;
    int g=gcd(a,b);
    //printf("%d %d\n",g,a/g*b);
    cout << g << ' ' << a/g*b << endl;
  }

  return 0;
}



Measured memory_bytes: 3076
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

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

		int x = Integer.parseInt(S);
		S = in.readLine();

		if(x <3200){
			System.out.println("red");
		}else{
			System.out.println(S);
		}


	}




}


Measured memory_bytes: 21076
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Atcoder
{
    class aaaa
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            string s3 = Console.ReadLine();
            Console.WriteLine(s1[0]+""+s2[1]+""+s3[2]);
        }
    }
}

Measured memory_bytes: 13140
#include<iostream>
#include<numeric>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<climits>
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define mkp make_pair
#define pll pair<ll,ll>
#define rep(i,from,to) for(int i=from;i<to;i++)
#define repd(i,from,till) for(int i=from;i>=till;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define mod 1000000007
#define inf1 1e18+1
#define pie 3.14159265358979323846
#define N 100005
using namespace std;
/*
ll bin(ll i,ll j){
	ll mid=(i+j)/2;
	if(a[mid]==x)reutrn mid;
	else if(ans>x)return bin(i,mid-1);
	else return bin(mid+1,j);
}*/

//To compute x^y under modulo m
ll power(ll x,ll y){
    if(y==0)return 1;
    ll p=power(x,y/2)%mod;
    p=(p*p)%mod;
    return(y%2==0)?p:(x*p)%mod;
}
/*
bool prime[n+1];
void SieveOfEratosthenes(int n){
	rep(i,0,n+1)prime[i]=true
    for (int p=2; p*p<=n; p++)
        if (prime[p] == true)
            for (int i=p*p;i<=n;i+=p)prime[i]=false;
}*/
/*
int gcd(int a,int b){
	if(b==0)return a;
	else return gcd(b,a%b);
}
*/
ll n,k;
ll a[100005];
ll fact[100005];
ll invfact[100005];

ll nCr(ll x,ll y){
	if(y>x)return 0;
	ll num=fact[x];
	num*=invfact[y];
	num%=mod;
	num*=invfact[x-y];
	num%=mod;
	return num;
}
void fac(){
	fact[0]=1;
	fact[1]=1;
	rep(i,2,100003){
		fact[i]=fact[i-1]*i;
		fact[i]=fact[i]%mod;
	}
}
void invfac(){
	invfact[100002]=power(fact[100002],mod-2);
	repd(i,100001,0){
		invfact[i]=invfact[i+1]*(i+1);
		invfact[i]=invfact[i]%mod;
	}
}
void precal(){
	fac();
	invfac();	
}
ll minsum(){
	ll ans=0;
	rep(i,1,n+k-1){		
		ans+=(a[i]*nCr(n-i,k-1))%mod;
		ans+=mod;
		ans%=mod;
		ans+=mod;
		ans%=mod;
	}
	return ans;
}
ll maxsum(){
	ll ans=0;
	rep(i,k,n+1){
		ans+=a[i]*nCr(i-1,k-1);
		ans%=mod;
		ans+=mod;
		ans%=mod;
	}
	return ans;
}
int solve(){
	precal();
    cin>>n>>k;
	rep(i,1,n+1)cin>>a[i];
    if(k==1){
		cout<<"0"<<endl;
    	return 0;
	}
    sort(a+1,a+n+1);
    ll s=minsum();
    ll a=maxsum();
 	cout<<((a-s)+mod)%mod<<endl;
	return 0;
}
int main(){
    //waste;
    int t;
    //cin>>t;
    t=1;
    while(t--){
       	solve();
    }
}


Measured memory_bytes: 2560
# include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int b[N] , res; 
int main(){
	int n;
	cin >> n;
	for(int i = 1; i < n; i ++) cin >> b[i];b[0] = 1e6,b[n] = 1e6;
	for(int i = 1; i <= n; i ++)
		res += min(b[i] , b[i - 1]);
	cout << res << "\n";
}

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

const int MAXN = 100000;

int N, u, v, ans=-1000000000;
vector<int> du(MAXN, 0), dv(MAXN, 0);
vector<vector<int>> E;

void disfunc1(int n) {
    queue<pair<int, int>> Q;
    vector<int> cl(N, 0); 
    Q.push(make_pair(n, 0));
    cl[n]=1;
    while(!Q.empty()) {
        pair<int, int> p = Q.front();
        Q.pop();
        du[p.first] = p.second;
        for(int i=0;i<E[p.first].size();i++) {
            if(cl[E[p.first][i]]==0) {                            
                Q.push(make_pair(E[p.first][i], p.second+1));
                cl[E[p.first][i]]=1;
            }
        }
    }
}

void disfunc2(int n) {
    queue<pair<int, int>> Q;
    vector<int> cl(N, 0); 
    Q.push(make_pair(n, 0));
    cl[n]=1;
    while(!Q.empty()) {
        pair<int, int> p = Q.front();
        Q.pop();
        dv[p.first] = p.second;
        for(int i=0;i<E[p.first].size();i++) {
            if(cl[E[p.first][i]]==0) {                            
                Q.push(make_pair(E[p.first][i], p.second+1));
                cl[E[p.first][i]]=1;
            }
        }
    }
}

signed main(){
    cin >> N >> u >> v;
    E.resize(N);
    for(int i=0;i<N-1;i++) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        E[a].push_back(b);
        E[b].push_back(a);
    }
    //cout << "OK1" << endl;
    disfunc1(u-1);
    disfunc2(v-1);
    //cout << "OK2" << endl;
    for(int i=0;i<N;i++) {
        if(du[i]<dv[i]) ans = max(ans, dv[i]);
    }
    cout << ans-1 << endl;
    return 0;
}

Measured memory_bytes: 8960
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		sc.close();
		Set<Integer> se = new HashSet<Integer>();
		se.add(s);
		for (int i = 2; i < 1000000; i++) {
			if (s % 2 == 0) {
				s = s / 2;
			} else {
				s = 3 * s + 1;
			}
			if (se.contains(s)) {
				System.out.println(i);
				return;
			}
			se.add(s);
		}
	}
}


Measured memory_bytes: 21716
import java.util.*;


public class Main {
    static void solve() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        HashMap<Integer, Integer> balls = new HashMap<>();
        for(int i = 0; i < n; i++){
            int bn = sc.nextInt();
            if(balls.containsKey(bn)){
                balls.put(bn, balls.get(bn)+1);
            }else{
                balls.put(bn, 1);
            }
        }

        LinkedList<Integer> ballsNum = new LinkedList<Integer>();

        int sum = 0;
        for(int i : balls.keySet()){
            ballsNum.add(balls.get(i));
            sum += balls.get(i);
        }
        Collections.sort(ballsNum);
        for(int i = ballsNum.size()-1; i >= ballsNum.size()-k; i--){
            if(i < 0) break;
            sum -= ballsNum.get(i);
        }


        System.out.println(sum);
    }

    public static void main(String[] args) {
        solve();
    }
}


Measured memory_bytes: 100188
#include <iostream>

using namespace std;

int main(void){
	int H,W;
	int i,ii;
	char** C,CC;

	cin>>H>>W;

	C=new char* [2*H];
	for(i=0;i<2*H;i++){
		C[i]=new char [W];
	}

	for(i=0;i<H;i++){
		for(ii=0;ii<W;ii++){
			cin>>C[2*i][ii];
			C[2*i+1][ii]=C[2*i][ii];
		}
	}

	for(i=0;i<2*H;i++){
		for(ii=0;ii<W;ii++){
			cout<<C[i][ii];
		}
		cout<<endl;
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int lmax=0;
        int rmin=n;
        for(int i=0;i<m;i++){
           int ninja = sc.nextInt();
           int unk0 = sc.nextInt();
           if(ninja>lmax){
               lmax=ninja;
           }
           if(unk0<rmin){
               rmin=unk0;
           }
        }
        int sum=rmin-lmax+1;
        if(sum<0){
            sum=0;
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 64064
import sys
n,Y = map(int,input().split())
for x in range(n+1):
    for y in range(n-x+1):
        z = n-(x+y)
        if z >= 0 and 10000*x+5000*y+1000*z == Y:
            print(x,y,z)
            sys.exit()
print(-1,-1,-1)

Measured memory_bytes: 9040
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define FFOR(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define rep(i,n) FOR(i,0,n-1)
#define int long long
#define MOD 998244353
#define MAXN  100005
#define P pair<int,int>
 
 
signed main(){
	
	int n;cin>>n;
	
	cout << (n<1000?"ABC":"ABD") << endl;
	 
	
}

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

void call(int n) {
    
    for (int i = 1; i <= n; ++i) {
        int x = i;
        if (x % 3 == 0) {
            cout << ' ' << x;
        } else {
            while (x) {
                if (x % 10 == 3) {
                    cout << ' ' << i;
                    break;
                }
                x /= 10;
            }
        }
    }
    cout << endl;
}

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

Measured memory_bytes: 3088
import sys
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]

A, B = ri_()
ans = 'IMPOSSIBLE'
if (A + B) % 2 == 0:
    ans = (A + B) // 2
print(ans)

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


int main(){
  int n;
  std::cin >> n;
  int t,a[n],x[10];
  for(int i = 0; i < n; i++){
    std::cin >> t;
    a[i] = t;
  }
  std::sort(a, a + n);
  for(int i = 0; i < n - 1; i++){
    if(a[i] == a[i + 1]){
      std::cout << "NO" << std::endl;
      return 0;
    }
  }
  std::cout << "YES" << std::endl;
  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define INF 999999999
using LL = long long;
using VI = vector<int>;
int main(){
  double t,x;
  cin >> t >> x;
  printf("%.10f\n",t/x);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;

int main() {
    int N, count = 0, a, b;
    cin >> N;
    vector<int> P(N), Q(N), A(N);
    for (int i = 0; i < N; i++) {
        cin >> P.at(i);
    }
    for (int i = 0; i < N; i++) {
        cin >> Q.at(i);
    }
    for (int i = 0; i < N; i++) {
        A.at(i) = i + 1;
    }
    do {
        if (A == Q) {
            a = count;
        }
        if (A == P) {
            b = count;
        }

        count++;
    }
    while(next_permutation(A.begin(), A.end()));

    cout << abs(a - b) << endl;
}



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

int main() {
  int64_t N, K;
  cin >> N >> K;
  
  vector<int> H(N);
  for(int i = 0; i < N; i++){
    cin >> H.at(i);
  }
  
  sort(H.begin(), H.end());
  
  int64_t sum = 0;
  for(int i = 0; i < N - K; i++){
    sum += H.at(i);
  }
  
  cout << sum << endl;
  
  
}


Measured memory_bytes: 1024
#include <iostream>//c++??§aoj Ring
#include <string>
using namespace std;
int main(void)
{
	string s, p;
	cin >> s >> p;
	int a=0, count;

	for (int i=0;i<=s.size();i++)
	{
		count=0;

		if (p[0] == s[i])
		{
			for (int j=0;j<=p.size()-1;j++)
			{
				if (s.size() > i+j)
				{
					if (s[i+j] != p[j])
					{
						count++;
					}
				}
				else if (s.size() <= i+j)
				{
					if (s[i+j-s.size()] != p[j])
					{	
						count++;
					}
				}

				else if (count != 0)
				{
					break;
				}
			}

			if (count == 0)
			{
				a=1;
			}
		}
	}
	if (a==1)
	{
		cout << "Yes" << endl;
	}
	else if (a!=1)
	{
		cout << "No" << endl;
	} 

	return 0;
}

Measured memory_bytes: 3152
import sys
from collections import deque
readline = sys.stdin.readline
n = int(readline())
li = list(map(int, readline().split()))
def square(P):
    G = []
    L = deque()
    for i, v in enumerate(P):
        if not L:
            L.append((i, v))
            continue
        if v > L[-1][1]:
            L.append((i, v))
        elif v < L[-1][1]:
            k = i - 1
            while L and v < L[-1][1]:
                a = L.pop()
                G.append((k - a[0] + 1) * a[1])
            L.append((a[0], v))
    while L:
        a = L.pop()
        G.append((len(P) - a[0]) * a[1])
    return max(G)
print(square(li))

Measured memory_bytes: 23000
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HBonsai
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABA solver = new ABA();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());
            if (B % A == 0) {
                out.println(B + A);
            } else {
                out.println(B - A);

            }
        }

    }
}



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

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

int main() {
    {
        _time time(disable);
        _i64 n, m; vector<vector<_i64>> A; vector<_i64> b, c;
        cin >> n >> m;
        A.resize(n, vector<_i64>(m)); b.resize(m); c.resize(n, 0);
        _rep(i, n) { _rep(j, m) { cin >> A[i][j]; } }
        _rep(i, m) { cin >> b[i]; }
        _rep(i, n) {
            _rep(j, m) { c[i] += A[i][j] * b[j]; }
            cout << c[i] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define mp make_pair
#define fi first
#define se second
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

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

    string s;
    cin >> s;

    cout << s.substr(0, s.size() - 8) << endl;

    return 0;
}

Measured memory_bytes: 256