akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
using Graphl = vector<vector<ll>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define FOR(itr, v) for (auto itr = (v).begin(); itr != (v).end(); ++itr)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
#define rALL(a)  (a).rbegin(),(a).rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> void PrintVector(const vector<T> &vec) {for (auto val : vec) cout << val << " "; cout << endl;}
const long long INF = 1LL << 60;
const long long minusINF = -(1LL << 40);
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    int n; cin >> n;
    vector<ll> a(n);
    int ans = 0;
    rep(i, n)
    {
        cin >> a[i];
        while (a[i] % 2 == 0)
        {
            a[i] /= 2;
            ans++;
        }
    }
    cout << ans << endl;
}

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

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

    ll x, k, d;
    cin >> x >> k >> d;
    x = abs(x);

    ll kl = x/d;
    if (kl >= k) {
        cout << x-d*k << endl;
        return 0;
    }
    
    k -= kl;

    ll x1 = x - d*kl;
    ll x2 = abs(x1-d);

    if (k%2) cout << x2 << endl;
    else cout << x1 << endl;

    return 0;
}

Measured memory_bytes: 3572
use proconio::input;

fn main() {
    input! {
        n: i64,
    }

    let limit = 100i64;
    let mut f = vec![0i64; n as usize + 5];
    for x in 1..=limit {
        for y in 1..=limit {
            for z in 1..=limit {
                let a = x*x + y*y + z*z + x*y + y*z + z*x;
                if a <= n {
                    f[a as usize] += 1;
                }
            }
        }
    }

    for i in 1..=n {
        println!("{}", f[i as usize]);
    }
}


Measured memory_bytes: 2088
using System;
using System.Collections.Generic;
namespace I_am_the_brown_coder{
    class Inonoa{
        static void Main(){
            string[] w_h_x_y = Console.ReadLine().Split();
            long w = long.Parse(w_h_x_y[0]);
            long h = long.Parse(w_h_x_y[1]);
            long x = long.Parse(w_h_x_y[2]);
            long y = long.Parse(w_h_x_y[3]);

            Console.Write( ((double)w*h/2.0 ).ToString()+ " ");
            Console.WriteLine((x*2==w && y*2==h)?"1":"0");
        }
    }
}


Measured memory_bytes: 13140
x, y = map(int, input().split())

ans = (abs(x) + abs(y)) * 2

if x < y:
    ans = min(ans, y - x)

if -x <= y:
    ans = min(ans, y - (-x) + 1)

if x <= -y:
    ans = min(ans, (-y) - x + 1)

if -x < -y:
    ans = min(ans, (-y) - (-x) + 2)

print(ans)

Measured memory_bytes: 3188
// Original: https://github.com/tanakh/competitive-rs
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

mod util {
    #[allow(dead_code)]
    pub fn chmin<T>(x: &mut T, y: T) -> bool
    where
        T: PartialOrd + Copy,
    {
        *x > y && {
            *x = y;
            true
        }
    }

    #[allow(dead_code)]
    pub fn chmax<T>(x: &mut T, y: T) -> bool
    where
        T: PartialOrd + Copy,
    {
        *x < y && {
            *x = y;
            true
        }
    }

    /// 整数除算切り上げ
    #[allow(dead_code)]
    pub fn roundup(a: i64, b: i64) -> i64 {
        (a + b - 1) / b
    }

    #[allow(dead_code)]
    pub fn ctoi(c: char) -> i64 {
        c as i64 - 48
    }
}

#[allow(unused_imports)]
use util::*;

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, VecDeque};

fn main() {
    input! {
        n:i64
    }
    let ans = n * n * n;
    println!("{}", ans);
}


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

void f(int& start, int& end, int& k)
{
	if (k < 10) {
		start = k;
		end = k;
	}

	int temp = k;
	end = temp - temp / 10 * 10;
	temp /= 10;
	while (temp != 0) {
		start = temp - temp / 10 * 10;
		temp /= 10;
	}
}

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

	array<array<int, 10>, 10> ary{0};

	int start, end;
	for (int i = 1; i <= n; ++i) {
		f(start, end, i);
		++ary[start][end];
	}

	long long ret = 0;
	for (int i = 1; i < 10; ++i) {
		for (int j = 1; j < 10; ++j) {
			ret += ary[i][j]* ary[j][i];
		}
	}

	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <cstring>

using namespace std;

inline int gi()
{
	int f = 1, x = 0;
	char c = getchar();
	while (c < '0' || c > '9')
	{
		if (c == '-') f = -1;
		c = getchar();
	}
	while (c >= '0' && c <= '9')
	{
		x = x * 10 + c - '0';
		c = getchar();
	}
	return f * x;
}

int n, a[100005], s[1000005], t[1000005];

inline void add(int d)
{
	for (; d <= 200010; d = d + (d & (-d))) ++t[d];
}

inline long long getans(int y)
{
	long long sum = 0;
	for (; y; y = y - (y & (-y))) sum = sum + t[y];
	return sum;
}	 

inline bool check(int x)
{
	memset(t, 0, sizeof(t));
	s[0] = 0;
	for (int i = 1; i <= n; i++)
	{
		s[i] = s[i - 1] + ((a[i] >= x) ? (1) : (-1));
	}
	long long sum = 0;
	for (int i = 0; i <= n; i++)
	{
		sum = sum + getans(s[i] + 100005);
		add(s[i] + 100005);
	}
	return sum >= (1ll * n * (n + 1) / 4);
}

