akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef string str;
static const long long INF = INT64_MAX;
static const long long MOD = (ll)1e9+7;

#define endl "\n"
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i, n) for(ll i=0;i<n;i++)
#define SZ(v) (ll)((v).size())
#define WHOLE(v) (v).begin(), (v).end()
#define ASC(v) sort((v).begin(), (v).end())
#define DESC(v) sort((v).rbegin(), (v).rend())
#define INV(v) reverse((v).begin(), (v).end())
#define FOLDL(src, dst, lambda) partial_sum((src).begin(), (src).end(), (dst).begin(), lambda)
#define FOLDR(src, dst, lambda) INV(src);partial_sum((src).begin(), (src).end(), (dst).begin(), lambda);INV(dst)
#define CUMSUML(src, dst) FOLDL(src, dst, [](auto a, auto b) {return a+b;})
#define CUMSUMR(src, dst) FOLDR(src, dst, [](auto a, auto b) {return a+b;})
#define ACCUM(v, d0, lambda) accumulate((v).begin(), (v).end(), d0, lambda)
#define SUM(v, d0) ACCUM(v, d0, [](auto a, auto b) {return a+b;})
#define ERASE(v, i) v.erase(v.begin() + i)
#define UNIQ(v) ASC(v);v.erase(unique(v.begin(), v.end()), v.end())

template <typename T>void debug(T t) {cerr << t << endl;}
template <typename T, typename ...Args>void debug(T t, Args ...args) {cerr << t << " ";debug(args...);}
template <typename T>void out(T t) {cout << t << endl;}
template <typename T, typename ...Args>void out(T t, Args ...args) {cout << t << " ";out(args...);}

ll dot(vll a, vll b) {
    ll ret = 0;
    REP(i, a.size()) {
        ret += a[i] * b[i];
    }
    return ret;
}

void solve() {
    str s;cin >> s;
    vll a;
    for(auto &v:s) a.push_back(v - '0');
    REP(i, 8) {
        vll ops = {
            1LL,
            (ll)(2 * ((i / 4) - .5)),
            (ll)(2 * (((i % 4) < 2) - 0.5)),
		    (ll)(2 * ((i % 2) - 0.5))
        };
        if(dot(ops, a) == 7) {
            cout << a[0];
            for(int i = 1; i < 4; i++) {
                cout << (ops[i] == 1 ? '+' : '-');
                cout << a[i];
            }
            cout << "=7" << endl;
            return;
        }
    }
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
//#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
const int64 INF = 1LL << 58;
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; }

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

    int H, W, A, B; cin >> H >> W >> A >> B;
    ve_vei board(H, vei(W,0));

    if(A == 0 and B == 0) {
        rep(i,H) {
            rep(j,W) cout << board[i][j];
            cout << endl;
        }
        return 0;
    }
    else if(A == 0) {
        rep(i,B) rep(j,W) board[i][j] = 1;
        rep(i,H) {
            rep(j,W) cout << board[i][j];
            cout << endl;
        }
        return 0;
    }
    else if(B == 0) {
        rep(i,H) rep(j,A) board[i][j] = 1;
        rep(i,H) {
            rep(j,W) cout << board[i][j];
            cout << endl;
        }
        return 0;
    }
    A = W - A; B = H - B;
    rep(i,H) rep(j,W) {
        if( (i / B) % 2 ==  (j / A) % 2 ) board[i][j] = 1;
    }

    rep(i,H) {
        rep(j,W) cout << board[i][j];
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 5248
#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main() {
  string X;
  cin >> X;
  stack<char> ans;
  for (int i = 0; i < X.size(); i++) {
    if (ans.empty() == true) ans.push(X[i]);
    else if (X[i] == 'S') ans.push(X[i]);
    else if (ans.top() == 'S') ans.pop();
    else ans.push(X[i]);
  }
  cout << ans.size() << endl;
  return 0;
}

Measured memory_bytes: 644
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
    int n;
    cin >> n;
    vector<int> data(n);
    rep(i,0,n){
        cin >> data.at(i);
    }
    set<int> color;
    int over=0;
    rep(i,0,n){
        if(data[i]<400){
            color.insert(1);
        }else if(data[i]<800){
            color.insert(2);
        }else if(data[i]<800){
            color.insert(2);
        }else if(data[i]<1200){
            color.insert(3);
        }else if(data[i]<1600){
            color.insert(4);
        }else if(data[i]<2000){
            color.insert(5);
        }else if(data[i]<2400){
            color.insert(6);
        }else if(data[i]<2800){
            color.insert(7);
        }else if(data[i]<3200){
            color.insert(8);
        }else{
            over++;
        }
    }
    if(color.size()==0){
        cout<<1<<" "<<over<<endl;
    }else{
        cout<<color.size()<<" "<<color.size()+over<<endl;
    }
    
    
  return 0;
}

Measured memory_bytes: 3592
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
# import numpy as np
# import scipy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]


def main():
    n,m = inpm()
    if n == m:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Measured memory_bytes: 39148
from heapq import heappop, heappush
import sys

MOD, INF = 1000000007, float('inf')


