akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include<stdio.h>
 
using namespace std;
 
#pragma GCC optimize("Ofast")

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}


int main(){
    long long int N;
    cin >> N;
    double U=sqrt(N);
    long long int limit=pow(10,6);
    if(N==2 || N==1){
        cout << 2;
    }
    
    else{
    for(long long int num=N; num<limit;++num){
        if(IsPrime(num)){
            cout <<num ;
            break;
        }
    }

    }

}

Measured memory_bytes: 512
s = input()
alpha = [0]*26
l = []
l.append('KIHBR')
l.append('AKIHBR')
l.append('KIHABR')
l.append('KIHBAR')
l.append('KIHBRA')

l.append('AKIHABR')
l.append('AKIHBAR')
l.append('AKIHBRA')
l.append('KIHABAR')
l.append('KIHABRA')
l.append('KIHBARA')
l.append('AKIHABAR')
l.append('KIHABARA')
l.append('AKIHBARA')
l.append('AKIHABRA')
l.append('AKIHABARA')
if s in l:
    print("YES")
else:
    print("NO")




Measured memory_bytes: 3064
#include <stdio.h>
int main(void){
    int n,m[100001]={},i,s1=0,s2=0;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        m[a[i]]=3-(m[a[i]]?m[a[i]]:2);
    }
    for(i=1;i<100001;i++){
        switch(m[i]){
            case 0: break;
            case 1: s1++;break;
            case 2: s2++;break;
        }
    }
    printf("%d",s1+(s2/2)*2);
}

Measured memory_bytes: 896
#include <iostream>
#include <stdio.h>
using namespace std;
int main(int argc, const char * argv[]) {
    int a,b,c,d;
    double e;
    cin >> a >> b;
    c = a/b;
    d =a%b;
    e= 1.0*a/b;
     printf("%d %d %.8lf\n",c,d,e);
    return 0;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define OUTPUT_PERMUTATION(n) do{VI v(n); iota(ALL(v), 1); do{REPx(x, v) cout << x << " "; ENDL} while(next_permutation(ALL(v)));} while(0);
#define MAKE_PERMUTATION(n) do{VVI a(fact(n), VI(n)); int idx = 0; VI v(n); iota(ALL(v), 1); do{REP(i, n) a[idx][i] = v[i]; idx++; PER = a;} while(next_permutation(ALL(v)));} while(0); // int fact(), VVI PERを宣言しておく
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
using VD = vector<double>;
const int INF = 1e9;
const LL MOD = 1e9 + 7;

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

void END(){cout << 1 << endl; exit(0);}

int r, s, p;
int judge(char you, char me)
{
  int res = 0;
  if (you == 'r' && me == 'p') res = p;
  else if (you == 's' && me == 'r') res = r;
  else if (you == 'p' && me == 's') res = s;
  return res;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k, ans = 0;
  string t;
  cin >> n >> k >> r >> s >> p >> t;
  VC rsp = {'r', 's', 'p'};
  REP(i, k)
  {
    string tmp = "";
    for (int j = i; j < n; j += k) tmp += t[j];
    VVI dp(3, VI(tmp.size(), 0));
    REP(i, 3) dp[i][0] = judge(tmp[0], rsp[i]);
    REP2(j, 1, tmp.size()) REP(k, 3) REP(l, 3)
    {
      if (k == l) continue;
      chmax(dp[k][j], dp[l][j-1]+ judge(tmp[j], rsp[k]));
    }
    int a = 0;
    REP(i, 3) chmax(a, dp[i][tmp.size()-1]);
    ans += a;
  }
  cout << ans;

  return 0;
}


Measured memory_bytes: 2176
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
int N, M;
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> N >> M, N or M)
    {
        vector<pair<int, int>> v;
        for(int i = 0; i < N; i++)
        {
            int D, P; cin >> D >> P;
            v.push_back(make_pair(P, D));
        }
        sort(v.begin(), v.end(), greater<pair<int, int>>());
        ll ans = 0;
        for(int i = 0; i < N; i++)
        {
            ll num = min(M, v[i].second);
            ans += (v[i].second - num) * v[i].first;
            M -= num;
        }
        cout << ans << endl;
    }
    return 0;
}




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

using namespace std;

int main(int argc, char *argv[]) {
    int N;
    cin >> N;
    vector<int> arr(N);
    for (int i = 0; i < N; i++) {
        cin >> arr[i];
    }

    double m = 0;
    for (int j = 0; j < N; j++) {
        double c = arr[j] * 1.0;
        m += 1.0 / c;
    }

    cout << setprecision(15) << 1.0 / m << endl;

    return 0;
}


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

