akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define rep(i,n) for(int i = 0; i < (n); ++i);
using namespace std;

int main() {
	int A, B;
	cin >> A >> B;
	
	for (int n = 1; n < 1010; n++) {
		int A_tax = n * 0.08;
		int B_tax = n * 0.1;

		if (A_tax == A && B_tax == B) {
			cout << n << endl;
			return 0;
		}
	}

	cout << -1 << endl;
	return 0;
	
}

Measured memory_bytes: 256
x=int(input())

b=0
while(True):
    bi=b**5
    ai=x+bi
#    print(ai,bi,(ai**(1/5))%1.0)
    #X-B^5 は整数を５乗した数か判定
    if(int((ai**(1/5))%1.0) == 0):

        aj=int((ai**(1/5))//1)
#        print(ai,aj,bi,b)
        if((aj**5)==ai):
            print(aj,b)
            break
    b*=-1

    bi=b**5
    ai=x+bi

    if(ai>=0 and int((ai**(1/5))%1.0) == 0):
        aj=int((ai**(1/5))//1)
#        print(ai,aj,bi,b)
        if((aj**5)==ai):
            print(aj,b)
            break
    b*=-1

    b+=1


Measured memory_bytes: 9380
process.stdin.setEncoding('ascii');
process.stdin.on('data', function (chunk) {

	var line, rc, r, c, sum, i;

	line = chunk.split(/\r?\n/).map(function (line) {
		if (line.length === 0) return [];
		return line.split(' ').map(Number);
	});

	rc = line.shift();
	r = rc[0];
	c = rc[1];
	line.length = r;

	sum = [];
	for (i = 0; i < c; i++) sum[i] = 0;

	line.forEach(function (line) {
		line.forEach(function addToSum(elem, i) { sum[i] += elem; });
	});
	line.push(sum);
	line.forEach(function (line) {
		line.push(line.reduce(function (a, b) { return a + b; }, 0));
	});

	function join(ary) { return ary.join(' '); }
	console.log(line.map(join).join('\n'));
	
});

Measured memory_bytes: 17552
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl

typedef long long ll;
typedef long double ld;
using namespace std;

const int MOD = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    cout << (n * (n - 1))/2;

    return 0;
}


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

const int N = 100010;

char s[N];

int main(){
	scanf("%s", s);
	int len = strlen(s);
	int odd = len & 1;
	int equal = s[len - 1] == s[0];
	return printf((odd ^ equal) ? "First" : "Second"), 0;
}

Measured memory_bytes: 512
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new KK(); }
class KK
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	double[] GR => Strs.Select(double.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	public const int MOD = 1000000007;
	public const long INFL = 4011686018427387913L;
	public KK()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var N = F;
		var S = Str;
		var dp = new long[N][];
		dp[0] = new[] { 1L };
		for (var i = 1; i < N; i++)
		{
			var sum = new long[i + 1];
			for (var j = 0; j < i; j++) sum[j + 1] = (sum[j] + dp[i - 1][j]) % MOD;
			dp[i] = new long[i + 1];
			if (S[i - 1] == '>') for (var j = 0; j <= i; j++) dp[i][j] = sum[i] - sum[j];
			else for (var j = 0; j <= i; j++) dp[i][j] = sum[j] - sum[0];
		}
		var ans = dp[N - 1].Sum() % MOD;
		if (ans < 0) ans += MOD;
		WriteLine(ans);
	}
}


Measured memory_bytes: 84540
import sys
import itertools
def line():return sys.stdin.readline().strip()

p = ["+","-","*"]
n = [[0,2,0,1],[0,2,1,2],[1,3,1,2],[1,3,2,3],[0,1,2,3]]
def f(l):
    for i in range(len(n)):
        L = l[:]
        L[n[i][0]] = "(" + L[n[i][0]]
        L[n[i][1]] = L[n[i][1]] + ")"
        L[n[i][2]] = "(" + L[n[i][2]]
        L[n[i][3]] = L[n[i][3]] + ")"
        for i in range(3):
            for j in range(3):
                for k in range(3):
                    N = L[:]
                    N[0]+=p[i]
                    N[1]+=p[j]
                    N[2]+=p[k]
                    e = " ".join(N)
                    exec("x=" + e,globals())
                    if x == 10:
                      return e
    return "0"

while True:
    l = line().split()
    if l[0] == "0":break
    ans = "0"
    for i in list(itertools.permutations(l)):
        i = f(list(i))
        if i != "0":
            ans = i
            break
    print(ans)

Measured memory_bytes: 7496
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

int N;
vector<int>vec;
int hyou[123456];

