akhauriyash/Code-Regression huggingface dataset:
#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>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

int imos(vector<int> &num){
	vector<int>cnt(num.size()+5);
	int maxv=0;
	cnt[0]=num[0];
	if(cnt[0]<0)cnt[0]=0;
	for(int i=1;i<num.size();++i){
		cnt[i]=cnt[i-1]+num[i];
		maxv=max(maxv,cnt[i]);
	}
	return maxv;
}


signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	int n,m;
	cin>>n>>m;
	ll a;
	map<ll,ll>mp;
	rep(i,n){
		cin>>a;
		mp[a]++;
	}
	rep(i,m){
		auto x=mp.end();
		x--;
		mp[x->first]--;
		mp[x->first/2]++;
		if(mp[x->first]==0){
			mp.erase(x->first);
		}
	}
	ll sum=0;
	for(auto x:mp){
		sum+=x.first*x.second;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template<class T> inline void chmin(T& a, T b){
    if (a > b){
        a = b;
    }
}

template<class T> inline void chmax(T& a, T b){
    if (a < b){
        a = b;
    }
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int A,B;
    cin >> A >> B;
    cout << (A*B%2==0 ? "No" : "Yes") << "\n";
}

Measured memory_bytes: 256
def calc(n, x):
    result = 0
    for i in range(3, n + 1):
        for j in range(2, i):
            if i + j < x < i + 2 * j:
                result += 1
    return str(result)

ans = []
while True:
    n, x = map(int, input().split())
    if n == x == 0:
        break
    ans.append(calc(n, x))

print("\n".join(ans))


Measured memory_bytes: 5604
#define _USE_MATH_DEFINES

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
#include <map>
using namespace std;

#define ll long long
const int MOD = 1000000007;//10^9+7

int max(int a, int b) {

	if (a > b)return a;
	else return b;

}
//aとbの大きい方

int min(int a, int b) {

	if (a < b)return a;
	else return b;

}
//aとbの小さい方

int avd_i(int a, int b) {

	if (a > b)return a - b;
	else return b - a;

}
double avd_d(double a, double b) {

	double re;
	if (a > b)re = a - b;
	else re = b - a;
	return re;

}
//aとbの差の絶対値

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//pは素数,aのb乗をpで割った余り

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//pは素数,(nCr)%p

int main() {
	
	string S, right = "CODEFESTIVAL2016";
	int count = 0;

	cin >> S;

	for (int i = 0; i < S.size(); i++) {

		if (S[i] != right[i])count++;

	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using vv = vector<V<T>>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
ll power(ll a,int n){
  ll res = 1,r = a;
  for (; n > 0;n>>=1,r*=r) res = res*(n & 1? r:1)%MOD;
  return res;
}
signed main(){
  int n;
  string s;
  cin >> n >> s;
  sort(ALL(s));
  vl ct(26,0);
  REP(i,n){
    ct[s[i]-'a']++;
  }
  ll ans = 1;
  REP(i,26){
    ans = ans*(ct[i]+1)%MOD;
  }
  cout << ans-1 << endl;
}


Measured memory_bytes: 512
"use strict";
main(require("fs").readFileSync("/dev/stdin", "utf8").replace(/\r?\n$/, "").split(/\r?\n/));

function main(lines){
	lines.some(function(line){
		if(line == "0 0") return true;
		var a = line.split(" ").map(Number);
		var n = a[0], x = a[1];
		var count = 0;
		for(var i=1;i<x/3;i++){
			for(var j=i+1;j<x/2;j++){
				var k = x - i - j;
				if(k <= j) break;
				if(k <= n) count++;
			}
		}
		console.log(count);
	});
}

Measured memory_bytes: 16064
def main():
  n=int(input())
  x=[]
  y=[]
  h=[]
  for i in range(n):
    i,j,k=map(int,input().split())
    x.append(i)
    y.append(j)
    h.append(k)
  h,x,y=zip(*reversed(sorted(zip(h,x,y))))
  for i in range(101):
    for j in range(101):
      h0=h[0]+abs(i-x[0])+abs(j-y[0])
      c=1
      for k in range(1,n):
        if max(h0-abs(i-x[k])-abs(j-y[k]),0)==h[k]:
          c+=1
        else:
          break
      if c==n:
        print(i,j,h0)
        return
main()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	int n;
	cin >> n;
	int ans = 0;
	rep(i, n) {
		int a;
		cin >> a;
		if(i % 2 == 0 && a % 2 == 1) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;

int main(){
  int n,h[100005];cin>>n;
  rep(i,n)cin>>h[i];
  int cost[100005];
  cost[0]=0;cost[1]=abs(h[1]-h[0]);
  for(int i=2;i<n;i++){
    cost[i]=min(cost[i-1]+abs(h[i]-h[i-1]),cost[i-2]+abs(h[i]-h[i-2]));
  }
  cout<<cost[n-1];
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
using namespace std;

string S;
string T;


// 与えられた2つのstringが '?' を考慮して等しいかどうかを判定する
static bool eq(string s1, string s2) {
    if (s1.size() != s2.size())
        return false;

    bool f = true;
    for (int i = 0; i < s1.size(); i++) {
        if (s1[i] != '?' and s2[i] != '?' and s1[i] != s2[i])
            f = false;
    }
    return f;
}

int main() {
    cin >> S >> T;
    reverse(S.begin(), S.end());
    reverse(T.begin(), T.end());

    int slen = S.size();
    int tlen = T.size();
    int i;
    for(i = 0; i < slen; i++) {
        if( eq(S.substr(i, tlen), T) )
            goto RESTORABLE;
    }

    UNRESTORABLE:
        cout << "UNRESTORABLE" << endl;
        return 0;

    RESTORABLE: // 後ろからi番目で初めて一致
        S.replace(i, tlen, T);
        reverse(S.begin(), S.end());
        for( auto& s : S ) // ? -> a
            s = (s == '?') ? 'a' : s;
        cout << S << endl;
        return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(X: int, Y: int):
    n=0
    while Y >= X*2**n:
        n+=1
    print(n)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(X, Y)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
from collections import deque
import itertools

h, w = map(int, input().split())
g = [input() for _ in range(h)]


# x,yはスタートの座標
def bfs(x, y):
    # 最初は全て未訪問なので-1で初期化
    d = [[-1] * w for _ in range(h)]
    # スタート地点への距離は0
    d[x][y] = 0
    q = deque([(x, y)])
    while q:
        tx, ty = q.popleft()
        # 右、上、左、下
        for dx, dy in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
            nx, ny = tx + dx, ty + dy
            # グリッドの範囲(縦方向, 横方向)内、通路(壁ではない)、未訪問(== -1)の場合
            if 0 <= nx < h and 0 <= ny < w and g[nx][ny] == '.' and d[nx][ny] < 0:
                d[nx][ny] = d[tx][ty] + 1
                q.append((nx, ny))
    # 最終的なdを平坦化して最大値を返す
    return max(list(itertools.chain.from_iterable(d)))


# 全てのマスについて
max_count = 0
for x in range(h):
    for y in range(w):
        # スタートが通路であるかチェックする必要がある
        if g[x][y] == ".":
            max_count = max(max_count, bfs(x, y))

print(max_count)


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

int main() {
int sss;
int s1;
int s2;
int s3;
cin >> sss;
s1 = sss/100;
s2 = sss/10-s1*10;
s3 = sss-s1*100-s2*10;
cout << s1+s2+s3 << endl;
}

Measured memory_bytes: 256
/* ex6_2
   kohei0713 */

#include <stdio.h>
#include <string.h>

int main(void){
    
    char str[120];
    int len;

    //input
    scanf("%s", str);

    //strの文字の長さを取得
    len = strlen(str);

    //strの1文字目,長さ-2,最後の文字を表示
    printf("%c%d%c\n", str[0], len - 2, str[len - 1]);

    return 0;
}

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

using namespace std;

int cnt[26];

int main() {

	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);

	string w;
	cin >> w;
	for (char c: w) {
		cnt[c - 'a']++;
	}
	for (int i = 0; i < 26; ++i) {
		if (cnt[i] % 2 != 0) {
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;
const ll MAXN = 1000000;
const ll MOD = 998244353;

void err()
{
    cout << 0 << endl;
    exit(0);
}

int main()
{
    int n;
    cin >> n;
    vector<ll> cnts(MAXN, 0);
    rep(i, 0, n)
    {
        int d;
        cin >> d;
        if (i == 0 ^ d == 0) err();

        ++cnts[d];
    }
    if (cnts[0] != 1)
    {
        cout << 0 << endl;
        return 0;
    }

    ll res = 1;
    rep(i, 0, n-1)
    {
        rep(j, 0, cnts[i+1])
        {
            res *= cnts[i];
            res %= MOD;
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 8064
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll N = 200005;
const ll mm = 1e+18;
void solve()
{
    int n;
    cin>>n;
    int a[n];
    int tot=0;
    rep0(i,n){
        cin>>a[i];
        tot+=a[i];
    }
    int m;
    cin>>m;
    while(m--){
        int p,x;
        cin>>p>>x;
        cout<<tot+(x-a[p-1])<<"\n";
    }
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}


Measured memory_bytes: 3584
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;
import std.container;
import std.bigint;
import std.math;

double cross (cdouble a, cdouble b) {
	return (a * b.conj).im;
}

void main()
{
	int n;
	while (n = readln.chomp.to!int, n) {
		auto m = readln.chomp.to!int;
		auto p = m;
		foreach (i; 1..n) {
			auto a = readln.chomp.to!int;
			if (p < 0) p = a;
			else p += a;
			m = max(m, p);
		}
		m.writeln;
	}
}

Measured memory_bytes: 1064
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//void p(vector<int> A){rep(i,A.size()){cout << A[i] << " ";}cout << "\n";}

int main(){
    ll a,b;
    cin >> a >> b;
    if(a > 0 && b > 0)cout << "Positive";
    if(a <= 0 && b >= 0)cout << "Zero";
    if(a < 0 && b < 0){
        ll c = b-a+1;
        if(c % 2 == 0)cout << "Positive";
        else cout << "Negative";
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <unordered_map>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
const char sp = ' ';


using namespace std;

int main(void){
    ll N;
    string s;
    cin>>N;
    string sorted;
    unordered_map<string, ll> mp;
    ll ans=0;
    rep(i, N){
        cin>>s;
        sort(all(s));
        ans+=mp[s];
        mp[s]++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 10660
#include<stdio.h>

int main(){

  int n,x,cnt=0;
  int i,j,minj;

  scanf("%d",&n);

  int A[n];

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

  for(i=0;i<n-1;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(A[j]<A[minj]){
	minj = j;
      }
    }

    if(i!=minj){
      x = A[i];
      A[i] = A[minj];
      A[minj] = x;
      cnt++;
    }

  }

  for(i=0;i<n;i++){
    printf("%d",A[i]);
    if(i<n-1) printf(" ");
  }
  printf("\n%d\n",cnt);

  return 0;
}



Measured memory_bytes: 2124
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	c := map[int]int{}
	for i := 0; i < n; i++ {
		c[scanInt()]++
	}
	ans := 0
	for i, e := range c {
		if i > e {
			ans += e
		} else {
			ans += e - i
		}
	}
	fmt.Fprintln(wr, ans)
}


Measured memory_bytes: 8604
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>
using namespace std;

#define ll long long
#define ld long double
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

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

int main(void) {
    int i,j;
    int n;
    cin >> n;
    vi r(n);
    rep(i,n) cin >> r[i];
    vector<double> x(n);
    rep(i,n){
        x[i] = r[i];
        rep(j,i){
            double h = abs(r[i]-r[j]);
            x[i] = max(x[i], x[j]+sqrt((r[i]+r[j])*(r[i]+r[j]) - h*h));
        }
    }
    double ans = 0;
    rep(i,n)ans = max(ans, x[i] + r[i]);
    cout << shosu(10) << ans << endl;
}



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

const int INF = 1001001001;

int main(){
    string s1;
    cin>>s1;
    char c1;
    ll s=0;
    int v;
    rep(i,s1.size()){
        c1 = s1[i];
        s+=c1-'0';
    }
    if(s%9==0){cout<<"Yes";}
    else{cout<<"No";}
    return 0;
}


Measured memory_bytes: 3716
#include <iostream>

using namespace std;

string rotateStr(string str){ 
    char n=str[str.size()-1];
    str.insert(0,1,n);
    str.erase(str.size()-1,1); 
             
    return str;
}

int main() { 
    string S,T;
    cin>>S>>T; 
    bool found=false;
    int compIteration=0;
    do{
        if(S==T){
            found=true;
        }else{
           S= rotateStr(S);
        } 
        compIteration++;
    }while(compIteration<S.size());
   
   
    if(found){
        cout<<"Yes";
    }else{ 
        cout<<"No";
    }
}

Measured memory_bytes: 256
#include<cstdio>

using namespace std;
int a[10];
int main() {
	int b;
	int k = 0;
	while (scanf("%d", &b) == 1) {
		k = 0;
		for (int i = 0; i < 4; i++) {
			a[i] = b % 10;
			b = b / 10;
		}
		for (int i = 1; i < 3; i++) {
			if (a[i-1] == a[i] && a[i] == a[i+1]) {
				k = 1;
				break;
			}
		}
		if (k == 0) printf("No\n");
		else printf("Yes\n");
	}
	return 0;
}

Measured memory_bytes: 128
from scipy.sparse.csgraph import connected_components
from scipy.sparse import coo_matrix
import numpy as np

N,M = map(int, input().split())
edges = [list(map(int, input().split())) for _ in range(M)]
I,J = zip(*edges)

g = coo_matrix(([1]*M, (I,J)), (N+1, N+1))
g = g.tolil()

ans = 0
for i,j in edges:
    g[i,j] = 0
    cnt, _ = connected_components(g, directed=False)
    g[i,j] = 1
    ans += (cnt > 2)
print(ans)

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

using namespace std;

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

	vector < pair < int, int >>v;
	for (int i = 0; i < N; i++) {
		int c, t;
		cin >> c >> t;
		v.push_back(make_pair(c, t));
	}

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

 for (auto & vc:v) {
		if (vc.second <= T) {
			cout << vc.first << endl;
			return 0;
		}
	}

	cout << "TLE" << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <tuple>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define repn(i, x) for (int i = 1; i <= (int)(x); i++)
#define repr(i, x) for (int i = ((int)(x) - 1); i >= 0; i--)
#define reprn(i, x) for (int i = ((int)(x)); i > 0; i--)
#define all(x) (x).begin(),(x).end()
typedef long long int64;
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;

int gcd(int a, int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

//逆元を求める関数
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < 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;
    }
}
//組み合わせ
long long COM (int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

void solve() {
		int n, k, q; cin >> n >> k >> q;
		vector<int> a(q), ans(n), cnt(n);
		rep (i, q) cin >> a[i];
		rep (i, n) ans[i] = k;
		for (int i = 0; i < q; ++i) {
			int tmp; tmp = a[i] - 1;
			cnt[tmp]++;
		}
		//正解数分だけ減少ポイントを減らす
		rep (i, n) ans[i] = k + (-q + cnt[i]);
		auto f = [&](int num) {
			return num > 0 ? "Yes" : "No";
		};
		rep (i, n) cout << f(ans[i]) << endl;
    return;
}

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



Measured memory_bytes: 1792
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
print(2*N if N%2==1 else N)

Measured memory_bytes: 5388
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
using namespace std;

int main() {
	int h, w;
  	char a[105][105];
  	bool row[105], col[105];
  	REP(i, 105) row[i] = false;
  	REP(i, 105) col[i] = false;
    cin >> h;
  	cin >> w;
  
  	//入力
    REP(i, h){
     	 REP(j, w){
    		cin >> a[i][j];
		}
    }
  
  	//処理
    REP(i, h){
        REP(j, w){
    		if(a[i][j] == '#') {
              	row[i] = true;
              	col[j] = true;
            }
		}
    }

  	//出力
    REP(i, h){
      	REP(j, w){
          	if(row[i] == true && col[j] == true) {
		    		cout << a[i][j];
            }
		}
    	if(row[i] == true) cout << "\n";
    }
	return 0;
}

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

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

  int sum = 0;
  int max = 0;
  for ( int i = 0; i < N; i++ ) {
    int x;
    cin >> x;
    if ( x > max ) {
      sum += max;
      max = x;
    } else {
      sum += x;
    }
  }

  if ( max < sum ) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const ll inf=1e9+7;

int main(){
  int n,k;
  string s;

  cin>>n>>k;
  cin>>s;

  rep(i,k-1) cout<<s.at(i);
  if(s.at(k-1)=='A') cout<<'a';
  else if(s.at(k-1)=='B') cout<<'b';
  else cout<<'c';

  for(int i=k;i<s.size();i++) cout<<s.at(i);
}

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

using namespace std;

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

	for (int i = 0; i < N; i++) {
		if (S[i] != S[K - 1]) {
			S[i] = '*';
		}
	}

 for (auto ss:S) {
		cout << ss;
	}

	cout << "\n";

	return 0;
}


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

ll fact[1000006], inv[1000006];

ll fp(ll base, ll exp)
{
    if (exp == 0)
        return 1;
    ll ans = fp(base, exp / 2);
    ans = (ans * ans) % mod;
    if (exp % 2 != 0)
        ans = (ans * (base % mod)) % mod;
    return ans;
}

void calcFacAndInv(ll n)
{
    fact[0] = inv[0] = 1;
    for (ll i = 1; i <= n; i++)
    {
        fact[i] = (i * fact[i - 1]) % mod;
        inv[i] = fp(fact[i], mod - 2);
    }
}

ll ncr(ll n, ll r)
{
    return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;
}

ll npr(ll n, ll r)
{
    return (fact[n] * inv[n - r]) % mod;
}

int main()
{
    int n, m;
    cin>>n>>m;
    calcFacAndInv(max(n, m));
    cout<<ncr(n, 2) + ncr(m, 2);
    return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int ll
#define pb push_back
#define setbits(x)          __builtin_popcountll(x)
#define endl "\n"
typedef long long ll;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a,b;
cin>>a>>b;
int ans=a/b;
if(a%b!=0)
    ans++;
cout<<ans<<endl;
    return 0;
}

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

using namespace std;

int n,sum,mx,x;

int main(){
    scanf("%d",&n);
    sum=mx=0;
    for (int i=1;i<=n;++i){
            scanf("%d",&x);
            sum+=x;mx=max(x,mx);
    }
    if (mx*2<sum) puts("Yes");else puts("No");
}


Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

#ifdef DEBUG
mt19937 mrand(300); 
#else
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count()); 
#endif

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 1e5 + 5;
int n;
vector<int> g[maxn];

bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    g[i].clear();
  }
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  return true;
}

int dfs(int v, int p) {
  int msk = 0;
  int msk2 = 0;
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (u == p) {
      continue;
    }
    int cur = dfs(u, v);
    msk2 |= (cur & msk);
    msk |= cur;
  }
  int bit = (msk2 ? 32 - __builtin_clz(msk2) : 0);
  msk &= ~((1 << bit) - 1);
  msk += (1 << bit);
  return msk;
}

void solve() {
  printf("%d\n", (31 - __builtin_clz(dfs(0, -1))));
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 10240
#[allow(unused_imports)]
use proconio::input;
use std::collections::HashSet;

fn main() {
    input! {
        n: usize,
        k: usize,
    };
    let mut dd: Vec<usize> = Vec::new();
    let mut aaa: Vec<Vec<usize>> = Vec::new();
    for _ in 0..k {
        input!{
            d: usize,
            aa: [usize; d]
        };
        dd.push(d);
        aaa.push(aa);
    }
    let mut set = HashSet::new();
    for i in 1..=n {
        set.insert(i);
    }
    for aa in aaa {
        for a in aa {
            set.remove(&a);
        }
    }
    println!("{}", set.len());
}


Measured memory_bytes: 2200
#include <stdio.h>

#define PLIMIT 200010
int prime[PLIMIT+10];
void makep(int n){prime[0]=prime[1]=1;for(int i=2;i*i<=n;i++)if(!prime[i])for(int j=i*i;j<=n;j+=i)prime[j]=1;}

int main(){
	makep(150000);
	int x;
	scanf("%d",&x);
	while(prime[x])x++;
	printf("%d",x);
}

Measured memory_bytes: 768
n,m=map(int,input().split())
a,b=set(),set()
for i in range(m):
    x,y=map(int,input().split())
    if x==1:
        a.add(y)
    if y==n:
        b.add(x)
print("POSSIBLE" if (len(a&b)) else "IMPOSSIBLE")

Measured memory_bytes: 19024
l1=[]#1の位が0
l2=[]#
for i in range(5):
    s=int(input())
    if s%10==0:
        l1.append(s)
    else:
        l2.append(s)
min_1=9
tot=sum(l1)
for i in range(len(l2)):
    tot+=10*(l2[i]//10 +1)
    if min_1>l2[i]%10:
        min_1=l2[i]%10
#print(tot,min_1)
if len(l1)!=5:
    ans=tot-10+min_1
else:
    ans=tot
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000007
const ll maxi =20000;
#define ip pair<ll,ll>
#define mp make_pair
int main()
{ 
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);

ll k;
cin>>k;
ll a=k%10;
if((a!=1)&&(a!=7)&&(a!=3)&&(a!=9)){cout<<-1<<endl;return 0;}

if(k==1||k==7){cout<<1<<endl;return 0;}

ll rem=7;
ll ct=1;
ll z=7;
while(rem!=0)
{ 
  z=(z*10)%k;
  rem=(rem+z)%k;
  
  ct++;

}
cout<<ct<<endl;
}

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

int main()
{
    vector<int> Ans;
    while (1)
    {
        int d, w;
        cin >> d >> w;
        if (d == 0 && w == 0)
            break;

        vector<vector<int>> heights(d, vector<int>(w));
        for (int i = 0; i < d; i++)
        {
            for (int j = 0; j < w; j++)
            {
                int in;
                cin >> in;
                heights.at(i).at(j) = in;
            }
        }

        int ans = 0;
        for (int x1 = 0; x1 < w; x1++)
        {
            for (int y1 = 0; y1 < d; y1++)
            {
                for (int x2 = x1 + 2; x2 < w; x2++)
                {
                    for (int y2 = y1 + 2; y2 < d; y2++)
                    {
                        int HeightMin = INT_MAX, sum = 0;
                        for (int x = x1; x <= x2; x++)
                        {
                            HeightMin = min(HeightMin, heights[y1][x]);
                            HeightMin = min(HeightMin, heights[y2][x]);
                        }
                        for (int y = y1; y <= y2; y++)
                        {
                            HeightMin = min(HeightMin, heights[y][x1]);
                            HeightMin = min(HeightMin, heights[y][x2]);
                        }
                        for (int x = x1 + 1; x <= x2 - 1; x++)
                        {
                            for (int y = y1 + 1; y <= y2 - 1; y++)
                            {
                                if (heights[y][x] >= HeightMin)
                                    goto Exit;
                                else
                                {
                                    sum += HeightMin - heights[y][x];
                                }
                            }
                        }
                        ans = max(ans, sum);
                    Exit:;
                    }
                }
            }
        }
        Ans.push_back(ans);
    }
    for (int i = 0; i < Ans.size(); i++)
    {
        cout << Ans[i] << endl;
    }
}


Measured memory_bytes: 3136
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        if(str.length() == 2){
            System.out.println(str);
        } else {
            for(int i = str.length()-1; i >= 0; i--) {
                System.out.print(str.charAt(i));
            }
            System.out.println();
        }
    }
}

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

const ll mod = 1e9 + 7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
};

int main() {
    Sieve sieve(1e6);
    int n;
    cin >> n;
    vector<int> A(n);
    rep(i, n) cin >> A[i];
    map<int, int> mp;
    rep(i, n) {
        vector<P> fa = sieve.factor(A[i]);
        for (auto p: fa) {
            mp[p.first] = max(mp[p.first], p.second);
        }
    }

    mint lcm = 1;
    for (auto p: mp) {
        rep(i, p.second) lcm *= p.first;
    }

    mint ans = 0;
    rep(i, n) {
        ans += lcm / A[i];
    }
    cout << ans.x << endl;
}

Measured memory_bytes: 4984
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const double EPS = 1e-9;
const double PI  = acos(-1.0);

#include <complex>
typedef complex<double> P;

double cross(P a, P b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}
double dot(P a, P b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;           // counter clockwise
  if (cross(b, c) < 0)   return -1;           // clockwise
  if (dot(b, c) < 0)     return +2;           // c--a--b on line
  if (norm(b) < norm(c)) return -2;           // a--b--c on line
  return 0;                                   // a--c--b on line
}
bool triangle_contains(const vector<P>& tri, const P& p) {
	if( ccw(tri[0], tri[1], p) > 0 &&
		ccw(tri[1], tri[2], p) > 0 &&
		ccw(tri[2], tri[0], p) > 0 )
		return true;
	if( ccw(tri[0], tri[1], p) < 0 &&
		ccw(tri[1], tri[2], p) < 0 &&
		ccw(tri[2], tri[0], p) < 0 )
		return true;
	return false;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		vector<P> triangle;
		triangle.push_back(P(x1,y1));
		triangle.push_back(P(x2,y2));
		triangle.push_back(P(x3,y3));
		bool contains=triangle_contains(triangle,P(xp,yp));
		cout<<(contains?"YES":"NO")<<endl;
	}
}

Measured memory_bytes: 1232
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		while (sc.hasNext()) {
			int sum = 0;
			int d = sc.nextInt();
			for (int i = 1; d * i <= 600 - d; i++)
				sum += (d * i) * (d * i) * d;
			System.out.println(sum);
		}

	}

}

Measured memory_bytes: 17176
#include <bits/stdc++.h>
using namespace std;
int main(){
	long long x;
	cin>>x;
	long long a=100;
	for (long long i=1;i<=3760;i++){
		a*=1.01;
		if (a>=x){
			cout<<i<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
using namespace std;

int main()
{
	int X,A;
	cin >> X >> A;
	
	if (X < A)
	{
		cout << "0" << endl;
	}
	else {
		cout << "10" << endl;
	}
}

Measured memory_bytes: 256
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;

public class Main {
  public static void main(String args[] ) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String a = "";
    String b = "";
    while(((a = br.readLine()) != null) && ((b = br.readLine()) != null)){
      int hit = 0;
      int blow = 0;

      String[] al = new String [4];
      al = a.split(" ");

      String[] bl = new String[4];
      bl = b.split(" ");

      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 4; j++) {
          if (al[i].equals(bl[j])) {
            if (i == j) {
              hit++;
            } else {
              blow++;
            }
          }
        }
      }
      System.out.println(hit+" "+blow);
    }
  }
}

Measured memory_bytes: 24216
#include <bits/stdc++.h>
#define ll long long int
#define pb(x) push_back(x)
#define TEST(t) int inox,t;cin>>t; for(inox=1;inox<=t;inox++)
using namespace std;

int main(){
	double h,a; cin>>h>>a;
	int e=ceil(h/a);
	cout<<e;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<utility>
#include<functional>
#include<stack>
#include<queue>
#include<cmath>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

int main() {

	int n = 0,tmp = 0;

	cin >> n;

	const int N = 55555;
	int arr[100000] = {};

	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (int i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (int j = 0; i * (j + 2) < N; j++) {
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for (int i = 2; tmp < n; i++) {
		if (arr[i]) {
			if (i % 5 == 1) {
				cout << i << " ";
				tmp++;
			}
			
		}
	}

	cout << endl;

	return 0;
}


Measured memory_bytes: 640
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

#define YES "Yes"
#define NO "No"

struct Edge {
	int a, b;
};

int N, K;
Edge es[100000];
int l[100000], h[100000];
int V[100000];
vector<int> es2[100000];
bool used[100000];

int main(int argc, char **argv) {
	cin >> N;
	REP(i, N - 1) {
		cin >> es[i].a >> es[i].b;
		--es[i].a;
		--es[i].b;
		es2[es[i].a].push_back(es[i].b);
		es2[es[i].b].push_back(es[i].a);
	}
	REP(i, N) l[i] = h[i] = -1;
	cin >> K;
	REP(i, K) {
		int P;
		cin >> V[i] >> P;
		--V[i];
		l[V[i]] = h[V[i]] = P;
	}
	bool res = true;
	CLEAR(used);
	stack<pair<int, int>> st;
	st.emplace(V[0], -1);
	while (!st.empty()) {
		auto pr = st.top();
		int a = pr.first, p = pr.second;
		if (p != -1 && es2[a].size() == 1) used[a] = true;
		if (used[a]) {
			st.pop();
			REP(i, es2[a].size()) {
				int b = es2[a][i];
				if (b == p) continue;
				l[a] = max(l[b] - 1, l[a]);
				h[a] = min(h[b] + 1, h[a]);
			}
		}
		else {
			REP(i, es2[a].size()) {
				int b = es2[a][i];
				if (b == p) continue;
				if (h[b] != -1) {
					if (h[a] % 2 == h[b] % 2) {
						res = false;
						break;
					}
					l[b] = max(l[a] - 1, l[b]);
					h[b] = min(h[a] + 1, h[b]);
					l[a] = max(l[b] - 1, l[a]);
					h[a] = min(h[b] + 1, h[a]);
					if (l[a] > h[a] || l[b] > h[b]) {
						res = false;
						break;
					}
				}
				else {
					l[b] = l[a] - 1;
					h[b] = h[a] + 1;
				}
				st.emplace(b, a);
			}
		}
		used[a] = true;
	}
	if (!res) {
		cout << NO << endl;
		return 0;
	}
	cout << YES << endl;
	CLEAR(used);
	queue<int> q;
	q.push(V[0]);
	used[V[0]] = true;
	while (!q.empty()) {
		int t = q.front(); q.pop();
		int c = h[t];
		REP(i, es2[t].size()) {
			int s = es2[t][i];
			if (used[s]) continue;
			if (l[s] <= c + 1 && c + 1 <= h[s]) l[s] = h[s] = c + 1;
			else h[s] = h[s] = c - 1;
			q.push(s);
			used[s] = true;
		}
	}
	REP(i, N) cout << h[i] << endl;
	return 0;
}


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

int main() {
  int N , K , a;
  cin >> N >> K;
  a = 1;
  
  for (int i = 0;i < N;i++){
    if (a + K < a * 2){
      a = a + K;
    }
    else{
      a = a * 2;
    }
  }
  cout << a << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)

bool isPrime(ll x){
  ll root_x = (ll)sqrt((double)x);
  bool prime = true;
  if(x<=1LL){
    return false;
  }
  for(ll i=2;i<=root_x;++i){
    if(x%i==0){
      prime = false;
      break;
    }
  }
  return prime;
}

int main() {
  vector<ll> v(100000+1);
  ll cnt=0;
  for(ll i=1;i<100001;++i){
    if(i%2==1){
      if(isPrime(i)&&isPrime((i+1LL)/2LL))++cnt;
    }
    v[i] = cnt;
  }
  ll q;cin>>q;
  for(ll i=0;i<q;++i){
    ll l,r;cin>>l>>r;
    cout << v[r] - v[l-1] <<endl;
  }
  return 0;
}


Measured memory_bytes: 1408
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
from heapq import heapify, heappop, heappush
import math
import random
import string
from copy import deepcopy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

"""
# 問題:N問、ジャッジ:M人
# M人のジャッジがそれぞれV問を選び、問題のスコアを１ずつあげる
# M人の投票の後、大きい方からP問が選ばれる
# 問題セットに選ばれる可能性があるのは何問あるか

M人全員が投票すれば選ばれやすくなる
選ばれるとは？
可能性がないものを数えた方が早いのでは
P番目以内にあれば無条件で通過
現在のP番目 <= A[i] + M
V <= Pなら
上からP - 1番目までのどれか + A[i]を加算させることでA[i]を強くできる　
V > Pなら？
上からP - 1番目までとA[i]を強化するとして、残りのV - P個は小さいものから順に選ぶ
A[i]を抜かせないようにしたい
A[i]より大きい数字も一緒に足される場合にはP以内に入れない
"""
N, M, V, P = getNM()
A = getList()
A.sort(reverse = True)

def judge(x):
    if x < P:
        return True
    if A[P - 1] > A[x] + M:
        return False
    # P - 1番目まで + 自身以降の数字についてはM個足す
    left = (V - (P - 1) - (N - x)) * M
    # P個目からx-1まで A[x] + Mを超えない分足す
    for i in range(P - 1, x):
        left -= A[x] + M - A[i]

    return left <= 0

ok = -1
ng = N

while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if judge(mid):
        ok = mid
    else:
        ng = mid
print(ok + 1)

Measured memory_bytes: 101956
n, m = input().split()
N = int(n)
M = int(m)

AB = []
for i in range(N):
    AB.append(list(map(int, input().strip().split(' '))))
AB.sort()

M_tmp = M
price = 0
for i in range(N):
    if M_tmp == 0:
        break
    
    elif AB[i][1] <= M_tmp:
        price += AB[i][0] * AB[i][1]
        M_tmp -= AB[i][1]
    
    else:
        price += AB[i][0] * M_tmp
        M_tmp = 0
print(price)


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

#define bolt ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define lb lower_bound
#define ub upper_bound

typedef long long ll;
typedef long double ld;

const ld pi=3.1415926535897932384626433;
const int mod = 1000000007;
const ll inf=3e18;
// 90DTG
ll dp[100001];
ll h[100001];
ll k;
ll n;

ll god(ll i)
{
   if (i>n)
      return inf;
   if (i==n)
      return 0;
   if (dp[i]!=-1)
      return dp[i];

   ll ans=inf;
   for (ll j=i+1;j<=min(i+k,n);j++)
   {
      ans=min(ans,abs(h[i]-h[j])+god(j));
   }
   return dp[i]=ans;
}
int main ()
{
   bolt;
   memset (dp,-1,sizeof(dp));
   cin>>n>>k;
   for (ll i=1;i<=n;i++)
   {
      cin>>h[i];
   }
   cout<<god(1);

}


Measured memory_bytes: 6528
def counting_sort(A, n, k):
    B = [0 for _ in range(n)]
    C = [0 for _ in range(k)]

    for num in A:
        C[num] += 1

    for i in range(1, k):
        C[i] += C[i - 1]

    for i in range(n - 1, -1, -1):
        B[C[A[i]] - 1] = A[i]
        C[A[i]] -= 1

    return B


def main():
    n = int(input())
    A = list(map(int, input().split()))

    B = counting_sort(A, n, 10000)
    print(*B)


if __name__ == "__main__":
    main()



Measured memory_bytes: 224384