akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include <chrono> 
using namespace std::chrono;
using namespace std;
typedef long long ll;
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_mset tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define fr(i,a,b) for (ll i=(a); i<(b);++i)
#define frr(i,a,b) for(int i=(a-1);i>=(b);--i)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define ppb pop_back()
#define pf push_front
#define ppf pop_front()
#define F first
#define S second
#define pii pair<int,int> 
#define rev(a) reverse(a.begin(),a.end())
#define srt(a) sort(a.begin(),a.end())
#define rsrt(a) sort(a.begin(),a.end(),greater<int>())
#define sz(a) (ll)a.size()
#define endl "\n"
#define po(a,b) (ll)(pow(a,b)+0.5)
#define double long double
#define print(a) for(auto x:a)cout<<x<<" ";cout<<endl;
const ll M=1e17+7;
const int MaxM=501;

  int a[10000005]={};vi pr;

void primes(int n)
{
 
 fr(i,2,n+1)
 {     
   if(a[i]==0)
   {
    a[i]=i;pr.pb(i);
   }
   for(int j=0;j<sz(pr) && pr[j]<=a[i] && i*pr[j]<=n;j++)
    a[pr[j]*i]=pr[j];

 }
   
}
unordered_map<int,int> m;
int cnt(int n)
{  
  m.clear();
    while(n!=1)
    { m[a[n]]++;
      n/=a[n];
    }
    ll ans=1;
    for(auto x:m)ans*=x.S+1;
    return ans;
}



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

    primes(1e7+5);

  int n;
  cin>>n;
  ll ans=0;
  fr(i,1,n+1)
  {
    ans+=i*cnt(i);
  }
  cout<<ans;

}



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

int main() {
 int a,b,c;
  cin>>a>>b>>c;
  ///////
  int ans=0;
  int mx=max(a,max(b,c));
  int mn=min(a,min(b,c));
  int md=a+b+c-mn-mx;
  /////////
  ans+=mx-md;
  mn+=ans;
  if(mn%2==mx%2){
    ans+=(mx-mn)/2;
  }
  else{
   ans+=(mx-mn+1)/2 +1;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3636
import sys

input = sys.stdin.readline

#N
#t1 x1 y1t1 x1 y1
#t2 x2 y2t2 x2 y2
#⋮⋮
#tN xN yNtN xN yN
N = 3
x = [0 for i in range(N)]
y = [0 for i in range(N)]
c =[[0 for i in range(N)] for i in range(N)]

for i in range(N):
    c1, c2, c3 = map(int, input().split())
    c[i][0] = c1
    c[i][1] = c2
    c[i][2] = c3


x[0] = 0
for i in range(N):
    y[i] = c[0][i] - x[0]
x[1] = c[1][0] - y[0]
x[2] = c[2][0] - y[0]

flag = True
for i in range(N):
   for j in range(N):
       numx = x[i]
       numy = y[j]
       if not numx + numy == c[i][j]:
           flag = False
if flag:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9184
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int k;
    cin >> k;
    priority_queue <ll> pq;
    for(int i = 1; i <= 9; i++){
        pq.push(-i);
    }
    vector <ll> v;
    while(v.size() < k){
        ll x = -pq.top();
        pq.pop();
        v.push_back(x);
        if(x%10 != 0){
            pq.push(-(10*x + x%10 - 1));
        }
        if(x%10 != 9){
            pq.push(-(10*x + x%10 + 1));
        }
        pq.push(-(10*x + x%10));
    }
    cout << v[k-1] << endl;
}


Measured memory_bytes: 3008
// 26
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fors(_, x, n, s) for (int _ = x; _ < n; _ += s)
#define forn(_, x, n) fors(_, x, n, 1)
#define rep(_, n) forn(_, 0, n)
#define forrs(_, x, n, s) for (int _ = x; _ > n; _ -= s)
#define forrn(_, x, n) forrs(_, x, n, 1)
#define rrep(_, n) forrn(_, n - 1, -1)
#define fi first
#define se second
#define pb push_back
#define pairii pair<int, int>
#define all(x) x.begin(), x.end()
#define lli __int128_t
#define li long long int
#define ld long double
#ifdef LOCAL
#define debug(e) cerr << "\033[48;5;196m\033[38;5;15m" << e << "\033[0m";
#else
#define debug(e)
#endif
// 4
template <class A, class B>
ostream &operator<<(ostream &os, pair<A, B> &p) {
  return os << "(" << p.fi << " " << p.se << ")";
}
// 8
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  rep(i, (int)v.size()) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
// 6
template <class A, class B>
ostream &operator<<(ostream &os, map<A, B> &m) {
  for (auto &kv : m) os << "{" << kv.fi << " " << kv.se << "}";
  return os;
}
// 3
void _main(int tc) {
  int n;
  cin >> n;
  vector<ld> p(n);
  rep(i, n) cin >> p[i];
  vector<vector<ld>> mem(n, vector<ld>(n + 1, -1));
  function<ld(int, int)> f = [&](int i, int c) -> ld {
    if (n - i + c <= i - c) return 0;
    if (i == n)
      if (c > n - c)
        return 1;
      else
        return 0;
    if (mem[i][c] != -1) return mem[i][c];
    return mem[i][c] = p[i] * f(i + 1, c) + (1 -  p[i]) * f(i + 1, c - 1);
  };
  cout << setprecision(10) << f(0, n) << endl;
}
// 7
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  _main(0), exit(0);
  int tc;
  cin >> tc;
  rep(i, tc) _main(i + 1);
}

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