int main() {
    int i = 1;
    int x;
    cin >> x;
    for (int i = 1; x != 0; i++) {
        cout << "Case " << i << ": " << x << "\n";
        cin >> x;
    }
    cout << flush;
    return 0;
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long int

int main()
{
    ll n,i,a,ans=0;
    cin>>n;
    ll prev;
    cin>>prev;
    for(i=1;i<n;i++)
    {
        cin>>a;
        if(a>=prev)
        {
            prev=a;
        }
        else
        {
            ans+=prev-a;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3580
#include <iostream>			// 백준 12840

using namespace std;

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

	int a, b, c;

	cin >> a >> b >> c;

	cout << c << " " << a << " " << b;
	
	return 0;
}


Measured memory_bytes: 256
l=list(map(int,input().split()))
l.sort()
cnt=0
cnt+=l[2]-l[1]
l[0]+=l[2]-l[1]
l[1]=l[2]
if (l[1]-l[0])%2!=0:
    l[1]+=1
    l[2]+=1
    cnt+=1
cnt+=(l[1]-l[0])//2
print(cnt)

Measured memory_bytes: 9152
package main

import (
	"fmt"
)

func main() {
	var n, x, y int
	fmt.Scanf("%d %d %d", &n, &x, &y)

	// index is from 1 to n - 1 (do not use 0)
	countForK := make([]int, n)

	for i := 1; i <= n-1; i++ {
		for j := i + 1; j <= n; j++ {
			dNormal := j - i

			dXToI := x - i
			if dXToI < 0 {
				dXToI = -dXToI
			}
			dYToJ := y - j
			if dYToJ < 0 {
				dYToJ = -dYToJ
			}
			dShortcut := dXToI + 1 + dYToJ

			k := dNormal
			if dShortcut < dNormal {
				k = dShortcut
			}

			countForK[k]++
		}
	}

	for k := 1; k <= n-1; k++ {
		fmt.Println(countForK[k])
	}
}


Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] strArr = br.readLine().split(" ");
		int[] arr = new int[6];
		for (int i = 0; i < 6; i++) {
			arr[i] = Integer.parseInt(strArr[i]);
		}
		Dice dice = new Dice(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);
		dice.roll(br.readLine());
		System.out.println(dice.getFace());
	}

}

class Dice {
	int[] num;

	{
		num = new int[6];
	}

	Dice(int a, int b, int c, int d, int e, int f) {
		super();
		num[0] = a;
		num[1] = b;
		num[2] = c;
		num[3] = d;
		num[4] = e;
		num[5] = f;
	}

	public int getFace() {
		return new Integer(num[0]);
	}

	void roll(String s) {
		for (int i = 0; i < s.length(); i++) {
			roll(s.charAt(i));
		}
	}

	void roll(char c) {
		int[] temp = new int[6];
		switch (c) {
		case 'N':
			temp[0] = num[1];
			temp[1] = num[5];
			temp[2] = num[2];
			temp[3] = num[3];
			temp[4] = num[0];
			temp[5] = num[4];
			break;
		case 'W':
			temp[0] = num[2];
			temp[1] = num[1];
			temp[2] = num[5];
			temp[3] = num[0];
			temp[4] = num[4];
			temp[5] = num[3];
			break;
		case 'E':
			temp[0] = num[3];
			temp[1] = num[1];
			temp[2] = num[0];
			temp[3] = num[5];
			temp[4] = num[4];
			temp[5] = num[2];
			break;
		case 'S':
			temp[0] = num[4];
			temp[1] = num[0];
			temp[2] = num[2];
			temp[3] = num[3];
			temp[4] = num[5];
			temp[5] = num[1];
			break;
		default:
		}
		num = temp;
	}

}

Measured memory_bytes: 17092
#include <bits/stdc++.h>
#define turbo cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define ll long long
#define pii pair<int,int>
#define f first
#define pb push_back
#define mp make_pair
#define inf 999999999999999

using namespace std;

ll tab[100005];
ll dp[100005];

int main(){
    turbo
    ll n,x,k;
    cin >> n >> k;
    for(ll i=1;i<=n;i++){
      cin >> tab[i];
    }
    for(ll i=2;i<=n;i++){
      ll mini = inf;
      mini = inf;
      for(ll j=1;j<=k and i-j>0;j++){
        mini = min(dp[i-j]+abs(tab[i]-tab[i-j]),mini);
      }
      dp[i]=mini;
    }
    cout << dp[n] << "\n";

    return 0;
}


Measured memory_bytes: 1792
//42
#include<iostream>
#include<algorithm>
#include<utility>

using namespace std;

int main(){
  for(int n;cin>>n,n;){
    pair<int,int> is[25];
    for(int i=0;i<n;i++){
      int t,b;
      cin>>t>>b;
      is[i]=make_pair(b,t);
    }
    sort(is,is+n);
    int j;
    int s=0;
    for(j=0;j<n;j++){
      s+=is[j].second;
      if(is[j].first<s)break;
    }
    cout<<((j<n)?"No":"Yes")<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include <iomanip>
using namespace std;



int main(){
	int n,m,max=0,b=0;
	vector<pair<string,int>>a(10000000);
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i].first;
		a[i].second=1;
	}
	cin>>m;
	for(int i=0;i<m;i++){
		cin>>a[n+i].first;
		a[n+i].second=-1;
	}
	sort(a.begin(),a.end(),greater<>());

	for(int i=0;i<m+n;i++){
		if(i!=0){
			if(a[i-1].first==a[i].first){
				
			}
			else{
				if(max<b){
					max=b;
				}
				b=0;
			}
		}
		b+=a[i].second;
	}
	if(max<b){
					max=b;
				}
	
	cout<<max<<endl;
	
	
    return 0;
}

Measured memory_bytes: 156544
A, B, C, D = map(int, input().split())
counter = 1
while A > 0 and C > 0:
    if counter % 2 == 1:
        '''T 攻击'''
        C -= B
    elif counter % 2 == 0:
        A -= D
    counter += 1
if A <= 0:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 9180
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
template<class T> void print(const T& t){ cout << t << endl; }
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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  vl a(n);
  rep(i,n){
    cin >> a[i];
  }
  ll money = 1000;
  ll stack = 0;
  rep(i, n-1){
    if(a[i]<a[i+1]){
      stack += money / a[i];
      money -= a[i] * (money / a[i]);
    }
    else if(a[i]>a[i+1]){
      money += a[i]*stack;
      stack = 0;
    }
  }
  money += a[n - 1] * stack;
  print(money);
}

