akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
import numpy as np
import itertools
n = int(input())
f = np.zeros((n,10),dtype='int32')
p = np.zeros((n,11),dtype='int32')
for i in range(n):
    f[i] = list(map(int,input().split()))
for i in range(n):
    p[i] = list(map(int,input().split()))
    

op = [0,1]
ans = -10**9
pro = list(itertools.product(op, repeat=10))
for i in pro:
    if(sum(i)==0):continue
    tmp = 0
    for j in range(n):
        tmp += p[j][np.dot(np.array(i),f[j])]
    ans = max(ans,tmp)
print(ans)


Measured memory_bytes: 14504
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int a, b;

int main() {
    fastio();

    cin >> a >> b;

    int ans = 0;
    for (int i = a; i <= b; i++) {
        string s = to_string(i);
        string t = s;
        reverse(all(t));
        ans += s == t;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
S = input()

my, ym = 0< int(S[:2]) <13, 0< int(S[2:]) <13

if my and ym:
	o = 'AMBIGUOUS'
elif my:
    o = 'MMYY'
elif ym:
	o = 'YYMM'
else:
	o = 'NA'
print(o)



Measured memory_bytes: 2940
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
ans = [100000,100000]

for i in range(len(H)):
    a = T-H[i]*0.006
    if abs(A-a)<ans[1]:
        ans[1]=abs(A-a)
        ans[0]=i+1
print(ans[0])

Measured memory_bytes: 3060
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//mapのキー：p->first mapのバリュー：p->second
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto i = begin; i != end; i++) {}
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// Nの桁数
ll dig(ll N) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= 10;
	}
	return dig;
}
// x,yの最大公約数
ll gcd(ll x, ll y) {
	ll r;
	while (x%y) {
		r = x % y;
		x = y;
		y = r;
	}
	return y;
}

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

	cout << N / 3 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <bitset>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define repm(i, a, n) for (ll i = a; i >= n; i--)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vd vector<double>
#define vb vector<bool>
#define vs vector<string>
#define vii vector<vector<int>>
#define vll vector<ll>
#define vllll vector<vector<ll>>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define reverse_v(a) reverse(a.begin(), a.end())

void print(bool c)
{
    (c) ? (cout << "Yes" << endl) : (cout << "No" << endl);
}

void Print(bool c)
{
    (c) ? (cout << "YES" << endl) : (cout << "NO" << endl);
}

//最小公倍数
template <typename T>
T gcd(T a, T b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

//最大公約数
template <typename T>
T lcm(T a, T b)
{
    return a * b / gcd(a, b);
}
//セカンドキー->ファーストキーの順ソート
bool cmp(const pii &a, const pii &b)
{
    if (a.second != b.second)
        return a.second < b.second;
    return a.first < b.first;
}

//右下左上
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};

int eve(int x)
{
    if (x % 400 == 0)
        return 1;
    if (x % 100 == 0)
        return 0;
    if (x % 4 == 0)
        return 1;
    return 0;
}

int main(void)
{
    ll n, m, x;
    cin >> n >> m >> x;
    vllll a(n, vll(m));
    vll c(n);
    rep(i, 0, n)
    {
        cin >> c[i];
        rep(j, 0, m)
        {
            cin >> a[i][j];
        }
    }
    ll ans = INF;
    rep(i, 0, 1 << n)
    {
        stringstream ss;
        ss << bitset<12>(i);
        string s = ss.str();
        vll sum(m, 0);
        ll money = 0;
        rep(j, 0, n)
        {
            if (s[11 - j] == '1')
            {
                money += c[j];
                rep(k, 0, m)
                {
                    sum[k] += a[j][k];
                }
            }
        }
        bool f = true;
        rep(j, 0, m)
        {
            if (sum[j] < x)
                f = false;
        }
        if (f)
            ans = min(ans, money);
    }
    cout << (ans != INF ? ans : -1) << endl;
}


Measured memory_bytes: 3644
#include <stdio.h>
int main()
{
	int A,B;
	scanf("%d %d",&A,&B);
	
	if(A+B>=A*B){
		if(A+B>=A-B){
			printf("%d",A+B);
		}else{
			printf("%d",A-B);}
	}else{
		if(A*B>=A+B){
			if(A*B>=A-B){
				printf("%d",A*B);
			}else{
				printf("%d",A-B);}
		}
	}
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int calculation(int a, int b, int *c){
	int i,x;
	x=1;
	for(i=0;i<b;i++){
		x=x*a;
	}
	*c=x;
	return 0;
}


int main(){
	int a,b,c;
	scanf("%d",&a);
	b=3;
	calculation(a,b,&c);
	printf("%d\n",c);
	return 0;
}

Measured memory_bytes: 1756
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define LINF 1e18
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

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; }


int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

