akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define FOR(i, j, limit) for(int i=j; i< limit; ++i)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ECHO(x) cout<<x<<endl;
#define MEMSET(a, n, x) REP(i, n) a[i]=x;
#define ARRIN(a, n) REP(i, n) cin>>a[i];
#define LL long long
int INF = 2147483647;
LL LINF = 9223372036854775807;
LL MOD = 1000000007;
typedef pair<int, int>P;
typedef pair<LL, LL>PL;
typedef vector<int> vi;
typedef vector<LL> vl;


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

  //A, G, C, T
  LL dp[n+1][4][4][4]={}; //[n文字目まで][入れる文字][1文字前の文字][2文字前の文字]

  //n=3
  REP(i, 4){
    REP(j, 4){
      REP(k, 4){
        dp[3][i][j][k]=1;
      }
    }
  }
  dp[3][2][0][1]=0;
  dp[3][1][2][0]=0;
  dp[3][2][1][0]=0;

  //n>=4
  for(int x=4; x<n+1; ++x){
    REP(i, 4){
      REP(j, 4){
        REP(k, 4){
          REP(l, 4){
            if(i==2&&j==1&&k==0) continue;//#AGC
            if(i==2&&j==0&&k==1) continue;//#GAC
            if(i==2&&k==1&&l==0) continue;//AG#C
            if(i==2&&j==1&&l==0) continue;//A#GC
            if(i==1&&j==2&&k==0) continue;//#ACG

            dp[x][i][j][k]+=dp[x-1][j][k][l];
            dp[x][i][j][k]%=MOD;

          }
        }
      }
    }
  }

  LL ans=0;
  REP(i, 4){
    REP(j, 4){
      REP(k, 4){
        ans+=dp[n][i][j][k];
        //cout<<dp[n][i][j][k]<<" ";
        ans%=MOD;
      }
      //cout<<endl;
    }
    //cout<<endl;
  }
  ECHO(ans);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define re register
inline int read(){
	re int t=0;
	re char v=getchar();
	while(v<'0'||v>'9')v=getchar();
	while(v>='0'&&v<='9'){
		t=(t<<3)+(t<<1)+(v^48);
		v=getchar();
	}
	return t;
}
int n,a,b,c,d;
int main(){
	scanf("%d",&a);
	if(a==1)++a;
	while(1){
		bool ia=0;
		for(re int i=2;i<=sqrt(a);++i){
			if(a%i==0){
				ia=1;
				break;
			}
		}
		if(!ia)break;
		++a;
	}
	printf("%d",a);
}

Measured memory_bytes: 256
package scc;
sub new{
	return bless[map[],1..$_[1]],$_[0];
}
sub add_edge{
	my$self=shift;
	push@{$self->[$_[0]]},$_[1];
}
sub scc{
	my$self=shift;
	my$now_ord=0,$group_num=0,@low,@ord=(-1)x@{$self},@ids;
	my@visited;
	my$dfs;
	$dfs=sub{
		my$v=shift;
		$low[$v]=$ord[$v]=$now_ord++;
		push@visited,$v;
		for$to(@{$self->[$v]}){
			if($ord[$to]==-1){
				$dfs->($to);
				$low[$v]=$low[$to]if$low[$v]>$low[$to];
			}
			else{
				$low[$v]=$ord[$to]if$low[$v]>$ord[$to];
			}
		}
		if($low[$v]==$ord[$v]){
			my$u=-1;
			while($u!=$v){
				$u=pop@visited;
				$ord[$u]=@{$self};
				$ids[$u]=$group_num;
			}
			$group_num++;
		}
	};
	for$i(0..$#ord){
		$dfs->($i)if$ord[$i]==-1;
	}
	$_=$group_num-1-$_ for@ids;
	my@groups=map[],1..$group_num;
	for$i(0..$#ids){
		push@{$groups[$ids[$i]]},$i;
	}
	return\@groups;
}
package main;
my($N,$M)=split$",<>;
my$scc=scc->new($N);
for(1..$M){
	my($a,$b)=split$",<>;
	$scc->add_edge($a,$b);
}
$groups=$scc->scc();
print scalar(@{$groups}),$/;
for$L(@{$groups}){
	print scalar(@{$L}),$","@{$L}",$/;
}


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

using namespace std;

int main(void) {
  int n;
  while (cin >> n, n) {
    int w, h;
    cin >> w >> h;

    vector< vector<int> > cnt(h, vector<int>(w, 0));
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      cnt[y - 1][x - 1]++;
    }

    int s, t;
    cin >> s >> t;

    int ans = 0;
    for (int i = 0; i + t - 1 < h; i++) {
      for (int j = 0; j + s - 1 < w; j++) {
        int sum = 0;
        for (int k = 0; k < t; k++) {
          for (int l = 0; l < s; l++) {
            sum += cnt[i + k][j + l];
          }
        }
        ans = max(ans, sum);
      }
    }

    cout << ans << endl;
  }

  return 0;
}


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

using namespace std;

using ll = long long;

