akhauriyash/Code-Regression huggingface dataset:
//Author ::  ABHINAV3010 ::

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define endl "\n"
#define all(x) (x).begin(), (x).end()
#define fast ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
typedef pair<ll,ll> p;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;
ll mod=1000000007;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll power(ll x, ll y, ll p=mod)
{ll res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1;x = (x*x) % p;}return res;}
vector<char>seq(1e5+3);
bool fun(ll n, vector<string>&v,ll i,ll a,ll b,ll c,vector< vector< vector< vector<ll> > > >&dp)
{
    if(a<0||b<0||c<0)
    {
        return false;
    }
    if(i==n)
    {
        return true;
    }
    if(dp[i][a][b][c]!=-1)
    {
        return dp[i][a][b][c];
    }
    bool ans=false;
    //cout<<a<<" "<<b<<" "<<c<<endl;
    if(v[i]=="AB")
    {
        ans=ans|fun(n,v,i+1,min(3ll,a+1ll),b-1,c,dp);
        if(ans)
        {
            seq[i]='A';
            return dp[i][a][b][c]=ans;
        }
        ans=ans|fun(n,v,i+1,a-1,min(3ll,b+1),c,dp);
        seq[i]='B';
    }else if(v[i]=="AC")
    {
        ans=ans|fun(n,v,i+1,min(3ll,a+1),b,c-1,dp);
         if(ans)
        {
            seq[i]='A';
            return dp[i][a][b][c]=ans;
        }
        ans=ans|fun(n,v,i+1,a-1,b,min(c+1,3ll),dp);
        seq[i]='C';
    }else if(v[i]=="BC")
    {
        ans=ans|fun(n,v,i+1,a,b-1,min(3ll,c+1),dp);
         if(ans)
        {
            seq[i]='C';
            return dp[i][a][b][c]=ans;
        }
        ans=ans|fun(n,v,i+1,a,min(3ll,b+1),c-1,dp);
        seq[i]='B';
    }
    return dp[i][a][b][c]=ans;
}
int main()
{
fast;
ll n;
cin>>n;
ll a,b,c;
cin>>a>>b>>c;
a=min(a,3ll);
b=min(b,3ll);
c=min(c,3ll);
vector<string>v;
for(ll i=0;i<n;i++)
{
    string s;
    cin>>s;
    v.pb(s);
}
vector< vector< vector< vector<ll> > > >dp(n+1,vector< vector< vector<ll> > >(4, vector< vector<ll> >(4, vector<ll>(4,-1))));
if(fun(n,v,0,a,b,c,dp))
{
    cout<<"Yes"<<endl;
    for(ll i=0;i<n;i++)
    {
        cout<<seq[i]<<endl;
    }
}else
{
    cout<<"No"<<endl;
}
return 0;
}


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

int curve(int x)
{
    return x * x;
}

int integral(int d)
{
    int area = 0;
    for (int i = 0; i < 600 / d; i++)
    {
        area += curve(d * i) * d;
    }
    return area;
}

int main()
{
    int d;
    while (cin >> d)
    {
        cout << integral(d) << endl;
    }
    return 0;
}


Measured memory_bytes: 3108
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <time.h>
#include <queue>
#include <stdarg.h>
#include <map>
#include <vector>
#include <algorithm>
#include <stack>
#include <iostream>
#include <numeric>
#include <set>

#define ll long long

using namespace std;

void
solve() {
  string a, b;
  cin>>a>>b;

  vector<int> right, left;
  for (int i=a.length()-1; i>=0; i--)
    right.push_back(a[i]-'0');
  for (int i=b.length()-1; i>=0; i--) 
    if (b[i] != '.') 
      left.push_back(b[i]-'0');

  vector<int> result;
  while (result.size() < right.size() + left.size()-1)
    result.push_back(0);

  for (int i=0; i<right.size(); i++)
    for (int j=0; j<left.size(); j++)
      result[i+j] += right[i] * left[j];

  for (int i=0; i<result.size()-1; i++) {
    result[i+1] += result[i] / 10;
    result[i] %= 10;
  }

  while (result[result.size()-1] >= 10) {
    result.push_back(result[result.size()-1] / 10);
    result[result.size()-2] %= 10;
  }
  while (result[result.size()-1] == 0 && result.size() > 3)
    result.pop_back();

  for (int i=result.size()-1; i>=2; i--)
    cout<<result[i];
  cout<<endl;
}

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

  int t = 1;
  //cin>>t;

  while (t > 0) {
    t--;
    solve();
  }

  return 0;
}

Measured memory_bytes: 3660
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

struct Circle {
    int x, y, r;
};
typedef pair<int, pair<int, int>> PP;

int sx, sy, xx, yy;