vector<long long> LISLDS(long long N, long long A, long long B) {
    vector<long long> res;
    for (long long i = B-1; i >= 0; --i) res.push_back(i);
    
    if (A == 1) return res;
    
    long long rem = N - B;
    long long p = rem / (A-1);
    long long r = rem % (A-1);
    
    long long b = r;
    long long c = A-1-r;
    
    for (int i = 0; i < b; ++i) {
        int size = (int)res.size();
        for (int j = 0; j < p+1; ++j) {
            res.push_back(size + p - j);
        }
    }
    for (int i = 0; i < c; ++i) {
        int size = (int)res.size();
        for (int j = 0; j < p; ++j) {
            res.push_back(size + p-1 - j);
        }
    }
    
    return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,A,B;
    cin>>N>>A>>B;
    if(A+B>N+1 || A*B<N) cout<<-1<<endl;
    else{
        auto res = LISLDS(N,A,B);
        for(auto x:res){
            cout<<x+1<<" ";
        }
        cout<<endl;
    }

}

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

int h[1000001];
int dp[1000001];
int d[3]={2,3,5};
void ham(int s){
	memset(h,0,sizeof(h));
	memset(dp,0,sizeof(dp));
	h[1]=1;
	for(int i=0;i<3;i++){
		for(int j=1;j<=s;j++){
			if(h[j/d[i]]==1 && j%d[i]==0)h[j]=1;
		}
	}
	for(int i=1;i<=s;i++){
		dp[i]=dp[i-1]+h[i];
	}
}

int main(void){
	ham(1000000);
	while(1){
		int m,n;
		scanf("%d",&m);
		if(m==0)break;
		scanf("%d",&n);
		printf("%d\n",dp[n]-dp[m-1]);
	}
    return 0;
}

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

ll big_mod(ll n_, ll p_, ll mod_){
     if(p_==0) return 1LL;
     if(p_&1LL) return (n_*big_mod(n_, p_-1LL, mod_))%mod_;
     ll tmp_=big_mod(n_, p_>>1LL, mod_);
     return (tmp_*tmp_)%mod_;
}

ll func(int sm){
     //cout << "Sm = " << sm << endl;
     int ans=0;
     while(sm>0){
          int cnt=__builtin_popcount(sm);
          sm%=cnt;
          ans++;
     }
     return ans;
}

int main(){
     ll i, j, k;
     ll n;
     cin >> n;
     string str;
     cin >> str;
     ll cnt=0, sm=0, mod0=0, mod1=0;
     for(i=0; i<n; ++i) cnt+=(str[i]=='1');
     //cout << cnt << endl;
     for(i=0; i<n; ++i){
          if(str[i]=='0') continue;
          if(cnt>1) mod0=(mod0+big_mod(2, n-1-i, cnt-1))%(cnt-1);
          mod1=(mod1+big_mod(2, n-1-i, cnt+1))%(cnt+1);
     }
     //cout << mod0 << " " << mod1 << endl;
     ll ans;
     for(i=0; i<n; ++i){
          if(str[i]=='1'){
               sm=mod0;
               if(cnt>1){
                    sm=(sm-big_mod(2, n-1-i, cnt-1))%(cnt-1);
                    if(sm<0) sm+=cnt-1;
                    ans=1+func(sm);
               }
               else ans=0;
          }
          else{
               sm=mod1;
               sm=(sm+big_mod(2, n-1-i, cnt+1))%(cnt+1);
               ans=1+func(sm);
          }
          printf("%lld\n", ans);
     }
}


Measured memory_bytes: 3852
/* Dsingh_24 */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ios	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

#define N  100005

int main()
{
	ios
	ll n,i,j;
	cin>>n;
	string s;
	cin>>s;
	ll ss=s.size();
	j=min(ss,n);
	for(i=0;i<j;i++)
		cout<<s[i];
	if(s.size()>n)cout<<"...";
	return 0;
}

Measured memory_bytes: 3652
K = int(input())
A,B = list(map(int,input().split()))
K2 = 0
num = []
for i in range(1,1000):
  K2 = K * i
  if K2 > 1000:
    break
  else:
    num.append(K2)
      
for i in range(A,B+1):
  if i in num:
    print("OK")
    break
  else:
    if i == B:
      print("NG")
      break

