akhauriyash/Code-Regression huggingface dataset:
package main

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

func main() {
	a := readi()
	b := readi()
	c := readi()
	d := readi()

	for {
		c = c - b
		if c <= 0 {
			fmt.Println("Yes")
			break
		}
		a = a - d
		if a <= 0 {
			fmt.Println("No")
			break
		}
	}
}

/*-------------------utilities-------------------*/

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

// 最大公約数
func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

// 最小公倍数
func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

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

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7

	COMB_MAX = 510000
)

var (
	readString func() string
)

var (
	fac  = [COMB_MAX]int{}
	finv = [COMB_MAX]int{}
	inv  = [COMB_MAX]int{}
)

func init() {
	readString = newReadString(os.Stdin)
}

func combInit() {
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i := 2; i < COMB_MAX; i++ {
		fac[i] = fac[i-1] * i % MOD
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
		finv[i] = finv[i-1] * inv[i] % MOD
	}
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

func readi64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readf() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}


Measured memory_bytes: 1756
code = """

# distutils: language=c++
# distutils: include_dirs=[/home/USERNAME/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False

from libc.stdio cimport getchar, printf
from libcpp.vector cimport vector
from libcpp.string cimport string
cpdef inline vector[int] ReadInt(int n):
    cdef int b, c
    cdef vector[int] *v = new vector[int]()
    for i in range(n):
        c = 0
        while 1:
            b = getchar() - 48
            if b < 0: break
            c = c * 10 + b
        v.push_back(c)
    return v[0]

cpdef inline vector[string] Read(int n):
    cdef char c
    cdef vector[string] *vs = new vector[string]()
    cdef string *s
    for i in range(n):
        s = new string()
        while 1:
            c = getchar()
            if c<=32: break
            s.push_back(c)
        vs.push_back(s[0])
    return vs[0]

cpdef inline void PrintLongN(vector[long] l, int n):
    for i in range(n): printf("%ld\\n", l[i])

cpdef inline void PrintLong(vector[long] l, int n):
    for i in range(n): printf("%ld ", l[i])
cdef extern from "<atcoder/scc>" namespace "atcoder":
    cdef cppclass scc_graph:
        scc_graph(int n)
        void add_edge(int fr, int to)
        vector[vector[int]] scc()

cdef class SccGraph:
    cdef scc_graph *_thisptr
    def __cinit__(self, int n):
        self._thisptr = new scc_graph(n)
    cpdef void add_edge(self, int fr, int to):
        self._thisptr.add_edge(fr, to)
    cpdef vector[vector[int]] scc(self):
        return self._thisptr.scc()
"""


import os, sys, getpass

if sys.argv[-1] == 'ONLINE_JUDGE':
    code.replace("USERNAME", getpass.getuser())
    open('atcoder.pyx','w').write(code)
    os.system('cythonize -i -3 -b atcoder.pyx')
    sys.exit(0)


from atcoder import SccGraph, ReadInt

def main():
    N, M = ReadInt(2)
    sg = SccGraph(N)
    for i in range(M):
        a, b = ReadInt(2)
        sg.add_edge(a, b)
    ans = sg.scc()
    print(len(ans))
    for i in range(len(ans)):
        print(len(ans[i]),*ans[i])

if __name__=="__main__":
    main()

Measured memory_bytes: 144068
#include <iostream>
#include <limits.h>
#include <queue>
#define MAX_V 100
#define MAX_E 9900
#define INF INT_MAX
using namespace std;

class Edge{
public:
  int from,to,cost;
};
Edge G[MAX_E+1];
int d[MAX_V+1][MAX_V+1];

int V,E;

int solve(){

  for(int i=0;i<V;i++)
    for(int j=0;j<V;j++){
      d[i][j]=INF;
      if(i==j)d[i][j]=0;
    }
      
  
  int cycle=0;
  while(1){
    
    bool update=false;
    
    for(int i=0;i<V;i++){
      for(int j=0;j<E;j++){
	Edge e = G[j];
	if(d[i][e.from]!=INF && d[i][e.from]+e.cost < d[i][e.to]){
	  d[i][e.to]=d[i][e.from]+e.cost;
	  update = true;
	}
      }
    }
    if(!update) break;
    cycle++;
    if(cycle>=V) return -1;
  }
 
  return 1;
}


int main(){

  
  cin>>V>>E;
  
  for(int i=0;i<E;i++){
    int from,to,cost;
    cin>>from>>to>>cost;
    G[i].from=from;
    G[i].to=to;
    G[i].cost=cost;
  }
  int ret = solve();
  if(ret==-1) cout<<"NEGATIVE CYCLE"<<endl;
  else
    for(int i=0;i<V;i++){
      for(int j=0;j<V;j++){
	if(d[i][j]==INF) cout<<"INF";
	else cout<<d[i][j];
        if(j!=V-1) cout<<" ";
      }
      cout<<endl;
    }
  return 0;
}

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