Measured memory_bytes: 3632
# define
BIT = [0] * 20
frac = [1] * 20
ckn = [[0] * 20] * 20
maxN = 10
ans = [0] * 2

# BIT
def upd(pos, val) :
    i = pos
    while i <= maxN:
        BIT[i] += val
        i += (i & (-i))
def get(pos):
    res = 0
    i = pos
    while i > 0:
        res += BIT[i]
        i -= (i & (-i))
    return res
# calculation
def prepare():
    for i in range(1, maxN): frac[i] = frac[i - 1] * i
    for i in range(0, maxN):
        ckn[0][i] = 1
    for i in range(1, maxN):
        for j in range(i, maxN):
            ckn[i][j] = ckn[i - 1][j - 1] + ckn[i][j - 1]

# Main
prepare()
n = int(input())

for i in range(0, 2):
    for j in range(0, maxN): BIT[j] = 0
    s = input()

    for j in range(0, n) :
        x = int(s.split()[j])
        ans[i] += (x - 1 - get(x)) * frac[n - j - 1]
        upd(x, 1)

print(abs(ans[0] - ans[1]))


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

int main() {
  int n;
  cin >> n;
  string ans="No",s=to_string(n);
  
  for(int i=0;i<3;i++){
    if(s[i]=='7')ans="Yes";
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3688
#include <bits/stdc++.h>
#define pb push_back
typedef long long ll;
using namespace std;
ll n;
ll a[505];
int main()
{
        cin >> n;
        for(ll i=1;i<=n;i++) cin >> a[i];
        ll ans = 0;
        for(ll i=1; i <= n ; i++) {
                if(a[i] == a[i-1]) {
                        ans += 1;
                        i += 1;
                }
        }
        cout << ans << endl;
        return 0;
}


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

using namespace std;

// Repetitions
#define FOR(i,a,n) for(ll i = ((ll) a); i < ((ll) n); ++i)
#define FORR(i, s, g) for(ll i = ((ll)s - 1); i >= ((ll) g); --i)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) FORR(i, n, 0)

// Container Utils
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define SORTALL(v) sort(ALL(v))
#define SZ(a) int((a).size())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())

// For Debug
#define DMP(x)  cerr << #x << " = " << (x) << endl
#define DBG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

// Aliases
#define PB push_back
#define MP make_pair
using ll = long long;
using ld = long double;
using str = string;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vs = vector<str>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

// Constant variables
const ld PI = (acos(-1));
const ll MOD = 1000000007;

// I/O Asynchronizing
struct __io_async{
    __io_async(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
};

int main() {
    int n;
    cin >> n;
    map<str, int> cnt;
    int max_cnt = 0;
    REP(i, n) {
        str s;
        cin >> s;
        cnt[s]++;
        max_cnt = max(max_cnt, cnt[s]);
    }
    vs ans;
    for(pair<str, int> kv: cnt) {
        if(kv.second == max_cnt) ans.push_back(kv.first);
    }
    SORTALL(ans);
    REP(i, ans.size()) {
        cout << ans[i] << "\n";
    }

    return 0;
}


Measured memory_bytes: 26868
import java.util.*
import java.io.PrintWriter

val pw = PrintWriter(System.out)
val MOD = 1000000007L
val INF = 2147483647
val LINF = 9223372036854775807L

fun main(args: Array<String>){
    solve()
    pw.flush()    
}

fun solve(){
    val list = nextIntList()
    val s = nextAryln(list.first())
    val t = s.sorted()
    println(t.joinToString(""))
}


// Print
fun println(v: String){
    pw.println(v)
}
fun print(v: String){
    pw.print(v)
}

// Read
fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = next().split(" ").map{ it.toInt() }
fun nextLongList() = next().split(" ").map{ it.toLong() }
fun nextDoubleList() = next().split(" ").map{ it.toDouble() }
fun nextAryln(n: Int) = Array(n){ next() }
fun nextIntAryln(n: Int) = IntArray(n){ nextInt() }
fun nextLongAryln(n: Int) = LongArray(n){ nextLong() }
fun nextDoubleAryln(n: Int) = DoubleArray(n) { nextDouble() }

// Math
fun abs(n: Long) : Long = Math.abs(n)
fun abs(n: Double) : Double = Math.abs(n)
fun max(a: Long = -LINF, b: Long = -LINF, c: Long = -LINF, d: Long = -LINF, e: Long = -LINF): Long = listOf(a, b, c, d, e).max()!!.toLong()
fun min(a: Long = LINF, b: Long = LINF, c: Long = LINF, d: Long = LINF, e: Long = LINF): Long = listOf(a, b, c, d, e).min()!!.toLong()
fun prime(from: Long, to: Long = from) : List<Long>{
    return (from..to).filter{ i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all{ j -> i % j != 0L}
    }
}
fun gcd(a: Long, b: Long) : Long = if(a % b == 0L) b else gcd(b, (a % b))
fun lcm(a: Long, b: Long) : Long = a / gcd(a, b) * b
fun modpow(a: Long, n: Long, p:Long = MOD) : Long {
    var res = 1L
    var ar = a
    var nr = n
    while(nr > 0){
        if((nr and 1) == 1L) res = res * ar % p
        ar = ar * ar % p
        nr = nr shr 1
    }
    return res
}
fun modinv(a: Long, p: Long = MOD) : Long = modpow(a, p - 2, p)
fun ncr(n: Long, r: Long) : Long {
    var a = 1L
    var b = 1L
    for (i in 1..r) {
        a = a * (n + 1 - i) % MOD
        b = b * i % MOD
    }
    return modinv(b, MOD) * a % MOD
}


Measured memory_bytes: 37804
/*
    Author: Alam Khan
    AUST CSE 40th Batch

*/

#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef deque<ll> dl;
typedef stack<ll> stl;
typedef set<ll> sl;
typedef map<string, ll> msl;
typedef map<ll,ll> mll;
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
#define sf(n)     scanf("%lld",&n)
#define sff(n,m)     scanf("%lld %lld",&n,&m)
#define sfff(n,m,r)     scanf("%lld %lld %lld",&n,&m,&r)
#define sfs(n)     scanf("%s",n)
#define pf(n)     printf("%lld\n",n)
#define pff(n,m)     printf("%lld %lld\n",n,m)
#define pfff(n,m,r)     printf("%lld %lld %lld\n",n,m,r)
#define pfs(n)     printf("%s\n",n)
#define pfcs(i,n)     printf("Case %lld: %lld\n",i,n)
#define pb     push_back
#define prf     printf
#define inf     2e18
#define low     -1000000000000
#define PI        acos(-1.0)
#define rep1(i,n) for(i=1;i<n;i++)
#define rep0(i,n) for(i=0;i<n;i++)
#define rep(i,a,n) for(i=a;i<n;i++)
#define repe1(i,n) for(i=1;i<=n;i++)
#define repe0(i,n) for(i=0;i<=n;i++)
#define repe(i,a,n) for(i=a;i<=n;i++)
#define endl  "\n"
#define FAST  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr freopen("input.txt","r",stdin)
#define fw freopen("output.txt","w",stdout)

int main()
{
    ll i,n,t,k,j,x=0,y=0,m;
    cin>>x;
    x = x%10;
    if(x==2 || x==4 ||x==5 || x==7 || x==9)
        cout<<"hon"<<endl;
    else if(x==3)
        cout<<"bon"<<endl;
    else cout<<"pon"<<endl;
    return 0;
}



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

using namespace std;
long long a[300005];
int main(){
    int  n,k;
    long long sum = 0LL;
    scanf("%d%d",&n,&k);
    if(k>=n) return !printf("0");
    for(int i =1;i<=n;i++){
        scanf("%lld",&a[i]);
        sum+=a[i];
    }
    sort(a+1,a+n+1);
    for(int i = n; i > n - k; i--){
        sum-=a[i];
    }
    printf("%lld",sum);

}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define INIT(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define INIT2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

// a+b = hK
// b+c = iK
// c+a = jK
// a+b+c = (h+i+j)*K/2
// a = ( h-i+j)/2 * K
// b = ( h+i-j)/2 * K
// c = (-h+i+j)/2 * K


int main(){
  ll N,K; cin>>N>>K;
  ll r;
  ll n = N/K;
  r = pow(n,3);
  if(K%2==0){
    n = (N+K/2)/K;
    r += pow(n,3);
  }
  cout << r;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
    int N, X, sum=0, mao=0, k;
    cin>>N>>X;
    while (N--) {
        cin>>k;
        sum+=k;
        if(sum>X) {
            break;
        }
        mao++;
    }
    cout<<mao+1<<endl;
}


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

int main() {
    int n;
    cin >> n;
    int a[100010];
    for(int i = 0; i < n; ++i) cin >> a[i];
    
    int index = 0;
    int i = 1;
    for(i = 1; i < n; ++i) {
        if(a[index] == 2) break;
        
        index = a[index] - 1;
    }
    
    if(i == n) cout << -1 << endl;
    else cout << i << endl;
}


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


int main(){
    int N;
    cin>>N;
    vector<int> a(N);

    for(int i=0;i<N;i++){
        cin>>a[i];
    }


    vector<bool> full(N+1,false);
    int m=0;
    for(int i=N;i>=1;i--){
        int tmp=0;
        for(int j=i;j<=N;j+=i){
            if(full[j]) tmp++;
        }
        if(tmp%2!=a[i-1]) {
            full[i]=true;
            m++;
        }
    }
    cout<<m<<endl;
    for(int i=1;i<=N;i++){
        if(full[i]) cout<<i<<" ";
    }
    cout<<endl;
    
    return 0;
}


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

int main() {
	int N;
	cin >> N;
	vector<int> d(13, 0), single;
	++d[0];
	for(int i=0; i<N; ++i){
	    int a;
	    cin >> a;
	    ++d[a];
	}
	int ans=12;
	for(int i=0; i<=12; ++i){
	    if(d[i]>2) ans=0;
	    if(d[i]==0) continue;
	    if(d[i]==1) single.push_back(i);
	    for(int j=0; j<=12; ++j){
	        if(i==j){
	            if(d[i]==2) ans=min(ans, min(i*2, 24-i*2));
	        }
	        else if(d[j]==0) continue;
	        else if(d[i]==2 || d[j]==2) ans=min(ans, abs(i-j));
	        else ans=min(ans, min(i+j, 24-i-j));
	    }
	}
	for(int i=0; i+2<single.size(); ++i) ans=min(ans, single[i+2]-single[i]);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
def gcd(a, b)
  a, b = b, a if a < b
  mod = a % b
  if mod == 0
    b
  else
    gcd(b, mod)
  end
end

def lcm(a, b)
  a * b / gcd(a, b)
end

while line = gets
  a, b = line.chomp.split.map(&:to_i)
  puts "#{gcd(a, b)} #{lcm(a, b)}"
end

Measured memory_bytes: 8676
//ヘッダー
#include<bits/stdc++.h>
using namespace std;

//型定義
typedef long long ll;

//定数
const int INF=1e+9;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値
// xのn乗%modを計算
ll mod_pow(ll x, ll n, ll mod){
    ll res = 1;
    while(n > 0){
        if(n & 1) res = res*x%mod;
        x = x*x%mod;
        n >>= 1;
    }
    return res;
}

int main(){
    string L;
    cin>>L;
    int N=L.size();
    auto dp=make_vec<ll>(N+1,2);
    dp[0][0]=1;
    dp[0][1]=0;
    REP(i,N){
        int L_i=L[i]-'0';
        REP(j,2){
            REP(k,j ? 2 : (L_i+1)){
                dp[i+1][j||k<L_i]+=(dp[i][j]*(k+1));
                dp[i+1][j||k<L_i]%=MOD;
            }
        }
    }
    cout<<((dp[N][0]+dp[N][1])%MOD)<<endl;
}

Measured memory_bytes: 5760
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int maxn=330;
int map[maxn][maxn],ma[maxn][maxn],n;
int main(){
	int i,j,k;
	while(scanf("%d",&n)!=EOF){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				scanf("%d",&map[i][j]);
				ma[i][j]=map[i][j];
			}
		}
		for(k=0;k<n;k++){
			for(i=0;i<n;i++){
				for(j=0;j<n;j++){
					if(ma[i][j]>ma[i][k]+ma[k][j])
						ma[i][j]=ma[i][k]+ma[k][j];
				}
			}
		}
		int flag=0;
		for(i=0;i<n;i++){
			for(j=0;j<n;j++)
				if(ma[i][j]!=map[i][j])
					flag=1;
		}
		long long  s=0,fond;
     	for(i=0;i<n;i++)
         	for(j=i+1;j<n;j++){
             	fond=1;
             	for(k=0;k<n;k++){
                    if(k==i||k==j) continue;
             		if(map[i][j]==map[i][k]+map[k][j])
                  		fond=0;
             	}
             	if(fond) s+=map[i][j];
         	}
		if(flag==1)
			printf("-1\n");
		else
			printf("%lld\n",s);
	}
	return 0;
}

Measured memory_bytes: 896
#include<stdio.h>

int main(void)
{
	bool *J;
	int f1, n, m, k, t, out;
	
	J = new bool [1000001];
	while(scanf("%d %d",&n, &m) && n+m > 0)
	{
		t = 0;
		out = 0;
		
		for(f1 = 1; f1 <= 1000001; f1++)
			J[f1] = false;
			
		for(f1 = 1; f1 <= n; f1++)
		{
			scanf("%d",&k);
			J[k] = true;
		}
		for(f1 = 1; f1 <= m; f1++)
		{
			scanf("%d",&k);
			J[k] = true;
		}
		for(f1 = 1; f1 <= 1000001; f1++)
		{
			if(J[f1])
			{
				if(out == 0 || f1 - t > out)
					out = f1 - t;
				t = f1;
			}
		}
		printf("%d\n",out);
	}
	return 0;
}

Measured memory_bytes: 0
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      int minv = Integer.parseInt(br.readLine());
      int n1   = Integer.parseInt(br.readLine());
      int maxv = n1- minv;
      if ( n1 < minv ) minv = n1;

      for( int i=2,r,mv; i<n; i++) {
        r = Integer.parseInt(br.readLine());
        if ( (mv = r-minv) > maxv ) maxv = mv;
        else if ( r < minv ) minv = r; 
      }

      System.out.println(maxv);
    }
  }
}