Measured memory_bytes: 9040
#include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	static const ULL M = 1000000007;

	void Solve() {
		UL H, W; cin >> H >> W;
		deque<UL> YM(H), XM(W);
		rep(y, H) cin >> YM[y];
		rep(x, W) cin >> XM[x];
		sort(XM.rbegin(), XM.rend()); XM.push_back(0);
		sort(YM.rbegin(), YM.rend()); YM.push_back(0);
		ULL ans = 1;
		UL emp = 0;
		UL w, h; w = 0; h = 0;
		for (UL i = W * H; i > 0; i--) {
			if (XM.front() == i && YM.front() == i) {
				XM.pop_front(); if (XM.front() == i) { cout << 0 << endl; return; }
				YM.pop_front(); if (YM.front() == i) { cout << 0 << endl; return; }
				emp += (w + h); h++; w++;
			}
			else if (XM.front() == i) {
				XM.pop_front(); if (XM.front() == i) { cout << 0 << endl; return; }
				ans = ans * h % M; if (h == 0) { cout << 0 << endl; return; }
				emp += h; w++; emp--;
			}
			else if (YM.front() == i) {
				YM.pop_front(); if (YM.front() == i) { cout << 0 << endl; return; }
				ans = ans * w % M; if(w == 0) { cout << 0 << endl; return; }
				emp += w; h++; emp--;
			}
			else {
				if(emp == 0) { cout << 0 << endl; return; }
				ans = ans * emp % M;
				emp--;
			}
		}
		cout << ans << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int D[N];
  for(int i = 0; i < N; ++i) cin >> D[i];
  int M;
  cin >> M;
  int T[M];
  for(int i = 0; i < M; ++i) cin >> T[i];
  if(M > N) cout << "NO" << endl;
  else{
    sort(D,D+N);
    sort(T,T+M);
    int k = 0;
    for(int i = 0; i < N; ++i){
      if(k < M && D[i] == T[k]) ++k;
    }
    if(k == M) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}


Measured memory_bytes: 1792
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
int n,a[100001];
class IO{char buffer[10000001];char *h;int len;inline char gchar(){return *h++;}inline bool validdigit(char c){return c>='0' && c<='9';}public:inline void init(){len=fread(buffer,1,10000000,stdin);h=buffer;}inline int nextint(){register int i=0;register char c;do c=gchar();while(!validdigit(c));do{i=i*10+c-48;c=gchar();}while(validdigit(c));return i;}}io;
int gcd(int a,int b){if(a<b)swap(a,b);for(register int t=a%b;t;a=b,b=t,t=a%b);return b;}
bool dfs()
{
	register int cnt=0,last=0,tmp;
	for(register int i=1;i<=n;++i)(a[i]&1)?last=i:++cnt;
	if(cnt&1)return true;
	if(cnt+1<n || a[last]==1)return false;
	tmp=a[last]-1;
	for(register int i=1;i<=n;++i)
		if(i!=last)tmp=gcd(tmp,a[i]);
	for(register int i=1;i<=n;++i)a[i]/=tmp;
	return !dfs();
}

int main()
{
	io.init();n=io.nextint();
	for(register int i=1;i<=n;++i)
		a[i]=io.nextint();
	puts(dfs()?"First":"Second");
}

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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define PI 3.14159265359 //πの値
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

 
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll A,B;
cin >> A >> B;
if(A==B) cout << "Yes";
else cout << "No";
}

Measured memory_bytes: 3656
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int hill[10];
  for(int i=0; i<10; i++){
    cin >>hill[i];
  }
  sort(hill,hill+10);
  cout <<hill[9]<<endl<<hill[8]<<endl<<hill[7]<<endl;
  return 0;
}

Measured memory_bytes: 0
#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<set>
#include<cstring>
 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define mp make_pair
#define pb push_back
#define LLIandI pair<long long int , int>
#define ll long long

