akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

/*
位置，進行方向
tim [0][x][y]東西 x→x+1
tim [1][x][y]南北 y→y+1
方向
 3
2 0
 1
*/

int tim[2][60][60],sig[60][60],size[101],q[101][10000][3],mk[20][20][4][101];
int M,N,FR,TO,GX,GY,ANS,SET;

void mark(int x,int y,int dir,int t){
	int tx=x-(dir%2)*((dir/2)*2-1);
	int ty=y-((dir+1)%2)*((dir/2)*2-1);

	//if(t<7)printf("%d-%d (%d)→ %d-%d\n",x,y,dir,tx,ty);
	if(tx<0 || tx>=M || ty<0 || ty>=N)return;

	int ttt=tim[dir%2][x-(dir%2)*(dir/2)][y-((dir+1)%2)*(dir/2)];
	if(ttt<0)return;
	ttt+=t;

	if(mk[tx][ty][dir][ttt]==SET)return;
	if(ttt>100)return;
	if(sig[tx][ty]!=0 && (ttt/sig[tx][ty])%2==dir%2)return;

	q[ttt][size[ttt]][0]=tx;
	q[ttt][size[ttt]][1]=ty;
	q[ttt][size[ttt]][2]=dir;
	size[ttt]++;
	if(tx==GX && ty==GY && ANS>ttt)ANS=ttt;
	mk[tx][ty][dir][ttt]=SET;
	//if(ttt<7)printf("%d-%d %d → %d-%d,%d\n",x,y,t,tx,ty,ttt);
}

void check(int i,int j){
	int x=q[i][j][0];
	int y=q[i][j][1];
	int d=q[i][j][2];
	int k;
	for(k=-1;k<=1;k++)mark(x,y,(d+k+4)%4,i);
}

int main(){
    int i,j,k,ay,by,val;
	char ax,bx;

    while(scanf("%d %d",&M,&N)*M*N){
		SET++;

		scanf("%d",&k);
		for(i=0;i<M;i++){
			for(j=0;j<N;j++){
				tim[0][i][j]=k;
				tim[1][i][j]=k;
				sig[i][j]=0;
			}
		}

		scanf("%d%*c",&k);
		for(i=0;i<k;i++){
			scanf("%c%*c%d %d%*c",&ax,&ay,&val);
			sig[ax-'a'][ay-1]=val;
		}

		scanf("%d%*c",&k);
		for(i=0;i<k;i++){
			scanf("%c%*c%d %c%*c%d%*c",&ax,&ay,&bx,&by);
			if(bx==ax && by-ay==1)tim[0][ax-'a'][ay-1]=-1;
			else if(bx-ax==1 && by==ay)tim[1][ax-'a'][ay-1]=-1;
		}

		scanf("%d%*c",&k);
		for(i=0;i<k;i++){
			scanf("%c%*c%d %c%*c%d %d%*c",&ax,&ay,&bx,&by,&val);
			if(bx==ax && by-ay==1)tim[0][ax-'a'][ay-1]+=val;
			else if(bx-ax==1 && by==ay)tim[1][ax-'a'][ay-1]+=val;
		}

		scanf("%c%*c%d %c%*c%d%*c",&ax,&ay,&bx,&by);

		q[0][0][0]=ax-'a';
		q[0][0][1]=ay-1;
		q[0][0][2]=0;
		size[0]=1;
		GX=bx-'a';GY=by-1;
		FR=0;TO=1;ANS=101;

		//for(i=0;i<M;i++){for(j=0;j<N;j++){printf("%3d",sig[i][j]);}printf("\n");}printf("\n");
		//for(i=0;i<M;i++){for(j=0;j<N;j++){printf("%3d",tim[0][i][j]);}printf("\n");}printf("\n");
		//for(i=0;i<M;i++){for(j=0;j<N;j++){printf("%3d",tim[1][i][j]);}printf("\n");}printf("\n");
		
		for(i=1;i<101;i++)size[i]=0;

		for(i=0;i<ANS;i++){
			for(j=0;j<size[i];j++){
				check(i,j);
			}
			//printf("%dmin size=%d\n",i,size[i]);
			//if(size[i]>2000)fprintf(stderr,"Danger!!\n");
		}

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

    }
 
    return 0;
}

Measured memory_bytes: 11172
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)

	l := make([]int, n)
	for i := range l {
		fmt.Scan(&l[i])
	}

	sort.Ints(l)

	sum := 0
	for i := 0; i < len(l)-1; i++ {
		sum += l[i]
	}

	if sum > l[n-1] {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}


Measured memory_bytes: 512
#include <stdio.h>


int main(void){

	char str[200];
	int i,j,k,l;
	int y=1;
	int ans=0;
	
	for(i=0;i<101;i++){
		scanf("%c",&str[i]);
		if(str[i]=='\n'){
			break;
		}
	}
	
	for(k=0;k<i;k++){
		str[i+k]=str[k];
	}
	
	char p[i];
	
	for(j=0;j<i;j++){
		scanf("%c",&p[j]);
		if(p[j]=='\n'){
			break;
		}
	}
	
	for(k=0;k<i;k++){
		for(l=0;l<j;l++){
			if(str[k+l]!=p[l]){
				y=0;
			}
		}
		ans=ans+y;
		y=1;
	}
	
	if(ans>0){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 2672
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, s, n) for (int i = (s); i < (n); ++i)
#define rrep(i, n, g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define len(x) (int)(x).size()
#define dup(x, y) (((x) + (y)-1) / (y))
#define pb push_back
#define Field(T) vector<vector<T>>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int x, y;
  cin >> x >> y;
  if (x + y >= 10)
    cout << "error" << endl;
  else
    cout << x + y << endl;
}