int main(){
  int n,k;
  cin >> n >> k;
  vector<ll> x(n),y(n);
  vector<ll> xx(n),yy(n);
  for(int i=0;i<n;++i){
    cin >> x[i] >> y[i];
    xx[i]=x[i];
    yy[i]=y[i];
  }

  sort(xx.begin(),xx.end());
  sort(yy.begin(),yy.end());

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

  ll cal=(xx[n-1]-xx[0])*(yy[n-1]-yy[0]);
  //cout << xx[0] << endl;
  //cout << cal << endl;
  for(int xl=0;xl<n;++xl){
    for(int xr=xl+1;xr<n;++xr){
      for(int yd=0;yd<n;++yd){
        for(int yu=yd+1;yu<n;++yu){
          int cnt=0;
          for(int i=0;i<n;++i){
            if(xx[xl]<=x[i] && xx[xr]>=x[i] && yy[yd]<=y[i] && yy[yu]>=y[i])cnt++;
          }
          if(cnt>=k){
            ll tmp=abs(xx[xl]-xx[xr])*abs(yy[yu]-yy[yd]);
            cal=min(cal,tmp);
          }
        }
      }
    }
  }
  cout << cal << endl;
  return 0;
}


Measured memory_bytes: 3564
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

signed main() {
    int N;
    cin >> N;
    int S[N+1];
    S[0] = 0;
    for (int i = 0; i < N; i++) {
        int a;
        cin >> a;
        S[i+1] = S[i] + a;
    }

    map<int, int> m;
    map<int, int> :: iterator it;
    for (int i = 0; i < N+1; i++) {
        m[S[i]]++;
    }

    int ret = 0;

    for (it = m.begin(); it != m.end(); it++) {
        ret += (it->second - 1) * it->second / 2;
    }

    cout << ret << endl;

    return 0;
}

Measured memory_bytes: 14336
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> lpair;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    double a,b,x;
    cin >> a >> b >> x;
    double lv = 0.0, rv = 90.0;
    const double pi = 3.141592653589;
    // double v = atan(a/b) * 180.0 / pi;
    // print(v);
    if(x >= a*a*b/2){
        double tant = (2*a*a*b-2*x) / (a*a*a);
        tant = atan(tant) * 180 / pi;
        cout << setprecision(10) << tant << endl;

    }else{
        double tant = 2.0 * x / (b*b*a);
        tant = atan(tant) * 180 / pi;
        tant = 90.0 - tant;
        cout << setprecision(10) << tant << endl;

    }
    // print(v);
    // rep(t,0,100){
    //     double mid = (rv + lv) / 2;
    //     bool ok = true;

    //     if(ok){
    //         lv = mid;
    //     }else{
    //         rv = mid;
    //     }
    // }

    

}

