akhauriyash/Code-Regression huggingface dataset:
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;


void main() {
    int n;
    scan(n);

    auto c = new char[](2*n + 1);
    auto a = new int[](2*n + 1);
    c[0] = '#', a[0] = 0;
    foreach (i ; 1 .. 2*n + 1) {
        scan(c[i], a[i]);
    }
    debug {
        writeln(a);
    }
    auto revw = new int[](n + 1);
    auto revb = new int[](n + 1);
    foreach (i ; 1 .. 2*n + 1) {
        if (c[i] == 'W') {
            revw[a[i]] = i;
        }
        else {
            revb[a[i]] = i;
        }
    }

    auto wf = new int[][](2*n + 1, n + 2);
    auto wb = new int[][](2*n + 1, n + 2);
    auto bf = new int[][](2*n + 1, n + 2);
    auto bb = new int[][](2*n + 1, n + 2);

    foreach (i ; 1 .. 2*n + 1) {
        foreach (j ; 1 .. i + 1) {
            if (c[j] == 'W') {
                wf[i][a[j]]++;
            }
            else {
                bf[i][a[j]]++;
            }
        }

        foreach_reverse (j ; 0 .. n + 1) {
            wf[i][j] += wf[i][j+1];
            bf[i][j] += bf[i][j+1];
        }
    }

    foreach (i ; 1 .. 2*n + 1) {
        foreach (j ; i .. 2*n + 1) {
            if (c[j] == 'W') {
                wb[i][a[j]]++;
            }
            else {
                bb[i][a[j]]++;
            }
        }

        foreach (j ; 1 .. n + 2) {
            wb[i][j] += wb[i][j-1];
            bb[i][j] += bb[i][j-1];
        }
    }

    debug {
        writeln("wf:");
        writefln("%(%s\n%)", wf);
        writeln;
        writeln("wb:");
        writefln("%(%s\n%)", wb);
        writeln;
    }

    auto dp = new int[][](n + 1, n + 1);
    fillAll(dp, 1<<30);
    dp[0][0] = 0;

    foreach (i ; 0 .. n + 1) {
        foreach (j ; 0 .. n + 1) {
            if (i + 1 <= n) {
                dp[i+1][j] = min(dp[i+1][j], dp[i][j] + wf[revw[i+1]][i+2] + bf[revw[i+1]][j+1]);
                                                      //+ wb[revw[i+1]][i] + bb[revw[i+1]][max(j-1, 0)]);
            }
            if (j + 1 <= n) {
                dp[i][j+1] = min(dp[i][j+1], dp[i][j] + wf[revb[j+1]][i+1] + bf[revb[j+1]][j+2]);
                                                      //+ wb[revb[j+1]][max(i-1, 0)] + bb[revb[j+1]][j]);
            }
        }
    }

    debug {
        writefln("%(%(%s %)\n%)", dp);
    }

    writeln(dp[n][n]);
}







































void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


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

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int H, W, A, B;
  cin >> H >> W >> A >> B;
  A = W - A;
  B = H - B;
  auto mat = make_v< int >(H, W);
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < A; j++) mat[i][j] = 1;
  }
  for(int i = B; i < H; i++) {
    for(int j = 0; j < W; j++) mat[i][j] ^= 1;
  }
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) cout << mat[i][j];
    cout << endl;
  }
}

Measured memory_bytes: 5248
N = int(input())
A = list(map(int, input().split()))

def solve(isPositive):
    sum_a = 0
    ans = 0
    for a in A:
        sum_a += a
        
        # 一回前が正か？
        if isPositive:
            # 一回前が正の場合、今回は負にならないといけない
            # そのため、0以上ならば負になるように調整
            if sum_a>=0:
                ans += 1 + sum_a
                # 最小回数の操作なので、sum_aはマイナス1になる
                sum_a = -1
            isPositive = False
        else:
            if sum_a<=0:
                ans += 1 - sum_a
                sum_a = 1
            isPositive = True
            
    return ans

print(min(solve(False), solve(True)))

Measured memory_bytes: 14332
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <array>
#include <list>
#include <stack>
#include <valarray>

using namespace std;

typedef unsigned uint;
typedef long long Int;
typedef unsigned long long UInt;

const int INF = 1001001001;
const Int INFLL = 1001001001001001001LL;

template<typename T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<typename T> void chmin(T& a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T& a, T b) { if (a < b) a = b; }
int in() { int x; scanf("%d", &x); return x; }
double fin() { double x; scanf("%lf", &x); return x; }
Int lin() { Int x; scanf("%lld", &x); return x; }

int main() {
  int N = in();
  int A = in();
  int B = in();

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

  return 0;
}