Measured memory_bytes: 3504
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;

#if DEBUG && !ONLINE_JUDGE
    ifstream input_from_file("input.txt");
    #define cin input_from_file
#else

#endif



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); // Togliere nei problemi con query online

    LL N;
    cin >> N;
    int qq = 0;
    vector<LL> primes;
    vector<LL> esp;
    for (LL p = 2; p*p <= N; p++) {
        if (N % p == 0) {
            primes.push_back(p);
            esp.push_back(0);
            while (N % p == 0) esp[qq]++, N /= p;
            qq++;
        }
    }
    if (N > 1) primes.push_back(N), esp.push_back(1), qq++;
    int res = 0;
    for (int i = 0; i < qq; i++) {
        int k = 0;
        while ((k+1)*(k+2)/2 <= esp[i]) k++;
        res += k;
    }
    cout << res << "\n";
}


Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


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

  int x;
  cin >> x;
  if(x==3 || x==5 || x==7) cout <<  "YES" << endl;
  else cout << "NO" << endl;
  
  
  return 0;
    

}


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

using namespace std;

// Optimization stuff
inline void debugMode() {
    #ifndef ONLINE_JUDGE
    freopen("debug.in", "r", stdin);
    #endif // ONLINE_JUDGE
}

inline void optimizeIt() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
}
// End optimization stuff

inline double ABS(const int &x) {
    return max(x, -x);
}

inline bool isPrime(const int &x) {
    if(x == 1) return false;

    for(int d = 2; d * d <= x; d++) {
        if(x % d == 0) return false;
    }

    return true;
}

typedef long long int ll;

const int NMax = 1e6 + 5;
const int LIM = 1e6;
const int MOD = 666013;

int main(){
    //debugMode();
    optimizeIt();

    int n;
    cin >> n;

    int ans = 0;
    int i;
    for(i = 1; ans < n; i++) ans += i;

    cout << i - 1;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>
#include <deque>
#include <complex>

using namespace std;

/*
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
*/

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<long long, long long> pll;
typedef vector<pll> vpll;

typedef long double ld;
typedef vector<ld> vld;

typedef vector<bool> vb;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, n) for (ll i = 1; i <= (n); i++)
#define rrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rreps(i, n) for (ll i = (n); i >= 1; i--)
#define all(v) (v).begin(), (v).end()

template <class T> void chmin(T& a, T b) { a = min(a, b);}
template <class T> void chmax(T& a, T b) { a = max(a, b);}

constexpr int INF = 1 << 30;
constexpr ll INFL = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr ld EPS = 1e-12;
ld PI = acos(-1.0);

bool dfs(vector<vpll>& g, ll cur, ll t, vll& hist, ll par) {
    if(cur == t) return true;
    for(auto& p : g[cur]) {
        if(p.first == par) continue;
        hist.push_back(p.second);
        if(dfs(g, p.first, t, hist, cur)) return true;
        hist.pop_back();
    }
    return false;
}

void solve() {
    ll n;
    cin >> n;
    vector<vpll> g(n);
    for(ll i = 0; i < n - 1; i++) {
        ll a, b;
        cin >> a >> b;
        a--, b--;
        g[a].push_back(make_pair(b, i));
        g[b].push_back(make_pair(a, i));
    }

    ll m;
    cin >> m;
    vll path(m);
    for(ll i = 0; i < m; i++) {
        ll u, v;
        cin >> u >> v;
        u--, v--;
        vll hist;
        dfs(g, u, v, hist, -1);
        for(auto j : hist) path[i] |= (1ll << j);
    }

    ll ans = 0;
    for(ll i = 0; i < (1 << m); i++) {
        ll lpath = 0;
        ll lans = 0;
        for(ll j = 0; j < m; j++) {
            if(!(i & (1 << j))) continue;
            lpath |= path[j];
        }
        lans = 1ll << (n - 1 - __builtin_popcountl(lpath));
        if(__builtin_popcountl(i) % 2) ans -= lans;
        else ans += lans;
    }
    cout << ans << endl;
    return;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
    int x, sum = 0;
    scanf("%d", &x);
    for(int i = 1; i <= x; i++) {
        for(int j = 1; j <= x; j++) {
            int now = __gcd(i, j);
            for(int k = 1; k <= x; k++) {
                sum += __gcd(now, k);
            }
        }
    }
    printf("%d\n", sum);

    return 0;
}


Measured memory_bytes: 1732
typedef long long ll;
// typedef long long long long;
#include <bits/stdc++.h>
using namespace std;
ll const MOD = 1e9+7;
long long modpow(long long a, long long n) {
      long long res = 1;
      while (n > 0) {
          if (n & 1) res = res * a % MOD;
          a = a * a % MOD;
          n >>= 1;
      }
  return res;
  }
ll inv_mul(ll x, ll y){
     return (x % MOD* modpow(y,MOD-2))%MOD;
 }
int main() {
    ll n;
    std::cin >> n;
    
    vector<ll> a(n);
    vector<ll> b(n);

    map<ll,ll> lcm;
    vector<map<ll,ll>> soin(n);

    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
        b[i]=a[i];
        for (int j = 2; j <= sqrt(a[i]); j++) {
            while(a[i]%j==0){
                soin[i][j]++;
                a[i]/=j;
            }
        }
        if(a[i]!=1){
            soin[i][a[i]]++;
        }
        
        for (auto e : soin[i]) {
            lcm[e.first] = max(lcm[e.first],e.second);
        }
    }
    ll res = 0;
    
    ll res_lcm = 1;
    
    for (auto e : lcm) {
        res_lcm *= modpow(e.first,e.second)%MOD;
        res_lcm %= MOD;
    }
    for (int i = 0; i < n; i++) {
        res += inv_mul(res_lcm,b[i]);
        
        res %=MOD;
    }
    
    std::cout << res << std::endl;
}

