akhauriyash/Code-Regression huggingface dataset:
/*
????´???????????????????????????????????????£??????(a/b)+(c/d)??????(a*d+c*b)/(b*d)??¨??????????????§?????????
???????????????????????¨LTE???
????????????????????????????????´??\?????????????????§??????????????§?¢?????????????
*/

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

#define CH(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)

using namespace std;

int P,Q,A,N,ans;

pair<int, int> partSum(int a1, int b1, int a2, int b2){
  pair<int,int> p;
  p.first = a1*b2 + a2*b1;
  p.second = b1*b2;
	return p;
}

void dfs(int step, int minnum, int pro, int sum/*pair<int,int> pn*/){
  if(pro > A || N < step) return;
  //if(pn.first*Q == pn.second*P/*pn.first == P && pn.second ==  Q*/){
	if(sum*Q == pro*P){
	  ans++;
		return;
	}

  //REP(i,minnum,A/pro+1){
	for(int i=minnum; pro*i <= A; i++){
    //pair<int, int> tpn;
    //tpn = partSum(pn.first, pn.second, 1, i);
    dfs(step+1, i, pro*i, sum*i + pro/*tpn*/);
  }
  return;
}

int main() {

  while(1){
    cin>>P>>Q>>A>>N;
    if(P==0&&Q==0&&A==0&&N==0) break;
    ans = 0;
    REP(i,1,A+1){ //????????????????±?????????????
      //pair<int ,int> pp(1,i);
      dfs(1,i,i,1/*pp*/);
    }
    cout<<ans<<endl;
  }

  return 0;
}

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

int main() {
	int H, W, K;
	cin >> H >> W >> K;

	vector<string> c(H);
	int black = 0;
	for (int i = 0; i < H; i++) {
		cin >> c[i];
		for (int j = 0; j < W; j++) {
			if (c[i][j] == '#') {
				black++;
			}
		}
	}

	int output = 0;
	for (int bit1 = 0; bit1 < (1 << W); bit1++) {
		bitset<6> B1(bit1);
		for (int bit2 = 0; bit2 < (1 << H); bit2++) {
			int tmp = black;
			bitset<6> B2(bit2);
			for (int w = 0; w < W; w++) {
				for (int h = 0; h < H; h++) {
					if (B1[w] || B2[h]) {
						if (c[h][w] == '#') {
							tmp--;
						}
					}
				}
			}
			if (tmp == K) {
				output++;
			}
		}
	}

	cout << output << endl;

	return 0;
}

Measured memory_bytes: 3580
#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



int main()
{
    
    long long int n, k;
    cin >> n >> k;

    cout << min(n % k, k - n % k) << endl;
    
    return 0;

}

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

const string YES = "YES";
const string NO = "NO";


// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    int A;
    scanf("%d",&A);
    int B;
    scanf("%d",&B);
    int C;
    scanf("%d",&C);
    printf("%s\n", A*B*C==175? YES.c_str(): NO.c_str());
    return 0;
}


Measured memory_bytes: 3756
#include <iostream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <math.h>
#include <set>
#include <stack>
#include <bitset>
#include <map>
#include <queue>
#include <random>
#include <unordered_set>
#include <unordered_map>
#define DEBUG
#define fi first
#define se second
#define pqueue priority_queue
#define pb(x) push_back(x)
// #define endl '\n'
#define all(x) x.begin(), x.end()
#define int long long
#define mk(a, b) make_pair(a, b)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ull> vull;
typedef vector<ll> vll;
// typedef tuple<int, int, int> tiii;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector< vector<int> > vvi;
typedef vector<char> vc;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1000000007;
const int MAXN = 3e5;
//const ld eps = 1e-6;
const ld eps2 = 1e-9;
const int MOD2 = 998244353;
const int dosz = 5e5;
const int SZ = (1<<18);
const ld PI = atan2l(0, -1);


void fast_io(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef DEBUG
        // freopen("a.in", "r",stdin);
#else
       // freopen("mxnl.in", "r", stdin);
       // freopen("mxnl.out", "w", stdout);
#endif
}

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

void solve(){ 
    int n;
    cin >> n;
    if(n==2){
        cout << 1 << endl;
        return;
    }
    int ans = 2;
    int lol = n-1;
    for(int i=2; i*i<=n-1; i++){
        if((n-1) % i == 0){
            ans++;
            // cout << i << " ";
            if((n-1)/i != i){
                ans++;
                // cout << (n-1)/i << " ";
            }
        }
    }
    for(int i=2; i*i<=n; i++){
        if(n%i == 0){
            int beta_n = n;
            while(beta_n % i == 0){
                beta_n /= i;
            }
            if(beta_n % i == 1){
                // cout << i << " ";
                ans++;
            }
            if(i!=n/i){
                beta_n = n;
                int kek = n/i;
                while(beta_n % kek == 0){
                    beta_n /= kek;
                }
                if(beta_n % kek == 1){
                    // cout << kek << " ";
                    ans++;
                }
            }
        }
    }
    // cout << endl;
    cout << ans << endl;
    // cout << ans << endl;
}