using namespace std;

int N, t, x, y, lx, ly, lt;

int main() {
	scanf("%d", &N);
	while(N--) {
		scanf("%d%d%d", &t, &x, &y);
		int a = abs(x - lx) + abs(y - ly);
		int b = t - lt;
		if((a & 1) != (b & 1) || a > b) {
			printf("No\n");
			return 0;
		}
		lx = x; ly = y; lt = t;
	}
	printf("Yes\n");
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
char con[205][205];
vector<int>adj[205];
bool vis[205], col[205];
int dist[205][205];
void dfs(int x){
	//cout<<x<<endl;
	vis[x]=true;
	for(int y:adj[x]){
		if(vis[y]) continue;
		col[y]=1^col[x];
		dfs(y);
	}
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			cin>>con[i][j];
			if(con[i][j]=='1'){
				adj[i].push_back(j);
				dist[i][j]=1;
			}
			else if(i==j) dist[i][j]=0;
			else dist[i][j]=1000;
		}
	}
	col[1]=0;
	dfs(1);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(con[i][j]=='1' && col[i]==col[j]){
				cout<<-1;
				return 0;
			}
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++){
				dist[j][k]=min(dist[j][k], dist[j][i]+dist[k][i]);
			}
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			ans=max(ans, dist[i][j]);
		}
	}
	cout<<ans+1;
}

Measured memory_bytes: 640
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(1, n - 1):
    if p[i - 1] < p[i] < p[i + 1] or \
       p[i + 1] < p[i] < p[i - 1]:
        cnt += 1
print(cnt)


Measured memory_bytes: 2940
#include <stdio.h>
#include <inttypes.h>

char S[128];
int K;

int nyan = 0;
int kugyu[128];
char mimorin[128];

int main(void) {
	int i, horieyui;
	int64_t mareitaso = 0;
	if (scanf("%127s", S) != 1) return 1;
	if (scanf("%d", &K) != 1) return 1;
	horieyui = 1;
	for (i = 1; S[i - 1] != '\0'; i++) {
		if (S[i - 1] != S[i]) {
			kugyu[nyan] = horieyui;
			mimorin[nyan] = S[i - 1];
			nyan++;
			horieyui = 1;
		} else {
			horieyui++;
		}
	}
	if (nyan < 1) {
		puts("ERROR!");
		return 2;
	} else if (nyan == 1) {
		int64_t yukati = (int64_t)kugyu[0] * K;
		mareitaso += yukati / 2;
	} else if (mimorin[0] == mimorin[nyan - 1]) {
		for (i = 1; i < nyan - 1; i++) {
			mareitaso += kugyu[i] / 2;
		}
		mareitaso *= K;
		mareitaso += ((int64_t)(kugyu[0] + kugyu[nyan - 1]) / 2) * (K - 1);
		mareitaso += kugyu[0] / 2;
		mareitaso += kugyu[nyan - 1] / 2;
	} else {
		for (i = 0; i < nyan; i++) {
			mareitaso += kugyu[i] / 2;
		}
		mareitaso *= K;
	}
	printf("%" PRId64 "\n", mareitaso);
	return 0;
}