Measured memory_bytes: 3968
#include<stdio.h>
int main(void)
{int x,y,z,temp;
scanf("%d%d%d",&x,&y,&z);
if(x<y)
{
	temp=x;x=y;y=temp;	
}
if(x<z)
{
	temp=x;x=z;z=temp;

}
printf("%d",y+z); 
	
return 0;
} 

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int solve(string s)
{
	int ans = 0,x=-1,i;
	for( i = 0;i<s.length(); i++)
	{
		if(s[i]=='B')
		{
			if(i-x>1)
				ans++;
			x = i;
		}
	}
	ans = ans *2;	
	return ans ;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin>>s;
	int g =0,z=0,ans=0;
	for(int i = 0; i<s.length(); i++)
	{
		if(s[i]=='W')
		{
			g = i;
			if(i!=0)
				ans++;
			break;
		}
	}
	s= s.substr(g);
	reverse(s.begin(),s.end());
	for(int i = 0; i<s.length(); i++)
	{
		if(s[i]=='W')
		{
			g = i;
			if(i!=0)
				ans++;
			break;
		}
	}
	s= s.substr(g);
	int ans2 = solve(s);
	reverse(s.begin(),s.end());
	ans2 = min(ans2,solve(s));
	cout<<ans+ans2<<endl;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <set>
#include <map>
#define range(i, r) for(int i=0;i<r;i++)
#define ranges(i, l, r) for(int i=l;i<r;i++)
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
#define MODn 1000000009;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  ll N, x;
  std::cin >> N >> x;
  if(x == 1 || x == 2*N-1){
    std::cout << "No" << '\n';
  }else{
    std::cout << "Yes" << '\n';
    std::vector<int> num;
    for(int i=1;i<=2*N-1;i++) if(i!=x-1&&i!=x&&i!=x+1) num.push_back(i);
    for(int i=1;i<N-2;i++) std::cout << num[i] << '\n';
    if(N>=3)std::cout << num[2*N-5] << '\n';
    std::cout << x-1 << '\n' << x << '\n' << x+1 << '\n';
    if(N>=3)std::cout << num[0] << '\n';
    for(int i=N-2;i<2*N-5;i++) std::cout << num[i] << '\n';
  }
  return 0;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
 
using namespace std;
 
int n;
vector<int> vec;
 
void rec(int N, int M){
    if(N == 0){
	int size = vec.size();
	for(int i = 0 ; i < size ; i++){
	    cout << vec[i] << (i != size-1 ? ' ' : '\n');
	}
    }else{
	for(int i = 0 ; i < M ; i++){
	    if(N - M + i >= 0){
		vec.push_back(M-i);
		rec(N - M + i, M - i);
		vec.pop_back();
	    }
	}
    }
}
 
int main(){
    while(cin >> n, n){
	rec(n, n);
    }
    return 0;
}

Measured memory_bytes: 3040
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
constexpr ll mod = 1e9 + 7;
#define endl '\n'


constexpr ll MAXN = 1e6+10;
vector<int> smallest_factor;
vector<bool> prime;
vector<int> primes;
 
void sieve() {
    // (C: https://codeforces.com/contest/1366/standings/page/1, D, neal)
    ll maximum = max(MAXN, 2LL);
    smallest_factor.assign(maximum + 1, 0);
    prime.assign(maximum + 1, true);
    prime[0] = prime[1] = false;
    primes = {};
 
    for (int p = 2; p <= maximum; p++)
        if (prime[p]) {
            smallest_factor[p] = p;
            primes.push_back(p);
 
            for (int64_t i = int64_t(p) * p; i <= maximum; i += p)
                if (prime[i]) {
                    prime[i] = false;
                    smallest_factor[i] = p;
                }
        }
}    

// Prime factorizes n in worst case O(sqrt n / log n). Requires having run `sieve` up to at least sqrt(n).
// If we've run `sieve` up to at least n, takes O(log n) time.
vector<pair<int64_t, int>> prime_factorize(int64_t n) {
  int64_t sieve_max = int64_t(smallest_factor.size()) - 1;
  assert(1 <= n && n <= sieve_max * sieve_max);
  vector<pair<int64_t, int>> result;
 
  if (n <= sieve_max) {
    while (n != 1) {
      int64_t p = smallest_factor[n];
      int exponent = 0;
 
      do {
        n /= p;
        exponent++;
      } while (n % p == 0);
 
      result.emplace_back(p, exponent);
    }
 
    return result;
  }
 
  for (int64_t p : primes) {
    if (p * p > n)
      break;
 
    if (n % p == 0) {
      result.emplace_back(p, 0);
 
      do {
        n /= p;
        result.back().second++;
      } while (n % p == 0);
    }
  }
 
  if (n > 1)
    result.emplace_back(n, 1);
 
  return result;
}

 
int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  sieve();
 
  ll n;
  cin >> n;
  vector<ll> A(n);
  for (auto& _a : A) cin >> _a;
  bool is_pairwise = true;
  vector<bool> seen(MAXN);
  for (int i = 0; i < n && is_pairwise; ++i) {
    auto pf =  prime_factorize(A[i]);
    for (auto& [k,e] : pf) {
      if (seen[k]) {
        is_pairwise = false;
        break;
      }
      seen[k] = true;
    }
  }
  



  
    
  if (is_pairwise) {
    cout << "pairwise coprime" << endl;
    return 0;
  }


  ll g = A[0];
  for (auto x : A) g = gcd(g, x);
  if (g == 1) {
    cout << "setwise coprime" << endl;
  } else {
    cout << "not coprime" << endl;
  }
  

}


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