int main(){
    ll n, x;
    cin >> n >> x;
    vector<ll> v(n);
    for(ll i = 0; i < n; ++i){
        cin >> v[i];
    }
    v.push_back(x);
    if(n == 1){
        cout << abs(v[0] - x);
        return 0;
    }
    sort(v.begin(), v.end());
    vector<ll> ans;
    for(ll i = 0; i < n; ++i){
        ans.push_back(v[i + 1] - v[i]);
    }
    ll odg = LLONG_MAX;
    sort(ans.begin(), ans.end());
    for(ll i = 0; i < ans.size() - 1; ++i){
        odg = min(odg, __gcd(ans[i], ans[i + 1]));
    }
    if(odg == LLONG_MAX)cout << 1;
    cout << odg;
    return 0;
}


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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int d;
    int sum = 0;
    int abssum ;
    int[] array = new int[n];
    for(int i=0; i<n; i++){
      d = sc.nextInt();
      sum += d;
      array[i] = d;
    }
    abssum = sum;
    for(int i=0; i<n; i++){
      sum = sum - 2 * array[i];
      if(sum<0){
        if(abssum<Math.abs(sum)){
          System.out.println(abssum);
          break;
        }else{
          System.out.println(Math.abs(sum));
          break;
        }
      }
      abssum = Math.abs(sum);
    }
  }
}

Measured memory_bytes: 23764
#include "bits/stdc++.h"
using namespace std;

using Info = bitset<101>;

vector<int> make_dag(vector<vector<int>> edges) {
	const int N = edges.size();
	vector<int> parnum(N);
	for (auto row : edges)for (auto col : row)parnum[col]++;

	queue<int> q;
	vector<int> res;
	for (int i = 0; i < N; i++)if (parnum[i] == 0)q.push(i);

	while (!q.empty()) {
		int v = q.front(); q.pop();
		for (auto u : edges[v]) {
			parnum[u]--;
			if (parnum[u] == 0) {
				q.push(u);
			}
		}
		res.push_back(v);
	}
	return res;
}

int main() {
	int V, E, w;
	cin >> V >> E >> w;
	vector<map<int, int>> edges(V);
	vector<vector<int>> parents(V), fordag(V);

	for (int i = 0; i < E; i++) {
		int s, t, c;
		cin >> s >> t >> c;
		edges[s][t] = c;
		parents[t].push_back(s);
		fordag[s].push_back(t);
	}

	// dag
	vector<int> dag = make_dag(fordag);

	// way
	vector<Info> res(V);
	for (auto& pos : dag) {
		for (int& parent : parents[pos]) {
			int len = edges[parent][pos];
			for (int i = 0; i < 101; i++) if (res[parent][i]) {
				int score = i + len;
				if (score + w < 0)res[pos][score] = true;
			}
			if (len + w < 0)res[pos][len] = true;
		}
	}

	int ans = -1;
	for (const auto& row : res)
		for (int i = 0; i < 101; i++)if (row[i])ans = max(ans, i);

	cout << (ans == -1 ? "NA" : to_string(ans + w)) << endl;
	return 0;
}


Measured memory_bytes: 51888
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    int arr[n];
    for(int i=0;i<n;i++)
    cin>>arr[i];
    int count=0;
    for(int i=0;i<n;i++)
    {
        if(arr[i]>=k)
        {
            count++;
        }
    }
    cout<<count<<endl;
}


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

int main() {
	
	int n;
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++)cin>>arr[i];
	sort(arr,arr+n);
	int ans=0;
	vector<int>vis(1000005,0);
	for(int i=0; i<n; i++){
	    if(i<n-1 && arr[i]==arr[i+1]) vis[arr[i]]=1;
	    for(int j=2*arr[i]; j<=arr[n-1]; j+=arr[i]){
	        vis[j]=1;
	    }
	}
	for(int i=0;i<n;i++){
	    if(vis[arr[i]]==0){
	        ans++;
	    }
	}
	cout<<ans<<endl;
}



Measured memory_bytes: 8008
import Data.List (elemIndices)
import Control.Monad (unless)
import Control.Applicative ((<$>))

findFixedPoint :: [Int] -> (Int, [Int])
findFixedPoint = findFixedPoint' 0
    where
        findFixedPoint' m ss
            | ss == cs  = (m, ss)
            | otherwise = findFixedPoint' (m + 1) cs
            where
                cs = map (\k -> length $ elemIndices (ss !! k) ss) [0 .. (length ss) - 1]

main :: IO ()
main = do
    n <- readLn
    unless (n == 0) $ do
        (m, p) <- findFixedPoint . map read . words <$> getLine
        putStrLn $ show $ m
        putStrLn $ unwords $ map show $ p
        main

Measured memory_bytes: 4016
#include <bits/stdc++.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int64_t X;
    cin >> X;
    map<int64_t, int64_t>m;
    for (int i=-1000; i <= 1000; i++) {
        m[i] = pow(i, 5);
    }

    bool get_ans = false;
    int64_t A, B;
    for (int i=-1000; i <= 1000; i++) {
        for (int j=-1000; j <= 1000; j++) {
            int64_t ans = m[i] - m[j];
            if (ans == X) {
                A = i;
                B = j;
                get_ans = true;
                break;
            }
        }

        if (get_ans) {
            break;
        }
    }

    cout << A << " " << B << endl;
    return 0;
}

Measured memory_bytes: 4240
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <map>
 
#define ST_ARR_LEN(array) (sizeof(array)/sizeof(*array))
 
using namespace std;
 
using ll = long long;
 
typedef stack<int> IntStack;
typedef queue<int> IntQueue;
typedef vector<int> IntVector;
typedef list<int> IntList;
 
typedef struct S{
  int a;
  int b;
} Object;
 
int euclideanGcd(int a, int b){
  if(a < b) return euclideanGcd(b, a);
  int c = a%b;
  while(c > 0){
    a = b;
    b = c;
    c = a%b;
  }
  return b;
}
 