typedef pair<double, int> P;
struct edge
{
    int to;
    double cost;
    edge(int _to, double _cost) : to(_to), cost(_cost) {}
    edge() {}
};

void dijkstra(int s, vector<vector<edge>>& E, vector<double>& a)
{
    priority_queue<P, vector<P>, greater<P> > que;
    REP(i, a.size())
        a[i] = -1;
    a[s] = 0;
    que.push(P(0, s));

    while (!que.empty())
    {
        P p = que.top();
        que.pop();
        int v = p.second;
        if (a[v] >= 0 && a[v] < p.first)
            continue;
        for (int i = 0; i < E[v].size(); ++i)
        {
            edge e = E[v][i];
            if (a[e.to] < 0 || a[e.to] > a[v] + e.cost)
            {
                a[e.to] = a[v] + e.cost;
                que.push(P(a[e.to], e.to));
            }
        }
    }
}

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

    cin >> sx >> sy >> xx >> yy;

    int N;
    cin >> N;

    vector<Circle> v;
    v.push_back(Circle{sx, sy, 0});
    v.push_back(Circle{xx, yy, 0});
    REP(i, N) {
        int x, y, r;
        cin >> x >> y >> r;
        v.push_back(Circle{x, y, r});
    }

    vector<vector<edge>> E(v.size());

    REP(i, v.size()) {
        REP(j, v.size()) {
            auto vi = v[i];
            auto vj = v[j];
            double d = sqrt((vi.x - vj.x) * (vi.x - vj.x) + (vi.y - vj.y) * (vi.y - vj.y)) - vi.r - vj.r;
            if (d < 0) d = 0;
            E[i].push_back(edge(j, d));
            E[j].push_back(edge(i, d));
        }
    }

    vector<double> d(v.size());
    dijkstra(0, E, d);
    fcout << d[1] << endl;

    return 0;
}


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

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

void solve() {
    ll x;
    cin >> x;

    ll year = 0;
    ll bank = 100;
    while (bank < x) {
        bank = bank + ll(double(bank) * 0.01);
        year++;
    }

    cout << year << endl;
}

int main() {
    solve();

    return 0;
}


Measured memory_bytes: 3612
n,m=map(int,input().split())
list_mat=[]
for i in range(n):
    s=list(map(int,input().split()))
    list_mat.append(s)

list_b=[]                
for j in range(m):
    t=int(input())
    list_b.append(t)
    
sum_ab=0
list_ab=[]    
for i in range(n):
    for j in range(m):
        sum_ab+=list_mat[i][j]*list_b[j]
    list_ab.append(sum_ab)
    sum_ab=0
[print(i) for i in list_ab]


Measured memory_bytes: 6016
import numpy as np
X, Y, A, B, C = list(map(int, input().split()))
p = sorted(list(map(int, input().split())))
q = sorted(list(map(int, input().split())))
r = np.array(sorted(list(map(int, input().split())), reverse=True))

p_cut = np.array(p[A-X:])
q_cut = np.array(q[B-Y:])
pi = 0
qi = 0
for i in range(len(r)):
    if pi >= X and qi >= Y:
        break
    if pi >= X:
        if q_cut[qi] >= r[i]:
            break
        q_cut[qi] = r[i]
        qi += 1
    elif qi >= Y:
        if p_cut[pi] >= r[i]:
            break
        p_cut[pi] = r[i]
        pi += 1
    elif p_cut[pi] >= q_cut[qi] :
        if q_cut[qi] >= r[i]:
            break
        q_cut[qi] = r[i]
        qi += 1
    else:
        if p_cut[pi] >= r[i]:
            break
        p_cut[pi] = r[i]
        pi += 1
print(np.sum(p_cut) + np.sum(q_cut))



Measured memory_bytes: 31508
// C - Next Prime
#include <bits/stdc++.h>
using namespace std;

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

int main(){
	int X; cin>>X;
	while(!isprime(X)) X++;
	cout<< X <<endl;
}

Measured memory_bytes: 256
N=int(input())
cAC=0
cWA=0
cTLE=0
cRE=0
for i in range(N):
    X=input()
    if X=="AC":
        cAC+=1
    elif X=="WA":
        cWA+=1
    elif X=="TLE":
        cTLE+=1
    else:
        cRE+=1

print("AC x "+str(cAC))
print("WA x "+str(cWA))
print("TLE x "+str(cTLE))
print("RE x "+str(cRE))


