akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000000
#define EPS 1e-10
#define PI 3.141592653589793238
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define double long double
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;
typedef complex<double> com;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }

ll mod = 1000000007;
ll modsize = 900010;

ll modinv(ll a) {
	ll b = mod, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= mod;
	if (u < 0) u += mod;
	return u;
}

ll modpow(ll a, ll b) {
	ll ans = 1;
	a %= mod;
	while (b) {
		if (b & 1) ans = ans * a%mod;
		a = a * a%mod;
		b >>= 1;
	}
	return ans;
}

vector<ll> fac(modsize + 5);
vector<ll> inv(modsize + 5);
vector<ll> facinv(modsize + 5);

void modcalc() {
	fac[0] = fac[1] = 1; inv[1] = 1;
	facinv[0] = facinv[1] = 1;
	for (int i = 2; i < modsize; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod / i) % mod;
		facinv[i] = facinv[i - 1] * inv[i] % mod;
	}
}

ll modcomb(ll n, ll k) {
	if (n < 0 || k < 0 || n < k) return 0;
	return fac[n] * facinv[k] % mod * facinv[n - k] % mod;
}

ll modperm(ll n, ll k) {
	if (n < 0 || k < 0 || n < k) return 0;
	return fac[n] * facinv[n - k] % mod;
}

ll modhom(ll n, ll k) {
	if (n < 0 || k < 0) return 0;
	if (n == 0 && k == 0) return 1;
	return modcomb(n + k - 1, k);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	modcalc();

	int a, b, c;
	cin >> a >> b >> c;
	int ans = 0;
	int p = 1;
	rep(i, b + c + 1) {
		int cnt = modpow(3, b + c - i);
		cnt *= modcomb(a + i - 1, a - 1); cnt %= mod;
		cnt *= p; cnt %= mod;
		ans += cnt; if (ans > mod) ans -= mod;
		p *= 2; p += 2 * mod;
		p -= modcomb(i, b); p -= modcomb(i, c); p %= mod;
	}
	cout << ans << endl;
}

Measured memory_bytes: 21376
<?php

$line[] = fgets(STDIN);
$param = $line[0];
$array = [
    1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
];

echo $array[$param-1];

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

int main() {
    ll sol=0,cnt;
    ll n;
    cin >> n;
    for (ll i=2;i*i<=n;i++) {
        if (n%i>0) continue;
        cnt=0;
        while(n%i==0) {
            cnt++;
            n/=i;
        }
        ll j=1;
        while(cnt>=j) {
            sol++;
            cnt-=j;
            j++;
        }
    }
    if (n>1) sol++;
    cout << sol;

}


Measured memory_bytes: 3580
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> p(N);
	for (int i = 0; i < N; i++)
	{
		cin >> p[i];
	}
	
	sort(p.begin(), p.end());
	
	int answer = 0;
	for (int i = 0; i < N; i++)
	{
		// 定価が高い品物
		if (i == N - 1)
		{
			answer += p[i] / 2;
		}
		else {
			answer += p[i];
		}
	}
	
	cout << answer << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<vector<int> > v(n, vector<int>(3, 0));
    for(int i = 0; i < n; i++)
        cin >> v[i][0] >> v[i][1] >> v[i][2];
    vector<vector<int> > dp(n, vector<int>(3,0));
    int i;
    dp[0][0] = v[0][0];
    dp[0][1] = v[0][1];
    dp[0][2] = v[0][2];
    for(i = 1; i < n; i++){
        dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + v[i][0];
        dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + v[i][1];
        dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + v[i][2];
    }
    cout << max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2]) << endl;
    return 0;
}

Measured memory_bytes: 11136
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int A = scanner.nextInt();
    int B = scanner.nextInt();
    int X = scanner.nextInt();

    if(X >= A && B >= X - A){
      System.out.println("YES");
    } else {System.out.println("NO");}
  }
}


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

using namespace std;

using ll = long long;
using ii = std::pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vvi = vector<vi>; //vector<vector<int>>
using vs = vector<string>;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend() 
#define sz(x) (int)((x).size())
#define arrsz(x) (int) (sizeof((x))/sizeof((x)[0]))

#define LSOne(S) (S & (-S))
#define isBitSet(S, i) ((S >> i) & 1)

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

/* Usage: output_vector(solution), which prints elements with spaces and then new line*/
template<typename T>
void output_vector(const vector<T> &v, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = int(v.size());
 
    for (int i = start; i < end; i++)
        cout << v[i] << " ";
    cout << endl;
}
// FILE I/O
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(string s = "") {
	unsyncIO();
	// cin.exceptions(cin.failbit); 
	// throws exception when do smth illegal
	// ex. try to read letter into int
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

int main() 
{
   int X, N;
   cin >> X >> N;
   vector<int> input;
   for (int i = 0; i < N; i++)
   {
       int num;
       cin >> num;
       input.pb(num);
   }
   sort(all(input));
   if (N == 0 || X < input[0] || X > input[N-1])
   {
       cout << X << endl;
   }
   else
   {
        set<int> numsAvailable;
        int j = 0;
        for (int i = input[0]-1; i <= input[N-1]+1; i++)
        {
            if (j <= N && i != input[j])
            {
                numsAvailable.insert(i);
            }
            else
            {
                j++;
            }
        }
        auto it1 = numsAvailable.lower_bound(X);
        int opt1 = *it1;
        it1--;
        int opt2 = *it1;
        if (abs(opt2 -X) <= abs(opt1 - X))
            cout << opt2 << endl;
        else
            cout << opt1 << endl;
        

   }
   





}
   

Measured memory_bytes: 3644
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
	"math"
)
 
