akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

const int INF = pow(2, 31) - 1;
#define ll long long
#define DEBUG(x) cout << "DEBUG>" << #x << ":" << x << endl;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main() {
  int D, G;
  cin >> D >> G;
  vector<int> p(D), c(D);
  REP(i, D) {
    cin >> p[i] >> c[i];
  }
  int ans = 100 * 10;
  for(int i = 0; i < pow(2, D); i++) {
    int ans_cmp = 0;
    int score = 0;
    int max_ns = 0;
    for(int j = 0; j < D; j++) {
      if(i >> j & 1) {
        score += (j + 1) * 100 * p[j] + c[j];
        ans_cmp += p[j];
      } else {
        max_ns = j;
      }
    }
    if(score < G) {
      if((G - score + (max_ns + 1) * 100 - 1) / ((max_ns + 1) * 100) < p[max_ns]) {
        ans_cmp += (G - score + (max_ns + 1) * 100 - 1) / ((max_ns + 1) * 100);
        ans = min(ans, ans_cmp);
      }
    } else {
      ans = min(ans, ans_cmp);
    }
  }
  cout << ans << endl;
  return 0;
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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 vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  double A, B, H, M; cin >> A >> B >> H >> M;
  double C = 30 * H + 0.5 * M;
  double D = M * 6;

  double pi = 2.0 * asin(1.0);
  double unit = pi / 180.0;

  double E = abs(C - D) * unit;
  double F = A * A + B * B - (2 * A * B * cos(E));
  cout << fixed << setprecision(20) << sqrt(F) << endl;
}

Measured memory_bytes: 4224
/*

This awesome macros which archieve stdin abstraction (input, input_innder, read_value)
is ported from @tanakh-san's repo.
@url: https://github.com/tanakh/competitive-rs/blob/master/src/lib.rs

====== macro ======
*/
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}


macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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


macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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


fn main () {
    input! {
        r: i32
    }
    if r < 1200 {
        println!("ABC");
    }
    else if 1200 <= r && r < 2800 {
        println!("ARC");
    }
    else {
        println!("AGC");
    }
}


Measured memory_bytes: 4352
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AABC
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            int k = int.Parse(s);
            if (k < 1200)
            {
                Console.WriteLine("ABC");
            }
            else if (k >= 1200 && k < 2800)
            {
                Console.WriteLine("ARC");
            }
            else if(k >= 2800)
            {
                Console.WriteLine("AGC");
            }
        }
    }
}


Measured memory_bytes: 11092
import java.util.Scanner;
class Main {
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int a=sc.nextInt()*sc.nextInt();
    int b=sc.nextInt()*sc.nextInt();
    if(a==b){
      System.out.println(a);
    }else{System.out.println(Math.max(a,b));}
  }
}

