akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cmath>
#define rep(i,n) for(int i=0; i<n; i++)
#define loop(i, j, n) for(int i=j; i<n; i++)
using namespace std;
int main()
{
	int n;
	cin >> n;
	bool ans = false;

	loop(i, 0, 26){
		loop(j, 0, 15){
			if(n == 4*i + 7*j) ans = true;
		}
	}
	if(ans) puts("Yes");
	else puts("No");
	return 0;
}

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

using namespace std;

const int N = 100100;

vector<int> g[N];
int d[N][3];

int main() {
   ios_base::sync_with_stdio(false);
   int n, m;
   cin >> n >> m;
   for (int i = 1; i <= m; ++i) {
      int u, v;
      cin >> u >> v;
      g[u].push_back(v);
   }
   int s, t;
   cin >> s >> t;
   memset(d, -1, sizeof d);
   queue<pair<int, int>> q;
   d[s][0] = 0;
   q.emplace(s, 0);
   while (!q.empty()) {
      int u, r;
      tie(u, r) = q.front();
      q.pop();
      for (int v : g[u]) {
         int nr = (r + 1) % 3;
         if (d[v][nr] == -1) {
            d[v][nr] = d[u][r] + 1;
            q.emplace(v, nr);
         }
      }
   }
   if (d[t][0] == -1) {
      cout << -1;
   } else {
      cout << d[t][0] / 3 << "\n";
   }
}


Measured memory_bytes: 6912
#include <stdio.h>
//#include<stdlib.h> 
struct Node{
  int p;
  int l;
  int r;
};

struct Node N[25];
 
 
void preOrder(int u){
  if(u==-1) return;//not root
  printf(" %d",u);
  preOrder(N[u].l);
  preOrder(N[u].r);
}
 
void inOrder(int u){
  if(u==-1) return;
  inOrder(N[u].l);
  printf(" %d", u);
  inOrder(N[u].r);
}
 
void postOrder(int u){
  if(u==-1) return;
  postOrder(N[u].l);
  postOrder(N[u].r);
  printf(" %d",u);
}
 
int main(){
  int i, id, l, r, n, root;
  scanf("%d", &n);
  for(i=0; i<n; i++){
    N[i].p=-1;
  }
  for(i=0; i<n; i++){
    scanf("%d %d %d",&id, &l, &r);
    N[id].l=l;
    N[id].r=r;
    if(!(l==-1)) N[l].p=id;
    if(!(r==-1)) N[r].p=id;
  }
  for(i=0; i<n; i++){
    if(N[i].p==-1){
      root=i;
    }
  }
  printf("Preorder\n");
  preOrder(root);
  printf("\n");
  printf("Inorder\n");
  inOrder(root);
  printf("\n");
  printf("Postorder\n");
  postOrder(root);
  printf("\n");
   
  return 0;
}
    

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

int main(){
    int row,column;
    cin >> row >> column;
    int sheet[101][101] = {};
    for(int i = 0; i < row; i++){
        int temp = 0;
        for(int j = 0; j < column; j++){
             cin >> sheet[i][j];
             temp += sheet[i][j];
         }
         sheet[i][column] = temp;
    }

    for(int i = 0; i < column; i++){
        int temp = 0;
        for(int j = 0; j < row; j++){
            temp += sheet[j][i];
        }
        sheet[row][i] = temp;
        sheet[row][column] += temp;
    }

    for(int i = 0; i < row + 1; i++){
        for(int j = 0; j < column + 1; j++){
            if(j == column) cout << sheet[i][j];
            else cout << sheet[i][j] << " ";
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3144
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B , C , D;
  cin >> A >> B >> C >> D;
 
  if (A+B > C+D) {
    cout << "Left" << endl;
    }else if (A+B == C+D) {
    cout << "Balanced" << endl;
    }else if(A+B < C+D){
    cout << "Right" << endl;
  }
 
}

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

int main(void) {
    int K, A, B;
    std::cin >> K >> A >> B;
    bool flag = false;
    for (int x = A; x <= B; ++x) {
        if (x % K == 0) {
            flag = true;
            break;
        }
    }
    printf("%s\n", flag ? "OK" : "NG");

    return 0;
}


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

using namespace std;
using ll = long long int;
using ull = unsigned long long int;
#define vll vector<ll>

#define FOR(i, b, e) for(int i = (b); i < (e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define REV(v) reverse((v).begin(), (v).end())
#define IN(v) cin >> (v);
#define VIN(v, n) REP(i, n) cin >> v[i];
#define OUT(v) cout << (v) << endl;
#define YN(b) OUT((b) ? "YES" : "NO")
#define Yn(b) OUT((b) ? "Yes" : "No")
#define yn(b) OUT((b) ? "yes" : "no")

const ll MOD = 1000000007;

ll n, m, q, ms = 0;
ll a[51][4];

ll check(vector<ll> c) {
  ll s = 0;
  REP(i, q) {
    if (c[a[i][1] - 1] - c[a[i][0] - 1] == a[i][2]) s += a[i][3];
  }
  return s;
}

void f(vector<ll> c) {
  if (c.size() == n) {
    ms = max(check(c), ms);
  } else {
    ll s = (c.size() != 0 ? c[c.size() - 1] : 1);
    FOR(i, s, m + 1) {
      c.push_back(i);
      f(c);
      c.pop_back();
    }
  }
}

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

  cin >> n >> m >> q;
  REP(i, q) cin >> a[i][0] >> a[i][1] >> a[i][2] >> a[i][3];

  vector<ll> c;
  f(c);

  cout << ms << endl;
  return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
// Welcome to my source code!

const ll INF = 1LL<<60;

int main() {
    int n;
    cin >> n;
    ll h[n];
    for (int i = 0; i < n; i++) cin >> h[i];
    ll dp[101000];
    for (int i = 0; i < 101000; i++) dp[i] = INF;
    dp[0] = 0;
    for (int i = 1; i < n; i++) {
        chmin(dp[i], dp[i-1] + abs(h[i] - h[i-1]));
        if (i > 1) chmin(dp[i], dp[i-2] + abs(h[i] - h[i-2]));
    }
    cout << dp[n-1] << endl;
}

Measured memory_bytes: 1792
import java.util.*;

class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Set<String> dict = new HashSet<>();
		
		for (int i = 0; i < n; i++) {
			String op = sc.next();
			String val = sc.next();
			
			if (op.equals("insert")) {
				dict.add(val);
			} else if (dict.contains(val)) {
				System.out.println("yes");
			} else  {
				System.out.println("no");
			}
			
		}
		
		
		
	}
}