func run() {

	var N int;
    N = nextInt();
    var D int;
    D = nextInt();
    X := make([][]int,N); for i := range X { X[i] = make([]int, D) };
    for i := 0 ; i < int(N) ; i++ {
        for j := 0 ; j < int(D) ; j++ {
            X[i][j] = nextInt();
        }
    }
	solve(N, D, X);

}

func solve(N int, D int, X [][]int){
	sum := 0.0
	count := 0
	for i := 0; i < int(N); i++ {
		for j := i+1; j < int(N); j++ {
			for k := 0; k < int(D); k++ {
				sum += math.Pow(float64(X[i][k]) - float64(X[j][k]),2) 
			}
			if math.Sqrt(sum) == round(math.Sqrt(sum)) {
				count ++
			}
			sum = 0
		}
	}
	Println(count)
}

func round(a float64) float64{
	return float64(int(a + 0.5)) 
}


// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		log.Fatal(err)
	}
	return a
}

func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}


type IntHeap []int
func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

/////数字と文字
// 基本クラス
type NS struct {
    Num int
    Str string
}

//////　数字と数字
// 基本クラス
type NN struct {
    Num1 int
    Num2 int
}

 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}



Measured memory_bytes: 2816
#include<bits/stdc++.h>
#define MSET(x,y) memset(x,y,sizeof(x))
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 100005
#define ll long long
#define ld long double
#define INF 1e18
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
ll MOD = 1000000007;
string yes = "YES\n";
string no = "NO\n";
#define PI 3.1415926535 
 
 
int32_t main() {
    fastio;
    ll n;
    cin>>n;
    vector<ll> a(n);
    map<ll,ll> mp;
    ll sum = 0;
    for(ll i=0;i<n;i++) {
        cin>>a[i];
        mp[a[i]]++;
        sum+=a[i];
    }
    ll q;
    cin>>q;
    while(q--) {
        ll b,c;
        cin>>b>>c;
        ll ans = sum + mp[b]*(c-b);
        mp[c] += mp[b];
        mp[b] = 0;
        sum = ans;
        cout<<sum<<endl;
    }
    return 0;
}

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

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int intarray [] = inputval();
        float a = intarray[0];
        float b = intarray[1];
        System.out.println((int)Math.ceil((a+b)/2));


    }

}



Measured memory_bytes: 32784
#include<bits/stdc++.h>
using namespace std;
#define MAX_M 200005
#define MAX_N 20
int m,n;

int dp[(1<<MAX_N)];
int w[MAX_M],t[MAX_M];
int c,b;
int a[MAX_N][MAX_M];

int main(){
  cin>>m>>n;
  for(int i=0;i<m;i++)scanf("%d %d",&w[i],&t[i]);
  for(int i=0;i<n;i++){
    scanf("%d %d",&c,&b);
    int k=0,sc=0,sb=0;
    for(int j=0;j<m;j++){
      if(j)sc-=w[j-1],sb-=t[j-1];
      while(k<m&&sc+w[k]<=c&&sb+t[k]<=b){
        sc+=w[k];
        sb+=t[k];
        k++;
      }
      a[i][j]=k;
    }
  }
  for(int S=0;S<(1<<n);S++){
    for(int i=0;i<n;i++){
      if(S>>i&1)continue;
      dp[S|(1<<i)]=max(dp[S|(1<<i)],a[i][dp[S]]);
    }
  }
  printf("%d\n",dp[(1<<n)-1]);
  return 0;
}

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

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

  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];

  long long odd_cnt = 0, odd_sum_cnt = 0;
  for (int i = 0; i < N; i++) {
    odd_sum_cnt += a[i];
    if (i % 2 == 0) {
      while (0 <= odd_sum_cnt) {
        odd_sum_cnt--;
        odd_cnt++;
      }
    } else {
      while (odd_sum_cnt <= 0) {
        odd_sum_cnt++;
        odd_cnt++;
      }
    }
  }

  long long even_cnt = 0, even_sum_cnt = 0;
  for (int i = 0; i < N; i++) {
    even_sum_cnt += a[i];
    if (i % 2 == 0) {
      while (even_sum_cnt <= 0) {
        even_sum_cnt++;
        even_cnt++;
      }
    } else {
      while (0 <= even_sum_cnt) {
        even_sum_cnt--;
        even_cnt++;
      }
    }
  }

  cout << min(odd_cnt, even_cnt) << endl;
  return 0;
}


Measured memory_bytes: 640
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cstring>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

#define SIZE(x) (int((x).size()))
#define rep(i,l,r) for (int i=(l); i<=(r); i++)
#define repd(i,r,l) for (int i=(r); i>=(l); i--)
#define rept(i,c) for (__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)

#ifndef ONLINE_JUDGE
#define debug(x) { cerr<<#x<<" = "<<(x)<<endl; }
#else
#define debug(x) {}
#endif