Measured memory_bytes: 9684
#include<bits/stdc++.h>
#define LL long long
#define INF 0x3f3f3f3f
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int N=2e5+100;
using namespace std;
int judge(LL tmp,LL n,LL s)
{
	LL sum=0;
	while(n)
	{
		sum+=n%tmp;
		if(sum>s)return 0;
		n/=tmp;
	}
	if(sum==s)return 1;
	return 0;
}
int  main()
{
	io;
	LL n,s;
	while(cin>>n>>s)
	{
		if(n==s)
		{
			cout<<n+1<<endl;
			continue;
		}
		else if(s>n)
		{
			cout<<-1<<endl;
			continue;
		}
		LL f=0;
		LL up=sqrt(n)+1;
		for(LL i=2;i<=up;i++)
		{
			if(judge(i,n,s))
			{
				f=i;
				break;
			}
		}
		if(f)
		{
			cout<<f<<endl;
			continue;
		}
		else
		{
			LL up=sqrt(n-s);
			LL ans=999999999999999999;
			//cout<<ans<<endl;
			for(LL i=1;i<=up;i++)
			{
				
				if((n-s)%i!=0)continue;
				LL tmp=i+1;
				if(judge(tmp,n,s)&&((n-s)/i)==(n/tmp))
				{
					
					f=tmp;
					ans=min(ans,f);
				}
				else if(judge((n-s)/i+1,n,s)&&(i==n/((n-s)/i+1)))
				{
					
					f=(n-s)/i+1;
					ans=min(ans,f);
				}
			}
			//cout<<ans<<endl;
//			if(judge(n-s+1,n,s)&&n/(n-s+1)==1)
//			{
//				ans=min(ans,n-s+1);
//				f=1;
//			}
			if(f)cout<<ans<<endl;
			else cout<<-1<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {
            var H = cin.ReadInt;
            var W = cin.ReadInt;
            var a = cin.ReadStrArray(H);

            for (int i = 0; i < W + 2; i++)
            {
                Write("#");
            }
            Write("\n");

            for (int i = 0; i < H; i++)
            {
                Write("#");
                Write(a[i]);
                Write("#\n");
            }

            for (int i = 0; i < W + 2; i++)
            {
                Write("#");
            }
            Write("\n");

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

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

int main () {
  int N; cin >> N;
  int d = 2;
  int max = 0;

  while (true) {
    if (N >= d) {
      max = d;
      d *= 2;
    } else if (N <= 2) {
      max = 1;
      break;
    } else {
      break;
    }
  }

  cout << max << endl;

  return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")

using ll = long long;

using pint = std::pair<int, int>;
using pll = std::pair<ll, ll>;


constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

namespace {
    template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
    template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
    template<typename T> void chadd(T& a, T b) { a = a + b; }

    void Cout(long long x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const T& x, const char* end = "\n") { std::cout << x << end; }
    template <typename T> void Cout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cout << x[i] << (i == sz - 1 ? end : sep); } }

    void CCout(long long x, const char* end = "\n") { std::cerr << x << end; }
    template <typename T> void CCout(const T& x, const char* end = "\n") { std::cerr << x << end; }
    template <typename T> void CCout(const std::vector<T>& x, const char* sep = " ", const char* end = "\n") { for (std::size_t i = 0, sz = x.size(); i < sz; i++) { std::cerr << x[i] << (i == sz - 1 ? end : sep); } }

    // 標準入出力
    struct inp {
        std::size_t sz;
        inp(std::size_t _sz = 1) : sz(_sz) {}
        template <typename T> operator T () const { T a; std::cin >> a; return a; }
        template <typename T> operator std::vector<T>() const { vector<T> a(sz); for (std::size_t i = 0; i < sz; i++) std::cin >> a[i]; return a; }
        template <typename T, typename U> operator std::pair<T, U>() const { T f; U s; std::cin >> f >> s; return std::pair<T, U>(f, s); }
    };

    inp inp1; // input one
}

int main() {

    int n, m;
    cin >> n >> m;
    vector<int> a = inp(n);

    int sum = 0;
    rep(i, n) sum += a[i];

    int num = 0;
    rep(i, n) {
        if (4 * m * a[i] >= sum) ++num;
    }

    Cout(Yes(num >= m));

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int             main(void)
{
        int     n;
        int     d[101][2];
        int     flag = 0;
        int     i;

        scanf("%d", &n);
        for (i = 0; i < n; i++)
        {
                scanf("%d%d", &d[i][0], &d[i][1]);
        }
        for (i = 0; i < n; i++)
        {
                if (d[i][0] == d[i][1])
                {
                        flag++;
                        if (flag == 3)
                        {
                                printf("Yes\n");
                                return (0);
                        }
                }
                else
                {
                        flag = 0;
                }
        }
        printf("No\n");
        return (0);
}

Measured memory_bytes: 1660
#include<iostream>
using namespace std;
int main(){
	string s;
	while(cin>>s){
		bool flag=true;
		int n=s.length();
		for(int i=0;i<(n-1)/2;i++){
			if(s[i]!=s[n-1-i]){
				flag=false;
				break;
			}
		}
		if(flag){
			for(int i=0;i<n/4;i++){
				if(s[i]!=s[(n-1)/2-i-1]){
					flag=false;
					break;
				}
			}
		}
		cout<<((flag)? "Yes\n":"No\n");
	}
	return 0;
}

Measured memory_bytes: 256
s = input()
a, b = int(s[:2]), int(s[2:])
if 1 <= a <= 12:
    if 1 <= b <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= b <= 12:
        print("YYMM")
    else:
        print("NA")


Measured memory_bytes: 8844
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

int main(){
	
	int k, t;
	
	cin >> k >> t;
	
	int margin = k - k / 2;
	
	int ans = 0;
	
	int hoge;
	
	for(int i = 0; i < t; i++){
		cin >> hoge;
		if(hoge - margin > ans){
			ans = hoge - margin;
		}
	}
	
	if(k % 2 == 0){
		ans = ans * 2 - 1;
	}else{
		ans *= 2;
	}
	
	if(ans < 0){
		ans = 0;
	}
	
	cout << ans << endl;
	
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>

using namespace std;

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

struct Circle {
	int x, y, r, c;
	int tops;
	Circle (int _x, int _y, int _r, int _c) : x(_x), y(_y), r(_r), c(_c) {}
};

bool CC(const Circle& c1, const Circle& c2) {
	if (sq(c1.x - c2.x) + sq(c1.y - c2.y) < sq(c1.r + c2.r)) return true;
	return false;
}

int n;
vector<Circle> cs;

int ans;
bool memo[1 << 25];

void rec(int cur) {
	if (memo[cur]) return;
	
	int ret = __builtin_popcount(cur);	// テァツ渉セテ・ツ慊ィテ・ツ渉姪」ツつ甘ゥツ卍、テ」ツ??」ツ?淌・ツ?凝ヲツ閉ー
	ans = max(ans, ret);
	
	int rmbit = ~cur;	// bitテ・ツ渉催ィツサツ「テ」ツつ津」ツ?ィテ」ツつ?
	
	// テ、ツサツ甘・ツ渉姪」ツつ甘ゥツ卍、テ」ツ?妥」ツつ凝・ツ??ァツ崢、テ」ツつ津ィツヲツ凝」ツ?、テ」ツ?妥」ツつ?
	for (int i = 0; i < n; i++) {
		if (cur >> i & 1) continue;	// テ」ツ?凖」ツ?ァテ」ツ?ォテ」ツ?ィテ」ツつ甘」ツ?ョテ」ツ?榲」ツ?凝」ツつ古」ツ?ヲテ」ツ??」ツつ?
		
		int topsi = cs[i].tops;
		if ( (topsi & rmbit) != 0) continue;
		
		// iテァツ閉ェテァツ崢ョテ」ツ?ョテ・ツ??ァツ崢、テ」ツ?ッテァツ渉セテ・ツ慊ィテ」ツ?ョテ」ツ?禿」ツ?」テ」ツ?ヲテ」ツ??」ツつ凝・ツ??ァツ崢、テ」ツ?ォテ」ツつ暗」ツつ嘉」ツ?堙」ツ?ォテ・ツ渉姪」ツつ甘ゥツ卍、テ」ツ?妥」ツつ?
		for (int j = i + 1; j < n; j++) {
			if (cur >> j & 1) continue;	// テ」ツ?凖」ツ?ァテ」ツ?ォテ」ツ?ィテ」ツつ甘」ツ?ョテ」ツ?榲」ツ?凝」ツつ古」ツ?ヲテ」ツ??」ツつ?
			
			int topsj = cs[j].tops;
			if ((topsj & rmbit) != 0) continue;
			
			// jテァツ閉ェテァツ崢ョテ」ツ?ョテ・ツ??ァツ崢、テ」ツつづァツ渉セテ・ツ慊ィテ」ツ?ョテ」ツ?禿」ツ?」テ」ツ?ヲテ」ツ??」ツつ凝・ツ??ァツ崢、テ」ツ?ォテ」ツつ暗」ツつ嘉」ツ?堙」ツ?ォテ・ツ渉姪」ツつ甘ゥツ卍、テ」ツ?妥」ツつ?
			
			// テ・ツ青古」ツ?佚ィツ可イテ」ツ?ェテ」ツつ嘉・ツ渉姪」ツつ甘ゥツ卍、テ」ツ?妥」ツつ?
			if (cs[i].c != cs[j].c) continue;
			
			// i テ」ツ?ィ j テ」ツつ津・ツ渉姪」ツつ甘ゥツ卍、テ」ツ??」ツ?淌・ツ?エテ・ツ青暗」ツ?ォテ」ツ?、テ」ツ??」ツ?ヲテ・ツ?催・ツクツー
			int nxt = cur | (1 << i);
			nxt |= 1 << j;
			rec(nxt);
		}
	}
	
	memo[cur] = true;
}

int main() {
	while (1) {
		cin >> n; if (n == 0) break;
		
		cs.clear();
		for (int i = 0; i < n; i++) {
			int x, y, r, c; cin >> x >> y >> r >> c;
			cs.push_back(Circle(x, y, r, c));
		}
		
		// テ・ツ青?・ツ??ァツ崢、テ」ツ?ォテ・ツッツセテ」ツ?療」ツ?ヲテ」ツ??」ツ?ゥテ」ツ?ョテ・ツ??ァツ崢、テ」ツ?古・ツ渉姪」ツつ甘ゥツ卍、テ」ツ?凝」ツ?ヲテ」ツ??」ツつ古」ツ?ーテ」ツ?敕」ツ?ョテ・ツ??ァツ崢、テ」ツつ津」ツ?ィテ」ツつ甘」ツ??」ツ?崚」ツつ凝」ツ?凝」ツつ津・ツ?・テ」ツつ古」ツつ?
		// テ・ツ渉姪」ツつ甘ゥツ卍、テ」ツ?凝」ツ?ェテ」ツ?妥」ツつ古」ツ?ーテ」ツ?ェテ」ツつ嘉」ツ?ェテ」ツ??・ツ??ァツ崢、テ」ツ?ォbitテ」ツつ津」ツ?淌」ツ?ヲテ」ツつ?
		for (int i = n - 1; i >= 0; i--) {
			int tops = 0;
			for (int j = i - 1; j >= 0; j--) {
				if (CC(cs[i], cs[j])) {
					tops |= 1 << j;
				}
			}
			cs[i].tops = tops;
		}
		
		// テ」ツ?凖」ツ?ケテ」ツ?ヲテ」ツ?ョテ・ツ??ァツ崢、テ」ツ?古ヲツョツ凝」ツ?」テ」ツ?ヲテ」ツ??」ツつ凝ァツ環カテヲツ?凝」ツ?凝」ツつ嘉ゥツ鳴凝・ツァツ?	
		memset(memo, 0, sizeof(memo));
		ans = 0;
		rec(0);
		cout << ans << endl;
	}
	
	return 0;
}

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

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
//#define ld long double
#define mod 1000000007
#define inf 100000000000010
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
#define all(x) (x).begin(), (x).end()

typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> pi;
typedef long double ld;
bool isprime(ll n)
{
    if(n<=1)return false;
    if(n<=3)return true;
    if(n%2==0||n%3==0)return false;
    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0||n%(i+2)==0)return false;
    }
    return true;
}

ll modexp(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b>0)
    {
        if(b&1)r=(r*a)%m;
        b = b>>1;
        a=(a*a)%m;
    }
    return r%m;
}




ll builtin_popcount(ll x)
{
    ll cnt = 0;
    for(ll i=60;i>=0;i--)
    {
        if((1LL<<i)&x)cnt++;
    }
    return cnt;
}

ll addmod(ll a,ll b,ll r)
{
    a%=r;
    b%=r;
    return (a+b)%r;
}
ll mulmod(ll a,ll b,ll r)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
ll submod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    a-=b;
    if(a<0)a+=mod;
    return a%mod;
}
struct CustomCompare
{
    bool operator()(ll a,ll b)
    {
        return a>b;
    }
};
/*
const int mxn = 5*(1e6) +10;
vi spf(mxn);
void sieve()
{
    for(ll i =0;i<mxn;i++)spf[i]  = i;
    for(ll i=2;i<mxn;i+=2)spf[i] = 2;
    for(ll i = 3;i*i<mxn;i++)
    {
        if(spf[i]==i)
        {
            for(ll j = i*i;j<mxn;j+=i)
            {
                if(spf[j]==j)spf[j] = i;
            }
        }
    }
}
*/

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
ll s; cin>>s;
vi arr;
ll x = 3;
while(x<=s)
{
    //cout<<x<<" ";
    arr.pb(x);
    x++;

}
//cout<<endl;
ll dp[s+1];
memset(dp,0,sizeof(dp));
dp[0] = 1;
for(ll i =0;i<=s;i++)
{
    for(ll j =0;j<arr.size();j++)
    {
        if(arr[j]>i)continue;
        dp[i] = addmod(dp[i],dp[i-arr[j]],mod);
    }
}
cout<<dp[s]<<endl;
return 0;
}
/*
1
3 1
023l
2 3
*/