Measured memory_bytes: 42472
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;


int main()
{
//回答が整数の場合
int ans=300000000;
//整数値の入力
int n,k;
cin >> n >>k;
//行列の入力
int table[n]={};
for (int i = 0; i < n; ++i) {
    cin >> table[i];
}

int lastfu=-1;
for (int i = 0; i < n; ++i) {
    if(table[i]<0){lastfu++;}
}

int start=0,temp=0;
//cout << lastfu << endl;
if (lastfu+2>k){start=lastfu-k+2;}
for(int i = 0; i < k; ++i) {

    if(table[start]>0){temp=table[start+k-1];}
    else{temp=min(abs(table[start])+2*abs(table[start+k-1]),2*abs(table[start])+abs(table[start+k-1]));}
   // cout << temp << endl;
    if(temp<ans){ans=temp;}
    start++;
    if(start+k>n){break;}
}
if(lastfu==n-1){ans=-1*table[n-k];}

//回答
cout << ans << endl;
return 0;
}


// b^nを計算する関数
int mypow(int b, int n) {
    if (n == 0) return 1;
    if (n == 1) return b;
    if (n % 2 == 0) {
        return mypow(b * b, n / 2);
    } else {
        return mypow(b, n - 1) * b;
    }
}


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

int main(){
      int n;cin >> n;
      double ans = 0;
      for(int i = 0;i < n;i++){
            double t;cin >> t;
            string s;cin >> s;
            if(s == "JPY")ans += t;
            else ans += t * 380000;
      }
      cout << ans;
}

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