def solve(s, t, links):
    q = [(0, 0, s, -1, 0), (0, 0, t, -1, 1)]
    visited_fwd, visited_bwd = [INF] * n, [INF] * n
    patterns_fwd, patterns_bwd = [0] * (n + 1), [0] * (n + 1)
    patterns_fwd[-1] = patterns_bwd[-1] = 1
    collision_nodes, collision_links = set(), set()
    limit = 0
    while q:
        cost, cost_a, v, a, is_bwd = heappop(q)
        if is_bwd:
            visited_self = visited_bwd
            visited_opp = visited_fwd
            patterns_self = patterns_bwd
        else:
            visited_self = visited_fwd
            visited_opp = visited_bwd
            patterns_self = patterns_fwd

        relax_flag = False
        cost_preceding = visited_self[v]
        if cost_preceding == INF:
            visited_self[v] = cost
            relax_flag = True
        elif cost > cost_preceding:
            continue

        patterns_self[v] += patterns_self[a]

        cost_opp = visited_opp[v]
        if cost_opp != INF:
            limit = cost + cost_opp
            if cost == cost_opp:
                collision_nodes.add(v)
            else:
                collision_links.add((v, a) if is_bwd else (a, v))
            break

        if relax_flag:
            for u, du in links[v].items():
                nc = cost + du
                if visited_self[u] < nc:
                    continue
                heappush(q, (nc, cost, u, v, is_bwd))

    collision_time = limit / 2
    while q:
        cost, cost_a, v, a, is_bwd = heappop(q)
        if cost > limit:
            break
        visited_self = visited_bwd if is_bwd else visited_fwd
        if visited_self[v] == INF:
            visited_self[v] = cost
        if is_bwd:
            if cost == collision_time:
                patterns_bwd[v] += patterns_bwd[a]
            continue
        if cost_a == collision_time:
            collision_nodes.add(a)
        elif cost == collision_time:
            collision_nodes.add(v)
            patterns_fwd[v] += patterns_fwd[a]
        else:
            collision_links.add((a, v))

    shortest_count = 0
    collision_count = 0

    for v in collision_nodes:
        if visited_fwd[v] == visited_bwd[v]:
            r = patterns_fwd[v] * patterns_bwd[v]
            shortest_count += r
            shortest_count %= MOD
            collision_count += r * r
            collision_count %= MOD

    for u, v in collision_links:
        if visited_fwd[u] + visited_bwd[v] + links[u][v] == limit:
            r = patterns_fwd[u] * patterns_bwd[v]
            shortest_count += r
            shortest_count %= MOD
            collision_count += r * r
            collision_count %= MOD

    return (shortest_count ** 2 - collision_count) % MOD


n, m = map(int, input().split())
s, t = map(int, input().split())
s -= 1
t -= 1
links = [{} for _ in range(n)]
for uvd in sys.stdin.readlines():
    u, v, d = map(int, uvd.split())
    # for _ in range(m):
    #     u, v, d = map(int, input().split())
    u -= 1
    v -= 1
    links[u][v] = d
    links[v][u] = d
print(solve(s, t, links))


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

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            new Main().solve(sc);
        }
    }

    void solve(Scanner sc) {
        long x = sc.nextLong();
        long ans = 2 * (x / 11);
        long remain = x % 11;
        if (remain == 0) {
            System.out.println(ans);
        } else if (remain <= 6) {
            System.out.println(ans + 1l);
        } else {
            System.out.println(ans + 2l);
        }
    }
}


Measured memory_bytes: 21972
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    int num;
    string str;
    cin >> num >> str;

    string w = ".",b = "#";

    int change[210000] ={};

    string check = w;
    int current = 0;
    for (int i = 0; i< num; i++){
        if(str.substr(i,1)==check){
            change[current] ++;
        }else{
            if(check == w){
                check = b;
            }else{
                check = w;
            }
            current ++;
            change[current] ++;
        }
    }
    
    if(check == w){
        check = b;
        current ++;
        change[current] = 0;
    }


    int ans = 0;
    for(int i = 1;i<current;){
        ans += change[i];
        i += 2;
    }
    int sum = ans;
    for(int i = current-1;i>=0;){
        sum += change[i];
        sum -= change[i-1];
        if(sum < ans){
            ans = sum;
        }
        i -=2;
    }

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

Measured memory_bytes: 1412
using System;
using System.Linq;

namespace _0526
{
	class Program
	{
		static void Main(string[] args)
		{
			while (true)
			{
				int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
				if (x.Max() == 0) break;
				long[,] edge = new long[x[0], x[0]];
				for (int i = 0; i < x[0]; i++)
					for (int j = 0; j < x[0]; j++)
						if (i != j) edge[i, j] = 1145141919;
				for (int i = 0; i < x[1]; i++)
				{
					int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
					a[1]--; a[2]--;
					if (a[0] == 0)
					{
						long ret = edge[a[1], a[2]];
						Console.WriteLine(ret < 1145141919 ? ret : -1);
					}
					else
					{
						for (int j = 0; j < x[0]; j++)
						{
							for (int k = 0; k < x[0]; k++)
							{
								edge[j, k] = Math.Min(edge[j, k],
									Math.Min(edge[j, a[1]] + a[3] + edge[a[2], k],
											 edge[j, a[2]] + a[3] + edge[a[1], k]));
							}
						}
					}
				}
			}
		}
	}
}