cnt = [0]*8
ziyu = 0
for a in A:
    if 1 <= a <= 399 and cnt[0] == 0:
        cnt[0] = 1
    elif 400 <= a <= 799 and cnt[1] == 0:
        cnt[1] = 1
    elif 800 <= a < 1199 and cnt[2] == 0:
        cnt[2] = 1
    elif 1200 <= a <= 1599 and cnt[3] == 0:
        cnt[3] = 1
    elif 1600 <= a <= 1999 and cnt[4] == 0:
        cnt[4] = 1
    elif 2000 <= a <= 2399 and cnt[5] == 0:
        cnt[5] = 1
    elif 2400 <= a <= 2799 and cnt[6] == 0:
        cnt[6] = 1
    elif 2800 <= a <= 3199 and cnt[7] == 0:
        cnt[7] = 1
    elif a >= 3200:
        ziyu += 1

min_cnt = 0
if ziyu > 0:
    min_cnt = 1

print(max(min_cnt, sum(cnt)), sum(cnt)+ziyu)


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <map>
#include <functional>
using namespace std;

int main() {
	long long int ans = 0;
	long long int N, M;
	cin >> N >> M;
	/*
	int f[5][5];
	for (int i = 0; i < 5;i++) {
	for (int j = 0; j < 5; j++) {
	f[i][j] = -1;
	}
	}
	int n,m;
	n = N; 
	m = M;
	if (n > 3) {
		n = 3;
	}
	if (m > 3) {
		m = 3;
	}
	for (int i = 1; i < n + 1; i++) {
		for (int j = 1; j < m + 1; j++) {
			f[i - 1][j - 1] *= -1;
			f[i - 1][j] *= -1;
			f[i - 1][j + 1] *= -1;
			f[i][j - 1] *= -1;
			f[i][j] *= -1;
			f[i][j + 1] *= -1;
			f[i + 1][j - 1] *= -1;
			f[i + 1][j] *= -1;
			f[i + 1][j + 1] *= -1;
		}
	}
	*/
	if (M == 1 && N == 1) {
		ans = 1;
	}
	else if (M == 1) {
		ans = N - 2;
	}
	else if (N == 1) {
		ans = M - 2;
	}
	else if (M == 2 || N == 2){
		ans = 0;
	}
	else {
		ans = (M - 2)*(N - 2);
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> V;
#define rep(i,e) for(ll i=0;i<e;i++ )
typedef pair<ll,ll> P;
const ll mod = 1e9+7;
const ll INF = INT64_MAX;


ll i;






int main(){
    ll N,M;
    cin>>N>>M;
    V A(N),B(N);
    rep(i,N)cin>>A.at(i)>>B.at(i);

    

    ll ans=0;
    priority_queue<ll> job;
    
    vector<P> kari(N);
    rep(i,N)kari.at(i)=P(A.at(i),B.at(i));
    sort(kari.begin(),kari.end());
    ll cnt=0;
    for(ll j=1;j<=M;j++){
        while(cnt<kari.size()&&kari.at(cnt).first<=j){
            job.push(kari.at(cnt).second);
            cnt++;
        }
        if(!job.empty()){
            ans+=job.top();
            job.pop();
        }
    }
    cout<<ans<<endl;
    
    
    
    



}


Measured memory_bytes: 4472
#include <bits/stdc++.h>
using namespace std;
int f[10][10];

int main()
{
    int W,H;
    cin >> H >> W;
    
    for(int i = 0;i<10;i++)
    {
        for(int j = 0;j<10;j++)
        {
            cin >> f[i][j];
        }
    }
    
    vector<int> data(10,0);
    
    for(int i = 0;i<H;i++)
    {
        for(int j=0;j<W;j++)
        {
            int a;
            cin >> a;
            if(a != -1)
            {
                data[a]++;
            }
        }
    }
    
    vector<int> p(10);
    
    vector<bool> used(10,false);
    used[1] = true;
    for(int i=0;i<10;i++)
    {
        p[i] = f[i][1];
    }
    bool noChange = false;
    while(!noChange)
    {
        noChange = true;
        int j;
        int temp=INT_MAX;
        for(int i = 0;i<10;i++)
        {
            if(!used[i])
            {
                noChange = false;
                if(temp > p[i])
                {
                    j = i;
                    temp = p[i];
                }
            }
        }
        
        if(!noChange)
        {
            used[j] = true;
            for(int i = 0;i<10;i++)
            {
                if(!used[i])
                {
                    p[i] = min(p[i],f[i][j] + p[j]);
                }
            }
        }
    }
    
    int ans=0;
    for(int i= 0;i<10;i++)
    {
        ans += p[i] * data[i];
    }
    cout << ans << endl;
    
    return 0;
    
}


 

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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		char[] c = {'a','b','c','d','e','f','g','h',
			'i','j','k','l','m','n','o','p','q','r',
			's','t','u','v','w','x','y','z'};

		StringBuffer sb = new StringBuffer();

		while(n > 0) {
			if(n <= 26) {
				sb.insert(0, c[((int)n)-1]);
				break;
			}
			long result = n % 26;
			if(result==0) {
				sb.insert(0, c[25]);
				n-=26;
			} else {
				sb.insert(0, c[((int)result)-1]);
			}
			n = n / 26;
		}
		System.out.println(sb.toString());
	}

}

