akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#define UI unsigned int
#define DEBUG false
using namespace std;

class P{
public:
  string c,v;
  int k;

  P(){};
  P(string C,string V){
    c=C; v=V; k=-1;
  };
};

string V="aiueo";
string C="kstnhmyrwgzdbp";

bool isS(string s,char c){
  UI i=0,len=s.length();
  for( ;i<len;i++ )
    if( s[i]==c ) break;
  return i!=len;
}

int main(){
  string s;
  vector<P> v;
  P p;
  while( cin>>s && s!="#" ){
    UI i=0,len=s.length();
    v.clear();
    while( i<len ){
      char c=s[i];
      if( isS(V,c) ){ // 母音
	p=P("",s.substr(i,1)); p.k=1;
	v.push_back( p ); i++; continue;
      }
      if( i+1<len && c==s[i+1] && !isS("nyw",c) ){ // 促音
	p=P(s.substr(i,1),""); p.k=4;
	v.push_back( p ); i++; continue;
      }
      if( c=='n' ){   // 撥音
	if( (i==len-1) 
	    || ( i+1<len && !isS(V,s[i+1]) && s[i+1]!='y') 
	    || ( i+1<len && s[i+1]=='\'') ){
	  int j=1;
	  if( s[i+1]=='\'' ) j++;
	  p=P(s.substr(i,j),""); p.k=5;
	  v.push_back( p ); i+=j; continue;
	}
      }
      int j=1;  // 子音
      if( i+1<len && s[i+1]=='y' ) j++;
      p=P(s.substr(i,j),s.substr(i+j,1));      p.k=j+1;
      v.push_back( p );
      i+=(j+1);
    }

    if( DEBUG ){
      cout << s << " =================" << endl;
      for( i=0;i<v.size();i++ )
	cout << v[i].c << " " << v[i].v << " " << v[i].k << endl;
    }

    bool bf=false;
    for( i=0;i<v.size();i++ ){
      bool f=false;
      if( !bf && (v[i].k==2 || v[i].k==3) ){
	//	cout << "#";
	if( isS( "iu",v[i].v[0] ) ){
	  if( isS( "ksthp",v[i].c[0] ) ){
	    UI j=i+1;
	    if( j<v.size() && v[j].k==4 ) j++;
	    if( j>=v.size() || isS( "ksthp",v[j].c[0] ) )
	      f=true;
	  }
	}
	if( !f && isS( "ao",v[i].v[0] ) ){
	  if( isS( "ksthp",v[i].c[0] ) ){
	    if( i+1<v.size() && isS( "ksthp",v[i+1].c[0] ) 
		&& v[i].v[0]==v[i+1].v[0] ){
	      f=true;
	      //	      cout << "#";
	    }
	  }
	}
      }
      cout << v[i].c;
      if( f )
	cout << "(" << v[i].v << ")" ;
      else
	cout << v[i].v;

      switch( v[i].k ){
      case 1:case 2:case 3:
	bf = f;
	break;
      }
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <vector>

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

#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define TRUE (0)
#define FALSE (1)

// This value shold be close to used maximum value.  
#define NUM_MAX 20000000005

// void sort(uint32_t *num, uint32_t size);

int main()
{
    vector<vector<uint64_t>> arr(0);
    vector<uint64_t> temp_vec(2);
    vector<uint64_t> num_vec(0);
    string result;
    // vector<long long> res_vec(0);
    // uint64_t res_arr[NUM_MAX];
    // uint32_t sum = 0;
    uint64_t num1, num2;
    uint64_t num;
    // uint64_t result;
    double length, mass;

    // uint32_t res_i = 0;
    // string str_temp, str_temp2;
    uint64_t temp, temp2;
    uint64_t i, j, k, l, count, n, o, size;
    // uint32_t count = 0;
    // string str;
    // uint8_t k_flag;
 
    cin >> length;

    length = length / (double)3;
    mass = pow(length, 3);

    cout << fixed << setprecision(10) << mass << endl;

    // for (i=0; i<num; i++) {
    //     cin >> temp_vec.at(0) >> temp_vec.at(1);
    //     arr.push_back(temp_vec);
    // }

    // for (i=0; i<num; i++) {
    //     temp = arr.at(i).at(0);
    //     result[temp] = arr.at(i).at(1);
    // }

    return 0;
}

uint64_t silver_fox(vector<vector<int64_t>>& monster_arr, uint64_t range, uint64_t attack, uint64_t count)
{
    int64_t life, pos, num;
    int64_t i, short_i;

    while (monster_arr.size() != 0) {
        pos = monster_arr[0][0];
        life = monster_arr[0][1];
        count++;
        short_i = 0;

        for (i = 0; i < monster_arr.size(); i++) {
            short_i++;
            if (monster_arr[i][0] < pos + range) {
                monster_arr[i][1] -= attack;
            } else {
                break;
            }
        }

        for (i = short_i - 1; i >= 0; i--) {
            if (monster_arr[i][1] <= 0) {
                monster_arr.erase(monster_arr.begin() + i);
            }
        }
    }

    return count;
}

// void sort(uint32_t *num, uint32_t size) {
//     uint32_t i, j, k;
//     uint32_t sorted_num;
//     uint32_t array[NUM_MAX] = {0};

//     for (i = 1; i < size + 1; i++) {
//         array[num[i - 1]]++;
//     }

//     sorted_num = 0;

//     for (i = 0; i < NUM_MAX; i++) {
//         for (j = 0; j < array[i]; j++) {
//             num[j + sorted_num] = i;
//         }
//         sorted_num += j;
//         j = 0;
//     }

//     return;
// }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

int main() {
  i64 n, p;
  while(cin >> n >> p, n && p) {
    i64 P = p;
    vector<i64> r(n);
    for(int i = 0;;i = (i + 1) % n){
      if(p == 0) {
        p = r[i];
        r[i] = 0;
      }
      else {
        p--;
        r[i]++;
      }
      if(p == 0 && r[i] == P) {
        cout << i << endl;
        break;
      }
    }
  }
}



Measured memory_bytes: 3092
#!/usr/bin/python3
import sys
input = lambda: sys.stdin.readline().strip()
def pal(s, L, R):
    return s[L] == s[R] and (L >= R or pal(s, L + 1, R - 1))

s = input()
n = len(s)
print('Yes' if pal(s, 0, n - 1) and pal(s, 0, (n - 1) // 2 - 1) and pal(s, (n + 3) // 2 - 1, n - 1) else 'No')

Measured memory_bytes: 9032
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringJoiner;
import java.util.StringTokenizer;

public class Main {
	
	static long m=(long)1e9+7;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		
		int n=sc.nextInt();
		long dp[]=new long[n+1];
		
		for(int i=3;i<=n;i++) dp[i]=1;
		
		for(int i=3;i<=n;i++) {
			for(int j=3;j<=i-3;j++) {
				if(i-j>=3)
				dp[i]=(dp[i]+ (dp[i-j]))%m;
			}
			//System.out.println(dp[i]);
		}
		System.out.println(dp[n]);
		
		
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


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

int main() {
	long N;
  	cin >> N;
  
  	vector<long> A(N);
  	for (long i=0; i<N; ++i) {
      	cin >> A.at(i);
    }
  
  	ll sum=0;
  	for (long i=1; i<N; ++i) {
      	if (A.at(i-1)>A.at(i)) {
          sum += (A.at(i-1)-A.at(i));
          A.at(i)=A.at(i-1);
        }
    }
  
  	cout << sum << endl;
    return 0;
}

Measured memory_bytes: 4760
fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).ok();
    let vec: Vec<&str> = buf.split_whitespace().collect();
    let a: i32 = vec[0].parse().unwrap();

    let x: [i32; 41] = [1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000];
    let mut cnt: usize = 1;
    let mut done: bool = false;

    while !done{
        if x[41-cnt] <= a{
            println!("{:?}",x[41-cnt] );
            done = true;
        }
        cnt = cnt + 1;
    }

}


Measured memory_bytes: 4352
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;

int main(){
    double a,b,c;
    cin >> a >> b >> c;
    double PI = acos(-1);
    double rad = c * PI / 180;

    double S = (a * b * sin(rad)) / 2;
    double L = a + b + sqrt(pow(a,2.0)+pow(b,2.0)-2*a*b*cos(rad));
    double h = 2 * S / a;

    printf("%.8f\n",S);
    printf("%.8f\n",L);
    printf("%.8f\n",h);
}



Measured memory_bytes: 3636
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
template<class AC>void r(AC &x){
    x=0;
    int f=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        f|=(ch=='-');
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    x=f?-x:x;
    return;
}
int x;
int main(){
    r(x);
    cout<<(int)sqrt(x)*(int)sqrt(x)<<endl;
    return 0;
}

Measured memory_bytes: 256
MOD = 1000000007
H, W, A, B = map(int, input().split())
if H - A > W - B:
    H, W = W, H
    A, B = B, A
#print(H, W, A, B)
ans1 = [1]
for i in range(H - A - 1):
    #print(ans1)
    ans1.append((ans1[-1] * (H - A - 1 + B - i) * pow(i + 1, MOD - 2, MOD)) % MOD)
#print(ans1)
c = 1
for i in range(W - H + A - B):
    c = (c * (W - B - 1 + A - i) * pow(i + 1, MOD - 2, MOD)) % MOD
ans = c
for i in range(H - A - 1):
    #print(ans)
    c = (c * (H - 1 - i) * pow(W - H + A - B + 1 + i, MOD - 2, MOD)) % MOD
    ans = (ans + c * ans1[i + 1]) % MOD
print(ans)

Measured memory_bytes: 6680
n,x = gets.chomp.split(" ").map(&:to_i)
if n == 2
  if x == 2
    puts "Yes",1,2,3
  else
    puts "No"
  end
elsif n == 3
  if x != 1 && x != 5
    puts "Yes"
    ans = [2,3,4]
    puts ans[x-3],1,ans[x-2],5,ans[x-4]
  else
    puts "No"
  end
else
  if x > 2 && x != 2*n-1
    ans = Array.new(2*n-4){|i|i+3}
    ans.delete_at(x-3)
    puts "Yes",ans[0,n-3],1,2*n-1,x,2,ans[n-3,n-2]
  elsif x == 2
    puts "Yes",Array.new(n-3){|i|i+3},2*n-1,1,2,2*n-2,Array.new(n-2){|i|i+n}
  else
    puts "No"
  end
end

Measured memory_bytes: 4604
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

L = [A[i] - B[i] for i in range(N)]
ans = 0

if sum(A) < sum(B) :
    ans = -1
else :
    debt = []
    deposit = []
    
    for i in range(N) :
        if L[i] < 0 :
            debt.append(-L[i])
        elif L[i] > 0 :
            deposit.append(L[i])
    
    deposit = sorted(deposit,reverse=True)
    debt_sum = sum(debt)
    
    ans += len(debt)
    
    while debt_sum > 0 :
        if debt_sum <= deposit[0] :
            deposit[0] = 0
            debt_sum = 0
        else :
            debt_sum -= deposit.pop(0)
        ans += 1
        
print(ans)
#print(debt)
#print(deposit)



Measured memory_bytes: 18620
#include <stdio.h>

int A[1000000], n;

int binarySearch(int key) {
  int left = 0;
  int right = n;
  int mid;
  while(left < right) {
    mid = (left + right) / 2;
    if(key == A[mid]) return 1; 
    if(key > A[mid]) left = mid + 1;
    else if(key < A[mid]) right = mid; 
  }
  return 0;
}

int main(void) {
  int i, q, k, sum = 0;
  scanf("%d",&n);
  for(i=0; i<n; i++) {
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++) {
    scanf("%d",&k);
    if(binarySearch(k))
      sum++;
  }
  printf("%d\n",sum);
  return 0;
}


Measured memory_bytes: 2128
using System;

class Program
{
    static void Main()
    {
        string[] str = Console.ReadLine().Split(' ');

        int a  = int.Parse(str[0]);
        int b =  int.Parse(str[1]);
        int c = int.Parse(str[2]);

        if (a <= b)
        {
            int i = a;
            int cnt = 0;
            while (true)
            {
                if ((c % i) == 0)
                {
                    cnt++;
                    
                }


                i++;

                if (i == b+1)
                {
                    break;
                }


            }

            Console.WriteLine("{0}", cnt);
        }

    }
}

Measured memory_bytes: 9224
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

struct UnionFind {
  vector<int> par; // par[i]:iの親の番号
  
  UnionFind(int N) : par(N){ // 最初は全てが根であるとして初期化
    for(int i = 0; i < N; i++) par[i] = i;
  }
  
  int root(int x){// データxが属する木の根を再帰で得る:root(x) = {xの木の根}
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  
  bool unite(int x, int y){ // xとyの木を併合
    int rx = root(x); // xの根をrx
    int ry = root(y); // yの根をry
    if (rx == ry) return false; // xとyの根が同じ時はそのまま
    par[rx] = ry; // xとyの根が同じでない時，xの根rxをyの根ryにつける
    return true;
  }
  
  bool same(int x, int y){
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};

struct corridor {
  int a, b, len;
  corridor(int a, int b, int len) : a(a), b(b), len(len){}
  // ソート用
  bool operator <(const corridor& rhs) const {
    if (len != rhs.len) { return len < rhs.len; }
    if (a != rhs.a) { return a < rhs.a; }
    return b < rhs.b;
  }
};

int main() {
  int V, E;
  cin >> V >> E;
  
  UnionFind tree(V);
  vector<corridor> cor;
  int s, t, w;
  rep(i, E){
    cin >> s >> t >> w;
    cor.push_back(corridor(s, t, w));
  }
  sort(cor.begin(), cor.end());
  int ans = 0;
  rep(i, E){
    if (tree.unite(cor[i].a, cor[i].b)){
      ans += cor[i].len;
    }
  }
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 4568
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<iomanip>
#include<limits>
#include<unordered_set> 
#include<cmath>
    using namespace std;
    //long long p = 998244353;
    long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<pin,int>
#define V vector
#define Endl endl
#define veb vector<bool>
#define fcout cout << fixed << setprecision(15)
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)-h.begin()
#define upper(h,val) upper_bound(h.begin(),h.end(),val)-h.begin()
int max_kai = 150000;
    vel kai(max_kai, 1);
    vel inv_kai;
    int rui(int a, int n, int mod) {
        if (n == 0) { return 1 % mod; }
        int x = rui(a, n / 2, mod);
        x *= x; x %= mod;
        if (n % 2 == 1) { x *= a; x %= mod; }
        return x;
    }
    vel pa;
    int root(int x) {
        if (pa[x] == -1) { return x; }
        int ans = root(pa[x]); pa[x] = ans;
        return ans;
    }
    void marge(int x, int y) {
        x = root(x);
        y = root(y);
        if (x != y) { pa[x] = y; }
    }
    int gcd(int x, int y) {
        if (x < y) { return gcd(y, x); }
        if (y == 0) { return x; }
        return gcd(y, x % y);
    }
    long long modinv(long long a, long long m) {
        long long b = m, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        u %= m;
        if (u < 0) u += m;
        return u;
    }
void solve(vel& ans, vvel &chi,int pot) {
    for (auto x : chi[pot]) {
        solve(ans, chi,x);
        int qans = ans[x];
        mmax(ans[pot], qans+1);
    }
}
signed main() {
    int a, b; cin >> a >> b;
    cout << a * b / gcd(a, b) << endl;
    return 0;
}
// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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


using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(ll i=st; i<ed; i++)
#define repn(i, st, ed) for(ll i=st; i<=ed; i++)
#define repb(i, ed, st) for(ll i=ed; i>=st; i--)
#define all(v) v.begin(),v.end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 2e5 + 10;
const ll INF = 1LL << 60;

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



// Main Code

int main()
{
	string s, t;
	cin>>s>>t;
	cout<<(t+s)<<endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.buffer.readline
N = int(input())
A = list(map(int, (input().split())))
A.sort(reverse=True)
if N%2:
    ans = A[0] + sum(A[1:(N-1)//2])*2 + A[(N-1)//2]
else:
    ans = A[0] + sum(A[1:N//2])*2
print(ans)

Measured memory_bytes: 29216
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;


// 抽象化したセグメント木
template<class Monoid> struct SegTree {
    using Func = function<Monoid(Monoid, Monoid)>;
    const Func F;
    const Monoid UNITY;
    int SIZE_R;
    vector<Monoid> dat;
    
    SegTree(int n, const Func f, const Monoid &unity): F(f), UNITY(unity) { init(n); }
    void init(int n) {
        SIZE_R = 1;
        while (SIZE_R < n) SIZE_R *= 2;
        dat.assign(SIZE_R * 2, UNITY);
    }
    
    /* set, a is 0-indexed */
    void set(int a, const Monoid &v) { dat[a + SIZE_R] = v; }
    void build() {
        for (int k = SIZE_R - 1; k > 0; --k)
            dat[k] = F(dat[k*2], dat[k*2+1]);
    }
    
    /* update a, a is 0-indexed */
    void update(int a, const Monoid &v) {
        int k = a + SIZE_R;
        dat[k] = v;
        while (k >>= 1) dat[k] = F(dat[k*2], dat[k*2+1]);
    }
    
    /* get [a, b), a and b are 0-indexed */
    Monoid get(int a, int b) {
        Monoid vleft = UNITY, vright = UNITY;
        for (int left = a + SIZE_R, right = b + SIZE_R; left < right; left >>= 1, right >>= 1) {
            if (left & 1) vleft = F(vleft, dat[left++]);
            if (right & 1) vright = F(dat[--right], vright);
        }                                                                                                              
        return F(vleft, vright);
    }
    inline Monoid operator [] (int a) { return dat[a + SIZE_R]; }
    
    /* debug */
    void print() {
        for (int i = 0; i < SIZE_R; ++i) {
            cout << (*this)[i];
            if (i != SIZE_R-1) cout << ",";
        }
        cout << endl;
    }
};



// 最長増加部分列の長さを求める
int LIS(const vector<long long> &a) {
    int N = (int)a.size();

    // 座標圧縮
    vector<long long> aval;
    for (int i = 0; i < N; ++i) aval.push_back(a[i]);
    sort(aval.begin(), aval.end());
    aval.erase(unique(aval.begin(), aval.end()), aval.end());

    // セグメント木 (区間取得を max としたもの)
    SegTree<int> dp(N+1,
                    [](int a, int b) { return max(a, b); },
                    0);

    // 更新
    int res = 0;
    for (int i = 0; i < N; ++i) {
        // a[i] が何番目か
        int h = lower_bound(aval.begin(), aval.end(), a[i]) - aval.begin();
        ++h; // 1-indexed にする

        // 値取得
        int A = dp.get(0, h);

        // 更新
        if (dp.get(h, h+1) < A + 1) {
            dp.update(h, A + 1);
            res = max(res, A + 1);
        }
    }
    return res;
}

int main() {
    int N; cin >> N;
    vector<long long> a(N);
    for (int i = 0; i < N; ++i) cin >> a[i];
    cout << LIS(a) << endl;
}   



Measured memory_bytes: 5448
using System;
 
namespace ConsoleApplication13
{
    class Program
    {
        static void Main(string[] args)
        {
            int a,b;
            int t;
            while(true)
            {
                string[] str = Console.ReadLine().Split(' ');
                a = int.Parse(str[0]);
                b = int.Parse(str[1]);
                if ((a == 0) && (b == 0))
                    break;
 
                if(a>b)
                {
                    t = a;
                    a = b;
                    b = t;
                }
 
                Console.WriteLine("{0} {1}", a, b);
 
            }
        }
    }
}
 

Measured memory_bytes: 9276
#include <cstdio>
#include <cstring>

int main() {
    int a, b;
    char nah[100];
    while ( scanf("%d %d", &a, &b) != EOF ) {
          sprintf(nah, "%d", a + b);
          printf("%d\n", strlen(nah));
    }
    return 0;
}

Measured memory_bytes: 1040
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <random>
#include <queue>
#include <typeinfo>
#include <type_traits>

using namespace std;

template <typename T>	constexpr T	rep_start(const T &end)			{ return 0; }
template <typename T>	constexpr T	rep_start(const T &start, const T &end)	{ return start; }
template <typename T>	constexpr T	rep_end(const T &end)				{ return end; }
template <typename T>	constexpr T	rep_end(const T &start, const T &end)		{ return end; }

#define rep(index, ...) for (auto index = rep_start(__VA_ARGS__); index < rep_end(__VA_ARGS__); ++index)
#define irep(index, ...) for (auto index = rep_end(__VA_ARGS__) - 1; index >= rep_start(__VA_ARGS__); --index)

using llong = long long;
using ullong = unsigned long long;

struct L
{
	bool operator()(const pair<int, llong> &a, const pair<int, llong> &b)
	{
		return a.second > b.second;
	}
};
struct G
{
	bool operator()(const pair<int, llong> &a, const pair<int, llong> &b)
	{
		return a.second < b.second;
	}
};
struct D
{
	vector<int> t;
	vector<llong> d;
	vector<int> kindBonus;
	int K;
	int N;

	llong solve()
	{
		fill(kindBonus.begin(), kindBonus.end(), 0);
		priority_queue<pair<int, llong>, vector<pair<int, llong>>, L> p;
		priority_queue<pair<int, llong>, vector<pair<int, llong>>, G> q;
		rep(i, N) q.push(make_pair(t[i] - 1, d[i]));

		llong score = 0LL;
		int kinds = 0;
		rep(i, K)
		{
			auto a = q.top();
			q.pop();
			clog << "<< [" << setw(8) << a.first + 1 << "] : " << a.second << endl;
			if (0 == kindBonus[a.first])
			{
				score += 2 * kinds + 1;
				++kinds;
			}
			++kindBonus[a.first];
			score += a.second;
			p.push(a);
		}

		llong m_score = score;
		while (!p.empty())
		{
			auto b = p.top();
			p.pop();
			if (1 < kindBonus[b.first])
			{
				clog << ">> [" << setw(8) << b.first + 1 << "] : " << b.second << endl;
				--kindBonus[b.first];
				score -= b.second;

				while (!q.empty())
				{
					auto a = q.top();
					q.pop();
					clog << "<< [" << setw(8) << a.first + 1 << "] : " << a.second << endl;
					if (0 == kindBonus[a.first])
					{
						score += 2 * kinds + 1;
						++kinds;
						++kindBonus[a.first];
						score += a.second;
						m_score = max(m_score, score);
						p.push(a);
						break;
					}
				}
			}
		}

		return m_score;
	}
};

int main ()
{
	D problem;
	cin >> problem.N >> problem.K;
	problem.t = vector<int>(problem.N);
	problem.d = vector<llong>(problem.N);
	rep(i, problem.N) cin >> problem.t[i] >> problem.d[i];
	problem.kindBonus = vector<int>(problem.N);
	cout << problem.solve() << endl;

	return 0;
}

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

int main(){
    long long n, a[100011], i, cnt4=0, cnt2=0;
    cin >> n;
    for(i=0;i<n;i++){
        cin >> a[i];
    }
    for(i=0;i<n;i++){
        if(a[i]%4==0) cnt4++;
        else if(a[i]%2==0) cnt2++;
    }

    if(cnt2==1) cnt2--;
    if(n%2!=0 && 3*cnt4+cnt2>=n) cout << "Yes" <<endl;
    else if(2*cnt4+cnt2>=n) cout << "Yes" <<endl;
    else cout << "No" <<endl;

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 

using namespace __gnu_pbds;
using namespace std;

// MACROS

#define ll long long
#define ull unsigned long long
#define ld long double

#define vi vector<int>
#define vll vector<ll>
#define vld vector<ld>
#define u_s unordered_set

#define pii pair<int,int>
#define pll pair<ll,ll>

#define FOR(i, n) for (ll (i) = 0; i < n; i++)
#define FORN(i, a, b) for (ll (i) = a; i < b; i++)
#define FORE(i, l) for (auto (i) : l)

#define pb push_back
#define pob pop_back
#define emp emplace
#define fi first
#define se second

#define all(n) (n).begin(), (n).end()
#define in(n) cin >> (n);
#define debug(n) cout << #n << ": " << n << '\n';

// FUNCTIONS

template< typename T >
inline T gcd(T a, T b) { if (b) return gcd(b, a % b); return a; }

template< typename T >
inline T ext_gcd(T a, T b, T & x, T & y) { if (a == 0) { x = 0; y = 1; return b; } T x1, y1; T g = ext_gcd(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return g; }

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);	
    //cout << setprecision(15);
    ll n;
    cin >> n;
    vll nums(n);
    FOR(i, n) cin >> nums[i];
    map<ll, ll> m;
    FOR(i, n) m[nums[i]]++;
    ll tot = 0;
    FORE(i, m) tot += (i.se * (i.se - 1)) / 2;
    FOR(i, n)
    {
        cout << (tot - m[nums[i]] + 1) << '\n';
    }
}



Measured memory_bytes: 11136
n=int(input())

if n<10:
    print(n)
elif n>=10 and n<100:
    print(9)
elif n>=100 and n<1000:
    print(9+(n-99))
elif n>=1000 and n<10000:
    print(909)
elif n>=10000 and n<100000:
    print(909+(n-9999))
else:
    print(90909)

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

// 無限大の値
const int64_t INF = 1000000000;


int main() {

  int64_t n;
  cin>>n;


  vector<int64_t> h(n);
  for(int i=0;i<n;i++){
    cin>>h.at(i);
  }

  vector<int64_t> cost(n,INF);
  cost.at(0)=0;

  for(int i=1;i<n;i++){
    int64_t cost1,cost2;
    cost1 = cost.at(i-1)+abs(h.at(i)-h.at(i-1));

    if(i>=2)
      cost2 = cost.at(i-2)+abs(h.at(i)-h.at(i-2));
    else
      cost2 = INF;

    cost.at(i) = min(cost1,cost2);
  }


  cout<<cost.at(n-1)<<endl;


  return 0;
}


Measured memory_bytes: 4800
#include<bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int gcd(int a, int b) {
	if (!b)return a;
	return gcd(b, a%b);
}
signed main() {
	int n, k; scanf("%d%d", &n, &k);
	int g, Max = 0;
	rep(i, n) {
		int a; scanf("%d", &a);
		if (i == 0)g = a;
		else g = gcd(g, a);
		if (a == k) {
			puts("POSSIBLE"); return 0;
		}
		Max = max(Max, a);
	}
	if (Max < k || k%g) {
		puts("IMPOSSIBLE"); return 0;
	}
	else puts("POSSIBLE");
}

Measured memory_bytes: 256
s = input()

s = s[:-1]
length = len(s)

for a in range(length, 1, -1):
    tmp = s[:a]
    if len(tmp) % 2 == 0:
        half = len(tmp)//2
        if tmp[:half] == tmp[half:]:
            ans = len(tmp)
            break

print(ans)


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

int main() {
	char a[3];
	cin >> a[0] >> a[1] >> a[2];
	int b = 0;
	if (a[0] == 'o') b++;
	if (a[1] == 'o') b++;
	if (a[2] == 'o') b++;
	cout << 700 + (b * 100) << endl;

	return 0;
}

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

bool isValid(int n){
    if(n==0) return true;

    bool ret = true;
    if(n%2==0) ret = isValid(n/2);
    else{
        if((n/2)%2==1) ret = false;
        else ret = isValid(n/2);
    }
    return ret;
}

int main(){
    ll mod = 1000000007;
    int H, W, K;  cin >> H >> W >> K;
    vector<vector<ll>> dp;
    dp = vector<vector<ll>>(H+1, vector<ll>(W+1, 0));
    dp[0][1] = 1;
    for(int h=0; h<H; h++){
        for(int w=1; w<=W; w++){
            ll c1 = 0, c2 = 0, c3 = 0;
            int N = (1 << (W - 1));
            for(int i=0; i<N; i++){
                if(!isValid(i)) continue;
                int n = i;
                int j = 1;
                vector<bool> bridge(W+1, false);
                while(n > 0){
                    if(n%2==1) bridge[W-j] = true;
                    n/=2;  j++;
                }
                if(!bridge[w] && !bridge[w-1]) c1++;
                if(bridge[w-1]) c2++;
                if(bridge[w]) c3++;
            }
            dp[h+1][w] = c1*dp[h][w]%mod;
            if(w-1>=1) dp[h+1][w] = (dp[h+1][w] + (c2*dp[h][w-1])%mod)%mod;
            if(w+1<=W) dp[h+1][w] = (dp[h+1][w] + (c3*dp[h][w+1])%mod)%mod;
        }
    }

    cout << dp[H][K] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;

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

  ll N;
  ll A = 0;

  cin >> N;
  vector<ll> vec(N);

for (ll i = 0; i < N; i++) {
  cin >>vec.at(i);
}

sort(vec.begin(), vec.end());
  
  for (ll i = 0; i < N-1; i++) {
    if(vec.at(i)==vec.at(i+1)){
      cout << "NO" << endl;
      A = 1;
      break;
    }
    
  }
  if(A==0){
    cout << "YES" << endl;
  }
}

Measured memory_bytes: 1792
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parent = list(range(n+1))
        self.size = [1] * (n+1)
        
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def union(self, a, b):
        a = self.find(a)
        b = self.find(b)
        
        if self.parent[a] == self.parent[b]:
            return
        if self.size[a] >= self.size[b]:
            self.parent[b] = a
            self.size[a] += self.size[b]
        else:
            self.parent[a] = b
            self.size[b] += self.size[a]
        
    def is_same(self, a, b):
        return self.find(a) == self.find(b)
    
    def count(self, x):        
        return self.size[self.find(x)]

n, m, k = map(int, input().split())

uf = UnionFind(n)
ans = [0] * (n + 1)

for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)
    ans[a] -= 1
    ans[b] -= 1
    
for _ in range(k):
    a, b = map(int, input().split())
    if uf.is_same(a, b):
        ans[a] -= 1
        ans[b] -= 1
        
for i in range(1, n+1):
    ans[i] += uf.count(i) - 1    
    
print(" ".join(map(str, ans[1:])))

Measured memory_bytes: 19000
package main

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

func main() {

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := nextInt(sc)

	call(n)
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextInt(sc *bufio.Scanner) int64 {
	i, err := strconv.ParseInt(nextString(sc), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func call(n int64) {
	checkNum(1, n)
}

func checkNum(i, n int64) (int64, int64) {
	x := i
	if x%3 == 0 {
		fmt.Printf(" %d", i)
		return endCheckNum(x, i, n)
	}
	return include3(x, i, n)
}

func include3(x, i, n int64) (int64, int64) {
	if x%10 == 3 {
		fmt.Printf(" %d", i)
		return endCheckNum(x, i, n)
	}
	x /= 10
	if x != 0 {
		return include3(x, i, n)
	}
	return endCheckNum(x, i, n)
}

func endCheckNum(x, i, n int64) (int64, int64) {
	i++
	if i <= n {
		return checkNum(i, n)
	}
	fmt.Println("")
	return x, i
}



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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N; cin >> N;
    vector<ll> A(1<<N);
    REP(i,1<<N) {
        cin >> A[i];
    }
    vector<vector<ll> > dp(1<<N,vector<ll>(2,0LL));
    REP(i,1<<N) dp[i][0] = A[i];
    for(int j=0; j<N; ++j) {
        for(int i=0; i<(1<<N); ++i) {
            if(i&(1<<j)) {
                int pi = (i & ~(1<<j));
                if(dp[pi][1] >= dp[i][0]) {
                    dp[i][0] = dp[pi][0];
                    dp[i][1] = dp[pi][1];
                }
                else if(dp[pi][0] >= dp[i][0] && dp[pi][1] < dp[i][0]) {
                    dp[i][1] = dp[i][0];
                    dp[i][0] = dp[pi][0];
                }
                else if(dp[pi][0]<dp[i][0] && dp[pi][0] >= dp[i][1]) {
                    dp[i][1] = dp[pi][0];
                }
                else continue;
            }
        }
    }
    vector<ll> res;
    for(int i=1; i<(1<<N); ++i) res.push_back(dp[i][0]+dp[i][1]);
    for(int i=0; i+1<(1<<N)-1; ++i) res[i+1] = max(res[i+1], res[i]);
    for(auto x:res) cout << x << '\n';
    return 0;
}

Measured memory_bytes: 21616
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
int main()
{
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
  }

  sort(a.begin(), a.end());
  if(a[n-1]-a[0]>1){
    cout << "No" << "\n";
  }
  else if(a[n-1]==a[0]){
    if(a[0]==n-1){
      cout << "Yes" << "\n";
    }
    else if(n/2>=a[0]){
      cout << "Yes" << "\n";
    }
    else{
      cout << "No" << "\n";
    }
  }
  else{
    int cnt=1;
    rep(i,n-1){
      if(a[i]!=a[i+1]){
	break;
      }
      else{
	cnt++;
      }
    }
    if(cnt<a[n-1]){
      if((n-cnt)/(a[n-1]-cnt)>=2){
	cout << "Yes" << "\n";
      }
      else{
	cout << "No" << "\n";
      }
    }
    else{
      cout << "No" << "\n";
    }
  }  
  
  
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <tuple>
#include <cstdio>
#include <cmath>
using namespace std;
using ll = long long;
const int INF = 1e9;

int main() {
    long double inp; cin >> inp;
    cout << 2.0 * M_PI * inp << endl;
}

Measured memory_bytes: 3744
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
const int inf=1e9+7;
const ll mod=1e9+7;

ll DP[105][105];
ll larr[105], rarr[105];

ll solve(int l, int r){
    if(DP[l][r] != 0) return DP[l][r];
    for(int i=l;i<r;++i){
        if(DP[l][r] == 0) DP[l][r] = solve(l, i) + solve(l+1, r) + larr[l] * rarr[i] * rarr[r];
        else DP[l][r] = min(solve(l, i) + solve(i+1, r) + larr[l] * rarr[i] * rarr[r], DP[l][r]);
    }
    return DP[l][r];
}

int main() {
    int n;
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>larr[i]>>rarr[i];
    }
    cout<<solve(0, n-1)<<endl;
}



Measured memory_bytes: 3148
using System;

namespace agc037
{
    class Program
    {
        static void Main(string[] args)
        {
            // input
            string s = Console.ReadLine();
            int s_cnt = s.Length;  // Sの文字数

            // output
            int result = 0;

            int next_p = 1;
            string now = "";
            string next = "";

            now = s[0].ToString();
            next = s[1].ToString();
            result = 1;

            while(true)
            {
                // 今と次が異なる文字列の場合
                if(!now.Equals(next))
                {
                    now = next;
                    next = "";
                    next_p++;
                    next = s[next_p].ToString();
                    result++;
                }
                // 同じ場合
                else
                {
                    next_p++;
                    next += s[next_p];
                }
                if(next_p == s.Length - 1)
                {
                    if(!now.Equals(next))
                    {
                        result++;
                    }
                                        break;
                }
            }

            Console.WriteLine(result.ToString());

        }
    }
}


Measured memory_bytes: 17328
#include <bits/stdc++.h>
   
using namespace std;
#define ll long long
#define ld long double
#define pll pair<long long,long long>
#define vll vector<long long>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define deb(x) cout << #x << "=" << x << endl
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define RF(i,a,b) for(ll i=a;i>=b;i--)
#define in(a,n) F(i,0,n-1)cin>>a[i]
#define vi vector<int>
#define out(a,n) F(i,0,n-1)cout<<a[i]<<" ";cout<<endl
#define mod 1000000007
#define int long long
set < ll> primes;
 
int n,m;

bool isvalid(int x,int y)
{
    return (x>=0 && x<n && y>=0 && y<m);
}
int dx[]={0,0,1,-1,-1,1,1,-1};
int dy[]={1,-1,0,0,-1,1,-1,1};
void Sieve(ll n) 
{ 
    bool prime[n+1];
	for(ll i=0;i<n+1;++i)
		prime[i]=true;
    for (ll p=2;p*p<=n;++p) 
    {
        if (prime[p] == true) 
        {  
            for (ll i=2*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    }  
    for(ll p=2; p<=n; p++) 
       if (prime[p]) 
		primes.insert(p);  
}

ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
        return gcd(b % a, a); 
} 
ll powermod(ll x, ll y){
    if(y==0)
    return 1;
        
    if(y%2==0)
    return (powermod(x,y/2)*powermod(x,y/2))%mod;
    else
    return (((powermod(x,y/2)*powermod(x,y/2))%mod)*x)%mod;
}

void solve()
{
    
    int n;
    cin>>n;
    int a[n];
    for(auto &x:a)cin>>x;
    
   // int ans=0;
   
    
    vector<int>l(n),r(n);
    for(int i=n-1;i>=0;i--)
    {
        if(i==n-1)r[i]=a[i];
        else r[i]=a[i]^r[i+1];
    }
    
    for(int i=0;i<n;i++)
    {
        if(i==0)
        l[i]=a[i];
        else l[i]=a[i]^l[i-1];
    }
    vector<int>ans(n);
    for(int i=0;i<n;i++)
    {
        if(i==0)
        ans[i]=r[i+1];
        else if(i==n-1)
        ans[i]=l[i-1];
        else
        ans[i]=l[i-1]^r[i+1];
        
    
        cout<<ans[i]<<' ';
    }
    
    
    
    
}
 
 

int32_t main()
{
	ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
  //  cin>>t;
    while(t--)solve();
    
   
}

Measured memory_bytes: 9432
#include<stdio.h>

#define ll long long

int main(){
	int n;
	scanf("%d", &n);
	ll sum = 0;
	for(int i = 1; i <= n; i++){
		if(i % 3 == 0 && i % 5 == 0){
			continue;
		}
		if(i % 3 == 0 || i % 5 == 0){
			continue;
		}
		else{
			sum += i;
		}
	}
	printf("%lld\n", sum);
	return 0;
}


Measured memory_bytes: 1704
# -*- coding: utf-8 -*-

inputs = input().split(' ')
N = int(inputs[0])
M = int(inputs[1])

maxL = 1
minR = 100000
for _ in range(M):
    inputs = input().split(' ')
    L = int(inputs[0])
    R = int(inputs[1])
    if L > maxL:
        maxL = L
    if R < minR:
        minR = R

if minR < maxL:
    print(0)
else:
    print(minR - maxL + 1)

Measured memory_bytes: 3188
#include <iostream>

using namespace std;

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

   int n;
   long long int d;
   cin >> n >> d;

   d *= d;
   int cnt = 0;
   for(int i = 0; i < n; ++i){
        long long int x, y; cin >> x >> y;
        if(x*x + y*y <= d){
            ++cnt;
        }

   }

   cout << cnt << "\n";

    return 0;
}


Measured memory_bytes: 3616
/*
 * Author: madlogic
 * It's better to do something than nothing
*/
#include <bits/stdc++.h>
using namespace std;
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define watch(x) cout<<"->"<<#x<<" : "<<x<<endl;
// #define int long long
const int INF = 1000000000;
const int MOD = 1000000007;
const double PI = 2*acos(0.0);
signed main()
{
	//freopen("","r",stdin);
	//freopen("","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n;
	cin>>n;
	int cnt = 0;
	for(int i=1;i<=n;i++)
		if(i&1)
			++cnt;
	long double res = (long double)cnt/(long double)n;	
	cout<<setprecision(12)<<fixed<<res<<endl;
	return 0;	
}

Measured memory_bytes: 256
#include <stdio.h>
typedef long long unsigned int u64;

// Minimize 6x + 5y >= n. x == y, so 11x >= n, or x == y + 1, 11x - 5 >= n.

u64 min(const u64 a, const u64 b) {
  return a < b ? a : b;
}

u64 solve(u64 n) {
  u64 bestresult = 1e15;
  // Case 1:
  u64 x = (n + 10) / 11;
  bestresult = min(bestresult, 2 * x);
  // Case 2:
  x = (n + 15) / 11;
  bestresult = min(bestresult, 2 * x - 1);
  return bestresult;
}

int main(void) {
  u64 x;
  scanf("%llu", &x);
  printf("%llu", solve(x));
  return 0;
}
 
   

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
	map<int,string>mp;
	vector<int>a={2,4,5,7,9}, b={0,1,6,8};
	mp[3]="bon";
	for(const int& x:a)
		mp[x]="hon";
	for(const int& x:b)
		mp[x]="pon";
	string s; cin>>s;
	int d = s[s.size()-1] -'0';
	cout<<mp[d]<<endl;
	return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

int main()
{
    ll N, M;
    cin >> N >> M;
    ll ai;
    vector<ll> A;
    for(int i=0;i<M;i++){
        cin >> ai;
        A.push_back(ai-1);
    }
    vector<ll> res(N,0);
    ll iA = 0;
    if(iA<A.size() && A[iA]==0){
        res[0] = 0;
        iA++;
        if(iA<A.size() && A[iA]==1){
            res[1] = 0;
        }else{
            res[1] = 1;
        }
    }else if(iA<A.size() && A[iA]==1){
        iA++;
        res[0] = 1;
        res[1] = 0;
    }
    else{
        res[0] = 1;
        res[1] = 2;
    }
    for(int i=2;i<N;i++){
        if(iA<A.size()&&i==A[iA]){ iA++; res[i] = 0; continue;}
        res[i] = res[i-1] + res[i-2];
        res[i] %= 1000000007;
    }
    cout<<res.back()<<endl;

    return 0;
}

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

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++) 
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = int(1e9) + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 200 * 1000 + 13;

int n;
li a[N];

bool read () {
	if (scanf("%d", &n) != 1)
		return false;
	forn(i, n){
		ld x;
		scanf("%Lf", &x);
		a[i] = round(x * INF);
	}
	return true;
}

int cnt[60][60];

void solve() {
	memset(cnt, 0, sizeof(cnt));
	li ans = 0;
	forn(i, n){
		li x = a[i];
		int p2 = 0, p5 = 0;
		while (x % 2 == 0) ++p2, x /= 2;
		while (x % 5 == 0) ++p5, x /= 5;
		ans += i;
		forn(j, 18 - p2) forn(k, 60)
			ans -= cnt[j][k];
		forn(j, 60) forn(k, 18 - p5)
			ans -= cnt[j][k];
		forn(j, 18 - p2) forn(k, 18 - p5)
			ans += cnt[j][k];
		++cnt[p2][p5];
	}
	printf("%lld\n", ans);
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	
	int tt = clock();
#endif
	
	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

#ifdef _DEBUG
	while(read()) {	
#else
	if(read()) {
#endif
		solve();
		
#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}

Measured memory_bytes: 5412
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] -= 1

l = [-1]*n
l[0] = 0
order = 0
now = 0

while True:
    k -= 1
    now = a[now]
    order += 1
    if k == 0:
        break
    if l[now] != -1:
        cycle = order - l[now]
        k %= cycle
    if l[now] == -1:
        l[now] = order

print(now + 1)

Measured memory_bytes: 32328
using System;
class Program
{
	static void Main(string[] args)
	{
      int a = int.Parse(Console.ReadLine());
      string b = Console.ReadLine();
      string[] array = new string[a];
      double c = 0.0f;
      for(int i = 0; i < array.Length;i++){
        array = b.Split(' ');
        c += 1 / double.Parse(array[i]);
      }
      Console.Write((1/c).ToString());
	}
}

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

#define REP(i,n) for(decltype(n) i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i,a,b) for(int i=(a);i>=(b);--i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(c) ((int)((c).size()))
#define st first
#define nd second
#define pb push_back

typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<bool> vb;
typedef long long ll;

int A[2][100];

void solve(){
    int N;
    cin>>N;
    for(int i=0;i<N;++i) cin>>A[0][i];
    for(int i=0;i<N;++i) cin>>A[1][i];
    for(int i=1;i<N;++i) A[0][i] += A[0][i-1];
    A[1][0] += A[0][0];
    for(int i=1;i<N;++i) A[1][i] += max(A[1][i-1], A[0][i]);
    cout<<A[1][N-1];
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
const ll MOD = 1e9+7;
const double PI  = 3.14159265358;
const double EPS = 1e-8;

#define INT_MX 2147483647
#define INF ((int)1e9)
#define LLINF ((ll)1e18)
#define F first
#define S second
#define mp(x,y) make_pair(x,y)
#define sz(v) ((int)v.size())
#define rs(n) resize(n)
#define all(v) v.begin(),v.end()
#define reset(v) memset((v),0,sizeof(v))
#define eb emplace_back
#define pb push_back
#define pf push_front
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define vec vector
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
	ull n, mem, ans;
	
	cin >> n;
	mem = n;
	if(n%2){
		cout << 0;
		return 0;
	}
	ans = 0;
	while(n){
		ans += n/5;
		n /= 5;
	}
	n = mem;
	while(n){
		ans -= (n+5)/10;
		n /= 5;
	}
	
	
	cout << ans << '\n';
	
}









Measured memory_bytes: 256
b = []
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
b.append(a1)
b.append(a2)
b.append(a3)
n = int(input())
c = [int(input()) for i in range(n)]
a = []
d = [[0 for i in range(3)] for j in range(3)]
flg = False
for i in c:
	for j in range(3):
		for k in range(3):
			if b[j][k] == i:
				d[j][k] = 1
	for l in range(3):
		if d[l][0] == 1 and d[l][1] == 1 and d[l][2] == 1:
			flg = True
		if d[0][l] == 1 and d[1][l] == 1 and d[2][l] == 1:
			flg = True
	if d[0][0] == 1 and d[1][1] == 1 and d[2][2] == 1:
		flg = True
	if d[0][2] == 1 and d[1][1] == 1 and d[2][0] == 1:
		flg = True
	if flg == True:
		print ("Yes")
		exit()
print ("No")


Measured memory_bytes: 3192
#include<stdio.h>

int main(){
	int n,m,d,x,y,i;
	for(;scanf("%d",&n),n;puts(n?"No":"Yes")){
		int f[21][21] = {0};
		for(i=n;i--;f[y][x] = 1)
			scanf("%d %d",&x,&y);
		scanf("%d",&m);
		x=y=10;
		for(i=m;i--;)
			for(scanf(" %c %d",&m,&d);d--; ){
				x += (m=='E')? 1 : (m=='W')? -1 : 0;
				y += (m=='N')? 1 : (m=='S')? -1 : 0;
				if(f[y][x]){
					n--;
					f[y][x] = 0;
				}
			}
	}
}

Measured memory_bytes: 0
import numpy as np
a,b,h,m=map(int,input().split())
h+=m/60.0

zi=30*h
hun=6*m


theta=np.abs(zi-hun)

if theta>180:
    theta=360.0-theta
theta*=np.pi/180.0

ans=a**2.0+b**2.0-2.0*np.cos(theta)*a*b
ans=ans**0.5


print(ans)

Measured memory_bytes: 27200
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<bitset>
using namespace std;

typedef long long LL;

inline LL read()
{
	char c=getchar();LL num=0,f=1;
	for(;!isdigit(c);c=getchar())
		f=c=='-'?-1:f;
	for(;isdigit(c);c=getchar())
		num=num*10+c-'0';
	return num*f;
}

const int N=5005;

int n,k,a[N];

bitset<N> f;
bool check(int p)
{
	if(a[p]>=k) return 1;
	f.reset();f[0]=1;
	for(int i=1;i<=n;++i)
	{
		if(i==p) continue;
		f|=(f<<a[i]);
	}
	for(int i=k-1;i>=k-a[p];--i)
		if(f[i]) return 1;
	return 0;
}

int main()
{
	n=read(),k=read();
	for(int i=1;i<=n;++i) a[i]=read(),a[i]=min(a[i],k);
	sort(a+1,a+n+1);
	int l=0,r=n,mid,ans=0;
	while(l<=r)
	{
		mid=(l+r)>>1;
		if(check(mid)) r=mid-1;
		else l=mid+1,ans=mid;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256