Measured memory_bytes: 18300
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
  double a, b, x, tanth;
  cin >> a >> b >> x;
  double h=2.0*x/pow(a, 2.0)-b;
  if(h<0){
    double w=a-2*x/(a*b);
    tanth=b/(a-w);
  }
  else{
    tanth=(b-h)/a;
  }
  cout << fixed << setprecision(7) << atan(tanth)*180.0/M_PI;
  return 0;
}

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

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

#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (ll(i) = (s); (i) > (e); (i)--)
#define debug(x) cout << #x << ": " << x << endl
#define mp make_pair
#define pb push_back
const ll MOD = 1000000007;
const int INF = 1e9;
const ll LINF = 1e16;
const double PI = acos(-1.0);
int dx[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };
int dy[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2017/04/15  Problem: ARC 013 B / Link: http://arc013.contest.atcoder.jp/tasks/arc013_b  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

vector<int >G[100100];
bool node[100100];
vector<ll>ans;
vector<ll>ans2;
void dfs(int v, int f) {
	node[v] = true;
	ans.push_back(v);
	bool flag = false;
	FOR(i, 0, G[v].size()) {
		if (flag == false) {
			if (node[G[v][i]] == false) {
				dfs(G[v][i], v);
				flag = true;
			}
		}
		else return;
	}
	return;
}
void dfs2(int v, int f) {
	node[v] = true;
	if (f != 0)
		ans2.push_back(v);
	bool flag = false;
	FOR(i, 0, G[v].size()) {
		if (flag == false) {
			if (node[G[v][i]] == false) {
				dfs2(G[v][i], v);
				flag = true;
			}
		}
		else return;
	}
	return;
}
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	ll N, M;
	FOR(i, 0, 100100) {
		node[i] = false;
	}
	cin >> N >> M;
	FOR(i, 0, M) {
		int a, b;
		cin >> a >> b;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	int p = 1;
	FOR(i, 1, N + 1) {
		if (G[i].size() == 1)p = i;
	}
	dfs(p, 0);
	dfs2(p, 0);
	
	cout << (int)ans.size() + (int)ans2.size() << endl;
	FORR(i, (int)ans2.size()-1,-1) {
		cout <<ans2[i]<< " ";
	}
	FOR(i, 0, (int)ans.size()) {
		cout << ans[i];
		if (ans.size() - 1 != i)cout << " ";
	}

	cout << endl;
	return 0;
}


Measured memory_bytes: 12020
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
//#define EPS 0.000000001
using namespace std;

#define EPS 0.0000000001

int N;

struct Line{
	double x1,y1,x2,y2;
};

struct Point{
	void set(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}
	double x,y;
};

Point calc_Cross_Point(double x1,double x2,double x3,double x4,double y1,double y2,double y3,double y4){
	Point ret;
	ret.x = ((x2-x1)*(y3*(x4-x3)+x3*(y3-y4))-(x4-x3)*(y1*(x2-x1)+x1*(y1-y2)))/((y2-y1)*(x4-x3)-(y4-y3)*(x2-x1));
	if(x1 != x2){
		ret.y = ((y2-y1)*ret.x+y1*(x2-x1)+x1*(y1-y2))/(x2-x1);
	}else{
		ret.y = ((y4-y3)*ret.x+y3*(x4-x3)+x3*(y3-y4))/(x4-x3);
	}
	return ret;
}

int func(double x1,double y1,double x2, double y2, double xp, double yp){
	double naiseki,norm1,norm2,gaiseki;
	norm1 = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	norm2 = sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));
	naiseki = (xp-x1)*(x2-x1)+(yp-y1)*(y2-y1);
	gaiseki = (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1);
	if(gaiseki > EPS){
		return 1;
	}else if(gaiseki < -EPS){
		return -1;
	}
	if(naiseki < -EPS){
		return 2;
	}

	if(norm1 < norm2){
		return -2;
	}
	return 0;
}

double calc_len(Point a,Point b){
	return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}


void func(){

	vector<Line> L;

	int ans = 1,tmp_count;

	Point tmp_point;
	bool FLG;

	for(int loop = 0; loop < N; loop++){
		vector<Point> P;
		Line tmp;
		scanf("%lf %lf %lf %lf",&tmp.x1,&tmp.y1,&tmp.x2,&tmp.y2);

		tmp_count = 0;

		for(int i = 0; i < L.size(); i++){
			if(func(L[i].x1,L[i].y1,L[i].x2,L[i].y2,tmp.x1,tmp.y1)*func(L[i].x1,L[i].y1,L[i].x2,L[i].y2,tmp.x2,tmp.y2) <= 0 &&
					func(tmp.x1,tmp.y1,tmp.x2,tmp.y2,L[i].x1,L[i].y1) * func(tmp.x1,tmp.y1,tmp.x2,tmp.y2,L[i].x2,L[i].y2) <= 0){

				tmp_point = calc_Cross_Point(L[i].x1,L[i].x2,tmp.x1,tmp.x2,L[i].y1,L[i].y2,tmp.y1,tmp.y2);

				FLG = true;

				if(tmp_point.x == -100.0 || tmp_point.x == 100.0 || tmp_point.y == -100.0 || tmp_point.y == 100.0){
					FLG = false;
				}

				if(FLG){
					for(int k = 0; k < P.size(); k++){
						if(calc_len(tmp_point,P[k]) < EPS){
							FLG = false;
							break;
						}
					}
				}
				if(FLG){
					tmp_count++;
					P.push_back(tmp_point);
				}
			}
		}
		ans += (tmp_count+1);
		L.push_back(tmp);
	}

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

int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}