int main(void){
    int N,M;
    scanf("%d %d",&N,&M);
    int ans=0;
    rep(i,2){
        if(N>M){ans+=N;N--;}
        else{ans+=M;M--;}
    }
    printf("%d\n",ans);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(auto i = (N) - 1; i >= 0; i -= 1)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define vrep(v,it) for(auto it = v.begin(); it != v.end(); it++)
#define vrepr(v,it) for(auto it = v.rbegin(); it!= v.rend(); it++)
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define rand mtrand
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cout << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,...) do { cout << #v << " = "; array_out(v , ##__VA_ARGS__);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = 0x1FFFFFFFFFFFFFFFLL;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}

random_device seed_gen; mt19937_64 mtrand(seed_gen());
#define MOD 1000000007
//////////////////////////////////////////

int main(){
  ini(n);
  int ans = 0;
  rep(i,6){
    ans += n % 10;
    n /= 10;
  }
  out(ans);
}

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

divisors = make_divisors(A[-1])
answer = 1
for d in divisors:
  NG = 0
  for a in A:
    if a % d != 0:
      NG += 1
    if NG > 1:
      break
  if NG <= 1:
    answer = d
    break
    
divisors = make_divisors(A[-2])
for d in divisors:
  NG = 0
  for a in A:
    if a % d != 0:
      NG += 1
    if NG > 1:
      break
  if NG <= 1:
    if d > answer:
      print(d)
    else:
      print(answer)
    break 


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

int main()
{
    int n, k, sum = 0, x;
    cin >> n >> k;

    for(int i = 1; i <= n; i++)
    {
        cin >> x;
        sum += 2 * min(x, abs(x - k));
    }

    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define gcd(m,n) __gcd(m,n)
#define lcm(m,n) m*(n/gcd(m,n))
#define fast std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pi acos(-1.0)
#define endl '\n'
#define MOD 1000000007
#define ull unsigned long long
#define ll long long
#define ld long double
#define pb push_back
#define dbg(x) cout << #x << "  " << x << endl;
 
ll power(ll base, ll exp) 
{ll res=1;while(exp>0) {if(exp%2==1) res=(res*base);base=(base*base);exp/=2;}return res;}
ll mod(ll a, ll b) {return (a % b + b) % b;}
ll powerm(ll base,ll exp,ll mod) 
{ll ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
/*{{ x | (1 << k) sets the kth bit of x to one
x & ~(1 << k) sets the kth bit of x to zero
x ^ (1 << k) inverts the kth bit of x.
x & (x-1) sets the last one bit of x to zero
x & -x sets all the one bits to zero, except for the last one bit. 
x | (x-1) inverts all the bits after the last one bit.}} SOME BIT MANIPULATION*/
//__builtin_clz(x): the number of zeros at the beginning of the number
//__builtin_ctz(x): the number of zeros at the end of the number
//__builtin_popcount(x): the number of ones in the number
//__builtin_parity(x): the parity (even or odd) of the number of ones 
struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
	{
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const 
	{
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
/*//DSU 
int parent[200005];
int rankr[200005];
int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}
void make_set(int v) {
    parent[v] = v;
    rankr[v] = 0;
}
void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (rankr[a] < rankr[b])
            swap(a, b);
        parent[b] = a;
        if (rankr[a] == rankr[b])
            rankr[a]++;
    }
} */

int main()
{  
	fast; 
	ll x1,x2,y1,y2; cin>>x1>>y1>>x2>>y2;
	ll x = x2 - x1; ll y = y2 - y1; 
	cout << x2 - y << " " << y2 + x <<  " " << x1 - y << " " << y1 + x << endl;
	return 0;
}

Measured memory_bytes: 3652
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
#define low lower_bound
#define upp upper_bound
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define Rep(i,n) for (int i = (int)(n); i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define rever(vec) reverse(all(vec));
#define cend printf("\n");
#define prique(T) priority_queue<T, vector<T>, greater<T>>
#define prique2(T) priority_queue<T>

#define yes printf("Yes\n")
#define Yes printf("YES\n")
#define no printf("No\n")
#define No printf("NO\n")

struct edge { int to, cost; };
using P = pair<int, int>;
using PP = pair<P, int>;
using D = pair<double, double>;
//const long long mod = 998244353;
const long long mod = 1e9 + 7, inf = 1e16;
const string sp = " ";
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = max(a, b);
		return true;
	}
	return false;
}
template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = min(a, b);
		return true;
	}
	return false;
}

int modpow(int x, int n) {
	int ans = 1;
	while (n > 0) {
		if (n & 1) {
			ans *= x;
			if (mod <= ans) ans %= mod;
		}
		x *= x;
		if (mod <= x) x %= mod;
		n >>= 1;
	}
	return ans;
}

int fact[1000000];
void f_init(int n) {
	if (1000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= n; ++i) {
		fact[i] *= fact[i - 1];
		if (mod <= fact[i]) fact[i] %= mod;
	}
	return;
}

int comb(int n, int r) {
	if (n < r) return 0;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod * modpow(fact[r], mod - 2);
	if (ans < 0) return ans + mod;
	return ans;
}

int perm(int n, int r) {
	if (n < r) return 0;
	if (n - r < r) r = n - r;
	int ans = fact[n] * modpow(fact[n - r], mod - 2) % mod;
	if (ans < 0) return ans + mod;
	return ans;
}

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

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

bool pri(int p) {
	for (int i = 2; i * i <= p; ++i) if (p % i == 0) return false;
	return p > 1;
}

map<int, int> factring(int n) {
	map<int, int>ans;
	for (int i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			n /= i;
			++ans[i];
		}
	}
	if (n != 1) ++ans[n];
	return ans;
}

int ans;
signed main() {
	int n, k;
	cin >> n >> k;
	rep(i, n) {
		int a;
		cin >> a;
		if (k <= a) ans++;
	}
	cout << ans << endl;
}


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

#define s second
#define f first

const int maxn = 2e5 + 10;

int n;
string s[maxn];
vector<pair<string, int>> ans;

void in();
void solve();
bool cmp(pair<string, int>, pair<string, int>);
void out();

int main(){
    in();
    solve();
    out();
}

void in(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> s[i];
}

void solve(){
    sort(s, s + n);
    int cnt = 1;
    for(int i = 1; i < n; i++){
        if(s[i] != s[i - 1]){
            ans.push_back({s[i - 1], cnt});
            cnt = 0;
        }
        cnt++;
    }
    ans.push_back({s[n - 1], cnt});
    sort(ans.begin(), ans.end(), cmp);
}

bool cmp(pair<string, int> s1, pair<string, int> s2){
    int x = s1.s;
    int y = s2.s;
    if(x == y)
        return s1.f < s2.f;
    return x > y;
}

void out(){
    cout << ans[0].f << '\n';
    for(int i = 1; i < ans.size(); i++){
        if(ans[i].s != ans[i - 1].s)
            break;
        cout << ans[i].f << '\n';
    }
}


Measured memory_bytes: 17136
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };

    let n: usize = sc.read();
    let m: usize = sc.read();
    let mut graph = vec![vec![]; n];
    let mut inverse = vec![vec![]; n];
    for _ in 0..m {
        let a = sc.read::<usize>() - 1;
        let b = sc.read::<usize>() - 1;
        graph[a].push(b);
        inverse[b].push(a);
    }

    let probability = calc_probability(&graph, &inverse, (n, n));
    let mut ans = probability[0];
    for from in 0..n {
        if graph[from].len() == 1 {
            continue;
        }
        if let Some(&next) = graph[from]
            .iter()
            .max_by(|&&next1, &&next2| probability[next1].partial_cmp(&probability[next2]).unwrap())
        {
            let p = calc_probability(&graph, &inverse, (from, next));
            if p[0] < ans {
                ans = p[0];
            }
        }
    }

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