using namespace std;
#define BUF (100005)
#define ll long long 

int n;
char s[BUF];

int main(void){
	cin >> s;
	n=strlen(s);

	int z=1;
	int o=1;
	int left,right;

	if(n%2==0){
		left=n/2;
		right=n/2-1;
		int k=s[left];
		while(s[left]==k && s[right]==k){
			k=s[left];
			
			left++;
			right--;
			if(left>n-1)break;
			if(right<0 )break;
		}
		cout << left << endl;
		return 0;
	}else{
		left=n/2;
		right=n/2;
		int k=s[left];
		while(s[left]==k && s[right]==k){
			k=s[left];
			
			left++;
			right--;
			if(left>n-1)break;
			if(right<0 )break;
		}
		cout << left << endl;
		return 0;
	
	}




	return 0;
}
		


Measured memory_bytes: 384
//Shubham Vijayvargiya

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define pb push_back
#define mp make_pair
#define eb emplace_back
#define F first
#define S second
#define sz(a) (int)(a.size())
#define set(a,b) memset(a,b,sizeof(a))
#define let(x,a) __typeof(a) x(a)
#define rep(i, begin, end) for (ll i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define all(v) (v).begin(),(v).end()
#define sll(x) { scanf("%lld",&x); }
#define si(x) { scanf("%d",&x); }
#define slf(x) { scanf("%lf",&x); }
#define pll(x) { printf("%lld\n",x); }
#define pi(x) { printf("%d\n",x); }
#define tcases() long long testcases; cin>>testcases ; while(testcases--)

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " = " << arg1<<" | ";__f(comma+1, args...);
}