Measured memory_bytes: 256
// clang-format off
	#define BADSEED random_device{}()
	#include <bits/stdc++.h>
	using namespace std;
	using ll = long long;
	using uint = unsigned int;
	ostream &operator<<(ostream &os, int8_t c) { return os << short(c); }
	istream &operator>>(istream &is, int8_t &c) { short x; is >> x; c = x; return is; }
	#define TM_(...) template <class __VA_ARGS__>
	namespace narut {
	TM_(T) using TupSz = tuple_size<decay_t<T>>;
	TM_(T) constexpr auto spc(T const &t, int) -> decltype((cout << t), 'a') { return ' '; }
	constexpr auto spc(string const &s, int) { return '\n'; }
	TM_(T) constexpr auto spc(T const &t, char) { return '\n'; }
	struct IO {
		TM_(T) static auto out_(ostream &os, T const &t, int) -> decltype(void(os << t)) { os << t; }
		TM_(T, class OS) static auto out_(OS &os, T const &t, int) -> decltype(void(begin(t))) {
			auto it = begin(t), e = end(t);
			if (it != e) out_(os, *it++, 0);
			for (; it != e; out_(os, *it++, 0)) os << spc(*it, 0);
		}
		TM_(T, size_t... Is) static void out_tup(ostream &os, T const &t, index_sequence<Is...>) { (void)initializer_list<int>{0, ((Is == 0) ? 0 : ((os << ' '), 0), (os << get<Is>(t)), 0)...}; }
		TM_(T) static decltype(void(TupSz<T>{})) out_(ostream &os, T const &t, char) { out_tup(os, t, make_index_sequence<TupSz<T>::value>{}); }
		TM_(Sep, class F, class... Ts) static ostream &print(ostream &os, Sep sep, F const &f, Ts const &... ts) { return void(initializer_list<int>{(out_(os, f, 0), 0), (out_(os << sep, ts, 0), 0)...}), os; }
		TM_(T) static auto in_(istream &is, T &t, int) -> decltype(void(is >> t)) { is >> t; }
		TM_(T, class IS) static auto in_(IS &is, T &t, int) -> decltype(void(begin(t))) { for (auto &x : t) in_(is, x, 0); }
		TM_(T, size_t... Is) static void in_tup(istream &is, T &t, index_sequence<Is...>) { (void)initializer_list<int>{0, (in_(is, get<Is>(t), 0), 0)...}; }
		TM_(T) static decltype(void(TupSz<T>{})) in_(istream &is, T &t, char) { in_tup(is, t, make_index_sequence<TupSz<T>::value>{}); }
	};
	} // namespace narut
	#define Cout(...) narut::IO::print(cout, ' ', __VA_ARGS__) << '\n'
	#ifdef NARUT_LOCAL
	#define Debug(...) narut::IO::print(cerr << "\033[0;31m", ", ", __VA_ARGS__) << "\033[0m\n"
	#else
	#define Debug(...) 0
	#endif
	[[maybe_unused]] struct Cin { 
		template <class T> Cin const &operator>>(T &t) const { return narut::IO::in_(cin, t, 0), *this; }
		template <class T> operator T() const { T t; return *this >> t, t;  }	
	} Cin;
	TM_(T) auto operator%(T &t, size_t n) -> decltype(t.resize(n), t)& { return t.resize(n), t; }
	#define FOR(i, j, n) for (int i = int(j); i < int(n); ++i)
	#define ROF(i, j, n) for (int i = int(n) - 1; i >= int(j); --i)

// clang-format on





auto Main() {
	string s,t;
	cin>>s>>t;
	return s == t.substr(0, s.size());
	
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(10);
#ifdef NARUT_LOCAL
	assert(freopen("io/test.in", "r", stdin));
	cin.exceptions(cin.badbit | cin.failbit);
	cerr << fixed << setprecision(10);
#endif

	cout << (Main() ? "Yes\n" : "No\n");
}


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