Measured memory_bytes: 9200
def main():
    n = [int(i) for i in input().split()]
    l = [int(i) for i in input().split()]
    ans = 1
    m = 0
    for i in l:
        m += i
        if m <= n[1]:
            ans += 1
        else:
            break
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 38256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        String str = "";
        if (a < b) {
            for (int i = 0; i < b; i++) {
                str += a;
            }
            System.out.println(str);
        } else {
            for (int i = 0; i < a; i++) {
                str += b;
            }
            System.out.println(str);
        }
        sc.close();
    }
}

Measured memory_bytes: 21588
// Undone
#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N;
  while (cin >> N, N) {
    set<pair<int,int>> exists;
    vector<int> x(N), y(N);
    for (int i = 0; i < N; i++) {
      cin >> x[i] >> y[i];
      exists.insert({x[i],y[i]});
    }
    int ans = 0;
    for (int i = 0; i < N-1; i++) {
      for (int j = i+1; j < N; j++) {
        int dx = abs(y[i]-y[j]), dy = abs(x[i]-x[j]);
        int ix = x[i]+dx, jx = x[j]+dx, iy = y[i]+dy, jy = y[j]+dy;
        if (exists.count({ix, iy}) && exists.count({jx, jy})) {
          ans = max(ans, (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
        }
      }
    }
    cout << ans << endl;
  }
}




Measured memory_bytes: 3260
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll a,b,sum,diff;
    char c = 'a';

    diff=a-b;
    //cin >> a >> c >> b ;
    scanf("%lld %c %lld",&a,&c,&b);
    sum = a+b;
    diff=a-b;
    if(c =='+')
    {
        printf("%lld\n",sum);
    }
    else
        printf("%lld\n",diff);
}


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