fn calc_probability(
    graph: &Vec<Vec<usize>>,
    inverse: &Vec<Vec<usize>>,
    prohibited: (usize, usize),
) -> Vec<f64> {
    let n = inverse.len();
    let mut dp = vec![0.0; n];
    for next in (0..n).rev() {
        for &from in inverse[next].iter() {
            if (from, next) == prohibited {
                continue;
            }
            let s = if from == prohibited.0 {
                graph[from].len() as f64 - 1.0
            } else {
                graph[from].len() as f64
            };
            dp[from] += (dp[next] + 1.0) / s;
        }
    }
    //    println!("{:?} dp={:?}", prohibited, dp);
    dp
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


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

int main(){
  

  
  int E,Y ;
  cin>>E>>Y  ;
  if(E==0 && 1868<=Y && Y<=1911){
    
    cout<<"M"<<Y-1867<<endl;
  }else if(E==0 && Y>=1912 && Y<=1925  ){
    
    cout<<"T"<<Y-1911<<endl;
  }else if(E==0 && Y>=1926 && Y<=1988){
    cout<<"S"<<Y-1925<<endl;
  }else if(E==0 && Y>=1989 && Y<=2016){
    cout<<"H"<<Y-1988<<endl;
  }else if(E==1){
    cout<<Y+1867<<endl;
  }else if(E==2){
    cout<<Y+1911<<endl;
  }else if(E==3){
    cout<<Y+1925<<endl;
  }else if(E==4){
    cout<<Y+1988<<endl;
  }

  
  

  return 0;
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF (1LL<<57)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz size

void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_base::fixed);}
void UNSETF() {cout.ios_base::unsetf(ios_base::fixed);}

typedef long long ll;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<PII, int> PPII;
typedef pair<PLL, ll> PPLL;
typedef map<int, int> MII;