int main()
{
	n = gi();
	int l = 0, r = 0;
	for (int i = 1; i <= n; i++) a[i] = gi(), r = max(r, a[i]);
	while (l <= r)
	{
		int mid = (l + r) >> 1;
		if (check(mid)) 
		{
			l = mid + 1;
		}
		else r = mid - 1;
	}
	printf("%d\n", r);
	return 0;
}

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

using namespace std;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
using vs=vector<string>;

#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define rep(i, a, n) for (int i = (n); i < (a); ++i)
#define repr(i, a, n) for (int i = (n); i >= (a); --i)

template<typename T,typename U>
void Inparray(T &f,U n){
  for(int i=0;i<n;i++) cin>>f[i];
}

template<typename T,typename U>
void Printarray(T f,U n){
  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];
}

void flagfunc(bool flag,string A,string B){
  flag ? cout<<A<<endl : cout<<B<<endl;
}

void flag2func(bool flag){
  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

void flag3func(bool flag){
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  char a,b;cin>>a>>b;
  if(a=='H')flagfunc(b=='H',"H","D");
  if(a=='D')flagfunc(b=='D',"H","D");
}


Measured memory_bytes: 380
h, w = map(int, input().split())
a = [''] * h
for i in range(h):
	a[i] = input()

row = [False] * h
col = [False] * w
for i in range(h):
	for j in range(w):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True

for i in range(h):
	if row[i]:
		for j in range(w):
			if col[j]:
				print(a[i][j], end = '')
		print()


Measured memory_bytes: 9304
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        int n = a.length();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            sb.append("x");
        }
        System.out.println(sb.toString());
    }
}


Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007ll
#define INF 1000000000ll
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end());
#define pb push_back

P dlt[4]={P(1,0),P(0,1),P(-1,0),P(0,-1)};

vector<vector<char>> c;
ll h,w,f;
P sp,gp;
vector<P> spr;
vector<vector<ll>> g_cost;
vector<vector<ll>> s_cost;

bool isfloor(P p) {
	if(p.first>=0&&p.first<h&&p.second>=0&&p.second<w&&
	   (c[p.first][p.second]=='.'||c[p.first][p.second]=='s')) return true;
	else return false;
}

vector<vector<ll>> dijkstra(vector<P> s) {
	vector<vector<ll>> dst(h,vector<ll>(w,INF*INF));
	priority_queue<pair<ll,P>,vector<pair<ll,P>>,greater<pair<ll,P>>> q;
	REP(i,(ll)s.size()) {
		dst[s[i].first][s[i].second]=0;
		q.push(make_pair(0,s[i]));
	}
	while(!q.empty()) {
		ll d=q.top().first;
		P p=q.top().second;
		q.pop();
		if(dst[p.first][p.second]!=d) continue;
		REP(i,4) {
			P np=P(p.first+dlt[i].first,p.second+dlt[i].second);
			if(isfloor(np)&&dst[np.first][np.second]>d+1) {
				dst[np.first][np.second]=d+1;
				q.push(make_pair(dst[np.first][np.second],np));
			}
		}
	}
	return dst;
}

void init() {
	cin>>w>>h;
	c.assign(h,vector<char>(w));
	REP(i,h) REP(j,w) cin>>c[i][j];
	REP(i,h) REP(j,w) if(c[i][j]=='.'||c[i][j]=='s') f++;
	REP(i,h) REP(j,w) if(c[i][j]=='s') sp=P(i,j);
	REP(i,h) REP(j,w) if(c[i][j]=='g') gp=P(i,j);
	REP(i,h) REP(j,w) if(c[i][j]=='*') spr.pb(P(i,j));
	g_cost=dijkstra(vector<P>(1,gp));
	s_cost=dijkstra(spr);
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	init();
	if(g_cost[sp.first][sp.second]<=s_cost[sp.first][sp.second]) {
		cout<<fixed<<setprecision(39)<<g_cost[sp.first][sp.second]<<endl;
		return 0;
	}
	ll cons=0;
	ll cf=0;
	priority_queue<ll,vector<ll>,greater<ll>> diff;
	REP(i,h) REP(j,w) if(c[i][j]=='.'||c[i][j]=='s') {
		if(g_cost[i][j]==INF*INF) {
			cons+=s_cost[i][j];
			cf++;
			continue;
		}
		cons+=g_cost[i][j];
		if(s_cost[i][j]<g_cost[i][j]) diff.push(s_cost[i][j]-g_cost[i][j]);
	}
	ld min_x=cons/(ld)(f-cf);
	while(!diff.empty()) {
		ll c=diff.top();
		diff.pop();
		cons+=c;
		cf++;
		min_x=min(min_x,cons/(ld)(f-cf));
	}
	cout<<fixed<<setprecision(39)<<min(
	(ld)g_cost[sp.first][sp.second],s_cost[sp.first][sp.second]+min_x)<<endl;
}



Measured memory_bytes: 10204
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define MOD 1000000007
#define MAX 2100000