bool check(int a1, int a2, int a3) {
    if((a1 < a2 && a2 < a3)|| (a1 > a2 && a2 > a3)) {
        return true;
    }
    return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int p[n];
  for(int i = 0;i < n;i++) {
      cin >> p[i];
  }
  int count = 0;
  for(int i = 0;i < n-2;i++) {
      if(check(p[i], p[i+1], p[i+2])) {
          count++;
      }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; i++ )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;

int main(){
   int n,l;
   cin>>n>>l;
   deque<pint> deq;
   int a[n];
   rep(i,n)cin>>a[i];
   rep(i,n){
       if(deq.size()){
            while(!deq.empty()&&a[i]<=deq.back().first){
                deq.pop_back();
            }
            deq.push_back({a[i],i});
           }
       else deq.push_back({a[i],i});
       if(i>=l-1){
           cout<<deq.front().first;
           if(i==n-1)cout<<endl;
           else cout<<" ";
           if(deq.front().second==i-l+1)deq.pop_front();
       }
   }
   return 0;
}


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

using namespace std;

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

  vector<int> p(n);
  for (int i = 0; i < n; i++)
  {
    cin >> p[i];
  }

  int p_min = n + 1;
  int cnt = 0;
  for (int i = 0; i < n; i++)
  {
    if (p[i] < p_min)
    {
      cnt++;
      p_min = p[i];
    }
  }

  cout << cnt << endl;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;

#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()



int main()
{
    int n; cin>>n;
    cout<<n+(n*n)+(n*n*n);
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
const int mod=1e9+7;
 
int dx[]={-1, 0, 1, 0};
int dy[]={0, -1, 0, 1};



int32_t main()
{

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



char c;
cin>>c;
if(c>='A'&&c<='Z')
{
    cout<<"A";
}
else cout<<"a";


}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define mod 1000000007

ll dp[10001][2][101];

ll solve(string &k,ll d,ll i,ll tight,ll sum)
{
	sum=sum%d;
	if(i==k.length())
	{
		if(sum%d==0)
		{
			return(1);
		}
		else
		{
			return(0);
		}
	}
	if(dp[i][tight][sum]!=-1)
	{
		return(dp[i][tight][sum]);
	}
	if(tight==0)
	{
		ll ans=0,j;
		for(j=0;j<=9;j++)
		{
			ans=(ans%mod+solve(k,d,i+1,0,sum+j)%mod)%mod;;
		}
		return(dp[i][tight][sum]=ans%mod);
	}
	else
	{
		ll ans=0,j;
		for(j=0;j<(k[i]-'0');j++)
		{
			ans=(ans+solve(k,d,i+1,0,sum+j))%mod;
		}
		ans=(ans+solve(k,d,i+1,1,sum+k[i]-'0'))%mod;
		return(dp[i][tight][sum]=ans%mod);
	}
}
int main()
{
	string k;
	ll d;
	cin>>k>>d;
	memset(dp,-1,sizeof(dp));
	cout<<(solve(k,d,0,1,0)-1+mod)%mod<<"\n";
}

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

int main(){

    ll X;
    cin >> X;
    ll money = 100;
    ll time = 0;
    while(money < X){
        money = money*1.01;
        time++;
    }
    cout << time << endl;
}


Measured memory_bytes: 3676
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    h, n = LI()
    a = LI()
    if h <= sum(a):
        print('Yes')
    else:
        print('No')
    return


# Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 52624
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


int main() {
    string s;
    cin>>s;
    int AA,BB;
    if(s[0]!=0){
      AA=(s[0]-'0')*10+(s[1]-'0');
      }else{
        AA=s[1]-'0';
        }

    if(s[2]!=0){
     BB=(s[2]-'0')*10+(s[3]-'0');
      }else{
        BB=s[3]-'0';
        }
    if(1<=AA && AA<=12 &&1<=BB && BB<=12) cout<<"AMBIGUOUS"<<endl;
    else if(1<=AA && AA<=12 && 0<=BB && BB<=99) cout<<"MMYY"<<endl;
    else if(0<=AA && AA<=99 && 1<=BB && BB<=12) cout<<"YYMM"<<endl;
    else cout<<"NA"<<endl;
}

Measured memory_bytes: 256
import Data.List
import Data.Ratio

main = do
  n <- readLn
  print $ phi n

phi :: Int -> Int
phi 1 = 1
phi n = numerator ratio --`div` denominator ratio
  where ratio = foldl (\acc x -> acc * (1 - (1 % x)))
                      (n % 1) $ nub (primeFactor n)

factors :: Int -> [Int]
factors n = [d | d <- [1..n], n `mod` d == 0]

isPrime :: Int -> Bool
isPrime x = null [y | y <- [2..(sqr x)], x `mod` y == 0]
  where sqr a = floor $ sqrt $ fromIntegral a

primeFactor :: Int -> [Int]
primeFactor n
  | isPrime n = [n]
  | otherwise = reverse $ go [] n
  where
    go res 1 = res
    go res n = go (d : res) (n `div` d)
      where d = factors n !! 1

Measured memory_bytes: 4268
n,m = map(int,input().split())
s = list(list(map(int,input().split())) for i in range(m))
x = [-1]*n
b = True
for i in range(m):
    if x[s[i][0]-1] == -1 or x[s[i][0]-1] == s[i][1]:
        x[s[i][0]-1] = s[i][1]
    else:
        b = False
for j in range(n):
    if x[j] == -1:
        if len(x) != 1 and j == 0:
            x[j] = 1
        else:
            x[j] = 0
if len(x) != 1 and x[0] == 0:
    b = False

if b:
  S=""
  for o in range(n):
    S+=str(x[o])
  print(int(S))
else:
  print(-1)


Measured memory_bytes: 3064
require "set"
n = gets.chomp.to_i

# 3進数を利用して七五三数を直接集める
hash = {"0"=>"3", "1"=>"5", "2"=>"7"}
arr = []
# 桁数だけ回す
(3..9).each do |digit|
  (3**digit).times do |i|
    set = Set.new
    num = ""
    ("%0#{digit}d" % i.to_s(3)).each_char do |c|
      num += hash[c]
      set << hash[c]
    end
    # 3,5,7が1回以上表れた場合に挿入
    arr << num.to_i if set.length == 3
  end
end

# 番兵
arr << 10 ** 9
# arrは作り方からsort済なのでindexを求めれば良い
puts arr.index{|a| a > n}


Measured memory_bytes: 14928
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 /*int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }*/
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int a){
	par= vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0)
      return a;
    else
      return par[a]=find(par[a]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int gcm(int a,int b){
    if(b==0)
        return a;
    return gcm(b,a%b);
}
int lcm(int a,int b){
    return a/gcm(a,b)*b;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){

}*/
signed main(){
	int a,b,c;
	cin>>a>>b>>c;
	V<int> d(a);
	fo(i,a)
	cin>>d[i];
	fo(i,a){
		c+=(b-1)/d[i]+1;
	}
	cout<<c<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pi;
const int MAXN = 1e6 + 50;
int A[MAXN];

main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int A, B, K; cin >> A >> B >> K;
    vector<int> vec;
    for (int i=1; i<=min(A,B); i++){
        if (A%i==0 && B%i==0){
            vec.push_back(i);
        }
    }
    cout << vec[vec.size()-K];
}


Measured memory_bytes: 256
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	long long n; cin >> n;
	long long ans = LLONG_MAX;

	for (long long i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			ans = min(ans, abs(1 - i) + abs(1 - (n / i)));
		}
	}

	cout << ans;

	return 0;
}

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

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N, M;
	int con = 0;
	
	cin>>N>>M;
	
	con = min(N, M/2);
	
	N -= con;
	M -= con*2;
	
	con += M/4;
	
	cout<<con<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    char S[3];
    scanf("%s",S);
    int alph[3] = {0};
    for(int i = 0; i < 3; i++){
        alph[S[i]-'a'] += 1;
    }
    
    if(alph[0] == 1 && alph[1] == 1 && alph[2] == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
# Time Limit Exceeded
N,T = gets.chomp.split(" ").map(&:to_i)
c = []
t = []
time_min = 1001
cost_min = 1001
ans_index = 0
flg = 0
for i in 0..N-1 do
    c[i],t[i] = gets.chomp.split(" ").map(&:to_i)
    if t[i] <= T && c[i] < cost_min
        ans_index = i
        time_min = t[i]
        cost_min = c[i]
        flg = 1
    end
end
if flg == 1 
    puts c[ans_index]
elsif flg == 0
    puts "TLE"    
end

Measured memory_bytes: 1788
N = int(input())
S = list(input())

left_black = 0
right_white = 0

for s in S:
    if s == '.':
        right_white += 1

c_min = left_black + right_white

for i in range(N):
    if S[i] == '#':
        left_black += 1
    elif S[i] == '.':
        right_white -= 1
    c = left_black + right_white
    if c < c_min:
        c_min = c
print(c_min)

Measured memory_bytes: 4840
using System;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Text;

namespace Fish.aizu
{
	public static class AizuOnlineJudge
	{
		public static int[] SplitToInts(string line)
		{
			return line.Split(' ').Select(x => int.Parse(x)).ToArray();
		}
		public static double[] SplitToDoubles(string line)
		{
			return line.Split(' ').Select(x => double.Parse(x)).ToArray();
		}
		public static long[] SplitToLongs(string line)
		{
			return line.Split(' ').Select(x => long.Parse(x)).ToArray();
		}
		public static int Main()
		{
			Compute(Console.In, Console.Out);
			return 0;
		}
		
		public static void Compute(TextReader reader, TextWriter writer)
		{
			string line = null;
			while (null != (line = reader.ReadLine()))
			{
				if ("0" == line) return;
				var sum = 0;
				foreach (var c in line)
				{
					sum += c - '0';
				}
				writer.WriteLine(sum);
			}
		}
	}
}

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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second


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

    ld x,st=100;
    ll res=0;
    cin >> x;
    while(st < x)
    {
        res++;
        ll a = st/100;
        st += a;
    }

    cout << res << '\n';

    return 0;
}

