akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e8;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
	int n;cin>>n;
	int ma=0,m;
	rep(i,n-1){
		cout<<"? "<<i+1<<" "<<n<<endl;
		int a;cin>>a;
		if(ma<a){
			ma=a;
			m=i;
		}
	}
	vi out(n);
	out[0]=m;
	rep(i,n)if(i!=m){
		cout<<"? "<<i+1<<" "<<m+1<<endl;
		int a;cin>>a;
		out[a]=i;
	}
	cout<<"!";
	rep(i,n)cout<<" "<<out[i]+1;cout<<endl;
}

Measured memory_bytes: 3568
n, k = map(int,input().split())
d = list(map(str, input().split()))
while True:
    S = str(n)
    t = 0
    for i in S:
        if i not in d:
            t += 1
    if t == len(S):
        print(int(S))
        break
    else:
        n += 1

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

int to_int(string s){
    return s[0] - 48;
}

string concat(string a, string b){
	string s = "";
	for(int i=0; i<to_int(b); i++){
		s = s + a;
	}
	return s;
}

int main() {
	int a,b;
	cin>>a>>b;
	string s1 = concat(to_string(a),to_string(b));
	string s2 = concat(to_string(b),to_string(a));

	string out;
	if(s1.length() < s2.length()){
        out = s1;
        for(unsigned int i=0; i<s2.length(); i++){
            if(s2[i] < s1[i]){
                out = s2;
                break;
            }
        }
	}
	else{
        out = s2;
        for(unsigned int i=0; i<s1.length(); i++){
            if(s1[i] < s2[i]){
                out = s1;
                break;
            }
        }
	}
	cout<<out<<endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60

ll N, Z, W;
ll dp[2001][2001];
vector<ll> a;

int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
	cin >> N >> Z >> W;
	a.resize(N + 1);
	for (int i = 1; i <= N;i++) cin >> a[i];
	if (N == 1) {
		cout << abs(a[1] - W) << endl;
	}
	else {
		cout << max(abs(a[N] - a[N - 1]), abs(a[N] - W)) << endl;
	}
	return 0;
}

Measured memory_bytes: 256
def main():
    S = input()

    s = set(S)
    repeat = []
    for c in s:
        repeat.append(operate(S, c))

    ans = min(repeat)
    print(ans)

def operate(txt, char):
    n = len(txt)
    tmp = ''
    ret = 0
    while len(set(txt)) > 1:
        i = 0
        n -= 1
        while i < n:
            if txt[i] == char or txt[i+1] == char:
                tmp = tmp + char
            else:
                tmp = tmp + txt[i]
            i += 1
        txt = tmp
        tmp = ''
        ret += 1

    return ret

main()


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

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

    vector<int> num(1, 1);

    for(int i = 1; i < k; i++){
        num[0]++;
        int size = num.size();

        for(int j = 0; j < size; j++){
            if(num[j] >= 10){
                num[j] = 0;
                if(j == size - 1){
                    num.push_back(1);
                    size++;
                }
                else num[j + 1]++;
            }
        }

        for(int j = size - 2; j >= 0; j--){
            if(num[j] > num[j+1] + 1){
                for(int k = j + 1; k < size; k++){
                    if(k == size - 1 || num[k] <= num[k+1]){
                        num[k]++;
                        j = k - 1;
                        break;
                    }
                }
                for(; j >= 0; j--){
                    num[j] = max(num[j+1] - 1, 0);
                }
            }
            else if(num[j] < num[j+1] - 1){
                for(; j >= 0; j--){
                    num[j] = max(num[j+1] - 1, 0);
                }
            }
        }
        //for(int j = num.size() - 1; j >= 0; j--) cout << num[j];
        //cout << endl;
    }

    for(int i = num.size() - 1; i >= 0; i--) cout << num[i];
    cout << 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);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        System.out.println("");

        int ab = a + b;
        int ac = a + c;
        int bc = b + c;

        int[] prices = new int[] {ab, ac, bc};
        Arrays.sort(prices);

        System.out.println(prices[0]);
    }

}

Measured memory_bytes: 23764
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, M = mapint()
mod = 10**9+7

dp = [0]*(N+1)
dp[0] = 1
broken = set([int(input()) for _ in range(M)])
for i in range(1, N+1):
    if i in broken:
        continue
    dp[i] += dp[i-1]
    if i>=2:
        dp[i] += dp[i-2]
    dp[i] %= mod
print(dp[-1])

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

int main(){
  int a,b;
  cin >> a >> b;
  if(a>=10 || b>=10){
    cout << "-1" << endl;
    return 0;
  }
  else{
    cout << a*b << endl;
    return 0;
  }
}

Measured memory_bytes: 256
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def f(k,p):
    if p<k:
        ret = 0
    if k==0:
        ret = 1
    elif k==1:
        ret = p*9
    elif k==2:
        ret = 9*9*p*(p-1)//2
    else:
        ret = 9*9*9*p*(p-1)*(p-2)//6
    #ddprint("f k {} p {} ret {}".format(k,p,ret))
    return ret