int main() {
    string o,e;
    cin >> o >> e;
    rep(i,e.length()){
        cout << o[i] << e[i];
    }
    if(o.length()!=e.length())cout << o[o.length()-1];
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;
const int L = 110;

int main() {
  int N, Q, cnt[L];
  while(cin >>N >>Q && N){
    memset(cnt, 0, sizeof(cnt));
    REP(i, N){
      int M; cin >>M;
      REP(j, M){
        int n; cin >>n;
        cnt[n]++;
      }
    }
    int ans = 0;
    REP(i, L) if(cnt[i] >= Q && cnt[i] > cnt[ans]) { ans = i; }
    cout <<ans <<endl;
  }
  return 0;
}

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

int main(){
    string s;
    long long int k;
    cin >> s >> k;

    for(long long int i=0; i<k; i++){
        if(s[i] != '1'){
            cout << s[i] << endl;
            return 0;
        }
    }
    cout << 1 << endl;
    return 0;
}

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

using namespace std;

#define int long long

#define N 100005



int32_t main()
{
        ios_base::sync_with_stdio(false);

        int s;
        cin>>s;

        int x2=1e9, y2=1, x3, y3;
        y3 = (s+x2-1)/x2;
        x3 = (x2*y3)-s;  

       

        cout<<0<<" "<<0<<" "<<x2<<" "<<y2<<" "<<x3<<" "<<y3;
 
        return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(ll i = (ll)(a); i <= (ll)(b); i++)
#define NFOR(i,a,b) for(ll i = (ll)(a); i >= (ll)(b); --i)
#define rep(i, a) for (ll i = 0; i < a; i++)
#define endl "\n"
#define fi first
#define se second
#define MOD 1000000007
#define inf 1e12
#define pb push_back
#define Case cout<<"Case #"<<++cas<<": ";
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(v) v.begin(),v.end()

typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;

#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ","; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const multiset<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}

void solve() {
	string s, t;
	cin >> s >> t;
	ll n = s.size(), m = t.size();
	vvl dp(n + 1, vl(m + 1, 0));

	FOR (i, 1, n)
		FOR (j, 1, m) {
			if (s[i-1] == t[j-1])
				dp[i][j] = dp[i-1][j-1] + 2;
			else 
				dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
		}

	string ans;
	int i = n, j = m;
	while (i >= 1 and j >= 1) {
		if (s[i-1] == t[j-1]) {
			ans += s[i-1];
			i--, j--;
		} else if(dp[i][j] == dp[i-1][j]) {
			i--;
		} else j--;
	}
	reverse(all(ans));
	cout << ans << endl;
}

int main()
{
    fastio;
    ll t  = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}


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

#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define ALL(x) (x).begin(), (x).end()
#define OUT(a) cout << (a) << "\n"

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;

const ll MOD = 10e9 + 7;
int dp_a[100001];
int dp_b[100001];
int dp_c[100001];

int main() {
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n);
    REP(i, n) {
        cin >> a[i] >> b[i] >> c[i];
    }
    dp_a[0] = a[0]; dp_b[0] = b[0]; dp_c[0] = c[0];
    for(int i=1; i<n; i++) {
        dp_a[i] = a[i] + max(dp_b[i-1], dp_c[i-1]);
        dp_b[i] = b[i] + max(dp_a[i-1], dp_c[i-1]);
        dp_c[i] = c[i] + max(dp_b[i-1], dp_a[i-1]);
    }
    int res = max(dp_a[n-1], dp_b[n-1]);
    res = max(res, dp_c[n-1]);
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
 
int main(){
  int A, B;
  cin >> A >> B;
  bool ans = true;
  if(max(A,B) > 8) ans = false;
  cout << (ans ? "Yay!" : ":(" ) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define maxn 20
#define maxm 500000
int n, N, ans, a[maxm];

int read()
{
    int x = 0, k = 1;
    char c;
    c = getchar();
    while(c < '0' || c > '9') { if(c == '-') k = -1; c = getchar(); }
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * k;
}

struct node
{
    int num, id;
    node(int a = 0, int b = 0) { num = a; id = b; }
    friend bool operator <(const node& a, const node& b)
    { if(a.num != b.num) return a.num < b.num; else return a.id < b.id; }
}f[maxn][maxm], g[maxn][maxm], t[8];

int main()
{
    n = read(); N = (1 << n) - 1;
    for(int i = 0; i <= N; i ++)  a[i] = read(), f[0][i] = node(a[i], i + 1);
    for(int i = 1; i <= n + 1; i ++)
        for(int j = 0; j <= N; j ++)
        {
            if(!((1 << (i - 1)) & j))
            {
                t[1] = f[i - 1][j], t[2] = g[i - 1][j], t[3] = f[i][j], t[4] = g[i][j]; 
            	sort(t + 1, t + 5); node mx, mxx; bool flag = 0;
            	for(int k = 4; k; k --) 
            		if(!flag) mx = t[k], flag = 1;
            		else if(t[k].id != mx.id) { mxx = t[k]; break; } 
            	f[i][j] = mx, g[i][j] = mxx;
			}
            else
            {
                t[1] = f[i - 1][j], t[2] = g[i - 1][j], t[3] = f[i][j], t[4] = g[i][j]; 
            	sort(t + 1, t + 5); node mx, mxx; bool flag = 0;
            	for(int k = 4; k; k --) 
            		if(!flag) mx = t[k], flag = 1;
            		else if(t[k].id != mx.id) { mxx = t[k]; break; } 
            	f[i][j] = mx, g[i][j] = mxx;

                int k = j ^ (1 << (i - 1)); flag = 0;
                
                t[1] = f[i - 1][k], t[2] = g[i - 1][k], t[3] = f[i][j], t[4] = g[i][j]; 
            	sort(t + 1, t + 5); 
            	for(int k = 4; k; k --) 
            		if(!flag) mx = t[k], flag = 1;
            		else if(t[k].id != mx.id) { mxx = t[k]; break; } 
            	f[i][j] = mx, g[i][j] = mxx;
            }
        }
    for(int i = 1; i <= N; i ++)
    {
        int tem = i, len = 1;
        while(tem) len ++, tem >>= 1;
        ans = max(ans, f[len][i].num + g[len][i].num);
        printf("%d\n", ans);
    }
    return 0;
}

Measured memory_bytes: 160768
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a;
int ans[n+1]={0};
for(int i=1;i<=n-1;i++){
cin >> a;
ans[a]++;
}
for(int i=1;i<n+1;i++)
cout << ans[i] <<endl;
}

	



Measured memory_bytes: 4420
import java.io.*;
import java.util.*;

public class Main{
    static MyReader in = new MyReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args){
        long A, B;
        {long[] a = in.ll(); A = a[0]; B = a[1];}
        if(B < A){
            long tmp = A;
            A = B;
            B = tmp;
        }

        long g = gcd(A, B);

        int ans = 1;
        double C = Math.sqrt(g+1);
        if(g%2 == 0){
            ans++;
            while(g%2 == 0)
                g /= 2;
        }
        if(g%3 == 0){
            ans++;
            while(g%3 == 0)
                g /= 3;
        }
        boolean b = false;
        for(int i = 5; i < C; i += (b = !b) ? 2 : 4){
            if(g%i == 0){
                ans++;
                while(g%i == 0)
                    g /= i;
            }            
        }
        if(g != 1){
            ans++;
        }
        out.println(ans);

        out.flush();
    }

    static long gcd(long a, long b){
        long r;
        while((r = b%a) > 0){
            b = a;
            a = r;
        }
        return a;
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}


Measured memory_bytes: 22612
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;

const int MaxN = 100000, Pt = 1e9 + 7;
int n, m;
LL x[MaxN + 5], y[MaxN + 5];
LL cx[MaxN + 5], cy[MaxN + 5];
LL Sx, Sy;

int main()
{
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &x[i]);
		if (i == 1) cx[i] = 0;
		else cx[i] = (cx[i - 1] + (i - 1) * (x[i] - x[i - 1]) % Pt) % Pt;
		Sx = (Sx + cx[i]) % Pt;
	}	
	for (int i = 1; i <= m; i++) {
		scanf("%lld", &y[i]);
		if (i == 1) cy[i] = 0;
		else cy[i] = (cy[i - 1] + (i - 1) * (y[i] - y[i - 1]) % Pt) % Pt;
		Sy = (Sy + cy[i]) % Pt;
	}	
	printf("%lld\n", Sx * Sy % Pt);
	return 0;
}