Measured memory_bytes: 27072
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;
int d[310][310],d2[310][310];
signed main()
{
    int n;
    cin>>n;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            d[i][j]=INF;
        }
        
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            int a;
            cin>>a;
            d[i][j]=a;
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            d2[i][j]=d[i][j];
        }
        
    }
    for (int k = 0; k < n; k++)
    {
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                d2[i][j] = min (d2[i][j] ,d2[i][k] + d2[k][j] );
            }
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if(d[i][j]!=d2[i][j]){
                cout << -1 << endl;
                return 0;
            }
        }
    }
    ll sum=0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            bool ok=false;
            for (int k = 0; k < n; k++)
            {
                if(k==i || k==j) continue;
                if(d[j][k] + d[k][i] == d[i][j]) ok=true;
            }
            if(!ok) sum+=d[i][j]; 
            
        }
        
    }
    cout<<sum/2<<endl;
    
    

    
    
    return 0;
}

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int a, b; cin >> a >> b;
	if (a == b)cout << "Draw" << endl;
	else if (a == 1)cout << "Alice" << endl;
	else if (b == 1)cout << "Bob" << endl;
	else {
		if (a < b)cout << "Bob" << endl;
		else cout << "Alice" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/agc018/tasks/agc018_a
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// int lcm(int c, int d) { return c / gcd(c, d) * d; }

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    REP(i, n) cin >> v[i];
    sort(ALL(v));
    if (v.front() > k || k > v.back()) {
        cout << "IMPOSSIBLE\n";
        return 0;
    }
    int g = v.front();
    for (auto &x : v) {
        g = gcd(g, x);
    }
    if (k % g == 0) {
        cout << "POSSIBLE\n";
    } else {
        cout << "IMPOSSIBLE\n";
    }
    return 0;
}


Measured memory_bytes: 1024
N, A, B = map(int, input().split())
S = input()
a, b = 0, 0
for i in range(N):
    if S[i] == 'a':
        if a + b < A + B:
            print('Yes')
            a += 1
        else:
            print('No')
    elif S[i] == 'b':
        if a + b < A + B and b + 1 <= B:
            print('Yes')
            b += 1
        else:
            print('No')
    else:
        print('No')


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = 10e10;
const ll MINF = -10e10;
//const int INF = INT_MAX;
#define mins(x, y) x = min(x, y)
#define maxs(x, y) x = max(x, y)

typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;
const int mod = 1000000007;
//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;