#else
#define trace(...)
#endif

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<long long,long long> pll;
typedef vector<long long> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;

const ll mod=1000000007;
//-----------------------------------------------------------------------------------------------------------------------------------------------//

ll a[100009],b[100009];

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

	ll n;
	sll(n);
	rep(i,0,n){
		sll(a[i]);
		sll(b[i]);
	}
	ll mn=0;
	rep(i,n,0){
		ll temp=(a[i]+mn+b[i]-1)/b[i];
		temp=temp*b[i];
		temp-=a[i];
		mn=temp;
	}
	cout<<mn<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int ans;
    if(s=="SAT")
        ans=1;
    else if(s=="SUN")
        ans=7;
    else if(s=="MON")
        ans=6;
    else if(s=="TUE")
        ans=5;
    else if(s=="WED")
        ans=4;
    else if(s=="THU")
        ans=3;
    else
        ans=2;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
import sys
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

x, t = na()

print((x - t) if x > t else 0)

Measured memory_bytes: 3060
# -*- coding: utf-8 -*-
import sys
from fractions import gcd
from string import ascii_uppercase as ABC
#input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))
N = int(input())
S, T = input().split()
ans = ""
for i in range(N):
    ans += S[i]
    ans += T[i]
print(ans)

Measured memory_bytes: 5220
program bbb
implicit none

integer :: n, i
real(8) :: res
real(8),allocatable,dimension(:) :: x
character(3),allocatable,dimension(:) :: u

read*, n
allocate(x(n),u(n))

do i=1, n
read*, x(i), u(i)
end do

res=0

do i=1,n
if(u(i)=='JPY') then
res=res+x(i)
else
res=res+x(i)*380000
end if
end do

write(*,*) res

end program

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

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

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...);}

#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define A first
#define B second
#define MOD 1000000007

typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long ll;

int mulmd(ll a, ll b){
    ll ret = (a * b) % MOD;
    return (int)ret;
}

inline int power(ll x, ll y, int p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = mulmd(res,x);
        y = y>>1;
        x = mulmd(x,x);
    }
    return (int)res;
}

int submd(ll a, ll b){
    ll ret = a-b;
    if(ret<0){
        ret+=MOD;
    }
    return (int)ret;
}

int addmd(ll a, ll b){
    ll ret = (a + b) % MOD;
    return (int)ret;
}

int phi(int n){
    int result = n;
    for(int i=2;i*i<=n;i++){
        if(n%i==0){
            while(n%i==0){
                n=n/i;
            }
            result-=result/i;
        }
    }
    if(n>1) result-=result/n;
    return result;
}

const int N = 1e5 + 5;

int arr[N];

/**
    Check out for boundary cases, (n = 1 or n = 0)
    check for integer overflow

**/

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int k, x;
    cin >> k >> x;
    for(int i = x - k + 1; i < x; i++){
        cout << i << " ";
    }
    cout << x <<" ";
    for(int i = x + 1; i < x + k; i++){
        cout << i << " ";
    }
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    double cnt = 0;
    rep(i, N) {
        int c = N;
        int now = i + 1;
        while(now < K) {
            now *= 2;
            c *= 2;
        }
        cnt += 1.0/c;
    }
    cout << setprecision(12) << cnt << endl;


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 
#define int long long
#define double long double