Measured memory_bytes: 3228
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <vector>
using namespace std;

#define bll long long
#define dou double
#define For(i,a,b) for (int i=(a),_##i=(b); i<=_##i; ++i)
#define Rof(i,a,b) for (int i=(a),_##i=(b); i>=_##i; --i)
#define Mem(a,b) memset(a,b,sizeof(a))
#define Cpy(a,b) memcpy(a,b,sizeof(b))

int main()
{
    int a,b,c,d;
    for (; scanf("%d%d%d%d",&a,&b,&c,&d)!=EOF; )
    {
        if (a+b<c+d)
            printf("Right\n");
        else if (a+b==c+d)
            printf("Balanced\n");
        else
            printf("Left\n");
    }
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,ans=1;cin>>n;
	for(int i=2;i<35;i++)
	{
		int x=i*i;if(x>n) break;
		while(x*i<=n) x*=i;
		if(x>ans) ans=x;
	}
    cout<<ans;
	return 0;
}

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;

vll G[100005];
ll dist[100005];

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n,k; cin>>n>>k;
  rep(i,n-1){
    ll a,b; cin>>a>>b; a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  
  queue<pll> q;
  q.emplace(0,0);
  fill(dist,dist+n,-1);
  dist[0]=k;
  
  while(!q.empty()){
    auto p=q.front(); q.pop();
    ll v=p.first, c=p.second;
    ll color;
    if(c==0) color=k;
    else color=k-1;
    for(auto nv: G[v]){
      if(dist[nv]==-1){
        dist[nv]=--color;
        q.emplace(nv,c+1);
        // cout<<nv<<endl;
      }
    }
  }
  ll ans=1;
  rep(i,n){
    ans*=dist[i];
    ans%=MOD;
  }
  cout<<ans<<endl;
  
}

Measured memory_bytes: 8948
#include <iostream>
//#include <stdio.h>

int main(int argc, char const* argv[])
{
	int a, b;
	std::cin >> a >> b;
	//scanf('%d %d);' 
	if (a < b) {
		std::cout << "a < b" << std::endl;
	} else if (a == b) {
		std::cout << "a == b" << std::endl;
	} else if (a > b) {
		std::cout << "a > b" << std::endl;
	}

	return 0;
}



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

#define what_is(x)    cerr<<#x<<" is "<<x<<"\n";
#define rep(i,a,n)    for(int i=a; i<=n; ++i)
#define rep1(i,a,n)   for(int i=a; i>=n; --i)
#define pb            push_back
#define mp            make_pair
#define int           long long
#define fr            first
#define sc            second
#define vc            vector
#define all(x)        (x).begin(),(x).end()
#define rall(x)       (x).rbegin(),(x).rend()
#define M             1000000007
#define MM            998244353
#define PI            3.14159265358979

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

int n,k,ans; string str;

int solve(){
    cin>>n>>k;
    rep(i,0,n-1){
        int a; cin>>a;
        if(a>=k) ans++;
    }
    cout<<ans;
    return 0;
}