def g(k,p,n):
    #ddprint("g k {} p {} n {} called".format(k,p,n))
    if p==0 or p<k:
        return 0
    if k==0:
        ret = 1
    elif p==1:
        ret = n
    elif n<10**(p-1):
        ret = g(k,p-1,n)
    else:
        m = n//(10**(p-1))
        ret = g(k-1,p-1,n-m*(10**(p-1))) + (m-1)*f(k-1,p-1) + f(k,p-1)
    #ddprint("g k {} p {} n {} ret {}".format(k,p,n,ret))
    return ret

n = inn()
k = inn()
print(g(k,100,n))


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

typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vstr;

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define asd cout << "ok" << endl;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define trav(it, m) for(auto it = m.begin(); it it!= m.end(); it++)

const char nl = '\n';
const int MOD = 1e9 +7;
const ll INF = 1e19;
const ld PI = acos((ld)-1);
const int MX = 2e5 + 5;

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

  int n ,m, c; cin >> n >> m >> c;
  int ans = 0;
  int b[m];
  for(int i = 0; i < m; i++)
    cin >> b[i];
  for(int i = 0; i < n ; i++){
      int tmp = 0;
    for(int j = 0; j< m; j++){
      int x; cin >> x;
      tmp += x*b[j];
    }
    if(tmp + c > 0)
      ans++;
  }
  cout << ans << nl;


  return 0;
}




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