int cnt[1000];
char g[1000][1000];

void lemon()
{
	int n,m; scanf("%d%d",&n,&m);
	rep(i,1,n)
	{
		scanf("%s",g[i]+1);
		rep(j,1,m)
		{
			cnt[g[i][j]-'a']++;
		}
	}
	
	int allow1, allow2;
	
	if (n%2==0 && m%2==0)
	{
		allow1=0; allow2=0;
	}
	else if (n%2==1 && m%2==1)
	{
		allow1=1; allow2=(n-1)/2+(m-1)/2;
	}
	else
	{
		allow1=0;
		if (n%2==1) allow2=m/2; else allow2=n/2;
	}
	
	int actual1=0;
	rep(i,0,25)
	{
		if (cnt[i]%2) actual1++;
	}
	if (actual1>allow1)
	{
		cout<<"No"<<endl;
		return;
	}
	
	rep(i,0,25) if (cnt[i]%2) cnt[i]--;
	
	int actual2=0;
	rep(i,0,25)
	{
		if (cnt[i]%4==2) actual2++;
	}
	if (actual2>allow2)
	{
		cout<<"No"<<endl;
		return;
	}
	
	cout<<"Yes"<<endl;
}

int main()
{
	ios::sync_with_stdio(true);
	#ifndef ONLINE_JUDGE
		//freopen("","r",stdin);
	#endif
	lemon();
	return 0;
}

Measured memory_bytes: 384
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<cstdlib>
#define cmax(a,b) (a<(b)?a=(b),1:0)
#define cmin(a,b) (a>(b)?a=(b),1:0)
#define dmin(a,b) ((a)<(b)?(a):(b))
#define dmax(a,b) ((a)>(b)?(a):(b))
#define CL fclose(stdin),fclose(stdout)
namespace io
{
	int F()
	{
		int n=0,F=1;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=0:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=(n<<1)+(n<<3)+ch-'0';
		return F?n:-n;
	}
	long long G()
	{
		long long n=0,F=1;
		char ch;
		while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		ch=='-'?F=0:n=ch-'0';
		while((ch=getchar())>='0'&&ch<='9')n=(n<<1)+(n<<3)+ch-'0';
		return F?n:-n;
	}
}
int c[555][555];
int f[555][555][2];
int main()
{
	//freopen("rabbit.in","r",stdin);
	//freopen("rabbit.out","w",stdout);
	int n=io::F(),M=1000000007;
	for(register int i=0;i<=n;++i)c[i][0]=c[i][i]=1;
	for(register int i=2;i<=n;++i)
		for(register int j=1;j<i;++j)
			c[i][j]=(c[i-1][j-1]+c[i-1][j])%M;
	f[1][0][0]=c[n][1];
	f[1][1][0]=c[n][1];
	#define register 
	for(register int i=1;i<n;++i)
		for(register int j=0;j<=i;++j)
			for(register int k=0;k<=1;++k)
				if(f[i][j][k])
				{
					long long F=f[i][j][k];
					for(register int x=0;x+i<=n;++x)
					{
						register int y=x==0?1:0;
						if((x+y^j)&1)++y;
						for(;x+y+i<=n;y+=2)
						{
							int cnt=x+y;
							if(cnt<j)continue;
							int ck=j+(cnt-j)/2,ct=cnt-ck;
							if(ck>x)
								f[i+cnt][ck-x][k]=(f[i+cnt][ck-x][k]+F*c[n-i][x]%M*c[n-i-x][y])%M;
								else if(ck<x)
									f[i+cnt][x-ck][!k]=(f[i+cnt][x-ck][!k]+F*c[n-i][x]%M*c[n-i-x][y])%M;
									else f[i+cnt][0][0]=(f[i+cnt][0][0]+F*c[n-i][x]%M*c[n-i-x][y])%M;
						}
					}
				}
	printf("%d\n",f[n][0][0]);
	return 0;
}



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

namespace AtCoder
{
	public class ABC
	{
		static public void Main(string[] args)
		{
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
			Solve(args);
			Console.Out.Flush();
		}

		private const int mod = 1000000007;  // 10^9+7

		static public void Solve(string[] args)
		{
			//string s = Console.ReadLine();
			//int n = int.Parse(Console.ReadLine());
			long n = long.Parse(Console.ReadLine());
			//int[] vs = Console.ReadLine().Split().Select(int.Parse).ToArray();
			//long[] vs = Console.ReadLine().Split().Select(long.Parse).ToArray();

			List<char> ans = new List<char>();
			while (n > 0) {
				long c = (n - 1) % 26 + 0x61;
				ans.Add((char)c);
				n = (n - 1) / 26;
			}
			ans.Reverse();
			Console.WriteLine(string.Concat(ans));

		}
	}
}



Measured memory_bytes: 27952
#include<bits/stdc++.h>
using namespace std;
const int maxn=3e5+10;
int n;
/*
    How to figure out this one
    sigh:
    :(
    Claim ->impossible to do in less than log_(n)
    Basically we need complete bipartite graph for each level
    // 2^k+1
    claim that there is just k level
    Each time we can divide to each side without no more than
    the best we can do is 2^k and 2^(k-1)+1
    Of course we must use at least k color for each side
    and another one color to separate it to another side
    so at least we need k+1 color

*/