Measured memory_bytes: 512
//
//  main.cpp
//  ABC 075D
//
//  Created by Shuangyi Zhang on 10/18/17.
//  Copyright © 2017 Shuangyi Zhang. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
vector <pair<long long,long long>> x,y;
int main() {
    int n,k,a,b;
    cin>>n>>k;
    for (int i=1;i<=n;i++){
        cin>>a>>b;
        x.push_back(make_pair(a,b));
        y.push_back(make_pair(b,a));
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    //for (int i=0;i<=n-1;i++){
    //    cout<<y[i].first<<" "<<y[i].second<<endl;
    //}
    long long res=4*pow(10,18)+1;
    for (int i=0;i<n;i++){
        for (int j=i+1;j<n;j++){
            for (int p=0;p<n;p++){
                for (int q=p+1;q<n;q++){
                    long long xl=x[i].first;
                    long long xr=x[j].first;
                    long long yd=y[p].first;
                    long long yu=y[q].first;
                    int sum=0;
                    for (int s=0;s<n;s++){
                        if (x[s].first>=xl &&x[s].first<=xr&&x[s].second>=yd&&x[s].second<=yu){
                            sum++;
                        }
                    }
                    if (sum>=k) {
                        if ((xr-xl)*(yu-yd)<res)res=(xr-xl)*(yu-yd);
                    }
                }
            }
        }
    }
    cout<<res;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mod 1000000007
#define all(x) x.begin(),x.end()
#define deb(x) cout<<#x<<" "<<x<<"\n";
#define cr7 ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main() {
	cr7
	ll r;
	cin >> r;
	double d = (double)(6.28318530717958623200/2.00);
	cout.precision(20+floor(log10(2*r) + 1));
	cout << (double)(2*(d)*r)<<"\n";
}

Measured memory_bytes: 4048
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
    int m, k;
    cin >> m >> k;
    if (m == 1) {
        if (k == 0) {
            cout << 0 << " " << 0 << " " << 1 << " " << 1 << endl;
        }
        else {
            cout << -1 << endl;
        }
        return 0;
    }
    if (k > (1 << m) - 1) {
        cout << -1 << endl;
        return 0;
    }
    cout << k << " ";
    for (int i = 0; i < (1 << m); i++) {
        if (i != k) {
            cout << i << " ";
        }
    }
    cout << k << " ";
    for (int i = (1 << m) - 1; i >= 0; i--) {
        if (i != k) {
            cout << i << " ";
        }
    }
    
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
static const int MAX = 200000;

int main() {
    int N;
    cin >> N;
    int R[MAX];
    // 配列を読み込み
    for (int i = 0; i < N; i++) {
        cin >> R[i];
    }
    for (int i = 0; i < N; i++) {
        int v = R[i];
        int j = i - 1;
        while (j >= 0 && R[j] > v) {
            R[j+1] = R[j];
            j--;
        }
        R[j+1] = v; // 実質最後のR[j]に代入しているのと同じ
        for (int k = 0; k < N; k++) {
            if (k == N-1) {
                cout << R[k] << endl;
            } else {
                cout << R[k] << " ";
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3128
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 1;
  for (int i = 0; i < N - 1; i++) {
	  if (S[i] != S[i + 1]) {
		  ans++;
		}
	}
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include <stdio.h>

int main()
{
    long long int h,n;
  scanf("%lld %lld\n",&h,&n);
  long long int i,arr[n],sum=0;
  for(i=0;i<n;i++)
  {
    scanf("%lld ",&arr[i]);
    sum=arr[i]+sum;
    
  }
  if(sum>=h)
    printf("Yes");
  else
    printf("No");
  
    

    return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#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++)
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
const double PI=3.1415926535897932;

int main()
{
    double RR;
    cin >> RR;
    
    cout << RR*2.0*PI;
    return 0;
}

Measured memory_bytes: 3764
import sys
from decimal import *

def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return list(map(int, input().split()))


def main():
    f = [Decimal(x) for x in input().split()]
    print(int(f[0] * f[1]))


main()


Measured memory_bytes: 10004
import sys
import numpy as np


def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


input = sys.stdin.buffer.readline
N = int(input())
A = np.array(sorted(list(map(int, input().split()))))
# print(f'{A=}')

L = [0] * (N + 1)
R = [0] * (N + 1)
M = [0] * N

for i in range(N):
    L[i + 1] = gcd(L[i], A[i])
# print(f'{L=}')

for i in range(N - 1, -1, -1):
    R[i] = gcd(R[i + 1], A[i])
# print(f'{R=}')

for i in range(N):
    M[i] = gcd(L[i], R[i + 1])
# print(f'{M=}')
ans = max(M)
print(ans)


Measured memory_bytes: 37720
str = input().rstrip().split(" ")
W = int(str[0])
a = int(str[1])
b = int(str[2])
x = 0

if a < b:
        x = b - (a + W)
elif a > b:
        x = a - (b + W)

if a == b or x < 0:
        print("0")
else:
        print(x)


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


int main(){
    ll n;cin>>n;
    ll a[100010],seki[100010];
    rep(i,0,n){
        cin>>a[i];
        if(a[i]==0){
            cout<<0<<endl;
            return 0;
        }
    }
    
    seki[0]=a[0];
    int ok=1;
    rep(i,1,n){
        seki[i]=seki[i-1]*a[i];
        if(seki[i]>1000000000000000000){ok=0;break;}
    }
    if(ok){
        rep(i,1,n){
            if(seki[i]/a[i]!=seki[i-1]){ok=0;break;}
        }
    }
    if(ok)cout<<seki[n-1]<<endl;
    else cout<<-1<<endl;
}

    









Measured memory_bytes: 5160
#include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

#define INF 1000000000

typedef long double Real;
#define EPS 1e-13
#define EQ(x) (-EPS<x && x<EPS)
typedef complex<Real> P;
Real dot(P a,P b){return real(conj(a)*b);}
Real cross(P a,P b){return imag(conj(a)*b);}

int main(){
  bool flag = true;
  vi leap;
  REP(i,3535){
    if(i%4==0 && (i%100!=0 || i%400==0))leap.push_back(i);
  }
  while(true){
    int a,b;
    cin>>a>>b;
    if(!a && !b)break;
    if(flag){
      flag = false;
    }else{
      cout<<endl;
    }
    int left = lower_bound(ALL(leap),a) - leap.begin();
    int right = upper_bound(ALL(leap),b) - 1 - leap.begin();
    if(left > right){
      cout<<"NA"<<endl;
    }else{
      FOR(i,left,right+1)cout<<leap[i]<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1228
#include<bits/stdc++.h>
using namespace std;
long long dp[55][55][55*55];
int x[55];
int main()
{
	int n,a;
	scanf("%d%d",&n,&a);
	for(int i=1;i<=n;i++)
		scanf("%d",&x[i]);
	dp[1][1][x[1]]=1;
	for(int i=2;i<=n;i++)
		for(int j=1;j<=i;j++)
			for(int k=1;k<=a*n;k++)
			{
				dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-x[i]];
				if(j==1)
					dp[i][j][k]+=(x[i]==k);
			}
	long long sum=0;
	for(int i=1;i<=n;i++)
		sum+=dp[n][i][a*i];
	printf("%lld\n",sum);
	return 0;
}


Measured memory_bytes: 65792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    set<int> st;
    vector<int> v;
    rep(i, 0, n) {
        int a;
        cin >> a;
        if (st.count(a)) {
            st.erase(a);
            v.push_back(a);
        } else {
            st.insert(a);
        }
    }

    sort(v.begin(), v.end(), greater<int>());

    if (2 <= v.size()) cout << (ll) v[0] * v[1] << endl;
    else cout << 0 << endl;

    return 0;
}


Measured memory_bytes: 4992
import sys
import numpy as np 

a = []
for l in sys.stdin:
  a.append(l.split(" "))
b=np.array(a).astype(int)

n=b[0,0]
d=b[0,1]
table=b[1:,:]
count=0
distance=np.sqrt(np.power(table[:,0],2)+np.power(table[:,1],2))
print((distance<=d).sum())


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

// int/long:		-2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<30)
//1,073,741,824
//= 536,870,912 *2

#define	MOD 1000000007

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)
// while (getline(cin, S)) {}

// cout <<fixed <<setprecision(10)

// priority_queue<int> q;
// priority_queue<int, vector<int>, less<int>> q; // Default: vector, less
// priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> q;

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

//
// Notes
//
// When specified less than N, try full scan.
// RE: empty vector
// Check Qs
// long/int
// xor -> count each bit
// Check values
// 	1,000,000 -> Loop
// 	100,000	-> vector(int:400KB, long:800KB) 

const int MAX = 200000;

void	ComInit(vector<long> &fac, vector<long> &finv, vector<long> &inv) {
	fac.at(0) = 1;
	fac.at(1) = 1;
	finv.at(0) = 1;
	finv.at(1) = 1;
	inv.at(1) = 1;
	for (int i=2; i<MAX; i++) {
		fac.at(i) = (fac.at(i-1)*i) %MOD;
		inv.at(i) = MOD - (inv.at(MOD%i)*(MOD/i)) %MOD;
		finv.at(i) = (finv.at(i-1)*inv.at(i)) %MOD; 
	}
}

long	COM(int N, int K, vector<long> &fac, vector<long> &finv) {
	if (N<K)
		return 0;
	if ((N<0)||(K<0))
		return 0;
	return (fac.at(N) * ((finv.at(K)*finv.at(N-K)) %MOD)) %MOD;
}

int	main() {
	// Array
	vector<long> fac(MAX);
	vector<long> finv(MAX);
	vector<long> inv(MAX);
	// Initialize
	ComInit(fac, finv, inv);
	/*
	// Example
	cout << "N?";
	int i;
	cin >>i;
	for (int j=0; j<=i; j++)
		cout << i << 'C' << j << " = " << COM(i, j, fac, finv) << endl;
	*/
	long n;
	cin >>n;
	vector<long> a(n+2, 0);
	vector<long> b(n+1, 0);
	long l=0;
	long r=0;
	for (int i=1; i<=n+1; i++) {
		cin >>a.at(i);
		if (0==b.at(a.at(i)))
			b.at(a.at(i))=i;
		else {
			l=b.at(a.at(i));
			r=i;
		}
	}
	for (int long i=1; i<=n+1; i++) {
		long S=COM(n+1, i, fac, finv);
		S +=MOD-COM(n-r+l, i-1, fac, finv);
		S %=MOD;
		cout <<S <<endl;
	}
	return 0;
}



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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int a, b;
  cin >> a >> b;
  cout << (a*b%2 ? "Yes": "No") << endl;

  return 0;
}


Measured memory_bytes: 892
#!/usr/bin/env python

class PrimeFactor():
    def __init__(self, n):
        '''
            Note:
                make the table of Eratosthenes' sieve
                and minFactor[] for fast_factorization.
        '''
        self.n = n
        self.table = [True for _ in range(n+1)]
        self.table[0] = self.table[1] = False
        self.minFactor = [-1 for _ in range(n+1)]

        for i in range(2, n+1):
            if not self.table[i]: continue
            self.minFactor[i] = i 
            for j in range(i*i, n+1, i): 
                self.table[j] = False
                self.minFactor[j] = i 
    
    def fast_factorization(self, n):
        '''
            Note:
                factorization
                return the form of {factor: num}.
        '''
        data = {}
        while n > 1:
            if self.minFactor[n] not in data:
                data[self.minFactor[n]] = 1 
            else:
                data[self.minFactor[n]] += 1
            n //= self.minFactor[n]
        return data

    def count_divisors(self, n):
        '''
            Note:
                return the number of divisors of n.
        '''
        ret = 1 
        for v in self.fast_factorization(n).values():
            ret *= (v+1)
        return ret 

n = int(input())
ans = 0
a = PrimeFactor(n)
for i in range(1, n): 
    ans += a.count_divisors(i)
print(ans)


Measured memory_bytes: 27144
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	int n;
	int[] x, y, r, c;
	byte[] memo;

	void run() {
		for (;;) {
			n = sc.nextInt();
			if (n == 0) return;
			x = new int[n];
			y = new int[n];
			r = new int[n];
			c = new int[n];
			memo = new byte[1 << n];
			for (int i = 0; i < 1 << n; i++) memo[i] = -1;
			for (int i = 0; i < n; i++) {
				x[i] = sc.nextInt();
				y[i] = sc.nextInt();
				r[i] = sc.nextInt();
				c[i] = sc.nextInt();
			}
			int max = 0;
			// ????????????????????????????????????????±???????
			for (int i = 0; i < n; i++) {
				for (int j = i + 1; j < n; j++) {
					if (c[i] != c[j]) continue;
					if (!noCover(i , j , 0)) continue;
					max = Math.max(max, 2 + bitDP(1 << i | 1 << j));
				}
			}
			System.out.println(max);
		}
	}

	int bitDP(int mask) {
		if (memo[mask] != -1) return memo[mask];

		byte res = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (c[i] != c[j]) continue;
				// ??¢???i or j????????£?????????
				if ((mask & (1 << i)) != 0 || (mask & (1 << j)) != 0) continue;
				if (!noCover(i, j, mask)) continue;
				res = (byte) Math.max(res, 2 + bitDP(mask | (1 << i | 1 << j)));
			}
		}
		return memo[mask] = res;
	}

	boolean noCover(int i, int j, int mask) {
		for (int k = j - 1; k >= 0; k--) {
			// ??¢???k???????????????????????????
			if ((mask & 1 << k) != 0) continue;
			int pDis_j = (x[k] - x[j]) * (x[k] - x[j]) + (y[k] - y[j]) * (y[k] - y[j]);
			int rDis_j = (r[k] + r[j]) * (r[k] + r[j]);
			int pDis_i = (x[k] - x[i]) * (x[k] - x[i]) + (y[k] - y[i]) * (y[k] - y[i]);
			int rDis_i = (r[k] + r[i]) * (r[k] + r[i]);
			// k?????????????????£??????????????§????????????
			if (pDis_j < rDis_j) return false;
			if (k < i && pDis_i < rDis_i) return false;
		}
		return true;
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 228428
/*
	Author: Ritik Patel
*/


//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& STL DEBUGGER &&&&&&&&&&&&&&&&&&&&&&&&&&&

// #define _GLIBCXX_DEBUG       // Iterator safety; out-of-bounds access for Containers, etc.
// #pragma GCC optimize "trapv" // abort() on (signed) integer overflow.

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LIBRARIES &&&&&&&&&&&&&&&&&&&&&&&&&&&

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

/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
template<typename T, typename V = __gnu_pbds::null_type>
using ordered_set = __gnu_pbds::tree<T, V, less<T>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>; 
*/
//find_by_order()->returns an iterator to the k-th largest element(0-based indexing)
//order_of_key()->Number of items that are strictly smaller than our item

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& DEFINES &&&&&&&&&&&&&&&&&&&&&&&&&&&

#define int long long int
#define all(i) i.begin(), i.end()
#define sz(a) (int)a.size()
 
// #define ld long double
// const ld PI  = 3.141592;
const int dx4[4] = {0, 1, 0, -1};
const int dy4[4] = {-1, 0, 1, 0};
const int dx8[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy8[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
 
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& DEBUG &&&&&&&&&&&&&&&&&&&&&&&&&&&
 
#define XOX
vector<string> vec_splitter(string s) {
    for(char& c: s) c = c == ','?  ' ': c;
    stringstream ss; ss << s;
    vector<string> res;
    for(string z; ss >> z; res.push_back(z));
    return res;
}
 
void debug_out(vector<string> __attribute__ ((unused)) args, __attribute__ ((unused)) int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
    if(idx > 0) cerr << ", ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, T...);
}
 
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__)
#else
#define debug(...) 42
#endif
 
 
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CODE &&&&&&&&&&&&&&&&&&&&&&&&&&&

void solve(){
    int N; cin >> N;
    N %= 1000;
    if(N == 0){
        cout << 0 << '\n';
    } else {
        cout << 1000 - N << '\n';
    }
}



int32_t main(){
    ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); 
    int T = 1; 
    // cin >> T;
    for(int i = 1; i <= T; ++i){
        // brute();
        solve();
    }
    return 0;
}

/*
Sample inp
*/

Measured memory_bytes: 3652
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
typedef int64_t ll;
typedef uint64_t ull;
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)

#define MAXN (200001)
#define MOD (1000000007)

int main(void)
{
    ll r;
    scanf("%ld",&r);

    
    printf("%ld\n", r*r);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

#include <climits>

using namespace std;


int main(){
	
	int n, l;
	
	cin >> n >> l;

	vector<string> arr(n);

	for (int i = 0; i < n; i++)cin >> arr[i];

	sort(arr.begin(), arr.end());

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

	cout << endl;

	return 0;

}

Measured memory_bytes: 3628
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int[] cnt=new int[26];
		for(int i=0;i<N;i+=2){
			cnt[S[i]-'a']++;
		}
		int ans=0;
		for(int t=9;t>0;t--){
			int c=0;
			for(int i=0;i<26;i++){
				if(cnt[i]==t)c++;
			}
			
			if(t==1){
				ans+=2*c;
			}else{
				if(c>=3){
					ans+=4+2*c;
				}else{
					ans+=4*c;
				}
			}
		}
		Console.WriteLine(ans-1);
		
		
	}
	int N;
	String S;
	public Sol(){
		N=ri();
		S=rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}

Measured memory_bytes: 9240
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------


n,m,x = mapi()
a =[]
cost = []
for i in range(n):
    tmp = list(mapi())
    cost.append(tmp[0])
    a.append(tmp[1:])
#
res = 0
def check(y):
    for i in y:
        if i<x:
            return False
    return True

def rec(i,arr):
    if check(arr):
        return 0
    if i>=n:
        return float("inf")
    #res= float("inf")
    selct = a[i][:]
    for l in range(m):
        selct[l]+=arr[l]
    return min(cost[i]+rec(i+1,selct),rec(i+1,arr))
tm = [0]*m
res = rec(0,tm)
if res==float("inf"):
    print(-1)
else:
    print(res)


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

int main(){
     int n; cin >> n;
     int d[n];
     for(int i = 0; i < n; i++) cin >> d[i];
     int sum = 0;
     for(int i = 0; i < n; i++)
         for(int j = i + 1; j < n; j++)
      	     sum += d[i] * d[j];
     cout << sum << endl;
     return 0;      	     
             
}


Measured memory_bytes: 256
// B.

#include <iostream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[]) {
	int n, m, x;
	cin >> n >> m >> x;
	int sum[2] = {};
	for (int i = 0; i < m; ++i) {
		int a;
		cin >> a;
		if (a < x) {
			sum[0] += 1;
		} else if (a > x) {
			sum[1] += 1;
		}
	}
	cout << min(sum[0], sum[1]) << endl;
	return 0;
}


Measured memory_bytes: 256
n = int(input())
input_line = [list(map(int,input().split())) for i in range(n)]
time=0
point = [0,0]

ans=1
for i in range(n):
    t,x,y = map(int,input_line[i])
    dist = abs(point[0]-x)+abs(point[1]-y)
    limit = t-time
    if dist>limit:
        ans=0
        break
    if (limit-dist)%2!=0:
        ans=0
        break
    time=t
    point=[x,y]
print('Yes' if ans==1 else 'No')

Measured memory_bytes: 27380
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<ll, P> P3;
typedef pair<P, P> PP;
constexpr ll MOD = ll(1e9 + 7);
constexpr int IINF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
constexpr int MAX_N = int(1e5) + 5;
constexpr double EPS = 1e-9;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()




int main() {
    int a, b;
    cin >> a >> b;
    if(b == 1){
        cout << 0 << endl;
        return 0;
    }
    int cnt = a, ans = 1;
    while(cnt < b){
        cnt += a-1;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
// {{{ by unolight
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

namespace { namespace unolight {
// Read Input
template<class T> void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( int64_t &x ) { scanf("%" PRId64,&x); }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }
void R() {}
template<class T, class... U> void R( T& head, U&... tail ) { _R(head); R(tail...); }
// Write Output
template<class T> void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
void _W( const int64_t &x ) { printf("%" PRId64,x); }
void _W( const double &x ) { printf("%.16f\n",x); }
void _W( const char &x ) { putchar(x); }
void _W( const char *x ) { printf("%s",x); }
template<class T> void _W( const vector<T> &x ) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W( const T& head, const U&... tail ) { _W(head); putchar(sizeof...(tail)?' ':'\n'); W(tail...); }

#ifdef UNOLIGHT
#include "dump.hpp"
#else
#define dump(...)
#endif

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}
// }}}


void main() {
    int n;
    R(n);
    vector<LL> ans(n);
    map<int,PII> mp;
    // int tot=0;
    REP(i,n) {
        int a; R(a);
        // tot+=a;
        if ( !mp.count(a) ) {
            mp[a]=MP(i,0);
        }
        mp[a].second++;
    }
    // dump(tot);
    vector<pair<int,PII>> vs;
    vs.PB(MP(0,MP(0,0)));
    for ( auto &p:mp ) vs.PB(p);
    // for ( int i=0; i<n; i++ ) {
    //     dump(vs[i].first, vs[i].second.second);
    // }
    int sum=0,id=n;
    for ( int i=SZ(vs)-1; i; i-- ) {
        int now=vs[i].first;
        chmin(id,vs[i].second.first);
        sum+=vs[i].second.second;
        int prv=vs[i-1].first;
        ans[id]+=(LL)(now-prv)*sum;
    }
    REP(i,n) W(ans[i]);
}

}} // {{{ main
int main() { unolight::main(); return 0; }
// }}}



Measured memory_bytes: 11992
#!/usr/bin/env python3

import sys
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from fractions import gcd                    # for Python3.4.3


def main():
    mod = 10000007                  # 10^9+7
    inf = float('inf')
    input = sys.stdin.readline      # 改行文字が残ることに注意
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def ii():  return int(input())
    def mi():  return map(int, input().rstrip().split())
    def lmi(): return list(map(int, input().rstrip().split()))
    def li():  return list(input().rstrip())
    

    def illuminate_p(state, bulb, L, P):
        connected_count = 0
        mask = 0b1
        for switch in L[bulb]:
            if state & (mask << switch):
                connected_count += 1
        return connected_count % 2 == P[bulb]
    

    n, m = mi()
    L = [None] * m
    # L[i] に電球 i のつながっているスイッチのリストが入る
    for i in range(m):
        line = list(map(lambda x: int(x)-1, input().rstrip().split()))
        L[i] = line[1:]
    P = lmi()

    ans = 0
    # state の下位 [j] bit が [j] 番目の switch が on かどうかのフラグとなる
    for state in range(2**n):
        for bulb in range(m):
            if not illuminate_p(state, bulb, L, P):
                break
        else:
            ans += 1
    print(ans)



if __name__ == "__main__":
    main()

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

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	for(auto &i:a)cin >> i;
	sort(a.begin(),a.end());
	//a.erase(unique(a.begin(),a.end()),a.end());
	//for(auto i:a)cout<<i<<endl;
	int ans = 0;
	for(int BIT;BIT<(1<<23);BIT++)
	{
		int bit = BIT<<1;
		bit ++;
		int now = 24;
		int l = 1;
		for(int i = 1;i<24;i++)
		{
			if((bit>>i&1)==0)l ++;
			else
			{
				now = min(l,now);
				l=1;
			}
		}
		now = min(l,now);
		//cout<<now<<endl;
		bool flag = true;
		bit--;
		for(int i =0 ;i<n;i++)
		{
			if((bit>>a[i]&1))
			{
				bit -= 1<<a[i];
			}
			else if((bit>>(24-a[i])&1))
			{
				bit -= 1<<(24-a[i]);
			}
			else 
			{
				flag = false;
			}
		}
		if(flag)
		{
			//cout<<';'<<endl;

			ans = max(now,ans);
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7

int main(){
	ll K, X;
	cin >> K >> X;

	K--;
	for(ll i = X - K; i <= X + K; i++) {
		cout << i;
		if(i == X + K) {
			cout << endl;
		} else {
			cout << " ";
		}

	}

}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int c=0;
    long int n;
    cin>>n;
    long int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<n-1;i++)
    {
        if(a[i]==a[i+1])
        {
            c=1;
            break;
        }
    }
    if(c==1)
        cout<<"NO";
    else
        cout<<"YES";
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, begin, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    string S;
    cin >> S;
    rep(i, 0, 3)
    {
        if (S.at(i) == S.at(i + 1))
        {
            cout << "Bad" << endl;
            return 0;
        }
    }
    cout << "Good" << endl;
}

Measured memory_bytes: 256
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,sse4,avx,avx2")
// #pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define FILL(a, b) memset(a, b, sizeof(a))

void dout() { cerr << endl; }

template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
    cerr << H << ' ';
    dout(T...);
}

mt19937 rnd(time(0));

const int MOD = 1000 * 1000 * 1000 + 7;

LL binpow(LL a, LL n)
{
    LL res = 1;
    while(n)
    {
        if (n & 1)
        {
            res *= a;
            res %= MOD;
        }
        a *= a;
        a %= MOD;
        n >>= 1;
    }
    return res;
}

LL inv(int x)
{
    return binpow(x, MOD - 2);
}

LL fac[4474];

LL C(int n, int k)
{
    return (((fac[n] * inv(fac[k])) % MOD) * inv(fac[n - k])) % MOD;
}

int main()
{       
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;

    fac[0] = 1;
    for (int i = 1; i < 4444; ++i)
    {
        fac[i] = fac[i - 1] * i;
        fac[i] %= MOD;
    }

    LL ans = 0;
    for (int len = 1; len * 3 <= n; ++len)
    {
        int sum = n - len * 3;
        ans += C(sum + len - 1, sum);
        // dout("C(", sum + len - 1, ",", sum, ") =", C(sum + len - 1, sum));
        ans %= MOD;
    }

    cout << ans << "\n";


    return 0;
}


Measured memory_bytes: 3688
#include <vector>
#include <stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;

int a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
};