int main() {

    int n, k;


    cin >> n >> k;

    cout << (n % k  == 0 ? 0 : 1 ) << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long tmp = n;
        long ans = 0;
        if (n < 10 || n % 2 == 1) {
            System.out.println(0);
            return;
        }
        while (n > 0) {
            long current = n / 5;
            ans += current / 2;
            n /= 5;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 22100
#include<iostream>
#include<cstdio>
#include<cctype>
#include<string>
using namespace std;
int main(){
  char a;
  string strin;
  while(scanf("%c",&a)!=EOF){
  if(a>='a' && a<='z')a-='a'-'A';
  strin+=a;
  }
  cout<<strin;
}

Measured memory_bytes: 1176
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

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,Q,l,r;
string S;

int main(){
    cin>>N>>Q>>S;
    int cnt[N];
    repi(i,1,N){
        if(S[i-1]=='A'&&S[i]=='C')cnt[i]=cnt[i-1]+1;
        else cnt[i]=cnt[i-1];
    }
    rep(i,Q){
        cin>>l>>r;
        out(cnt[r-1]-cnt[l-1]);
    }
}


Measured memory_bytes: 1408
#include <iostream>
using namespace std;
int main()
{
  long long int a,b,ens;
  cin>>a>>b;
  if(a>=b){
    for(int i=1; ;i++){
    if((a*i)%b==0){ens=a*i; break;}
    }
  }
  else{
    for(int i=1; ;i++){
    ens=b*i;
    if((b*i)%a==0){ens=b*i; break;}
    }
  } 
  
  cout<<ens<<endl;
  return 0;
}

Measured memory_bytes: 256
import math

a, b, x = input().split(" ")
a = int(a)
b = int(b)
x = int(x)

max_volume = a*a*b
h = (x / max_volume) * b
if (b-h < h):
  theta = math.atan((b-h)/(a/2)) * 180 / math.pi
else:
  m = (2*x)/(a*b)
  theta = math.atan(b/m) * 180 / math.pi

print(theta)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
 
#define loop(i, n) for(int i = 0; i < n; i++)
#define loop1(i, a, n) for(int i = a; i < n; i++)
#define PI 3.141592653589793238
#define bc __builtin_popcountll
#define pf push_front
#define pb push_back
#define rf pop_front
#define rb pop_back
#define fs first
#define sc second
#define mp make_pair
#define fi ios_base::sync_with_stdio(false); cin.tie(NULL)
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
const ll M = 1e9 + 7;
const ll INF = 1e9;
inline ll pwr(ll base, ll n, ll m) {ll ans = 1;while( n > 0 ) {if ( n & 1 ) ans = (ans * base) % m; base = (base * base) % m; n>>=1;}return ans;}


int main() {
    fi;
 
    // #ifndef ONLINE_JUDGE
    // freopen( "input.txt", "r", stdin );
    // freopen( "output.txt", "w", stdout );
    // #endif

    string s, t;
    cin >> s >> t;

    int cnt = 0;
    loop(i, 3)
        if( s[i] == t[i] ) cnt++;
    cout << cnt;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int N;
    cin >> N;
    string S,T; cin >> S >> T;
    int cnt = 0;
    REP(i,N) {
        if(S.substr(i,N-i) == T.substr(0,N-i)) {
            cout << S.substr(0,i).size() + T.size() << endl;
            return 0;
        }
    }
    cout << 2*N << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define For(i,l,r) for(res i=(l),_=(r);i<=_;++i)
#define Dor(i,l,r) for(res i=(r),_=(l);i>=_;--i)
#define Sor(i,l,r) for(res i=(l),_=(r);i<_;++i)
#define fz(a,b) memset(a,b,sizeof a)
#define qd(a) while(!a.empty())a.pop()
#define JB(a,b)(T[++t]=b,E[t]=H[a],H[a]=t)
#define ll long long
#define N 100001
#define M 1000000007
int main() {
	int a,b;
	cin>>a>>b;
	cout<<(a+b-3)/(a-1);
}

Measured memory_bytes: 256
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto nx = readints;
    int x = nx[1];
    auto xs = readints;

    auto ans = xs.map!(e => abs(x - e)).reduce!(gcd);
    writeln(ans);
}

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


Measured memory_bytes: 4220
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstdio>
#include<algorithm>

using namespace std;

typedef pair<int,int>pii;

int main(void){

	map<int,int>mp;
	vector<pii>v;
	while(true){
		int a,b;
		scanf("%d,%d",&a,&b);
		if(a==0 && b==0)break;
		v.push_back(pii(b,a));
	}
	sort(v.begin(),v.end());
	reverse(v.begin(),v.end());

	int k=1;
	for(int i=0;i<v.size();i++){
		mp[v[i].second]=k;
		if(v[i].first!=v[i+1].first)k++;
	}

	int n;
	while(cin >> n){
		cout << mp[n] << endl;
	}

	return 0;
}

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

class Main {


  

  public static void main(String[] args) {
    Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    int N = in.nextInt();

    double[] p = new double[N];
    for (int i = 0; i < N; i++) {p[i] = in.nextDouble();}

    double[] dp = new double[N + 1];
    dp[0] = 1;
    for (int i = 0; i < N; i++) {
      for (int j = i + 1; j >= 0; j--) {
        dp[j] = (j == 0 ? 0 : (dp[j - 1] * p[i])) + dp[j] * (1 - p[i]);
      }
    }

    double ans = 0;
    for (int i = N / 2 + 1; i <= N; i++) {
      ans += dp[i];
    }




    System.out.println(ans);
  }

}

Measured memory_bytes: 37996
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
const int INF = 1e9;
const int MXN = 3e3 + 5;
const int MXV = 0;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define FOR(i, L, R) for (int i = L; i < (int)R; ++i)
#define FORD(i, L, R) for (int i = L; i > (int)R; --i)
#define IOS                                                                    \
    cin.tie(nullptr);                                                          \
    cout.tie(nullptr);                                                         \
    ios_base::sync_with_stdio(false);
int dp[MXN][MXN], pre[MXN][MXN];
int dir[3][2] = {{-1, -1}, {-1, 0}, {0, -1}};

int main()
{
    // IOS;
    string s, t;
    cin >> s >> t;
    FOR(i, 1, s.size() + 1) FOR(j, 1, t.size() + 1)
    {
        if (s[i - 1] == t[j - 1])
        {
            dp[i][j] = dp[i - 1][j - 1] + 1;
            pre[i][j] = 0;
        }
        else if (dp[i - 1][j] > dp[i][j - 1])
        {
            dp[i][j] = dp[i - 1][j];
            pre[i][j] = 1;
        }
        else
        {
            dp[i][j] = dp[i][j - 1];
            pre[i][j] = 2;
        }
    }
    vector<char> st;
    for (int i = (int)s.size(), j = (int)t.size(); i && j;)
    {
        // cout << i << ' ' << j << '\n';
        if (pre[i][j] == 0)
        {
            st.PB(s[i - 1]);
        }
        int tmp = dir[pre[i][j]][0];
        j += dir[pre[i][j]][1];
        i += tmp;
    }
    while (!st.empty())
    {
        cout << st.back();
        st.pop_back();
    }
    cout << '\n';
}


Measured memory_bytes: 74032
#include<bits/stdc++.h>
#define ll long long
#define MAX 200005
#define MOD 1000000007
using namespace std;

ll modpow(ll a, ll b)
{
    if (b == 0) return 1;
    ll u = modpow(a, b / 2);
    u = (u * u)%MOD;
    if (b%2) u = (a * u)%MOD;
    return u;
}

int n;
vector<int> ad[MAX];
ll ans[MAX], sz[MAX];

void dfs(int s, int f)
{
    sz[s] = 1;
    for (auto nd:ad[s]) {
        if (nd != f) {
            dfs(nd, s);
            sz[s] += sz[nd];
        }
    }
    ans[1] = ans[1] * modpow(sz[s], MOD - 2)%MOD;
}

void dfs2(int s, int f)
{
    for (auto nd:ad[s]) {
        if (nd != f){
            ans[nd] = (ans[s] * sz[nd])%MOD * modpow(n - sz[nd], MOD - 2)%MOD;
            dfs2(nd, s);
        }
    }
}

int main()
{
    cin >> n;
    int a, b;
    ans[1] = 1;
    for (int i = 2; i <= n; i++) ans[1] = (ans[1]%MOD) * (i%MOD) % MOD;
    for (int i = 1; i <= n - 1; i++) {
        cin >> a >> b;
        ad[a].push_back(b);
        ad[b].push_back(a);
    }
    dfs(1, -1);
    dfs2(1, -1);
    for (int i = 1; i <= n; i++) {
        cout << ans[i] << "\n";
    }
}


Measured memory_bytes: 18048
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define REP(i,n) for(int i=1;i<=(n);++i)
#define pa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
#define pb push_back

using ll = long long;
using namespace std;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
const int INFint = 2e9+1;
const ll INFll = 2e18+1;
ll MOD=1e9+7;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最大公倍数

vector<int> G[200001];
int N,Q;
int p[200001]={0};
ll cnt[200001] = {0};

void dfs(int parent,int node,int ten){
  cnt[node] = ten;
  for(int i(0);i<int(G[node].size());i++){
    int next = G[node][i]; 
    if(next != parent){
      dfs(node,next,ten+p[next]);
    }
  }
}
int main(){
  cin>>N>>Q;
  for(int i(0);i<N-1;i++){
    int a,b; 
    cin>>a>>b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for(int i(0);i<Q;i++){
    int P,x;
    cin>>P>>x;
    p[P] += x;
  }
  dfs(-1,1,p[1]);
  for(int i(0);i<N;i++){
    cout << cnt[i+1] << " ";
  }
  cout << endl;
  return 0;
}


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

int main()
{
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++)
  {
    cin >> a.at(i);
  }
  int ans = 0;
  for (int i = 0; i < N; i++)
  {
    ans += a.at(i) - 1;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define ll long long
inline int read()
{
	int x=0;bool t=false;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')t=true,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return t?-x:x;
}
int main()
{
	int n=read(),m=read();
	printf("%d\n",n%m);
	return 0;
}


Measured memory_bytes: 256
def lucas_dp(n):
    memo = [None] * (n + 1)
    memo[0] = 2
    memo[1] = 1
    for i in range(2, n+1):
        memo[i] = memo[i - 1] + memo[i - 2]
    return memo[n]  

n = int(input())
lucas = lucas_dp(n)
print(lucas)


Measured memory_bytes: 9156
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
ll Max(ll(a), ll(b), ll(c)) {
	return max(max(a, b), c);
}
ll Min(ll(a), ll(b), ll(c)) {
	return min(min(a, b), c);
}
ll kai(vector<ll> A, ll key) {
	ll an = 0;
	rep(i, A.size()) {
		an += (A.at(i) - 1) / key;
	}
	return an;
}
// index が条件を満たすかどうか
bool isOK(int index,vector<ll> A, int K) {
	if (kai(A,index) <= K) return true;
	else return false;
}

// 汎用的な二分探索のテンプレ
int binary_search(ll MA,vector<ll> A,ll K) {
	int left = 0; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = MA; // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, A,K)) right = mid;
		else left = mid;
	}

	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
vector<ll> fact, factinv, inv;
ll mod = 1e9 + 7;
void prenCkModp(ll n) {
	fact.resize(n + 5);
	factinv.resize(n + 5);
	inv.resize(n + 5);
	fact.at(0) = fact.at(1) = 1;
	factinv.at(0) = factinv.at(1) = 1;
	inv.at(1) = 1;
	for (ll i = 2; i < n + 5; i++) {
		fact.at(i) = (fact.at(i - 1) * i) % mod;
		inv.at(i) = mod - (inv.at(mod % i) * (mod / i)) % mod;
		factinv.at(i) = (factinv.at(i - 1) * inv.at(i)) % mod;
	}

}
ll nCk(ll n, ll k) {
	if (n < 0 || k < 0){
		return 1;
	}
	else if (n < k) {
		return 0;
	}
	return fact.at(n) * (factinv.at(k) * factinv.at(n - k) % mod) % mod;
}
ll HP[4];
int main() {
	
	ll n,s=0;
	cin >> n;
	vector<ll> a(1+n);
	rep(i, n+1) {
		cin >> a.at(i);
		s += a.at(i);

	}
	s -= (n * (n + 1)) / 2;
	ll L=-1, R=-1;
	rep(i, n+1) {
		if (a.at(i) == s) {
			if (L == -1) {
				L = i+1;
			}
			else {
				R = i + 1;
			}
		}

	}

	prenCkModp(n);

	for (ll k = 1; k <= n + 1; k++) {
		cout << (nCk(n + 1, k) - nCk(n  + L - R, k - 1) + mod) % mod << endl;
	}
}


Measured memory_bytes: 6260
#define ONLINE_JUDGE
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) for(ll i=0;i<(n);++i)
#define _rep3(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2)(__VA_ARGS__)
#define _repe2(i,n) for(ll i=0;i<=(n);++i)
#define _repe3(i,a,b) for(ll i=(a);i<=(b);++i)
#define repe(...) _overload3(__VA_ARGS__,_repe3,_repe2)(__VA_ARGS__)
#define _rrep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define _rrep3(i,a,b) for(ll i=(b)-1;i>=(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
template<class T>
bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>
bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<class T>
using pq=priority_queue<T,vector<T>,greater<T>>;

ll N;
ll M;
ll Q;
vl a;
vl b;
vl c;
vl d;

void solve();

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin >> N;
    cin >> M;
    cin >> Q;
    a = vl(Q);
    b = vl(Q);
    c = vl(Q);
    d = vl(Q);
    for(int i = 0; i < Q; ++i){
        cin >> a[i];
        cin >> b[i];
        cin >> c[i];
        cin >> d[i];
    }
    solve();
}

// 入力は全て整数
// 2 ≤ N ≤ 10
// 1 <= M <= 10
// 1 <= Q <= 50
// 1 <= a_i < b_i <= N ( i = 1, 2, ..., Q )
// 0 <= c_i <= M - 1 ( i = 1, 2, ..., Q )
// (a_i, b_i, c_i) != (a_j, b_j, c_j) ( i != j のとき)
// 1 <= d_i <= 10^5 ( i = 1, 2, ..., Q )

ll ans=0;
vl x;

void dfs(ll i,ll val){
    x[i]=val;
    if(i==N){
        ll tmp=0;
        rep(j,Q){
            if(x[b[j]-1]-x[a[j]-1]==c[j])tmp+=d[j];
        }
        chmax(ans,tmp);
        return;
    }
    repe(j,val,M){
        dfs(i+1,j);
    }
}

// ll N, ll M, ll Q, vl a, vl b, vl c, vl d
// A の得点の最大値を出力せよ。
void solve(){
    x.resize(N);
    dfs(0,1);
    cout<<ans<<endl;
}


Measured memory_bytes: 3616
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!
 
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize ("Ofast,unroll-loops,-ffloat-store,no-stack-protector")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")

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

string to_string(const string& s) { return '"' + s + '"'; }
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << " " << to_string(H);
    debug_out(T...);
}
#ifdef LOCAL
    #define debug(...) cout << "#" << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 3
#endif
 
#define cin_exception cin.exceptions(cin.failbit);
#define cout_precision cout.setf(ios::fixed); cout.precision(15);
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
using ld = long double;  using ui = uint_fast32_t;
using ll = int_fast64_t; using ul = uint_fast64_t;

// -----------------------------------------------------------------------------

void solve() {
    int n;
    cin >> n;
    set<string> st;
    for (int i = 0; i < n; ++i) {
        string s; cin >> s;
        st.insert(s);
    }
    cout << st.size() << '\n';
}

// -----------------------------------------------------------------------------

int main() {
    fast_io; // cout_precision;
#ifdef LOCAL
    cin_exception;
#endif
    int t = 1;
    // cin >> t;
    for (int i = 1; i <= t; ++i) {
        solve();
    }
}

Measured memory_bytes: 19216
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
int dp[1001][1001];
int solve(string a,string b)
{	
	
	int maxn=0;
	int len1=a.size(),len2=b.size();
	

	for(int i=1;i<=len1;i++)
		for(int j=1;j<=len2;j++)
		{
			if(a[i-1]==b[j-1])
				dp[i][j]=dp[i-1][j-1]+1;
			else 
				dp[i][j]=max(dp[i-1][j],dp[i][j-1]);//这个只是表示某个状态的不是最大的，这个是自己设定的
			maxn=max(maxn,dp[i][j]);
		}
		return maxn;
		
		
	
}
int main()
{	int n;
	string a,b;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b;
		cout<<solve(a,b)<<endl;
	}
	return 0;
}


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