Measured memory_bytes: 3328
n,k=map(int,input().split())
if k%2!=0:
  cnt=n//k
else:
  cnt=n//k
  cnt2=0
  for i in range(n):
    i+=1
    if i%k==k//2:
      cnt2+=1
def f(cnt):
  if cnt==0:
    return 0
  elif cnt==1:
    return 1
  elif cnt==2:
    return 8
  else:
    return cnt+3*cnt*(cnt-1)+cnt*(cnt-1)*(cnt-2)
if k%2!=0:
  print(f(cnt))
else:
  print(f(cnt)+f(cnt2))

Measured memory_bytes: 3192
#include "bits/stdc++.h"
#define REP(i, m, n) for(long long i = m; i < n; ++i)
#define CO(n) cout << n << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

string S;
int K;
int dp[2][101][4];
//桁DP : dp[f][i][j]
//f:未満フラグ
//上からi桁目まで決めて0でない桁がj個

int main()
{
    ios::sync_with_stdio(false);
    cin >> S >> K;
    int l = S.length();
    //初期化
    //S[0]から始める
    dp[0][1][1] = 1;
    //S[0]-1,...,1から始める;
    dp[1][1][1] = (int)(S[0]-'0')-1;
    //0から始める
    dp[1][1][0] = 1;
    REP(i,1,l){
        int s = S[i]-'0'; //追加しようとしている桁に対応するNの数字
        //sが0の場合
        if (s == 0){
            //false tableの更新
            //0を追加する
            REP(j,0,4){
                dp[0][i+1][j] += dp[0][i][j];
            }
            ///true tableの更新
            //0を追加する
            REP(j,0,4){
                dp[1][i+1][j] += dp[1][i][j];
            }
            //1,...,9を追加する
            REP(j,0,3){
                dp[1][i+1][j+1] += 9*dp[1][i][j];
            }
        }
        //sが0でない場合
        else{
            //false tableの更新
            REP(j,0,3){
                //S[i]を追加する
                dp[0][i+1][j+1] = dp[0][i][j];
            }
            //true tableの更新
            REP(j,0,4){
                //0を追加する場合 //必ず未満フラグが立つ
                dp[1][i+1][j] = dp[0][i][j] + dp[1][i][j];
            }
            REP(j,0,3){
                //false table から S[i]-1,...,1 を追加する場合
                dp[1][i+1][j+1] += ((int)(S[i]-'0') - 1) * dp[0][i][j];
                //true table から 9,...,1 を追加する場合
                dp[1][i+1][j+1] += 9*dp[1][i][j];
            }
        }            
    }
    // CO("false");
    // REP(i,0,l+1){
    //     REP(j,0,4){
    //         cout << dp[0][i][j] << ' ';
    //     }
    //     cout << endl;
    // }
    // CO("true");
    // REP(i,0,l+1){
    //     REP(j,0,4){
    //         cout << dp[1][i][j] << ' ';
    //     }
    //     cout << endl;
    // }
    CO(dp[0][l][K]+dp[1][l][K]);
    return 0;
}

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