////////////////////////////////////////////////////////////////////
ll modpow(ll a,  ll n, const ll &MOD = MOD){
  ll ret = n == 0 ? 1 : modpow(a, n/2, MOD);
  (ret *= ret) %= MOD;
  if(n%2)((ret *= a) %= MOD);
  return ret;
}
///////////////////////___modinv___////////////////////
ll modinv(ll d, const ll &MOD = MOD){
  return modpow(d, MOD-2, MOD);
}
///////////////////////___prime_factor___////////////////////
map<int, int> prime_factor(int n){
  map<int, int> ret;
  for(int i = 2;i*i <= n;i++){
    while(n % i == 0){
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1){
    ret[n] = 1;
  }
  return ret;
}

////////////////////////////////////////////////////////////////////

int n,t[110000],a[110000],b[110000],c[110000];
signed main(){
  cin>>n;rep(i,n)cin>>t[i];rep(i,n)cin>>a[i];
  b[0] = 1;c[0] = t[0];
  repd(i,1,n){
    if(t[i-1] > t[i]){
      cout << 0 << endl;return 0;
    }else if(t[i-1] < t[i]){
      b[i] = 1;
      c[i] = t[i];
    }else{
      b[i] = t[i];
      c[i] = 0;
    }
  }
  b[n-1] = 1;
  if(c[n-1] > 0 && c[n-1] != a[n-1] || (b[n-1] != 1 && a[n-1] > b[n-1])){
    cout << 0 << endl;return 0;
  }
  for(int i = n-2;i >= 0;i--){
    if(a[i+1] > a[i]){
      cout << 0<< endl;return 0;
    }else if(a[i+1] < a[i]){
      b[i] = 1;
      if((c[i] > 0 && c[i] != a[i]) || (b[i] != 1 && a[i] > b[i])){
        cout << 0 << endl;return 0;
      }
    }else{
      if(c[i] > a[i]){
        cout << 0 << endl;return 0;
      }
      chmin(b[i], a[i]);
    }
  }
  int ans = 1;
  rep(i,n)ans = (ans*b[i])%MOD;
  cout << ans << endl;
}




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

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    for (int i=0; i<N; ++i) cin >> H[i];

    int res = 0;
    int cnt = 0;
    for(int i=0; i+1<N; ++i) {
        if(H[i] >= H[i + 1]) ++cnt;
        else {
            res = max(res, cnt);
            cnt = 0;
        }
        if(i + 2 == N) res = max(res, cnt);
    }
    cout << res << endl;
}

Measured memory_bytes: 640
k = int(input())
S = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(S[k-1])

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int X;
int Y;
int Z;
int main(){
  int res;
  rd(X);
  rd(Y);
  rd(Z);
  res = (X - Z) / (Y + Z);
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int X, Y, Z;
// {
//   int res;
//   rd(X, Y, Z);
//   res = (X - Z) / (Y + Z);
//   wt(res);
// }


Measured memory_bytes: 256
fun main(args: Array<String>) {
    abc054c()
}

fun abc054c() {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val edges = (1..m).map { readLine()!!.split(' ').map { it.toInt() }.let { Edge(it[0] - 1, it[1] - 1) } }

    val graph = Array(n) { Vertex(it) }
    edges.forEach {
        val (from, to) = it
        graph[from].neighbor.add(to)
        graph[to].neighbor.add(from)
    }

    fun dfs(index: Int, visited: Set<Int>): Int {
        val to = graph[index].neighbor.filter { it !in visited }
        return if (to.isEmpty()) {
            if (visited.size + 1 == n) 1 else 0
        } else {
            to.map { dfs(it, visited + index) }.sum()
        }
    }

    val answer = dfs(0, setOf())

    println(answer)
}

private data class Edge(val from: Int, val to: Int)
private data class Vertex(val index: Int, val neighbor: MutableList<Int> = mutableListOf())


Measured memory_bytes: 47752
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
typedef pair<int, int> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);
vector<int> v[100001];

void dfs(int t,int a[],int pare,int deep){

    if(v[t].size()==1&&v[t][0]==pare){

    }else{
        deep++;
        for(int i=0;i<v[t].size();i++){
            if(v[t][i]!=pare){
                a[v[t][i]]=deep;
                dfs(v[t][i],a,t,deep);
            }
        }
    }

}


int main() {
    int n;
    cin>>n;
    rep(i,n-1){
        int a,b;
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }

    int f[100001];
    int s[100001];
    rep(i,100001){f[i]=0;s[i]=0;}

    dfs(1,f,-1,0);
    dfs(n,s,-1,0);

    int fen = 0;
    int sun = 0;



    for(int i=1;i<=n;i++){
        f[i]<=s[i]?fen++:sun++;
        //cout<<i<<" "<<f[i]<<" "<<s[i]<<endl;
    }

    cout<<(fen>sun?"Fennec":"Snuke")<<endl;




    return 0;
}


Measured memory_bytes: 14336
h,w,k=map(int,input().split())
c=[list(input()) for _ in range(h)]
ans=0
for row in range(1<<h):
  for col in range(1<<w):
    cnt=0
    for i in range(h):
      for j in range(w):
        if (row&(1<<i))==0 and (col&(1<<j))==0 and c[i][j]=="#":
          cnt+=1
    if cnt==k:
      ans+=1
print(ans)



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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); i++)
typedef long long ll;
const int INF = 1e9;

int n, a[16][16];
ll dp[1 << 16];
ll cost[1 << 16];

int main() {
  cin >> n;
  rep(i, n) rep(j, n) cin >> a[i][j];

  // maskごとのcostの事前計算
  rep(i, 1 << n) rep(j, n) for (int k = j + 1; k < n; ++k) 
      if (i & (1 << j) && i & (1 << k))
        cost[i] += a[j][k];

  // bitDP
  rep(i, 1 << n) for (int j = i; j > 0; j = (j - 1) & i) 
    dp[i] = max(dp[i], dp[i - j] + cost[j]);

  cout << dp[(1 << n) - 1] << endl;

  return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f3f3f3f
const int maxn=1e5+5;
int dp[maxn];
int height[maxn];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>height[i];
	
	height[0]=inf;
	//从0那个位置转移来的时候可能会有问题 
	
	//每一个状态都可以由前一个或者是隔着两个的状态转移而来  
	dp[0]=dp[1]=0; 
	for(int i=2;i<=n;i++)
	{
		dp[i]=min(dp[i-1]+abs(height[i]-height[i-1]),dp[i-2]+abs(height[i]-height[i-2]));
	}
	cout<<dp[n];
	return 0;
} 

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define mod 1000000007
#define dd double
#define ld long double
#define f(i,a,b) for(ll i = a; i < b; i++)
#define fr(i,a,b) for(ll i = b;i>=a;i--)
#define vll vector<ll>
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define vpll vector< pii >
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second
#define all(v) (v).begin(),(v).end()
#define Sort(v) sort(v.begin(), v.end(), sortbysec)
#define MEM(a, b) memset(a, (b), sizeof(a))

