akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

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

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

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

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


int main(){
    int N; cin >> N;
    VLL cnt(26, 0);
    string S; cin >> S;
    REP(i, S.length())
        ++cnt[S[i] - 'a'];
    ll ans(1);
    REP(i, 26){
        ans = (ans * (cnt[i] + 1)) % MOD;
    }
    --ans;
    if(ans < 0) ans += MOD;
    cout << ans << endl;
    return 0;
}


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

int main(){
    int h, w;
    cin >> h >> w;
    vector<vector<int>> a(h, vector<int>(w));
    rep(i, h){
        rep(j, w){
            cin >> a[i][j];
        }
    }
    int n = 0;
    vector<vector<ll>> ans;
    rep(i, h){
        rep(j, w){
            if(a[i][j]%2 == 0) continue;
            else{
                if(i>0&&a[i-1][j]%2 == 1){
                    a[i][j]--;a[i-1][j]++;
                    n++;
                    ans.push_back({i+1, j+1, i, j+1});
                    continue;
                }
                if(j>0&&a[i][j-1]%2 == 1){
                    a[i][j]--; a[i][j-1]++;
                    n++;
                    ans.push_back({i+1, j+1, i+1, j});
                    continue;
                }
                if(i<h-1&&a[i+1][j]%2==1){
                    a[i][j]--;a[i+1][j]++;
                    n++;
                    ans.push_back({i+1, j+1, i+2, j+1});
                    continue;
                }
                if(j<w-1&&a[i][j+1%2==1]){
                    a[i][j]--;a[i][j+1]++;
                    n++;
                    ans.push_back({i+1, j+1, i+1, j+2});
                    continue;
                }
                if(i<h-1){
                    a[i][j]--;a[i+1][j]++;
                    n++;
                    ans.push_back({i+1, j+1, i+2, j+1});
                    continue;
                }
                if(j<w-1){
                    a[i][j]--;a[i][j+1]++;
                    n++;
                    ans.push_back({i+1, j+1, i+1, j+2});
                    continue;
                }
            }
        }
    }
    cout << n << endl;
    rep(i,n){
        rep(j, 3){
            cout << ans[i][j] << " ";
        }
        cout << ans[i][3] << endl;
    }
    return 0;
}

Measured memory_bytes: 11824
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        String o = scan.next();
        String e = scan.next();
        
        for(int i=0;i<e.length();i++)
        {
            System.out.print(o.charAt(i));
            System.out.print(e.charAt(i));
        }
        if(o.length()>e.length())
        {
            System.out.println(o.charAt(o.length()-1));
        }
        else
        {
            System.out.println();
        }
    }
}

Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

struct mint {
    lint v;
    lint _mod;
    mint() : v(0) {}
    mint(signed v, lint _mod = mod) : v(v), _mod(_mod) {}
    mint(lint t, lint _mod = mod) : _mod(_mod) {
        v = t % _mod;
        if (v < 0)
            v += _mod;
    }

    mint pow(lint k) {
        mint res(1), tmp(v);
        while (k) {
            if (k & 1)
                res *= tmp;
            tmp *= tmp;
            k >>= 1;
        }
        return res;
    }
    static mint add_identity() { return mint(0); }
    static mint mul_identity() { return mint(1); }
    mint inv() { return pow(_mod - 2); }

    mint &operator+=(mint a) {
        v += a.v;
        if (v >= _mod)
            v -= _mod;
        return *this;
    }
    mint &operator-=(mint a) {
        v += _mod - a.v;
        if (v >= _mod)
            v -= _mod;
        return *this;
    }
    mint &operator*=(mint a) {
        v = v * a.v % _mod;
        return *this;
    }
    mint &operator/=(mint a) { return (*this) *= a.inv(); }

    mint operator+(mint a) const { return mint(v) += a; };
    mint operator-(mint a) const { return mint(v) -= a; };
    mint operator*(mint a) const { return mint(v) *= a; };
    mint operator/(mint a) const { return mint(v) /= a; };

    mint operator-() const { return v ? mint(_mod - v) : mint(v); }

    bool operator==(const mint a) const { return v == a.v; }
    bool operator!=(const mint a) const { return v != a.v; }
    bool operator<(const mint a) const { return v < a.v; }
};
ostream &operator<<(ostream &os, mint m) { return os << m.v; }

mint nCk(int n, int k) {
    mint ret = 1;
    for (int i = n; i > n - k; --i) {
        ret *= i;
    }
    for (int i = 1; i <= k; ++i) {
        ret /= i;
    }
    return ret;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint n;
    cin >> n;
    lint a, b;
    cin >> a >> b;
    mint ret = mint(2).pow(n) - 1; // 1: zero
    ret -= nCk(n, a);
    ret -= nCk(n, b);
    cout << ret << "\n";
    return 0;
}

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

/*解説AC*/
const int  mod = 1000000007;
struct mint{
    ll x;
    mint (ll x=0) : x((x%mod+mod)%mod){}//カッコの中で初期化している
    mint& operator+=(const mint a){//operatorは構造体同士の比較に用いられる
        if((x +=a.x)>=mod) x-=mod;
        return *this;//thisとは現在のオブジェクトのこと
    }
    mint& operator-=(const mint a){
        if((x +=mod-a.x)>=mod) x-=mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x*=a.x)%=mod;
        return *this;
    }
    mint operator+(const mint a){
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a){
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a){
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const{
        if(!t) return 1;
        mint a=pow(t>>1);
        a*=a;
        if(t&1) a*=*this;
        return a;
    }
    mint inv() const{
        return pow(mod-2);//逆元
    }
    mint&operator/=(const mint a) {
        return (*this)*=a.inv();
    }
    mint&operator/(const mint a) const{
    mint res(*this);
    return res/=a;
    }
};