struct h_llint {
  static uint64_t splitmix64(uint64_t x) {    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

struct h_pair{
  size_t operator()(const PLL&x)const{
    return hash<ll>()(((ll)x.ff)^(((ll)x.ss)<<32));
  }
};

typedef map<ll, ll> MLL;
typedef map<PII, int> MPII;
typedef map<PLL, ll> MPLL;
typedef set<int> SI;
typedef set<ll> SL;
typedef unordered_map<ll, int, h_llint> UMLI;
typedef unordered_map<ll, ll, h_llint> UMLL;
typedef unordered_map<PLL, int, h_pair> UMPI;
typedef unordered_map<PLL, ll, h_pair> UMPL;

ll ar[MV];
ll arr[MV];

void solve(int T)
{
	ll n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	cin>>ar[i];
	ll gd = ar[0];
	for(int i=1;i<n;i++)
	gd = __gcd(gd, ar[i]);
	bool xd = 0;
	for(int i=0;i<n;i++)
	{
		ar[i] /= gd;
		if(!(ar[i] & 1))
		{
			xd = 1;
			break;
		}	
	}
	gd /= 2;
	if(xd)
	cout<<"0\n";
	else
	{		
		ll lc = 1;
		sort(ar, ar+n);
		for(int i=0;i<n;i++)
		{
			lc = (lc * ar[i]/__gcd(lc, ar[i]));
			if((lc * gd) > m)
			{
				cout<<"0\n";
				return;
			}
		}		
		lc *= gd;
		ll res = (m - lc)/(2*lc) + 1;
		cout<<res<<"\n";	
	}
	return;	
}

int main(void)
{
	FLASH();
	int T;
	T = 1;

// #ifndef ONLINE_JUDGE
// 	time_t time_t1, time_t2;
// 	time_t1 = clock();
// #endif

	while(T--)
	solve(T);

// #ifndef ONLINE_JUDGE
// 	time_t2 = clock();
// 	SETF();
// 	cout<<"Time taken: "<<setprecision(7)<<(time_t2 - time_t1)/(double)CLOCKS_PER_SEC<<"\n";
// 	UNSETF();
// #endif

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>
#include <set>


constexpr long long int MOD = 1000000007;
long long int gcd(long long int a, long long int b) { 
	return b == 0 ? a : gcd(b, a % b);
}
long long int power(long long int base, int exp) {
	switch (exp) {
	case 0: return 1LL;
	case 1: return base % MOD;
	default: return power(base, exp & 1) * power(base * base % MOD, exp >> 1) % MOD;
	}
}
int main(void) {
	int n; std::cin >> n;
	std::vector<int> values(n); for (auto& a : values) std::cin >> a;
	std::vector<long long int> inv(1000001, 1);
	for (auto i = 2; i < inv.size(); ++i) {
		inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD;
	}
	std::vector<int> prime_count(1000001, 0);
	for (auto v : values) {
		int count = 0;
		while ((v & 1) == 0) {
			++count;
			v >>= 1;
		}
		prime_count[2] = std::max(count, prime_count[2]);
		for (auto i = 3; i * i <= v; i += 2) {
			if (v % i == 0) {
				count = 0;
				while (v % i == 0) {
					++count;
					v /= i;
				}
				prime_count[i] = std::max(count, prime_count[i]);
			}
		}
		if (v != 1) {
			prime_count[v] = std::max(1, prime_count[v]);
		}
	}
	long long int lcm = 1;
	for (auto i = 2; i < prime_count.size(); ++i) {
		if (prime_count[i] != 0) {
			lcm = lcm * power(i, prime_count[i]) % MOD;
		}
	}
	long long int result = 0;
	for (const auto v : values) {
		result += lcm * inv[v] % MOD;
		result %= MOD;
	}
	std::cout << result << std::endl;
}



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

#define int long long
#define REP(i,n) for(int i=0;i<n;i++)

/*
int value(int n,int r){
    return abs(n-r*2);
}

int find_r(vector<int> aa,int n){
    int len=aa.size();
    int i=0,j=len;
    while(i!=j){
        int m1=i+(j-i)/3;
        int m2=i+(j-i)*2/3;
        if(value(n,aa[m1])<value(n,aa[m2])){
            i=m1;
        }else{
            j=m2;
        }
    }
    return aa[i];
}
*/
signed main(){
    int n;
    cin>>n;
    vector<int> aa(n);
    REP(i,n)cin>>aa[i];
    sort(aa.begin(),aa.end());
    int N=aa.back();
    int p=1e9;
    int R;
    REP(i,n){
        int q=abs(N-aa[i]*2);
        if(q<p)p=q,R=aa[i];
    }
    cout<<N<<" "<<R<<endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <sstream>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <functional>
#include <utility>
#include <stdio.h>
#define ll long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define F first
#define S second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
int n;
PLL a[200010];
ll t;
int main()
{
	cin >>n;
	for (int i=0;i<n;i++)
	{
		cin >>a[i].S>>a[i].F;
		a[i].S=-a[i].S;
	}
	sort(a,a+n);
	for (int i=0;i<n;i++)
	{
		t+=-a[i].S;
		if (t>a[i].F)
		{
			cout <<"No";
			return 0;
		}
	}
	cout <<"Yes";
	return 0;
}

Measured memory_bytes: 3456
def main():
    n, m = map(int, input().split())
    students = []
    points = []

    for _ in range(n):
        x, y = map(int, input().split())
        students.append((x, y))

    for _ in range(m):
        x, y = map(int, input().split())
        points.append((x, y))

    for s in students:
        idx = 0
        r = distance(s, points[0])

        for i in range(1, m):
            d = distance(s, points[i])
            if d < r:
                idx = i
                r = d
        print(idx + 1)

def distance(s, p):
    return abs(p[0] - s[0]) + abs(p[1] - s[1])

main()


Measured memory_bytes: 3064
#include "bits/stdc++.h"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<int, int> P;
struct Edge{ll from, to, cost;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

ll dp1[110][4];
ll dp2[110][4];
ll visited1[110][4];
ll visited2[110][4];
string S;
ll K;

ll dpf1(ll keta, ll knum){
  if(visited1[keta][knum]==1){
    return dp1[keta][knum];
  }else{
    visited1[keta][knum]=1;
    if(keta==1){
      if(knum==1)dp1[keta][knum]=9;
      if(knum==0)dp1[keta][knum]=1;
    }else{
      if(knum==0)dp1[keta][knum]=dpf1(keta-1, knum);
      if(knum>=1)dp1[keta][knum]=dpf1(keta-1, knum)+9*dpf1(keta-1, knum-1);
    }
    return dp1[keta][knum];
  }
}
ll dpf2(ll keta, ll knum){
  if(visited2[keta][knum]==1){
    return dp2[keta][knum];
  }else{
    visited2[keta][knum]=1;
    if(keta==1){
      if(knum==0)dp2[keta][knum]=1;
      if(knum==1)dp2[keta][knum]= S[keta-1] - '0';
    }else{
      if(knum==0)dp2[keta][knum]=dpf2(keta-1, knum);
      if(knum>=1){
        if(S[keta-1]=='0')dp2[keta][knum] = dpf2(keta-1, knum);
        else{
          dp2[keta][knum]=dpf1(keta-1, knum);
          dp2[keta][knum]+=(S[keta-1]-'0'-1)*dpf1(keta-1, knum-1);
          dp2[keta][knum]+=dpf2(keta-1, knum-1);
        }
      }
    }
    return dp2[keta][knum];
  }
}


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  cin >> S;
  cin >> K;
  reverse(ALL(S));
  cout << dpf2(S.size(), K);
  return 0;
}


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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        int k = sc.nextInt();
        String[][] s = new String[h][w];
        for (int i = 0; i < h; i++) {
            s[i] = sc.next().split("");
        }
        int num = 1;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if ("#".equals(s[i][j])) {
                    s[i][j] = String.valueOf(num++);
                }
            }
        }
        for (int i = 0; i < h; i++) {
            for (int j = 1; j < w; j++) {
                if (".".equals(s[i][j])) {
                    s[i][j] = s[i][j - 1];
                }
            }
        }
        for (int i = 0; i < h; i++) {
            for (int j = w - 2; j >= 0; j--) {
                if (".".equals(s[i][j])) {
                    s[i][j] = s[i][j + 1];
                }
            }
        }
        for (int i = 0; i < w; i++) {
            for (int j = 1; j < h; j++) {
                if (".".equals(s[j][i])) {
                    s[j][i] = s[j - 1][i];
                }
            }
        }
        for (int i = 0; i < w; i++) {
            for (int j = h - 2; j >= 0; j--) {
                if (".".equals(s[j][i])) {
                    s[j][i] = s[j + 1][i];
                }
            }
        }
        for (int i = 0; i < h; i++) {
            StringJoiner sj = new StringJoiner(" ");
            for (int j = 0; j < w; j++) {
                sj.add(s[i][j]);
            }
            System.out.println(sj);
        }
    }

}