signed main() {
    fast_io();
    int q = 1;
    // cout << fixed << setprecision(6);
    // cin >> q;
    // cout << 1 << endl;
    while(q--){
        solve();
    }
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long int
#define ld long double
#define getFaster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define rev(i,n,init) for(int i=n;i>=init;i--)
#define MAXN 200005
#define MOD2 998244353
#define MOD1 1e9+7
#define f first
#define s second
#define endl '\n'
#define pii pair<int,int>
#define piii pair<pii,int>
#define precise(i) cout<<fixed<<setprecision(i)
#define codejam cout<<"Case #"<<ii+1<<": ";
#define impossible cout<<"IMPOSSIBLE"<<endl;
#define error(s) throw runtime_error(s)
#define log loga
// std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// int myRand(int R) {
// 	int val=rng() % R;
//       assert(val>=0);
//       return val;
// }
using namespace std;
const long double PI = atan(1.0)*4;
const int64_t INF=3e18;
const int32_t LOG=21;
const int32_t MOD=MOD1;

int32_t main()
{ 
      getFaster;
      int tests=1;
      //cin>>tests;
      rep(ii,0,tests)
      {
            vector<pii> edges;
            int n;
            cin>>n;
            rep(i,0,n-1)
            {
                  int x,y;
                  cin>>x>>y;
                  if(x>y)swap(x,y);
                  edges.push_back({x,y});
            }

            int ans=0;
            rep(i,1,n+1)
            {
                  ans+=(i*(i+1))/2;
            }
            for(auto it:edges)
            {
                  int l=it.f,r=it.s;
                  ans-=l*(n-r+1);
            }
            cout<<ans<<endl;
      }
      return 0;                         
}

/*
 TIPS:
 1.) Check for corner cases (like 0 is exception case)
 2.) Check for global memory sizes,memory refreshments and its complexity 
 3.) Check for sorting criteria (if used 1-based indexing)
 4.) Check for numbers overflow (while multiplying and doing MOD)
 5.) Check for typecasting issues like int to float( while dividing numbers)
*/

Measured memory_bytes: 7408
import java.util.Map;
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        long n = sc.nextLong();
        long k = sc.nextLong();

        long res =  n % k;
        long res2 = Math.abs(res-k);
        System.out.println(Math.min(res, res2));

    }
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef vector<vector<ii> > vvii;

#define tr(container, it) \
     for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define pb push_back
#define mp make_pair
#define present(container, element) (container.find(element) != container.end())
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int t  = 0;
int visited[100005]={0};
int start[100005]={0};
int finish[100005] = {0};
vvi V(100005);
ll dp[100005][2] = {0};

void dfs_visit(int i)
{
  t++;
  start[i] = t;
  visited[i] = 1;
  dp[i][0] = dp[i][1] = 1;
  for(int j=0;j<V[i].size();j++)
  {
    if(visited[V[i][j]]==0)
    {

      dfs_visit(V[i][j]);
      dp[i][0] = (dp[i][0] * (dp[V[i][j]][1]+dp[V[i][j]][0])%mod)%mod;
      dp[i][1] = (dp[i][1] * dp[V[i][j]][0])%mod;   
    }
  }

  t++;
  finish[i] = t;
  visited[i] = 2;
}

void dfs(int n)
{
    for(int i=1;i<=n;i++)
    {
      if(visited[i]==0)
      {
        dfs_visit(i);
      }
    }
}

int main()
{
  ll n;
	cin >>n;
	for(int i=1;i<=n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		V[a].pb(b);
		V[b].pb(a);
	}

  dfs(n);

  cout << (dp[1][1] + dp[1][0])%mod << '\n'; 
}


Measured memory_bytes: 12672
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
#include <queue>
#include <algorithm>
#include <utility>
#include <vector>
#include <tuple>
#include <numeric>
using namespace std;


int main(int argc, char* argv[]){
	int N;
	scanf("%d",&N);
	if(N<3){
		printf("0\n");
	}else{
		vector<int> L(N);
		for(int i=0; i<N; i++){
			scanf("%d", &L[i]);
		}
		sort(L.begin(), L.end());
//		vector<int> new_L;
//		new_L.push_back(L[0]);
//		for(int i=1; i<N; i++){
//			if(L[i]!=L[i-1]){
//				new_L.push_back(L[i]);
//				printf("%d,",L[i]);
//			}
//		}
		int a, b, c;
		int ans=0;
		for(int i=0; i<(int)L.size()-2; i++){
			for(int j=i+1; j<(int)L.size()-1; j++){
				for(int k=j+1; k<(int)L.size(); k++){
					a=L[i];
					b=L[j];
					c=L[k];
					if(a!=b && b!=c && c!=a){
						if(a+b>c){
//							printf("%d %d %d\n",a,b,c);
							ans++;
						}
					}
				}
			}
		}
		printf("%d", ans);

	}


}


Measured memory_bytes: 3712
from sys import stdin
import numpy as np

A = np.array([int(x) for x in stdin.readline().rstrip().split()])
B = np.reshape(A, (2, 2))
vector = np.array(B[1] - B[0])
print(
    str((B[1] - np.array([vector[1], -vector[0]]))[0]) + ' ' + str((B[1] - np.array([vector[1], -vector[0]]))[1])
    + ' ' + str((B[0] - np.array([vector[1], -vector[0]]))[0]) + ' ' + str((B[0] - np.array([vector[1], -vector[0]]))[1])
)