Measured memory_bytes: 3732
import sys
input = sys.stdin.readline

################################################################################

n = int(input())
a = list(map(int, input().split()))
pt = []
nt = []
for x in a:
    if x >= 0:
        pt.append(x)
    elif x < 0:
        nt.append(x)

res = []

s = 0
if len(pt) == n:
    a.sort()
    s = a[0]
    for i in range(1, n-1):
        res.append((s, a[i]))
        s -= a[i]

    res.append((a[-1], s))
    s = a[-1] - s

elif len(nt) == n:
    a.sort(reverse=True)
    s = a[0]
    for i in range(1, n):
        res.append((s, a[i]))
        s -= a[i]

else:
    s = nt[0]
    for i in range(1, len(pt)):
        res.append((s, pt[i]))
        s -= pt[i]

    res.append((pt[0], s))
    s = pt[0] - s

    for i in range(1, len(nt)):
        res.append((s, nt[i]))
        s -= nt[i]

print(s)
for r in res:
    print(r[0], r[1])


Measured memory_bytes: 63136
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/



int H, W;
string A[101];
#define NO "No"
#define YES "Yes"
//--------------------------------------------------------------------------------------------------
string solve() {
    map<char, int> cnt;
    rep(y, 0, H) rep(x, 0, W) cnt[A[y][x]]++;

    if (H % 2 == 0 && W % 2 == 0) {
        fore(p, cnt) if (p.second % 4) return NO;
        return YES;
    }

    if (H % 2 && W % 2) {
        map<int, int> c;
        fore(p, cnt) c[p.second % 4]++;
        if (c[3]) return NO;
        if (c[1] != 1) return NO;
        if (c[2] > (H - 1) / 2 + (W - 1) / 2) return NO;
        return YES;
    }

    if (W % 2) swap(H, W);

    map<int, int> c;
    fore(p, cnt) c[p.second % 4]++;
    if (c[1] || c[3]) return NO;
    if (c[2] > W / 2) return NO;
    return YES;
}
//--------------------------------------------------------------------------------------------------
void _main() {
    cin >> H >> W;
    rep(y, 0, H) cin >> A[y];
    cout << solve() << endl;
}

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