Measured memory_bytes: 1684
#include<iostream>
using namespace std;
int main()
{
	int th,ts,ah,as;
	cin>>th>>ts>>ah>>as;
	while(th||ah==0)
	{
		ah-=ts;
		if(ah<=0)
		{
			cout<<"Yes";
			return 0;
		}
		th-=as;
		if(th<=0)
		{
			cout<<"No";
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 3620
/* ex4_2
   takafumi_ueki */
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979

int main(void){
    int hour_length,min_length,hour,min;
    double rad,distance;
    scanf("%d %d %d %d",&hour_length,&min_length,&hour,&min);
    //時針と分針の成す角を計算する
    rad = (PI*min/30)-(PI*(hour*60+min)/360);
    //余弦の定理を用いて端点の間の距離を計算する。
    distance = sqrt((double)(pow(hour_length,2) + pow(min_length,2) - 2*hour_length*min_length*cos(rad)));
    //誤差の影響を考えて有効数字を設定する
    printf("%.9f\n",distance);
    return 0;
}


Measured memory_bytes: 2536
#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
#include<functional>
#include<numeric>
#include<iomanip>
using namespace std;

typedef long long LL;

class Combination
{
public:
	Combination(int sz) : size(sz+1), table(size, vector<LL>(size, 0)){init();};
	LL nCk(int n, int k) const{return table[n][k];};

private:
	void init(void)
	{
		for(int i=0; i<size; i++)
			for(int j=0; j<=i; j++)
				if(j==0 || j==i)
					table[i][j] = 1;
				else
					table[i][j] = table[i-1][j-1] + table[i-1][j];
	}

	const int size;
	vector<vector<LL>> table;
};

int main(void)
{
	int N, A, B;
	cin >> N >> A >> B;

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

	sort(v.begin(), v.end(), greater<long long>());

	long long sum = 0;
	for(int i=0; i<A; i++)
		sum += v[i];
	double ret_ave = 1.0 * sum / A;
	cout << fixed << setprecision(20) << ret_ave << endl;

	long long ret_cnt = 0;
	Combination comb(N);
	if(v[0] == v[A-1])
	{
		int all = count(v.begin(), v.end(), v[A-1]);
		int cnt = count(v.begin(), v.begin()+A, v[A-1]);
		int right = min(B, all);
		for(int i=cnt; i<=right; i++)
			ret_cnt += comb.nCk(all, i);
	}
	else
	{
		int all = count(v.begin(), v.end(), v[A-1]);
		int cnt = count(v.begin(), v.begin() + A, v[A-1]);

		ret_cnt = comb.nCk(all, cnt);
	}

	cout << ret_cnt << endl;

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b)
{ return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b)
{ return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)

int main(void)
{
	int r;
	scanf("%d", &r);

	printf("%d\n", 3 * r * r);
	return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstring>

int main(){
  char str[1001];

  while(1){
    scanf( "%s", str );
    if ( str[0] == '0' ) break;
    int sum = 0;
    for ( int i = 0; i < strlen(str); i++ ){
      sum += ( str[i] - '0') ;
    }

    printf("%d\n", sum);
  }

  return 0;
}

Measured memory_bytes: 2708
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] s = br.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        long d = Long.parseLong(s[1]);
        d *= d;
        int count = 0;
        for(int i=0; i<n; i++) {
            s = br.readLine().split(" ");
            long x = Long.parseLong(s[0]);
            long y = Long.parseLong(s[1]);
            if(x*x + y*y <= d)
                count++;
        }
        System.out.print(count);
    }
}

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

int main() {
  int n, nn, l;
  int ans;
  while (cin >> n) {
    if (n<=1000 || n>=3000) {
      nn = (n<=1000) ? n : 4000-n;
      ans = (nn+3)*(nn+2)*(nn+1)/6;
    } else {
      ans = 0;
      nn = (n>2000) ? 4000-n : n;
      l = nn-1000;
      ans = 167167*(3*nn-1997);
      ans += l*(l+1)*(999-l)>>1;
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if ((a == 7) && (b == 5 && c == 5) || (b == 7) && (c ==  5 && a == 5) || (c == 7) && (a == 5 &&  b == 5)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}

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

using namespace std;

long long memo[101][100001];

long long phi(const int &n, const int &c, const int items[][2]){
    long long ans;
    if(n == 0 || c == 0) ans = 0;
    else if(memo[n][c] != -1) ans = memo[n][c];
    else if(c - items[n - 1][0] < 0) ans = phi(n - 1, c, items);
    else{
        ans = max(items[n - 1][1] + phi(n - 1, c - items[n - 1][0], items), phi(n - 1, c, items));
    }
    return memo[n][c] = ans;
}

int main(){
    int N, C;
    while(scanf("%d %d", &N, &C) != EOF){
        int items[N][2];
        for(int n = 0; n <= N; n++){
            for(int c = 0; c <= C; c++){
                memo[n][c] = -1;
            }
        }
        for(int i = 0; i < N; i++){
            scanf("%d %d", &items[i][0], &items[i][1]);
        }
        printf("%lli\n", phi(N, C, items));
    }
    return 0;
}

Measured memory_bytes: 82688
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;
 
#define  GODSPEED       ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define  f              first                 
#define  s              second
#define  newl           cout<<"\n";
#define  pb             push_back  
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" ";newl;
#define  deb1(a)        cout<<a<<"\n";
#define  deb2(a,b)      cout<<a<<" "<<b<<"\n";
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<"\n";
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n";
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());
#define  all(a)         a.begin(),a.end()           
 
typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   N     =  2e3+5;
const ll   mod   =  1e9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   LEVEL =  log2(N)+1;

ll n, dp[N][N], ans = 0;

void solve(){
	cin >> n;
	for(int i = 3; i <= n; i++) dp[i][1] = 1;
	int f = 0;
	if(n >= 3) ans = 1;
	for(int i = 6; i <= n; i += 3) {
		ll sum = 0;
		f = 1-f;
		for(int j = i, k = i-3; j <= n; j++, k++){
			sum += dp[k][i/3-1];
			sum %= mod;
			dp[j][i/3] = sum;
			if(j == n) ans = (ans + sum)%mod;
		}
	}
	deb1(ans)
}

int main(){
	GODSPEED;
	int test = 1;
	//cin>>test;
	for(int i = 1; i <= test; i++){
		solve();
	}
	#ifndef ONLINE_JUDGE
	cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	#endif
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const int INF=1e9;
const int MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) for (auto i = mp.begin(); i != mp.end(); ++i) { cout << i->first <<":"<<i->second << endl;}
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<" ";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll x;
    cin>>x;
    ll ans=0;
    ll goods = x/100;
    ll gmin = 0;
    if (x%100 !=0 && (x%100)%5 == 0){
        gmin = (x%100)/5;
    } else if (x%100 !=0 && (x%100)%5 != 0){
        gmin = (x%100)/5+1;
    }
    if (gmin <= goods) {
        ans = 1;
    } else {
        ans = 0;
    }
    cout<<ans<<endl;
    return  0;
}


Measured memory_bytes: 256
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

import fractions
from functools import reduce
from collections import Counter

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A,B = II()

x = gcd_list([A,B])
c = Counter(prime_factorize(x))
print(len(c.keys())+1)

Measured memory_bytes: 64204
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long a, n, ret = 0, lb = 1e14, ub = -1e14;
  cin>>n;
  while(n--)
  {
    cin>>a; ret += a;
    lb = min(lb, a);
    ub = max(ub, a);
  }
  cout << lb << " " << ub << " " << ret << "\n";
}


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

//最大公約数
int gcd(int a, int b)
{
    int r;
    while((r = a % b) != 0) 
    {
        a = b;
        b = r;
    }
    return b;
}


//最小公倍数
int lcm(int a, int b)
{
    return ((a / gcd(a,b))*b);
}



int main(){

int a,b;

while(cin >> a >> b){
    if(a == -1 or b == -1)  break;
   while(a <= 0 or a>2000000000 or b <= 0 or b > 2000000000){
       cin >> a >> b;
   }
   if(a > 0 and b > 0){
        cout << gcd(a,b) << " "<< lcm(a,b)<< "\n";
    }
}

return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <cassert>
#include <limits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <array>
#include <map>
#include <set>
#include <deque>
#include <list>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cstring>
#include <bitset>
#include <stack>
#include <queue>

#define MOD (1e9 + 7);
#define PI (3.14159265358979323846)

using ll = int64_t;
using ull = uint64_t;

using namespace std;

[[maybe_unused]] static auto __x = [](){ios_base::sync_with_stdio(0); cin.tie(0);};

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

    cout << n * (n - 1) / 2 + m * (m - 1) / 2;

    return 0;
}


Measured memory_bytes: 256
//WAPER
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#define inf 1e9
#define eps 1e-6
#define N 200010
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline ll read()
{
	char ch=getchar();
	ll s=0,w=1;
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
	return s*w;
}
char s[N];
int n;
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%s",s+1);
	n=strlen(s+1);int ans=0;
	for(register int i=1;i<=n/2;i++)if(s[i]!=s[n-i+1])ans++;
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MAXN = 1e5 + 7;

int main()
{
    ios::sync_with_stdio(0);
    int n, x = 10, ans = 0;
    cin>>n;
    for(int i = 1; i <= n; i++)
    {
        if(i >= x)
        {
            x *= 10;
            i = x;
            x *= 10;
        }
        if(i <= n) ans++;
    }
    cout<<ans<<endl;

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<cstdio>
//#include<string>
//#include<sstream>
using namespace std;
int main()
{
	int n,a,b;
	scanf("%d",&n);
	if(n==1){
		printf("Hello World\n");
	} 
	else if(n==2){
		scanf("%d%d",&a,&b);
		printf("%d\n",a+b);
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N,K;
  cin>>N>>K;
  vector<int> A(N);
  for(int &i:A)cin>>i;
  int ans=100000000000;
  for(int i=0;i<(1<<N);i++){
    if(__builtin_popcount(i)<K)continue;
    int cnt=0,mx=0;
    for(int j=0;j<N;j++){
      if(i>>j&1){
        if(mx>=A[j])mx++,cnt+=mx-A[j];
      }
      mx=max(mx,A[j]);
    }
    ans=min(ans,cnt);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30

using namespace std;
typedef long long ll;
typedef pair<int, int> pp;

int main(void) {
	int num, i, all = 0;
	cin >> num;
	vector<int> d(num);
	rep(i, num) {
		cin >> d[i];
		all ^= d[i];
	}
	rep(i, num)
		cout << (all ^ d[i]) << "\n";
	return 0;
}

Measured memory_bytes: 3980
T=[['A','B','C','D','E','F'],[10,11,12,13,14,15]]
X,Y=map(str,input().split())
x=T[0].index(X)
y=T[0].index(Y)
if x==y:
    print('=')
else:
    print('<>'[T[1][x]>T[1][y]])

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

int main() {
	long long int l, r;
	cin >> l >> r;

	constexpr long long int mod = 2019;

	if (r - l >= mod) {
		cout << 0 << endl;
	}
	else {
		long long int ans = ((l % mod) * ((l + 1) % mod)) % mod;
		for (int i = l; i < r; i++) {
			for (int j = i + 1; j <= r; j++) {
				long long int t = ((i % mod) * (j % mod)) % mod;
				if (t < ans) ans = t;
			}
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int sum = C-(A-B);
        if(sum < 0){
            sum = 0;
        }
        System.out.println(sum);
    }
}

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

int main(){
  string s; cin >> s;
  int n = s.size();
  bool a = true;
  for(int i = 0; i < n; i++){
    if(s.at(i) == s.at(n-1-i)){
      continue;
    }
    else{
      a = false;
      break;
    }
  }
  for(int i = 0; i < (n-1)/2; i++){
    if(s.at(i) == s.at((n-1)/2-1-i)){
      continue;
    }
    else{
      a = false;
      break;
    }
  }
  for(int i = 0; i <(n-1)/2 ; i++){
    if(s.at((n+3)/2-1 + i) == s.at(n-1-i)){
      continue;
    }
    else{
     a = false;
      break;
    }
  }
  if (a == false)
    cout << "No";
  else
    cout << "Yes";
}

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

int main() {
  long N;
  long MAX = 1000000;
  cin >> N;
  int count = 0;
  long i;
  for (i = 2; i <= MAX; i++) {
    long p = i;
    for (int k = 1; k <= 39; k++) {
      if (N % p == 0) {
        N /= p;
        count++;
        p *= i;
      } else {
        break;
      }
    }
    while (N % i == 0) {
      N /= i;
    }
    if (N == 1) {
      break;
    }
  }
  if (i == MAX+1) {
    count++;
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 3644
import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        if(a == 2){
            System.out.println(a);
            return;
        }
        ArrayList<Integer> list = getPrime(a);
        while(true){
            if(check(a,list)){
                System.out.println(a);
                return;
            }
            a++;
        }
    }
    
    static ArrayList<Integer> getPrime(int x){
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(2);
        int max = (int)Math.pow(x*2,0.5);
        for(int i = 3; i < max; i+=2){
            boolean chk = true;
            for(int j : list){
               if(i % j == 0){
                   chk = false;
                   break;
               }
            }
            if(chk){
                list.add(i);
            }
        }
        return list;
    }
    
    static boolean check(int x, List<Integer> list) {
        for(int j : list){
           if(x % j == 0){
               return false;
           }
        }
        return true;
    }
}



Measured memory_bytes: 23124
n, q = gets.split.map(&:to_i)
process = []
n.times do
  p, t = gets.split
  t = t.to_i
  process << [p, t]
end

total = 0
while process.any?
  p, t = process.shift
  if t <= q
    total += t
    puts "#{p} #{total}"
  else
    t -= q
    total += q
    process << [p, t]
  end
end

Measured memory_bytes: 19376
#include<stdio.h>
int main(){
	int h[10];
	int i,j,v;
	for(i=0;i<10;i++){
		scanf("%d",&h[i]);
	}
	
	for(i=1;i<10;i++){
		v=h[i];
		j=i-1;
		while(j>=0&&h[j]>v){
			h[j+1]=h[j];
			j--;
		}
		h[j+1]=v;
	}
	
	for(i=0;i<3;i++){
		printf("%d\n",h[9-i]);
	}
	
	return 0;
}

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

#define clock_starts() clock_t begin = clock()
#define clock_ends() clock_t end = clock()
#define print_running_time() double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; \
printf("Elapsed Time : %.10f second(s)\n", elapsed_secs)
#define readfile(s) freopen(s, "r", stdin)
#define writefile(s) freopen(s, "w", stdout)
#define debug(s) cout<< #s <<" = "<< s <<endl
#define all(v) v.begin(), v.end()
#define cin_cout_is_cool ios_base::sync_with_stdio(false); cin.tie(NULL)
#define printBinary(n) cout << #n << " = " << bitset<64>(n) << endl
#define min_pq priority_queue<int, vector<int>, greater<int> >
#define MEMSET(a,val) memset(a, val, sizeof a)
#define PB push_back
#define endl '\n'
#define cin(n) scanf("%d", &n)

template<typename T>T max(T a_,T b_,T c_) { return max(a_,max(b_,c_)); }
template<typename T>T min(T a_,T b_,T c_) { return min(a_,min(b_,c_)); }

typedef pair<int, int> ii;
typedef pair<long, long> pll;
typedef pair<double, double> pdd;

#define ceil(num,d) 		( (int)(num/d) + (num%d>0 ? 1 : 0) )
#define block_no(idx) 		( ceil(idx, BLOCK_SIZE) )
#define block_starting(idx) ( ((block_no(idx)-1) * BLOCK_SIZE) +1 )
#define block_ending(idx) 	( min(n, block_no(idx)*BLOCK_SIZE) )
#define block_ranking(idx) 	((idx%BLOCK_SIZE==0)?BLOCK_SIZE:idx%BLOCK_SIZE)



int32_t main () {
	//readfile("input.in");
	//writefile("output.out");
	int n; cin>>n;
	cout<<int(24+(24-n))<<endl;	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#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 ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    vector<string> s(n);
    REP(i,n)cin >> s[i];
    map<string,int>mp;
    REP(i,n)mp[s[i]]++;
    cout << mp.size() << endl;
    return 0;
}

Measured memory_bytes: 25012
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while(sc.hasNext()){
			String str = sc.nextLine();
			if(str.length() > 1000) break;
			String[] words = str.split(" ");

			String longw = "";
			String mostd = "";

			int count = 0;
			int disp = 0;
			int[] dispCount = new int[words.length] ;

			for (int i = 0; i < words.length; i++) {
				if(words[i].length() > 32) break;
				if(words[i].length() > count){
					count = words[i].length();
					longw = words[i];
				}
				for (int j = 0; j < words.length; j++) {
					if(i != j){
						if(words[i].equals(words[j]) && words[i].length() > disp){
							dispCount[j]++;
						}
					}
				}
			}
			for (int i = 0; i < dispCount.length; i++) {
				if(dispCount[i] > disp){
					disp = dispCount[i];
					mostd = words[i];
				}
			}
			System.out.println(mostd + " " + longw);

		}
	}
}

Measured memory_bytes: 25720
#include<iostream>
#include<vector>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

struct UnionFind
{
    vector<int> d;
    UnionFind(int n = 0): d(n, -1){}
    int find(int x){
        if(d[x] < 0) return x;
        return d[x] = find(d[x]);
    }

    bool unite(int x, int y){
        x = find(x); y = find(y);
        if(x == y) return false;
        if(d[x] > d[y]) swap(x, y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x, int y){return find(x) == find(y);}
    int size(int x){return -d[find(x)];}
};

int deg[1000005];
vector<int> to[1000005];

int main(){
    int n, m, k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    rep(i, m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        deg[a]++;
        deg[b]++;
        uf.unite(a, b);    
    }
    rep(i, k){
        int a, b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    rep(i, n){
        int ans = uf.size(i)-1-deg[i];
        for(int u : to[i]){
            if(uf.same(i, u)) ans--;
        }
        printf("%d%c", ans, i==n-1?'\n':' ');
    }
    return 0;
}


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

int main() {
    int n, m, sum = 0;
    cin >> n >> m;
    vector<int> a(n);
    for (auto &i : a) cin >> i, sum += i;
    sort(a.rbegin(), a.rend());
    for (int i = 0; i < m; i++) {
        if (a[i] * 4 * m < sum) {
          cout << "No" << endl;
          return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3620
//Train Ticket
#include <bits/stdc++.h>
using namespace std;
int a, b, c, d;
bool solve(int i)
{
    int w = a, x = b, y = c, z = d;
    if (!(i & 1))
        x *= -1;
    if (!(i & 2))
        y *= -1;
    if (!(i & 4))
        z *= -1;
    return (w + x + y + z == 7);
}
int main()
{
    int q, m, k, h, ans = 0, sum = 0, p;
    string s;
    cin >> s;
    a = s[0] - '0';
    b = s[1] - '0';
    c = s[2] - '0';
    d = s[3] - '0';
    for (int i = 0; i < 8; ++i)
        if (solve(i))
        {
            cout << a << (i & 1 ? "+" : "-") << b << (i & 2 ? "+" : "-") << c << (i & 4 ? "+" : "-") << d << "=7" << endl;
            break;
        }
    return 0;
}

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

int main() {
  char c;
  cin >> c;
  if (c == 'a'|| c == 'i' ||c == 'u' || c == 'e' || c == 'o'){
  cout << "vowel" << endl;
  }
  else {
  cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

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


int main(){
    int n; cin >> n;
    vector<Pi_i> xy(n);
    REP(i, n){
        int x, y; cin >> xy[i].first >> xy[i].second;
    }
    SORT(xy);
    REP(i, n){
        cout << xy[i].first << " " << xy[i].second << "\n";
    }
    return 0;
}



Measured memory_bytes: 3572
#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i=(ll)(r);i<(ll)(n);++i)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define pb(n) push_back(n)
#define endl '\n'
#define debug(x) cout << #x << " = " << (x) << endl
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c
#define VIN(V) for(int ii = 0; ii < (V).size(); ii++) {cin >> (V).at(ii);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(ii,(V).size()){cout << (V)[ii] << " ";} cout<<endl;
#define VOUT2(V) REP(jj,(V).size()){VOUT(V[jj])}
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<vi > vvi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = numeric_limits<ll>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
ll n, m, k, ans, sum, cnt = 0; string s; char c;

int main(){
  cin.tie(0);ios::sync_with_stdio(false);
  IN(n);
  vi a(n);
  VIN(a);

  ll max = *max_element(ALL(a));
  ll mcount = 0;
  ll second = 0;
  FOR(i,0,n) {
    if (a[i] == max) mcount ++;
    else {
      chmax(second, a[i]);
    }
  }

  FOR(i,0,n) {
    if (mcount == 1 && a[i] == max) OUT(second);
    else OUT(max);
  }
}


Measured memory_bytes: 3200
#include <iostream>
#include <string>
#include <map>
#include <queue>
using namespace std;

#define ansstr "111111111222444666555333333333"

class Cube{
public:
    string str;
};

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        char ch[30];
        for(int j=0;j<30;j++){
            cin >> ch[j];
        }

        Cube cube;
        string str(ch);
        cube.str = str;
        
        queue<Cube> que;
        que.push(cube);

        map<string, int> puz;
        puz[cube.str] = 0;

        while(!que.empty()){
            cube = que.front();
            que.pop();

            if(cube.str == ansstr){
                cout << puz[ansstr] << endl;
                break;
            }

            Cube cube2 = cube;  //right front
            for(int j=0;j<3;j++)
                swap(cube2.str[2+j*3], cube2.str[21+j*3]);
            swap(cube2.str[11], cube2.str[18]);
            swap(cube2.str[12], cube2.str[14]);
            if(puz.find(cube2.str) == puz.end()){
                que.push(cube2);
                puz[cube2.str] = puz[cube.str]+1;
            }

            cube2 = cube;       //left front
            for(int j=0;j<3;j++)
                swap(cube2.str[6+j], cube2.str[21+j]);
            swap(cube2.str[12], cube2.str[17]);
            swap(cube2.str[ 9], cube2.str[11]);
            if(puz.find(cube2.str) == puz.end()){
                que.push(cube2);
                puz[cube2.str] = puz[cube.str]+1;
            }

            cube2 = cube;       //right back
            for(int j=0;j<3;j++)
                swap(cube2.str[0+j], cube2.str[27+j]);
            swap(cube2.str[14], cube2.str[15]);
            swap(cube2.str[18], cube2.str[20]);
            if(puz.find(cube2.str) == puz.end()){
                que.push(cube2);
                puz[cube2.str] = puz[cube.str]+1;

            }

            cube2 = cube;       //left back
            for(int j=0;j<3;j++)
                swap(cube2.str[0+j*3], cube2.str[23+j*3]);
            swap(cube2.str[ 9], cube2.str[20]);
            swap(cube2.str[15], cube2.str[17]);
            if(puz.find(cube2.str) == puz.end()){
                que.push(cube2);
                puz[cube2.str] = puz[cube.str]+1;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 3248
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	int n; cin >> n;
	int res = 1;
	vector<pair<ll, ll>> v(n);
	rep(i, n)
	{
		ll x, l; cin >> x >> l;
		v[i] = { x + l, x - l };
	}
	sort(all(v));
	ll r = v[0].first;
	for (int i = 1; i < n; ++i)
	{
		while (i < n && v[i].second < r)
		{
			++i;
		}
		if (i < n)
		{
			++res;
			r = v[i].first;
		}
	}
	cout << res << endl;
}


Measured memory_bytes: 1792
#include <iostream>

using namespace std;

int main() {
    int H[10000], W[10000];
    int n = 0;

    while(true) {
        cin >> H[n] >> W[n];
        if(H[n] == 0 && W[n] == 0) break;
        n++;
    }

    for(int i  = 0; i < n; i++) {
        for(int j = 0; j < H[i]; j++) {
            for(int l = 0; l < W[i]; l++) {
                if(j == 0 || j == H[i] - 1 || l == 0 || l == W[i] - 1) {
                    cout << '#';
                } else {
                    cout << '.';
                }
            }
            cout << endl;
        }
        cout << endl;
    }
    

    return 0;
}


Measured memory_bytes: 3128
#include<bits/stdc++.h>
#define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long int

using namespace std;

void solve()
{
   int n;
   cin>>n;
   vector<int> dp(n),v(n);

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

   for(int i=1;i<n;i++)
   {
    dp[i] = INT_MAX;
    dp[i] = min(dp[i],dp[i-1]+abs(v[i]-v[i-1]));
    if(i-2>=0)
    dp[i] = min(dp[i],dp[i-2]+abs(v[i]-v[i-2]));

   }

   cout<<dp[n-1]<<endl;



}
signed main()

{
    FAST_IO;
    int t = 1;

    // cin>>t;

    while(t--)
    {
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <math.h>

typedef struct{
  double x;
  double y;
}P;

void kock(int, P, P);

int main(){

  int n;
  P p1 = {0.0, 0.0}, p2 = {100.0, 0.0};

  scanf("%d", &n);

  printf("%f %f\n", p1.x, p1.y);

  kock(n, p1, p2);

  printf("%f %f\n", p2.x, p2.y);

  return 0;
}

void kock(int n, P p1, P p2){

  P s, t, u;

  if(n == 0) return ;

  s.x = (p1.x * 2 + p2.x) / 3;
  s.y = (p1.y * 2 + p2.y) / 3;
  t.x = (p1.x + p2.x * 2) / 3;
  t.y = (p1.y + p2.y * 2) / 3;
  u.x = (t.x - s.x) * cos(M_PI / 3) - (t.y - s.y) * sin(M_PI / 3) + s.x;
  u.y = (t.x - s.x) * sin(M_PI / 3) + (t.y - s.y) * cos(M_PI / 3) + s.y;

  kock(n-1, p1, s);
  printf("%f %f\n", s.x, s.y);
  kock(n-1, s, u);
  printf("%f %f\n", u.x, u.y);
  kock(n-1, u, t);
  printf("%f %f\n", t.x, t.y);
  kock(n-1, t, p2);

}

Measured memory_bytes: 640
def getinputdata():

    array_result = []    
    data = input()
    array_result.append(data.split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

print("ABC" if n<1000 else "ABD")

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

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

switch (N%10){
  case 2:
  case 4:
  case 5:
  case 7:
  case 9:
    
    cout << "hon";
    break;
    
  case 0:
  case 1:
  case 6:
  case 8:
    
    cout << "pon";
    break;

  case 3:
    
    cout << "bon";
    break;
}
}

Measured memory_bytes: 3648
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;


class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    

    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        int L = cin.nextInt();
        int[] a = new int[N];
        for (int i = 0; i < N; i++)
        {
            a[i] = cin.nextInt();
        }

        for (int i = 0; i < N - 1; i++)
        {
            if(a[i] + a[i+1] >= L)
            {
                Console.WriteLine("Possible");
                for (int j = 0; j < i; j++)
                {
                    Console.WriteLine(j + 1);
                }
                for (int j = N - 1; j > i; j--)
                {
                    Console.WriteLine(j);
                }
                return;
            }
        }
        Console.WriteLine("Impossible");
    }


}

class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 30556
#include <iostream>
#include <cstdio>
using namespace std;
 
int main() 
{
  int a,b;
  char op;
  op = '0';
  while(true){
    cin >> a >> op >> b;
    if(op == '+'){
      cout << a+b << endl;
      continue;
    }else if(op == '-'){
      cout << a-b << endl;
      continue;
    }else if(op == '*'){
      cout << a*b << endl;
      continue;
    }else if(op == '/'){
      cout << a/b << endl;
      continue;
    }else if(op == '?'){
      return 0;
    }
  }
}


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

int main() {
  int h, w, k, num = 0;
  cin >> h >> w >> k;
  vector<string> s(h);
  rep(i, h) cin >> s[i];

  vector<vector<int>> a(h, vector<int>(w));

  vector<int> cnt(h);
  rep(i, h) rep(j, w) if (s[i][j] == '#') cnt[i]++;

  // rep(i, h) cerr << s[i] << endl;

  auto solve = [&](int cl, int cr) {
    vector<int> P;
    for (int i = cl; i < cr; i++) rep(j, w) if (s[i][j] == '#') P.push_back(j);
    sort(P.begin(), P.end());

    rep(i, P.size()) {
      int v1 = 0, v2 = w;
      if (i >= 1) v1 = P[i - 1] + 1;
      if (i < P.size() - 1) v2 = P[i] + 1;
      num++;
      for (int j = cl; j < cr; j++)
        for (int k = v1; k < v2; k++) a[j][k] = num;
    }

    // rep(i, h) rep(j, w)
    //     fprintf(stderr, "%d%c", a[i][j], (j == w - 1 ? '\n' : ' '));
  };

  vector<int> vec;
  rep(i, h) if (cnt[i] >= 1) vec.push_back(i);

  rep(i, vec.size()) {
    int v1 = 0, v2 = h;
    if (i >= 1) v1 = vec[i - 1] + 1;
    if (i < vec.size() - 1) v2 = vec[i] + 1;
    // cerr << v1 << " " << v2 << endl;
    solve(v1, v2);
    // return 0;
  }

  rep(i, h) rep(j, w) printf("%d%c", a[i][j], (j == w - 1 ? '\n' : ' '));

  return 0;
}


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

int main()
{


    int64_t k,a,b;
    cin>>k>>a>>b;


    if(a+2>b||k<(a-1)+2)
        cout<<k+1<<endl;
    else{
        int64_t wk1=b+(k-(a-1)-2)/2*(b-a)+(k-(a-1)-2)%2;
        cout<<wk1<<endl;
    }


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }

const int mod=1000000007;
const int INF=1001001001;
int main() {
  int N;
  cin>>N;
  int m=-1;
  int ans=0;
  for(int i=1;i<=N;i++){
    int x=i;int cnt=0;
    while(x%2==0){
      cnt++;
      x/=2;
    }
    if(cnt>m){m=cnt;ans=i;}
  }
  cout<<ans<<endl;
  return 0;
}


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

int main()
{
	  ll n;
  cin >> n;
  ll ans = 0;
  for (ll i = 1; i <= n; ++i)
    for (ll j = 1; i * j < n; ++j)
      ++ans;
  cout << ans << endl;
	return 0;		
			
}
		



Measured memory_bytes: 3636
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
	long long int n; cin >> n;
  	if (n % 2 != 0) {
    	cout << 0 << endl;
    } else {
      	long long int ans = 0;
    	for (long long int i = 10; i <= n; i *= 5) {
        	ans += n / i;
        }
      	cout << ans << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){

    int a, b, out = 0;
    cin >> a;
    cin >> b;
    if(a < b){
        swap(a, b);
    }
    out += a;
    a -= 1;
    if (a < b)
    {
        swap(a, b);
    }
    out += a;
    cout << out << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define Map unordered_map<string,ll>
#define MB	unordered_map<string,bool>
#define ft first 
#define sd second

using namespace std;

int main(){
	int n;
	cin>>n;
	MB c;
	Map lis;
	Map rec;
	while(n--){
		string s;
		cin>>s;
		int l = 10;
		sort(s.begin(),s.end());
		if(c[s]!=true)c[s]=true;
		else{
			lis[s]++;
			rec[s]+=lis[s];
		}

		
	}
	//ll no = rec.size();
	//cout<<no<<endl;
	ll pr=0;
	//for(auto it:rec)cout<<it.sd<<' ';

	//cout<<endl;
	
	 //cout<<"no "<<no<<' ';
	for(auto it:rec){
		pr+=it.sd;
	}
	//pr-=no;
	cout<<pr<<endl;
}


Measured memory_bytes: 10788