int main(){
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            int x=(i^j);
            printf("%d ",__builtin_ctz(x)+1);
        }
        printf("\n");
    }
}
/*
    Good Luck
        -Lucina
*/


Measured memory_bytes: 512
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)

int main() {

	int N, x[123], y[123], h[123], mh = 0;
	scanf("%d", &N);

	rep(i, N) {
		scanf("%d%d%d", &x[i], &y[i], &h[i]);
		mh = max(h[i], mh);
	}

	rep(Cx, 101) {
		rep(Cy, 101) {
			rep(H, 300) {
				bool f = true;
				rep(i, N) {
					if (max(H + mh - abs(x[i] - Cx) - abs(y[i] - Cy), 0ll) != h[i]) {
						f = false;
						break;
					}
				}
				if (f) {
					printf("%lld %lld %lld\n", Cx, Cy, mh + H);
					return 0;
				}
			}
		}
	}

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=205;
int pre[maxn];
int main(){
    int n,m,x;
    cin>>n>>m>>x;
    memset(pre,0,sizeof(pre));
    int tmp;
    for(int i=0;i<m;i++){
        scanf("%d",&tmp);
        pre[tmp]=1;
    }
    for(int i=1;i<=n;i++)
        pre[i]+=pre[i-1];
    cout<<min(pre[n]-pre[x],pre[x])<<"\n";
    return 0;
}


Measured memory_bytes: 256
listed = []
nmin = 0
nmax = 0
nsum = 0

n = int(input())
if n > 0 and n <= 10000:
    listed = list(map(int, input().split(maxsplit=n-1)))
    nmin = listed[0]
    nmax = listed[0]
    for i in listed:
        if i >= -1000000 and i <= 1000000:
            if nmin > i:
                nmin = i
            if nmax < i:
                nmax = i
            nsum += i
        else:
            pass
else:
    pass

print("{0} {1} {2}".format(nmin, nmax, nsum))

Measured memory_bytes: 8676
import math
import itertools
 
N = int(input())
XY = [list(map(int, input().split())) for x in range(N)]
 
P = list(itertools.permutations(XY, N))
 
total = 0
for p in P:
    for i in range(1, N):
        a = p[i - 1]
        b = p[i]
        total += math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
        
ans = total / len(P)
print(ans)

Measured memory_bytes: 45680
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  ll N,ans=1;
  cin>>N;
  ll a=7;
  while(a%N!=0&&ans<100000000){
    a*=10;a+=7;a%=N;ans++;
  }
  if(ans==100000000){
    ans=-1;
  }
  cout<<ans;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
 
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define cout_precision cout.setf(ios::fixed); cout.precision(32);
#define clr(a) memset(a,0,sizeof(a))
#define umap unordered_map
#define uset unordered_set
#define fr first
#define sc second
#define pb push_back
#define M int(1e9+7)


using ll = int64_t; using vll = vector<ll>; using vvll = vector<vll>;
using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;
int solve(int num){
	int d= floor(log10(num))+1;
	if(d==1)	return num;
	else if(d&1)	return (num+1-pow(10,d-1))+solve(pow(10,d-2));
	else	return solve(pow(10,d-1)-1);
}

int main(){
	fast_io; cout_precision;
	int n;	cin >> n;
	cout<<solve(n);
	
	return 0;
}

Measured memory_bytes: 512
n, k = map(int, input().split())

n = n+1
mod = 10**9+7

ans = 0
for i in range(k, n+1):
    m1 = ((i+1)*i//2)
    m2 = ((n-i+1+n)*i//2)

    ans = (ans + m2 - m1 + 1) % mod

print(ans)


Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
int main(){
	//freopen("","r",stdin);
	//freopen("","w",stdout);
	long long n,sum=1,bei=1;
	cin>>n;
	while(n>1){
		n/=2;
		bei*=2;
		sum+=bei;
	}
	cout<<sum;
}


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

std::map<long long, long long> primeFactorization(
    long long n) { /* prime factorization * nを素因数分解する */
  std::map<long long, long long> pf;
  for (long long i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      n /= i;
      ++pf[i];
    }
  }
  if (n > 1) {
    ++pf[n];
  }
  return pf;
}
LL N;
LL dfs(map<LL, LL> pf, LL Sum) {
  DUMP("dfs", pf, Sum);
  if (pf.size() == 0) {
    LL m = max(Sum - 1, 1LL);
    DUMP("edge ", m, N, N / m, N % m);
    if (N / m == N % m)
      return m;
    else
      return 0;
  }
  LL ans = 0;
  pair<long, long> r = *pf.begin();
  pf.erase(pf.begin());
  REP(i, 0, r.second + 1) {
    LL t = pow(r.first, i);
    DUMP("         ", i, r, pf, t, Sum * t);
    ans += dfs(pf, Sum * t);
  }
//   pf.insert(r);
  return ans;
}
int main() {
  cin >> N;
  LL sum = 0;
//   REP(m, 1, N) {
//     if (N / m == N % m) {
//       DUMP(m, sum);
//       sum += m;
//     }
//   }
//   DUMP("simple", sum);

  auto pf = primeFactorization(N);
  LL ans = dfs(pf, 1LL);
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
    using namespace std;
    int main()
    {
     
        int n;
        cin>>n;
      double a[n],ans=0.0;
      for(int i=0;i<n;i++)
        cin>>a[i];
      for(int i=0;i<n;i++)
        ans=ans+(1.0/a[i]);
        cout<<1/ans;
      return 0;
    } 

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '2')ans++;
  }


  cout << ans << "\n";
  return 0;
}

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