int main() {
  bool authenticity = true;
  int N, a, alice = 0, bob = 0;
  
  cin >> N;
  vector<int> nue(N);
  
  for (int i = 0; i < N; i++) cin >> nue.at(i);
  
  sort(nue.begin(), nue.end());
  reverse(nue.begin(), nue.end());
  
  for (int i = 0; i < N; i += 2) {
    alice += nue.at(i);
    if (i + 1 < N) bob += nue.at(i + 1);
  }
  
  cout << alice - bob << endl;
}


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



int gcd2(int a,int b)
{
	if(a==0) 
      return b;
  return gcd2(b % a,a);//ユークリッドの互除法を実装してます
}

int gcd(int a,int b,int c)
{
	return gcd2(a,gcd2(b,c));
}

int main() {
	int k;
	cin>>k;
  	
  	ll sum=0;
  	for(int d=1;d<=k;d++){
      for(int e=1;e<=k;e++){
        for(int f=1;f<=k;f++){
          sum += gcd(d,e,f);//abcにすると上とかぶるからだめなのね
        }
      }
    }
  
  cout<<sum;
  return 0;
}

Measured memory_bytes: 3640
N,M=map(int,input().split())
X_list=list(map(int,input().split()))

if(N>=M):
    print(0)
else:
    X_list.sort()
    L_list=list()
    
    for i in range(M-1):
        L_list.append(abs(X_list[i+1]-X_list[i]))
    
    L_list.sort()
    L_list.reverse()
    
    for i in range(M-N):
        L_list.pop()
        
    ans=(max(X_list)-min(X_list))-sum(L_list)
    
    print(ans)

Measured memory_bytes: 13968
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int h = sc.nextInt();
		int a = sc.nextInt();

		int i;
		for (i = 0; h > 0; i++) {
			h -= a;
		}
		System.out.println(i);
	}
}

Measured memory_bytes: 22740
/*input
37564
whydidyoudesertme
*/

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

// from atcoder live
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1e9+7;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
  mint p(int n, int k) {
    return fact[n]*ifact[n-k];
  }
};

int main() {
  int k, n;
  string s;
  cin >> k >> s;
  n = s.size();
  combination c(n+k);
  mint ans = 0;
  for (int i = 0; i <= k; ++i) {
    mint now = mint(26).pow(k-i);
    now *= mint(25).pow(i);
    now *= c(n-1+i, n-1);
    ans += now;
  }
  cout << ans << endl;
}