signed main() {
    ios::sync_with_stdio(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    //cin>>t;
    while(t--) solve();
    return 0;
}

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

int main()  
{  
    long long int n, num;
    cin>>n;
    if(n%2!=0) {
        cout<<0;
    } else {
        long long int x=0, i=1;
        num=n;
        n/=10;
        while(1) {
            long long int p = pow(5,i);
            if(n>=p)
                x+=n/p;
            else
                break;
            i++;
        }
        x+=num/10;
        cout<<x;
    }
}  

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //  repマクロ
#define leng(n) (int)(log10(n)+1)  //  桁数
using namespace std;

signed main() {
  int n;
  cin >> n;
  if (n==1) cout << "Hello World" << endl;
  if (n==2) {
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
  }
}

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef unsigned long long ull;
typedef long double ld; 
typedef tuple<int,int,int> State;

ll mod = 1e9 + 7;

#define citc(tc) int tc; cin>>tc; while(tc--){solve();}
#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinai(a, n) vi a(n); rep(i, n) { cin>>a[i]; }
#define cinal(a, n) vl a(n); rep(i, n) { cin>>a[i]; }
#define coutai(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define coutal(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define ent cout<<endl;

void solve()
{
	string s;
	cin>>s;
	int a = 0;
	rep(i, s.length()/2)
	{
		if(s[2*i] == 'h' and s[2*i+1] == 'i')
			a++;
	}
	if(a*2 == s.length())
		cout<<"Yes\n";
	else
		cout<<"No\n";
}
int main()
{
	fastio();
	// citc(tc);
	solve();
}

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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;

int main(){
    int N;
    string W[110];
    cin >> N;
    rep(i, N) cin >> W[i];

    rep(i, N-1){
        FOR(j, i+1, N){
            if(W[i] == W[j]){
                cout << "No" << endl;
                return 0;
            }
        }
    }

    rep(i, N-1){
        if(W[i][W[i].size()-1] != W[i+1][0]){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 256
//Name-Deepesh Bhatt
//Institute-IIT Dhanbad

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

ll gcd(ll a,ll b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}
ll lcm(ll a ,ll b)
{
    return a/gcd(a,b)*b;
}
ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
int main()
{
    ios_base::sync_with_stdio(false);    //for fast I/O operation
    cin.tie(NULL);
    ll t;
    t=1;
    while(t--) {
        int l;
        cin>>l;
        double s=l/3.0;
        cout<<setprecision(30)<<s*s*s;
    }
    return 0;
}

Measured memory_bytes: 256
MOD=10**9+7
cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end

def bs(ar,eq,n) en=(eq==1 ? :>= : :>); ar.bsearch_index{|x|x.send(en,n)} end
def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end

def puts_yesno(can) puts(can ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n=gi
a=gsmi

a.each do |i|
  next if i==1

  while true do
    if i%2==0
      cnt+=1
      i/=2
    else
      break
    end
  end
end

puts cnt

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

int64_t solve(int64_t n){
  int64_t ans=0;
  ans=(n-1)*n/2;
  return ans;
}

int main(){
  int64_t n;
  cin >> n;
  cout << solve(n) << endl;
  return 0;
}

Measured memory_bytes: 3612
N = int(input())
S = (input() for i in range(N))
c0, c1, c2, c3 = 0, 0, 0, 0
for i in S:
    if i == 'AC':
        c0 += 1 
    if i == 'WA':
        c1 += 1
    if i == 'TLE':
        c2 += 1
    if i == 'RE':
        c3 += 1
print('AC','x',c0)
print('WA','x',c1)
print('TLE','x',c2)
print('RE','x',c3)

Measured memory_bytes: 9208
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <iomanip>
#define ll long long int
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};
int mx2[] = {1,0};
int my2[] = {0,1};

class AGoodInteger {
public:
	void solve(istream& in, ostream& out) {
        string s; in >> s;
        if(s[0] == s[1] && s[1] == s[2]) out << "Yes" << endl;
        else if(s[1] == s[2] && s[2] == s[3]) out << "Yes" << endl;
        else out << "No" << endl;
	}
};

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

Measured memory_bytes: 256
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	distance_table := [][]int{
		{0, 6, 13, 18, 23, 43, 58},
		{6, 0, 7, 12, 17, 37, 52},
		{13, 7, 0, 5, 10, 30, 45},
		{18, 12, 5, 0, 5, 25, 40},
		{23, 17, 10, 5, 0, 20, 35},
		{43, 37, 30, 25, 20, 0, 15},
		{58, 52, 45, 40, 35, 15, 0},
	}
	toll_table := [][]int{
		{0, 300, 500, 600, 700, 1350, 1650},
		{300, 0, 350, 450, 600, 1150, 1500},
		{500, 350, 0, 250, 400, 1000, 1350},
		{600, 450, 250, 0, 250, 850, 1300},
		{700, 600, 400, 250, 0, 600, 1150},
		{1350, 1150, 1000, 850, 600, 0, 500},
		{1650, 1500, 1350, 1300, 1150, 500, 0},
	}
	for scanner.Scan() {
		d, _ := strconv.Atoi(scanner.Text())
		if d == 0 {
			break
		}
		d--
		scanner.Scan()
		dbuf := strings.Split(scanner.Text(), " ")
		dh, _ := strconv.Atoi(dbuf[0])
		dm, _ := strconv.Atoi(dbuf[1])
		dtime := 100*dh+dm
		scanner.Scan()
		a, _ := strconv.Atoi(scanner.Text())
		a--
		scanner.Scan()
		abuf := strings.Split(scanner.Text(), " ")
		ah, _ := strconv.Atoi(abuf[0])
		am, _ := strconv.Atoi(abuf[1])
		atime := 100*ah+am
		toll := toll_table[d][a]
		if distance_table[d][a] <= 40 &&
			1730 <= dtime && dtime <= 1930 ||
			1730 <= atime && atime <= 1930 {
				toll = ((toll/2-1)/50+1)*50
		}
		fmt.Println(toll)
	}
}



Measured memory_bytes: 1084
N = int(input())
S = input()

U = S.count('R') * S.count('G') * S.count('B')

for i in range(N):
    for j in range(i+1, N):
        k = 2 * j - i
        if k >= N:
            break
        elif S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            U -= 1
print(U)


Measured memory_bytes: 9128
/*
 _____ _             _              _           _ 
|_   _| |__   ___   / \   _ __  ___| |__  _   _| |
  | | | '_ \ / _ \ / _ \ | '_ \/ __| '_ \| | | | |
  | | | | | |  __// ___ \| | | \__ \ | | | |_| | |
  |_| |_| |_|\___/_/   \_\_| |_|___/_| |_|\__,_|_|                                                

*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x) 	for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define max(a,b)	(a>b?a:b)
#define min(a,b)	(a<b?a:b)

/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_is(x)  cerr << #x << " is " << x << endl;

std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define DECIMAL(n)  cout << fixed ; cout << setprecision(n);
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  100005

void solve()
{
	ll x,y;
	cin>>x>>y;
	if(y&1) {
		cout<<"No\n";
		return;
	}
	y/=2;
	ll b=y-x;
	ll a=x-b;
	cout<<((a>=0 && b>=0)?"Yes":"No")<<endl;
	return;
}
int main()
{
	FAST
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		solve();
	}
	TIME
	return 0;
}

Measured memory_bytes: 3804
class Dice():
    
    def __init__(self,d1,d2,d3,d4,d5,d6):
        self.d1=d1
        self.d2=d2
        self.d3=d3
        self.d4=d4
        self.d5=d5
        self.d6=d6
    
    def roll(self,c):
        if c=='N':
            self.d1,self.d5,self.d6,self.d2=self.d2,self.d1,self.d5,self.d6
        elif c=='S':
            self.d1,self.d5,self.d6,self.d2=self.d5,self.d6,self.d2,self.d1
        elif c=='E':
            self.d1,self.d3,self.d6,self.d4=self.d4,self.d1,self.d3,self.d6
        elif c=='W':
            self.d1,self.d3,self.d6,self.d4=self.d3,self.d6,self.d4,self.d1
        elif c=='R':
            self.d2,self.d3,self.d5,self.d4=self.d4,self.d2,self.d3,self.d5
        elif c=='L':
            self.d2,self.d3,self.d5,self.d4=self.d3,self.d5,self.d4,self.d2
    
    def minnum(self):
        return min(self.d1,self.d2,self.d3,self.d4,self.d5,self.d6)
        
    def min2num(self):
        return min(self.d2,self.d3,self.d4,self.d5,self.d6)
        
    def rolling(self):
        m=self.minnum()
        if m==self.d3:
            self.roll('W')
        elif m==self.d6:
            self.roll('E')
            self.roll('E')
        elif m==self.d4:
            self.roll('E')
        elif m==self.d2:
            self.roll('N')
        elif m==self.d5:
            self.roll('S')
        m=self.min2num()
        if m==self.d3:
            self.roll('L')
        elif m==self.d5:
            self.roll('L')
            self.roll('L')
        elif m==self.d4:
            self.roll('R')
            
    def returnlist(self):
        l=[self.d1,self.d2,self.d3,self.d4,self.d5,self.d6]
        return l
    
a,b,c,d,e,f=map(int,input().split())
D=Dice(a,b,c,d,e,f)
a,b,c,d,e,f=map(int,input().split())
D2=Dice(a,b,c,d,e,f)
D.rolling()
D2.rolling()
if D.returnlist()==D2.returnlist():
    print("Yes")
else:
    print("No")


Measured memory_bytes: 5620
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A=sc.nextInt(), B=sc.nextInt(), X=sc.nextInt();
    if(A>X) {
      System.out.println("NO");
    } else if(X-A>B) {
      System.out.println("NO");
    } else {
      System.out.println("YES");
    }
  }    
}


Measured memory_bytes: 35684
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;

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;


void main() {
    auto d = ['A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'];
    char a;
    scan(a);
    writeln(d[a]);
}


























int[][] readGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new int[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v;
        scan(u, v);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= v;
        if (isUndirected) {
            adj[v] ~= u;
        }
    }

    return adj;
}

alias Edge = Tuple!(int, "to", int, "cost");

Edge[][] readWeightedGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new Edge[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v, c;
        scan(u, v, c);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= Edge(v, c);
        if (isUndirected) {
            adj[v] ~= Edge(u, c);
        }
    }

    return adj;
}

void yes(bool b) {
    writeln(b ? "Yes" : "No");
}

void YES(bool b) {
    writeln(b ? "YES" : "NO");
}

T[] readArr(T)() {
    return readln.split.to!(T[]);
}

T[] readArrByLines(T)(int n) {
    return iota(n).map!(i => readln.chomp.to!T).array;
}

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

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


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

#define    ll     long long int

string s, t, mx;

int isOk(string a, string b)
{
    int i, l = (int) a.size();
    for (i = 0; i < l; i++) {
        if (a[i] == '?' || a[i] == b[i]) {
            continue;
        }
        return 0;
    }
    return 1;
}

string makeIt(string s)
{
    int i, l = (int) s.size();
    for (i = 0; i < l; i++) {
        if (s[i] == '?')
            s[i] = 'a';
    }
    return s;
}

int main( )
{
    int ls, lt, i, j, k;
    for (i = 0; i < 52; i++) {
        mx.push_back('z');
    }
    cin >> s >> t;
    ls = (int) s.size();
    lt = (int) t.size();
    for (i = 0; i + lt - 1 < ls; i++) {
        string sub = s.substr(i, lt);
        //cout << sub << ' ' << t << '\n';
        if (isOk(sub, t)) {
            string tmp = s.substr(0, i) + t + s.substr(i + lt, ls - lt - i);
            mx = min(mx, makeIt(tmp));
        }
    }
    if ((int) mx.size() > ls ) {
        cout << "UNRESTORABLE\n";
    }
    else {
        cout << mx << '\n';
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
using namespace std;

#define mp make_pair
#define fi first
#define se second
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) (((a) * (b)) / (__gcd((a), (b))))
#define in_range(x, y, r, c) (x < r && y < c && x >= 0 && y >= 0)
#define setbits(x) __builtin_popcountll(x)
#define unsetend(x) __builtin_ctzll(x)
#define unsetfront(x) __builtin_clzll(x)
#define f first
#define s second
#define pb push_back
#define pf push_front
#define ll long long
#define endl "\n"
#define Endl "\n"

// long long expo(long long a, long long b, long long mod)
// {
//     ll ret = 1;
//     while (b > 0)
//     {
//         if (b % 2 == 1)
//             ret = (((ret)%mod) * ((a)%mod))%mod;
//
//         a = ((a)%mod) * ((a)%mod)%mod;
//         b = b / 2;
//     }
//     return (ret%mod);
// }

// vector<long long> seive()
// {
//    long long i,j;
//    vector<long long> hash(1000001,1);
//    vector<long long> primes;
//
//    for(i=2;i*i<=1000000;i++)
//    {
//        if(hash[i])
//        {
//            for(j=i*i;j<=1000000;j+=i)
//            hash[j]=0;
//        }
//    }
//    for(i=2;i<1000001;i++)
//    {
//        if(hash[i])
//        primes.pb(i);
//    }
//    return primes;
// }

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

    int i, j, n, m, mod = 1e9 + 7;
    cin >> n >> m;
    char arr[n][m];
    int dp[n][m];

    for (i = 0; i < n; i++)
    {
        for (j = 0; j < m; j++)
        {
            cin >> arr[i][j];
            dp[i][j] = 0;
        }
    }

    dp[0][0] = 1; //up,left

    for (i = 0; i < n; i++)
    {
        for (j = 0; j < m; j++)
        {
            if (i == 0 && j == 0)
                dp[i][j] = 1;
            else
            {
                if (arr[i][j] != '#')
                {
                    if (in_range(i - 1, j, n, m))
                        dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
                    if (in_range(i, j - 1, n, m))
                        dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
                }
            }
        }
    }
    cout << dp[n - 1][m - 1] << endl;
}


Measured memory_bytes: 8464
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<iomanip>
using namespace std;

int main() {
    int N; cin >> N;
    vector<int> B(N - 1);
    for (int i = 0; i < N - 1; i++) cin >> B[i];

    vector<int> A(N);
    A[0] = B[0];
    for (int i = 0; i < N - 2; i++) {
        if (B[i] < B[i + 1]) A[i + 1] = B[i];
        else A[i + 1] = B[i + 1];
    }
    A[N - 1] = B[N - 2];

    long long sum = 0;
    for (int i = 0; i < N; i++) sum += A[i];
    cout << sum << endl;
}


Measured memory_bytes: 256
#include <cstdio>
 
int main(){
    int x,y;
    while(true){
        scanf("%d %d",&x,&y);
        if(x == 0 && y == 0){
            break;}
        if(x > y) printf("%d %d\n",y,x);
        else{
            printf("%d %d\n",x,y);
        }
    }
    return 0;
}


Measured memory_bytes: 2708
/*
 *  solution very similar to editorial
 */
import java.io.*;
import java.util.*;

public class Main{


	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner();
		PrintWriter out=new PrintWriter(System.out);
		long k=sc.nextLong();
		int n=50;
		long x=k/n;
		long []a=new long [n];
		for(int i=0;i<n;i++)
			a[i]=i+x;
		int rem=(int) (k%n);
		for(int i=0;i<rem;i++) {
			a[i]+=n;
			for(int j=0;j<n;j++)
				if(j!=i)
					a[j]--;
			
		}
		out.println(n);
		for(long z:a)
			out.print(z+" ");

		out.close();
	}
	
	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;
		Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		Scanner(String fileName) throws FileNotFoundException{
			br=new BufferedReader(new FileReader(fileName));
		}
		String next() throws IOException {
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		String nextLine() throws IOException {
			return br.readLine();
		}
		int nextInt() throws IOException{
			return Integer.parseInt(next());
		}
		long nextLong()  throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}
	}
	
}



Measured memory_bytes: 23252
n = int(input())
a = list(map(int,input().split()))
color = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
num = [0]*9
for i in a:
    for j in range(9):
        if i<=color[j]:
            num[j]+=1
            break
s = [1 for i in num[:8] if i>0]
print(max(sum(s), 1), sum(s)+num[8])

Measured memory_bytes: 3064
#include <stdio.h>

int main(void)
{

  int i, j, tmp;

  int price[1001];

  int variety, total, sum = 0;
  scanf("%d", &total);
  scanf("%d", &variety);
  for (i = 0; i < total; i++)
  {
    scanf("%d", &price[i]);
  }

  for (i = 0; i < total; ++i)
  {
    for (j = i + 1; j < total; ++j)
    {
      if (price[i] > price[j])
      {
        tmp = price[i];
        price[i] = price[j];
        price[j] = tmp;
      }
    }
  }

  for (i = 0; i < variety; i++)
  {
    sum += price[i];
  }
  printf("%d\n", sum);

  return 0;
}


Measured memory_bytes: 1740
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char s[51],skn[51],t[51];
    int lens,lent,i,j,k,flag;
    scanf("%s",skn);
    scanf(" %s",t);
    lens=strlen(skn);
    lent=strlen(t);
    if (lent>lens) printf("UNRESTORABLE");
    else
    {
        for (i=0;i<=lens-lent;i++)
        {
            for (flag=1,j=lens-1-i,k=lent-1;k>=0;j--,k--)
            {
                if (skn[j]=='?') continue;
                if (skn[j]!=t[k])
                {
                    flag=0;
                    break;
                }
            }
            if (flag==1)
            {
                strcpy(s,skn);
                for (j=lens-1-i,k=lent-1;k>=0;j--,k--)
                    s[j]=t[k];
                for (j=0;j<lens;j++)
                    if (s[j]=='?') s[j]='a';
                puts(s);
                exit(0);
            }
        }
        printf("UNRESTORABLE");
    }
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
        string x,y;
        cin>>x>>y;
        sort(x.begin(),x.end());
        sort(y.begin(),y.end(),greater <int>());
        if(x<y){
                cout<<"Yes";
        }
        else{
                cout<<"No";
        }
}