namespace Tasks
{
    public class D
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = long.Parse(Console.ReadLine());
            var p = (int)1e9 + 7;
            var dp = new int[61][].Select(x => x = new int[3]).ToArray();
            dp[60][0] = 1;
            for (var i = 59; i >= 0; i--)
            {
                for (var j = 0; j <= 2; j++)
                {
                    var u = (N >> i) & 1;
                    if (j * 2 - 2 + u >= 0)
                    {
                        var j11 = Math.Min(2, j * 2 - 2 + u);
                        dp[i][j11] += dp[i + 1][j];
                        dp[i][j11] %= p;
                    }

                    if (j * 2 - 1 + u >= 0)
                    {
                        var j01 = Math.Min(2, j * 2 - 1 + u);
                        dp[i][j01] += dp[i + 1][j];
                        dp[i][j01] %= p;
                    }

                    var j00 = Math.Min(2, j * 2 + u);
                    dp[i][j00] += dp[i + 1][j];
                    dp[i][j00] %= p;
                }
            }

            var answer = 0L;
            for (var i = 0; i <= 2; i++)
            {
                answer += dp[0][i];
                answer %= p;
            }
            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 27988
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)




int main() {
    ll n, m;
    cin >> n >> m;
    
    while(n | m){
        vector<ll> a(n);
        REP(i, n){
            cin >> a[i];
        }
        
        ll ans = -1;
        REP(i, n - 1){
            for(ll j = i + 1; j < n; j++){
                if(a[i] + a[j] <= m){
                    ans = max(ans, a[i] + a[j]);
                }
            }
        }
        
        if(ans != -1){
            cout << ans << '\n';
        }
        else{
            cout << "NONE" << '\n';
        }
        
        cin >> n >> m;
    }
}



Measured memory_bytes: 3072
A, B, C = [int(_) for _ in input().split()]

if A >= B:
    if A >= C:
        print(A * 10 + B + C)
    else:
        print(C * 10 + B + A)
else:
    if B >= C:
        print(B * 10 + A + C)
    else:
        print(C * 10 + B + A)


Measured memory_bytes: 38384
#include <iostream>
#include <queue>
#include <vector>

typedef std::pair<int, int> P;

int main(){
	std::priority_queue<P, std::vector<P>, std::greater<P> > que;
	int n, m;
	
	std::cin >> n;
	while(n--){
		int hour, min;
		std::cin >> hour >> min;
		que.push(P(hour, min));
	}

	std::cin >> m;
	while(m--){
		int hour, min;
		std::cin >> hour >> min;
		que.push(P(hour, min));
	}

	bool flag = false;
	int lmin = 100, lhour = 100;
	while(!que.empty()){
		P p = que.top(); que.pop();
		if(!(lhour == p.first && lmin == p.second)){
			if(flag)
				std::cout << " ";
			std::cout << p.first << ":";
			if(p.second < 10)
				std::cout << 0;
			std::cout << p.second;
		}
		lhour = p.first;
		lmin = p.second;
		if(que.size() == 0)
			std::cout << std::endl;
		if(!flag)
			flag = true;
	}
	return 0;
}

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


void solve(long long N, long long M){
    if(N>=2&&M>=2)cout << (N-2)*(M-2) << endl;
    if(N<2&&M>=2) cout << (M-2) << endl;
    if(N>=2&&M<2) cout << (N-2) << endl;
    if(N<2&&M<2)  cout << 1 << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using P = pair<int,int>;
using ll = long long;
#define INF 10000000


int main() {
    int n,m,x;
    cin >> n >> m >> x;
    vector<int> c(n);
    vector<vector<int> > a(n,vector<int>(m));
    rep(i,n){
        cin >> c.at(i);
        rep(j,m) cin >> a.at(i).at(j);
    }


    bool flag=true;
    rep(i,m){
        int sum=0;
        rep(j,n) sum+=a.at(j).at(i);
        if(sum<x) flag=false;
    }
    int cost;
    int ans=INF;

    int loop = pow(2,n);
    rep(i,loop){
        int num=i;
        bool sub_flag=true;
        vector<int> und(m,0); 
        cost=0;
        rep(j,n){
            int mod=num%2;
            num=num/2;
            if(mod){
                rep(k,m) und.at(k) = und.at(k)+a.at(j).at(k);
                cost = cost+c.at(j);
            }
        }
        rep(j,m) if(und.at(j)<x) sub_flag=false;
        if(sub_flag) ans=min(ans,cost);
    }

    if(flag){
        cout << ans << endl;
    }else{
        cout << -1 << endl;
    }

}

Measured memory_bytes: 4048
import java.util.Scanner;

class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
//		String S = sc.next();

		int[] arr = new int[N];
		for(int i = 0; i< N ; i++) {
			arr[i] = 10;
		}
		for(int i = 0; i<M ; i++) {
			int aa = Integer.parseInt(sc.next());
			int bb = Integer.parseInt(sc.next());

			if(N > 1 && aa ==1 && bb == 0) {
				System.out.println(-1);
				return;
			}
			if(arr[aa-1] != 10 && arr[aa-1] != bb) {
				System.out.println(-1);
				return;
			} else {
				arr[aa-1] =  bb;
			}
		}


		for(int i=0;i < arr.length;i++) {
			if(arr.length > 1 && i==0 && arr[i] == 10) {
				System.out.print(1);
			} else if(arr[i] == 10) {
				System.out.print(0);
			} else {
				System.out.print(arr[i]);
			}
		}
	}
}


Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