int main() {
    int N;
    cin >> N;
    vector<vector<ll>> cnt(10, vector<ll>(10, 0));
    for (int n = 1; n <= N; n++) {
        string n_str = to_string(n);
        cnt[n_str.front() - '0'][n_str.back() - '0']++;
    }

    ll ans = 0;
    for (int i = 0; i <= 9; i++) {
        for (int j = 0; j <= 9; j++) {
            ans += cnt[i][j] * cnt[j][i];
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
static const int MAX=1000;
static const int VMAX=10000;

int n,A[MAX],s;
int B[MAX],T[VMAX+1];

int solve(){
  int ans=0;

  bool V[MAX];
  int i;
  for(i=0;i<n;i++){
    B[i]=A[i];
    V[i]=false;
  }
  sort(B,B+n);

  for(i=0;i<n;i++) T[B[i]]=i;
  for(i=0;i<n;i++){
    if(V[i]) continue;
    int cur=i;
    int S=0;
    int m=VMAX;
    int an=0;
    while(1){
      V[cur]=true;
      an++;
      int v=A[cur];
      m=min(m,v);
      S+=v;
      cur=T[v];
      if(V[cur]) break;
    }
    ans+=min(S+(an-2)*m,m+S+(an+1)*s);
  }
  return ans;
}

int main(){
  cin>>n;
  s=VMAX;
  int i;
  for(i=0;i<n;i++){
    cin>>A[i];
    s=min(s,A[i]);
  }
  int ans=solve();
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 3164
house = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())

for i in range(n):
    b, f, r, v = map(int, input().split())
    house[b - 1][f - 1][r - 1] += v

for b in range(4):
    for f in house[b]:
        print('', *f)
    if b != 3:
        print('#' * 20)

Measured memory_bytes: 7680
#include <iostream>
#include <algorithm>

using namespace std;

int main(void) {
    while (true) {
        int n, m, c2 = 0, c5 = 0;
        cin >> n;
        if (n == 0) break;
        for (int i = 1; i <= n; i++) {
            m = i;
            while (m % 2 == 0) {
                m /= 2;
                c2++;
            }
            while (m % 5 == 0) {
                m /= 5;
                c5++;
            }
        }
        cout << min(c2, c5) << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>
int main(){
	long long int n,sum=0;
	scanf("%ld",&n);
		for(int i=1;i<=n;i++){
		if(i%3 == 0 && i%5 ==0) continue;
		else if(i%3==0) continue;
		else if(i%5==0) continue;
		sum += i;
		}
			printf("%lld\n",sum);
 	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)


int main(){
    int N,M;
    cin>>N>>M;
    cout<<N*(N-1)/2+M*(M-1)/2<<endl;    
    return 0;
}

//a=97,z=122

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
typedef long long       ll;
#define pb                emplace_back
#define mp              make_pair
#define sz(a)           a.size()
#define mods(a, m)          ((a % m + m) % m)   
#define md(a)               mods(a, MOD)
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define mem(a,h)          memset(a, (h), sizeof(a))
#define F first
#define S second
#define f first
#define s second
#define fore(i, b, e)     for (int i = b; i < e; i++)
#define forr(i, b, e)     for (int  i = b; i < e; i++)
int faster_in(){int r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -faster_in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;
//using namespace __gnu_pbds;
typedef long double       ld;

typedef pair<int, int>  ii;
typedef vector<int>     vi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const int INF = int(1e7 + 7);
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1);
#define tam 1230456
int main()
{
    std::ios::sync_with_stdio(false); cin.tie(0);
    int a,b;
    cin>>a>>b;
    cout<<a/b+(a%b!=0)<<endl;
}
// PLUS ULTRA!


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001001001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int n;
    cin >> n;
    vector<int> aa(n);
    int minus_maxi = 0;
    int minus_idx = 0;
    int plus_maxi = 0;
    int plus_idx = 0;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        aa[i] = a;
        if (a < 0)
        {
            minus_maxi = max(minus_maxi, abs(a));
            if (minus_maxi + aa[i] == 0)
            {
                minus_idx = i;
            }
        }
        else
        {
            plus_maxi = max(plus_maxi, a);
            if (plus_maxi == aa[i])
            {
                plus_idx = i;
            }
        }
    }
    cout << n * 2 - 1 << endl;
    if (plus_maxi >= minus_maxi)
    {
        for (int i = 0; i < n; i++)
        {
            aa[i] += plus_maxi;
            cout << plus_idx + 1 << ' ' << i + 1 << endl;
        }
        for (int i = 1; i < n; i++)
        {
            aa[i] += aa[i - 1];
            cout << i << ' ' << i + 1 << endl;
        }
    }
    else
    {
        for (int i = 0; i < n; i++)
        {
            aa[i] -= minus_maxi;
            cout << minus_idx + 1 << ' ' << i + 1 << endl;
        }
        for (int i = n - 2; i >= 0; i--)
        {
            aa[i] += aa[i + 1];
            cout << i + 2 << ' ' << i + 1 << endl;
        }
    }
    // print(aa);
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
  using namespace std;
 
int main(){
  vector<int> a(5);
  bool canCom=true;
  for(int i=0;i<5;i++){
    cin>>a.at(i);
  }
  int k;
  cin>>k;
  for(int i=0;i<5;i++){
    if(!canCom) break;
    for(int j=i+1;j<5;j++){
      if(a.at(j)-a.at(i)>k){
       canCom=false;
        break;
      }
    }
  }
  
  if(canCom){
    cout<<"Yay!"<<endl;
  }else{
    cout<<":("<<endl;
  }
}

Measured memory_bytes: 256
n = int(input())
L1 = list(map(int, input().split()))
L2 = list(map(int, input().split()))

ans = 0
for i in range(n):
    L1_ = L1[0:i+1]
    L2_ = L2[i:]
    #print(L1_, L2_)
    temp = sum(L1_) + sum(L2_)
    ans = max(ans, temp)
print(ans)


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

int main() {
	vector<int> a(3);
	for (int i = 0;i < 3;i++) {
		cin >> a[i];
	}

	int ans = 0;
	while (!(a[0] == a[1] && a[1] == a[2])) {
		sort(a.begin(), a.end());
		while (a[1] < a[2]) {
			a[1]++;
			a[0]++;
			ans++;
		}
		while (a[0] < a[2]) {
			a[0] += 2;
			ans++;
		}
	}
	cout << ans << endl;


	return 0;
}

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

signed main()
{
    int n,k;
    cin>>n>>k;
    int x=n%k;
    cout<<min(x,k-x)<<endl;
    
    return 0;
}

Measured memory_bytes: 256
//
// ~oisín~ C++ Template
//

#include                <bits/stdc++.h>
#define MX_N            5001
#define mp              make_pair
#define mod7            1000000007
#define modpi           314159
#define PI              3.141592653589793238
#define pb              push_back
#define FastIO          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define All(a)          a.begin(),a.end()
#define fi              first
#define se              second
#define ll              long long int
#define ull             unsigned long long int

int kx[8]  =            {+2, +2, -2, -2, +1, +1, -1, -1};
int ky[8]  =            {+1, -1, +1, -1, +2, -2, +2, -2};
int d9x[9] =            {+1, +1, +1, +0, +0, +0, -1, -1, -1};
int d9y[9] =            {+1, +0, -1, +1, +0, -1, +1, +0, -1};
int dx4[4] =            {+0, +0, +1, -1};
int dy4[4] =            {+1, -1, +0, +0};

ll gcd(ull a, ull b){
    return (a==0)?b:gcd(b%a,a);
}

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

const long long INF = 1e18;

using namespace std;

int main(){
    int a[5];
    for(int i=0;i<5;++i){
        cin >> a[i];
        if(a[i] == 0){
            cout << i+1 << endl;
        }
    }
}


Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
typedef long long LL;
typedef pair<int,double> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};

static const int MAX_SIZE = 1 << 22; 

LL segMax[2 * MAX_SIZE - 1], segAdd[2 * MAX_SIZE - 1];

void add(int a, int b, LL x, int k = 0, int l = 0, int r = MAX_SIZE)
{
    if (r <= a || b <= l) return;

    if (a <= l && r <= b){
        segAdd[k] = (segAdd[k] + x)%mod;
        return;
    }

    add(a, b, x, k * 2 + 1, l, (l + r) / 2);
    add(a, b, x, k * 2 + 2, (l + r) / 2, r);

    segMax[k] = max(segMax[k * 2 + 1] + segAdd[k * 2 + 1], segMax[k * 2 + 2] + segAdd[k * 2 + 2])%mod;
}

LL getMax(int a, int b, int k = 0, int l = 0, int r = MAX_SIZE)
{
    if (r <= a || b <= l) return 0;

    if (a <= l && r <= b) return (segMax[k] + segAdd[k])%mod;

    LL left = getMax(a, b, k * 2 + 1, l, (l + r) / 2);
    LL right = getMax(a, b, k * 2 + 2, (l + r) / 2, r);

    return (max(left, right) + segAdd[k])%mod;
}

int main(){
    LL n;cin >> n;
    LL ans = 0;
    add(0, 1, 1);
    for (int i = 0; i < n; i++) {
        LL d = getMax(i, i + 1);
        if(i == n - 1){
            ans = (ans + d * n) %mod;
        }
        else{
            add(i + 1, i + 2, d);
            add(i + 3, i + 2 + n, d);
            ans = (ans + d * (n - 1) %mod * (n - 1)) %mod;
        }
    }
    for (int i = n; i <= 2 * n; i++) {
        ans = (ans + getMax(i,i+1))%mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 52480
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i,a,b) for(int i=a;i<=b;i++)
const int N=1e5+5;
int n,m,num,now;
int main()
{
	cin>>n;
	if(n<1200)cout<<"ABC";
	else if(n<2800)cout<<"ARC";
	else cout<<"AGC";

	return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;
int main()
{
    int m, n, x;
    long sum = 0, days;
    cin >> m >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        sum += x;
    }
    days = m - sum;
    if (days >= 0)
        cout << days << endl;
    else cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 3584
A=[list(map(int,input().split())) for i in range(3)]
N=int(input())
B=list(int(input()) for i in range(N))
x=[]
for i in range(3):
  for j in range(3):
    if A[i][j] in B:
      x.append(A[i][j])
if A[0][0] in x and A[1][0] in x and A[2][0] in x:
  print("Yes")
elif A[0][1] in x and A[1][1] in x and A[2][1] in x:
  print("Yes")
elif A[0][2] in x and A[1][2] in x and A[2][2] in x:
  print("Yes")
elif A[0][0] in x and A[0][1] in x and A[0][2] in x:
  print("Yes")
elif A[1][0] in x and A[1][1] in x and A[1][2] in x:
  print("Yes")
elif A[2][0] in x and A[2][1] in x and A[2][2] in x:
  print("Yes")
elif A[0][0] in x and A[1][1] in x and A[2][2] in x:
  print("Yes")
elif A[0][2] in x and A[1][1] in x and A[2][0] in x:
  print("Yes")
else:
  print("No")

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

typedef long long ll;
const int p = (int)1e9+7;


int main() {
	int H, W;
	cin >> H >> W;
	vector<string> a(H);
	map<char, int> cnt;
	map<int, int, greater<int> > pm;
	for (int i = 0; i < H; i++) {
		cin >> a[i];
	}
	for(int i=0; i<H; i++)
		for(int j=0; j<W; j++)
			cnt[a[i][j]]++;

	
	if (H % 2 == 0 && W % 2 == 0) {
		pm[4] = (H/2)*(W/2);
	}
	else if (H % 2 == 0 && W % 2 != 0) {
		pm[4] = (H/2)*(W/2);
		pm[2] = H/2;
	}
	else if (H % 2 != 0 && W % 2 == 0) {
		pm[4] = (H/2)*(W/2);
		pm[2] = W/2;
	}
	else {
		pm[4] = (H/2)*(W/2);
		pm[2] = H/2 + W/2;
		pm[1] = 1;
	}

	bool flag=true;
	for (auto c = cnt.begin(); c != cnt.end(); c++) {
		//cout << c->first <<" "<< c->second << endl;
		for (auto p = pm.begin(); p != pm.end(); p++) {
			//cout <<" "<< p->first <<" "<< p->second << endl;
			while (p->second != 0 && c->second != 0) {
				if (c->second - p->first >= 0) {
					c->second -= p->first;
					p->second--;
				}
				else {
					break;
				}
			}
		}
	}

	for (auto c = cnt.begin(); c != cnt.end(); c++) {
		//cout << c->first <<" "<< c->second << endl;
		if(c->second != 0) flag = false;
	}

	cout << (flag?"Yes":"No") << endl;

}

Measured memory_bytes: 256
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat)


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    A, B, M = MI()
    a = LI()
    b = LI()
    x = [0] * M
    y = [0] * M
    c = [0] * M
    ans = 10**9
    # min_x_i = 10**9
    # min_y_i = 10**9
    # min_x = 10**9
    # min_y = 10**9

    for i in range(M):
        x[i], y[i], c[i] = MI()

    for i in range(M):
        A = a[x[i]-1]
        B = b[y[i]-1]
        ans = min(ans, A + B - c[i])
        # if min_x > x[i]:
        #     min_x = x[i]
        #     min_x_i = i

        # if min_y > y[i]:
        #     min_y = y[i]
        #     min_y_i = i

    ans = min(ans, min(a) + min(b))

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 67888
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define uint unsigned int
#define MOD 1000000007
#define MAXN 5000
#define MAXH 4
#define MAXM 4
#define INF 1LL << 30
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;

int main(){
	fast_io();
	int n,t;
	cin >> n >> t;
	int a[n+1];
	cu(i,0,n)cin >> a[i];	
	a[n] = INT_MAX;
	ll ans = 0;
	cu(i,0,n){
		ans += min(a[i] + t, a[i+1]) - a[i];	
	}
	cout << ans << '\n';
}


Measured memory_bytes: 1024
#include<stdio.h>
int main() {
    int n, num;
    char ch;
    scanf("%d",&n);
    int S[14],H[14],C[14],D[14];
    for(int i=1; i<14; i++)
        S[i]=H[i]=C[i]=D[i]=0;
    for(int i=1; i<=n; i++) {
        scanf(" %c %d",&ch, &num);
        if(ch=='S') {
            S[num] = 1;
        }
        if(ch=='H') {
            H[num] = 1;
        }
        if(ch=='C') {
            C[num] = 1;
        }
        if(ch=='D') {
            D[num] = 1;
        }
    }

    for(int i=1; i<14; i++) {
        if(S[i]==0)
            printf("S %d\n",i);}
            for(int i=1; i<14; i++) {
        if(H[i]==0)
            printf("H %d\n",i);}
        for(int i=1; i<14; i++) {
        if(C[i]==0)
            printf("C %d\n",i);}
        for(int i=1; i<14; i++) {
        if(D[i]==0)
            printf("D %d\n",i);



    }

return 0;
}




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

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

  int x;
  cin >> x;

  int m[n];
  int min_m = 1000000;
  int count = 0;
  for(int i=0;i<n;i++){
    cin >> m[i];
    x -= m[i];
    count++;
    if(m[i] < min_m){
      min_m = m[i];
    }
  }

  count += x / min_m;

  cout << count << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define ll long long int
#define lf long double
#define vi vector<int>
#define vl vector<long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define MOD 1000000007
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define in insert
#define all(x) x.begin(),x.end()
#define apo ios::sync_with_stdio(false);cin.tie(0)
ll add(ll x, ll y) {ll res = x + y; return (res >= MOD ? res - MOD : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= MOD ? res % MOD : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + MOD : res);}

ll power(ll x, ll y) {if (y < 0) return 1; ll res = 1; x %= MOD; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}

int main(){
	apo;
	ll a;
	lf b;
	cin>>a>>b;
	lf mul=(lf)a*b;
	ll res = floor(mul);
	cout<<res;
}

Measured memory_bytes: 3748
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll mod = 1e9+7;
typedef pair<int,int> P;
#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,m,N) for(int i=m;i<N;i++)
#define mm(n,m) memset(n,m,sizeof(n))

int main(){
  int x,y;
  ll ans = 0;
  cin>>x>>y;
  if(x==1)ans+=3e5;
  else if(x==2)ans+=2e5;
  else if(x == 3)ans+=1e5;
  if(y==1)ans+=3e5;
  else if(y==2)ans+=2e5;
  else if(y == 3)ans+=1e5;
  if(x==y&&x==1)ans+=4e5;
  cout<<ans <<endl;  
}


Measured memory_bytes: 256
from collections import Counter
n, k = map(int, input().split())
arr = map(int, input().split())
c = Counter(arr)
a = 0
l = len(c.keys()) - k
if 0 < l:
    for _, v in sorted(c.items(), key=lambda x: x[1])[:l]:
        a += v
print(a)

Measured memory_bytes: 41492
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<queue>

using namespace std;
using ll = long long;

const int INF = 1001001001;

int main() {
	int x;
	cin >> x;
	if (x == 1) cout << 0 <<endl;
	else cout << 1 << endl;
	return 0;
}

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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii; typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <class F,class ...S> void dbg(const F& f, const S&...s){cerr <<f <<": "; dbg(s...);}

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int x, n;
	cin >>x >>n;
	VI p(110, 0);
	rep(i, n){
		int z; cin >>z;
		p[z]=1;
	}
	
	rep(i, n+n+2){
		if(x-i>=0 && p[x-i]==0){ cout <<x-i<<"\n"; return 0;}
		if(x+i<=103 && p[x+i]==0){ cout <<x+i<<"\n"; return 0;}
	}
	return 0;
}


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

int main(){
  int N,K,x;
  cin>>N>>K;
  
  int sum=0;
  
  for(int i=0;i<N;i++){
    cin>>x;
    if(K-x<x){
      sum+=2*(K-x);
    }
    else{
      sum+=2*x;
    }
  }

  cout<<sum<<endl;
}

Measured memory_bytes: 256
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [X] = [int(input_raw[0])]
    if X==7 or X==5 or X==3:
        print "YES"
    else:
        print "NO"

if __name__ == '__main__':
    main()


Measured memory_bytes: 2936
#include <bits/stdc++.h>
#define int long long
#define IOS ios_base::sync_with_stdio(false)

using namespace std;

bool comp(const pair<int,int>& a , const pair<int,int>& b){
	return a.second < b.second ;
}

int32_t main(){IOS;
	int h , n ; cin >> h >> n ;
	pair<int,int>arr[n];
	for(auto& i : arr) cin >> i.first >> i.second ;	// first attack
	sort(arr,arr+n);
	//for(auto i : arr) cout << i.first << ' ' << i.second << endl;
	//vector<int>dp(h+1,INT_MAX);
	int dp[h+1][n];
	
	for(int i=0;i<=h;i++){
		for(int j=0;j<n;j++){
			dp[i][j]=INT_MAX;
		}
	}
	for(int j=0;j<=h;j++)
		dp[j][0]=arr[0].second*((j+arr[0].first-1)/(arr[0].first));
	for(int i=1;i<n;i++){
		for(int j = 0 ; j <= h;j++){
			if(j<arr[i].first)
				dp[j][i]=min(dp[j][i-1],arr[i].second);
			else dp[j] [i]= min(dp[j][i-1],dp[j-arr[i].first][i]+arr[i].second);
		}
	}
	cout<<dp[h][n-1];
	/*if(dp[h] != INT_MAX){
		cout << dp[h] << endl;
		return 0;
	}
	sort(arr,arr+n,comp);
	int index = h;
	while(dp[index] == INT_MAX) {
		index--;
	}
	cout << index-1 << endl;
	h = h - (index-1);
	int ans = dp[n] ;
	for(int i = 0 ;i < n ;i++ ){
		if(arr[i].first >= h){
			ans += arr[i].second;
			break;
		}
	}
	cout << ans << endl;*/
		
	return 0;
}


Measured memory_bytes: 78464
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

S=one_str()
print(0+S.count("+")-S.count("-"))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){ll i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}


int main(){
  ll N,M;
  cin>>N>>M;
  vector<ll> dp(1LL<<N,MOD);
  dp[0]=0;
  for(int i=0;i<M;i++){
    ll a,b;
    cin>>a>>b;
    ll x=0;
    for(int i=0;i<b;i++){
      ll c;
      cin>>c;
      c--;
      x|=1LL<<c;
    }
    for(int i=0;i<(1LL<<N);i++){
      dp[i|x]=min(dp[i|x],dp[i]+a);
    }
  }
  cout<<(dp.back()==MOD?-1:dp.back())<<endl;
  
  
  return 0;
}


Measured memory_bytes: 256
# coding: utf-8

cnt = int()
m = int()
g = []

def insersion_sort(a, n, g):
    global cnt
    for i in xrange(g, n):
        v = a[i]
        j = i - g
        while j >= 0 and a[j] > v:
            a[j+g] = a[j]
            j = j - g
            cnt += 1
        a[j+g] = v
    return list(a)

def shell_sort(a, n):
    global cnt
    global m
    global g
    cnt = 0
    m = 0
    g = []
    nn = n
    while True:
        nn /= 2
        if nn <= 0:
            break
        g.append(nn)
        m += 1
    if n == 1:
        m = 1
        g = [1]
    for i in g:
        a = insersion_sort(a, n, i)
    return a

def main():
    global cnt
    global m
    global g
    n = input()
    a = []
    for i in xrange(n):
        a.append(input())
    a = shell_sort(a, n)
    print m
    print " ".join(map(str, g))
    print cnt
    for i in xrange(n):
        print a[i]

main()

Measured memory_bytes: 53772
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <map>
#include <string>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <algorithm> 

#define MaxN 100005

using namespace std;

long long N,K,fr[MaxN],X,Y;

int main()
{
	cin>>N>>K;
	for(int i=1;i<=N;i++)
	{
		cin>>X>>Y;
		fr[X]+=Y;
	}
	for(int i=1;i<=100000;i++)
	{
		if(fr[i]<K)
			K-=fr[i];
		else
		{
			cout<<i;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 1024
/*     *******************Bismillahir Rahmanir Rahim************************
                          MD. ASFAKUL GHANI!
                          *ProMAGFAT*!
 SECRET_warning :)->FAT   CSE-25!
                          JAHANGIRNAGAR UNIVERSITY!
                          Dhaka,Bangladesh!
*/

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

#define           fasterIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define           Im int main()
#define           ll long long
#define           sc scanf
#define           pf printf
#define           rn0 return 0
#define           rn return
#define           f0(i,n) for(ll i=0;i<n;i++)
#define           f1(i,n) for(ll i=1;i<=n;i++)
#define           f2(i,n) for(ll i=n-1;i>=0;i--)
#define           pi 2*acos(0.0)
#define           modulo 1000003
#define           dd double
#define           PI 3.14159265358979
#define           pi 2*acos(0.0)
#define           p_b push_back
#define           ps push

/*
ll for_binarySearch(ll a,ll b,ll aa[],ll x){while(a<=b){ll mid=(a+b)/2;if(aa[mid]==x) return 1;else if(aa[mid] > x) b=mid-1;else a=mid+1;}return -1;}
ll for_gcd(ll a,ll b){if(a==0) return b;else return for_gcd(b%a,a);}
ll for_prime(ll x){for (ll i=2;i*i<=x;i++){if(x%i==0) return 0;}return 1;}
void for_swap(char *x,char *y){char temp;temp=*x;*x=*y;*y=temp;}
ll for_big_mod(ll b,ll p,ll m){if(p==0) return 1;else if(p%2==0){ll k=for_big_mod(b,p/2,m);return (k*k)%m;}else return ((b%m)*(for_big_mod(b,p-1,m)))%m;}
ll for_josephus(ll n,ll k){if(n==1) return 1;return (for_josephus(n-1,k)+k-1)%n+1;}
ll for_gcdExtended(ll a,ll b,ll *x,ll *y){if(a==0){*x=0;*y=1;return b;}ll x1,y1;ll gcd=for_gcdExtended(b%a,a,&x1,&y1);*x=y1-(b/a)*x1;*y=x1;return gcd;}
*/

void debug1()
{
    cout << "***" << endl;
}

void debug11(ll n)
{
    cout << n << endl;
}

#define ipair pair <ll,ll>
#define inf 12345678912345
ll n,m,p;
vector <ipair> v1[101010];
pair <ll,ipair> pp[101010];
vector <ll> dis;

void FAT_dj(ll src)
{
    dis[src] = 0;
    for (ll i = 0; i < n; i += 1){
        if (i == p) continue;
        for (ll j = 0; j < m; j += 1){
            ll w = pp[j].first;
            ll u = pp[j].second.first;
            ll v = pp[j].second.second;
            if (dis[u] != inf && dis[u] + w < dis[v]){
                dis[v] = dis[u] + w;
            }
        }
    }
}

Im
{
    /*#ifdef FAT
       freopen("input.txt","w",stdin);
    #endif // FAT*/

    //fasterIO;

    cin>>n>>m>>p;

    for (ll i = 0; i < m; i += 1){
        ll u,v,w;
        cin>>u>>v>>w;
        //v1[u].p_b(make_pair(v,w));
        pp[i] = make_pair(w,make_pair(u,v));
        //v1[v].p_b(make_pair(u,w));
    }

    for (ll i = 0; i <= n; i += 1) dis.p_b(inf);

    FAT_dj(p);

    for (ll i = 0; i < m; i += 1){
        ll w = pp[i].first;
        ll u = pp[i].second.first;
        ll v = pp[i].second.second;
        if (dis[u] != inf && dis[u] + w < dis[v]){
            cout << "NEGATIVE CYCLE" << endl;
            rn0;
        }
    }

    for (ll i = 0; i < n; i += 1){
        v1[i].clear();
        if (dis[i] == inf) cout << "INF" << endl;
        else cout << dis[i] << endl;
    }

   // main();

    rn0;
}

Measured memory_bytes: 7900
from collections import deque
N, M = map(int, input().split())

graph = [[] for _ in range(N)]
flag = [0] * N

for i in range(M):
  A, B = map(int, input().split())
  A -= 1
  B -= 1
  graph[A].append(B)
  graph[B].append(A)
  
D = deque([0])
visited = [False] * N
visited[0] = True

while D:
  v = D.popleft()
  for i in graph[v]:
    if visited[i]:
      continue
    visited[i] = True
    flag[i] = v
    D.append(i)
    
print("Yes")
for i in range(1, N):
  print(flag[i] + 1)

Measured memory_bytes: 34888
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

//ワーシャルフロイド法、全点対最短路

//実装例

const int INFTY=numeric_limits<int>::max();
vector<vector<int>>d;//d[u][v]は辺uvのコスト、ただし存在しないときINFTY,d[i][i]=0

void warshall_floyd(int V){//Vは頂点数
	for(int k=0;k<V;++k){//経由する頂点
		for(int i=0;i<V;++i){//始点となる頂点
			for(int j=0;j<V;++j)//目的地の頂点
      		d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
		}
	}
}

int main(){	
	int n,m;//nは頂点数、mは辺の数
	cin>>n>>m;
	d=vector<vector<int>>(n,vector<int>(n,INFTY/3));//INFTYで初期化
	for(int i=0;i<n;++i)d[i][i]=0;

	vector<int>from(m),to(m),cost(m);

	for(int i=0;i<m;++i){
		cin>>from[i]>>to[i]>>cost[i];
		--from[i];--to[i];
		d[from[i]][to[i]]=cost[i];
		d[to[i]][from[i]]=cost[i];//無向グラフなので忘れない
	}
	warshall_floyd(n);
	int ans=0;
	rep(i,m){
		bool judge=false;
		rep(s,n){
			rep(t,n){
				if(d[s][from[i]]+cost[i]+d[to[i]][t]==d[s][t])judge=true;
		//全頂点対に対してi番目の辺が最短経路に含まれるか調べる
			}
		}
		if(!judge)++ans;
	}
	cout<<ans<<endl;
	return 0;
}


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

int main(){
  string a;
  cin >> a;
  int b=0;
  for(int i=0;i<3;i++){
    if(a[i]=='7'){
      b++;
    }
  }
    if(b>0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3560
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Sparsh Sanchorawala
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CSubarraySum solver = new CSubarraySum();
        solver.solve(1, in, out);
        out.close();
    }

    static class CSubarraySum {
        public void solve(int testNumber, InputReader s, PrintWriter w) {
            HashMap<Long, Integer> hm = new HashMap<>();
            int n = s.nextInt(), k = s.nextInt(), sum = s.nextInt();
            for (int i = 0; i < k; i++)
                w.print(sum + " ");
            for (int i = k; i < n; i++) {
                if (sum == (int) 1e9)
                    w.print(sum - 1 + " ");
                else
                    w.print((int) 1e9 + " ");
            }
            w.println();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 36024
#include   <bits/stdc++.h>
using      namespace        std;
#define    int              long long int
#define    sz(a)            (int)a.size()
#define    w(x)              int T; cin>>T; while(T -- > 0)
#define    ff                first
#define    ss                second

/*	hon when the digit in the one's place of N is 2, 4, 5, 7, or 9
;
pon when the digit in the one's place of N
is 0, 1, 6 or 8
;
bon when the digit in the one's place of N
is 3.*/

void solveTC(){

	string str;
	cin>>str;

	if(str.back()=='2' or str.back()=='4' or str.back()=='5' or str.back()=='7' or str.back()=='9')
		cout<<"hon\n";
	else if(str.back()=='0' or str.back()=='1' or str.back()=='6' or str.back()=='8')
		cout<<"pon\n";
	else if(str.back()=='3')
		cout<<"bon\n";

}

int32_t main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

 //   w(x){  solveTC();  } // with TestCases

   solveTC();          //  without TestCases

    return 0;

}

Measured memory_bytes: 3608
/*	
*  Sachin Mittal
*/
#include<bits/stdc++.h>
#define int long long
#define M 998244353
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define mem0(dp) memset(dp,0,sizeof(dp))
#define mem1(dp) memset(dp,-1,sizeof(dp))
#define pb push_back
#define fr(i,j,n) for(int i=j;i<n;i++)
#define sz(s) (int)(s.size())
using namespace std;
int32_t main(){
ios
int t=1;
//cin>>t;
while(t--)
{
	int n,x,y;
	cin>>n>>x>>y;
	vector<int> ans(n+1,0);
	for(int i=1;i<n;i++)
	{
		for(int j=i+1;j<=n;j++)
		{
			if(i<x)
			{
				if(j<=x)
					ans[j-i]++;
				else if(j<=y)
				{
					ans[min(j-i,x-i+1+y-j)]++;
				}
				else ans[x-i+1+j-y]++;
			}
			else if(i<y)
			{
				ans[min(j-i,i-x+1+abs(j-y))]++;
			}
			else ans[j-i]++;
		}
	}
	for(int i=1;i<n;i++)
		cout<<ans[i]<<'\n';	
}
}

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

const double PI = 3.14159265358979323846L;

void solve(){
  int r; cin >> r;
  cout << (2.0L*PI*r) << endl;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}


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

using namespace std;

int main()
{
      int ti = clock();

    int H, W;cin >> H >> W;
    vector<string> s;
    for(int i = 0;i < H;i++){
        string v;cin >> v;
        s.push_back(v);
    }
    map<char, int> mp;
    for(int i = 0;i < H;i++){
        for(int j = 0;j < W;j++){
            mp[s[i][j]]++;
        }
    }
    vector<int> ss;
    for(auto a : mp){
        int w = a.second;
        //cout<<a.first<<" "<<a.second<<endl;
        while(w > 3){
            //cout<<w<<endl;
            ss.push_back(0);
            w -= 4;
        }
        if(w != 0)ss.push_back(w);
    }
    vector<int> w;
    if(H % 2 == 0 && W % 2 == 0){
        for(int i = 0;i < H * W / 4;i++){
            w.push_back(0);
        }
    }else
    if(H % 2 == 1 && W % 2 == 0){
        for(int i = 0;i < (H - 1) * W / 4;i++){
            w.push_back(0);
        }
        for(int i = 0;i < W / 2;i++){
            w.push_back(2);
        }
    }else
    if(H % 2 == 0 && W % 2 == 1){
        for(int i = 0;i < H * (W - 1) / 4;i++){
            w.push_back(0);
        }
        for(int i = 0;i < H / 2;i++){
            w.push_back(2);
        }
    }else
    if(H % 2 == 1 && W % 2 == 1){
        for(int i =0 ;i < (H - 1) * (W - 1) / 4;i++){
            w.push_back(0);
        }
        for(int i = 0;i < H / 2;i++){
            w.push_back(2);
        }
        for(int i = 0;i < W / 2;i++){
            w.push_back(2);
        }
        w.push_back(1);
    }
    map<int, int> A, B;
    for(int a : ss)A[a]++;
    for(int b : w)B[b]++;
    /*
    for(auto a : A)
        cout<<a.first<<" "<<a.second<<endl;
    for(auto b : B)
        cout<<b.first<<" "<<b.second<<endl;
        */
    while(A[2] < B[2]){
        if(A[0] > B[0]){
            A[0]--;
            A[2]+=2;
        }
      if(1.0 * (clock() - ti) / CLOCKS_PER_SEC >= 1.0){
        cout<<"No"<<endl;
        return 0;
      }
    }
    /*
    for(auto a : A)
        cout<<a.first<<" "<<a.second<<endl;
    for(auto b : B)
        cout<<b.first<<" "<<b.second<<endl;
        */
    if(A == B){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n; cin>>n;
    vector<int> l(n);
    for(int i=0;i<n;i++) cin>>l[i];
    int maxj=0;
    int maxi=0;
    for(int i=0;i<n;i++){
        if(l[i]>maxj){
            maxj=l[i];
            maxi=i;
        }
    }
    int sum=0;
    for(int i=0;i<n;i++){
        if(i!=maxi) sum+=l[i];
    }
    if(maxj<sum) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256