vector<bool> seen;
vector<int> L,R,D;
vector<int> place;
bool dfs(vector<vector<int>> &G,int v){
  seen.at(v)=true;
  bool flag=true;
  for(auto e:G.at(v)){
    if(L.at(e)==v){
      if(!seen.at(R.at(e))){
        seen.at(R.at(e))=true;
        place.at(R.at(e))=place.at(L.at(e))+D.at(e);
        flag=flag&&dfs(G,R.at(e));
      }else{
        if(place.at(R.at(e))!=place.at(L.at(e))+D.at(e)){
          return false;
        }
      }
    }else{
      if(!seen.at(L.at(e))){
        seen.at(L.at(e))=true;
        place.at(L.at(e))=place.at(R.at(e))-D.at(e);
        flag=flag&&dfs(G,L.at(e));
      }else{
        if(place.at(R.at(e))!=place.at(L.at(e))+D.at(e)){
          return false;
        }
      }
    }
  }
  return flag;
}

int main(){
  int N,M;
  cin>>N>>M;
  L.resize(M);
  R.resize(M);
  D.resize(M);
  vector<vector<int>> G(N);
  for(int i=0;i<M;i++){
    cin>>L.at(i)>>R.at(i)>>D.at(i);
    L.at(i)--;
    R.at(i)--;
    G.at(L.at(i)).push_back(i);
    G.at(R.at(i)).push_back(i);
  }

  seen.resize(N,false);
  place.resize(N);
  bool flag=true;
  for(int i=0;i<N;i++){
    if(seen.at(i)){
      continue;
    }
    flag=flag&&dfs(G,i);
  }
  if(flag){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 14848
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int main(){
  string s;
  cin>>s;
  int cnt[3] = {0,0,0};

  for(char c: s) cnt[c-'a']++;

  bool ok = true;
  rep(i,3)rep(j,3) if(abs(cnt[i]-cnt[j])>=2) ok = false;

  if(ok) cout << "YES" << endl;
  else cout << "NO" << endl;

  return 0;
}


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

int main() {
  int N;
  cin >> N;
  int64_t result = 0;
  vector<int64_t> fk(N + 1);
  for (int i = 1; i <= N; i++) {
    for (int j = 1; i * j <= N; j++) {
      fk.at(i * j)++;
    }
  }
  for (int i = 1; i <= N; i++) {
    result += i * fk.at(i);
  }
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 81400
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (4) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);   
int adj[30][30]={0};
int visit[30]={0};
ll sumi=0;
int n,m;
int conuti(int ind,int num){
	if(num==n){
		sumi++;
		return 0;
	}
	int i;
	f(i,1,n+1){
		if(adj[ind][i]==1 && visit[i]!=1){
			visit[i]=1;
			conuti(i,num+1);
			visit[i]=0;
		}
	}
	return 0;
	
}
int main(){
	std::ios::sync_with_stdio(false);
	int i,a,b;
	cin>>n>>m;
	rep(i,m){
		cin>>a>>b;
		adj[a][b]=1;
		adj[b][a]=1;
	}
	visit[1]=1;
	conuti(1,1);
	cout<<sumi<<endl;

}


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

using namespace std;

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

int main(){
   
   int n,k;
   cin >> n >> k;
   long long ans = k;
   for(int i = 0; i < n - 1; ++i){
      ans *= (k - 1);
   }
   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 256
s1 = raw_input(); l1 = len(s1)
s2 = raw_input(); l2 = len(s2)
dp = [[10**6]*(l2+1) for i in xrange(l1+1)]
dp[0][0] = 0
for i in xrange(l1+1):
    for j in xrange(l2+1):
        if i < l1:
            dp[i+1][j] = min(dp[i][j]+1, dp[i+1][j])
        if j < l2:
            dp[i][j+1] = min(dp[i][j]+1, dp[i][j+1])
        if i < l1 and j < l2:
            dp[i+1][j+1] = min(dp[i][j] + (s1[i]!=s2[j]), dp[i+1][j+1])
print dp[l1][l2]

Measured memory_bytes: 36600
#include <bits/stdc++.h>
using namespace std;
int main(void){
   int h,w;cin>>h>>w;
   char t[h][w];
   for(int i=0;i<h;i++){
       for(int j=0;j<w;j++){
           cin>>t[i][j];
       }
   }
   int res=0;
   int l[h][w],r[h][w],d[h][w],u[h][w];
   for(int i=0;i<h;i++){
       for(int j=0;j<w;j++){
           if(t[i][j]=='#'){
               l[i][j]=0;
           }
           else if(j==0){
               l[i][j]=1;
           }
           else{
               l[i][j]=l[i][j-1]+1;
           }
           
           if(t[i][w-1-j]=='#'){
               r[i][w-1-j]=0;
           }
           else if(j==0)r[i][w-1-j]=1;
           else{
               r[i][w-1-j]=r[i][w-j]+1;
           }
           
           if(t[i][j]=='#'){
               d[i][j]=0;
           }
           else if(i==0)d[i][j]=1;
           else{
               d[i][j]=d[i-1][j]+1;
           }
           
           if(t[h-1-i][j]=='#'){
               u[h-1-i][j]=0;
           }
           else if(i==0)u[h-1-i][j]=1;
           else{
               u[h-1-i][j]=u[h-i][j]+1;
           }
       }
   }
   for(int i=0;i<h;i++){
       for(int j=0;j<w;j++){
           int ans = l[i][j]+r[i][j]+d[i][j]+u[i][j]-3;
           if(ans<0)ans=0;
           //cout<<u[i][j]<<" ";
           res=max(res,ans);
       }
       //cout<<endl;
   }
   cout<<res<<endl;
}

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

#define ll long long
#define INF_LL 1LL << 60
#define INF 99999999
#define MOD (ll)1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, a, n) for(int i = a; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

void put_double(double obj){printf("%.12f\n",obj);};

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


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

    if( abs(x-a) > abs(x-b) ) cout << "B" << endl;
    else if( abs(x-a) < abs(x-b) ) cout << "A" << endl;
}


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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];

		int max = 0;
		int second_max = 0;
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			b[i] = a[i];
		}
		Arrays.sort(b);
		for(int i = 0; i < n; i++) {
			if(b[n-1]==a[i]) {
				System.out.println(b[n-2]);
			}
			else {
				System.out.println(b[n-1]);
			}
		}
	}
}