Measured memory_bytes: 48296
import java.util.*;

public class Main {

    public static long attack( long h ){
        if( h == 1 ){
            return 1;
        }
        return 2 * attack( h / 2 ) + 1;
    }

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        long h = Long.parseLong(sc.nextLine());
        System.out.println( attack( h ) );

    }

}


Measured memory_bytes: 21972
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <string>
#include <utility>
#include <map>
#include <deque>

using namespace std;
#define rep(i,n) for(int i=1;i<=(int)(n);i++)
#define Rep(i,n) for(int i=0;i<=(int)(n-1);i++)
typedef long long ll;
typedef map<int,int> mint;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef deque<pair<ll,ll>> dep;
int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};
int inf=1e9+1000;
const int mod=1e9+7;
ll infi=1e18+100;

//x=10111;
//x<<2 = 1011100 (右シフト),x>>2 = 101 (左シフト)
//(x>>2)&1 = 101 & 001 = 1
//iビット目は、(x>>i) & 1 でわかる(x>>i)%2 でもよい

int N;



int main(){
	bool isprime[100001];
	rep(i,100001) isprime[i]=true;
	isprime[0]=isprime[1]=false;
	for(int i=0 ; i*i<100001; i++){
		if(isprime[i]){
			for(int j=2;i*j<100001;j++){
				isprime[i*j]=false;
			}
		}
	}
	cin>>N;
	int prime[60];
	int k=0;
	int i=0;
	while(k<=N||i<=55555){
		if(isprime[i]&&i%5==1){
			prime[k]=i;
			k++;
		}
		i++;
		}
	
	Rep(i,N-1) cout<<prime[i]<<" ";
	cout<<prime[N-1]<<endl;
	return 0;
}

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

int a[100000][3];

void Solve(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++)
            cin >> a[i][j];
    }
    int dp[100000][3];
    dp[0][0] = a[0][0];
    dp[0][1] = a[0][1];
    dp[0][2] = a[0][2];
    for(int i=1;i<n;i++){
        dp[i][0] = a[i][0] + max(dp[i-1][1],dp[i-1][2]);
        dp[i][1] = a[i][1] + max(dp[i-1][0],dp[i-1][2]);
        dp[i][2] = a[i][2] + max(dp[i-1][0],dp[i-1][1]);
    }

    int ans = max({dp[n-1][0] ,dp[n-1][1] ,dp[n-1][2]});
    cout << ans << endl;
    /*for(int i=1;i<n;i++){
        if(a[i] >= b[i] && a[i] >= c[i]){
            if(ch != 'a'){
                ans+=a[i];
                ch = 'a';
                continue;
            }
            else{
                if(b[i] > c[i]){
                    ans+=b[i];
                    ch = 'b';
                }
                else{
                    ans+=c[i];
                    ch = 'c';
                }
                continue;
            }
        }
        else if(b[i] >= a[i] && b[i] >= c[i]){
            if(ch != 'b'){
                ans+=b[i];
                ch = 'b';
                continue;
            }
            else{
                if(a[i] > c[i]){
                    ans+=a[i];
                    ch = 'a';
                }
                else{
                    ans+=c[i];
                    ch = 'c';
                }
                continue;
            }
        }
        else if(c[i] >= b[i] && c[i] >= a[i]){
            if(ch != 'c'){
                ans+=c[i];
                ch = 'c';
                continue;
            }
            else{
                if(b[i] > a[i]){
                    ans+=b[i];
                    ch = 'b';
                }
                else{
                    ans+=a[i];
                    ch = 'a';
                }
                continue;
            }
        }
    } 
    cout << ans << endl;*/
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int t=1;
    //cin >> t;
    while(t--)
        Solve();
}