int main(void){
    ll n,m; cin >> n >> m; n--;
    vector<vector<ll>> ship(n+1);
    for(int i=0;i<m;i++){
        int a,b; cin >> a >> b; a--,b--;
        ship[a].push_back(b);    
    }
    for(int i=0;i<ship[0].size();i++){
        vector<ll> f = ship[ship[0][i]];
        if(f.size() != 0 && *find(f.begin(),f.end(),n)==n){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;
    return 0;
}


Measured memory_bytes: 8832
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define drep(i,cc,n) for(int i=cc;i>n;--i)
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; }
const long long INF = 1LL <<60;
typedef long long ll;
using namespace std;

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

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

ll choose2(ll n){
    return n*(n-1)/2;
}

int main() {
    double a,b,x;
    cin>>a>>b>>x;
    double s = x / a;

    double rad;
    double ans;

    if(x >= a * a * b) cout<<0<<endl;
    else {
        if(a * b / 2 >= s){
            double a2 = (2.0 * s) / b;
            rad = atan(b/a2);
        }
        else{
            double bu = (2.0 * s) / a - b;
            double b2 = b - bu;
            //double s2 = s - (bu * a);
            rad = atan(b2/a);
        }

        ans = rad * 180.0 * M_1_PI;
        printf("%.11lf\n",ans);
    }

    return 0;
}

Measured memory_bytes: 384
import sys

a,b,c,k=(int(i) for i in input().split())



if a > k:
    one = k
    k = 0
else :
    one = a
min =0
nokori = k-a
if nokori > 0:
    zero = b
    nokori= nokori -b

if nokori > 0:
    min = nokori

ans = 1*one-1*min
print(ans)

Measured memory_bytes: 9192
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let n = read::<i64>();
    let mut answers = vec![0i128; n as usize + 1];
    for i in 1..n + 1 {
        for j in 1.. {
            if j * i > n {
                break;
            }
            answers[(j * i) as usize] += 1;
        }
    }
    let mut ans = 0i128;
    for i in 1..n + 1 {
        ans += i as i128 * answers[i as usize] as i128;
    }

    println!("{}", ans);
}

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

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

fn get_primes(n: i64) -> Vec<i64> {
    let mut is_prime = vec![true; n as usize + 1];
    let mut primes = Vec::new();
    is_prime[0] = false;
    is_prime[1] = false;

    for i in 2..n + 1 {
        if is_prime[i as usize] {
            primes.push(i);
            let mut j = 2 * i;
            while j < n {
                is_prime[j as usize] = false;
                j += i;
            }
        }
    }
    primes
}

fn factorize(mut num: i64, primes: &Vec<i64>) -> i128 {
    // max_primes >= (num)^(1/2)
    let mut cur = 1;
    for &p in primes.iter() {
        let mut coef = 1;
        while num % p == 0 {
            coef += 1;
            num /= p;
        }
        cur *= coef;
        if num == 1 {
            break;
        }
        if p * p > num {
            break;
        }
    }
    if num != 1 {
        cur *= 2;
    }
    cur
}


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

int main(void)
{
	char str1[11],*str2 = "YAKI";
	
	gets(str1);
	
	if (strncmp(str1,str2,4) == 0) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 128
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();
		System.out.println(a / b);
		System.out.println(a % b);
		System.out.printf("%.6f\n", (double) a / b);
		scanner.close();
	}

}


Measured memory_bytes: 26512