Measured memory_bytes: 12512
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7;
const ll LINF=1e18;
using namespace std;
#define int long long
//template
//main
signed main(){
  int n,q,k,d;cin>>n>>q>>k>>d;
  k--;d--;
  std::vector<int> ans;
  int sd=d;
  for(int i=0;i<q;i++)sd=sd*2%n;
  int a=(k-sd+n)%n;
  std::vector<int> vs;
  for(int i=0;i<q;i++){
    vs.push_back(a%2);
    a/=2;
  }
  if(a){cout<<-1<<endl;return 0;}
  for(int i=0;i<q;i++){
    int b1=vs[q-1-i];
    int b2=(d>=n/2);
    ans.push_back(b1^b2);
    d=d*2%n+b1;
  }
  reverse(ans.begin(),ans.end());
  //cout<<d<<endl;
  for(int p:ans)cout<<p<<endl;
}



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

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

    int left  = L;
    int right = L + N - 1;
    int eat;
//最も味が大きいものが０以下なら，最も味が大きいものの絶対値が小さい
//最も味が小さいものが０以上なら，最も味が小さいものの絶対値が小さい
//それ以外なら０をまたいでるので，０が小さい
    if     (right <= 0) eat = right;
    else if(left  >= 0) eat = left;
    else                eat = 0;