#define MAX_N 2000005
ll inv[MAX_N], fac[MAX_N], finv[MAX_N];
void make() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for(int i=2; i<MAX_N; i++) {
    inv[i] = mod - inv[mod%i] * (mod/i) % mod;
    fac[i] = fac[i-1] * (ll)i % mod;
    finv[i] = finv[i-1] * inv[i] % mod;
  }
}
ll perm(ll n, ll r) {
  if(n < 0)       return 0;
  else if(n < r)  return 0;
  else            return (fac[n] * finv[n-r]) % mod;
}
ll comb(ll n, ll r) {
  ll ans = 1;
  ans = perm(n, r);
  ans = (ans * finv[r]) % mod;
  return ans;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  make();
  ll s; cin >> s;
  ll ans = 0;
  REP(i, 1, s) {
    ll rem = s-3*i;
    if(rem < 0) break;
    (ans += comb(rem+i-1, i-1)) %= mod;
  }
  cout << ans << endk;
  return 0;
}


Measured memory_bytes: 50504
using System;
using System.Collections.Generic;

namespace ABC114_D___756
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var isPrime = new bool[N + 1];
            for (int i = 0; i < N + 1; i++) isPrime[i] = true;
            isPrime[0] = false;
            isPrime[1] = false;

            for (int i = 2; i < Math.Pow(N, 0.5); i++)
            {
                if (!isPrime[i]) continue;
                for (int j = i + 1; j < N + 1; j++) if (j % i == 0) isPrime[j] = false;
            }

            var factoring = new Dictionary<int, int>();
            for (int i = 2; i < N + 1; i++) if (isPrime[i]) factoring.Add(i, 0);

            int[] primes = new int[factoring.Keys.Count];
            factoring.Keys.CopyTo(primes, 0);

            for (int i = 2; i <= N; i++)
            {
                foreach (int j in primes)
                {
                    var temp = j;
                    if (i < j) break;
                    while (i % temp == 0)
                    {
                        factoring[j] += 1;
                        temp *= j;
                    }
                }
            }

            var count2 = 0;
            var count4 = 0;
            var count14 = 0;
            var count24 = 0;
            var count74 = 0;

            foreach (int item in factoring.Values)
            {
                if (item >= 2) count2 += 1;
                if (item >= 4) count4 += 1;
                if (item >= 14) count14 += 1;
                if (item >= 24) count24 += 1;
                if (item >= 74) count74 += 1;
            }

            var result = 0;
            result += count4 * (count4 - 1) * (count2 - 2) / 2;
            result += count14 * (count4 - 1);
            result += count24 * (count2 - 1);
            result += count74;
            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <string>
#include <sstream>
#include <set>
#include <bitset>
using namespace std;

int r, c;
bitset<10000> cookie[10];