int main()
{
    long long a,b,c;
    scanf("%lld%lld%lld",&a,&b,&c);
    if (c-a-b<0){
        printf("No");return 0;
    }
    if (4*a*b<1LL*(c-a-b)*(c-a-b)){
        printf("Yes\n");
    }
    else
        printf("No\n");


}


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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    
    ll ans = 0;
    for (int i = 0; i < n - 2; ++i) {
        for (int j = i + 1; j < n - 1; ++j) {
            int safe = lower_bound(a.begin(), a.end(), a[i] + a[j]) - a.begin();
            ans += max(safe - j - 1, 0);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3604
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<iterator>
#include<complex>
#include<stack>
using namespace std;
string s;
using MIte = multimap<vector<char>, int>::iterator;

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

	multimap<vector<char>, int> mpStr;
	for (int i = 0; i != N; i++) {
		string s;
		cin >> s;
		vector<char> vcStr;
		for (int j = 0; j != 10; j++) {
			vcStr.push_back(s[j]);
		}
		sort(vcStr.begin(), vcStr.end());
		MIte it = mpStr.find(vcStr);
		if (it == mpStr.end()) {
			mpStr.insert(make_pair(vcStr, 1));
		}
		else {
			it->second += 1;
		}
	}

	long long cnt = 0;
	for (MIte it = mpStr.begin(); it != mpStr.end(); it++) {
		long iElem = it->second;
		cnt += iElem * (iElem - 1) / 2;
	}

	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 11136
#include<stdio.h>
#define H 101
#define W 101

void MagTile(int y,int x,int data[H][W],char Tiles[H][W]){
  if (data[y][x]==1){
    printf("LOOP\n");
    return ;
  }
  if (Tiles[y][x]=='.'){
    printf("%d %d\n",x,y);
    return ;
  }
  switch(Tiles[y][x]){
  case '>':data[y][x++]++;break;
  case '<':data[y][x--]++;break;
  case '^':data[y--][x]++;break;
  case 'v':data[y++][x]++;break;
  }
  MagTile(y,x,data,Tiles);
}

int main(){
  int i,j,w,h;
  int data[H][W];
  char Tiles[H][W];
  while(scanf("%d %d",&h,&w)){
    if ((h==0) && (w==0))
      break;
    for (i=0;i<h;i++)
      for (j=0;j<w;j++){
        scanf(" %c",&Tiles[i][j]);
        data[i][j]=0;
      }
    MagTile(0,0,data,Tiles);
  }

  return 0;
}

Measured memory_bytes: 660
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

ST = read_str()
S, T = list(ST.split())
AB = read_int()
A, B = AB
U = read_str()

def solve():
    ans = 0
    if S == U:
        print(A - 1, B)
    else:
        print(A, B - 1)
    return A, B

if __name__ == "__main__":
    solve()

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

int main() {
  int x, a, b;
  cin >> x >> a >> b;
  if(a >= b){
    cout << "delicious" <<endl;
  }
  else if(b - a <= x){
    cout << "safe" <<endl;
  }
  else{
    cout << "dangerous" <<endl;
  }

}


Measured memory_bytes: 256
f :: String -> Int
f [x',y',z'] = abs $ 753 - (100*(read [x']) + 10*(read [y']) + (read [z']))
f (x':y':z':l) = let x = (read [x'])
                     y = (read [y'])
                     z = (read [z'])
                 in
                 if (abs $ 753 - (100*x + 10*y + z)) <= f (y':z':l)
                   then abs $ 753 - (100*x + 10*y + z)
                   else f (y':z':l)

main :: IO ()
main = do
  s <- getLine
  putStrLn $ show $ f s

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

typedef long long ll;
typedef long double ld;

bool check(string s){
    int n = s.size();
    for(int i=0; i<n-i-1; i++){
        if(s[i] != s[n-i-1]) return 0;
    }
    return 1;
}

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

	string s;
	cin >> s;
	int n = s.size();
	if(!check(s)){
        cout << "No";
        return 0;
	}
	int sz = (n-1)/2;
	string ss = "";
	for(int j=0; j<sz; j++) ss += s[j];
	if(!check(ss)){
        cout << "No";
        return 0;
	}
	ss = "";
	for(int j=(n+3)/2-1; j<n; j++) ss += s[j];
	if(!check(ss)) cout << "No";
	else cout << "Yes";
    return 0;
}


Measured memory_bytes: 256
H, W = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))

nl = []

for i in range(N):
  nl += [str(i+1)] * A[i]

#print(nl)

for i in range(H):
  work = nl[i*W:(i+1)*W]
  if i%2 == 1:
    work.reverse()
  print(" ".join(work))

Measured memory_bytes: 3700
N , H, W = (int(i) for i in input().split())

hh = []
ww = []
for j in range(N):
    hhj, wwj = (int(i) for i in input().split())
    hh.append(hhj)
    ww.append(wwj)

num = 0
for j in range(N):
    if hh[j] >= H and ww[j] >= W:
        num = num + 1

print(num)


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

int main(){
  ll i, j;
  string s, t;
  cin >> s >> t;
  bool judge = false;
  char buf;
  for(i = 0; i < s.size() && !judge; i++){
    if(s == t)
      judge = true;
    else{
      buf = s[0];
      for(j = 0; j < s.size() - 1; j++)
        s[j] = s[j + 1];
      s[j] = buf;
    }
    //cout << s << endl;
  }
        
      
  if(judge)   
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

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

int main(){
	int n;
	long long Li,Li1,Li2;

	cin >> n;

	Li2 = 2;
	Li1 = 1;
	Li = Li1;

	for(int i=2;i<=n;i++){
		Li = Li1+Li2;
		Li2 = Li1 ;
		Li1 = Li ;
	}

	cout << Li << endl;

	return 0;
}

Measured memory_bytes: 256