//HINT:等差数列の総和
// 項数 * (初項 + 末項) / 2
    cout << ((N * (left + right)) / 2) - eat;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

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

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int A = scanner.nextInt();
        int B = scanner.nextInt();
        int C = scanner.nextInt();
        if (A == B) {
            System.out.println(C);
        } else if (A == C) {
            System.out.println(B);
        } else {
            System.out.println(A);
        }
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";

        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {
                    line = br.readLine();
                }
                s = line.split(reg, 0);
                i = 0;
                return s[i++];
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public int nextInt() {
            try {
                return Integer.parseInt(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }

        public double nextDouble() {
            try {
                return Double.parseDouble(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }

        public long nextLong()  {
            try {
                return Long.parseLong(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }
    }
}


Measured memory_bytes: 21076
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
typedef long long int ll;
const int INF = 1 << 30;
using namespace std;
#define pp pair<int,int>
#define FOR(i,a,n) for(int i=(ll)a;i<(ll)n;++i)
#define TFOR(i,n)FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
int main() {
	int n, k, x, y;
	cin >> n >> k >> x >> y;
	if (n > k)cout << (n - k)*y + k*x << endl;
	else cout << n*x << endl;
	return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;
using ull = unsigned long long;

#define int long long
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

void shift()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
}
const int N = 2e5;


signed main()
{
    int n;
    cin >> n;
    vector<int>a(n);
    for(int i = 0; i < n; ++i)
        cin >> a[i];
    for(int i = n - 2; i >= 0; --i)
    {
        if (a[i] > a[i + 1])
            a[i]--;
    }
    bool kek = true;
    for(int i = 0; i + 1 < n; ++i)
        kek &= (a[i] <= a[i + 1]);
    if (kek)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}


Measured memory_bytes: 1152
import collections
N,K=map(int,input().split())
A=list(map(int,input().split()))
c=collections.Counter(A)
cm=c.most_common()
t=len(cm)
j=-1
ans=0
while(t>K):
    ans+=cm[j][1]
    t-=1
    j-=1
print(ans)

Measured memory_bytes: 39344
#include <bits/stdc++.h>
using namespace std;
// 13:40
 
int main(){
  int W, H, N;
  cin >> W >> H >> N;
  vector<vector<int>> white(H, vector<int>(W, 1));
  int ans = 0;
  
  // x, y, aの値を受け取る
  // aによって場合分けをする
  // 色を塗りつぶす（条件に一致する配列の値をゼロにする)
  
  int x, y, a;
  for(int i = 0; i < N; i++){
    cin >> x >> y >> a;
    if( a == 1) { 
      for(int j = 0; j < H; j++){
        for(int k = 0; k < x; k++){
          white.at(j).at(k) = 0;
        }
      }
    } else if ( a == 2){
      for(int j = 0; j < H; j++){
        for(int k = x; k < W; k++){
          white.at(j).at(k) = 0;
        }
      }
    } else if ( a == 3){
      for(int j = 0; j < y; j++){
        for(int k = 0; k < W; k++){
          white.at(j).at(k) = 0;
        }
      }
    } else if ( a == 4){
      for(int j = y; j < H; j++){
        for(int k = 0; k < W; k++){
          white.at(j).at(k) = 0;
        }
      }
    }
  }
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      ans += white.at(i).at(j);
    }
  }
  
  cout << ans << endl;
  
  return 0;
}



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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;


int main() {
	set<int>prime;
	vector<int>like(1e5, 0);
	bool isPrime = true;
	for (int i = 2; i <= 1e5; i++) {
		isPrime = true;
		for (int j = 2; (j * j) <= i; j++) {
			if (i % j == 0) {isPrime = false; break;}
		}
		if (isPrime)prime.insert(i);
		if (isPrime && prime.count((i + 1) / 2))like[i] = 1;
	}

	vector<int>likesum((1e5) + 1, 0);
	rep(i, 1e5) {
		likesum[i + 1] = likesum[i] + like[i];
	}

	int q;
	cin >> q;
	int l, r;
	rep(i, q) {
		cin >> l >> r;
		cout << likesum[r+1] - likesum[l] << endl;
	}

	return 0;
}



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

using namespace std;
using ll = long long;

const ll mod = 1000000007LL;

// a - bをmodをとりつつ計算する.
ll submod(ll a, ll b) {
    return a > b ? (a - b) % mod : ((a - b) % mod + mod);
}

// x^nをmodをとりつつ求める
ll powmod(ll x, ll n) {
    if (n == 0LL) return 1LL;
    x %= mod;
    if (n % 2LL == 0) {
        return powmod((x * x) % mod, n / 2LL);
    }
    else {
        return (x * powmod((x * x) % mod, n / 2LL)) % mod;
    }
}

// xの逆元を求める.
ll modinv(ll x) {
    return powmod(x, mod - 2LL);
}

ll mfac[200000+1];

void initFac() {
    mfac[0] = mfac[1] = 1LL;
    for (int i = 2; i <= 200000; ++i) {
        mfac[i] = mfac[i - 1] * i % mod;
    }
}

// nPkを求める
ll perm(ll n, ll k) {
    if (k > n) throw "k must be less or equal than n";
    return mfac[n] * modinv(mfac[n - k]) % mod;
}

// nCkを求める
ll comb(ll n, ll k) {
    if (k > n) return 0LL;
    else return mfac[n] * modinv(mfac[k] * mfac[n - k]) % mod;
}

int main() {
    initFac();
    ll n; cin >> n;
    vector<ll> A(n);
    vector<ll> B(n + 1, -1);
    ll L;
    for (ll i = 0; i < n; ++i) {
        cin >> A[i];
        if (B[A[i]] >= 0) {
            L = i - B[A[i]] + 1LL;
        }
        B[A[i]] = i;
    }
    if (n == 1LL) {
        cout << 1 << endl;
        cout << 1 << endl;
    }
    else {
        cout << n << endl;
        for (ll k = 2; k <= n + 1; ++k) {
            ll ans = 0;
            ans += comb(n - 1LL, k);
            ans += comb(n - 1LL, k - 2LL);
            ans %= mod;
            ans += (2 * submod(comb(n - 1LL, k - 1LL), comb(n + 1LL - L, k - 1LL))) % mod;
            ans %= mod;
            ans += comb(n + 1LL - L, k - 1LL);
            ans %= mod;
            cout << ans << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 4728
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
string s;
char p = 'a';
int c = 0;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> s;
  ll ans = 0;
  FOR(i, 0, sz(s)){
    switch(s[i]){
      case 'A':
        if(p!='A') c = 0;
        p = 'A';
        c++;
        break;
      case 'B':
        if(p!='A'){
          p = 'A';
          c = 0;
        }
        p = 'B';
        break;
      case 'C':
        if(p=='B'){
          ans += c;
        }else{
          c = 0;
        }
        p = 'A';
        break;
      default:
        break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 720
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

#include <cstdio>

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define swap(a, b, type) { type _tmp = a; a = b; b = _tmp; }
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	string s;
	int K;
	map<int, vector<int> > ch;
	set<string> subs;
	set<string>::iterator it;
	string sub;

	for (char c = 'a'; c <= 'z'; c++) ch[c].push_back(-1);

	cin >> s >> K;

	rep(i, s.length()) {
		if (ch[s[i]][0] == -1) ch[s[i]].clear();
		ch[s[i]].push_back(i);
	}

	for (char c = 'a'; c <= 'z'; c++) {
		if (ch[c][0] == -1) continue;

		repc(i, 1, K) {
			if (ch[c][0] + i - 1 >= s.size()) break;
			rep(j, ch[c].size()) {
				if (ch[c][j] + i - 1 >= s.size()) continue;
				sub = s.substr(ch[c][j], i);
				subs.insert(sub);
			}
		}

		if (subs.size() >= K) break;
	}

	it = subs.begin();
	rep(i, K - 1) it++;

	cout << *it << endl;

	return 0;
}


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

public class Main {

	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long x = sc.nextLong();
		long[] a = new long[N];
		long sum = 0;
		for(int i=0;i<N;i++) {
			a[i] = sc.nextLong();
			sum += a[i];
		}
		Arrays.sort(a);

		if(sum < x) {
			System.out.println(N-1);
		}else if(sum == x) {
			System.out.println(N);
		}else {
			long asum = 0;
			for(int i=0;i<N;i++) {
				asum += a[i];
				if(asum > x) {
					System.out.println(i);
					break;
				}
			}
		}
	}
}

Measured memory_bytes: 23124
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] -= i + 1
A = sorted(A)
if N % 2:
    M = A[N // 2]
else:
    M = (A[N // 2 - 1] + A[N // 2]) // 2
S = 0
for i in range(N):
    S += abs(A[i] - M)
print(S)

Measured memory_bytes: 26708
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int ll;
typedef pair<ll,ll> Pi;
typedef tuple<ll,ll,ll> Tu;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const double PI=3.14151926535;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
const ll tMOD=(ll)998244353;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

ll n;
ll a[10010];
vector<ll> prime;
ll prime_check(){
    prime.push_back(2);
    for(int i=3;i<=1000;i++){
        int flag=1;
        for(int j=0;j<prime.size()&&prime[j]*prime[j]<=i;j++){
            if(i%prime[j]==0){
                flag=0;
                break;
            }
        }
        if(flag){
            prime.push_back(i);
        }
    }
}
ll p_fac[1001000]={};
int main(){
    cin>>n;
    prime_check();
    REP(i,n){
        cin>>a[i];
        ll t=a[i];
        for(int j=0;j<prime.size()&&t>=prime[j];j++){
            if(t%prime[j]==0){
                ll co=0;
                while(t%prime[j]==0){
                    co++;
                    t/=prime[j];
                }
                p_fac[prime[j]]=max(p_fac[prime[j]],co);
            }
        }
        if(t!=1)p_fac[t]=1;
    }
    vector<int> all_v;
    for(int i=0;i<1000001;i++){
        if(p_fac[i]){
            all_v.push_back(i);
            //cout<<i<<" "<<p_fac[i]<<endl;
        }
        
    }
    ll ans=0;
    for(int i=0;i<n;i++){
        ll t=a[i];
        ll t_ans=1;
        for(int j=0;j<all_v.size();j++){
            int co=0;
            while(t%all_v[j]==0){
                co++;
                t/=all_v[j];
            }
            for(int k=0;k<p_fac[all_v[j]]-co;k++){
                t_ans*=all_v[j];
                t_ans%=MOD;
            }
            //ans+=t_ans;
            //cout<<t_ans<<" "<<a[i]<<" "<<all_v[j]<<endl;
        }
        ans+=t_ans;
        ans%=MOD;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 6656
import math
n,h=map(int,input().split())
a_max=0
b_=[]
for i in range(n):
    a,b=map(int,input().split())
    b_.append(b)
    if a_max<a:
        a_max=a
ans=0
b_=sorted(b_,reverse=True)
for i in range(n):
    if a_max<b_[i]:
        ans+=1
        h-=b_[i]
        if h<=0:
            h=0
            break
print(ans+math.ceil(h/a_max))

Measured memory_bytes: 56408
use std::io::{ stdin, stdout, BufRead, Write };
use std::ops::{ Add, Sub, Mul };

const SP : u8 = b' ';
const LF : u8 = b'\n';

#[inline(always)]
fn atoui<T>(s: &[u8]) -> T
  where T: Add<Output=T> +
           Sub<Output=T> +
           Mul<Output=T> +
           Default +
           From<u8>
{
  let mut n = T::default();
  if s.len() == 0 {
    return n;
  }

  let mut i = 0;
  if s[i] == b'+' {
    i += 1;
  }

  for b in &s[i..] {
    n = (n * T::from(10)) + T::from(b - b'0');
  }

  n
}

fn main() {
  let stdin = stdin();
  let mut stdin = stdin.lock();

  let mut buf = Vec::with_capacity(500 * 2);
  let len = stdin.read_until(SP, &mut buf).unwrap();
  buf.truncate(len - 1);
  let h = atoui::<usize>(&buf);

  buf.clear();
  let len = stdin.read_until(LF, &mut buf).unwrap();
  buf.truncate(len - 1);
  let w = atoui::<usize>(&buf);

  // let mut ans = Vec::with_capacity(8 * h * w - 1);
  let mut ans = Vec::new();
  let mut n   = 0;

  let mut odd = 0;
  let mut x   = 0;
  let mut y   = 0;

  for i in 0..h {
    buf.clear();
    stdin.read_until(LF, &mut buf).unwrap();

    if i % 2 == 0 {
      for j in 0..w {
        if odd != 0 {
          writeln!(&mut ans, "{} {} {} {}", y + 1, x + 1, i + 1, j + 1).unwrap();
          n += 1;
        }
        odd ^= buf[j * 2] & 1;
        y = i;
        x = j;
      }
    } else {
      for mut j in 0..w {
        j = w - 1 - j;

        if odd != 0 {
          writeln!(&mut ans, "{} {} {} {}", y + 1, x + 1, i + 1, j + 1).unwrap();
          n += 1;
        }
        odd ^= buf[j * 2] & 1;
        y = i;
        x = j;
      }
    }
  }

  let stdout = stdout();
  let mut stdout = stdout.lock();
  writeln!(&mut stdout, "{}", n).unwrap();
  stdout.write(&ans).unwrap();
  stdout.flush().unwrap();
}


Measured memory_bytes: 8188
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = numeric_limits<ll>::max()/3;
const ll mod = 1e9 + 7;

int main(void){
  int m,d;
  cin >> m >> d;
  int res = 0;
  for(int i = 2;i < 10;++i){
    for(int j = 2;j < 10;++j){
      if(i * 10 + j <= d && i*j <= m){
        ++res;
      }
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
void main() {
	auto K = ri;
	long res;
	foreach(a; 1..K+1) foreach(b; 1..K+1) foreach(c; 1..K+1) {
		res += gcd(a,gcd(b, c));
	}
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 2692
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>

using namespace std;

long long int dp[101][100001];

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

    memset(dp,0,sizeof(dp));

    vector<int>w(n);
    vector<int>v(n);

    for(int i = 0;i < n;i++)
        cin >> w[i] >> v[i];
    
    for(int i = 0;i < n;i++){
        for(int j = 1;j <= W;j++){
            if(j >= w[i])
                dp[i+1][j] = max(dp[i][j-w[i]]+v[i],dp[i][j]);
            else 
                dp[i+1][j] = max(dp[i+1][j-1],dp[i][j]);
        }
    }


    cout << dp[n][W] << endl;

    return 0;
}

Measured memory_bytes: 79104
#include <iostream>

int main() {
	int w, h, x, y, r;
	
	std::cin >> w >> h >> x >> y >> r;
	
	if(w>=(x+r) && (x-r)>=0 && h>=(y+r) && (y-r)>=0) {
		std::cout << "Yes" << std::endl;
	} else {
		std::cout << "No" << std::endl;
	}
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
using namespace std;
struct ball
{
	int id;
	int num;
}q[200010];
int a[200010];
map<int,int> p;
bool cmp(ball a,ball b)
{
	return a.num<b.num;
}
int main()
{
	int n,m,i;
	cin>>n>>m;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		p[a[i]]=p[a[i]]+1;
	}
	map<int,int>::iterator it;
	i=1;
	for(it=p.begin();it!=p.end();it++)
	{
		q[i].id=it->first;
		q[i++].num=it->second;
	}
	int s=p.size();
	sort(q+1,q+1+s,cmp);
	int num=0;
	s-=m;
	for(i=1;i<=s;i++)
	{
		num+=q[i].num;
	}
	cout<<num;
	return 0;
}

Measured memory_bytes: 11904
#include "bits//stdc++.h"
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

#define rep(i,n) for (int i = 0; i < (n); i++)
#define ALL(v) v.begin(), v.end()
int a[100000];
vector<int> G[100000];
int in[100000];
int N, K;
int ans;
int solve(int v) {
	if (G[v].size() == 0) return 0;
	int ma = 0;
	for (int to : G[v]) {
		int t = solve(to) + 1;
		if (t == K && v > 0) {
			t = 0;
			ans++;
		}
		ma = max(ma, t);
	}
	return ma;

}
int main() {
	cin >> N >> K;
	rep(i, N) {
		cin >> a[i];
		a[i]--;
	}
	if (a[0] != 0) ans++;
	for (int i = 1; i < N; i++) {
		G[a[i]].push_back(i);
	}
	solve(0);
	cout << ans << endl;
}


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

return 0;

}

Measured memory_bytes: 1176
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#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 <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(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 FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 10;
const int MOD = 1000000007;

struct UnionFind {
	vi data;
	UnionFind(int size) : data(size, -1) {}
	bool unite(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool find(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int main() {
	int n, q;
	cin >> n >> q;
	UnionFind uf(n);

	int c, x, y;
	REP(i, q) {
		cin >> c >> x >> y;
		if (c == 0) {
			uf.unite(x, y);
		}
		else {
			cout << (uf.find(x, y)) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3144
#include <stdio.h>

int main(){
  int ret,s[200000];
  int count = 0,flag = 0;
  char c;
  while(1){
    ret = scanf("%c",&c);
    if(ret == EOF || c == '\n') break;
    if(c == 'A'){
      s[count] = 0;
      count++;
      flag = 0;
    }else if(c == 'B'){
      s[count] = 2;
      count++;
      flag = 1;
    }else if(flag == 0 && c == 'C'){
      s[count] = 3;
      count++;
    }else if(flag == 1 && c == 'C'){
      s[count-1] = 1;
      flag = 0;      //BCをまとめる
    }
  }
  s[count] = 10;
  int num, num_bc, prev = 0;
  long answer = 0;
  for(int i = 0; i < count; ++i){//AorBC連内の各Aの右に何個BCあるか
    if(s[i] == 2 || s[i] == 3 || i == count - 1){
      num = 0;
      num_bc = 0;
      for(int j = prev; j <= i; ++j){
        if(s[j] < 2) num++;
        if(s[j] == 1) num_bc++;
      }for(int j = prev; j <= i; ++j){
       // printf("%d\n",num_bc);
        if(s[j] == 0) answer += (long) num_bc;
        if(s[j] == 1) num_bc = num_bc - 1;
      }
      prev = i + 1;
    }
  }
  printf("%ld\n",answer);
  return 0;
}

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

int gcd(int x, int y){
    while(1){
        int r = x % y;
        if(r == 0) return y;
        x = y;
        y = r;
    }
}

int main(void){
    int x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;

    return 0;
}


Measured memory_bytes: 3088
#include <iostream>
#include <vector>
using namespace std;
int main() {
	int N, ans;
	ans = 0;
	cin >> N;
	vector<int> d(N);
	for (int i = 0; i < N; i++) {
		cin >> d[i];
	}
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			ans += (d[i] * d[j]);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
//                        DushtuBunny
//                        Rahul Halder    
//    Indian Institute of Engineering Science & Technology,Shibpur


#include <bits/stdc++.h>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll int64_t
#define f first
#define se second
#define LB lower_bound
#define UB upper_bound
#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define vi vector<int>
#define vc vector<char>
#define vpll vector<pair<ll,ll>>
#define pll pair<ll,ll>
const unsigned int MOD = 1000000007;

using namespace std;

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

    IOS;
    int T;
    // cin>>T;
    T=1;

    while(T--)
    {
        ll a,b,c,k;
        cin>>a>>b>>c>>k;
        ll ans = 0;
        if(k>a)
        {
            ans+=a;
            k-=a;
        } 
        else
        {
            ans+=k;
            k=0;
        }

        if(k>b)
            k-=b;
        else
            k = 0;

        if(k>c)
        {
            ans-=c;
            k-=c;
        }
        else
            ans-=k;
        cout<<ans;
    }
  
    return 0;
}

Measured memory_bytes: 3648
import java.util.Scanner;

class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());

		String U = sc.next();

		if(U.equals(S)) {
			System.out.println((A-1) + " "+ B);
		} else {
			System.out.println(A + " "+ (B-1) );
		}
	}
}

Measured memory_bytes: 22868
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		V = sc.nextInt();
		E = sc.nextInt();
		g = new ArrayList[V];
		for (int i = 0; i < V; ++i)
			g[i] = new ArrayList<>();

		for (int i = 0; i < E; ++i) {
			int s = sc.nextInt();
			int t = sc.nextInt();
			g[s].add(t);
		}

		vis = new boolean[V];
		ord = new int[V];

		topologialSort();

		for (int i = V - 1; i >= 0; --i) {
			System.out.println(ord[i]);
		}

	}

	static ArrayList<Integer>[] g;
	static boolean[] vis;
	static int V, E;
	static int[] ord;
	static int now = 0;

	static void topologialSort() {
		for (int i = 0; i < V; ++i) {
			if (!vis[i])
				dfs(i, -1);
		}
	}

	static void dfs(int cur, int pre) {
		for (int to : g[cur]) {
			if (!vis[to] && pre != cur)
				dfs(to, cur);
		}
		vis[cur] = true;
		ord[now++] = cur;
	}
}

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

#define ll long long

int main() {
    int H, W, h, w;
    scanf("%d%d", &H, &W);
    scanf("%d%d", &h, &w);
    printf("%d\n", H*W - w*H - h*W + h*w);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
  int n;
  cin>>n;
  rep(i,n){
    vector<int>a,b;
    int tmp;
    cin>>tmp;
    pb(a,tmp);
    rep(j,9){
      cin>>tmp;
      if(a[a.size()-1]<tmp)pb(a,tmp);
      else pb(b,tmp);
    }
    bool han=true;
    rep(j,b.size()-1)if(b[j]>b[j+1])han=false;
    if(han)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
}

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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
 
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
 
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
 
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

struct Prime {
    vector<int> p_list;
    vector<bool> memo;

    Prime (int N) : memo(N+1, true) {
        init(N);
    }

    void init(int N){
        memo[0] = false;
        if(1 <= N) memo[1] = false;
        if(N < 2) return;

        int idx = 2;
        while(idx <= N) {
            if(memo[idx]){
                p_list.push_back(idx);
                LL x = 2;
                while(idx * x <= N) {
                    memo[idx*x] = false;
                    x++;
                }
            }

            idx += (idx == 2 ? 1 : 2);
        }
    }

    bool isPrime(int i) {
        return memo[i];
    }
};

void solve(long long N){
    VI ans;

    Prime x(55555);
    int target = 11;
    REP(i, x.p_list.size()) {
        if(x.p_list[i] % 10 == 1) {
            ans.PB(x.p_list[i]);
        }

        if(ans.size() == N) break;
    }

    cout << ans[0];
    REP1(i, N) cout << " " << ans[i];
    cout << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define outl(x) cout<< (x) << '\n'
using pii = pair<int,int>;
using ll = long long;

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

    int N, M, Q;
    int cum[505][505] {};

    cin >> N >> M >> Q;
    rep(i, M) {
        int l, r;
        cin >> l >> r;
        ++cum[l][r];
    }

    for(int i=1; i<=N; ++i) {
        for (int j=1; j<=N; ++j) {
            cum[i][j] += cum[i-1][j] + cum[i][j-1] - cum[i-1][j-1];
        }
    }


    while (Q--) {
        int l, r;
        cin >> l >> r;
        int p = cum[r][r] - cum[r][l-1] - cum[l-1][r] + cum[l-1][l-1];
        outl(p);
    }

    return 0;
}



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

int dp[100];

//最大公約数
int gcd(int x, int y){
  if(x % y == 0) return 1;
  return gcd(y, x % y);
}
//最小公倍数
int lcm(int x, int y){
  return x * y / gcd(x, y);
}
//フィボナッチ数列
//配列dpを-1で初期化する
int fib(int n){
  if(n == 0 || n == 1) return dp[n] = 1;
  if(dp[n] != -1) return dp[n];
  return dp[n] = fib(n - 1) + fib(n - 2);
}
//階乗計算(factorial)
int fact(int n){
  if(n = 1) return 1;
  return n * fact(n - 1);
}
//累乗計算(Exponentiation)
//x**y
ll expo(int x, int y){
  ll ans = 1;
  rep(i, y){
    ans *= x;
  }
  return ans;
}
//桁数
int keta(ll x){
  if(x == 0) return 1;
  int res = 0;
  while(x){
    x /= 10;
    res++;
  }
  return res;
}


int main(){
  int a, b;
  cin >> a >> b;

  int high = 1;
  int c = b - a;
  REP(i, c){
    int d = i + 1;
    high += d;
  }
  cout << high - b << endl;
}


/*





















*/


Measured memory_bytes: 256
def get_min_max_sum(arr):
    array = sorted(arr)
    minimum = array[0]
    maximum = array[-1]
    s= sum(array)

    print( str(minimum) + " " + str(maximum) + " " + str(s))

if __name__ == "__main__":

    number = int(input())
    seq = input().split(" ")
    array = [int(a) for a in seq ]

    get_min_max_sum(array)



Measured memory_bytes: 6708
fun main(args: Array<String>) {
    a110(readLineList())
}

fun readLineList(): Array<String> {
    val lineList = mutableListOf<String>()
    while (true) {
        val line = readLine()
        if (line.isNullOrBlank()) {
            break
        } else {
            lineList.add(line!!)
        }
    }
    return lineList.toTypedArray()
}


fun a110(args: Array<String>) {
    println(when {
        args[0] == "1" -> "Hello World"
        args[0] == "2" -> args[1].toInt() + args[2].toInt()
        else -> IllegalArgumentException()
    })
}

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

#define ll long long

int main(){

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

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int n;
    ll d;
    cin>>n>>d;
    int ans=0;
    while(n--){
        ll a,b;
        cin>>a>>b;
        if(a*a+b*b<=d*d) ans++;
    }
    cout<<ans;
}

Measured memory_bytes: 3632
// Problem : C - Peaks
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std; 
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define INF LLONG_MAX
#define PI acos(-1)
const ll MOD = 1e9 + 7;
#define fir first
#define sec second
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(c,a,b) for(ll c=a;c<b;c++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define min_heap priority_queue<pll,vector<pll>,greater<pll> >
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> 
{
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {}
};
ll dx4[]={-1,1,0,0};
ll dy4[]={0,0,-1,1};
ll dx8[]={-1,-1,-1,0,1,1,1,0};
ll dy8[]={-1,0,1,1,1,0,-1,-1};
bool isvalid(ll x,ll y,ll n,ll m)
{
    return (x>=0 and y>=0 and x<n and y<m);
}
vector<bool> isprime;
vector<ll> prime;
void sievetoprime(ll n)
{
    isprime.resize(n+1,true);
    for(ll p=2;p*p<=n;p++)
    {
        if(isprime[p]==true)
        {
            for(ll i=p*p;i<=n;i+=p)
                isprime[i]=false;
        }
    }
    for(ll i=1;i<=n;i++)
    {
    	if(isprime[i])
    		prime.pb(i);
    }
}
ll lcm(ll a,ll b)
{
    return (a/__gcd(a,b))*b;
}
//Disjoint-Set Union-find algorithm
void initialize_disjoint_set(vector<ll> &arr,vector<ll> &size,ll n)
{
	for(ll i=0;i<n;i++)
    {
		arr[i] = i ;
		size[i] = 1;
	}
}
ll root(vector<ll> &arr,ll i)
{
    while(arr[i] != i)
    {
		i=arr[i]; 
    }
	return i;
}

void unione(vector<ll> &arr,vector<ll> &size,ll a,ll b)
{
    ll root_A = root(arr,a);
    ll root_B = root(arr,b);
    if(size[root_A] < size[root_B ])
    {
		arr[root_A] = arr[root_B];
		size[root_B] += size[root_A];
	}
    else
    {
		arr[ root_B ] = arr[root_A];
		size[root_A] += size[root_B];
	}	
}
// Vec<1,ll> v(n,0);
void solve()
{
    ll n,m;
    cin>>n>>m;
   	vector<ll> adj[n+1];
   	vector<ll> h(n+1,0);
   	rep(i,0,n)
   		cin>>h[i+1];
   	ll a,b;
   	rep(i,0,m)
   	{
   		cin>>a>>b;
   		adj[a].pb(b);
   		adj[b].pb(a);
   	}
   	ll cnt=0;
   	for(ll i=1;i<=n;i++)
   	{
   		cnt++;
   		for(auto j:adj[i])
   		{
   			if(h[j]>=h[i])
   			{
   				cnt--;
   				break;
   			}
   		}
   	}
   	cout<<cnt;
}
int main()
{
    ll inpoup = 0;
    if(inpoup==1)
    {
        #ifndef ONLINE_JUDGE
            freopen("input.txt","r",stdin);
            freopen("output.txt","w",stdout);
        #endif
    }
    IOS
    ll t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 9744