Measured memory_bytes: 3684
#include <iostream>

long long pow5(long long x)
{
    return x * x * x * x * x;
}

int main()
{
    long long X;
    std::cin >> X;
    for (long long A = 0; pow5(A) <= 1000000000; A++)
    {
        for (long long B_ = 0; pow5(B_) <= 1000000000; B_++)
        {
            if (pow5(A) + pow5(B_) == X)
            {
                std::cout << A << " " << -B_ << std::endl;
                return 0;
            }
        }
    }
    for (long long A = 0; A <= 178; A++)
    {
        for (long long B = 0; B < A; B++)
        {
            if (pow5(A) - pow5(B) == X)
            {
                std::cout << A << " " << B << std::endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 3608
#include <stdio.h>
 
int main()
{
    int x[3000], y[3000];
    int i = 0, j;
    do {
        scanf("%d %d", &x[i], &y[i]);
        i++;
    }while (!((x[i - 1] == 0) && (y[i - 1] == 0)));
 
    for (j = 0; (i - 1) != j; j++)
    {
        if (x[j] <= y[j])
        {
            printf ("%d %d\n", x[j], y[j]);
        }
        else if(x[j] > y[j])
        {
            printf ("%d %d\n", y[j] ,x[j]);
        }
    }
return 0;
}

Measured memory_bytes: 624
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)


int main(){
    int n;
    cin>>n;
    rep(i,n){
        string s,t;
        cin>>s>>t;
        
        
        int dp[1001][1001]={};
        
        rep(i,s.size()){
            rep(j,t.size()){
                if(s[i]==t[j])dp[i+1][j+1] = dp[i][j]+1;
                else dp[i+1][j+1] = max(dp[i][j+1],dp[i+1][j]);
            }
        }
        
        cout<<dp[s.size()][t.size()]<<endl;
    }
}

Measured memory_bytes: 7068
//submitted by HimJ
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define fr(i,s,e) for(i=s;i<e;i++)
#define ms(arr,val) memset(arr,val,sizeof(arr))
using namespace std;
const int mxn=1e5+1;
struct node{
    ll v;
    ll y,s;
};
vector<node> graph[mxn];
ll disy[mxn],diss[mxn],seg[4*mxn],arr[mxn];
void dij(int s,int t)
{
   
    diss[t]=0;
    priority_queue<pair<ll,ll>,vector<pair<ll,ll> >,greater<pair<ll,ll> > > q;
    q.push({0,t});
    while(!q.empty())
    {
        ll d=q.top().fi;
        ll u=q.top().se;
        q.pop();
        for(int i=0;i<graph[u].size();i++)
        {
            int v=graph[u][i].v;
            int dis=graph[u][i].s;
            if(diss[v]>d+dis)
            {
                diss[v]=d+dis;
                q.push({diss[v],v});
            }
        }
    }
    disy[s]=0;
    q.push({0,s});
    while(!q.empty())
    {
        ll d=q.top().fi;
        ll u=q.top().se;
        q.pop();
        for(int i=0;i<graph[u].size();i++)
        {
            int v=graph[u][i].v;
            int dis=graph[u][i].y;
            if(disy[v]>d+dis)
            {
                disy[v]=d+dis;
                q.push({disy[v],v});
            }
        }
    }
}
void build(int ss,int se,int si)
{
    if(ss==se)
    {
        seg[si]=arr[ss];
        return;
    }
    int mid=(ss+se)>>1;
    build(ss,mid,2*si);
    build(mid+1,se,2*si+1);
    seg[si]=min(seg[2*si],seg[2*si+1]);
}
ll query(int ss,int se,int si,int l,int r)
{
    if(l<=ss&&r>=se)
        return seg[si];
    if(r<ss||l>se||ss>se)
        return 1e18;
    int mid=ss+se>>1;
    return min(query(ss,mid,2*si,l,r),query(mid+1,se,2*si+1,l,r));
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  ll t=1;
  //cin>>t;
    while(t--){
            int n,m,s,t,u,v,a,b,i,j;
    cin>>n>>m>>s>>t;
    fr(i,1,n+1)
    diss[i]=disy[i]=1e16;
    fr(i,0,m)
    {
        cin>>u>>v>>a>>b;
        graph[u].pb({v,a,b});
        graph[v].pb({u,a,b});
    }
    dij(s,t);
  //  ll arr[n+1];
    fr(i,1,n+1)
    {
        arr[i]=disy[i]+diss[i];
    }
    build(1,n,1);
    fr(i,1,n+1)
    {
        ll ans=1e15-query(1,n,1,i,n);
        cout<<ans<<"\n";
    }

    }
  return 0;
  }



Measured memory_bytes: 16284
N = int(input())
A = list(int(input()) for i in range(N))

ans = 0
for i in range(N) :
    ans += A[i]//2
    if i != N-1 :
        if A[i+1] >= 1 :
            A[i+1] += A[i] % 2
print(ans)


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

N = int(input())

A = []
i = 1
while 6 ** i <= 100000:
    A.append(6 ** i)
    i += 1
j = 1
while 9 ** j <= 100000:
    A.append(9 ** j)
    j += 1
A.sort(reverse=True)  # 引き出せる金額のリスト

# i番目以降の金額を使ってj円を作るときの最小操作数
dp = [[-1 for j in range(N + 1)] for i in range(len(A) + 1)]


def func(i, j):
    # 1円しか選択肢がないなら
    if i == len(A):
        dp[i][j] = j
        return dp[i][j]

    # 探索済みなら計算量を減らせる
    if dp[i][j] >= 0:
        return dp[i][j]

    # その他の場合
    # 目いっぱい引き出すのが最適とは限らない
    # 引き出す回数を増やしていく
    # 8*11回くらいで十分だろう
    ret = 100001
    for times in range(88):
        if A[i] * times <= j:
            # dp[i][j]に代入すると再計算されてしまうことに注意
            ret = min(ret, func(i+1, j-A[i]*times) + times)
        else:
            break
    dp[i][j] = ret
    return ret


print(func(0, N))


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

int main(){
    unsigned long A,B,K;
    cin >>A>>B>>K;
    if(A+B<=K){
        cout<<0<<" "<<0;
    } else if(A<=K){
        cout<<0<<" "<<A+B-K;
    } else {
        cout<<A-K<<" "<<B;
    }
}

Measured memory_bytes: 384
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
//#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<list>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*
cout<<setprecision(20)
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1e9+7;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
//llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
//for(int i=0;i<n;i++){cout<<que[i]<<(i+1<n?" ":"\n");}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,x;cin>>n;
	bitset<2001>can;
	can[0]=1;
	while(n--){cin>>x;can|=(can<<x);}
	cin>>n;
	while(n--){cin>>x;cout<<(can[x]?"yes\n":"no\n");}
	
	return 0;
}


Measured memory_bytes: 3172
#include <bits/stdc++.h>
#include <stdio.h>
typedef long long int LL;
#define fr(i,p,n) for(LL i=p;i<n;i++)
#define fr1(i,p,n) for(LL i=p;i>=n;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define PI 3.14159265358979323846
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define precise cout << std::setprecision(10) << std::fixed;

using namespace std;
 
int main()
{
        LL n;
        cin>>n;
        LL a[n];
        LL ans=0;
        fr(i,0,n){
        cin>>a[i];
        ans^=a[i];
        } 
        fr(i,0,n)
        {
           a[i]=ans^a[i];
        }
        fr(i,0,n)
        {
           cout<<a[i]<<" ";
        }
         
    return 0;
}

Measured memory_bytes: 5000
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int p = scanner.nextInt();
        int q = scanner.nextInt();
        int r = scanner.nextInt();
        System.out.println(Math.min(Math.min(p + q, p + r), q + r));
    }
}