#define endl "\n"

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

//REPEAT
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//動的計画法で役に立つ関数
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; }

//最大公約数と最小公倍数
ll gcd(ll a, ll b) {
    if(b==0)return a;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
  ll g = gcd(a, b);
  return a/g*b;
}

vector<vector<long long> > comb(int n) {
  vector<vector<long long> > v(n + 1,vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int X,t;cin >> X >> t;
    cout << max(X-t, 0) << endl;
  
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include <iomanip>
#include <vector>
#include <queue>
#include <functional>
#include <random>
#include <ctime>

using namespace std;
#define RN cout << "\r\n";
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef long long int ll;
typedef pair<ll, ll> P;

// combination
const int MAX = 510000;
const int MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

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

long long COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    ll n, k;
    cin >> n >> k;
    map<ll, ll> map;
    REP(i, n) {
        ll a, b;
        cin >> a >> b;
        if (map.count(a)) {
            map[a] += b;
        } else {
            map[a] = b;
        }
    }
    for (P p: map) {
        k -= p.second;
        if (k <= 0) {
            cout <<  p.first << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
#include<algorithm>
#include<string>
#include <stdlib.h>
using namespace std;
#define         rep(i,n)       for (int i = 0;i<(int)(n);i++)
#define         rep1(i,n)      for (int i = 1;i<=(int)(n);i++)
#define         sajo(str)      sort(str.begin(),str.end())
#define         rsajo(str)     reverse(str.begin(),str.end())
#define         pi             3.14159265359
#define         neli            printf("\n")
#define         gcd(a,b)       __gcd(a,b)
#define         lcm(a,b)       (a/gcd(a,b))*b
#define         yes            cout<<"Yes"<<"\n"
#define         no             cout<<"No"<<"\n"
#define         pf             printf
#define         sf             scanf
#define         pb             push_back
#define         ppb            pop_back
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 2e5+5;
typedef long long int         lli;
typedef long long             ll;
typedef unsigned long long    ull;
typedef double                db;
typedef long double           ldb;

int pos(int arr[], int n, int x)
{
    for (int i = 0; i < n; i++)
        if (arr[i] == x)
            return i+1;
}

int main()
{
    //FIO;
    int a,b,x,y,ans=0,q,n,i,j;
    string s,t;

    cin>>a;
    n=a-2;
    cin>>s;
    for(int i=0;i<n;i++)
    {
        if((s[i]==65) && (s[i+1]==66) && s[i+2]== 67)
        {
            ans++;
            i+=2;
        }
    }
    cout<<ans<<endl;


    return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#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 mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n,a;
  cin>>n>>a;
  int before;
  vector<string>ans;
  vector<int>out;
  rep(i,n){
    char d;
    int b,c,e,f;
    string s1,s2;
    cin>>b>>d>>c>>s1>>e>>d>>f>>s2;
    if(i){
      int after=b*60+c;
      if(after-before>=a){
	ans.pb(s1);
	out.pb(after-before);
      }
    }
    before=e*60+f;
  }
  cout<<ans.size()<<endl;
  rep(i,ans.size())
    cout<<ans[i]<<" "<<out[i]<<endl;
}

Measured memory_bytes: 1236
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
#define N 1000002
const int p=924844033;
struct edge{int to,nxxt;}e[N];
int head[N],cnt=1,n,siz[N],f[N],inv[N],finv[N],fa[N],ct[N],tt[N],rev[N];
int a[N],b[N],c[N];
inline void ins(int u,int v){e[cnt].to=v;e[cnt].nxxt=head[u];head[u]=cnt++;}
void df5(int te,int la)
{siz[te]=1;
	for(int i=head[te];i;i=e[i].nxxt)
	{
		int j=e[i].to;if(j==la)continue;
		fa[j]=te;df5(j,te);siz[te]+=siz[j];
	}
}
inline int C(int nn,int mm)
{
	if(nn<mm)return 0;
	return 1ll*f[nn]*finv[mm]%p*finv[nn-mm]%p;
}
inline int ksm(int d,int k){int ret=1;while(k){if(k&1)ret=1ll*ret*d%p;d=1ll*d*d%p;k>>=1;}return ret;}
inline void ntt(int x[],int len,int mde)
{
	for(int i=0;i<len;i++)if(i<rev[i])swap(x[i],x[rev[i]]);
	for(int i=2;i<=len;i<<=1)
	{
		int wn=ksm(5,(p-1)/i);if(mde<0)wn=ksm(wn,p-2);
		for(int j=0,stp=i>>1;j<len;j+=i)for(int k=j,w=1;k<j+stp;k++,w=1ll*w*wn%p)
		{
			int t1=x[k],t2=1ll*x[k+stp]*w%p;
			x[k]=(t1+t2)%p,x[k+stp]=(t1-t2+p)%p;
		}
	}if(mde<0)for(int i=0,te=ksm(len,p-2);i<len;i++)x[i]=1ll*x[i]*te%p;
}
int main()
{
    scanf("%d",&n);
	f[0]=finv[0]=f[1]=finv[1]=inv[1]=1;
	for(int i=2;i<=500000;i++)
	{
		inv[i]=1ll*(p-p/i)*inv[p%i]%p;
		f[i]=1ll*f[i-1]*i%p;finv[i]=1ll*finv[i-1]*inv[i]%p;
	}
	for(int i=1;i<n;i++)
	{
		int x,y;scanf("%d%d",&x,&y);
		ins(x,y),ins(y,x);
	}
	df5(1,1);
	for(int i=2;i<=n;i++)ct[siz[i]]++;
	for(int i=1;i<=n;i++)tt[n-i]=ct[i];
	for(int i=1;i<=n;i++)ct[i]+=tt[i];
	int len=1;while(len<(n<<1))len<<=1;
	for(int i=1;i<=len;i++){rev[i]=rev[i>>1]>>1;if(i&1)rev[i]|=len>>1;}
	for(int i=1;i<=n;i++)a[i]=1ll*f[i]*ct[i]%p;
	for(int i=0;i<=n;i++)b[i]=finv[n-i];
	ntt(a,len,1);ntt(b,len,1);
	for(int i=0;i<len;i++)a[i]=1ll*a[i]*b[i]%p;
	ntt(a,len,-1);
	for(int i=1;i<=n;i++)a[i]=a[i+n];
	for(int i=1;i<=n;i++)
	{
		int ts=(1ll*n*C(n,i)%p-1ll*finv[i]*a[i]%p+p)%p;
		printf("%d\n",ts);
	}
}


Measured memory_bytes: 36036
#include <bits/stdc++.h>
#if __has_include("debug.h")
#include "debug.h"
#endif
using namespace std;

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

#define pb push_back
#define ff first
#define ss second
#define rep(i, a, b) for (ll i = a; i < b; ++i)
#define rep_(i, a, b) for (ll i = a; i > b; --i)
#define endl '\n'

const ll maxn = 1e5;

// -------------- Arithmetic --------------
const ll mod = 1e9 + 7;

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

ll mod_inv(ll a) {return power(a, mod - 2, mod);}

ll add(ll a, ll b) {return (((a + b) % mod) + mod) % mod;}
ll sub(ll a, ll b) {return (((a - b) % mod) + mod) % mod;}
ll mul(ll a, ll b) {return (((a * b) % mod) + mod) % mod;}
ll div(ll a, ll b) {return mul(a, mod_inv(b));}

// -------------- Code --------------

ll n, m;
ll a[maxn];
vi g[maxn];
string s;
char c;

void solve() {
	cin >> n;
	rep(i, 0, n) cout << "ACL";
	cout << endl;
}

void aux() {
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cout << fixed << setprecision(10);
	aux();
	ll _ = 1;
	// cin >> _;
	while(_--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 6004
#include<iostream>
using namespace std;
typedef long long ll;
int main(){
  string s; 
  ll sum=0,ch[26]={},tmp;
  cin >> s;
  for(int i=0;i<s.size();i++){
    ch[s[i]-'a']++;
  }
  for(int i=0;i<26;i++){
    tmp=0;
    for(int j=0;j<26;j++){
      if(i==j) continue;
      tmp+=ch[j];
    }
    sum += ch[i]*tmp;
  }
  sum/=2;
  cout << sum+1<<endl;
}


Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main(){
  int m;
  int m1 = 0;
  int m2 = 0;
  int m3 = 0;
  while(cin >> m){   
 if(m1<m){
      m3 = m2;     
      m2 = m1;     
      m1 = m;
    }
    else if(m2<m){
      m3 = m2;   
      m2 = m;
    }
    else if(m3<m){
      m3 = m;
    }
  }
  cout << m1 << endl << m2 << endl << m3 <<endl;
  return 0;
}

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

int main(){
  int N,K,num=1;
  cin >> N;
  cin >> K;
  for(int i=0;i<N;i++){
    if(num*2<=num+K){
      num*=2;
    }
    else{
      num+=K;
    }
  }
  cout << num << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;


int T, n, m;

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	cin >> n;
	ll sum = 0, ans = 1ll << 60, mins = 0, seq = 0;
	cin >> sum;
	REP(i, n - 1){
		char op;
		ll x;
		cin >> op >> x;
		sum += x;
		if(op == '-'){
			if(mins){
				ans = min(ans, mins + seq);
			}
			mins += x;
			seq = 0;
		}else seq += x;
	}
	ans = min(ans, mins);
	cout << sum - 2 * ans << endl;
	return 0;
}


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

int main(){
  int r,c,sum;
  cin >> r >>c;
  int* A = new int[c];
  int* FC = new int[c]();

  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      cin >> A[j];
    }
    sum = 0;
    for(int j=0;j<c;j++){
      cout << A[j] << ' ';
      sum += A[j];
      FC[j] += A[j];
      if(j==c-1){
        cout << sum << endl;
      }
    }
  }
  sum = 0;
  for(int i=0;i<c;i++){
    cout << FC[i] << ' ';
    sum += FC[i];
  }
  cout << sum << endl;
}


Measured memory_bytes: 3100
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	word := nextLine()
	if word[2] == word[3] && word[4] == word[5] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


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


int main() {
  ll n, p;
  cin >> n >> p;
  bool odd = 0;
  rep(i, n) {
    int a;
    cin >> a;
    if (a%2 != 0) odd = true;
  }
  if (odd) {
    ll m = pow(2, n-1);
    cout << m << endl;
    return 0;
  }
  if (p == 0) {
    ll m = pow(2, n);
    cout << m << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func mainC() {
    let (X, N) = readTwoInts()
    let numbers = readInts()

    for i in 0...100 {
        let targetA = X - i

        if !numbers.contains(targetA) {
            print(targetA)
            return
        }

        let targetB = X + i
        if !numbers.contains(targetB) {
            print(targetB)
            return
        }
    }

}

mainC()

Measured memory_bytes: 13668
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	a, b, c, d := io.NextInt(), io.NextInt(), io.NextInt(), io.NextInt()
	var out string
	for {
		c -= b
		if c <= 0 {
			out = "Yes"
			break
		}
		a -= d
		if a <= 0 {
			out = "No"
			break
		}
	}
	io.Println(out)
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


Measured memory_bytes: 1776
void main() {
	auto N = ri;
	auto a = N.to!string.map!(i => i.to!string.to!int).sum;
	if(N % a == 0) {
		"Yes".writeln;
	} else {
		"No".writeln;
	}
}

// ===================================

import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
#ifdef __APPLE__
    # include <iostream>
    # include <cmath>
    # include <algorithm>
    # include <stdio.h>
    # include <cstdint>
    # include <cstring>
    # include <string>
    # include <cstdlib>
    # include <vector>
    # include <bitset>
    # include <map>
    # include <queue>
    # include <ctime>
    # include <stack>
    # include <set>
    # include <list>
    # include <random>
    # include <deque>
    # include <functional>
    # include <iomanip>
    # include <sstream>
    # include <fstream>
    # include <complex>
    # include <numeric>
    # include <immintrin.h>
    # include <cassert>
    # include <array>
    # include <tuple>
    # include <unordered_map>
    # include <unordered_set>
    # include <thread>
#else
    # include <bits/stdc++.h>
#endif

#define F first
#define S second
#define MP make_pair
#define PB push_back

#define all(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back
#define fir first
#define sec second

using namespace std;

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

const int max_n = 10000+10, inf = 1000111222;

int ans[max_n];

int main() {
//    freopen("barik.in", "r", stdin);
//    freopen("barik.out", "w", stdout);

    for (int x=1;x<=100;x++){
        for (int y=1;y<=100;y++){
            for (int z=1;z<=100;z++){
                int cur=x*x+y*y+z*z+x*y+y*z+z*x;
                if (cur<max_n){
                    ans[cur]++;
                }
            }
        }
    }

    int n;
    cin>>n;
    for (int i=1;i<=n;i++){
        cout<<ans[i]<<"\n";
    }
}


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


int main() {
  int s,i,owari=0;
  cin>>s;
  vector<int>data(1000000);
  data.at(0)=s;
  for(i=0;owari==0;i++){
    if(data.at(i)%2==0)
      data.at(i+1)=data.at(i)/2;
    else data.at(i+1)=3*data.at(i)+1;
    for(int i2=0;i2<i+1;i2++)
      if(data.at(i+1)==data.at(i2)) owari=1;
  }
  cout << i+1<<endl;
}
  


Measured memory_bytes: 4096
//
//  header_useful.h
//  c++_acm
//
//  Created by 李弘辰 on 2019/7/23.
//  Copyright © 2019 李弘辰. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <vector>
#include <list>
#include <set>
#include <utility> // pair
#include <map>
#include <iostream>
#include <sstream>
#include <algorithm> // sort
#include <string>
#include <stack>
#include <queue>
#include <fstream>

using namespace std;

#define ll long long
#define uchar unsigned char
#define ushort unsigned short
#define uint unsigned int
#define ulong unsigned long
#define ull unsigned long long

#define pi acos(-1)

#define mx(a,b) (a) > (b) ? (a) : (b)
#define mn(a,b) (a) < (b) ? (a) : (b)
#define mem(a,b) memset(a,b,sizeof(a))
#define fre(a) freopen(a,"r",stdin)
#define cio ios::sync_with_stdio(false);

#define itn int
#define nit int
#define inr int
#define mian main
#define ednl endl
#define fro for
#define fir for
#define reutrn return
#define retunr return
#define reutnr return


/* header_useful_h */


int main()
{
    string str;
    cin >> str;
    int ok = 0;
    if (str.size() == 6)
    {
        if (str[2] == str[3] && str[4] == str[5]) ok = 1;
    }
    if (ok) printf("Yes\n");
    else printf("No\n");
    return 0;
}


Measured memory_bytes: 888
n = int(input())
a_list = list(map(int, input().split()))

agents = {}
n_pair = 0

for i, a in enumerate(a_list):
  x = i - a
  if x not in agents:
    agents[x] = 0
  agents[x] += 1

for i, a in enumerate(a_list):
  x = i + a
  if x in agents:
    n_pair += agents[x]
print(n_pair)
    

Measured memory_bytes: 40396
#include <stdio.h>

int main(void)
{
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);

    if(a < b && b < c)
    {
        printf("Yes\n");
    }

    else 
    {
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 580
#include <stdio.h>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
    int N, K;
    NSInteger Q;
    scanf("%d %d %ld", &N, &K, &Q);
    
    long wins[N];
    int i;
    for (i = 0; i < N; i++) {
        wins[i] = 0;
    }
    NSInteger j;
    for (j = 0; j < Q; j++) {
        NSInteger n;
        scanf("%ld", &n);
        wins[n-1] ++;
    }
    
    for (j=0; j < N; j++) {
        if(wins[j] >= Q - K + 1) {
            printf("Yes\n");
        } else {
            printf("No\n");
        }
    }
  	return 0;
}

Measured memory_bytes: 1280
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*----------------------------------------*/
struct UnionFind {
  UnionFind(int sz) : data(sz, -1) {}

  int root(int ver) { return data[ver] < 0 ? ver : data[ver] = root(data[ver]); }

  void unite(int ver1, int ver2) {
    ver1 = root(ver1);
    ver2 = root(ver2);
    if (ver1 != ver2) {
      if (data[ver1] > data[ver2]) swap(ver1, ver2);
      data[ver1] += data[ver2];
      data[ver2] = ver1;
    }
  }

  bool same(int ver1, int ver2) { return root(ver1) == root(ver2); }

  int size(int ver) { return -data[root(ver)]; }

private:
  vector<int> data;
};

using CostType = long long;
struct Edge {
  int src, dst;
  CostType cost;
  Edge(int dst_, CostType cost_ = 0) : src(-1), dst(dst_), cost(cost_) {}
  Edge(int src_, int dst_, CostType cost_) : src(src_), dst(dst_), cost(cost_) {}
};
inline bool operator < (const Edge &lhs, const Edge &rhs) { return lhs.cost < rhs.cost; }
inline bool operator <= (const Edge &lhs, const Edge &rhs) { return lhs.cost <= rhs.cost; }
inline bool operator > (const Edge &lhs, const Edge &rhs) { return lhs.cost > rhs.cost; }
inline bool operator >= (const Edge &lhs, const Edge &rhs) { return lhs.cost >= rhs.cost; }

CostType kruskal(const vector<vector<Edge> > &graph) {
  int sz = graph.size();
  priority_queue<Edge, vector<Edge>, greater<Edge> > que;
  REP(i, sz) for (Edge e : graph[i]) que.emplace(e);
  vector<vector<Edge> > res(sz);
  CostType total = 0;
  UnionFind uf(sz);
  while (!que.empty()) {
    Edge e = que.top(); que.pop();
    if (!uf.same(e.src, e.dst)) {
      res[e.src].emplace_back(e);
      res[e.dst].emplace_back(Edge(e.dst, e.src, e.cost));
      total += e.cost;
      uf.unite(e.src, e.dst);
    }
  }
  // return res;
  return total;
}

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n; cin >> n;
  vector<pair<pair<int, int>, int> > x(n), y(n);
  REP(i, n) {
    int xx, yy; cin >> xx >> yy;
    x[i] = {{xx, yy}, i};
    y[i] = {{yy, xx}, i};
  }
  sort(ALL(x));
  sort(ALL(y));
  vector<vector<Edge> > graph(n);
  REP(i, n-1) {
    long long cost = min(abs(x[i].first.first-x[i+1].first.first), abs(x[i].first.second-x[i+1].first.second));
    int num1 = x[i].second, num2 = x[i+1].second;
    graph[num1].emplace_back(Edge(num1, num2, cost));
  }
  REP(i, n-1) {
    long long cost = min(abs(y[i].first.first-y[i+1].first.first), abs(y[i].first.second-y[i+1].first.second));
    int num1 = y[i].second, num2 = y[i+1].second;
    graph[num1].emplace_back(Edge(num1, num2, cost));
  }
  cout << kruskal(graph) << '\n';
  return 0;
}


Measured memory_bytes: 22128