int main(void)
{
	cin >> N;
	for (int i = 0; i < N; ++i) {
		int tmp; cin >> tmp;
		vec.push_back(tmp);
	}
	sort(vec.rbegin(), vec.rend());
	int M = vec[0];
	for (int j = M; j >= 1; --j) {
		if (M % j != 0) {
			hyou[j] = hyou[j + 1] + 1;
		}
	}
	int ans = 0;
	for (int elm : vec) {
		ans += hyou[elm];
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3540
#include <bits/stdc++.h>
#define MOD 998244353
#define int long long
#define N 4000
using namespace std;
int n, p;
int a[N];

int barket[N];

int ans;

signed main () {
	cin >> n >> p;
	for (int i = 1; i <= n; i ++) cin >> a[i];
	
	for (int i = 1; i <= n; i ++) {
		if (a[i] > p) continue;
		(ans += (n - i + 1ll) * barket[p - a[i]]) %= MOD;
		if (a[i] == p) (ans += (n - i + 1ll) * i) %= MOD;
		for (int j = p; j >= a[i]; j --) {
			(barket[j] += barket[j-a[i]]) %= MOD;
		}
		(barket[a[i]] += i) %= MOD;
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
 
#define mem(dp,a)       memset(dp,a,sizeof dp)
#define ninja           ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb(x)           push_back(x)
#define mp(x,y)         make_pair(x,y)
#define all(c)          c.begin(), c.end()
#define ff              first
#define ss              second
#define nl              '\n'
#define inf             1e9+7
 
int main()
{
	ninja
	int t; //cin>>t;
	t=1;
	while(t--)
	{
		ll n,m; cin>>n>>m;
		ll x;
		ll mod=1e9+7;
		vector<bool> broken(n+1,false);
		for(ll i=0;i<m;i++)
			{cin>>x; broken[x]=1;}

		vector<ll> dp(n+1,0);
		dp[0]=1;
		if(broken[1])dp[1]=0;
		else dp[1]=1;
		for(ll i=2;i<=n;i++){
			if(!broken[i])
			{
				dp[i]+=((dp[i-1]+dp[i-2])%mod);
			}
		}
		cout<<dp[n];
	}
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,NAME,...) NAME
#define pr(...) GET_MACRO(__VA_ARGS__,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)
#define pr1(a) (#a)<<"="<<(a)
#define pr2(a,b) pr1(a)<<", "<<pr1(b)
#define pr3(a,b,c) pr2(a,b)<<", "<<pr1(c)
#define pr4(a,b,c,d) pr3(a,b,c)<<", "<<pr1(d)
#define pr5(a,b,c,d,e) pr4(a,b,c,d)<<", "<<pr1(e)
#define int long long
#define double long double
using namespace std;
const int N = 100010;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
typedef pair<int,int> P;
typedef long long ll;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
ostream& operator<<(ostream& o,vector<auto> &a){int i=0;for(auto t:a)o<<(i++?" ":"")<<t;return o;}
istream& operator>>(istream& i,vector<auto> &a){for(auto &t:a)i>>t;return i;}
void prArr(auto a,string s=" "){int i=0;for(auto t:a)cout<<(i++?s:"")<<t;cout<<endl;}

int n;
vector<vector<int> > G;

int isLine(int pos,int pre,bool init = 0){
  static int mem[N],used[N]={};
  if(init) {memset(used,0,sizeof(used));return 0;}
  if(G[pos].size() > 2) return 0;
  if(pre != -1 && G[pos].size() == 1) return 1;
  if(used[pos]++) return mem[pos];
  if(G[pos][0] != pre) return mem[pos] = isLine(G[pos][0],pos);
  if(G[pos][1] != pre) return mem[pos] = isLine(G[pos][1],pos);
  assert(0);
}

int root;
int dfs(int pos,int pre){
  int line = 0;
   int res = 0;
   for(int to:G[pos]){
     if(to == pre) continue;
     if(isLine(to,pos)) line++;
     else res += dfs(to,pos);
   }
   if(pos == root && G[pos].size() == 2 && line == 1) res ++;
   else if(line >= 2) res += line-1;
   return res;
}

signed main(){
  cin>>n;

  G.resize(n);
  for(int i=0;i<n-1;i++){
    int a,b;
    cin>>a>>b;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  for(int i=0;i<n;i++){
    if(G[i].size() != 1) continue;
    if(isLine(i,-1)){
      cout<<1<<endl;
      return 0;
    }
    isLine(0,0,1);
    break;
  }

  for(int i=0;i<n;i++) if(G[i].size() != 1) root = i;
  int ans = dfs(root,root);
  cout<<ans<<endl;

  
  return 0;
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6+9, INF = 0x3f3f3f3f;
int dt[N], cnt = 0;

void insertSort( int dt[], int n, int g ) {
    for( int i = g; i < n; ++i ) {
        int v = dt[i], j = i - g;
        while( j >= 0 && v < dt[j] ) {
            dt[j + g] = dt[j];
            j -= g;
            ++cnt;
        }
        dt[j + g] = v;
    }

}

void shellSort( int dt[], int n ) {
    vector<int> vt;
    for( int i = 0; i * 2 + 1 < n; i = i * 2 + 1 ) vt.push_back( i * 2 + 1 );
    int m = vt.size();
    if( m == 0 ) m = 1, vt.push_back( 1 );
    cout << m << '\n';
    for( int i = m - 1; i >= 0; --i ) {
        cout << vt[i] << ( i == 0 ? '\n' : ' ' );
        insertSort( dt, n, vt[i] );
    }
    cout << cnt << '\n';
}

int main( void ) {
    ios::sync_with_stdio( false );
    int n;
    cin >> n;
    for( int i = 0; i < n; ++i ) cin >> dt[i];
    shellSort( dt, n );
    for( int i = 0; i < n; ++i ) cout << dt[i] << '\n';
    return 0;
}




Measured memory_bytes: 7100
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main() {
	int n,m;
	cin >> n >> m;
	vector<int> v;
	int a, b;
	while(cin>> a >> b) {
		v.push_back(a);
		v.push_back(b);
	}
	
	for (int i = 1; i < n+1; i++) {
		int cnt = 0;
		for (int j = 0; j < v.size(); j++) {
			if (v[j] == i)
				cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;

int main()
{
    int n;
    cin >> n;
    vector<int> cnt(n,0);
    for(int i = 0; i < n; i++){
        int a; cin >> a;
        cnt[a]++;
    }

    ll ans = 1,flag = 1;
    if(n%2 == 1){
        for(int i = 0; i < cnt.size(); i++){
            if(i%2 == 1){
                if(cnt[i] != 0)flag = 0;
            }else{
                if(i == 0){
                    if(cnt[i] != 1) flag = 0;
                }else{
                    if(cnt[i] != 2) flag = 0;
                    else ans = ans * 2 % mod;
                }
            }
        }
    }else{
        for(int i = 0; i < cnt.size(); i++){
            if(i%2 == 0){
                if(cnt[i] != 0)flag = 0;
            }else{
                if(cnt[i] != 2) flag = 0;
                else ans = ans * 2 % mod;
            }
        }
    }

    cout << (flag ? ans : 0) << endl;

    return 0;
}

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

typedef long long ll;
using vi = vector<int>;
using vvi = vector<vi>;

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

  while (n > 0) {
    n -= 1000;
  }

  int ans = n * -1;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int a[100][100];

int main(){
  int n,m;
  cin >> n >> m;
  int k[n];
  rep(i,n){
    cin >> k[i];
    rep(j,k[i]){
      cin >> a[i][j];
      a[i][j]--;
    }
  }
  int ans=0;
  rep(i,m){
    bool ok=true;
    rep(j,n){
      bool flag=false;
      rep(l,k[j]){
        if(a[j][l]==i)flag=true;
      }
      if(!flag)ok=false;
    }
    if(ok)ans++;
  }
  cout << ans << endl;
return 0;}


Measured memory_bytes: 256
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    ans = []
    for i in range(N):
        l = len(a)
        for i in reversed(range(l)):
            if a[i] == i+1:
                p = a.pop(i)
                ans.append(p)
                break
                
    if a != []:
        print(-1)
    else:
        for i in range(N):
            print(ans[-1-i])

if __name__ == "__main__":
    main()


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

int main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    int count = 0;
    bool finished = false;

    for(int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }

    for (int j = 0; j < 100; j++) {
        for (int i = 0; i < N; i++) {

            if(vec.at(i) % 2 == 1) {
                finished = true;
                break;
            }
        
            else {
                vec.at(i) /= 2;
            }
        }

        if(finished) {
            break;
        }

        count++;
    }    
    cout << count << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int x, y;
	
	while (1){
		scanf("%d%d", &x, &y);
		
 		if (x == 0 && y == 0){
			break;
 		}
		
		if (x < y){
			printf("%d %d\n", x, y);
		}
		else {
			printf("%d %d\n", y, x);
		}
	}
	return (0);
}




Measured memory_bytes: 1976
n,k = map(int,input().split())
a = list(map(int,input().split()))
adic = {}
for s in range(n):
  adic[s+1] = a[s]
if k<=10**6:
  kpos = 1
  for i in range(k):
    kpos = adic[kpos]
  print(kpos)
else:
  passpt = set()
  passpt.add(1)
  kpos = 1
  looppt = 0
  for i in range(4*(10**5)):
    kpos = adic[kpos]
    if kpos in passpt:
      looppt = kpos
      break
    else:
      passpt.add(kpos)
  kpos = looppt
  looppass = set()
  for i in range(4*(10**5)):
    kpos = adic[kpos]
    if kpos in looppass:
      break
    else:
      looppass.add(kpos)
  remk = (k-len(passpt))%len(looppass)
  kpos = looppt
  for i in range(remk):
    kpos = adic[kpos]
  print(kpos)

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i=0; i<N;i++){
    cin >> A.at(i);
  }
  int Ans=0;
  for(int i=0;i<N;i=i+2){
    if(A.at(i)%2){
      Ans++;
    }
  }
  cout << Ans << endl;
  return 0;
}

Measured memory_bytes: 3572
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mt make_tuple
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	string s;
	cin>>s;
	vi co(256);
	rep(i,s.size())co[s[i]]++;
	int out=0;
	rep(i,256)if(co[i]%2)out++;
	cout<<out/2<<endl;
}

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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion

#define int long long


signed main()
{
    int n, m;
    while(cin>>n>>m, n) {
        vector<int> s(n), t(m);
        for(int i=0; i<n; ++i) cin >> s[i];
        for(int i=0; i<m; ++i) cin >> t[i];

        int s_sum = accumulate(s.begin(), s.end(), 0);
        int t_sum = accumulate(t.begin(), t.end(), 0);

        int f = 0;
        sort(s.begin(), s.end());
        sort(t.begin(), t.end());
        int a = MOD;
        int b = MOD;
        for(int i=0; i<n; ++i) {
            for(int j=0; j<m; ++j) {
                if(s_sum-s[i]+t[j] == t_sum-t[j]+s[i]) {
                    f = 1;
                    if(a+b>=s[i]+t[j]) {
                        a = s[i];
                        b = t[j];
                    }
                }
            }
        }
        if(f==1) cout << a << " " << b << endl;
        else cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3124
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  int K,X;
  cin>>K>>X;
  REP(i,0,K){
    cout<<X-(K-1)+i<<" ";
  }
  REP(i,0,K-1){
    cout<<X+i+1<<" ";
  }
  cout<<endl;

  return 0;
}


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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,cnt=0;
    for(int i=0;i<4;i++){
        cin >> a;
        cnt+=a;
    }
    int x=cnt/60,y=cnt%60;
    cout << x << endl;
    cout << y << endl;

    return 0;
}


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

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            //

            var N = GetInt();
            var A = GetLongArray();
            var num = A.Count(a => a < 0) % 2;
            var ans = A.Select(a => Math.Abs(a)).Sum();
            if (num == 1) { ans -= 2 * A.Min(a => Math.Abs(a)); }


            Console.WriteLine(ans);

            //
            Console.Out.Flush();
            Console.ReadKey();
        }

        static void Solve()
        {

        }

        static long GCD(long a, long b) { return b != 0 ? GCD(b, a % b) : a; }

        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Split(' ').Select(char.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

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

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

#include <iostream>
#include <vector>
#include <algorithm>

int N;
std::vector<std::pair<int, int>> X_L; 

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

	int remain = N;

	for( int i = 0; i < N; i++ )
	{
		int x, l;

		scanf("%d %d", &x, &l);

		X_L.push_back(std::make_pair(x, l));
	}

	std::sort(X_L.begin(), X_L.end());

	for( int i = 1; i < N; i++ )
	{
		int now_lb = X_L[i].first - X_L[i].second;
		int now_lf = X_L[i].first + X_L[i].second;
		int prev_lb = X_L[i -1].first - X_L[i -1].second;
		int prev_lf = X_L[i -1].first + X_L[i -1].second;
		
		if( prev_lf > now_lb )
		{
			if( prev_lf <= now_lf )
			{
				X_L[i].first = X_L[i -1].first;
				X_L[i].second = X_L[i -1].second;
			}

			remain--;
		}
	}

	printf("%d\n", remain);

	return 0;
}


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

// Contest: AtCoder Beginner Contest 143 (https://atcoder.jp/contests/abc143)
// Problem: D: Triangles (https://atcoder.jp/contests/abc143/tasks/abc143_d)

using namespace std;

using ll = int64_t;
using u64 = uint64_t;
using u32 = uint32_t;

const double PI = 3.141592653589793;

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

    int a, b, x; cin >> a >> b >> x;
    auto a1 = PI / 2 - atan2(a, b);

    ll l = 0, r = 90'000'000'000ll;
    while (r - l > 1) {
        ll m = (l + r) / 2;
        double ang = m / (double)360'000'000'000 * 2 * PI;
        double area;
        if (ang <= a1)
            area = a * b - (tan(ang) * a) * a / 2;
        else
            area = (tan(PI / 2 - ang) * b) * b / 2;
        if (area * a >= x)
            l = m;
        else
            r = m;
    }

    cout << fixed << setprecision(20) << (l / (double)1'000'000'000) << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  string s, t;
  cin >> s >> t;
  sort(ALL(s));
  sort(ALLr(t));
  if(s < t) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const ll Lmax=ll(1e18);
const int Nmax=2e5+1;
const int Nd=61;
const int INF=1e5;

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 main(){
  int n,m; cin>>n>>m;
  vector<P> ab(m);
  rep(i,m){
    cin>>ab[i].first>>ab[i].second;
    ab[i].first--;
    ab[i].second--;
  }

  UnionFind uf(n);
  vector<ll> ans(m+1);
  ll add=0;
  ans[m]=ll(n)*ll(n-1)/2;

  rep(i,m){
    int a=ab[m-1-i].first;
    int b=ab[m-1-i].second;
    if(uf.same(a,b)){
      add=0;
    }else{
      add=ll(uf.size(a))*ll(uf.size(b));
    }
    ans[m-1-i]=ans[m-i]-add;
    uf.unite(a,b);

  }
  rep(i,m){
    cout<<ans[i+1]<<endl;
  }


}


Measured memory_bytes: 5832
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int num[3];
int main() {
	int n = 1;
	while(1) {
		int tmp; cin>>tmp;
		if(tmp==0) break;
		printf("Case %d: %d\n",n,tmp);
		n++;
	}
}


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

using namespace std;

const int N=1e6+3;

#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;

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

const int inf=1e9;

int n,m,a[N],b[N],k,q,u,v,x,y,tc,c,l,r,ans;

char s[N];

void IO(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("test.txt","r",stdin);
	#endif
}

int aa[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};


int main(){
	//IO();
	scanf("%d%d",&n,&m);
	if (n==1 || m==1)
		return !printf("1\n");
	ll ans=((ll)n*m)/2;
	if (n&1 && m&1)
		ans++;
	printf("%lld\n",ans);
}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main() {
    let nk = read_vec::<u64>();
    let (n,k) = (nk[0],nk[1]);
    let div = n - k;
    let mut v = read_vec::<u64>();
    v.sort();
    let sum :u64 = v.iter().sum();
    let ans = sum - (0..div).fold(0,|x,y| x + v[y as usize]);
    println!("{}",ans);
}

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

typedef pair<int, int> P;

int main() {
	int t, p, r;
	while(cin >> t >> p >> r){
		int tid, pid, tm, rp[64][16] = {0};
		bool check[64][16] = {0};
		string message;
		vector<P> s;
		for(int i = 0; i < t; ++i){
			s.push_back(P(0, 0));
		}
		for(int i = 0; i < r; ++i){
			cin >> tid >> pid >> tm >> message;
			tid--;
			if(message == "CORRECT"){
				if(!check[tid][pid]){
					check[tid][pid] = true;
					s[tid].second += tm + rp[tid][pid] * 1200;
					s[tid].first--;
				}
			}
			else{
				rp[tid][pid]++;
			}
		}
		vector<P> rnk = s;
		stable_sort(s.begin(), s.end());
		bool is_out[64] = {0};
		for(int i = 0; i < t; ++i){
			for(int j = 0; j < t; ++j){
				if(rnk[j].first == s[i].first && rnk[j].second == s[i].second && !is_out[j]){
					is_out[j] = true;
					cout << j + 1 << " " << -s[i].first << " " << s[i].second << endl;
					break;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1232
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")
           
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
           
using namespace std;
using namespace __gnu_pbds;
           
//#define int long long
  
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
           
using matrix = vector<vector<ll>>;
template<typename T>
using kawaii_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
           
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
  
void FAST_IO() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout.setf(ios::fixed);
    cout.precision(20);
    #ifndef _offline
    //freopen("mincost.in", "r", stdin);
    //freopen("mincost.out", "w", stdout);
    #endif
}

signed main() {
    FAST_IO();
    ld n;
    cin >> n;
    ld ans = (n / 3) * (n / 3) * (n / 3);
    cout << ans << '\n';
}   

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

int main()
{
  long long H, N, A[100100];
  cin >> H >> N;
  long long sum = 0;
  for(int i = 0; i < N; ++i)
  {
    cin >> A[i];
    sum += A[i];
  }

  if(sum >= H) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 4356
#include <stdio.h>

int main(){
    int N, M;
    int A[10000];
    int sum = 0;
    int play = 0;

    scanf("%d %d", &N, &M);
    for (int i = 0; i < M; i++){
        scanf("%d", &A[i]);
        sum += A[i];
    }

    if(sum > N){
        printf("-1");
    }else{
        play = N - sum;
        printf("%d", play);
    }
    }

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

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

template <class T> ostream& operator<<(ostream& os, const V<T>& v) {
    os << "[";
    for (auto d : v) os << d << ", ";
    return os << "]";
}

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "P(" << p.first << ", " << p.second << ")";
}


template <uint MD> struct ModInt {
    using M = ModInt;
    uint v;
    ModInt() : v(0) {}
    ModInt(ll _v) { set_v(_v % MD + MD); }
    M& set_v(uint _v) {
        v = (_v < MD) ? _v : _v - MD;
        return *this;
    }
    explicit operator bool() const { return v != 0; }
    M operator-() const { return M() - *this; }
    M operator+(const M& r) const { return M().set_v(v + r.v); }
    M operator-(const M& r) const { return M().set_v(v + MD - r.v); }
    M operator*(const M& r) const { return M().set_v(ull(v) * r.v % MD); }
    M operator/(const M& r) const { return *this * r.inv(); }
    M& operator+=(const M& r) { return *this = *this + r; }
    M& operator-=(const M& r) { return *this = *this - r; }
    M& operator*=(const M& r) { return *this = *this * r; }
    M& operator/=(const M& r) { return *this = *this / r; }
    M pow(ll n) const {
        M x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    M inv() const { return pow(MD - 2); }
    friend ostream& operator<<(ostream& os, const M& r) { return os << r.v; }
};
using Mint = ModInt<TEN(9) + 7>;


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

    int n;
    cin >> n;
    string s;
    cin >> s;
    V<Mint> dp(1); dp[0] = 1;
    for (auto c: s) {
        int m = int(dp.size()) + 1;
        V<Mint> ndp(m);
        if (c == '<') {
            Mint sm = 0;
            for (int i = 0; i < m; i++) {
                ndp[i] = sm;
                if (i == m - 1) break;
                sm += dp[i];
            }
        } else {
            Mint sm = 0;
            for (int i = m - 1; i >= 0; i--) {
                ndp[i] = sm;
                if (i == 0) break;
                sm += dp[i - 1];
            }
        }
        dp = ndp;
    }
    Mint sm = 0;
    for (auto v: dp) sm += v;
    cout << sm << endl;
    return 0;
}


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

using namespace std;
using ll = long long;

int main()
{
	int i,o,t,j,l,s,z;
	ll sq=0;

	cin>>i>>o>>t>>j>>l>>s>>z;

	sq += o;

	while(i>2)
	{
		i-=2;
		sq+=2;
	}
	while(l>2)
	{
		l-=2;
		sq+=2;
	}
	while(j>2)
	{
		j-=2;
		sq+=2;
	}

	cerr<<sq<<endl;
	cerr<<i<<" "<<j<<" "<<l<<endl;

	int ms=0;
	for(int n=0;n<3;n++)
	{
		int temp=0;
		int ii=i;
		int jj=j;
		int ll=l;
		for(int m=0;m<n;m++)
		{
			ii--;
			jj--;
			ll--;
			temp+=3;
		}
		if(ii<0 || jj<0 || ll<0)
			continue;
		
		temp+=(ii/2)*2;
		temp+=(jj/2)*2;
		temp+=(ll/2)*2;
		ms = max(temp,ms);
	}
	sq+=ms;

	cout<<sq<<endl;
	return 0;
}

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

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

    int now = 1;
    int ct = 0;
    vector<int> num;
    rep(i,n) {
        if (s[i] == char('0' + now)) {
            ct++;
        }
        else {
            num.push_back(ct);
            now = 1 - now;
            ct = 1;
        }
    }
    if (ct) num.push_back(ct);
    if (num.size() % 2 == 0) num.push_back(0);

    int add = 2 * k + 1;
    int ans = 0;
    int tmp = 0;
    int left = 0;
    int right = 0;
    for (int i = 0; i < num.size(); i += 2) {
        int next_l = i;
        int next_r = min(i+add,(int)num.size());
        while (next_l > left) {
            tmp -= num[left];
            left++;
        }
        while (next_r > right) {
            tmp += num[right];
            right++;
        }
        ans = max(ans,tmp);
    }
    cout << ans << endl;

}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n; cin >> n;
    vector<int> a(n,0);
    rep(i, n) {
        int x; cin >> x;
        a[x]++;
    }
    bool flag = true;
    for (int i=n-1; i>0; i-=2) {
        if (a[i]!=2) flag = false;
    }
    if (flag) {
        ll ans = 1;
        rep(i, n/2) (ans*=2)%=MOD;
        cout << ans << endl;
    } else puts("0");
    return 0;
}

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

using namespace std;

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

  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<pair<int, int>> p(q);
  vector<int> arr(n+1);
  rep (i, q)
    cin >> p[i].first >> p[i].second;
  
  int count = 0;
  rep (i, n-1){
    if(s.substr(i,2) == "AC")
      count++;
    arr[i+1] = count;
  }

  rep(i, q) {
    int ans = arr[p[i].second-1] - arr[p[i].first-1];
    cout << ans << endl;
  }
}

Measured memory_bytes: 2256
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		
		Map<Character, boolean[]> cardsMap = new HashMap<>();
		cardsMap.put('S', new boolean[13]);
		cardsMap.put('H', new boolean[13]);
		cardsMap.put('C', new boolean[13]);
		cardsMap.put('D', new boolean[13]);

		for (int i = 0; i < n; i++) {
			String input[] = sc.nextLine().split(" ");
			char mark = input[0].charAt(0);
			int num = Integer.parseInt(input[1]);

			cardsMap.get(mark)[num - 1] = true;
		}
		sc.close();

		char[] marks = { 'S', 'H', 'C', 'D' };
		for (char mark : marks) {
			boolean[] cards = cardsMap.get(mark);
			for (int i = 0; i < 13; i++) {

				if (!cards[i])
					System.out.println(mark + " " + (i + 1));

			}
		}
	}
}

Measured memory_bytes: 26468
package main

import (
	"fmt"
)
func main(){
	var a,b int
	fmt.Scanf("%d", &a)
	fmt.Scanf("%d", &b)
	if a<b {
		temp := a
		a=b
		b=temp
	}
	i := gcd(a,b)
	fmt.Println(i)
}
func gcd(a int,b int) int {
	if b==0 {
		return a
	} else {
		return gcd(b, a%b)
	}
}



Measured memory_bytes: 1124
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstring>

int A,B,K;
int main()
{
	scanf("%d %d %d",&A,&B,&K);
	for(int i=1;i<=K;i++){
		if((i%2)==1){
		    if((A%2)==1){
			    A=A-1;
			    A=A/2;
			    B=B+A;
		    }
		    else if((A%2)==0){
			    A=A/2;
			    B=B+A;
		    }
		}
		else{
			if((B%2)==1){
				B=B-1;
				B=B/2;
				A=A+B;
			}
			else if((B%2)==0){
				B=B/2;
				A=A+B;
			}
		}
	}
	printf("%d %d",A,B);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <random>
using namespace std;
#define Would
#define you

int main() {
	int n;
	cin >> n;
	cout << 24 + (24 - n) << endl;
}

Measured memory_bytes: 256
#define watch5(a,b,c,d,e) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d << " | "<<#e<<": "<<e<<endl;
#define watch4(a,b,c,d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define watch3(a,b,c) cerr <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define sharingan cerr << "\n-------------------------------------------\n\n";
#define watch2(a,b) cerr <<#a<<": "<<a<<" | "<<#b<<": "<<b<< endl;
#define Yup ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define watch(a) cerr <<#a<<": "<<a<<endl;
#define __gcd(a, b) __algo_gcd(a, b)
#define PI 3.14159265358979323846
#define mod 1000000007
#include "bits/stdc++.h"
using namespace std;
#define int long long

int dp[1000000];

int go( int left ){
    if( left == 0 )return 1;
    if( left < 0 )return 0;
    if( dp[left] != -1 )return dp[left];
    int ans = 0;
    for( int i = 3; i <= left; i++ ){
        ans = ans % mod + go(left-i) % mod;
        ans %= mod;
    }
    return dp[left] = ans;
}

int32_t main(){
    memset(dp, -1, sizeof(dp));
    int s;
    cin >> s;
    cout << go(s);
}

Measured memory_bytes: 11448
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair < int , int >;

template < typename T >
void min_self (T & a, T b) {
	if (a > b) a = b;
}

const int mx = 301;
const ll inf = 1e18 - 1;

void solve() {
	int n, k;
	scanf ("%d %d", &n, &k);
	ll h[mx];
	for (int i = 0; i < n; i++) {
		scanf ("%lld", &h[i]);
	}
	
	ll dp[mx][mx];
	for (int i = 0; i < mx; i++) {
		for (int j = 1; j < mx; j++) {
			dp[i][j] = inf;
		}
	}
		
	for (int i = 0; i < n; i++) dp[i][1] = h[i];
	
	for (int x = 1; x < n; x++) {
		for (int y = 2; y < n - k + 1; y++) {
			for (int i = 0; i < x; i++) {
				min_self (dp[x][y], dp[i][y - 1] + max (0LL, h[x] - h[i]));
			}
		}
	}
	
	ll answer = inf;
	
	for (int i = 0; i < n; i++) {
		min_self (answer, dp[i][n - k]);
	}
	
	printf ("%lld\n", answer);
}

int main() {
	solve();
	return 0;
}


Measured memory_bytes: 896
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
void *wmem;
char memarr[96000000];
template<class T> inline void walloc1d(T **arr, int x, void **mem = &wmem){
  static int skip[16] = {0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  (*mem) = (void*)( ((char*)(*mem)) + skip[((unsigned long long)(*mem)) & 15] );
  (*arr)=(T*)(*mem);
  (*mem)=((*arr)+x);
}
template<class T1> void sortA_L(int N, T1 a[], void *mem = wmem){
  sort(a, a+N);
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int N;
int K;
int H[200000];
int main(){
  int i;
  wmem = memarr;
  long long res = 0;
  rd(N);
  rd(K);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=(0);Lj4PdHRW<(N);Lj4PdHRW++){
      rd(H[Lj4PdHRW]);
    }
  }
  sortA_L(N,H);
  for(i=(0);i<(N-K);i++){
    res += H[i];
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200119-1

// --- original code ---
// int N, K, H[2d5];
// {
//   ll res = 0;
//   rd(N,K,H(N));
//   sortA(N,H);
//   rep(i,N-K) res += H[i];
//   wt(res);
// }


Measured memory_bytes: 1024
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int x,y;
    while(cin >> y >> x, x || y){
        for(int i = 0; i < y; i++){
            for(int j = 0; j < x; j++){
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 1112
//Date : 06 - 06 - 18    //Author : Rishabh Paul

#include<bits/stdc++.h>
using namespace std;

int main() {
	int n;
	scanf("%d" ,&n);
	int ans = INT_MAX;
	for(int i = 1 ,j = n - 1 ; i <= j ; i++ ,j--) {
		int x = i ,s = 0;
		while(x) {
			s += x % 10;
			x /= 10;
		}
		x = j;
		while(x) {
			s += x % 10;
			x /= 10;
		}
		ans = min(ans ,s);
	}
	printf("%d\n" ,ans);
	return 0;
}

Measured memory_bytes: 256
// Math = ♥️

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set                            \
    tree<ll, null_type, less<ll>, rb_tree_tag, \
         tree_order_statistics_node_update>

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

    ll x, y;
    cin >> x >> y;
    x--, y--;

    ll n = 100, m = 100;
    char mat[n][m];

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            mat[i][j] = '?';
        }
    }

    for (int i = 0; i < m; i++) {
        mat[0][i] = '.';
        mat[n - 1][i] = '#';
    }

    ll curr = 1;
    bool flag = false;
    while (y != 0) {
        for (int i = 0; i < m; i++) {
            if (y == 0) {
                flag = true;
            }

            if (flag || (i & 1)) {
                mat[curr][i] = '.';
            } else {
                mat[curr][i] = '#';
                y--;
            }
        }
        curr++;
        for (int i = 0; i < m; i++) {
            mat[curr][i] = '.';
        }
        curr++;
    }

    curr = n - 2, flag = false;
    while (x != 0) {
        for (int i = 0; i < m; i++) {
            if (x == 0) {
                flag = true;
            }

            if (flag || (i & 1)) {
                mat[curr][i] = '#';
            } else {
                mat[curr][i] = '.';
                x--;
            }
        }
        curr--;
        for (int i = 0; i < m; i++) {
            mat[curr][i] = '#';
        }
        curr--;
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (mat[i][j] == '?') {
                mat[i][j] = mat[i - 1][j];
            }
        }
    }

    cout << n << " " << m << "\n";
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cout << mat[i][j];
        }
        cout << "\n";
    }
}

Measured memory_bytes: 256
n = int(input())
a = [0]*n
a = list(map(int, input().split()))
b = [0]*n
b = list(map(int, input().split()))
kekka = 0
for i in range(n):
    if a[i] > b[i]:
        kekka += a[i] - b[i]
print(kekka)


Measured memory_bytes: 3060
# coding: utf-8

def main():
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    E = int(input())
    K = int(input())
    # print(A,B,C,D,E,K)
    if E - A <= K: 
        print("Yay!")
    else:
        print(":(")


if __name__ == "__main__":
    main()

Measured memory_bytes: 3064