Measured memory_bytes: 253092
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

ll gcd(ll a, ll b) {
    if(a < b){
        return gcd(b, a);
    }
    ll r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

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

void solve(long long N, long long M, std::vector<long long> a){
    vector<ll> b(N);
    REP(i, N){ b.at(i) = a.at(i) / 2; }
    ll l = 1;
    REP(i, N){
        l = lcm(l, b.at(i));
        if(l > M){
            cout << 0 << endl;
            return;
        }
    }
    REP(i, N){
        if((l / b.at(i)) % 2 == 0){
            cout << 0 << endl;
            return;
        }
    }
    ll ans = ((M / l) + 1) / 2;
    cout << ans << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    solve(N, M, std::move(a));
    return 0;
}


Measured memory_bytes: 1792
#include<cstdio>
typedef long long ll;
const int mod=1000000007;
int f[1000050],g[1000050],s[1000050];
int main(){
	int n,h,d,p,i;
	scanf("%d%d%d",&n,&h,&d);
	f[0]=f[1]=1;
	for(i=2;i<=n;++i)f[i]=(ll)f[i-1]*i%mod;
	p=2;
	for(i=2;i<=n;++i)p=(p+f[i])%mod;
	s[1]=g[1]=f[n];
	for(i=2;i<=d;++i)s[i]=(s[i-1]+(g[i]=(ll)g[i-1]*p%mod))%mod;
	for(i=d+1;i<=h;++i){
		g[i]=(ll)(s[i-1]-s[i-d-1]+mod)*(p-1+mod)%mod;
		s[i]=(s[i-1]+g[i])%mod;
	}
	printf("%d\n",g[h]);
	return 0;
}

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

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

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

    vi v(n);

    for(auto& x : v) cin >> x;

    int abs_ma = 0;
    int ma = 0;
    int ma_ndx = 0;

    for(int i = 0; i < n; i++) if(abs(v[i]) >= abs_ma)
    {
        abs_ma = abs(v[i]);
        ma = v[i];
        ma_ndx = i + 1;
    }

    vvi ans;

    if(ma > 0)
    {
        ans.push_back({ma_ndx, 1});
        ans.push_back({ma_ndx, 1});

        for(int i = 2; i <= n; i++)
        {
            ans.push_back({i - 1, i});
            ans.push_back({i - 1, i});
        }
    }
    else
    if(ma < 0)
    {
        ans.push_back({ma_ndx, n});
        ans.push_back({ma_ndx, n});

        for(int i = n - 1; i >= 1; i--)
        {
            ans.push_back({i + 1, i});
            ans.push_back({i + 1, i});
        }
    }

    cout << ans.size() << endl;

    for(auto& e : ans) cout << e[0] << ' ' << e[1] << endl;

    /* debug
    for(auto& e : ans)
    {
        v[e[1] - 1] += v[e[0] - 1];
    }

    for(auto x : v) cout << x << ' '; cout << endl;
    */

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct c{
  string name;
  int sc;
  int ind;
  bool operator < (const c&  cc){
  if(name!=cc.name)return name<cc.name;
    else{
      return sc>cc.sc;
  }
}
}q[105];
int main(){
  int n;
  cin>>n;
  int s;
  string nm;
  for(int i=0;i<n;i++){
  cin>>nm;
    cin>>s;
    q[i].name=nm;
    q[i].sc=s;
  q[i].ind=i;

  }
  sort(q,q+n);
  for(int i=0;i<n;i++){
  cout<<q[i].ind+1<<endl;

  }




}


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

int main () {
  string s ;
  cin >> s ;
  if ( s == "hi" ||s== "hihi" || s=="hihihi" || s=="hihihihi" ||s=="hihihihihi")
    cout <<"Yes" << endl ;
  else cout <<"No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int n, m;

int main(){
  while(scanf("%d", &n) && n){
    map<string, string>convert;
    string a, b;
    rep(i, n){
      cin >> a >> b;
      convert[a] = b;
      //      cout << convert[a] << endl;
    }
    //    printf("map size %d\n", (int)convert.size());
    string res = "";
    scanf("%d", &m);
    rep(i, m){
      cin >> a;
      if(convert.find(a) != convert.end()) a = convert[a];
      res += a;
    }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 1376
#include <bits/stdc++.h>
const long long INF = 1LL << 60;
using namespace std;

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

    vector<long long> h(N);
    for (int i = 0; i < h.size(); ++i) cin >> h[i];

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

    long long ans = INF;
    for (int i = 0; i < h.size() - (K - 1); ++i) ans = min(ans, h[i+(K-1)] - h[i]);

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
R, G, B, N = map(int, input().split())
ans = 0
for i in range(int(N/R) + 1):
    for j in range(int(N/G) + 1):
        tmp = int((R * i) + (G * j))
        if N >= tmp and (N - tmp) % B == 0:
            ans += 1
print(ans)

Measured memory_bytes: 40940
#include <iostream>
#include <vector>
using namespace std;
using P = pair<int, int>;

void dfs(vector<vector<int>>& G, vector<bool>& isvisit, int start, P excludeEdge){
    if(isvisit[start]) return;
    else isvisit[start] = true;
    for(int i = 0; i < G[start].size(); i++){
        if((start == excludeEdge.first && G[start][i] == excludeEdge.second) ||
        (start == excludeEdge.second && G[start][i] == excludeEdge.first)) continue;
        dfs(G, isvisit, G[start][i], excludeEdge);
    }
}

int main(){
    int n, m;
    cin >> n >> m;
    vector<P> E(m);
    vector<vector<int>> G(n+1);
    for(int i = 0; i < m; i++){
        int s, t;
        cin >> s >> t;
        E[i] = make_pair(s, t);
        G[s].push_back(t);
        G[t].push_back(s);
    }

    int ans = 0;
    for(int i = 0; i < m; i++){
        vector<bool> isvisit(n+1, false);
        dfs(G, isvisit, 2, E[i]);
        bool islinking = true;
        for(int i = 1; i <= n; i++){
            if(!isvisit[i]) islinking = false;
        }
        if(!islinking) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3640
fun main(args: Array<String>) {
    val (N, W) = readLine()!!.split(" "). map { it.toInt() }
    val INIT = 2000000000L
    val SIZE = 1000001
    var dp = LongArray(SIZE) {INIT}
    dp[0] = 0
    val w = IntArray(N+1)
    val v = IntArray(N+1)
    for(i in 0 until N) {
        val a = readLine()!!.split(" "). map { it.toInt() }
        w[i] = a[0]
        v[i] = a[1]
    }

    for (i in 0 until N) {
        val dp2 = dp.clone()
        for (j in SIZE-1 downTo v[i]) {
            if (dp[j-v[i]] == INIT) continue
            if (dp[j -v[i]] + w[i] > W) continue
            dp2[j] = Math.min(dp2[j], dp[j - v[i]] + w[i])
        }
        dp = dp2
    }
    for (i in (SIZE-1) downTo 0) {
        if (dp[i] <= W) {
            println(i)
            return
        }
    }
}

Measured memory_bytes: 232112
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + end + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  if(N % 2 == 1){
    myout((Math.floor(N / 2) + 1) / N);
  }else{
    myout(0.5);
  }
}

Measured memory_bytes: 31108
#include <stdio.h>
#include <math.h>
int main(void){
    double x1,y1,x2,y2;
    double t;
    scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
    t=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
    printf("%f\n",t);
}

Measured memory_bytes: 1804
#include <stdio.h>

int main(void) {
    char s[3];
    char t[3];
    int ct = 0;

    scanf("%s", s);
    scanf("%s", t);

    for (int k = 0; k < 3; k++) {
        if (s[k] == t[k]) {
            ct++;
        }
    }
    printf("%d\n", ct);

    return 0;

}

Measured memory_bytes: 128
#include <stdio.h>
int main ()
{
  int A,B,C;
  
  scanf("%d %d",&A,&B);

  if((B-1)%(A-1)==0)
  {
   C=(B-1)/(A-1);
  }
  else
  {
    C=(B-1)/(A-1)+1;
  }
  
  printf("%d",C);
  
  return 0;
}

Measured memory_bytes: 128
S = list(map(str, input()))

cnt = 0

for i in range(len(S)-1):
    if S[i] == S[i+1]:
        cnt += 1

        if S[i+1] == "1":
            S[i+1] = "0"
        else:
            S[i+1] = "1"

print(cnt)


Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //int:2*10**9
typedef long double ld;
#define REP(i,n) for(ll i = 0; i<(ll)(n); i++)
#define REPS(i,n) for (ll i = 1; i<=(ll)(n); i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define vec2(name,i,j) vector<vector<ll>> name(i,vector<ll>(j))
#define vec2f(name,i,j,k) vector<vector<ll>> name(i,vector<ll>(j,k))
#define vec3(name,i,j,k) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k)))
#define vec3f(name,i,j,k,l) vector<vector<vector<ll>>> name(i,vector<vector<ll>>(j,vector<ll>(k,l)))
#define pb push_back
#define MOD 1000000007
#define MOD2 998244353
#define PI 3.141592653
#define INF 100000000000000 //14
//cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

ll bitcnt(ll x){
    ll y = 0;
    REP(i,18)if((x>>i)%2) y++;
    y%=2;
    return y;
}

int main(){
    vec2f(D,51,51,0);
    FOR(i,0,50) D[i][0]=D[i][i]=1;
    FOR(i,1,50)FOR(j,1,50){
        if (i>=j) D[i][j]=D[i-1][j-1]+D[i-1][j];
    }
    ll n, k, s, t; cin >> n >> k >> s >> t;
    vector<ll> lim(18);
    vector<ll> aa(n);
    REP(i,n) cin >> aa[i];
    REP(i,18){
        if ((s>>i)%2&&(t>>i)%2) lim[i]=1;
        else if (1-(s>>i)%2&&(t>>i)%2) lim[i]=2;
        else if (1-(s>>i)%2&&1-(t>>i)%2) lim[i]=0;
        else{
            cout << 0 << endl;
            return 0;
        }
    }
    vector<ll> a;
    REP(i,n){
        bool jud = true;
        REP(j,18){
            if (lim[j]==1&&1-(aa[i]>>j)%2) jud = false;
            if (lim[j]==0&&(aa[i]>>j)%2) jud = false;
        }
        if (jud) a.pb(aa[i]);
    }
    n=a.size();
    ll ans = 0;
    //cout << ans << endl;
    FOR(i,1,(1<<18)-1){
        bool jud = true;
        REP(j,18) if((i>>j)%2&&lim[j]!=2) jud = false;
        if (jud==false) continue;
        ll ansc = 0;
        vector<ll> am(n);
        REP(j,n) am[j]=i&a[j];
        sort(am.begin(),am.end());
        ll cnt = 0;
        /*if (i<=10){
            REP(j,am.size()) cout << am[j] << " ";
            cout << endl;
        }*/
        while(cnt<n){
            ll ind = upper_bound(am.begin(),am.end(),am[cnt])-am.begin();
            FOR(j,1,min(ind-cnt,k)) ansc+=D[ind-cnt][j];
            cnt = ind;
        }
        /*if (i<=10) cout << i << " " << ansc << endl;*/
        if (bitcnt(i)) ans-=ansc;
        else ans+=ansc;
    }
    FOR(i,1,k) ans+=D[n][i];
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3668
#include<cstdio>
#include<set>
#include<algorithm>
#include<iostream>
#define ll long long
using namespace std;
int n;
ll a[200001];
multiset<ll>s;
ll inv(ll x)
{
    ll t=1;
    while(t<=x) t<<=1;
    return t-x;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
    sort(a+1,a+1+n);
    int ans=0;
    for(int i=n;i>=1;i--)
    {
        const auto& f=s.find(a[i]);
        if(f!=s.end()) ans++,s.erase(f);
        else s.insert(inv(a[i]));
    }
    printf("%d\n",ans);
}


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


int main()
{
    vector<int> a{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin >> k;
    cout << a[k - 1] << endl;
    return 0;
}


Measured memory_bytes: 256
# array = [*1..q].map { |_| gets.split.map(&:to_i) }
# n = gets.split.map(&:to_i)
# a = [*1..m].repeated_combination(n).to_a


n = gets.to_i


a = n % 10

if a == 0 || a == 1 || a == 6 || a == 8
  puts "pon"
elsif a == 3
  puts "bon"
else
  puts "hon"
end


Measured memory_bytes: 14272
#include<iostream>
#include<cmath>

#define loi long int

using namespace std;

// Problem https://atcoder.jp/contests/abc046/tasks/abc046_b

loi solver(int BALLNUM,int PENKINUM){
    loi result;
    result = 1;
    result = PENKINUM * pow(PENKINUM-1,BALLNUM-1);
    return result;
}

int main(void){
    loi answer;
    answer = 0;
    int N,K;
    cin >> N >> K;
    answer = solver(N,K);
    cout << answer << endl;
    return 0;
}

Measured memory_bytes: 384
def ascan; gets.split.map(&:to_i); end

def no; puts "WA"; exit 0; end

s = gets.chomp

no unless s[0] == 'A'
no unless s[2..-2].chars.count('C') == 1
no unless s.chars.map{|e| ('A'..'Z').include?(e)}.count(true) == 2

puts "AC"

Measured memory_bytes: 3836
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <queue>
#include <map>
#include <set>
using namespace std;
using Int = int64_t;
const Int INF = 1<<30;
const Int MOD = (Int)1e9 + 7;
const Int MAX_N = (Int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

void solve()
{
    int h1, m1, h2, m2, k; cin >> h1 >> m1 >> h2 >> m2 >> k;
    h1 *= 60;
    h2 *= 60;
    int ans = 0;
    int a = h1 + m1;
    int b = h2 + m2 - k;
    for(int i = a; i < b; i++)
    {
        ans++;
    }
    cout << ans << endl;
}

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#include<string.h>
using namespace std;
#define MOD 1000000007
#define MAX 105
#define MAX_NUM 300001
char s[MAX];
int main()
{
    double L;
    scanf("%lf",&L);
    L=L/3;
    double V=L*L*L;
    printf("%.9f",V);
    return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>

int main(){
    int n,i,j;
    int a[100];
    double sum=0;

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


    for(i=0;i<n;i++){
        sum+=(double)1/a[i];
    }



    printf("%f\n",(double)1/sum);

    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define inf1 1e18+1
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(a>b)swap(a,b);if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n;
	cin>>n;
	ll a[n];
	rep(i,n){cin>>a[i];}
	multiset<ll>ms;
	for(int i=0;i<n;i++){
		auto it=ms.lower_bound(a[i]);
		if(it==ms.begin()){
			ms.insert(a[i]);
		}
		else{
			it--;
			ms.erase(it);
			ms.insert(a[i]);
		}
	}
	cout<<ms.size();
}
int main()
{
	waste;
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int main()
{
	ll a,b,i,j,k;
	string s1,s2;
	cin>>a>>b;
	ll g=__gcd(a,b);
	ll l=(a*b)/g;
	cin>>s1>>s2;
	if (l==max(a,b)||s1[0]!=s2[0])
	cout<<-1<<endl;
	else if (g==1)
	cout<<l<<endl;
	else
	{
		int A=a,B=b,p=0;
		a/=g;
		b/=g;
		for (i=0;i*min(a,b)<min(A,B)&&i*max(a,b)<max(A,B);i++)
		{
			if (s1[a*i]!=s2[b*i])
			{
				cout<<-1<<endl;
				p=1;
				break;
			}
		}
		if (p==0)
		cout<<l<<endl;
	}
}

Measured memory_bytes: 512
/**
 * @author torith
 * @date 2018-12-22
 */

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    string a; cin >> a;
    int ans = 0;
    for (int i = 0; i < a.size(); ++i) {
        if(a[i] == '2') ans++;
    }
    cout << ans << "\n";


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fast                                                                   \
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define ff(i, n) for (int i = 1; i <= n; i++)
#define F first
#define S second
#define pii pair<int,int>
#define sz size()
#define all(v) v.begin(),v.end()
#define pb push_back
#define pf push_front    
#define PB pop_back
#define pll pair<long long, long long>
#define vl vector<int>
#define mp make_pair
#define mod 1000000007
typedef unsigned long long ull;
const int N = 200005;
const int MOD = 998244353 ;



void solve(){
    string s;
    cin>>s;
    if(s == "SUN")cout<<"7";
    if(s == "MON")cout<<"6";
    if(s == "TUE")cout<<"5";
    if(s == "WED")cout<<"4";
    if(s == "THU")cout<<"3";
    if(s == "FRI")cout<<"2";
    if(s == "SAT")cout<<"1";
}


int32_t main() {
    fast
    int t;
    t = 1;
    //cin >> t;
    while(t--)solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll          long long int
#define pb          push_back
#define pll         pair<ll,ll>
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod         1000000007
#define inf         1000000000000000000LL
#define vl          vector<ll>
#define F           first
#define S           second
#define db          long double
#define sz(x)       (ll)x.size()
#define fix(n)      cout<<fixed<<setprecision(n)
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define all(x)      x.begin(),x.end()
#define mset(x)     memset(x,0,sizeof x)
#define pi          3.14159265


const int N = 1e5+5;
ll n,a[N];


void solve()
{
       cin>>n;
       ll ans=0, prv=0;
       while(n--)
       {
              ll x;
              cin>>x;
              if(x==0) { prv=0;  continue; }
              x += prv;
              ans += x/2;
              prv = x%2;
       }
       cout<<ans;    
}


int main()
{
    speed_up
    ll T=1;
    //cin>>T;
    while(T--)
        solve();
    return 0;
}


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

int func(int n){
  if(n%2==0) return n/2;
  else return 3*n+1;
}

int main() {
  int N; cin>>N;
  vector<int> v(N);
  rep(i,N) cin>>v[i];
  sort(v.begin(),v.end());
  int sum=0;
  rep(i,N){
    if(i!=N-1) sum+=v[i];
    else sum+=v[i]/2;
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    if (a + b == 15) {
        cout << "+" << endl;
    } else if (a * b == 15) {
        cout << "*" << endl;
    } else {
        cout << "x" << endl;
    }
}


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

int main() {
  int N;
  string A;
  cin >>  A;
 N=700;
  for(int i=0;i<A.size();i++){
  if (A[i]=='o') {
    N+=100;
  }
  }
  cout << N<<endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    ll i, j;
    i = 0;
    j = 0;
    ll ans = 0;
    ll tmp = A[0];
    while(i < N){
        if((j < N-1) && ((tmp & A[j+1]) == 0)){
            j++;
            tmp += A[j];
        }
        else{
            ans += j-i+1;
            tmp -= A[i];
            i++;
        }
    }

    printf("%lld\n", ans);


}

Measured memory_bytes: 4840
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

ll A[200010];
int main()
{
	int N;
	cin >> N;
	ll ans = 0;
	for (int i = 0; i < N; i++) cin >> A[i];
	map<ll, ll> mp;
	for (int i = 0; i < N; i++) {
		ll num = i - A[i];
		ans += mp[num];
		mp[(ll)i + A[i]]++;
		//cout << ans << endl;
	}
	cout << ans << endl;
}

Measured memory_bytes: 27800
import copy

N = int(input())
A = [int(input()) for _ in range(N)]

first = 0
second = 0

aa = copy.deepcopy(A)
aa.sort()

for a in aa:
    if a >= first:
        second = first
        first = a

for a in A:
    if a == first:
        print(second)
    else:
        print(first)


Measured memory_bytes: 19280
def check(st) :  
    n = len(st) 
    digitSum = 0
      
    for i in range(0,n) : 
        digitSum = digitSum + (int)(st[i])
    return (digitSum % 9 == 0) 
st=input()
if (check(st)):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9224
#include <bits/stdc++.h>
using namespace std;
template<class T, class U> inline bool chmax(T& a,U b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class U> inline bool chmin(T& a,U b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int N, a, b;
    cin >> N >> a >> b;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    
    int ans = 0;
    if (N == 1) ans = abs(b - A[0]);
    else ans = max(abs(A[N-1] - b), abs(A[N-2] - A[N-1]));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int a,b,c,k,ans;
 
int main(){
	cin >> a >> b >> c >> k;
  
  	if (k<=a){
      cout << k << endl;
  	  return 0;
	}
	
  	if (k>a && k<=a+b){
      cout << a << endl;
  	  return 0;
	  }
	
  	cout << a+(a+b-k) << endl;
}

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

typedef long long ll;

struct point { 
    ll x, y; int i; 
    point() {}
    point(ll x, ll y) : x(x), y(y) {}
};

int compare(ll d1, ll d2)
{
    if(d2 - d1 > 0) return -1;
    if(d1 - d2 > 0) return 1;   
    return 0;
}

int turn(point p, point q, point r)
{
    ll result = (r.x - q.x) * (p.y - q.y) - (r.y - q.y) * (p.x - q.x);
    return compare(result, 0); 
}

bool cw(point p, point q, point r)
{
    return turn(p, q, r) < 0;
}

bool cmp(point p1,point p2)
{
    return p1.x < p2.x || (p1.x == p2.x && p1.y < p2.y);
}

vector<point> convexHull(vector<point> P)
{
    int n = (int)P.size(), k = 0;
    vector<point> H(2 * n);
    sort(P.begin(), P.end(),cmp);
    for(int i = 0; i < n; i++)   
    {
        while(k >= 2 && cw(H[k - 2], H[k - 1], P[i])) k--;
        H[k++] = P[i];
    }
    for(int i = n - 2, t = k + 1; i >= 0; i--) 
    {
        while(k >= t && cw(H[k - 2], H[k - 1], P[i])) k--;
        H[k++] = P[i];
    }
    H.resize(k); H.pop_back(); 
    return H;
}

// dot product 
ll dot(point p, point q) { return p.x * q.x + p.y * q.y; }
// modulo^2 de un punto (distance to origin)
double norm2(point p) { return p.x * p.x + p.y * p.y; }


double angle(point a, point o, point b) // angle AOB (radians)
{
   point u(a.x - o.x, a.y - o.y); // u: vector oa
   point v(b.x - o.x, b.y - o.y); // v: vector ob
   return acos(dot(u,v) / sqrt(norm2(u) * norm2(v))); // dot product
}


int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(10);
    int n,m;
    double ans[105];
    vector<point> p,h;
    while(cin >> n)
    {
        p = vector<point>(n);
        for(int i = 0; i < n; i++)
        {
            cin >> p[i].x >> p[i].y;
            p[i].i = i;
        }
        h = convexHull(p);
        m = h.size();
        for(int i = 0; i < n; i++)
            ans[i] = 0;
        for(int i = 0; i < m; i++)
            ans[h[i].i] = (M_PI - angle(h[(i-1+m)%m], h[i], h[(i+1)%m])) / (2*M_PI);
        for(int i = 0; i < n; i++)
            cout << ans[i] << '\n';
    }
    return 0;
} 

Measured memory_bytes: 256
H,W,K,*s = open(0).read().split()
H = int(H)
W = int(W)
K = int(K)
ans = [[0] * W for _ in range(H)]
using = 0
unpainted = -1
for i in range(H):
    appeared = -1
    for j in range(W):
        if s[i][j] == '#':
            if appeared < 0:
                appeared = 1
                using += 1
                for k in range(j+1):
                    ans[i][k] = using
            else:
                using += 1
                ans[i][j] = using
        else:
            if appeared > 0:
                ans[i][j] = using
    if appeared < 0:
        if using > 0:
            ans[i] = ans[i-1]
        else:
            unpainted += 1
if unpainted >= 0:
    for i in range(unpainted,-1,-1):
        ans[i] = ans[i+1]
for x in ans:
    print(*x)


Measured memory_bytes: 75872
#include<cmath>
#include<cstdio>
#include<iostream>
using namespace std;
int n,x,p,ans;
int gcd(int a,int b){
	if(a<b) swap(a,b);
	if(b==0) return a;
	else return gcd(b,a%b);
}
int read(){
	int x=0,f=1;char c=getchar();
	for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
	for(;c>='0'&&c<='9';c=getchar()) x=(x<<3)+(x<<1)+c-'0';
	return x*f;
}
int main(){
	n=read();x=read();p=read();
	ans=abs(x-p);
	while(--n){
		p=read();
		ans=gcd(ans,abs(x-p));
	}
	printf("%d",ans);
	return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin >> n;
    
    vector <int> previous(n+1);
    vector <int> answer(n+1, 0);
    previous[1] = -1;
    for (int i=2; i<=n; i++){
        cin >> previous[i];
        int now = previous[i];
        answer[now]++;
        
    }
    
    for (int i=1; i<=n; i++){
        cout << answer[i] << endl;
    }
}

Measured memory_bytes: 4712
#include <bits/stdc++.h>
#define ll long long

using namespace std;

bool compare(int i,int j)
{
    return i>j;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll A, B, C, D;
    cin>>A>>B>>C>>D;

    ll P = (C*D)/__gcd(C, D);
    A--;
    ll solution = (B/C-A/C)+(B/D-A/D)-(B/P-A/P);
    cout<<(B-A)-solution;



    return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main()
{
    int n;
    long long int ans=0;
    vector<int> b(100000);
    vector<int> a(100000);

    cin>>n;
    for(int i=0;i<n-1;i++){
        cin>>b[i];
    }
    a[0]=b[0];
    a[n-1]=b[n-2];
    for(int i=1;i<n-1;i++){
        if(b[i]>b[i-1]){
            a[i]=b[i-1];
        }
        else{
            a[i]=b[i];
        }
    }
    for(int i=0;i<n;i++){
        //cout<<a[i]<<endl;
        ans+=a[i];
    }
    cout<<ans<<endl;
}

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

typedef long long ll;

///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Macro Start-*-*-*-*-*-*-*--*-*-*-*-*/

#define Faster_IO              ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F                      first
#define S                      second
#define pb                     push_back
#define MP                     make_pair
#define sf                     scanf
#define pf                     printf
#define gcin(a)                getline(cin,a);
#define pi                     (2*acos(0))
#define MAX(a,b)               (a>b? a:b)
#define MIN(a,b)               (a<b? a:b)
#define circle_area(r)         (pi*r*r)
#define triangle_area(b,h)     (0.5*b*h)
#define trapezium_area(a,b,h)  (0.5(a+b)*h)
#define ellipse_area(a,b)      (pi*a*b)
#define sector_area(r,angle)   (0.5*r*r*angle)
#define to_radian(degree)      ((pi/180)*degree)
#define to_degree(radian)      ((180/pi)*radian)
#define SQ(a)                  (a)*(a)
#define SORT(x)                sort(x.begin(),x.end())
#define SetPrint(a,x)          cout<<fixed<<setprecision(x)<<a<<endl
#define READ(x)                freopen(x,"r",stdin)
#define show(vec)              for (auto it = vec.begin(); it != vec.end(); it++)cout << *it << " ";

///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Macro END-*-*-*-*-*-*-*--*-*-*-*-*/

///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Template Start-*-*-*-*-*-*--*-*-*-*-*/

//template <class T> T isPrime(T n){if(n<=1)return 0;for(long long i=2;i*i<=n; i++)if(n%i==0)return 0;return 1;}
//template <class T> T bigmod(T X, T n, T M) {if (n==0) return 1;if (n%2) return ((X%M) * bigmod(X,n-1,M)) %M;else {long long int d = bigmod(X,n/2, M);return ((d%M) * (d%M))%M;}}

///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Template END-*-*-*-*-*-*-*--*-*-*-*-*/



using namespace std;
int main()
{
    string str;
    cin >> str;

    (str[2]==str[3] and str[4]==str[5])? cout <<"Yes" << endl : cout <<"No" << endl;




    return 0;
}



Measured memory_bytes: 256
#include <algorithm> 
#include <iostream>
#include <string.h>
#include <stdio.h>
using namespace std;

const int N = 200000 + 10;
int n, m;
int a[N];
int mmax = -1;
int sum;

int main() {
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
		cin >> a[i];

	for (int i = 1; i <= m; i++) {
		sum += a[i];
	}

	mmax = sum;

	int k = 1;
	for (int i = m+1; i <= n; i++, k++) {
		sum = sum - a[k] + a[i];
		//cout << a[k] << " " << a[i] << endl;
		mmax = max(mmax, sum);
	}

	double d;
	d = mmax;

	printf("%.12lf", (d + m) / 2);

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	string s;
	cin >> s;
	map<char, int> ct;
	for (auto ch : s) ct[ch]++;

	if ((ct['N'] * ct['S'] == 0) && (ct['N'] + ct['S'] > 0)) cout << "No\n";
	else if ((ct['E'] * ct['W'] == 0) && (ct['E'] + ct['W'] > 0)) cout << "No\n";
	else cout << "Yes\n";

	return 0;
}


Measured memory_bytes: 384
#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn main() {
    input! {
        a: usize,
        b: String,
    }

    let b = b.split('.').collect::<Vec<_>>();
    let b = b[0].parse::<usize>().unwrap() * 100 + b[1].parse::<usize>().unwrap();
    println!("{}", a * b / 100);
}


Measured memory_bytes: 2140
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#include<functional>
typedef long long ll;
using namespace std;

int Paripi[31][31]={};
int main(){
  int N,M;
  cin >> N >> M;
  for(int i=1;i<=N;i++){
    int k;
    cin >> k;
    for(int j=1;j<=k;j++){
      int tmp;
      cin >> tmp;
      Paripi[i][tmp]++;
    }
  }
  /*for(int i=1;i<=N;i++){
    for(int j=1;j<=M;j++){
      cout << Paripi[i][j] << " ";
    }
    cout << endl;
  }*/
  int ans = 0;
  for(int i=1;i<=M;i++){
    int miria = 0;
    for(int j=1;j<=N;j++){
      miria += Paripi[j][i];
    }
    if(miria==N){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 888
import math
def AAA(s,k):
    a = 1
    while s*math.pow(2,a) < k:
        a = a+1
    return a
def Coin(n,k):
    s = [i+1 for i in range(n)]     
    b = list(map(lambda a:AAA(a,k) if a<k else 0,s))
    res = list(map(lambda a:(1/n)*math.pow(1/2,a) if a!=0 else 1/n,b))
    return sum(res)
n,k = map(int, input().split())
print(Coin(n,k))

Measured memory_bytes: 10996
#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

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

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

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

	vector<long long> T(N);
	for (auto &x : T) cin >> x;
	auto ans = accumulate(T.begin(), T.end(), T[0], lcm);
	cout << ans << endl;
}


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

void init() {
//#if __GLIBCXX__ == 20160609
#ifdef FIRE_MIND
    freopen("a.in", "r", stdin);
    ///freopen("a.out", "w", stdout);
#else
    ///freopen(TASKNAME".in", "r", stdin);
    ///freopen(TASKNAME".out", "w", stdout);
#endif
}

typedef long long ll;
const ll INF = (ll)1e18 + 34;
const int N = (int)1e6 + 34;

vector<pair<int, int>> es[N];
ll x[N];

void dfs(int v, ll dst) {
    //cerr << v << " " << dst << "\n";
    if (x[v] != INF && x[v] != dst) {
        cout << "No";
        exit(0);
    }
    if (x[v] != INF) return;

    x[v] = dst;
    for (auto p: es[v]) {
        dfs(p.first, dst + p.second);
    }
}

int main() {
    init();
    int n, m, l, r, d;
    scanf("%d%d", &n, &m);
    for (int i = 0; i <= n; i++) {
        x[i] = INF;
    }

    for (int iq = 0; iq < m; iq++) {
        scanf("%d%d%d", &l, &r, &d);
        l--;
        r--;
        es[l].push_back({r, d});
        es[r].push_back({l, -d});
    }

    for (int i = 0; i < n; i++) {
        if (x[i] == INF) {
            //cerr << "dfs " << i << "\n";
            dfs(i, 0);
        }
    }

    cout << "Yes";
    return 0;
}


Measured memory_bytes: 34176
#include <bits/stdc++.h>
using namespace std;
long long int GCD(long long a ,long long b){
  if (b==0) return a;
  else return GCD (b,a%b);
}
 
int main() {
  int  N;
  cin >> N;
  long long int ans=0;
  for(int i=1;i<N+1;i++){
    for(int j=1;j<N+1;j++){
      for(int k=1;k<N+1;k++){
        ans +=GCD(GCD(i,j),k);
      }
    }
  }
  cout << ans <<endl;
}

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

using namespace std;

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

int main(){
	int a, e, k;
	cin >> a;
	rep(i, 4) cin >> e;
	cin >> k;
	cout << (e-a > k? ":(":"Yay!") << endl;
}

Measured memory_bytes: 256
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")

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

using namespace std;

typedef pair <int, int> pii;
typedef pair <long long, long long> pll;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define endl "\n"
#define mt make_tuple
#define mp make_pair

template <typename T1, typename T2>
bool umax(T1 &a, const T2&b) { return a < b ? a = b, 1 : 0;}
template <typename T1, typename T2> 
bool umin(T1 &a, const T2 &b) {return a > b ? a = b, 1 : 0;}
template <typename T>
T sqr(T a) {return a * a;}

mt19937 rng(20010709);
const int mod = 1000000007;
const int INF = 1000000001;

int n, m, dp[100005];
vector <int> e[100005], re[100005];

int dfs(int v);

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

    cin >> n >> m;

    while (m--) {
        int u, v;
        cin >> u >> v;

        e[u].push_back(v);
        re[v].push_back(u);
    }

    for (int i = 1; i <= n; i++) {
        if (e[i].empty())
            dfs(i);
    }

    cout << *max_element(dp, dp + n + 1) - 1 << endl;;

    return 0;
}

int dfs(int v) {
    if (dp[v])
        return dp[v];

    dp[v] = 1;

    for (auto it : re[v]) 
        umax(dp[v], dfs(it) + 1);
    return dp[v];
}

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

using namespace std;

string S, T;

void input() {
	cin >> S >> T;
}

void solve() {
	T.pop_back();
	if (S == T) {
		cout << "Yes"<< endl;
	}
	else{
		cout << "No"<<endl;
	}
}


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

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 10007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0,  1, -1,  1, -1 };
static const int dy[] = { 0, -1, 0, 1 , 1,  1, -1, -1 };

LL a, b, n;


int main() {
	while ( ~scanf( "%lld %lld %lld", &a, &b, &n ) ) {
		LL s = 0;
		for ( int i = 0; i < n; i++ ) {
			a %= b;
			a *= 10;
			char d = a / b;
			s += d;
		}
		printf( "%lld\n", s );
	}
	return 0;
}

Measured memory_bytes: 1188
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  ll s,c;
  cin>>s>>c;
  if(s==c/2){
    cout<<s<<endl;
  }else if(s>c/2){
    cout<<c/2<<endl;
  }else if(s<c/2){
    c-=s*2;
    ll a=c/4+s;
    cout<<a<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int a, b, c;
int num = 0;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> a >> b >> c;

	for (int i = a; i <= b; i++) {
		if (c % i == 0) {
			num++;
		}
	}
	cout << num << "\n";
	return 0;
}

Measured memory_bytes: 3208