Measured memory_bytes: 256
#include<string>
#include<iostream>
#include <algorithm>
#include<vector>
#include<functional>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <numeric>
#define ll long long
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
using namespace std;

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

int main() {
	ll K, ans = 0;
	cin >> K;
	for (int a = 1; a < K + 1; a++) {
		for (int b = 1; b < K + 1; b++) {
			for (int c = 1; c < K + 1; c++) {
				int ab = gcd(a, b);
				int abc = gcd(ab, c);
				ans += abc;
				
				
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio();
    cin.tie(0);
    
    int x;
    
    cin >> x;
    
    
    if(x>=30)
        cout<<"Yes";
    else
        cout<<"No";
        
    return 0;
}

Measured memory_bytes: 3584
#include <stdio.h>
#include <string.h>

int main(void){
    int kane=700,i;
    char s[4];
    scanf("%s",s);
    for(i=0;i<3;i++){
        if(s[i]=='o')kane+=100;
    }
    printf("%d\n",kane);
    return 0;
}


Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
	private static final int MOD = (int)Math.pow(10, 9);
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		int[][] ab = new int[n][2];
		
		for (int i = 0; i < n; i++) {
			ab[i][0] = sc.nextInt();
			ab[i][1] = sc.nextInt();
		}
		
		Arrays.sort(ab, (a, b) -> Integer.compare(a[1], b[1]));
		/* for (int i = 0; i < n; i++) {
			System.out.println(ab[i][0] + " " + ab[i][1]);
		}*/
		
		String res = "Yes";
		int total = 0;
		
		for (int i = 0; i < n; i++) {
			total += ab[i][0];
			if (total > ab[i][1]) {
				res = "No";
			}
		}
		System.out.println(res);
	}
	
	static class FastReader {
	    BufferedReader br;
	    StringTokenizer st;
	
	    public FastReader() {
	      br = new BufferedReader(new InputStreamReader(System.in));
	    }
	  
	    String next() { 
	      while (st == null || !st.hasMoreElements()) {
	        try {
	          st = new StringTokenizer(br.readLine());
	        } catch (IOException  e) {
	          e.printStackTrace();
	        }
	      }
	      return st.nextToken();
	    }
	
	    int nextInt() {
	      return Integer.parseInt(next());
	    }
	
	    long nextLong() {
	      return Long.parseLong(next());
	    }
	
	    double nextDouble() { 
	      return Double.parseDouble(next());
	    }
	
	    String nextLine() {
	      String str = "";
	        try{
	            str = br.readLine();
	        } catch (IOException e) {
	            e.printStackTrace();
	        }
	        return str;
	      }
	  }
}


Measured memory_bytes: 53428
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int m = Integer.parseInt(str.substring(5, 7));
		int d = Integer.parseInt(str.substring(8, 10));
		if (m >= 5 || (m >= 4 && d > 30)) {
			System.out.println("TBD");
		} else {
			System.out.println("Heisei");
		}
	}
}


Measured memory_bytes: 19796
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
template<class T>
vector<pair<T, int>> rle(vector<T> vec) {
	vector<pair<T, int>> ans;
	ans.emplace_back(vec.front(), 1);
	for (int i = 1; i < vec.size(); i++) {
		if (vec[i] == ans.back().first)
			ans.back().second++;
		else
			ans.emplace_back(vec[i], 1);
	}
	return ans;
}
signed main(){
    int n;
    cin>>n;
    vector<char>s(n);
    for(int i=0;i<n;i++)
        cin>>s[i];
    cout<<rle(s).size()<<endl;
}


Measured memory_bytes: 2676
#include <string>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <stdlib.h>
#include <algorithm>
#include <list>
#include <math.h>

using namespace std;

int main(void){
	int i,j,k,n,m[100001];
	scanf("%d" ,&n);
	for(i=1;i<=n;i++){
		scanf("%d" ,&m[i]);
	}
	int ans=0;
	for(i=1;i<=n;i++){
		if(m[i] != -1 && m[m[i]]==i){
			ans++;
			m[i]=-1;
			m[m[i]]=-1;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 640