Measured memory_bytes: 86448
#include <stdio.h>
int main(){
int i,n,x,j,k;
while(1){
int kumia=0;

scanf("%d %d",&n,&x);
if(n==0&&x==0)return 0;

for(i=1;i<=n;i++){
    for(j=i+1;j<=n;j++){
    for(k=j+1;k<=n;k++){
       if(i+j+k==x)kumia++;

}
}
}

    printf("%d\n",kumia);
}
}

Measured memory_bytes: 600
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<string.h>
#include<list>
#include<limits>
#include<bitset>
#include<ctype.h>
#include<set>
#define all(vec) vec.begin(),vec.end()
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;cin>>n>>m;
    vector<ll> a(n);
    priority_queue<ll> q;
    for(int i=0;i<n;i++){
        cin>>a[i];
        q.push(a[i]);
    }
    for(int i=0;i<m;i++){
        ll t=q.top();q.pop();
        t/=2LL;
        q.push(t);
    }
    ll ans=0;
    while(!q.empty()){
        ans+=q.top();
        q.pop();
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 2168
a, b = map(int, input().split())

for i in range(int(-(-a//0.08)),int(-(-(a+1)//0.08))):
    for j in range(int(-(-b//0.1)),int(-(-(b+1)//0.1))):
        if(i == j):
            print(i)
            exit()
print(-1)


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

int main(void) {
	long int a,b,i;
	int k;
	scanf("%ld %ld %d",&a,&b,&k);
	i=a;
	while(i<=b){
		printf("%ld\n",i);
		i++;
		if((i>a+k-1)&&(i<b-k+1)){
			i=b-k+1;
		}
	}
	return EXIT_SUCCESS;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 3e3 + 5, mod = 1e9 + 7;

int a[N];
int dp[N][N];

int solve(int s, int e) {
	if (s > e)
		return 0;
	if (s == e)
		return a[s];

	if (dp[s][e] != -1)
		return dp[s][e];

	int op1 = a[s] + min(solve(s + 2, e), solve(s + 1, e - 1));
	int op2 = a[e] + min(solve(s, e - 2), solve(s + 1, e - 1));
	return dp[s][e] = max(op1, op2);
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;

	int sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	//lets find max val of x hence y becomes sum - x;
	memset(dp, -1, sizeof dp);
	int X = solve(0, n - 1);
	int Y = sum - X;

	cout << X - Y << endl;

	return 0;
}

Measured memory_bytes: 74300
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
int u(const void *a, const void *b){
    return *(ll*)a-*(ll*)b;
}
int d(const void *a, const void *b){
    return *(ll*)b-*(ll*)a;
}
int cmp(const void *a, const void *b){
    return strcmp((char*)a, (char*)b);
}
int cmpchar(const void *a, const void *b){
    return *(char *)a-*(char *)b;
}
int min(int a,int b){
  if(a>b)return b;
  return a;
}
int max(int a,int b){
  if(a>b)return a;
  return b;
}
int gcd(int a,int b){
  if(!b)return a;
  return gcd(b,a%b);
}
int kt(ll a){
  int sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
int ks(ll a){
  int sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
int x[100000];
int main(void){
  int n;
  scanf("%d",&n);
  char s[n][11];
  FOR(n){
    scanf("%s",s[i]);
    qsort(s[i],10,sizeof(s[i][0]),cmpchar);
  }
  qsort(s,n,sizeof(s[0]),cmp);
  ll ans=0,cnt=0;
  FOR(n-1){
    int flg=1;
    FORJ(10)if(s[i][j]!=s[i+1][j])flg=0;
    if(!flg){
      ans+=cnt*(cnt+1)/2;
      cnt=0;
    }else{
      cnt++;
    }
  }
  ans+=cnt*(cnt+1)/2;
  PRL(ans);
  return 0;
}

Measured memory_bytes: 2300
#include <iostream>
#include <cstring>
#define For(i,x,y) for(register int i=(x); i<=(y); i++)
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll qpow(ll a, ll n)
{
    ll ans=1;
    while(n)
    {
        if(n&1)ans=(ans%mod)*(a%mod)%mod;
        a=a%mod*(a%mod)%mod;
        n>>=1;
    }
    return ans;
}
const int maxn=1e5+10;
ll inv[maxn],a[maxn];
int main()
{
    ll ans=0,cnt=1;
    int n;
    cin>>n;
    For(i,1,n)cin>>a[i],cnt=cnt%mod*(i%mod)%mod;//先计算方案数
    For(i,1,n)inv[i]=(qpow(i,mod-2)+inv[i-1])%mod;
    For(i,1,n)ans+=(a[i]%mod)*(inv[i]+inv[n-i+1]-1)%mod;//这里减1，是减去自身的重复。
    cout<<cnt*(ans%mod)%mod<<endl;
    return 0;
}


Measured memory_bytes: 5120
import java.util.*;
class  Main{
	Scanner sc= new Scanner(System.in);
	void aaaa(){
		int gundam=0;
		int n=sc.nextInt();
		int[] N=new int[n];
		for(int i=0;i<n;i++)N[i]=sc.nextInt();
		int q=sc.nextInt();
		for(int i=0;i<q;i++){
			int Q=sc.nextInt();
			for(int j=0;j<n;j++){
				if(N[j]==Q){
					gundam++;
					break;
				}
			}
		}
		System.out.println(gundam);
	}
	public static void main(String[]args){
		new Main().aaaa();
		
	}
}

Measured memory_bytes: 31084
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

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

Measured memory_bytes: 3648
#include<stdio.h>

int vis[105];
int main()
{
	int n, k,ans=0;
	scanf("%d%d", &n, &k);
	while (k--)
	{
		int d;
		scanf("%d", &d);
		for (int i = 0; i < d; i++)
		{
			int tmp;
			scanf("%d", &tmp);
			vis[tmp] = 1;
		}
	}
	for (int i = 1; i <= n; i++)
	{
		if (vis[i] == 0)
			ans++;
	}
	printf("%d", ans);
}

Measured memory_bytes: 1736
/* You are being watched. */


//~ while (clock() <= 69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")

#include <bits/stdc++.h>

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

using namespace std;

//~ #include <ext/pb_ds/assoc_container.hpp>
//~ #include <ext/pb_ds/tree_policy.hpp>
//~ using namespace __gnu_pbds;
//~ template <typename T>
//~ using ordered_set =
  //~ tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) (x).begin(), (x).end()
#define show(x) cerr << __LINE__ << " says: " << #x << " = " << (x) << "\n"
#define FastIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
//using li = __int128;
//using uli = unsigned __int128;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

const int N = 2e5 + 10;

vector <int> g[N];
int a[N];
int n;
int ans[N];
set <int> m;

void dfs(int u, int p) {
  auto cur = m.lower_bound(a[u]);
  int del = -1;
  if(cur != m.end()) {
    del = *cur;
    m.erase(del);
  }
  m.insert(a[u]);
  ans[u] = m.size();
  for(auto v : g[u]) {
    if(v == p) continue;
    dfs(v, u);
  }
  m.erase(a[u]);
  if(del != -1) m.insert(del);
}

void solve() {
  cin >> n;
  for(int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for(int i = 1; i < n; i++) {
    int u, v; cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1);
  for(int i = 1; i <= n; i++) cout << ans[i] << '\n';
}

int main() {
  int t; t = 1;
  while(t--) solve();
}

Measured memory_bytes: 28100
#include <bits/stdc++.h> //全てのヘッダファイルをインクルード
 
//ループ
#define rep(i, n) for(int i = 0; i < (n); i++) //普通のループ
#define repr(i, n) for(int i = n; i >= 0; i--) //逆ループ
 
//型名省略
typedef long long ll;
//値
static const ll MX = 100005;
static const ll MX_ll = 1e18;
const double PI = acos(-1); //π
 
using namespace std;
 
//ソート
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
 
//#include "./lib/generic/search.h"

//文字列入力した小数値を小数点なくして返す
int changeDoubleToInt(string decimal){ 
    decimal.erase(1, 1); //小数点削除
    int n_decimal = atoi(decimal.c_str()); //c_strでchar*に変換後、atoiでintに変換
    return n_decimal;
}

//最大公約数
int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
}

int main(){
   double l;
   cin >> l;
   double x = l/3;
   double ans = pow(x,3);
   printf("%.10f\n", ans);
   return 0;
}

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

#define int long long
using ll = long long;
using ld = long double;
using intpair = pair<int, int>;
using intmap = map<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
const int MOD = 1e9 + 7;
inline int mod (ll a, int m = MOD) { return (a % m + m) % m; }
inline bool bit (ll b, ll i) { return b & (1 << i); }
inline ll ceiv (ll a, ll b) { return (a + b - 1) / b; }
//struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;

#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

signed main(){
    int n;
    cin >> n;
    vi d1(n), d2(n);
    rep(i,n) cin >> d1[i] >> d2[i];
    rep(i,n-2){
        if(d1[i] == d2[i] && d1[i+1] == d2[i+1] && d1[i+2] == d2[i+2]){
            cout << "Yes" << endl;
            exit(0);
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3628
//https://atcoder.jp/contests/abc140/tasks/abc140_b
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;
#define FOR(i,a,b) for(int64_t i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N; cin>>N;
    vector<ll> an(N+1);
    vector<ll> bn(N+1);
    vector<ll> cn(N);
    FOR(i,1,N+1){
        cin>>an[i];
    }
    FOR(i,1,N+1){
        cin>>bn[i];
    }
    FOR(i,1,N){
        cin>>cn[i];
    }

    ll prev_r=-100;
    ll ans= 0;
    FOR(i,1,N+1){
        auto r = an[i];
        ans += bn.at(r);
        if(prev_r+1==r){
            ans += cn.at(prev_r);
        }
        prev_r = r;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long 
#pragma GCC optimize("Ofast", "unroll-loops")
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1; i>=0; i--)
#define pii pair<int,int>
#define SZ(x) x.size()
#define ALL(x) x.begin(), x.end()
#define ull unsigned ll 
#define pb push_back
#define f first 
#define s second
using namespace std;
int main (){
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int a,b; cin>>a>>b;
	cout<<max({a+b, a-b, a*b})<<endl;
}

Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.*;

public class Main {

    private static Scanner in = new Scanner(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        String s = in.next();
        String t = in.next();
        int sn = s.length();
        int tn = t.length();

        Map<Character, List<Integer>> sMap = new HashMap<>();
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            char ch = chars[i];
            if (sMap.containsKey(ch)) {
                sMap.get(ch).add(i);
            } else {
                List<Integer> l = new ArrayList<>();
                l.add(i);
                sMap.put(ch, l);
            }
        }

        Map<Character, int[]> map = new HashMap<>();
        sMap.forEach((k, v) -> {
            v.sort((Comparator.comparingInt(o -> o)));
            map.put(k, v.stream().mapToInt(i->i).toArray());
        });

        // out.println(sMap);
        long ans = 0;
        int before = -1;
        chars = t.toCharArray();
        for (char ch : chars) {
            int[] possible = map.get(ch);
            if (possible == null || possible.length == 0) {
                ans = -1;
                break;
            }

            int minIndex = nextIndex(possible, before, sn);
            int min = distance(minIndex, before, sn);
            ans += min;
            before = minIndex;
            // out.println("Char " + ch + " minIndex " + minIndex + " min " + min);
        }

        out.println(ans);
    }

    private static int nextIndex(int[] possible, int before, int sn) {
        int pt = Arrays.binarySearch(possible, before);
        // out.println("Binary search " + Arrays.toString(possible) + " before " + before + " result " + pt + " bit not " + ~pt);
        if (pt >= 0)
             return possible[(pt + 1) % possible.length];
        pt = ~pt;

        return possible[pt % possible.length];
    }

    private static int distance(int i, int before, int sn) {
        if (i == before)
            return sn;
        if (i > before)
            return i - before;
        return i + sn - before;
    }

}


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

using namespace std;

void solve() {
    int N;
    cin >> N;
    int L, L_max, L_sum;
    L_max = 0;
    L_sum = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> L;
        L_max = max(L, L_max);
        L_sum += L;
    }
    
    if (L_max < L_sum-L_max)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
    

}

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

Measured memory_bytes: 3604
# coding: utf-8
N,H=map(int,input().split())

A=[]
B=[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)

MA=max(A)
ans=0
B.sort()
k=-1

while B[k]>MA:
    H-=B[k]
    k-=1
    ans+=1
    if H<=0:
        break
    if k<-N:
        break
if H>=0:
    ans+=-(-H//MA)

print(ans)

Measured memory_bytes: 86712
#include <bits/stdc++.h>
#define ff first
#define ss second
#define endl '\n'
using namespace std;
const long long INF = (long long) 1e18;
const int mod = (int) 1e9+7;
const int MAXN = (int) 3e5+5;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n;
ll x[MAXN], y[MAXN];

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

    #ifdef Local
        freopen("../IO/int.txt","r",stdin);
        freopen("../IO/out.txt","w",stdout);
    #endif

    cin>>n;
    ll fact = 1, factn;
    for(int i = 1; i <= n; i++)
        fact *= i;
    double a = fact;
    factn = fact/n;
    double b = factn;
    for(int i = 0; i < n; i++){
        cin>>x[i]>>y[i];
    }
    double ans = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            ll dx = (x[i] - x[j])*(x[i] - x[j]);
            ll dy = (y[i] - y[j])*(y[i] - y[j]);
            double del = sqrt(dx + dy)*b;
            ans += del;
        }
    }

    ans = ans / fact;
    cout<<fixed<<setprecision(15)<<ans<<endl;

    #ifdef Local
        cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds ";
    #endif
}

Measured memory_bytes: 2304
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n")
  tmp0 = input[0].split(" ")
  N = Number(tmp0[0])
  tmp1 = input[1].split(" ")
  
  var ans=0
  var max_height = Number(tmp1[0])
  ans++
  for(var i=1; i < N; i++){
    if(tmp1[i] >= max_height){
      ans++
      max_height = Number(tmp1[i])
    }
  }
  console.log(ans)

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//Main("4\n6 5 6 8\n")

Measured memory_bytes: 21064
#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int a,b,x,n;
    scanf("%d %d %d",&a,&b,&x);
    if(a>x)
    {
        cout<<"NO"<<endl;
    }
    if(a==x)
    {
        cout<<"YES"<<endl;
    }
    if(a<x)
    {
        n=x-a;
        if(n<=b)
        {
            cout<<"YES"<<endl;
        }
        if(n>b)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

int main() {
	string S, T;
	cin >> S >> T;

	int result = 0;
	for(int i = 0; i < S.length(); i++) {
		if(S[i] != T[i]) {
			result++;
		}
	}

	cout << result << endl;

	return 0;
}


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

void solve(long long N, long long M, std::vector<long long> A)
{
    priority_queue<ll> que;
    for(auto x: A)
        que.push(x);
    rep(i, M){
        que.push(que.top() / 2);
        que.pop();
    }

    ll ans = 0;
    while(!que.empty()){
        ans += que.top();
        que.pop();
    }
    cout << ans << endl;
}

// Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    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: 2168
L = list(input())
O = ["+","-"]
for o1 in O :
    for o2 in O :
        for o3 in O :
            f = L[0]+o1+L[1]+o2+L[2]+o3+L[3]
            if eval(f) == 7 :
                print(f+"=7")
                exit()
                

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w,n;
  cin>>h>>w>>n;
  map<pair<int,int>,int> m;
  vector<int> a(h+1,200010);
  for(int i=0;i<n;i++){
    int x,y;
    cin>>x>>y;
    m[make_pair(x,y)]=1;
    a[x]=min(a[x],y);
  }
  int c=0;
  for(int i=2;i<=h;i++){
    if(a[i]<i-c){
      cout<<i-1;
      return 0;
    }
    if(m[make_pair(i,i-c)]==1){
      c++;
    }
  }
  cout<<h;
}

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

int main(){
    string s;cin>>s;
    bool a[3]={};
    fol(i,3){
        a[s[i]-'a']=true;
    }
    if(a[0]&&a[1]&&a[2]){
        cout << "Yes"<<endl;
    }else{
        cout << "No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
/*
[abc168] A - ∴ (Therefore)
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()

int N;

string solve() {
    switch (N % 10) {
        case 2:
        case 4:
        case 5:
        case 7:
        case 9:
            return "hon";
        case 0:
        case 1:
        case 6:
        case 8:
            return "pon";
        default:
            return "bon";
    }
}

int main() {
    cin >> N;

    cout << solve() << endl;

    return 0;
}


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

using namespace std;
typedef long long ll;
//typedef unsigned long long ll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;

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

    for (char c : s) {
        int ci = c - 'A';
        int d = (ci + n) % 26;
        char dc =   'A' + d;
        cout << dc;
    }
    cout << endl;

}

Measured memory_bytes: 256
#include <stdio.h>

int main( void ) {
	int n1, n2, n3, max = 0;

	while ( ~scanf( "%*[^J]" ) ) {
		n1 = n2 = n3 = 0;
		scanf( "%*[J]%n%*[O]%n%*[I]%n", &n1, &n2, &n3 );
		n3 -= n2;
		n2 -= n1;

		if ( n1 >= n2 && n2 <= n3 )
			if ( max < n2 )
				max = n2;
	}

	printf( "%d\n", max );

	return 0;
}

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

#ifdef LOCAL
	#define D(a) cerr << #a << " = " << a << endl
#else
	#define D(a)
	#define cerr false && cerr
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define forn(i,n) forsn(i,0,n)
#define all(a) a.begin(),a.end()
#define si(a) int((a).size())
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first
using pii = pair<int,int>;
using vi = vector<int>;
using ll = long long;

vi node;
vector<vi> g;
vector<bool> v;

int sum(int n){
    v[n] = true;
    int s = node[n];
    for(int i : g[n]) if(!v[i]) s += sum(i);
    return s;
}

int main() {
	fastio;
	
    string s; cin >> s;
    int n = si(s), sd = n+1, sn = (sd+1)/2;
    vi d(sd);
    s = 'a'+s+'a';
    node = vi(sn), g.resize(sn), v.resize(sn);

    forn(i,sd) d[i] = (26+s[i]-s[i+1]) % 26;
    forn(i,sd/2) node[i] = (52-d[i]-d[sd-i-1]) % 26; 
    if(sd & 1) node[sd/2] = (26-d[sd/2]) % 26;

    int m; cin >> m;
    forn(i,m){
        int x,y; cin >> x >> y; x--;
        if(x >= sd/2) x = sd-x-1;
        if(y >= sd/2) y = sd-y-1;
        g[x].pb(y), g[y].pb(x);
    }
    bool ok = true;
    forn(i,sn) if(!v[i] && sum(i) % 26 != 0) ok = false;
    cout << (ok ? "YES" : "NO") << endl;  
	return 0;
}


Measured memory_bytes: 5612
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define int ll
#define BUF 1e5
#define INF 1 << 30
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#define bit(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
constexpr ll mod = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

vector<ll> divisor(ll n) {
    vector<ll> ret;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n)
                ret.push_back(n / i);
        }
    }
    sort(begin(ret), end(ret));
    return (ret);
}

signed main() {
    cin >> N >> K;
    vi a(N);
    cin >> a;
    ll sum = 0;
    for (int i = 0; i < N; i++)
        sum += a[i];
    vi div = divisor(sum);
    ans = 1;
    dump(a);
    dump(div);
    for (int d : div) {
        int smN = 0;
        vi vp;
        for (int i = 0; i < N; i++) {
            if (a[i] % d == 0)
                continue;
            int x = a[i] / d;
            smN += a[i] - d * x;
            vp.push_back(d * (x + 1) - a[i]);
            dump(d, a[i], smN, smP);
        }
        sort(all(vp));
        int n = smN / d;
        int k = 0;
        for (int i = 0; i < n; i++) {
            k += vp[i];
        }
        if (k > K) {
            continue;
        } else {
            ans = max(ans, d);
        }
    }
    cout << ans << endl;
}

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

using namespace std;

#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))
#define OUT(P) cout << (P) << endl
#define OUT2(P1, P2) cout << (P1) << " " << (P2) << endl
#define PRINT_ARRAY(P) for(int i=0; i<P.size(); i++) cout << P[i] << endl;
#define PRINT_ARRAY_INLINE(P) do { for(int i=0; i<P.size(); i++) cout << P[i] << " "; cout << endl; } while(0)
#define PRINT_ARRAY_WITH_LABEL(L, P) do { cout << L << ": "; PRINT_ARRAY_INLINE(P); cout << endl; } while(0)
typedef long long ll;

int sum_digits(int num);
template <class T>
vector<T> copy_vector(vector<T> vec);
int gcd(int a, int b);

int main() {
    int n, k;
    cin >> n >> k;
    cout << n - k + 1 << endl;
    return 0;
}

/******************************/
/***** DECRARED FUNCTIONS *****/
/******************************/

int sum_digits(int num) {
    int rtn = 0;
    while(num != 0) {
        int tmp = num % 10; 
        rtn += tmp;
        num /= 10; 
    }   
    return rtn;
}

// vectorのコピー
template <class T>
vector<T> copy_vector(vector<T> vec) {
    vector<T> rtn;
    rtn.reserve(vec.size());
    copy(vec.begin(), vec.end(), back_inserter(rtn));
    return rtn;
}

// ユークリウッドの互除法
int gcd(int a, int b) {
    if(b==0) return a;
    else return gcd(b, a % b);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ASSERT(C, ...) assert( (C) || (PRINT(__VA_ARGS__), false) )
template <class Head> void PRINT(Head head) {
    std::cout << head << "\n";
}
template <class Head, class... Tail> void PRINT(Head head, Tail... tail) {
    std::cout << head << " ";
    PRINT(tail...);
}

ll solve() {
    ll N, A, B, K;
    cin >> N >> A >> B >> K;
    const ll MOD = 998244353;
    auto Add = [&](ll& x, ll y, ll m) { x = ( x + y % m ) % m; };
    auto Mul = [&](ll& x, ll y, ll m) { x = ( x * y % m ) % m; };
    auto Pow = [&](ll x, ll n, ll m) -> ll {
        ll t = x % m, r = 1;
        while ( n > 0 ) {
            if ( n & 1 ) Mul(r, t, m);
        Mul(t, t, m);
        n >>= 1;
        }
        return r;
    };
    auto Inv = [&](ll a, ll m) -> ll {
        return Pow(a, m - 2, m);
    };
    auto gcd = [](ll a, ll b) {
        while ( b != 0 ) {
            ll t = b;
            b = a % b;
            a = t;
        }
        return a;
    };
    ll g = gcd(A,B);
    if ( K % g != 0 ) return 0;
    if ( (A+B)*N < K ) return 0;
    A /= g;
    B /= g;
    K /= g;
    if ( A > B ) swap(A,B);
    ll AB = A*B;
    // A!=Bのとき
    ll ia = 1, ib = 1;
    for ( ; ia < B; ia++ ) {
        if ( ia * A % B == 1 ) break;
    }
    for ( ; ib < A; ib++ ) {
        if ( ib * B % A == 1 ) break;
    }
    ll a = K % B, b = K % A;
    Mul(a, ia, B);
    Mul(b, ib, A);
    ASSERT((a*A+b*B)%AB == K%AB, a, b, a*A+b+B, K%(A*B));
    while ( a*A+b*B > AB ) a -= B;
    a += K / AB * B;
    ASSERT(a*A+b*B == K, a, b, a*A+b+B);
    if ( a > N ) {
        ll k = (a-N)/B;
        a -= k * B;
        b += k * A;
    }
    vector<ll> C(N+1);
    ll c = 1;
    C[0] = c;
    for ( ll i = 1; i <= N; i++ ) {
        Mul(c, N-i+1, MOD);
        Mul(c, Inv(i, MOD), MOD);
        C[i] = c;
    }
    ll ans = 0;
    while ( a >= 0 && b <= N ) {
        if ( a <= N ) {
            ll w = 1;
            Mul(w, C[a], MOD);
            Mul(w, C[b], MOD);
            Add(ans, w, MOD);
        }
        a -= B;
        b += A;
    }
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define N 10005
using namespace std;
typedef long long ll;
int n;
ll a[N],b[N],s1,s2;
int main()
{

    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);
    for(int i=1;i<=n;i++){
        scanf("%lld",&b[i]);
        if(a[i]<=b[i])
            s1+=(b[i]-a[i])/2;
        else
            s2+=a[i]-b[i];
    }
    if(s1>=s2)
        printf("Yes");
    else
        printf("No");
    return 0;
}

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

int main() {
	long long n;
	cin >> n;
	string name = "";
	while (1) {
		n--;
		name += (n % 26 + 'a');
		n /= 26;
		if (n == 0) break;
	}
	reverse(name.begin(), name.end());
	cout << name;
}


Measured memory_bytes: 3624