Measured memory_bytes: 35628
#include<bits/stdc++.h>
#include<numeric>
#include<cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#define ll long long int
#define CON 100010
const long long mod=1e9+7;
const int INF=1001001001;
const int inf=100000;
//const ll inf=1e9+7;
//const ll ful=1e18;
using namespace std;
//namespace mp = boost::multiprecision;
int main() 
{
	int n,k;
	cin>>n>>k;
	vector<int> p(n);
	for(int i=0;i<n;i++)
	{
		cin>>p[i];
	}
	sort(p.begin(),p.end());
	ll ans=0;
	for(int i=0;i<k;i++)
	{
		ans+=p[i];
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 3592
#include<stdio.h>
int main()
{
	int i,j,max,temp;
	int ya[10];
	
	for(i=0;i<10;i++)scanf("%d",&ya[i]);
	for(i=0;i<10;i++){
		max=i;
		for(j=i+1;j<10;j++){
			if(ya[max]<ya[j]){
				temp=ya[max];
				ya[max]=ya[j];
				ya[j]=temp;
			}
		}
	}
		for(i=0;i<3;i++)printf("%d\n",ya[i]);
		return 0;
	
}

Measured memory_bytes: 600
import java.util.Scanner;

public class Main {

	public static void main (String[] args) {

		Main main = new Main();
		main.solve();
	}

	private void solve() {
		Scanner scanner = new Scanner (System.in);

		int maximum = 1;
		int number = scanner.nextInt();
		int[] list = new int [number];

		for (int index=0; index<number; index++) {
			list[index]=scanner.nextInt();
		}
		for (int index=0; index+1<number; index++) {
			int first = list[index];
			int second = list[index+1];
			int temp = find(first, second);

			if (index!=0) {
				temp = find (maximum,temp);

				if (temp<maximum) {
					maximum=temp;
				}

			} else {
				maximum=temp;
			}

		}

		System.out.println(maximum);
	}

	private int  find(int first, int second) {

		if (first<second) {
			find (second, first);
		}

		if (second==0) {
			return first;
		} else {
			first = find(second, (first%second));
		}

		return first;
	}
}


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

using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using ldouble = long double;
 
const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s) cout << fixed << setprecision(10) << s << endl;

ll res;

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

    res = 1;
    for (ll i = 0; i < a; i++)
    {
        res = min(res * 2, res + b);
    }

    println(res);
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define each(a, x) for (auto& a : (x))
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define int long long
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
const int MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;

void input() {
  ;
  ;
  int a, b, c;
  cin >> a >> b >> c;
  bool ans = false;
  if (a == b) {
    if (a != c) {
      ans = true;
    } else {
      ans = false;
    }
  } else if (b == c) {
    if (a != b) {
      ans = true;
    } else {
      ans = false;
    }
  } else if (a == c) {
    if (b != a) {
      ans = true;
    } else {
      ans = false;
    }
  } else {
    ans = false;
  }
  cout << (ans ? "Yes" : "No") << endl;
}
void solve() {
  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main(){
long long i,j,k,l,m,n,p,q;
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
while(cin>>p){
    q=100;n=0;
    while(q<p){n++;
    q+=(q/100);
    }
    cout<<n<<endl;
} return 0;
}


Measured memory_bytes: 3648
#include <cstring>
#include <functional>
#include <iostream>
#include <string>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

const int vx[4] = {0, 1, 0, -1}, vy[4] = {1, 0, -1, 0};

int W, H;
std::string s[21];
bool is_searched[21][21];

int dfs(int x, int y) {
	int ret = 0;
	is_searched[x][y] = true;

	for(int i = 0; i < 4; ++i) {
		int nx = x + vx[i], ny = y + vy[i];

		if(0 <= nx && nx < H && 0 <= ny && ny < W &&
		   !is_searched[nx][ny] && s[nx][ny] == '.') {

			ret += dfs(nx, ny) + 1;
		}
	}

	return ret;
}

int solve() {
	int ret = 0;
	int sx, sy;

	std::memset(is_searched, false, sizeof is_searched);

	for(int i = 0; i < H; ++i) {
		for(int j = 0; j < W; ++j) {
			if(s[i][j] == '@') {
				sx = i, sy = j;
				break;
			}
		}
	}

	ret = dfs(sx, sy) + 1; // +1 は'@' の分

	return ret;
}

int main() {

	while(cin >> W >> H, W | H) {
		for(int i = 0; i < H; ++i) {
			cin >> s[i];
		}

		int ans = solve();

		cout << ans << endl;
	}

	return 0;
}



Measured memory_bytes: 3092
def nC2(n):
    return n * (n - 1) // 2


def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    cnt_list = [0] * n  # 各番号が書かれたボールが何個あるか

    for a in a_list:
        cnt_list[a - 1] += 1

    total_method = 0
    for i in range(n):
        total_method += nC2(cnt_list[i])

    for k in range(n):
        ans = total_method
        num_k = cnt_list[a_list[k] - 1]  # k番目のボールに書かれた数字が何個あるか
        ans -= nC2(num_k)
        num_k -= 1
        ans += nC2(num_k)
        print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 100776
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class A { public static void Main() => (new Solver()).Solve(); }

public class Solver
{
	public void Solve()
	{
		switch(GetLong() % 10)
		{
			case 3:
				WriteLine("bon");
				break;
			
			case 0:
			case 1:
			case 6:
			case 8:
				WriteLine("pon");
				break;

			default:
				WriteLine("hon");
				break;
		}
	}
}

public static class MyIO
{
	private static string[] args = new string[0];
	private static int cnt = 0;
	private static IEnumerable<string> getArgs(long N) => Range(0, N).Select(_ => getArg());
	private static string getArg()
	{
		if(cnt == args.Length) { args = Console.ReadLine().Split(); cnt = 0; }
		return args[cnt++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => getArgs(N).Select(int.Parse).ToArray();
	public static long[] GetLongs(long N) => getArgs(N).Select(long.Parse).ToArray();
	public static double[] GetDoubles(long N) => getArgs(N).Select(double.Parse).ToArray();
	public static decimal[] GetDecimals(long N) => getArgs(N).Select(decimal.Parse).ToArray();
	public static string[] GetStrings(long N) => getArgs(N).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) < 0) x = y; }
	public static void chmin<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) > 0)	x = y; }
	public static void swap<T>(ref T x, ref T y) { T tmp = x; x = y; y = tmp; }
	public static long rightShift(long x, long y) => (x >> (int)y);
	public static long leftShift(long x, long y) => (x << (int)y);
	public static bool contains(long s, long x) => (rightShift(s, x) & 1L) == 1L;
	public static long gcd(long x, long y) => (y == 0) ? x : gcd(y, x % y);
	public static long lcm(long x, long y) => (x / gcd(x,y)) * y;	
	public static IEnumerable<int> Range(long start, long count) => Enumerable.Range((int)start, (int)count);
	public static void Sort(this List<string> source) => source.Sort(StringComparer.Ordinal);
}


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

using namespace std;