ll power(ll x, ll y, ll p)  
{  
    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;  
}  

 

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

ll n;
cin>>n;

vll v(n);
f(i,0,n)
cin>>v[i];

sort(all(v));
ll ans = v[n-1];
ll cnt = n-2;
ll j = n-2;

while(cnt)
{
   if(cnt >= 2)
   {
       ans += 2*v[j];
       j--;
       cnt -= 2;
   }
   else
   {
       ans += v[j];
       j--;
       cnt--;
   }
}

cout<<ans<<endl;




}


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

void ioThings() {
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("io\\in.txt", "r", stdin);
    freopen("io\\out.txt", "w", stdout);
    freopen("io\\err.txt", "w", stderr);
#endif
}

using   ll        = long long;
#define debug(x)    cerr << #x << ": <" << (x) << ">\n"
#define dotc()      int tcs; if (cin >> tcs) for (int tc = 0; tc < tcs; tc++)
#define sz(x)       (int)x.size()
#define eb          emplace_back
#define pb          push_back
#define all(x)      x.begin(), x.end()
#define rall(x)     x.rbegin(), x.rend()
#define fi          first
#define se          second
#define mod         1000000007

int main() {
    ioThings();

    int n; cin >> n;
    map<string, int> votes;
    while (n--) {
        string s; cin >> s;
        votes[s]++;
    }
    int mx = max_element(all(votes), 
    [](pair<string, int> x, pair<string, int> y) { return x.se < y.se; })->se;
    for (auto& i : votes)
        if (i.se == mx)
            cout << i.fi << '\n';

    return 0;
}


Measured memory_bytes: 23808
S = input()
S_list = list(S)
N = len(S_list)
L = []
for i in range(2**(N-1)):
    tmp = []
    for j in range(N-1):
        tmp.append(S_list[j])
        if i>>j&1:
            tmp.append("+")
        else:
            tmp.append("")
    tmp.append(S_list[N-1])
    calc = "".join(tmp)
    C = calc.split("+")
    L.append(sum(map(int, C)))
print(sum(L))

Measured memory_bytes: 3064
mod = 10**9+7
n,m = map(int,raw_input().split())
def factorial(x):
	retval = 1
	for i in range(2,x+1):
		retval = (retval * i)% mod
	return retval

if abs(n-m) > 1:
	print 0
	quit()

if max(n,m) > min(n,m):
	print (factorial(max(n,m)) * factorial(min(n,m))) % mod

else :
	print ((factorial(n)**2)%mod * 2)%mod

Measured memory_bytes: 5764
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <deque>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

struct ST {
    int x, y, t, a;
    ST() {}
    ST(int x, int y, int t, int a) : x(x), y(y), t(t), a(a) {}
};

#define B (128)
int sx, sy, gx, gy, lx, ly;
int f[B*2][B*2], dp[B*2][B*2][6];

int solve() {
    memset(dp, -1, sizeof(dp));
    deque<ST> q;
    q.push_back(ST(sx, sy, 0, 0));
    while (!q.empty()) {
        ST cur = q.front();
        q.pop_front();
        const int x = cur.x, y = cur.y, t = cur.t;
        if (dp[B+x][B+y][t] != -1) continue;
        dp[B+x][B+y][t] = cur.a;
        if (x == gx && y == gy) return cur.a;
        rep (d, 6) {
            const int nx = x+dx[d], ny = y+dy[x&1][d];
            if (abs(nx) > lx || abs(ny) > ly) continue;
            if (f[B+nx][B+ny]) continue;
            if (d == abs(x*y*t)%6) q.push_front(ST(nx, ny, (t+1)%6, cur.a));
            else q.push_back(ST(nx, ny, (t+1)%6, cur.a+1));
        }
        q.push_back(ST(x, y, (t+1)%6, cur.a+1));
    }
    return -1;
}

int main() {
    scanf("%d%d%d%d", &sx, &sy, &gx, &gy);
    int n;
    scanf("%d", &n);
    rep (_, n) {
        int x, y;
        scanf("%d%d", &x, &y);
        f[B+x][B+y] = 1;
    }
    scanf("%d%d", &lx, &ly);
    printf("%d\n", solve());
    return 0;
}

Measured memory_bytes: 3380
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int K, A, B;
  cin >> K >> A >> B;
  
  string s = "NG";
  
  for (int i = A; i <= B; i++)
  {
    if (i % K == 0)
    {
      s = "OK";
      break;
    }
  }
  
  cout << s << endl;
}

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

using namespace std;

namespace Tzh{
	
	int n,ans; char s[200];

	void work(){
		scanf("%s",s+1); n=strlen(s+1);
		for(int i=1;i<=n;i++) ans+=s[i]=='o';
		ans+=15-n;
		if(ans>=8) puts("YES");
		else puts("NO");	
		return ;
	}
}

int main(){
	Tzh::work();
	return 0;
}

Measured memory_bytes: 256