Measured memory_bytes: 22228
package main
import (
  "fmt"
  "math"
)
func main() {
  var q,a,b int
  fmt.Scan(&q)
  for k:=0;k<q;k++ {
    fmt.Scan(&a,&b)
    if a > b { a,b = b,a }
    if a == b || a+1 == b {
      fmt.Println(2*a-2)
    } else {
      var c int = int(math.Sqrt(float64(a)*float64(b)))
      if int64(c)*int64(c) == int64(a)*int64(b) { c-- }
      if int64(c)*int64(c+1) < int64(a)*int64(b) {
        fmt.Println(2*c-1)
      } else {
        fmt.Println(2*c-2)
      }
    }
    
  }
}

Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC123_A
{
    class Program
    {
        static void Main(string[] args)
        {
            const int AntennaCount = 5;
            int[] antenna = new int[AntennaCount];

            for (int i = 0; i < AntennaCount; ++i)
            {
                antenna[i] = int.Parse(Console.ReadLine());
            }

            int k = int.Parse(Console.ReadLine());

            bool flag = true;

            for (int i = 0; i < AntennaCount - 1; ++i)
            {
                for (int j = i + 1; j < AntennaCount; ++j)
                {
                    if (Math.Abs(antenna[i] - antenna[j]) > k)
                    {
                        flag = false;
                        break;
                    }
                }
                if (!flag) break;
            }

            Console.WriteLine(flag? "Yay!" : ":(");
        }
    }
}