map<ll, ll> mp;
map<ll, ll> all;
map< ll, ll > prime_factor(ll n) {
    map< ll, ll > ret;
    for(ll i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
        if(mp[i]<ret[i]) mp[i] = ret[i];
    }
    if(n != 1) {
        ret[n] = 1;
        if(mp[n] == 0) mp[n] = 1;
    }
    return ret;
}

int main(void){
    int n;
    cin>>n;
    vector<ll> v(n);
    vector<map<ll, ll> > vmap(n);
    rep(i, n) cin>>v[i];
    rep(i, n){
       vmap[i] = prime_factor(v[i]);
    }
    mint LCM = 1;
    for(auto p : mp) LCM *=pow(p.first, p.second);
    mint ans = 0;
    rep(i, n){ 
        mint tmp = LCM;
        tmp /= v[i];
        ans += tmp;
    }
    cout<<ans.x<<endl;
    return 0;
}

Measured memory_bytes: 603904
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
typedef long long ll;
const ll mod = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    string S0;
    string S1;
    cin >> S0 >> S1;

    ll ans = 1;
    if (S0[0] == S1[0]) {
        ans *= 3;
    } else {
        ans *= 6;
    }
    for (int i: irange(1, N)) {
        if (S0[i - 1] == S1[i - 1]) {
            ans = ans * 2 % mod;
        } else {
            if (S0[i - 1] == S0[i] && S1[i - 1] == S1[i])
                continue;
            if (S0[i] == S1[i]) {
                continue;
            } else {
                ans = ans * 3 % mod;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>

#ifdef _MSC_VER
#include <agents.h>
#endif

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define REV(v) v.rbegin(), v.rend()
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int N = 1e7 + 10;
int dat[N];

int main(){
	int n;
	cin >> n;
	rep(i, n){
		int h;
		cin >> h;
		++dat[1], --dat[h+1];
	}

	rep(i, N) dat[i + 1] += dat[i];

	ll ans = 1;
	FOR(i, 1, N){
		ans += min(i * 4, dat[i]);
	}
	cout << ans << endl;



	return 0;
}

Measured memory_bytes: 40216
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;
int main(){
  int n; cin >> n;
  vector<int> a(n,0);

  rep(i,n-1){
    int t; cin >> t;
    a.at(t-1)++;
  }

  rep(i,n){
    cout << a.at(i) << endl;
  }
}


Measured memory_bytes: 4048
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]


N = int(input())
aa = list(map(int,input().split()))
bb = list(map(int,input().split()))
cc = list(map(int,input().split()))

aa.sort()
bb.sort()
cc.sort()

ans = 0
for b in bb:
	an = bisect.bisect_left(aa,b)
	cn = N-bisect.bisect_right(cc,b)
	ans += an*cn

print(ans)


Measured memory_bytes: 23968
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  if(a >= 13) cout << b << endl; 
  if(6 <= a && a <= 12) cout << b/2 << endl;
  if(a <= 5) cout << 0 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define upperlimit 1000100
#define INF 1000000100
#define INFL 1000000000000000100
#define eps 1e-8
#define endl '\n'
#define sd(n) scanf("%d",&n)
#define slld(n) scanf("%lld",&n)
#define pd(n) printf("%d",n)
#define plld(n) printf("%lld",n)
#define pds(n) printf("%d ",n)
#define pllds(n) printf("%lld ",n)
#define pdn(n) printf("%d\n",n)
#define plldn(n) printf("%lld\n",n)
#define REP(i,a,b) for(i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define clr(a) memset(a,0,sizeof(a))
using namespace std;

ll gcd(ll n1,ll n2){
	if(!n1)return n2;
	if(!n2)return n1;
	if(n1%n2==0)return n2;
	return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent){
	base%=mod;
	ll ans=1;
	while(exponent){
		if(exponent&1)ans=(ans*base)%mod;
		base=(base*base)%mod;
		exponent/=2;
	}
	ans%=mod;
	return ans;
}
string arr[upperlimit+1];
char answer[111][111];
int n,m;
char f(int num){
	return ('0'+num);
}
bool valid(int i,int j){
	return (i>=0 && i<n && j>=0 && j<m && arr[i][j]=='#');
}
int dx[] = {-1,0,1};
int dy[] = {-1,0,1};
int solve(int x,int y){
	int ret=0;
	for(int i=0;i<3;i++)for(int j=0;j<3;j++)if(valid(x+dx[i],y+dy[j]))ret++;
	return ret;
}
int main()
{
	int i,j,k;
	sd(n);sd(m);
	for(i=0;i<n;i++){
		cin>>arr[i];
	}
	for(i=0;i<n;i++)for(j=0;j<m;j++)answer[i][j]=arr[i][j];
	for(i=0;i<n;i++)for(j=0;j<m;j++){
		if(arr[i][j]!='#'){
			answer[i][j]=f(solve(i,j));
		}
	}
	for(i=0;i<n;i++){
		for(j=0;j<m;j++)cout<<answer[i][j];
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
using namespace std;
vector<int> cores;
vector<vector<int>> grid;
int main(){
	int h, w, n, rd;
	int ph = 0, pw = 0, sentido = 1;
	cin >> h >> w >> n;
	for(int i = 0; i < n; ++i){
		cin >> rd;
		cores.push_back(rd);
	}
	grid.resize(h);
	for(int i = 0; i < h; ++i){
		grid[i].resize(w);
	}
	for(int i = 0; i < n; ++i){
		int k = cores[i]; 
		for(int j = 0; j < k; ++j){
			grid[ph][pw] = i+1;
			if(pw + sentido >= w || pw + sentido < 0){
				sentido = -sentido;
				ph++;
			}
			else pw += sentido;
		}
	}
	for(auto i: grid){
		bool st = 1;
		for(auto j: i){
			if(!st) cout<<' ';
			else st = 0;
			cout<< j;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 384
#include <iostream>

std::string s1, s2, s3;
int i, j, k, cur;

void solve() {
    std::cin >> s1 >> s2 >> s3;
	cur = 0;
	i = 0;
    j = 0;
    k = 0;
	while (true) {
		if (cur == 0) {
            while (s1[i] == 'a')
                    i++;
            if (i == s1.length()) {
                std::cout << 'A' << std::endl;
                return;
            }
            else {
                if (s1[i] == 'c')
                    cur = 2;
                else 
                    cur = 1;
            }
            ++i;
		} else if (cur == 1) {
            while (s2[j] == 'b')
                j++;
            if (j == s2.length()) {
                std::cout << 'B' << std::endl;
                return;
            }
            else {
                if (s2[j] == 'c')
                    cur = 2;
                else
                    cur = 0;
            }
            ++j;
		} else {
            while (s3[k] == 'c') 
                k++;
            if (k == s3.length()) {
                std::cout << 'C' << std::endl;
                return;
            }
            else {
                if (s3[k] == 'a')
                    cur = 0;
                else
                    cur = 1;
            }
            ++k;
		}
	}
}

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


Measured memory_bytes: 3612
void main(){
	int[][] group = [[1,3,5,7,8,10,12],[4,6,9,11],[2]];
	int[] xy = inln();
	int x, y;
	foreach(i,elm; group){
		if(elm.count(xy[0]) != 0 && elm.count(xy[1]) != 0){
			writeln("Yes");
			return;
		}	
	}
	writeln("No");
}
     
import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math, std.range;
const long mod = 10^^9+7;      
// 1要素のみの入力
T inelm(T= int)(){
	return to!(T)( readln().chomp() );
}
     
// 1行に同一型の複数入力
T[] inln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split())ln ~= elm.to!T();
	return ln;
}


Measured memory_bytes: 2672
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds; 

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define f first
#define s second
#define sz(x) ll(x.size())
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;++i)
#define fore(i,l,r) for(int i=int(l);i<=int(r);++i)
#define rep(i,begin,end) for(__typeof(end) i=(begin);i!=(end);i++)
#define fill(a,value) memset(a,value,sizeof(a));
#define gcd(a,b) __gcd((a),(b))
#define watch1(x) cout << (x) << endl
#define watch2(x,y) cout << (x) << " " << (y) << endl
#define watch3(x,y,z) cout << (x) << " " << (y) << " " << (z) << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
 
typedef long long ll;
typedef long double ld; 
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
 
const ll mod = 1e9 + 9;
const int inf = 1e9 + 5;
const int N = 2e5 + 5;

int a[N];

signed main(){
    fastio;
    ll i,n;
    cin>>n;
    map<ll,ll> mp;
    for(i=1;i<=n;++i){
        cin>>a[i];
        mp[a[i]]++;
    }
    ll ans=0;
    for(auto it:mp)
        ans+=(it.s)*(it.s-1)/2;
    for(i=1;i<=n;++i){
        ll temp=ans-(mp[a[i]])*(mp[a[i]]-1)/2;
        temp+=(mp[a[i]]-1)*(mp[a[i]]-2)/2;
        cout<<temp<<endl;
    }
    return 0;
}

Measured memory_bytes: 10368
#include <stdio.h>

int main(void)
{
	int N,i,j;
	scanf("%d",&N);
	int one[N+1],two[N+1],three[N+1],mainasu[N+1];
	for(i=1;i<N+1;i++)
	{
		mainasu[i]=0;
		scanf("%d %d %d",&one[i],&two[i],&three[i]);
	}
	for(i=1;i<N+1;i++)
	{
		for(j=1;j<N+1;j++) //one???i??????
		{
			if(i!=j)
			{
				if(one[i]==one[j])
				{	
					mainasu[i]=mainasu[i]+one[i];
					break;
				}
			}
		}
		for(j=1;j<N+1;j++) //two???i??????
		{
			if(i!=j)
			{
				if(two[i]==two[j])
				{
					mainasu[i]=mainasu[i]+two[i];
					break;
				}
			}
		}
		for(j=1;j<N+1;j++) //three???i??????
		{
			if(i!=j)
			{
				if(three[i]==three[j])
				{
					mainasu[i]=mainasu[i]+three[i];
					break;
				}
			}
		}
	}	
	for(i=1;i<N+1;i++)printf("%d\n",one[i]+two[i]+three[i]-mainasu[i]);
	return 0;
}	

Measured memory_bytes: 1816
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#define rep(i, n) for(int i = 0; i < n; i ++)
#define COUNT(i, n) for(int i = 1; i <= n; i ++)
#define ITER(c) __typeof((c).begin())
#define each(c, it) for(ITER(c) it =(c).begin(); it!=(c).end(); it++)
#define ALL(c) c.begin(), c.end()
#define mp make_pair
#define pb push_back
#define MEMSET(v, h) memset((v), h, sizeof(v))
 
using namespace std; 

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = 1 << 24;
const string L = "ox";

int main(void){
    char res;
    for(string in; res = 'd', cin >> in; cout << res << endl){
        rep(i, 2)
            rep(m, 2){
                int cnt;
                rep(j, 3){
                    cnt = 0;
                    rep(k, 3) if(in.at((m ? j:k) + 3 * (m ? k:j)) == L.at(i)) cnt ++;
                    if(cnt == 3) res = L.at(i);
                }
                cnt = 0;
                rep(j, 3){
                    if(in.at(2 * m + (m ? 2:4) * j) == L.at(i)) cnt ++;
                }
                if(cnt == 3) res = L.at(i);
            }
    }
 
    return 0;
}

Measured memory_bytes: 1180
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string N;
    cin >>N;
    string res = "No";
    if(N[0] == '7') res = "Yes";
    if(N[1] == '7') res = "Yes";
    if(N[2] == '7') res = "Yes";
    
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3568
# include"stdio.h"
# include"math.h"
int main(){
    int n;
    scanf("%d",&n);
    double sum=0;
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        sum += a[i];
    }
    int med = (int)round(sum/n);
    int sc=0;
    for(int i=0;i<n;i++){
        sc += (med-a[i])*(med-a[i]);
    }
    printf("%d\n",sc );

}


Measured memory_bytes: 128
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
s=min((a-1)%10,(b-1)%10,(c-1)%10,(d-1)%10,(e-1)%10)+1
print(int(-(-a//10))*10+int(-(-b//10))*10+int(-(-c//10))*10+int(-(-d//10))*10+int(-(-e//10))*10+s-10)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
#define PUTS(x) cout << (x) << endl;
int main() {
    Int n, a, b;
    cin >> n >> a >> b;
    if (abs(a - b) % 2 == 0) {
        PUTS(abs(a - b) / 2);
    } else {
        PUTS(min((b-1+a-1+1)/2, (n-a+n-b+1)/2));
    }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using namespace std;


int main()
{
    int n,k;
    scanf("%d%d",&n,&k);
    vector<int> vec;
    for (int i=1;i<=k;++i) {
        int tmp;scanf("%d",&tmp);
        vec.push_back(tmp);
    }
    for (int i=k;i<n;++i){
        int tmp;scanf("%d",&tmp);
        if (tmp>vec[i-k]) printf("Yes\n");
        else printf("No\n");
        vec.push_back(tmp);
    }

}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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 (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){

  int n,a,b;
  cin >> n >> a >> b;
  if(n*a>b) cout << b fin;
  else cout <<n*a fin;
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var a string
	fmt.Scan(&a)

	az := "abcdefghijklmnopqrstuvwxyz"
	for _, r := range az {
		if r == rune(a[0]) {
			fmt.Println("a")
			return
		}
	}
	fmt.Println("A")
}


Measured memory_bytes: 1768
N = int(input())
S = list(input())

if len(S) <= 3:
    print(0)
    exit()

sorted_S = sorted(S)
c = [0, 0, 0]
j = 0
for i in range(len(sorted_S) - 1):
    if sorted_S[i] != sorted_S[i + 1]:
        if j == 0:
            c[j] = i + 1
            j += 1
        else:
            c[j] = (i + 1) - c[j - 1]
            j += 1

# print('c', c, j)
if j != 2:
    print(0)
    exit()
c[2] = N - c[0] - c[1]

condition1 = c[0] * c[1] * c[2]
# print('condition1', condition1)

condition2 = 0
for i in range(N):
    for d in range(N // 2 + 2):
        j = i + d
        k = j + d
        if j >= N or k >= N:
            continue
        # print('i, j, k', i, j, k)
        if (S[i] != S[j]) and (S[j] != S[k]) and (S[k] != S[i]):
            condition2 += 1
ans = condition1 - condition2
print(ans)


Measured memory_bytes: 73592
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  dp=[inf]*100010
  dp[0]=0
  dp[1]=0
  dp[2]=abs(l[1]-l[0])

  for i in range(2,n):
    dp[i+1]=min(dp[i-1]+abs(l[i]-l[i-2]),dp[i]+abs(l[i]-l[i-1]))

  return dp[n]

print(main())


Measured memory_bytes: 16708
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
	int N, K;

	cin >> N >> K;

	vector<char>  S(N);
	int i = 0;
	while (i < N) {
		cin >> S[i];
		i++;
	}

	if (S[K - 1] == 'A') {
		S[K - 1] = 'a';
	}
	else if (S[K - 1] == 'B') {
		S[K - 1] = 'b';
	}
	else {
		S[K - 1] = 'c';
	}

	int j = 0;
	while (j < N) {
		cout << S[j];
		j++;
	}
	

	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
	long long int n ,a , b;
	cin >> n >> a >> b;

	if(n == 1)
	{
		if(a == b)
			cout << "1";
		else
			cout << "0";
	}
	else
	{
		if(a > b)
			cout << "0";
		else
		{
			long long int min = (n - 1) * a + b;
			long long int max = (n - 1) * b + a;
			cout << max - min + 1;
		}

	}


	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int,int>;
/* ちゃんと考えてわかって実装 */

const int INF = 2147480000;

int main(void){

    ll H, N;
    vector<ll> A, B;
    cin >> H >> N;
    for(ll i=0; i<N; i++){
        ll a, b; cin >> a >> b;
        A.push_back(a);
        B.push_back(b);
    }

    ll max_A = 0;
    for(ll i=0; i<N; i++){
        max_A = max(max_A, A[i]);
    }

    ll dp[1005][20200];
    for(ll i=0; i<=N; i++){
        for(ll j=0; j<=H+max_A; j++){
            dp[i][j] = INF;
        }
    }

    dp[0][0] = 0;
    for(ll i=0; i<N; i++){
        for(ll j=0; j<=H+max_A; j++){
            if(j - A[i] < 0){
                dp[i+1][j] = dp[i][j];
            }
            else{
                dp[i+1][j] = min(dp[i][j], dp[i+1][j - A[i]] + B[i]);
            }
        }
    }
    ll ans = INF;
    for(ll i=H; i<=H+max_A; i++){
        ans = min(ans, dp[N][i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 158080
s=input()
a=0
if len(s)%2==1:
  a=1
for i in range(len(s)):
  if i%2==0:
    if s[i]!="h":
      a=1
  else:
    if s[i]!="i":
      a=1
if a==0:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll M = 1000000000+7;
ll RS(ll N, ll P, ll Mod){if(P==0)return 1;else if(P%2==0){ll sq=RS(N,P/2,Mod);return sq*sq%Mod;}else{return N*RS(N,P-1,Mod)%Mod;}} //power(mod)(repeat-square,fast)

 int main(void){
  ll n,a,b;
  cin >> n >> a >> b;
  ll ans;
  ans = RS(2,n,M); // nから任意個選ぶ組み合わせ=2^n (0本の花束はないので、後で1引く)
  
  ll abunbo=1,abunshi=n;
  for (int i = 1; i < a; i++){
    abunshi = abunshi * (n-i) % M;
    abunbo = abunbo * (i+1) % M;
  }
  ll acomb = abunshi * RS(abunbo, M-2, M) % M;
  ll bbunbo=1,bbunshi=n;
  for (int i = 1; i < b; i++){
    bbunshi = bbunshi * (n-i) % M;
    bbunbo = bbunbo * (i+1) % M;
  }
  ll bcomb = bbunshi * RS(bbunbo, M-2, M) % M;
  
  ans -= (acomb + bcomb + 1) % M;
  if (ans < 0) ans += M;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.StringTokenizer;

public class Main implements Closeable {

  private InputReader in = new InputReader(System.in);
  private PrintWriter out = new PrintWriter(System.out);

  private long power(long a) {
    return a * a * a * a * a;
  }

  public void solve() {
    int x = in.ni();
    long limit = 0;
    final long MAX_N = (long) 1e18;
    List<Long> list = new ArrayList<>();
    while (power(limit) <= MAX_N) {
      list.add(limit);
      list.add(-limit);
      limit++;
    }
    list.sort(Comparator.naturalOrder());
    for (int i = 0; i < list.size(); i++) {
      for (int j = 0; j < list.size(); j++) {
        if (power(list.get(i)) - power(list.get(j)) == x) {
          out.println(list.get(i) + " " + list.get(j));
          return;
        }
      }
    }
  }

  @Override
  public void close() throws IOException {
    in.close();
    out.close();
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int ni() {
      return Integer.parseInt(next());
    }

    public long nl() {
      return Long.parseLong(next());
    }

    public void close() throws IOException {
      reader.close();
    }
  }

  public static void main(String[] args) throws IOException {
    try (Main instance = new Main()) {
      instance.solve();
    }
  }
}


Measured memory_bytes: 37352
#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{
int n,k,a,i,ans=0;
  cin>>n>>k;
  for(i=0;i<n;i++)
  {
    cin>>a;
    if(a>=k)ans++;
    
  }
  cout<<ans<<endl;
}

 

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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 (b<a) { a=b; return 1; } return 0; }



int n;
char c[1010];
void solve(){
	cin >> n;
	set<char> s;
	for(int i = 0; i < n; i++){
		cin >> c[i];
		s.insert(c[i]);
	}
	
	if(s.size() == 4) cout << "Four" << endl;
	else cout << "Three" << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll n,m;
ll a[22],p[22];
ll f[1<<20];

int main(){
  cin>>n>>m;
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>p[i];
  rep(i,1<<n){
    ll lcm=1;
    rep(j,n){
      if(!((i>>j)&1))continue;
      ll g=__gcd(a[j],lcm);
      ll rest=a[j]/g;
      if(rest>9e18/lcm){
        lcm=m+1;
        break;
      }else lcm*=rest;
    }
    f[i]=m/lcm;
  }
  rep(i,n){
    rep(j,1<<n){
      if(j&1<<i)f[j]-=f[j^1<<i];
    }
  }
  double res=0;
  rep(i,1<<n){
    double prob=1;
    rep(j,n){
      if(!((i>>j)&1)) prob*=(double)(100-p[j])/100.0;
      else prob*=(double)p[j]/100.0;
    }

    res+=(m-abs(f[i]))*prob;
  }
  printf("%.10f\n", res);
  return 0;
}



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

const int N = 100010;

int n, a[N];

bool solve(){
	int even = 0, odd = 0, sit;
	for (int i = 0; i < n; ++ i){
		if (a[i] & 1){
			++ odd;
			sit = i;
		}
		else{
			++ even;
		}
	}
	if (even & 1){
		return true;
	}
	if (odd > 1){
		return false;
	}
	if (a[sit] == 1){
		return false;
	}
	-- a[sit];
	int gcd = std::__gcd(a[0], a[1]);
	for (int i = 2; i < n; ++ i){
		gcd = std::__gcd(gcd, a[i]);
	}
	for (int i = 0; i < n; ++ i){
		a[i] /= gcd;
	}
	return !solve();
}

int main(){
	scanf("%d", &n);
	for (int i = 0; i < n; ++ i){
		scanf("%d", &a[i]);
	}
	if (n == 1){
		return printf(n == 1 ? "Second\n" : "First\n"), 0;
	}
	return printf(solve() ? "First\n" : "Second\n"), 0;
}

Measured memory_bytes: 768
#include <vector>
#include <iostream>
#include <map>
#include <cstdio>
using namespace std;

int main(){
  const double INF = 1e9;
  int N;
  cin >> N;
  map<int,double> ma[2], mi[2];
  for(int i = 0; i < 2; ++i){
    for(int d = -1; d < 2; ++d){
      ma[i][d] = -INF;
      mi[i][d] = INF;
    }
  }
  for(int i = 0; i < N; ++i){
    double x[2];
    char d;
    cin >> x[0] >> x[1] >> d;
    int D[2];
    if(d == 'R'){
      D[0] = 1;
      D[1] = 0;
    }
    if(d == 'L'){
      D[0] = -1;
      D[1] = 0;
    }
    if(d == 'U'){
      D[0] = 0;
      D[1] = 1;
    }
    if(d == 'D'){
      D[0] = 0;
      D[1] = -1;
    }
    for(int j = 0; j < 2; ++j){
      ma[j][D[j]] = max(ma[j][D[j]],x[j]);
      mi[j][D[j]] = min(mi[j][D[j]],x[j]);
    }
  }

  auto f_min = [&](int xy, double x){
                 double ret = INF;
                 for(int d = -1; d < 2; ++d){
                   ret = min(ret,mi[xy][d]+d*x);
                 }
                 return ret;
               };

  auto f_max = [&](int xy, double x){
                 double ret = -INF;
                 for(int d = -1; d < 2; ++d){
                   ret = max(ret,ma[xy][d]+d*x);
                 }
                 return ret;
               };

  auto area = [&](double x){
                return (f_max(0,x)-f_min(0,x))*(f_max(1,x)-f_min(1,x));
              };

  vector<double> T(1,0);
  T.push_back(INF);

  for(int i = 0; i < 2; ++i){
    for(int d = -1; d < 2; ++d){
      for(int d_ = d+1; d_ < 2; ++d_){
        double t = (ma[i][d_]-ma[i][d])/(d-d_);
        T.push_back(t);
        t = (mi[i][d_]-mi[i][d])/(d-d_);
        T.push_back(t);
      }
    }
  }

  double ans = area(0);
  for(auto t : T){
    if(t < 0) continue;
    ans = min(ans,area(t));
  }

  printf("%.12f\n",ans);
}


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

public class Main{
  public static void main(String[] args){
    try {
      Scanner sc = new Scanner(System.in);
      int d;
      d=Integer.parseInt(sc.next());

      System.out.print("Christmas");
      for(int i=0; i<25-d; i++){
        System.out.print(" Eve");
      }
      System.out.println("");
      
      }catch (Exception e) {
      System.out.println("out");
    }
  }
}


Measured memory_bytes: 22228
N = int(raw_input())
A = map(int, raw_input().split())

cnt = 0
v = None
u = True
d = True
for a in A:
    if v == None:
        v = a
        cnt += 1
    elif a > v:
        if u == False:
            cnt += 1
            u = True
            d = True
        else:
            d = False
    elif a < v:
        if d == False:
            cnt += 1
            u = True
            d = True
        else:
            u = False
    v = a
print cnt

Measured memory_bytes: 11320
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        while(!isPrime(x)){
            x++;
        }
        System.out.println(x);
        scan.close();
    }
    
    public static boolean isPrime(int x){
        for(int i = 2; i <= Math.sqrt(x); i++){
            if(x % i == 0) return false;
        }
        return true;
    }
}

Measured memory_bytes: 26956
//#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#define MAX_INT 2100000000
using namespace std;
typedef long long int ll;
//#include "Header.h"
int first[110], n, i, j, mn = 0,last=0,length;
vector<int> ans;
int main()
{
	int n, q, l, r, i, j;
	static int cnt[100000 + 10];
	string s;
	vector<int> ans;
	cin >> n >> q >> s;
	cnt[0] = 0;
	for (i = 1; i < s.length(); i++)
	{
		if (s[i] == 'C'&&s[i - 1] == 'A') cnt[i] = cnt[i - 1] + 1;
		else cnt[i] = cnt[i - 1];
		//cout << cnt[i] << endl;
	}
	for (i = 1; i <= q; i++)
	{
		cin >> l >> r;
		ans.push_back(cnt[r - 1] - cnt[l - 1]);
	}
	for (i = 0; i < ans.size(); i++)
	{
		cout << ans[i] << endl;
	}
}


Measured memory_bytes: 1912
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long int ll;
typedef unsigned long long int ull;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >>n;
  ull m=1e+18,ans=1;
  multiset<ull> a;
  rep(i,n){
    ull u;
    cin >>u;
    a.insert(u);
  }
  for(auto itr = a.begin(); itr != a.end(); ++itr){
    if(*itr==0){
      cout <<0;
      return 0;
    }
    if(*itr>m/ans){
      cout <<-1;
      return 0;
    }
    ans*=*itr;
    //cout <<m/ans<<endl;
  }
  cout <<ans;
}

Measured memory_bytes: 8280
#include<stdio.h>
int main(void){
    int n,k;
    int height[100000];
    scanf("%d %d",&n,&k);
    int i=0,sum = 0;
    for(i=0;i<n;i++){
        scanf("%d",&height[i]);
    if(k <= height[i]){
        sum = sum + 1;
    }
    }
    printf("%d\n",sum);
    return 0;
}

Measured memory_bytes: 512
n = int(input())
s = input()
s = list(map(lambda x: 0 if x == 'W' else 1, s))
ans = 300000
beright = [0 for i in range(n)]
beleft = [0 for i in range(n)]
for i in range(1, n):
    beright[i] = beright[i-1] + abs(s[i-1] - 1)
    beleft[-i-1] = beleft[-i] + s[-i]

for br, bl in zip(beright, beleft):
    ans = min(ans, br + bl)

print(ans)


Measured memory_bytes: 29516
#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++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  rep2(i, 1, n + 1) cin >> a[i];
  if (n % 2 != 0) {
    for (int i = n; i > 0; i -= 2) {
      cout << a[i];
      if (n != 1) cout << " ";
    }
    for (int i = 2; i <= n - 1; i += 2) {
      cout << a[i];
      if (i != n - 1) cout << " ";
    }
    cout << endl;
  } else {
    for (int i = n; i >= 2; i -= 2) {
      cout << a[i] << " ";
    }
    for (int i = 1; i <= n - 1; i += 2) {
      cout << a[i];
      if (i != n - 1) cout << " ";
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 2944
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner a = new Scanner(System.in);
        int n = a.nextInt();
        int A[] = new int[n];
        for(int i=0; i<n; i++){
            A[i] = a.nextInt();
        }
        int flag = 1;
        int count = 0;
        while(flag==1){
            flag = 0;
            for(int i=n-1; i>=1; i--){
                if(A[i] < A[i-1]){
                    A[i] = A[i] + A[i-1];
                    A[i-1] = A[i] - A[i-1];
                    A[i]= A[i] - A[i-1];
                    flag = 1;
                    count++;
                }
            }       
        }
        for(int i=0; i<n; i++){
            System.out.print(A[i]);
            if(i<n-1){
                System.out.print(" ");
            }
        }
        System.out.println();
        System.out.println(count);
    }
}


Measured memory_bytes: 26352
import java.util.Scanner;

public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] a = new int[100000];

    for (int p = 1; p <= 100; p++){
      for(int q = 1; q <= 100; q++){
        for(int r = 1; r <= 100; r++){
          int s = p*p+q*q+r*r+p*q+q*r+r*p;
          if(s <= N){
            a[s]++;
          }
        }
      }
    }

    for(int i = 1; i <= N; i++){
      System.out.println(a[i]);
    }
    
  }
}


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

typedef long long ll;

int main() {
    string S;
    int K;
    cin >> K;
    cin >> S;

    if (S.size() <= K) {
        cout << S << endl;
    } else {
        for (int i = 0; i < K; i++) {
            cout << S[i];
        }
        cout << "..." << endl;
    }
}


Measured memory_bytes: 3596
# https://atcoder.jp/contests/abc087/tasks/arc090_b
# ノードL→RへのコストはDであるとすれば、有向グラフと見なせる
# 任意のノードからbfsをしてメモしていけば良い
# 連結していないグラフがあるかもしれない。(だけど連結していないグラフはお互いに独立)


import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


from collections import defaultdict, deque

N, M = read_ints()
graph = defaultdict(lambda: [])  # 有向グラフ、隣接リスト形式
for _ in range(M):  # データ読み込み
    l, r, d = read_ints()
    l -= 1
    r -= 1
    graph[l].append((r, d))
    graph[r].append((l, -d))

# bfs
X = [None] * N  # visitedも兼ねる


def bfs(u):  # スタートするノードを入れる
    que = deque([(u, 0)])  # (今のノード,今の座標)
    X[u] = 0
    while que:
        u, x = que.popleft()
        # print(u, x)
        for nu, add in graph[u]:
            nx = x + add
            if X[nu] == nx:
                continue
            # 次の探索
            if X[nu] is not None and X[nu] != nx:
                print('No')
                exit()
            X[nu] = nx
            que.append((nu, nx))


for u in range(N):
    if X[u] is None:
        bfs(u)
print('Yes')


Measured memory_bytes: 86364
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int x;
    cin >> x;
    int a = x;
    int num = 1;
    while(1) {
        if (a == 0) break;
        a = (a + x) % 360;
        ++num;
    }
    cout << num << endl;
    return 0;
}


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

int main(){

int n;
cin>>n;int a;
vector<int>d;int cn=0;
for(int i=0;i<n;i++)
    {cin>>a;d.push_back(a);}
sort(d.begin(),d.end(),greater<int>());
/*
for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++)
    {
        for(int k=j+1;k<n;k++){
            if(d[i]<d[j]+d[k] && d[j]<d[i]+d[k] && d[k]<d[j]+d[i])
                cn++;
        }
    }
}*/
for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++)
    {
        for(int k=j+1;k<n;k++){
            if(d[i]<d[j]+d[k] && d[j]<d[i]+d[k] && d[k]<d[j]+d[i])
                cn++;
        }
    }
}
cout<<cn<<endl;
}


Measured memory_bytes: 256
#pragma region header
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <stdio.h>
#include <string.h>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
template <class T> ll size(const T& x) { return x.size(); }
#define rep(i,a,b) for(ll i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
#define MOD 1000000007;
#define MOD2 998244353;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
template <class T> T smod(T a, T b) {
	return (a % b + b) % b;
}

const int INF = ~(1 << 31);
const double pi = acos(-1);
const double EPS = 1e-9;

#pragma endregion

/*vector<int> edg[100100];
bool active[100100];
int depth[100100];
bool vis[100100];
bool print = false;
vector<int> ans;
void dfs(int at, int dep){
	if(vis[at]) return;
	if(print){
		ans.pb(at);
		return;
	}
	if(active[at] && dep-depth[at] >= 2){
		print = true;
		ans.pb(at);
		return;
	}
	depth[at] = dep;
	active[at] = true;
	vis[at] = true;
	rep(i,0,edg[at].size()){
		dfs(edg[at][i],dep+1);
	}
	active[at] = false;
}*/

ll cntdivisors(ll n)
{
	ll cnt = 0;
	rep(i, 2, floor(sqrt(n)) + 1)
	{
		if (n % i == 0)
		{
			cnt++;
			//cout << i << endl;
		}
	}
	return cnt;
}

int main() {
	ll n;
	cin >> n;
	if (n == 2)
	{
		cout << 1 << endl;
		return 0;
	}
	set<ll> D;
	set<ll> ans;
	rep(i, 2, floor(sqrt(n))+1)
	{
		if (n % i == 0)
		{
			D.insert(i);
		}
	}
	ll cnt = 0;
	iter(it, D)
	{

		//cout << *it << endl;
		bool f = false;
		ll cur = *it;
		while (n%cur == 0 && n >= cur)
		{
			//cout << cur << endl;
			if (cur == n)
			{
				cnt++;
				ans.insert(*it);
				f = true;
			}
			cur *= (*it);
		}
		cur /= *it;
		ll num = n / cur;
		if (num % (*it) == 1) if (!f)
		{
			ans.insert(*it);
			cnt += 1;
		}
	}
	ll cnt2 = 0;
	n--;
	rep(i, 2, floor(sqrt(n)) + 1)
	{
		if (n % i == 0)
		{
			ans.insert(i);
			ans.insert(n / i);
			cnt2 += 2;
			if (i == floor(sqrt(n))) cnt2--;
		}
	}
	//iter(it, ans) cout << *it << ' '; cout << endl;
	cout << ans.size() + 2<< endl;
	//cout << cnt + cnt2 + 2 << endl;
}


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

int main(void)
{
  double x[21], y[21], s=0.0;
  int n = 0, i;
  y[0] = 0;

  while(scanf("%lf,%lf", &x[n+1], &y[n+1]) != EOF){
    n++;
  }
 
  x[0] = x[n];
  x[n+1] = x[1];

  for(i = 1; i <= n; i++){
    s += (x[i-1] - x[i+1])*y[i];
  }
  s *= -0.5;

  printf("%f\n", fabs(s));

  return 0;
}

Measured memory_bytes: 652
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ul unsigned long long int
#define ld long double
const ll INF = 1000000007;
const ld PI = 3.141592653589;
#define endl "\n"
#define pb push_back
#define mp make_pair
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (a*b)/__gcd(a,b);}

int main(){
    FAST_IO;
    ll _=1;
    //cin>>_;
    for(ll ii=1;ii<=_;ii++)
    {
		string s;cin>>s;
		cout<<s[0]<<s[1]<<s[2];
	}
	//cout<< "Done in " <<fixed<<setprecision(15)<<(double)clock()/7.33e8<<"sec"<< endl;
    return 0;
}


Measured memory_bytes: 3576
int selectionSort(int A[], int N) {
  int i, j, t, sw = 0, mini;
  for(i=0;i<N-1;i++) {
    mini = i;
    for(j=i; j<N; j++) {
      if(A[j] < A[mini]) mini = j;
    }
    t = A[i]; A[i] = A[mini]; A[mini] = t;
    if(i != mini) sw++;
  }
  return sw;
}

int main(void) {
  int A[100], N, i, sw;
  scanf("%d", &N);
  for(i=0;i<N;i++) scanf("%d",&A[i]);

  sw = selectionSort(A,N);

  for(i=0;i<N;i++) {
    if(i>0) printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n", sw);

  return 0;
}

Measured memory_bytes: 604
from collections import defaultdict
import itertools

N, M = map(int, input().split())
a = [0]+list(itertools.accumulate(map(int, input().split())))

d = defaultdict(int)
for i in a:
    d[i%M] += 1

print(sum(x*(x-1)//2 for x in d.values()))

Measured memory_bytes: 15404
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1000010,P=1000000007;
ll f[N];
int main(){
	ll n,sum=0,ans=0;
	cin>>n;
    f[1]=1;
	for(ll i=1;i<=n;i++){
        f[i]=(f[i]+f[i-1])%P;
        if(i>=3) f[i]=((f[i]+sum-f[i-1]-f[i-2])%P+P)%P;
		if(i<n) ans=(ans+f[i]*(n-1)%P*(n-1)%P)%P;
		if(i<n-1) ans=(ans+f[i]*(i+1)%P)%P;
		else ans=(ans+f[i]*i%P)%P;
		sum=(sum+f[i])%P;
    }
	cout<<ans<<endl;
}



Measured memory_bytes: 8064
#include<stdio.h>
 
int main(){
int i;
int a,b,sx,sy,tx,ty;
scanf("%d %d %d %d",&sx,&sy,&tx,&ty);
b=tx-sx;
a=ty-sy;
	for(i=0;i<a;i++) printf("U");
	for(i=0;i<b;i++) printf("R");
	for(i=0;i<a;i++) printf("D");
	for(i=0;i<=b;i++) printf("L");
	for(i=0;i<=a;i++) printf("U");
	for(i=0;i<=b;i++) printf("R");
  printf("DR");
	for(i=0;i<=a;i++) printf("D");
	for(i=0;i<=b;i++) printf("L");
  printf("U\n");
	return 0;
}

Measured memory_bytes: 128