int main(void){
  int m, f, r, s;
  while(true){
    scanf("%d %d %d", &m, &f, &r);
    if(m == -1 && f == -1 && r == -1){
      return 0;
    }

    s = m + f;
    if(m == -1 || f == -1){
      puts("F");
    }else if(s >= 80){
      puts("A");
    }else if(s >= 65){
      puts("B");
    }else if(s >= 50){
      puts("C");
    }else if(s >= 30){
      if(r >= 50){
        puts("C");
      }else{
        puts("D");
      }
    }else{
      puts("F");
    }
  }
}



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

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

  // ここにプログラムを追記
  string arare;
  for (int i = 0; i < N; i++) {
    cin >> arare;
    if (arare == "Y") {
      cout << "Four" <<endl;
      break;
    }
    if (i + 1 == N)
      cout << "Three" <<endl;
  }
}



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

using namespace std;

#define all(x) begin(x), end(x)

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;

constexpr int MOD = 1e9 + 7;

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

    // dp[i][j] = number of permutations of length i that end with j
    // when you insert j, everything that was >= j goes up by 1
    // if s[i] = <
    // dp[i][j] = sum_{k <= j} dp[i - 1][k]
    // else
    // dp[i][j] = sum_{k > j} dp[i - 1][k]
    // keep dem prefix sums

    int n;
    string s;
    cin >> n >> s;

    vector<vi> dp(n, vi(n, 0));
    dp[0][0] = 1;
    for (int i = 1; i < n; ++i) {
        if (s[i - 1] == '<') {
            for (int j = 1; j <= i; ++j) {
                dp[i][j] = dp[i - 1][j - 1];
            }
        } else {
            for (int j = 0; j < i; ++j) {
                dp[i][j] = dp[i - 1][i - 1] - (j ? dp[i - 1][j - 1] : 0);
                if (dp[i][j] < 0)
                    dp[i][j] += MOD;
            }
        }

        for (int j = 1; j <= i; ++j) {
            dp[i][j] += dp[i][j - 1];
            if (dp[i][j] >= MOD)
                dp[i][j] -= MOD;
        }
    }

    cout << dp[n - 1][n - 1] << '\n';
    
    return 0;
}


Measured memory_bytes: 35584
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair < int, int >
#define F first
#define S second
#define int  long long int
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
using namespace std;
/// age ye mosh dp ro baze dashti dp tedad baz shodeye baste nashode yadet nare !!
/// joooob zadam

int32_t main(){
    ll n;
    cin >> n;
    cout << (n-1)/2;    
}


Measured memory_bytes: 256
// Believe in yourself
#include<bits/stdc++.h>
#include<ctime>

using namespace std;

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

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define Pair vector<pair<ll,ll>>
#define vec vector <ll> 
#define all(a) a.begin(),a.end()
#define mo 1000000007
#define decimal(i,n) fixed << setprecision(i) << n
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define show_nl(a) for(auto xyz:a)cout<<xyz<<endl;


void eea(ll a,ll b,ll &x,ll &y)
{
    if (a == 1)
    {
        x = 1; y = 0;
        return;
    }
    ll x1, y1;
    eea(b%a,a,x1,y1);
    x=y1-(b/a)*x1;
    y=x1;
}
ll mi(ll a,ll m)
{
    ll x,y;
    eea(a,m,x,y);
    x= (x%m+m)%m;
    return x;
}

void Sieve(int n) 
{ 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
    for (int p=2; p<=n; p++) 
    {
        
    }       
}

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

ll binary(ll r,ll l,ll a[])
{
    
}

/*
Enter the test case


Some helpful points
1.) Calm yourself
2.) check for semicolon or data type mismatch
3.) It can be solved
*/

int main()
{
    // clock_t time_req;
    // time_req = clock();
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);    
    ll t=1;
    // cin>>t;
    while(t--)
    {
       string s;
      cin>>s;
      int a=0;
      for(int i=0;i<s.size();i++)
      {
         a=a+(int)(s[i]-48);
      }
      if(a%9==0)
        cout<<"Yes\n";
      else
        cout<<"No\n";
    }
    // time_req = clock()-time_req;
    // cout<<"Time taken: "<<(float)time_req/CLOCKS_PER_SEC<<"s"<<endl;
}



Measured memory_bytes: 3784
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;


int main(){
    int n;
    int count = 0;
    cin >> n;
    
    vector<int> x(n);
    for (int i = 0; i < n; i++){
        cin >> x.at(i);
    }
    vector<int> y(n);
    y = x;
    sort(x.begin(),x.end());
    for(int i = 0; i < n; i++){
        if(x.at(i) != y.at(i)){
            count++;
        }
    }
    if(count == 0 || count == 2){
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
    
}


Measured memory_bytes: 256