Measured memory_bytes: 11092
MOD = 10**9+7

N,M = map(int,input().split())

if abs(N-M)>1:
    print(0)
    exit()

#N=Mなら最後に2をかける
dog = 1
monkey = 1
for i in range(1,N+1):
    dog = (dog*i)%MOD
for j in range(1,M+1):
    monkey = (monkey*j)%MOD

ans =(dog*monkey)%MOD
if N==M:
    ans=(ans*2)%MOD

print(ans)


Measured memory_bytes: 63664
using System;

public class hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var c = int.Parse(line[1]);
        if (n == 1 && c < 0) Console.WriteLine(11);
        else if (c < 0) Console.WriteLine(new string('9', 2 * n));
        else getAns(n, c);
    }
    static void getAns(int n, int c)
    {
        var z = new string('0', n - 1);
        var e = int.Parse("1" + z + "0" + z + "1");
        var s = int.Parse(new string('9', 2 * n + 1));
        for (int i = s; i >= e; i--)
        {
            var its = i.ToString();
            if (check(its, n, c) && IsPalindrome(its) && IsPrime(i))
            {
                Console.WriteLine(i);
                return;
            }
        }
    }
    static bool check(string s, int n, int c) => s[n] == c.ToString()[0];
    static bool IsPalindrome(string s)
    {
        var sL = s.Length;
        for (int i = 0; i < sL / 2; i++)
            if (s[i] != s[sL - 1 - i]) return false;
        return true;
    }
    static bool IsPrime(int n)
    {
        if (n < 2) return false;
        else if (n == 2) return true;
        else if (n % 2 == 0) return false;
        double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i <= sqrtNum; i += 2)
            if (n % i == 0) return false;
        return true;
    }
}


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