int main(){
  int K;
  cin >> K;
  
  long long count = 0;
  for(int i=1;i<=K;i++){
    for(int j=1;j<=K;j++){
      for(int k=1;k<=K;k++){
        count += euclideanGcd(euclideanGcd(i, j), k);
      }
    }
  }
  
  cout << count << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
char a[101];
bool ak=false,au=false;
int main(){
    cin>>a;
    for(int i=0;i<=100;i++){
        if(a[i]=='C')ak=true;
        if(a[i]=='F'&&ak)au=true;
    }
    if(ak&&au)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

int n, k;
string s;

int num[MAX_N];

int ans;

int main(void) {
  // Here your code !
  scanf("%d %d", &n, &k);

  cin >> s;

  for (int i = 0; i < n; ++i) {
    if (s[i] == '0') {
      if (i == 0 || s[i - 1] == '1') {
        num[i] = 1;
      }
    }
  }

  for (int i = 1; i < n; ++i) {
    num[i] += num[i - 1];
  }

  // num[n] = num[n - 1] + 1;

  int cnt = num[n - 1];

  if (k >= cnt) {
    printf("%d\n", n);
    return 0;
  }

  ans = -1;

  for (int i = 0; i < n; ++i) {
    int add = (s[i] == '0') ? k - 1 : k; // already using 0 part

    auto itr = upper_bound(num + i, num + n, num[i] + add);

    int ind = (itr - num) - 1;

    if (num[ind] - num[i] != add) continue;

    int score = ind - i + 1;

    ans = max(ans, score);
  }

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

  return 0;
}


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


void solve(long long N, long long K){
    int ans = 0;
    while(N>=1){
        N = N/K;
        ans++;
    }
    cout << ans << endl;

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    solve(N, K);
    return 0;
}


Measured memory_bytes: 256
/*Bismillahir Rahmanir Rahim*/

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

typedef long long ll;
typedef vector<int> vi;
typedef vector <long long> vll;
typedef pair<int, int> pii;
///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Macro Start-*-*-*-*-*-*-*--*-*-*-*-*/

#define Faster_IO              ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F                      first
#define S                      second
#define pb                     push_back
#define MP                     make_pair
#define sf                     scanf
#define pf                     printf
#define PI                     (2*acos(0))
#define to_radian(degree)      ((pi/180)*degree)
#define to_degree(radian)      ((180/pi)*radian)
#define SQ(a)                  (a)*(a)
#define SORT(x)                sort(x.begin(),x.end())
#define rSORT(x)               sort(x.rbegin(),x.rend())
#define SetPrint(a,x)          cout<<fixed<<setprecision(x)<<a<<endl
#define show(vec)              for (int i=0; i<vec.size(); i++)cout << vec[i] << " ";
#define lines                  cout <<"\n" <<"---------------" << "\n";
#define YES                    printf("YES\n")
#define NO                     printf("NO\n")
#define Yes                    printf("Yes\n")
#define No                     printf("No\n")
#define testcase(n)            int n; cin >> n; while(n--)
#define lcm(a,b)               ((a / __gcd(a,b) ) * b)
#define gcd(a,b)               __gcd(a,b)
#define all(vec)               vec.begin(), vec.end()
#define SUM(vec)               accumulate(vec.begin(), vec.end(), 0)
#define gcin(str)              getline(cin, str)
///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Macro END-*-*-*-*-*-*-*--*-*-*-*-*/

///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Template Start-*-*-*-*-*-*--*-*-*-*-*/

//template <class T> T isPrime(T n){if(n<=1)return 0;for(long long i=2;i*i<=n; i++)if(n%i==0)return 0;return 1;}
//template <class T> T bigmod(T X, T n, T M) {if (n==0) return 1;if (n%2) return ((X%M) * bigmod(X,n-1,M)) %M;else {long long int d = bigmod(X,n/2, M);return ((d%M) * (d%M))%M;}}

///*-*-*-*-*-*-*-*-*-*-*-*-*-*-Template END-*-*-*-*-*-*-*--*-*-*-*-*/


int main()
{
    Faster_IO
    #ifndef ONLINE_JUDGE
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
    #endif

    int n;
    string s;

    int ac=0, wa=0,tle=0, re=0;

    cin >> n;
    while(n--)
    {
        cin >> s;

        if(s=="AC") ac++;
        else if(s=="WA") wa++;
        else if(s=="TLE") tle++;
        else if(s=="RE") re++;
    }

    cout << "AC x " << ac <<"\n" << "WA x " << wa << "\n" << "TLE x " <<tle << "\n" << "RE x " << re << "\n";

    return 0;
}


Measured memory_bytes: 3612
function Main(input) {
	input = input.split("\n");
	tmp = input[0].split(" ");
	var age = parseInt(input[0], 10);
    if (age === 7 || age === 5 || age === 3) {
      console.log('YES');
    } else {
      console.log('NO');
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
using System;
using System.Linq;

namespace D
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var hoge = Enumerable.Repeat(0, n).Select(x => Console.ReadLine().Split(' ').Select(long.Parse).ToList()).OrderBy(x => x[1]).ToArray();
            long sum = 0;
            for (var i=0;i<n;i++)
            {
                sum += hoge[i][0];
                if(sum>hoge[i][1])
                {
                    Console.WriteLine("No");
                    return;
                }
            }
            Console.WriteLine("Yes");
        }
    }
}


Measured memory_bytes: 48836
#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<math.h>

#define REPS(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)

using namespace std;

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

const int mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197;
const long double eps = 1e-7;

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

	int A[2][101];
	REP(i, 2) {
		REP(j, N) {
			cin >> A[i][j];
		}
		A[i][N] = 0;
	}

	// 累積和を取る
	for (int i = 1; i < N; i++) {
		A[0][i] += A[0][i - 1];
	}

	for (int i = N - 2; i >= 0; i--) {
		A[1][i] += A[1][i + 1];
	}

	int max = 0;

	REP(i, N) {
		if (max < A[0][i] + A[1][i]) {
			max = A[0][i] + A[1][i];
		}
	}

	cout << max << endl;

	//system("pause");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long int64;
typedef pair<int, int> P;
const int MOD = 1000000007;
template<typename T1, typename T2>
inline void add(T1 &a, const T2 &b) { a = (a + b) % MOD; }

void solve() {
    int N, K;
    cin >> N >> K;
    vector<P> layer;
    for(int i = 1; i * i <= N; ++i) {
        layer.emplace_back(i, 0);
        layer.emplace_back(N / i, 0);
    }
    sort(layer.begin(), layer.end());
    layer.erase(unique(layer.begin(), layer.end()), layer.end());
    rep(i, layer.size() - 1) {
        int l = N / layer[i + 1].first;
        int r = N / layer[i].first;
        layer[i].second = r - l;
    }
    layer.back().second = 1;
    int M = layer.size();
    map<int, int> ma;
    rep(i, M) ma[layer[i].first] = i;
    vector<vector<int64>> dp(K + 1, vector<int64>(M));
    dp[0][ma[N]] = 1;
    rep(i, K) {
        for(int j = M - 2; j >= 0; --j) {
            add(dp[i][j], dp[i][j + 1]);
        }
        rep(j, M) {
            int nj = ma[N / layer[j].first];
            dp[i + 1][j] = dp[i][nj] * layer[j].second;
        }
    }
    int ans = 0;
    rep(j, M) add(ans, dp[K][j]);
    cout << ans << '\n';
}

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


Measured memory_bytes: 54264
program common_subsequence
  implicit none
  integer(8), parameter :: md = 1000000007_8
  integer :: n, m, s(2000), t(2000), i, j
  integer(8) :: dp(0:2000,0:2000)
  s = 0
  t = 0
  dp = 0_8
  read(*,*) n, m
  read(*,*) s(1:n)
  read(*,*) t(1:m)
  do i = 1, n
    do j = 1, m
      if (s(i).eq.t(j)) then
        dp(i,j) = mod(1_8+dp(i,j-1)+dp(i-1,j),md)
      else
        dp(i,j) = mod(mod(dp(i,j-1)+dp(i-1,j),md)+mod(md-dp(i-1,j-1),md),md)
      end if
    end do
  end do
  write(*,'(i0)') dp(n,m)+1_8
  stop
end program common_subsequence

Measured memory_bytes: 31488
#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

const int N = 10010;
int n,a[N],cnt,p[N];
bool vis[N];

inline int F(int x,int mod){
	int nw=1,ret=0;
	For(i,0,n) ret=(ret+1ll*(a[i]%mod+mod)*nw)%mod,nw=1ll*nw*x%mod;
	return ret;
}

int main(){
	srand(time(0));
	n=read();
	int g=0;
	Dow(i,n,0) a[i]=read(),g=__gcd(g,abs(a[i]));
	poly ans;
	for (int i=2;i*i<=g;++i) if (g%i==0) ans.pb(i),g/=i;
	if (g!=1) ans.pb(g);
	For(i,2,n) if (!vis[i]){
		p[++cnt]=i;
		For(j,2,n/i) vis[i*j]=1;
	}
	For(i,1,cnt){
		bool flag=1;
		FOR(j,0,20){
			int x=(rand()<<16^rand())%p[i];
			if (F(x,p[i])){
				flag=0;break;
			}
		}
		if (flag) ans.pb(p[i]);
	}
	sort(all(ans)),ans.resize(unique(all(ans))-ans.begin());
	for (auto i:ans) printf("%d\n",i);
}

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

int main()
{
	string s;
	cin >> s;
	
	if(s[s.length()-1] == '2' || s[s.length()-1] == '4' || s[s.length()-1] == '5' || s[s.length()-1] == '7' || s[s.length()-1] == '9')
	{
		cout << "hon" << endl;
	} 
	else if(s[s.length()-1] == '0' || s[s.length()-1] == '1' || s[s.length()-1] == '6' || s[s.length()-1] == '8')
	{
		cout << "pon" << endl;
	} 
	else if(s[s.length()-1] == '3')
	{
		cout << "bon" << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    int n;
    cin >> n;
    vs32 b(n);
    rep (i, n)
    {
        cin >> b[i];
        if (b[i] > i + 1)
        {
            cout << "-1\n";
            return 0;
        }
    }

    vs32 ans(n);
    for (int i = n - 1; i >= 0; --i)
    {
        int pos = b.size() - 1;
        while (b[pos] != pos + 1) --pos;
        ans[i] = pos + 1;
        b.erase(b.begin() + pos);
    }

    rep (i, n)
    {
        cout << ans[i] << "\n";
    }
    return 0;
}



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

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


#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};


int main()
{
    int x,y;
    cin>>x>>y;
    if(x*2<=y && y<=x*4 && y%2==0)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    
    
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <cmath>
#include <cstdlib>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
#define ALL(x) x.begin(), x.end()
#define INF (1001000000)
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i:c)
#define EXIST(cs,v) (find(ALL(cs),(v))!=cs.end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define UNIQ(c) (c).erase(unique((c).begin(),(c).end()), (c).end());
#define P(p) cout<<(p)<<endl;

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

    int n;
    cin >> n;
    int h[n];
    REP(i, n) cin >> h[i];

    int cnt = 0;
    vector<int> flower(n);
    fill(ALL(flower), 0);
    REP(i, n) {
        while(flower[i] != h[i]) {
            int end = i;
            while (end < n && flower[end] < h[end]) end++;
            REP(i, end) flower[i]++;
            cnt++;
        }
    }
    P(cnt);

    return 0;
}


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

int main() {
long long int a, b, c;
 cin >> a >> b >> c;
  
 long long int d = c - a - b;
  if (4 * a * b < d * d && d > 0){
   cout << "Yes" << endl;
  }
    
  else{
   cout << "No" << endl;
  }
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define ll long long

#define fast ios_base::sync_with_stdio(false)
#define itt cin.tie(0)
#define now cout.tie(0)

using namespace std;

string s;

int main()
{
	cin>>s;
	if(s=="ABC")
		cout<<"ARC"<<endl;
	else
		cout<<"ABC"<<endl;
	return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define ll long long
ll mod=1000000007;
#define vl vector<ll>
#define pl pair<ll,ll>
#define rep(i,b) for(ll i=0;i<b;i++)
#define all(v) (v).begin(),(v).end()
using namespace std;

int main(){
    int n,q;
    cin>>n>>q;
    queue<ll>s[n];
    while(q--){
        ll a,b,c;
        cin>>a>>b;
        if(!a){
            cin>>c;
            s[b].push(c);
        }
        else if(a==1){
            if(!s[b].empty())cout<<s[b].front()<<endl;
        }
        else if(!s[b].empty())s[b].pop();
    }
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long x, k, d;
  cin >> x >> k >> d;
  x = abs(x);
  if (x / k >= d) {
    cout << x - k * d << '\n';
    return 0;
  }
  if (x / d % 2 == k % 2) {
    cout << x % d << '\n';
  } else {
    cout << d - x % d << '\n';
  }
  return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
main(){
  int w,h,a[55][55];
  string s[55];
  cin>>h>>w;
  for(int i=0;i<h;i++)cin>>s[i+1];
  for(int i=0;i<=w;i++)s[0]+='0';
  for(int i=0;i<=h;i++)s[i]='0'+s[i];
  for(int i=0;i<=h;i++)
    for(int j=0;j<=w;j++)
      a[i][j]=s[i][j]-'0';
  for(int i=1;i<=h;i++)
    for(int j=1;j<=w;j++){
      if(i==1)a[i][j]+=a[i][j-1];
      else if(j==1)a[i][j]+=a[i-1][j];
      else a[i][j]=min(a[i-1][j],a[i][j-1])+a[i][j];
    }
  cout<<a[h][w]<<endl;
}

Measured memory_bytes: 3216
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000

int n;
vector<pair<ll, ll> > v;

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

  cin >> n;
  rep(i, 0, n) {
    int x, l;
    cin >> x >> l;
    v.push_back(make_pair(x + l, x - l));
  }

  vsort(v);

  int rsl = 1;
  int cur = v[0].first;
  rep(i, 1, n){
    if(cur <= v[i].second) {
      cur = v[i].first;
      ++rsl;
    }
  }
  cout << rsl << endl;
}


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

#define LL long long
#define VI vector<int>
#define VB vector<bool>
#define VL vector<long long>
#define FOR(i,a,b) for(int i= (a); i<((int)b); ++i)
#define RFOR(i,a) for(int i=(a); i >= 0; --i)
#define FOE(i,a) for(auto i : a)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v,x) (std::find(v.begin(), v.end(), x) != v.end())
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define EPS 1e-14

const std::string YES = "YES";
const std::string Yes = "Yes";
const std::string NO = "NO";
const std::string No = "No";

bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }

// 4近傍（右, 下, 左, 上）
const std::vector<int> dy = { 0, -1, 0, 1 };
const std::vector<int> dx = { 1, 0, -1, 0 };

using namespace std;



int main() {
    int N;
    cin >> N;
    vector<LL> L(N), R(N);
    vector<pair<int, int>> P;

    LL max_ball = 0;
    LL min_ball = INT_MAX;
    FOR(i, 0, N) {
        cin >> L[i] >> R[i];
        max_ball = max(max_ball, max(L[i], R[i]));
        min_ball = min(min_ball, min(L[i], R[i]));
        P.emplace_back(make_pair(min(L[i], R[i]), max(L[i], R[i])));
    }
    sort(ALL(P));

    LL ans = LONG_LONG_MAX;
    // r_max = max_ball and r_min = min_ball
    {
        LL r_max = max_ball;
        LL r_min = min_ball;

        set<pair<LL, int>> S;
        S.insert({P[0].second,1000000});
        FOR(i,0, N) {
            if(i) {
                S.insert({P[i].second,i});
            }
        }
        while(1) {
            LL diff = S.rbegin()->first - S.begin()->first;
            ans = min(ans ,(r_max - r_min) * diff);

            auto a = *S.rbegin();
            S.erase(*S.rbegin());

            if(a.second>=1000000) {
                break;
            }
            S.insert({P[a.second].first,1000000});
        }
    }
    // r_max = max_ball and b_min = min_ball
    {
        LL r_max = max_ball;
        LL r_min = LONG_LONG_MAX;
        LL b_max = P[N-1].first;
        LL b_min = min_ball;
        FOR(i, 0, N) {
            r_min = min<LL>(r_min, P[i].second);
        }
        ans = min(ans, (r_max - r_min) * (b_max - b_min));
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 17392
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;

typedef unsigned int uint;
typedef long long llong;
typedef unsigned long long ullong;
// -2.1e-9 <= int <= 2.1e9
// -9.2e-18 <= long long <= 9.2e18
// 0 <= unsigned int <= 4.2e9
// 0 <= unsigned long long <= 18.4e18
// cout << fixed << setprecision(10);

int main()
{
    string S;
    cin >> S;
    if (S == "ABC") cout << "ARC" << endl;
    else cout << "ABC" << endl;
}


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

int main() {
  int N, sub=0;
  cin >> N;
  vector<int> a(N);
  
  for(int i=0;i < N;i++){
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  
  for(int i=0;i < N;i++){
    if(i % 2 == 0)
      sub += a.at(N-1-i);
    else
      sub -= a.at(N-1-i);
  }
  cout << sub <<endl;
}


Measured memory_bytes: 3600
#include <cstdio> 
#include <ctime> 
#include <cmath>   
#include <cstring>
#include <cstdlib>               //a = clock(); b = clock(); time = a - b;
#include <iostream>                                      
#include <map>                   //map<Type, Type>::iterator it;
#include <queue>                 //priority_queue< Type >Name
#include <stack>                 
#include <vector>                //.push_back()
#include <string>  
#include <algorithm>  
#define e 2.718281828459045      //底数
#define pi 3.141592653589793239  //high precision Π

using namespace std;
long long a,b;
int main(){
	int a;
	scanf("%d",&a);
	if(a==1)printf("0");
	else printf("1");
} 

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

class ABC058 {
    static void Main(string[] args) {
        var spl = Console.ReadLine().Split();
        int N = int.Parse(spl[0]);
        var D = new HashSet<char>(Console.ReadLine().Split().Select(s => (char)(int.Parse(s) + '0')).ToArray());
        for(int i=N; ; i++) {
            var s = i.ToString();
            foreach (var c in s) if (D.Contains(c)) goto NEXT;
            Console.WriteLine(s);
            return;
        NEXT:;
        }
    }
}


Measured memory_bytes: 5592
n, m = map(int, input().split())

xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

MOD = int(1e9 + 7)

x_sum = 0
y_sum = 0

for k in range(1, n+1):
    #x_sum += ((k-1) * xs[k-1] - (n-k) * xs[k-1])
    x_sum += ((2*k-n-1) * xs[k-1]) % MOD

for k in range(1, m+1):
    y_sum += (2*k-m-1) * ys[k-1] % MOD

print(x_sum * y_sum % MOD)

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

const int MAX_V = 1e5+10; //頂点数
vector<int> G[MAX_V]; //グラフの隣接リスト
vector<int> rG[MAX_V]; //辺の向きを逆にしたグラフ
vector<int> vs; //帰りがけ順の並び
vector<bool> visited(MAX_V); //既に調べたか
vector<int> cmp(MAX_V); //属する強連結成分のトポロジカル順序
int V,E;

struct SCC{

  void dfs(int v){
    visited[v] = true;
    for(int i = 0; i < G[v].size(); i++){
      if(!visited[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
  }

  void rdfs(int v,int k){
    visited[v] = true;
    cmp[v] = k;
    for(int i = 0; i < rG[v].size(); i++){
      if(!visited[rG[v][i]]) rdfs(rG[v][i],k);
    }
  }

  int scc(){
    fill(visited.begin(),visited.begin()+V,false);
    for(int v = 0; v < V; v++){
      if(!visited[v]) dfs(v);
    }

    fill(visited.begin(),visited.begin()+V,false);
    int k = 0;
    for(int i = vs.size()-1; i >= 0; i--){
      if(!visited[vs[i]]) rdfs(vs[i],k++);
    }
    return k;
  }

}scc;

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

  //強連結成分分解
  cin >> V >> E;
  for(int i = 0; i < E; i++){
    int s,t; cin >> s >> t;
    G[s].push_back(t);
    rG[t].push_back(s);
  }
  scc.scc();

  int Q; cin >> Q;
  for(int i = 0; i < Q; i++){
    int u,v; cin >> u >> v;
    if(cmp[u] == cmp[v]) cout << 1 << endl;
    else cout << 0 << endl;
  }

  return 0;
}



Measured memory_bytes: 9528
#include<bits/stdc++.h>
using namespace std;
int n,a[100010];
int main()
{
    cin>>n;
    for(int i=1;i<=n;++i)scanf("%d",a+i);
    sort(a+1,a+n+1);
    reverse(a+1,a+n+1);
    for(int i=1;i<=n;++i){
        if(i+1>a[i+1]){
        	int ans=0;
            for(int j=i+1;a[j]==i;++j)ans^=1;
            ans|=(a[i]-i)&1;
            if(ans)puts("First");
            else puts("Second");
            return 0;
            
		}
	}
}

Measured memory_bytes: 640
import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

x = I()

if x == 0:
    print(1)
elif x == 1:
    print(0)


Measured memory_bytes: 9212
#include <stdio.h>

int main(void) {
	int N, l, r;
	int ans = 0;

	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d %d", &l, &r);
		ans += r - l + 1;
	}

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

	return 0;
}

Measured memory_bytes: 128
from sys import stdin
import sys
N, M = [int(x) for x in stdin.readline().rstrip().split()]
A = []
for _ in range(N):
    temp = [int(x) for x in stdin.readline().rstrip().split()]
    A.append(temp)
A = sorted(A, key = lambda x: x[0])
ans = 0
for i in range(N):
    a = min(M, A[i][1])
    ans += a * A[i][0]
    M -= a
    if M == 0:
        print(ans)
        sys.exit()

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

using namespace std;
using namespace __gnu_pbds;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"
#define  st first
#define  nd second
#define int unsigned long long 

template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef cc_hash_table<int, int, hash<int > > ht;

const int  M    =  998244353;
const int  maxn =  100001   ;
const int  inf  =  1e16     ;
const long double eps = 1.084202e-19;
bool lessThan ( long double a, long double b ){ if ( a + eps < b ) return true; else return false; }

int32_t main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      long double  a , b ,c ; 
      cin >> a >> b >> c  ; 
      long double x = a + b + (2*sqrt(a*b)) ; 
      if(lessThan(x,c))
        cout <<"Yes";
      else
      {
           cout <<"No";
      }
      
       

   
return 0;
}  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; // [9,223,372,036,854,775,807 to -9.....808] 19 digits
typedef long double ld;
#define inc(i, a, b) for (long long int i = a; i <= b; i++)
#define dec(i, a, b) for (long long int i = a; i >= b; i--)
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL);                \
    cout.tie(NULL);
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define lv vector<ll>
#define cv vector<char>
#define dv vector<ld>
#define rall(c) (c).rbegin(), (c).rend()
#define lpr pair<ll, ll>
#define mp make_pair
#define cin(c) \
    ll c;      \
    cin >> c;
#define lmap unordered_map<ll, ll>
#define vinp(a, n) \
    inc(i, 1, n)   \
    {              \
        cin(k);    \
        a.pb(k);   \
    }
#define LIM 1000000007
#define F first
#define S second
#define fr(i, n) inc(i, 0, n - 1)
#define fri(n, a) \
    inc(i, 0, n - 1) { cin >> a[i]; }
#define endl cout << "\n";
#define debug(p) cout << p;
#define umap unordered_map
#define uset unordered_set
#define fill(a, val, n) \
    inc(i, 0, n - 1) { a[i] = val; }
void i_love_Accepted()
{
    ll a[5];
    fri(5,a);
    fr(i,5)
    {
        if(a[i]==0)
        {
            cout<<i+1;
            return;
        }
    }
}   
int main()
{
    fast;
    ll t=1;
    //cin>>t;
    while(t--)
    {
        i_love_Accepted();
        endl;
    } 
}


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

const int MOD = 1000000007;
int main() {

ll n,k;
cin>>n>>k;
ll N=n+1;
//N=数字の個数に。
ll sum=0;
for (ll i = k; i <= N; i++)
{
  /*if(i==N)//Nからkこ選ぶとき なくて良かった その場合も下の式できちんと1になるので
  {sum+=1; continue;}*/

  //最初はN=4,i=2みたいな感じで始まる 最大の数はA+n (n=3)
  ll l=0,r=0;
 /* rep(j,i)
  {l+=(n-j);r+=(j);}*/
  l=i*(n+n-i+1)/2;
  r=i*(i-1)/2;
  //cout << l<<":"<<r<<endl;
  sum=(sum+(l-r)+1)%MOD;//等差数列の公式を使って、ループしなくてもいいようにする


  
}

cout << sum<<endl;

}
/*vector <int> a(3);
for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }*/

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
const ll MOD = (ll)1e9+7;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}

int main(){
	string a, b;
	cin >> a >> b;
	rep(i, (int)a.size()-(int)b.size()+1){
		if(a.substr(i, b.size())==b){
			cout << i << endl;
		}
	}
	return 0;
}



Measured memory_bytes: 3192
N = int(input())
out = ["AC","WA","TLE","RE"]
output = [0]*4

for _ in range(N):
    S = input()
    if S == out[0]:
        output[0] += 1
    elif S == out[1]:
        output[1] += 1
    elif S == out[2]:
        output[2] += 1
    else:
        output[3] += 1

print(out[0],"x",output[0])
print(out[1],"x",output[1])
print(out[2],"x",output[2])
print(out[3],"x",output[3],end="")

Measured memory_bytes: 70012
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#define all(x) (x).begin(),(x).end()
#define size(x) ((int)(x).size()) 
#define FIRST first 
#define SECOND second
#define FRONT front
#define PUSH_BACK push_back
#define MAKE_PAIR make_pair 
#define EMPTY empty
#define PRIORITY_QUEUE priority_queue
using namespace std;
typedef long long LL;
typedef unsigned int uii;
typedef pair<int,int> pii;
typedef unsigned long long uLL; 
typedef vector<LL> vii; 
// const double PI = acos(-1.0);
//head
const int inf = 1e9;
const int M = 1e9 + 7;

typedef vector<vii> mat;

mat mul(mat &A, mat &B){
	// cout << size(B[0]) << endl;
	mat C(size(A), vii(size(B[0])));
	for(int i = 0; i < size(A); i++){
		for(int j = 0; j < size(B[0]); j++){
			for(int k = 0; k < size(B); k++){
				C[i][j] = (C[i][j] + A[i][k] * B[k][j]) % M; 
			}
		}
	}
	return C;
}
mat pow(mat A, LL n){
	mat B(size(A), vii(size(A)));
	for(int i = 0; i < size(A); i++){
		B[i][i] = 1;
	}
	while(n > 0){
		if(n & 1) {
			B = mul(B, A);
		}
		A = mul(A, A);
		n >>= 1;
	}
	return B;
}

void test(mat &A){
	for(int i = 0; i < size(A); i++){
		for(int j = 0; j < size(A[0]); j++){
			cout << A[i][j] << ' ';
		}
		cout << endl;
	}
}
int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
	// freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	LL n, k;
	cin >> n >> k;
	mat a(n, vii(n));
	for(int i = 0; i < n; ++i){
		for(int j = 0; j < n; ++j){
			cin >> a[i][j];
		}
	}
	mat b = pow(a, k);
	LL res = 0;
	for(int i = 0; i < n; ++i){
		for(int j = 0; j < n; ++j){
			res = (res + b[i][j]) % M;
		}
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define pf push_front
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 
const ll MOD = 1e9+7;
const ll MAXN = 2e5+5;

ll mpow(ll x, ll n) {
	ll res = 1;
	while(n != 0) {
		if(n&1) res = res * x % MOD;
		x = x*x % MOD;
		n = n >> 1;
	}
	return res;
}

vector<ll> inv(MAXN);

ll Cnk(ll n, ll k) {
	ll res = 1;
	for(ll i = 1; i <= k; i++) {
		res = res*(n-i+1) % MOD;
	}

	for(ll i = 1; i <= k; i++) {
		res = res*inv[i] % MOD;
	}
	return res;
}

int main() {
	ll n, a, b;
	cin >> n >> a >> b;
	
	for(int i = 1; i <= max(a, b); i++) {
		inv[i] = mpow((ll)i, MOD-2);
	}

	ll ca = Cnk(n, a);
	ll cb = Cnk(n, b);
	ll base = mpow(2, n);
	ll sum = (1+ca+cb) % MOD;
	


	ll ans;
	if(base >= sum) {
		ans = (base - sum) % MOD;
	} else {
		ans = (base + MOD - sum) % MOD;
	}
	cout << ans << endl;
	return 0;
}


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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)

typedef long long ll;

const ll inf = 1e18+7;
const ll mod = 1e9+7;


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

    if((b-a)%2)cout<<"Borys"<<endl;

    else cout<<"Alice"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string S;
	cin>>S; 
	int ans=0;
	for(int i=0;i<S.size();i++)
	{
		if(S[i]=='+')
		{
			ans=ans+1;
		}
		else
		{
			ans=ans-1;
		}
	}
	cout<<ans;
	return 0;
 } 

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

#define all(v) v.begin(), v.end()
#define V vector
#define P pair
typedef long long ll;
const int INT_INF = 1e9;
const ll INF = 1LL << 30;

int main() {
    ll n; cin >> n;
    map<ll, ll, greater<ll>> m;
    for(int i = 0; i < n; i++){
        ll a; cin >> a;
        m[a]++;
    }

    ll w = 0, h = 0;
    for(auto p : m){
        if(h > 0 && w > 0) break;
        if(p.second >= 4){
            if(h > 0){
                w = p.first;
                break;
            }else{
                cout << p.first * p.first << endl;
                return 0;
            }
        }else if(p.second >= 2){
            if(h == 0) h = p.first;
            else w = p.first;
        }
    }
    cout << w * h << endl;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,H,X,Y,Z; /*入力*/
  cin >> N;
  H = N%1111;
  X = N/10;
   Y = X%111;
    Z = (N - X)%100;
  //いい整数かどうかを判定する
  if (H==0||Y==0||Z==0){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


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

int main() {
	ios_base::sync_with_stdio( false );

	int n;
	while( (cin >> n) && n != 0 ) {
		vector<int> a( n );
		for( auto& v: a ) { cin >> v; }

		int result = INT_MIN;
		for( int i = 0; i < n; ++i ) {
			int x = 0;

			for( int j = i; j < n; ++j ) {
				x += a[j];

				if( x > result ) {
					result = x;
				}
			}
		}

		cout << result << '\n';
	}
}



Measured memory_bytes: 3172
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>

struct Node{
    int id;
    int k;
    std::vector<int> c;

    int parent;
    int depth;

    bool operator<(const Node &another) const {
        return id < another.id;
    };
    
};

std::string get_type(Node& node){
    if(node.parent == -1) return "root";
    if(node.k > 0) return "internal node";
    return "leaf";
}

void trace_parent(std::vector<Node>& nodes, Node& node){
    for(int c : node.c){
        nodes[c].parent = node.id;
    }
}

int trace_depth(std::vector<Node>& nodes, Node& node){
    if(node.depth >= 0){
        ; // pass
    }else if(node.parent == -1){
        node.depth = 0;
        return 0;
    }else{
        int p = trace_depth(nodes, nodes[node.parent]);
        node.depth = p + 1;
    }
    return node.depth;
}

int main(int argc, char **argv)
{
    int n;
    std::cin >> n;
    std::stringstream ss;

    std::vector<Node> nodes(n);

    for(int i = 0; i < n; i++){
        std::cin >> nodes[i].id;
        std::cin >> nodes[i].k;
        for(int j = 0; j < nodes[i].k; j++){
            int c;
            std::cin >> c;
            nodes[i].c.push_back(c);
        }
        nodes[i].parent = -1;
        nodes[i].depth = -1;
    }

    std::sort(nodes.begin(), nodes.end());

    for(int i = 0; i < n; i++){
        trace_parent(nodes, nodes[i]);
    }

    for(int i = 0; i < n; i++){
        trace_depth(nodes, nodes[i]);
    }

    for(int i = 0; i < n; i++){
        ss << "node " << nodes[i].id << ": ";
        ss << "parent = " << nodes[i].parent << ", ";
        ss << "depth = " << nodes[i].depth << ", ";
        ss << get_type(nodes[i]) << ", ";
        std::string sep = "";
        ss << "[";
        for(int j = 0; j < nodes[i].k; j++){
            ss << sep << nodes[i].c[j];
            sep = ", ";
        }
        ss << "]";
        ss << std::endl;
    }

    std::cout << ss.str();
    
}



Measured memory_bytes: 18280