int main() {
    while (cin >> r >> c && r) {
        for (int i = 0; i < r; ++i)
            for (int j = 0; j < c; ++j) {
                bool upward;
                cin >> upward;
                cookie[i][j] = upward;
            }
        int ans = 0;
        for (int i = 0; i < (1 << r); ++i) {
            for (int j = 0; j < r; ++j)
                if (i & (1 << j)) cookie[j].flip();
            int possible_ans = 0;
            for (int j = 0; j < c; ++j) {
                int up_cookie_count = 0;
                for (int k = 0; k < r; ++k)
                    if (cookie[k][j]) up_cookie_count++;
                possible_ans += max(up_cookie_count, r - up_cookie_count);

            }
            ans = max(ans, possible_ans);
            for (int j = 0; j < r; ++j)
                if (i & (1 << j)) cookie[j].flip();
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3056
o = list(input())
e = list(input())
ans = []
flg = False
if len(o) != len(e):
    e.append(0)
    flg = True

for i in range(len(o)):
    ans.append(o[i])
    ans.append(e[i])
if flg:
    del ans[-1]
    print("".join(ans))
else:
    print("".join(ans))


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define int long long int
#define double long double
#define inf (int)(1e15)
#define all(x) (x).begin(), (x).end()
#define pair pair<int, int>
typedef vector<int> vi;   // Vector of long long
typedef vector<vi> vvi;   // Vector of vi
typedef vector<pair> vii; // Vector of pairs
typedef vector<vii> vvii; // Vector of Vector of pairs
typedef vector<bool> vb;  // Vector of bool
#define pq priority_queue // Max heap (To convert to min heap, use negative sign before every value)
#define ff first          // For pairs
#define ss second
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, -1, 0, 1};
const int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}, dy8[] = {1, -1, 1, 0, -1, 1, -0, -1};
#define testcases(t) \
    int(t);          \
    cin >> (t);      \
    while ((t)--)
vi a(51, 0);
int bs(int cnt)
{
    int start = 1, end = 50, ans = -1;
    while (start <= end)
    {
        int mid = (start + end) / 2;
        if (a[mid] <= cnt)
        {
            ans = mid;
            start = mid + 1;
        }
        else
            end = mid - 1;
    }
    return ans;
}
signed main()
{
    for (int i = 1; i <= 50; i++)
    {
        a[i] = a[i - 1] + i;
    }
    int n, cnt = 0, ans = 0;
    cin >> n;
    while (n % 2 == 0)
    {
        cnt++;
        n /= 2;
    }
    if (cnt > 0)
        ans += bs(cnt);
    for (int divisor = 3; divisor < ((int)(1e6)); divisor += 2)
    {
        cnt = 0;
        while (n % divisor == 0)
        {
            cnt++;
            n /= divisor;
        }
        if (cnt > 0)
        {
            ans += bs(cnt);
        }
    }
    if (n > 1)
        ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;

int main() {
    int h,w;
    cin >> h >> w;
    vector<vector<int>> a(h,vector<int>(w)),b(h,vector<int>(w));
    rep(i,h) rep(j,w) cin >> a[i][j];
    rep(i,h) rep(j,w) cin >> b[i][j];
    vector<vector<bool>> dp(h*w,vector<bool>(30001,false));
    dp[0][b[0][0]-a[0][0]+15000] = true;
    dp[0][a[0][0]-b[0][0]+15000] = true;
    rep2(i,1,h*w) rep(j,30001) {
        int na = a[i/w][i%w];
        int nb = b[i/w][i%w];
        if(i >= w) {
            if(i%w != 0) {
                if(0 <= nb-na+j && nb-na+j < 30001) dp[i][j] = dp[i][j] || dp[i-w][j-(na-nb)] || dp[i-1][j-(na-nb)];
                if(0 <= na-nb+j && na-nb+j < 30001) dp[i][j] = dp[i][j] || dp[i-w][j-(nb-na)] || dp[i-1][j-(nb-na)];
            } else {
                if(0 <= nb-na+j && nb-na+j < 30001) dp[i][j] = dp[i][j] || dp[i-w][j-(na-nb)];
                if(0 <= na-nb+j && na-nb+j < 30001) dp[i][j] = dp[i][j] || dp[i-w][j-(nb-na)];
            }
        } else {
            if(i%w != 0) {
                if(0 <= nb-na+j && nb-na+j < 30001) dp[i][j] = dp[i][j] || dp[i-1][j-(na-nb)];
                if(0 <= na-nb+j && na-nb+j < 30001) dp[i][j] = dp[i][j] || dp[i-1][j-(nb-na)];
            }
        }
    }
    rep(i,15001) {
        if(dp[h*w-1][15000+i] || dp[h*w-1][15000-i]) {
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 26112
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define endl "\n"
#define fo for(int i=0;i<n;i++)
#define clear cin.clear();cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define loopSolve int t; cin>>t; while(t--){solve();}
//INT_MAX         2,147,483,647                       <10^10
//U_INT_MAX       4,294,967,295                       <10^10
//LONG_LONG_MAX   9,223,372,036,854,775,807           <10^18
//U_LONG_LONG_MAX 18,446,744,073,709,551,615          <10^18
//ll power(int a, int b){
//    return (ll)(pow(a,b)+0.5);
//}

//vector<int> gV(int n){
//    vector<int> v(n);
//    int input;
//    fo { cin>>v[i];  }
//    return v;
//}

int* gA(int n){
    int* arr = new int[n];
    fo cin>>arr[i];
    return arr;
}

bool isPossible(int t){
    if(t>=0)
        return true;
    else
        return false;
}

int compute(int x,int y, int z){
    return (x*x + y*y + z*z + x*y + y*z + z*x);
}

void solve(){
    int n,ans=0;
    cin>>n;
    int* arr = new int[n];
    for(int i=0;i<n;i++)
        arr[i]=0;
    //cout<<endl;

    for(int i=1;i<=sqrt(n);i++){
        for(int j=1;j<=sqrt(n);j++){
            for(int k=1;k<=sqrt(n);k++){
                ans=compute(i,j,k);
                //cout<<ans<<" for  "<<i<<","<<j<<","<<k<<endl;
                if(ans>n)
                    break;
                else
                    arr[ans-1]+=1;
            }
        }
    }

    for(int i=0;i<n;i++)
        cout<<arr[i]<<endl;


}


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

    solve();
    //loopSolve;

	return 0;
}


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

int N,L;
const int MAX_N = 100010;
int a[MAX_N],b[MAX_N][20];

void init(){
	a[N+1] = 2e9+1;
	for(int i=N,j=N+1;i>0;i--){
		while(a[i] + L < a[j])j--;
		b[i][0] = j;
	}
	for(int j=1;j<20;j++){
		for(int i=1;i<=N;i++){
			b[i][j] = b[b[i][j-1]][j-1];
		}
	}
}

int query(int x,int y){
	int ret = 0;
	for(int i=19;i>=0;i--){
		if(a[b[x][i]] < a[y]){
			x = b[x][i];
			ret += (1<<i);
		}
	}
	return ret+1;
}

int main(){
	ios::sync_with_stdio(false);
	cin >> N;
	for(int i=1;i<=N;i++){
		cin >> a[i];
	}
	cin >> L;

	init();

	int Q,x,y;
	cin >> Q;
	while(Q--){
		cin >> x >> y;
		if(x > y)swap(x,y);
		cout << query(x,y) << "\n";
	}
	return 0;
}

Measured memory_bytes: 9088
#include <stdio.h>

int main(void) {
	int n, t;
	int max, min;
	int a[200000];
	int i;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d", &t);
		a[i] = t;
	}

	max = a[1] - a[0];
	min = a[0];

	for (i = 1; i < n; i++) {
		if (max < a[i] - min) {
			max = a[i] - min;
		}
		if (min > a[i]) {
			min = a[i];
		}
	}

	printf("%d\n", max);
	return 0;
}


Measured memory_bytes: 2580
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<cstdio>
#include<time.h>
#include<vector>
#include<cstring>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#define R register
#define LL long long
using namespace std;
const int N=2e5+10;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;

int n,m;
LL ans,a[N],sum[N];
map<LL,LL> Map;

namespace FastIO {
	template<typename tp> inline void read(tp &x) {
		x=0; register char c=getchar(); register bool f=0;
		for(;c<'0'||c>'9';f|=(c=='-'),c = getchar());
		for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0',c = getchar());
		if(f) x=-x;
	}
	template<typename tp> inline void write(tp x) {
	  if (x==0) return (void) (putchar('0'));
     if (x<0) putchar('-'),x=-x;
     int pr[20]; register int cnt=0;
     for (;x;x/=10) pr[++cnt]=x%10;
     while (cnt) putchar(pr[cnt--]+'0');
	}
	template<typename tp> inline void writeln(tp x) {
		write(x);
		putchar('\n');
	}
}
using namespace FastIO;

int main() {
	read(n);
	for (int i=1;i<=n;i++) read(a[i]);
	for (int i=1;i<=n;i++) {
		sum[i]=sum[i-1]+a[i];
		Map[sum[i]]+=1;
	}
	Map[0]++;
	for (int i=0;i<=n;i++) {
		LL t=Map[sum[i]];
		if (!t) continue;
		ans+=(t-1)*t/2;
		Map[sum[i]]=0;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

bool query(string s) {
    cout << "? " << s << endl;
    // const string ans_str = "1000000000";
    // bool cond1 = s <= ans_str;
    // bool cond2 = stoll(s) <= stoll(ans_str);
    // return cond1 == cond2;
    string str;
    cin >> str;
    return str == "Y";
}

int main(void) {
    // 桁数特定パート
    ll digit;
    {
        auto check = [&](ll mid) {
            return query('1' + string(mid-1, '0'));
        };

        ll lb = 1, ub = 11;
        while(ub-lb > 1) {
            ll mid = (lb+ub)/2;
            if(check(mid)) lb = mid;
            else ub = mid;
        }
        digit = lb;
    }

    // 答えは10のべき乗
    if(digit == 10) {
        auto check = [&](ll mid) {
            return query(string(mid, '9'));
        };

        ll lb = 0, ub = 10;
        while(ub-lb > 1) {
            ll mid = (lb+ub)/2;
            if(check(mid)) ub = mid;
            else lb = mid;
        }
        cout << "! 1" << string(ub-1, '0') << endl;
    }
    // digit桁で確定
    else {
        auto check = [&](ll mid) {
            return query(to_string(mid*10));
        };

        ll lb = pow(10, digit-1)-1, ub = pow(10, digit)-1;
        while(ub-lb>1) {
            ll mid = (lb+ub)/2;
            dump(lb, mid, ub);
            if(check(mid)) ub = mid;
            else lb = mid;
        }
        cout << "! " << ub << endl;
    }

    return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <stdlib.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = -200; i < (int)(n); i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define RS(x) rsort(x.begin(),x,end()))
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
typedef long double ld;
signed main(){
string s,t;
cin >> s >> t;
s+=t[t.size()-1];
if(s==t){
    cout << "Yes";
}else{
    cout << "No";
}
}

Measured memory_bytes: 3628
H, W = map(int, input().split())
A = [[a for a in input()] for _ in range(H)]
Sharps = [ ['#' for i in range(W+2)]for _ in range(H + 2)]
for i in range(1,H+1):
    for j in range(1,W+1):
        Sharps[i][j]=A[i-1][j-1]


for i in Sharps:
    print('.'.join(i).replace('.',''))

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

int main() {
    string s;
    cin >> s;
    vector<string> day = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    int match = 0;
    for(int i = 0; i < 7; i++){
        if(day.at(i) == s){
            match = i;
        }
    }
    cout << 7 - match << endl;
}


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

using namespace std;


int main()
{
 //   freopen("dna.in", "r", stdin);
 //  freopen("dna.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);

     int a,b=0,N;
     long long c=0;
     cin>>N;
     while(N--)
     {
         cin>>a;
         if(a==0)b=0;
         c+=(a+b)/2;
         b=(a+b)%2;
     }

      cout<<c<<endl;
    return 0;
}


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

int main() {
  int N; cin >> N;
  bool ans = false;
  for(int i=0; i<3; i++) {
    if(N %10 ==7) ans = true;
    N/=10;
  }
  if(ans==true) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3572