#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)
typedef long long int lli;
typedef pair<int, int> pi;
typedef pair<lli, int> pii;



int main()
{
    lli n, k;
    cin >> n >> k;
    lli a[n];
    for(auto &x: a) cin >> x;
    int cnt1[45] = {0}, cnt0[45] ={0};
    for(auto x: a){
        for(int i=0; i<45; i++){
            if(x%2){
                cnt1[i]++;
            }
            else{
                cnt0[i]++;
            }
            x/=2;
        }
    }
    lli xo = 0LL;
    for(int i=44; i>=0; i--){
        lli tm = 1LL<<i;
        if(xo+tm <= k){
            if(cnt1[i] < cnt0[i]){
                xo += tm;
            }
        }
    }
    lli ans = 0;
    for(auto x: a){
        ans += (x^xo);
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 1024
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::cmp::{max, min, Ordering};

macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

// N M => let (N, M) = get!(usize, usize)
// A1 B1
// ...
// AQ BQ => let A = get!(usize, usize; Q)

const MOD: u64 = 1000000007;

fn main() {
    let (N, X, Y) = get!(i32, i32, i32);

    println!("{} {}", min(X, Y), max(0, X + Y - N));
}


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

using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define Get(t, i) get<(i)>((t))
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

const int inf = 1 << 25;
const ll INF = 1LL << 55;

struct UnionFind
{
  vector<int> data;
  UnionFind(int sz):data(sz, -1){};
  int size(int x) { return -data[find(x)]; }
  int find(int x) { return data[x] < 0 ? x : data[x] = find(data[x]); }
  bool same(int x, int y) { return find(x) == find(y); }
  int unite(int x, int y)
  {
    x = find(x), y = find(y);
    if(x != y) {
      if(data[x] < data[y]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return -data[x];
  }
};


struct edge{
  int u, v, weight;
  edge(){}
  edge(int u, int v, int weight):u(u), v(v), weight(weight){}
  bool operator<(const edge& e) const {
    return weight < e.weight;
  }
};

struct Kruskal
{
  vector<edge> edges;
  int V;
  Kruskal(int V):V(V){}
  void add_edge(int u, int v, int weight)
  {
    edges.push_back(edge(u, v, weight));
  }
  int build()
  {
    sort(edges.begin(), edges.end());
    UnionFind uf(V);
    int ret = 0;
    for(int i = 0; i < edges.size(); i++){
      edge& e = edges[i];
      if(!uf.same(e.u, e.v)){
	uf.unite(e.u, e.v);
	ret += e.weight;
      }
    }
    return ret;
  }
};


int main()
{
  int V, E;
  cin >> V >> E;
  Kruskal msp(V);
  while(E--) {
    int s, t, w;
    cin >> s >> t >> w;
    msp.add_edge(s, t, w);
  }
  cout << msp.build() << endl;
  return 0;
}

Measured memory_bytes: 4520
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter};
use std::io::*;
use std::ops::*;
use std::*;

// -----------------------------------------------
// Framework
// -----------------------------------------------

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($arg:expr),*) => {
        #[cfg(debug_assertions)]
        {
            let entries = [$(&stringify!([$arg]:), &$arg as &Debug),*];
            stderr().write_fmt(format_args!("{:#?}\n", entries)).unwrap();
        }
    };
}

#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

// -----------------------------------------------
// Solution
// -----------------------------------------------

pub fn main() {
    let (A, B) = read!(i32, i32);
    println!(
        "{}",
        if A + B == 15 {
            "+"
        } else if A * B == 15 {
            "*"
        } else {
            "x"
        }
    );
    return;
}


Measured memory_bytes: 4352
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		int N = sc.nextInt();
		int[] l = new int[N + 1];
		int[] r = new int[N + 1];
		for (int i = 1; i <= N; i++) {
			l[i] = sc.nextInt();
			r[i] = sc.nextInt();
		}
		int ans = 0;
		for (int i = 1; i <= N; i++) {
			ans += r[i] - l[i] + 1;
		}
		System.out.println(ans);
	}
	//以下、自作ライブラリ

	//最大公約数
	public static long gcd(long a, long b) {
		if (a < b)
			return gcd(b, a);
		long c = 0;
		c = a % b;
		if (c == 0)
			return b;
		return gcd(b, c);
	}

	//最小公倍数
	public static long lcm(long m, long n) {
		return m * n / gcd(m, n);
	}

	//素数判定
	public static boolean isPrime(int n) {
		if (n < 2)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;

		for (int i = 3; i * i <= n; i += 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

//以下、高速スキャナークラス
class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


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

ll N, sqrtN;
int main(){
    scanf("%lld", &N);
    sqrtN = sqrt(N)+1;
    for (int i = sqrtN; i >= 1; i--) {
        if(N%i ==0){
            printf("%lld\n", (i+N/i - 2));
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int n,ans=0,temp;
  scanf("%d",&n);
  temp=n%10;
  if(n<100)ans=1;
  while(n){
    n/=10;
    if(n%10==temp)ans=1;
    temp=n%10;
  }
  printf("%s",ans==1?"Bad":"Good");
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main()
{
	int n;
	string ans;

	// input
	cin >> n;

	// calc 本の組み合わせパターンをビット表現
	n = n % 10;
	switch (n) {
	case 2:
	case 4:
	case 5:
	case 7:
	case 9:
		ans = "hon";
		break;
	case 0:
	case 1:
	case 6:
	case 8:
		ans = "pon";
		break;
	case 3:
		ans = "bon";
		break;
	}

	// output
	cout << ans;
	cout << endl;

	return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 1)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int moder) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%moder;
		x = x * x%moder;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	if (x == y)return 1;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int h, w;
char c[2010][2010];
int ta[2010][2010], mu[2010][2010];
int cnt, ans = 0;

signed main() {
	cin >> h >> w;
	rep(i, h) {
		rep(j, w)cin >> c[i][j];
	}
	rep(i, h) {
		cnt = 0;
		rep(j, w) {
			if (c[i][j] == '#') {
				cnt = 0;
				ta[i][j] = 0;
			}
			else if (c[i][j - 1] == '#'||j==0) {
				for (int k = j;; k++) {
					if (c[i][k] == '.')cnt++;
					else break;
				}
				ta[i][j] = cnt;
			}
			else ta[i][j] = cnt;
		}
	}
	rep(j, w) {
		cnt = 0;
		rep(i, h) {
			if (c[i][j] == '#') {
				cnt = 0;
				mu[i][j] = 0;
			}
			else if (c[i - 1][j] == '#' || i == 0) {
				for (int k = i;; k++) {
					if (c[k][j] == '.')cnt++;
					else break;
				}
				mu[i][j] = cnt;
			}
			else mu[i][j] = cnt;
		}
	}
	rep(i, h) {
		rep(j, w) {
			if (ta[i][j] && mu[i][j])ans = max(ans, ta[i][j] + mu[i][j] - 1);
			else ans = max(ans, ta[i][j] + mu[i][j]);
		}
	}
	cout << ans << endl;
}

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


const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  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 {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};

// Paskal's triangle => Combination
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for ( int i = 0; i <= 4000; i++) {
    for ( int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}

mint comb(int n, int k) {
  return c[n][k];
}

mint f2(int n, int k) {
  return comb(n+k-1,k-1);
}

mint f(int n, int k) {
  if (n < k) return 0;
  if (n == 0 && k == 0) return 1;
  if (k < 1) return 0;
  return f2(n-k,k);
}

int main() {
  init();
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++) {
    mint blue = f(k,i);
    mint red = 0;
    {
      red += f(n-k,i-1);
      red += f(n-k,i);
      red += f(n-k,i);
      red += f(n-k,i+1);
    }
    mint ans = blue * red;
    printf("%lld\n", ans.x);
  }
  return 0;
}


/*
long long combination(int n, int r) {
  long long num = 1;
  for ( int i = 1; i <= r; i++ ) {
    num = ( num * ( n - i + 1 ) / i ) % MOD; // 1/2が0になるので、右辺が num * () / iとする
    // cout << num << endl;
  }
  return num;
}


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


  for ( int i = 1; i <= K; i++ ) {
    // K-1Ci-1 * N-K+1Ci
    long long ans = 0;
    ans = combination(K-1, i-1) % MOD;
    ans *= combination(N-K+1, i) % MOD;
    cout << ans << endl;

  }
  return 0;
}
*/


Measured memory_bytes: 125568
/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

vector<string> vec_splitter(string s) {
    for(char& c: s) c = c == ','?  ' ': c;
    stringstream ss; ss << s;
    vector<string> res;
    for(string z; ss >> z; res.push_back(z));
    return res;
}

void debug_out(vector<string> __attribute__ ((unused)) args, __attribute__ ((unused)) int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
    if(idx > 0) cerr << ", ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, T...);
}

#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__)
#else
#define debug(...) 42
#endif

const double PI = acos(-1);
typedef long long ll;
#define int ll
#define fori(n) for(int i=0; i<int(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a, n) vd a(n); fori(n) { cin>>a[i]; }

typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;

void solve() {
    cini(n);
    cini(m);
    cini(x);
    vi c(n);
    vvi a(n,vi(m));
    for(int i=0; i<n; i++) {
        cin>>c[i];
        for(int j=0; j<m; j++)
            cin>>a[i][j];
    }

    const int INF=1e18;
    int ans=INF;
    for(int i=1; i<(1<<n); i++) {
//cerr<<"i="<<i<<endl;
        vi algos(m);
        int price=0;

        for(int b=0; b<n; b++) {
            if(!(i&(1<<b)))
                continue;

            price+=c[b];
            for(int j=0; j<m; j++) {
                algos[j]+=a[b][j];
            }
        }
        bool ok=true;
        for(int i : algos)
            if(i<x)
                ok=false;
        if(ok)
            ans=min(ans, price);
    }
    if(ans==INF)
        ans=-1;
    cout<<ans<<endl;
}

signed main() {
    cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    solve();
}



Measured memory_bytes: 3648
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy

path="U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U"
print(path)

Measured memory_bytes: 9072
#include <stdio.h>

int main(void)
{
	int H, W, x, y, i;
	
	for(i = 0; i < 300; i++){
		scanf("%d%d", &H, &W);
		if((H == 0) && (W == 0)) break;
		for(y = 1; y <= H; y++){
			for(x = 1; x <= W; x++){
				if((y == 1) || (y == H)){
					printf("#");
				}else{
					if((x == 1) || (x == W)){
						printf("#");
					}else{
						printf(".");
					}
				}
			}
			printf("\n");
		}
		printf("\n");
	}
	
	return(0);
}



Measured memory_bytes: 1732
#include<iostream>
#include<set>
#include<algorithm>
#include<stack>
using namespace std;
typedef set<string> set_t;
set_t a;
string rev(string s);
void revers(string s1,string s2)
{
    a.insert(s1+s2);
    a.insert(s1+rev(s2));
    a.insert(rev(s1)+rev(s2));
    a.insert(rev(s1)+s2);
    a.insert(s2+s1);
    a.insert(s2+rev(s1));
    a.insert(rev(s2)+rev(s1));
    a.insert(rev(s2)+s1);
}
string rev(string s)
{
    if(s.size()>1)
        reverse(s.begin(),s.end());
    return s;
}
int main()
{
    int m;
    cin>>m;
    for(int i=0;i<m;i++)
    {
        string s;
        cin>>s;
        string s1,s2;
        for(int j=0;j<s.size();j++)
        {
            s1=s.substr(0,j);
            s2=s.substr(j);
            revers(s1,s2);
        }
        cout<<a.size()<<endl;
        a.clear();
    }
    return 0;
}



Measured memory_bytes: 3072