Measured memory_bytes: 5936
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int H,W;
    cin>> H >> W;
    vector <vector<char>> masu (H,vector<char>(W));
    for(int i=0;i<H;++i){
        for(int j=0;j<W;++j){
        char temp;
        cin >> temp;
        if(temp=='#'){masu.at(i).at(j)='#';
                }
        else {masu.at(i).at(j)='0';
            }
        }
    }


//すべてのマスを参照
for(int i=0;i<H;++i){
    for(int j=0;j<W;++j){
        if(masu.at(i).at(j)=='#') continue;
        //masu.at(i).at(j)の周りのマスをmasu.at(y).at(x)で参照
        for(int y=i-1;y<=i+1;y++){
            for(int x=j-1;x<=j+1;++x){
                //マスからはみ出てないかチェック
                //forが４つあるので一回かうんとしたとこもかばーできるのでは
                if(0<=y&& y<H && 0<=x && x<W){
                    if(masu.at(y).at(x)=='#'){
                        ++masu.at(i).at(j);
                    }
                }
            }
        }
    }
}
 for(int i=0; i<H; ++i){
        for(int j=0; j<W; ++j){
            cout << masu.at(i).at(j);
        }
        cout << endl;
 }
}
 

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

typedef long long ll;
typedef long double ld;
typedef vector<ll> v1;
typedef vector<v1> v2;

typedef unordered_map<ll, unordered_map<ll, ll>> graph;

const ll INF = 1ll << 50;
const ll mod = 1000000007;

ll k;

ll increment(ll x){
    ll a = x%10;
    if(x/10 == 0){
        if(a == 9){
            return 10;
        }else{
            return a+1;
        }
    }
    ll b = (x/10)%10;
    if(a < 9 && a-b < 1){
        return x+1;
    }else{
        ll x_10_ = increment(x/10);
        return x_10_*10+(max(0ll, (x_10_%10)-1));
    }
}

ll x = 0;
int main(){
    cin >> k;
    for(ll i = 0;i < k;i++){
        // cerr << x << endl;
        x = increment(x);
    }
    cout << x << endl;
}


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


def solve(X: int, A: int, B: int):
    print((X - A) % B)


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
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(X, A, B)


if __name__ == '__main__':
    main()


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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  cout << fixed << setprecision(12);
  set<int> s = {1,2,3};
  int x; cin>>x; s.erase(x);
  cin>>x; s.erase(x);
  cout<<*s.begin();
  

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void show(int n, int *a){
    int k;
    for (k = 0; k < n - 1; k++){
        printf("%d ", a[k]);
    }
    printf("%d\n", a[n - 1]);
}

int main(void){
    int n;
    int *a;
    int i, j;
    int tmp;
    scanf("%d", &n);
    a = (int *)malloc(sizeof(int) * n);
    for (i = 0; i < n; i++){
        scanf("%d", &a[i]);
    }

    for (i = 1; i < n; i++){
        tmp = a[i];
        j = i - 1;
        show(n, a);
        while (tmp < a[j] && j >= 0){
            a[j + 1] = a[j];
            a[j] = tmp;
            j--;
        }    
    }
    show(n, a);
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;
typedef vector<char> vech;

int main() {
    ll N,K,Q;cin>>N>>K>>Q;
    vel A(Q);
    rep0(i,Q){cin>>A[i];}
    map<ll,ll> data;
    rep1(i,N){data[i]=K;}
    rep0(i,Q){
        data[A[i]]++;
    }
    rep0(i,N){
        if(data[i+1]<=Q){cout<<"No"<<endl;}
        else{cout<<"Yes"<<endl;}
    }
}


Measured memory_bytes: 7680
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
using namespace std;
int main(){
    ll N,L;
    cin >> N >> L;
    if(L<0){
        if(L+N-1<0){
            cout << (2*L+N-2)*(N-1)/2 << endl;
        }
        else{
            cout << (2*L+N-1)*N/2 << endl;
        }

        
    }
       
    else{
        cout << (2*L+N-1)*N/2-L <<endl;
    }
    return 0;
}



Measured memory_bytes: 888
#include <iostream>
#include <algorithm>
#include <array>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vsort(x) sort(x.begin(),x.end())

using int64 = uint64_t;

using namespace std;

int main() {

	int i, j, k;
	int a[8];
	rep(i, 0, 8)
		cin >> a[i];
	int x=0, y=0;
	rep(i, 0, 4)
		x += a[i];
	rep(i, 4, 8)
		y += a[i];
	cout << max(x, y) << endl;
	return 0;
}

Measured memory_bytes: 3084