akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.BigInteger;
public class Main
{
    public static void main(String[]args)
    {

        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Solver solver = new Solver();
        int ca = 1;
        solver.solve(ca,in,out);
        out.close();
    }
    static class Solver
    {

        public void solve(int ca,InputReader in,PrintWriter out)
        {
            while(ca -- != 0)
            {

                String s = in.next();
                String temp = "keyence";
                if(s.contains(temp))
                {
                    out.println("YES");
                }
                else
                {
                    int n = s.length();
                    int flag = 0;
                    for(int i = 0;i<n;i++)
                    {
                        for(int j = n-1;j >= i;j--)
                        {
                            if( (s.substring(0,i) + s.substring(j)).equals(temp))
                            {
                                out.println("YES");
                                flag = 1;
                                break;
                            }
                        }
                        if(flag == 1) break;
                    }
                    if(flag == 0) out.println("NO");
                }


            }
        }
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
        public BigInteger nextBigInteger()
        {
            return new BigInteger(next());
        }

    }
}

Measured memory_bytes: 22356
#include <bits/stdc++.h>
using namespace std;
const int maxn = 123456;
char s[maxn];
int main(){
	scanf("%s", s + 1);
	int len = strlen(s + 1);
	if(s[len] == '1') cout << -1 << endl;
	else if(s[1] == '0' || s[len - 1] == '0') cout << -1 << endl;
//	else if(s[len / 2] == '0' || s[len - len/2] == '0') cout << -1 << endl;
	else {
		vector<pair<int,int> > eds;
		bool bad = false;
		int root = 1;
		int sz = 1;
		for(int i = 2; i <= len/2; i++){
			if(s[i] == '1' || s[len - i] == '1'){
				if(s[i] == '1' && s[len - i] == '1'){
					int add = i - sz;
					int newRoot = ++sz;
					eds.push_back({root, newRoot});
					add--;
					while(add--){
						int newSon = ++sz;
						eds.push_back({newRoot, newSon});
					}
					root = newRoot;		
				} else {
					bad = true;
				}
			}
		}
		if(bad) cout << -1 << endl;
		else {
			int newRoot = ++sz;;
			eds.push_back({root, newRoot});
			int add = len - sz;
			for(int i = 0; i < add; i++){
				int newSon = ++sz;
				eds.push_back({newRoot, newSon});
			}
			for(auto e : eds) cout << e.first << " " << e.second << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 2420
N = int(input())
Odd = [num for num in range(1,N+1) if num%2 == 1]
dic = {}
counter = 0
for i in Odd:
  dic[i] = []
  for x in range(1,i+1):
    if(i%x == 0):
      dic[i].append(x)
  if(len(dic[i])==8):
    counter += 1
print(counter)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define lli long long int
#define vec2 vector<vector<lli>>
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define FRE freopen("explicit.in","r",stdin);freopen("explicit.out","w",stdout)
#define pll pair <lli,lli>
#define vll vector <lli>
#define vpll vector <pll>
#define f first
#define s second
#define pb push_back
#define priq priority_queue
#define unm unordered_map
#define pf push_front
#define minii LLONG_MAX
#define all(x) x.begin(), x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define ld double
#define eb emplace_back
const long double pi = 3.1415926535898;
const lli mod=1e9+7;
//const lli mod=100000000;
using namespace std;
lli lcm (lli a, lli b) {return ((a*b)/__gcd(a,b));}
lli modpower (lli a,lli b)
{
    if(b==0) return 1;
    lli c=modpower(a,b/2)%mod;
    if (b%2) return (((a*c)%mod)*c)%mod;
    else return (c*c)%mod;
}
lli power (lli a,lli b)
{
    if(b==0) return 1;
    lli c=power(a,b/2);
    if (b%2) return (a*c*c);
    else return c*c;
}
bool prime (lli k)
{
    if (k==1||k==0) return 0;
    bool flag=1;
    lli a=sqrt(k);
    for (int i=2;i<=a;i++)
    {
        if (k%i==0)
        {flag=0;break;}
    }
    return flag;
}
lli sieve (int n)
{
    bool qrr[n+1];
    for (int i=0;i<=n;i++)
    qrr[i]=1;qrr[0]=0;qrr[1]=0;
    for (int i=2;i*i<=n;i++)
    {
        if (qrr[i]==1)
        {
            for (int j=2*i;j<=n;j+=i)
            {qrr[j]=0;}
        }
    }
    return 0;
}
int main()
{
    fio;
    lli n;
    cin>>n;
    lli a[n+1][n+1];
    for (int i=1;i<=n;i++)
    {
        for (int j=1;j<=n;j++)
        {
            cin>>a[i][j];
        }
    }
    lli b=power(2,n);
    lli dp[b];
    mem(dp,0);
    dp[0]=1;
    for (int i=1;i<=n;i++)
    {
        for (int j=0;j<b;j++)
        {
            lli cnt=0;
            for (int k=0;k<n;k++)
            {
                if (j&(1LL<<k))
                cnt++;
            }
            if (cnt!=i-1)
            {
                continue;
            }
            for (int k=0;k<n;k++)
            {
                if (((1LL<<k)&j)==0&&a[i][k+1]==1)
                {
                    dp[j|(1LL<<k)]+=dp[j];
                    dp[j|(1LL<<k)]%=mod;
                }
            }
        }
    }
    cout<<dp[b-1];
    return 0;
}

Measured memory_bytes: 20052
#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_a_genius = 0; ngtkana_is_a_genius < int(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (int i = int(begin); (i) < int(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
 os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  std::string s, t; std::cin >> s >> t;
  int l = s.length(), m = t.length();
  std::vector<int>a(l),b(m);
  std::transform(all(s), a.begin(), [](char c){ return c == 'A' ? 1 : 2; });
  std::transform(all(t), b.begin(), [](char c){ return c == 'A' ? 1 : 2; });
  std::partial_sum(all(a),a.begin());
  std::partial_sum(all(b),b.begin());
  a.insert(a.begin(), 0);
  b.insert(b.begin(), 0);
  // debug(a,b);
  int q; std::cin >> q;
  loop(q) {
    int u, v, w, x;
    std::cin >> u >> v >> w >> x;
    u--, w--;
    int A = a.at(v) - a.at(u);
    int B = b.at(x) - b.at(w);
    int C = A - B;
    if (C < 0) C = -C;
    bool ans = (C % 3 == 0) && (u!=v || w==x);
    std::cout << (ans ? "YES" : "NO") << std::endl;
  }
  return 0;
}

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

int main() {
  int n, m, s = 0;
  cin >> n;
  vector<int> t(n);
  for(int i = 0; i < n; i++) {
    cin >> t.at(i);
    s += t[i];
  }
  cin >> m;
  vector<int> p(m), x(m);
  for(int i = 0; i < m; i++)
    cin >> p.at(i) >> x.at(i);
  for(int i = 0; i < m; i++)
    cout << s + x[i] - t[p[i] - 1] << endl;
}

Measured memory_bytes: 256
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N,M;
char S[200100];
int32_t flag[200000][2];
std::vector<int> graph[200000];

bool deleted[200000];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N >> M;
	in >> S;
	for (int32_t i = 0; i < N; i++)
	{
		S[i] -= 'A';
	}
	for (int32_t i = 0; i < M; i++)
	{
		int a, b;
		in >> a >> b;
		--a; --b;

		graph[a].emplace_back(b);
		graph[b].emplace_back(a);

		++flag[a][S[b]];
		++flag[b][S[a]];
	}

	std::queue<int> que;
	for (int32_t i = 0; i < N; i++)
	{
		if (flag[i][0] <= 0 || flag[i][1] <= 0) {
			deleted[i] = true;
			que.push(i);
		}
	}
	while (!que.empty())
	{
		auto v = que.front(); que.pop();

		for (auto& t : graph[v]) {
			--flag[t][S[v]];
			if (flag[t][S[v]] <= 0 && !deleted[t]) {
				deleted[t] = true;
				que.push(t);
			}
		}
	}

	for (int32_t i = 0; i < N; i++)
	{
		if (!deleted[i]) {
			out << "Yes" << endl;
			return 0;
		}
	}
	

	out << "No" << endl;
	return 0;
}
#endif


Measured memory_bytes: 12544
#include <bits/stdc++.h>
using namespace std;
const long long MOD=1e9+7;
map<pair<long long, long long>, long long>mp;
map<pair<long long, long long>, bool>done;
long long modpow(long long x,long long e){
	if(x==1||e==0) return 1;
	long long c=modpow(x,e/2);
	long long c1=(c*c)%MOD;
	if(e%2==0) return c1;
	else return (c1*x)%MOD;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n;
	cin>>n;
	set<pair<long long, long long>>s;
	long long z1=0, z2=0, z0=0;
	for(int i=1;i<=n;i++){
		long long a, b;
		cin>>a>>b;
		if(a==0 && b==0){
			z0++;
		}
		else if(a==0){
			z1++;
		}
		else if(b==0){
			z2++;
		}
		else{
			long long g=__gcd(a, b);
			mp[{-a/g, -b/g}]++;
			mp[{a/g, b/g}]++;
			s.insert({a/g, b/g});
		}
	}
	long long fans=1;
	for(auto p:s){
		if(done[p]) continue;
		long long ans=modpow(2, mp[p])+modpow(2, mp[{-p.second, p.first}])-1;
		done[p]=true;
		done[{-p.second, p.first}]=true;
		done[{p.second, -p.first}]=true;
		done[{-p.first, -p.second}]=true;
		fans=(fans*ans)%MOD;
	}
	long long mul=modpow(2, z1)+modpow(2, z2)-1;
	fans=(fans*mul)%MOD;
	cout<<(fans+MOD-1+z0)%MOD;
}

Measured memory_bytes: 103628
p = input()
s = p.split()
w = int(s[0])
h = int(s[1])
x = int(s[2])
y = int(s[3])
r = int(s[4])
if 0+r <= x <= w-r and 0+r <= y <= h-r:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 5596
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
using namespace std;

int p;
string S;

int num();
int factor();
int term();
int calc();

int num(){
	int n = 0;
	while(p<S.size()-1){
		if(isdigit(S[p])) n = n*10+S[p]-'0';
		else break;
		p++;
	}
	return n;
}

int factor(){
	int n;
	if(S[p]=='('){
		p++; n = calc(); p++;
	}
	else n = num();
	return n;
}

int term(){;
	int n = factor();
	while(p<S.size()-1){
		if(S[p]=='*') p++, n *= factor();
		else if(S[p]=='/') p++, n /= factor();
		else break;
	}
	return n;
}

int calc(){
	int n = term();
	while(p<S.size()-1){
		if(S[p]=='+') p++, n += term();
		else if(S[p]=='-') p++, n -= term();
		else break;
	}
	return n;
}

int main(){
	int N;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>S;
		p = 0;
		printf("%d\n",calc());
	}
	return 0;
}

Measured memory_bytes: 1196
#include<cstdio>

int main(){
	int a[101] = {};
	int t, c = 0;
	while(scanf("%d", &t) + 1){
		a[t]++;
		if(a[t] > c){
			c++;
		}
	}
	for(int i = 1; i < 101; i++){
		if(a[i] == c){
			printf("%d\n", i);
		}
	}
}

Measured memory_bytes: 1028
#include<stdio.h>

int main()
{
  int n, m, l, i, j, k;

  scanf("%d %d %d", &n, &m, &l);
  
  int a[n][m], b[m][l]; 
  double c[n][l];

  for(i=0; i<n ; i++){
    for(j=0; j<m ; j++){
      scanf("%d", &a[i][j]);
	}
  }

  for(i=0; i<m ; i++){
    for(j=0; j<l ; j++){
      scanf("%d", &b[i][j]);
	}
  }

 for(i=0; i<n ; i++){
    for(j=0; j<l ; j++){
      c[i][j]=0;
	}
  }

  for(i=0; i<n ; i++){
    for(j=0; j<l ; j++){
      for(k=0; k<m ; k++){
      c[i][j] += a[i][k]*b[k][j];
      }
    }
  }

  for(i=0; i<n ; i++){
    for(j=0; j<l-1 ; j++){
      printf("%.0f ", c[i][j]);
	}
    printf("%.0f",c[i][l-1]);
    printf("\n");
  }

  return 0;
}

Measured memory_bytes: 788
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define REVERSE(a) reverse(ALL(a))
using namespace std;
typedef long long ll;
//vector<vector<int>> vec(i, vector<int>(j));

vector<int> input(int N) {
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }
    return vec;
}

void Main() {
    string s;
    cin >> s;
    int tmp = 0;
    int ans = 0;
    int start, end;
    bool flag = false;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'A') {
            start = i;
            break;
        }
    }
    for (int i = s.size()-1; i >= 0; i--)
    {
        if (s[i] == 'Z') {
            end = i;
            break;
        }
    }
    cout << end-start+1 << endl;
}

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

Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

#define L 20
#define Gard NULL

struct Tree{
  int nodekey;
  struct Tree *parent;
  struct Tree *leftch;
  struct Tree *rightch;
};

typedef struct Tree  *Search;
Search road;

void Insert(int );
void Pre(Search );
void In(Search );
Search Find(int ,Search);

int main(){
  int loop,numnode;
  char order[L];
  int i;
    
  scanf("%d",&loop);
  
  for(i=0;i<loop;i++){
    scanf("%s",order);
   
    if(order[0]=='i'){
      scanf("%d",&numnode);
      Insert(numnode);
    }
    
    else if(order[0]=='p'){
      In(road);
      printf("\n");
      Pre(road);
      printf("\n");
    }
    
    else if(order[0]=='f'){
      scanf("%d",&numnode);
    
      if(Find(numnode,road)!=Gard){
	printf("yes\n");
      }

      else{
	printf("no\n");
      }
    }
    
  }
  
  return 0;
}

void Insert(int numnode){
  Search x,y,z;
  
  x=road;
  y=Gard;
  z=malloc(sizeof(struct Tree));
  z->nodekey=numnode;
  z->leftch=Gard;
  z->rightch=Gard;
  
  while(x!=Gard){
    y=x;
    
    if(z->nodekey<x->nodekey){
      x=x->leftch;
    }
    
    else{
      x=x->rightch;
    }
  }
  
  z->parent=y;
  
  if(y==Gard){
    road=z;
  }
  
  else if(z->nodekey<y->nodekey){
    y->leftch=z;
  }
  
  else{
    y->rightch=z;
  }
  
}

void Pre(Search road){
  
  if(road==Gard){
    return;
  }
  
  printf(" %d",road->nodekey);
  
  Pre(road->leftch);
  Pre(road->rightch);
  
}

void In(Search road){
  
  if(road==Gard){
    return;
  }
  
  In(road->leftch);
  
  printf(" %d",road->nodekey);
  
  In(road->rightch);
}

Search Find(int numnode, Search road){
  
  if((road==Gard) || (numnode==road->nodekey)){
    return road;
  }
  
  else if(numnode<road->nodekey){
    return Find(numnode,road->leftch);
  }
  
  else{
    return Find(numnode,road->rightch);
  }
}



Measured memory_bytes: 20440
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


a, b, c = na()
print(max(b + c - a, 0))


Measured memory_bytes: 3444
#include<bits/stdc++.h>
#define rep(i,a) for(int (i)=0; (i)<(a); (i)++)
#define rrep(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define rep2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define all(v) v.begin(), v.end()
typedef long long ll;

using namespace std;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n; cin >> n;
  vector<ll> a(n);
  const ll MAX = 1e18;
  bool flg = false;
  rep(i,n){ cin >> a[i]; if(a[i] == 0) flg = true; }
  
  if(flg){ cout << "0"; return 0;}
  
  
  ll ans = 1;
  rep(i,n){
    if(a[i] > MAX/ans){ cout << "-1"; return 0;}
    ans *= a[i];
  }
  cout << ans;
  return 0;
}

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

int n;
map<string, ll> mp;

int main() {
    cin >> n;
    for(int i = 0; i < n; i++) {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        mp[s]++;
    }
    ll ans = 0;
    for(auto e : mp) {
        ll cnt = e.second;
        ans += cnt * (cnt-1) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 11136
#include "bits/stdc++.h"
using namespace std;
#define ri(a,b,c) for(int a=(b);a<(c);++a)
#define ll long long
#define rll(a,b,c) for(ll a=(b);a<(c);++a)

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

    int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;
    cin>>a;
  b=0;
  for(i=0;i<a;++i){
    cin>>s;
    while(s%2==0){
      s/=2;
      ++b;
    
    }
  
  }








    cout<<b<<endl;

    return 0;
}



Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

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

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class BChooseIntegers {
public:
    void solve(std::istream &in, std::ostream &out) {
        int a, b, c;
        in >> a >> b >> c;
        bool res = __gcd(b, c) % __gcd(a, b) == 0;
        out << (res ? "YES" : "NO") << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    BChooseIntegers solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
class UF():
  def __init__(self, N):
    self.par = [-1] * N

  def find(self, n):
    if self.par[n] < 0:
      return n
    else:
      self.par[n] = self.find(self.par[n])
      return self.par[n]

  def union(self, x,y):
    p1,p2 = self.find(x), self.find(y)
    if p1 == p2: return
    if p1 > p2:
      p1,p2 = p2,p1
    self.par[p1] += self.par[p2]
    self.par[p2] = p1

  def same(self, x,y):
    return self.find(x) == self.find(y)

N,K,L = map(int,input().split())
uf_road = UF(N)
uf_railway = UF(N)

for _ in range(K):
  u,v = map(int,input().split())
  u -= 1
  v -= 1
  uf_road.union(u,v)

for _ in range(L):
  u,v = map(int,input().split())
  u -= 1
  v -= 1
  uf_railway.union(u,v)

dic = {}
counter = []
for i in range(N):
  p1 = uf_road.find(i)
  p2 = uf_railway.find(i)
  counter.append((p1,p2))
  if (p1,p2) not in dic:
    dic[(p1,p2)] = 1
  else:
    dic[(p1,p2)] += 1

for i in range(N):
  print(dic[counter[i]], end=" ")

Measured memory_bytes: 125144
a = input()
b = input()
la = len(a)
lb = len(b)
L = [[0 for j  in range(la + 1)] for k in range(lb + 1)]
for i in range(la + 1):
    L[0][i] = i
for i in range(lb + 1):
    L[i][0] = i
for  m in range(1, la + 1):
    for n in range(1, lb + 1):
        if a[m-1] == b[n-1]:
            L[n][m] = L[n-1][m-1]
        else:
            L[n][m] = min(L[n-1][m], L[n][m-1], L[n-1][m-1]) + 1
print(L[-1][-1])

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

signed main(){
  int q , t , f , rev=0;
  string s;
  deque<char> head , tail;
  char c;
  cin>>s;
  cin>>q;
  for(int i=0;i<q;i++){
    cin>>t;
    if(t == 1){
      rev=(rev+1)%2;
    } else {
      cin>>f>>c;
      if(rev == 0 && f == 1 || rev == 1 && f == 2){
        head.push_front(c);
      } else {
        tail.push_back(c);
      }
    }
  }
  if(rev == 0){
    for(int i=0;i<head.size();i++){
      cout<<head[i];
    }
    cout<<s;
    for(int i=0;i<tail.size();i++){
      cout<<tail[i];
    }
  } else {
    for(int i=tail.size();i>0;i--){
      cout<<tail[i-1];
    }
    for(int i=0;i<s.size();i++){
      cout<<s[s.size()-1-i];
    }
    for(int i=head.size();i>0;i--){
      cout<<head[i-1];
    }
  } 
  cout<<endl;
  return(0);
}

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

public class Main {
    static int n;
    static int m;
    static int[] a;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();
        a = new int[n];
        Arrays.fill(a, -1);

        boolean bl = true;
        for (int i = 0; i < m; i++) {
            int k = sc.nextInt() - 1;
            int num = sc.nextInt();
            //0以外の00 000はダメ
            if (k == 0 && num == 0 && n > 1) {
                bl = false;
                break;
            }
            if (a[k] == -1) {
                a[k] = num;
            } else {
                //同じ指定で違う値はありえない
                if (a[k] != num) {
                    bl = false;
                    break;
                }
            }
        }
        //-1 は最小値0に置き換え
        for (int i = 0; i < n; i++) {
            if (a[i] == -1) {
                a[i] = 0;
            }
        }
        //0123 -> 1123
        if (a[0] == 0 && n > 1) a[0] = 1;

        if (m == 0) {
            if (n == 1) {
                System.out.print(0);
            } else {
                System.out.print(1);
                for (int i = 1; i < n; i++) {
                    System.out.print(0);
                }
            }
        } else if (bl) {
            for (int num : a) {
                System.out.print(num);
            }
        } else {
            System.out.print(-1);
        }
        System.out.println();
    }
}


Measured memory_bytes: 23124
import math

n, a, b = map(int, input().split())
mod = 10**9 + 7


def calcCombination(n, r, mod):
    
    x = 1
    y = 1
    for i in range(1, r + 1):
        x = x * (n-i+1) % mod 
        y = y * i % mod
    return (x*pow(y, mod-2, mod)) % mod

sumComb= pow(2, n, mod) 
# print(sumComb)
aComb = calcCombination(n, a, mod)
# print(aComb)
bComb = calcCombination(n, b, mod)
# print(bComb)
ans = ( sumComb - 1 - aComb - bComb ) % mod

print(int(ans))



Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N; cin>>N;
    vint a(N+1);
    REP(i,N){
        cin>>a[i+1];
        a[i+1]+=a[i];
    }

    int ans=1e18;
    for(int i=1;i<=N-1;i++){
        ans=min(ans,abs(2*a[i]-a[N]));
    }
    cout<<ans<<endl;

}


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

string s;
int res = 100000;

bool func(string t){
  rep(i, t.size() - 1){
    if(t.at(i) != t.at(i + 1)){
      return true;
    }
  }
  return false;
}

int main(){
  cin >> s;
  int n = s.size();
  rep(i, 26){
    char c = 'a' + i;
    string pt = "", t = s;
    int cnt = 0;
    while(func(t)){//判定
      pt = t;
      t = "";
      rep(i, pt.size() - 1){
        if(pt.at(i) == c || pt.at(i + 1) == c){
          t += c;
        }else{
          t += 'X';
        }
      }
      cnt++;
      cerr << t << endl;
    }
    if(t.at(0) != 'X'){
      res = min(res, cnt);
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef pair<pi, pi> pipi;
#define f first
#define s second
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<pii> vpii;
#define pb push_back
#define pf push_front
#define all(v) v.begin(), v.end()
#define disc(v) sort(all(v)); v.resize(unique(all(v)) - v.begin());
#define INF (int) 1e9 + 100
#define LLINF (ll) 1e18
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline ll rand(ll x, ll y) { ++y; return (rng() % (y-x)) + x; } //inclusivesss

ll n, cost[55], ans = LLINF;
string str[55][2];
map<string, ll> memo[2];

ll dp(string s, ll p) { // p = 0 means prefix
	string s2 = s;
	reverse(all(s2));
	if (s == s2) return 0ll;
	
	if (memo[p].count(s)) return memo[p][s];
	memo[p][s] = LLINF;
	ll f = !p;
	
	FOR(i, 1, n) {
		bool ok = 1;
		FOR(j, 0, min(s.size(), str[i][f].size())-1) if (s[j] != str[i][f][j]) ok = 0;
		if (!ok) continue;
		
		if (s.size() > str[i][f].size()) {
			string nxt = "";
			FOR(j, str[i][f].size(), s.size()-1) nxt += s[j];
			memo[p][s] = min(memo[p][s], dp(nxt, p) + cost[i]);
		} else {
			string nxt = "";
			FOR(j, s.size(), str[i][f].size()-1) nxt += str[i][f][j];
			memo[p][s] = min(memo[p][s], dp(nxt, f) + cost[i]);
		}
	}
	return memo[p][s];
}

int main() {
	fastio; cin >> n;
	FOR(i, 1, n) {
		cin >> str[i][0] >> cost[i];
		str[i][1] = str[i][0];
		reverse(all(str[i][1]));
	}
	FOR(i, 1, n) ans = min(ans, dp(str[i][0], 0) + cost[i]);
	cout << (ans == LLINF ? -1 : ans);
}


Measured memory_bytes: 3704
import sys

N = int(sys.stdin.readline())

ans = 0
for i in range(1, int(N**0.5) + 1):
    # print(i, N % i)
    a = i
    b_max = N // i
    for b in range(a, b_max + 1):
        c = N - a * b
        if c > 0:
            if a == b:
                ans += 1
            else:
                ans += 2

print(ans)

Measured memory_bytes: 66348
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int,int> P;
const int INF=(int)1e9;
const int MOD=(int)1e9+7;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
};

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

  int cont=0;
  for(int t=0;t<3;t++){
    if(s[t]=='1')cont++;
  }
  cout<<cont<<endl;

 return 0;
}


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

int main() {
    int n,m;
    cin >> n >> m;
    vector<int> a(n),w(n);
    for (int i=0;i<n;i++) {
        a[i]=0;
        w[i]=0;
    }
    int pin;
    string sin;
    for (int i=0;i<m;i++) {
        cin >> pin >> sin;
        pin--;
        if (sin=="AC") a[pin]=1;
        else {
            if (a[pin]==0) w[pin]++;
        }
    }
    ll aans=0,wans=0;
    for (int i=0;i<n;i++) {
        aans+=a[i];
        if (a[i]==1) wans+=w[i];
    }
    cout << aans << " " << wans << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<limits>
#include<math.h>
#include<bits/stdc++.h>

using namespace std;

#define make_graph(m,G) for (int i = 0; i<m; i++) { int a,b; cin>>a>>b;G[a-1].push_back(b-1); G[b-1].push_back(a-1);}
#define make_dir_graph(m,G) for (int i = 0; i<m; i++) { int a,b; cin>>a>>b;G[a-1].push_back(b-1);}
#define make_weighted_graph(m,G,w) for (int i = 0; i<m; i++) { int a,b; cin>>a>>b; cin>>w[a-1][b-1];w[b-1][a-1]=w[a-1][b-1];G[a-1].push_back(b-1); G[b-1].push_back(a-1);}
#define make_weighted_dir_graph(m,G,w) for (int i = 0; i<m; i++) { int a,b; cin>>a>>b; cin>>w[a-1][b-1]; G[a-1].push_back(b-1);}

int dp[1001][1001];
int main()
{
	int t=1;
	// cin>>t;
	while (t--)
	{
		// code
		int n,m; cin>>n>>m;
		char grid[n][m];
		for (int i = 0.; i<n; i++)
		{
			for (int j = 0; j<m; j++)
			{
				cin>>grid[i][j];
			}
		}		
		if (grid[0][0] == '#')
		{
			cout<<0<<endl;
			return 0;
		}
		dp[0][0] = 1;
		for (int i = 0; i<n; i++)
		{
			for (int j = 0; j<m; j++)
			{
				if (grid[i][j] != '#')
				{
					if (i>0 and grid[i-1][j] != '#')
					{
						dp[i][j]+= dp[i-1][j] % 1000000007;
					}
					if (j>0 and grid[i][j-1] != '#')
					{
						dp[i][j]+= dp[i][j-1] % 1000000007;
					}
				}				
			}
		}
		cout<<dp[n-1][m-1] % 1000000007;
		cout<<endl;	
	}
}

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

import math
x = 0.99999999999999999999
amin = math.ceil(a/0.08)
amax = int((a+x)//0.08) 
bmin = math.ceil(b/0.10)
bmax = int((b+x)//0.10)

amin,amax,bmin,bmax #(25, 37, 20, 29)

ans = -1
for i in range(amin,amax+1):
  if i >= bmin and i <= bmax:
    ans = i
    break

print(ans)


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

using namespace std;
using ll = long long;
using ld = long double;

void solve() {
  int n;
  cin >> n;
  n %= 1000;
  if (n == 0) {
    cout << 0 << endl;
    return;
  }
  cout << 1000 - n << endl;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);

  solve();
  return 0;
}


Measured memory_bytes: 3648
#include <stdio.h>

int main(){
  int i, j, n;
  int a[200000];
  int min,ans;

  scanf("%d",&n);
  
  for(i=0; i<n; i++)
    scanf("%d",&a[i]);

  min=a[0];
  ans=a[1]-a[0];

  for(i=1; i<n; i++){
    if(ans<a[i]-min)
      ans=a[i]-min;
    if(a[i]<min)
      min=a[i];
  }
    
  
  printf("%d\n",ans);

  return 0;
}



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

#define MAXN 300*1000 + 5

int fact[MAXN], fact_inv[MAXN];

const int mod = 1000*1000*1000 + 7;
using ll = long long;

int mul(ll a, ll b) {
	int ans = (1LL * a * b) % mod;
	while(ans >= mod) ans -= mod;
	while(ans < 0) ans += mod;
	return ans;
}

int mpow(int a, int n) {
	if(n == 0) return 1;
	int x = mpow(a, n/2);
	x = mul(x, x);
	if(n % 2) x = mul(x, a);
	return x;
}

int binomial(int n, int k) {
	return mul(fact[n], mul(fact_inv[n-k], fact_inv[k]));
}

void add_self(ll& a, ll b) {
	a += b;
	while(a >= mod) a -= mod;
}

void sub_self(ll& a, ll b) {
	a -= b;
	while(a < 0) a += mod;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	fact[0] = fact_inv[0] = 1;
	for(int i = 1; i < MAXN; i++) {
		fact[i] = mul(fact[i-1], i);
		fact_inv[i] = mpow(fact[i], mod-2);
	}

	int n;
	cin >> n;
	vector<ll> arr(n);
	for(ll& x : arr) cin >> x;
	ll ans = 0;

	for(int i = 0; i < n; i++) {
		add_self(ans, mul(n-1, arr[i] % mod));
	}

	for(int b = 0; b < 60; b++) {
		int k = 0;
		for(int i = 0; i < n; i++) {
			k += arr[i] >> b & 1;
		}

		if(k > 1) {
			sub_self(ans, mul((1LL<<(b+1)) % mod, binomial(k, 2)));
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 4992
#include <stdio.h>

int main()
{
	int a[100];
	int i,j,tmp;
	
	for (i=0;i<3;i++) {
		scanf("%d",&a[i]);
	}

	for (i=0;i<3;i++) {
		for (j=i+1;j<3;j++) {
			if (a[i]>a[j]) {
				tmp  = a[i];
				a[i] = a[j];
				a[j] = tmp;
			}
		}
	}
	
	
	printf("%d %d %d\n",a[0],a[1],a[2]);

return 0;
}


Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  ll n,k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i,n){
    cin >> a.at(i);
  }
  ll is=1;
  string ans;
  for(ll i=k;i<n;i++){
    if(a.at(i-k)<a.at(i)){
      cout << "Yes" << endl;
    }else{
      cout << "No"<<endl;
    }
  }
}

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

int main() {
    while (true) {
        int L;
        cin >> L;
        
        if (L==0) {
            break;
        }
        
        int M[12], N[12];
        
        for (int i=0; i<12; i++) {
            cin >> M[i] >> N[i];
        }
        
        int c = 0;
        bool flag = true;
        
        for (int i=0; i<12; i++) {
            c += M[i]-N[i];
            
            if (c>=L) {
                cout << i+1 << endl;
                flag = false;
                break;
            }
        }
        
        if (flag) {
            cout << "NA" << endl;
        }
    }
}


Measured memory_bytes: 3080
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
  int h, m, s, s_in;
  cin >> s_in;
  s = s_in % 60;
  m = s_in / 60;
  h = m / 60;
  m = m % 60;
  printf("%d:%d:%d\n", h, m, s);
}



Measured memory_bytes: 3220
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		k--;
		StringBuilder sb = new StringBuilder(sc.next());
		char c = sb.charAt(k);
		if(c=='A') sb.setCharAt(k, 'a');
		if(c=='B') sb.setCharAt(k, 'b');
		if(c=='C') sb.setCharAt(k, 'c');
		System.out.println(sb.toString());
		sc.close();
	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

int main(void) {
    ll h, w, n;
    cin >> h >> w >> n;
    vector<vector<ll>> v(h);
    REP(i, n) {
        ll a, b;
        cin >> a >> b;
        a--, b--;
        v[a].push_back(b);
    }

    deque<ll> dq1, dq2;
    for(ll i=0; i<w; i+=2) {
        dq1.push_back(i);
        dq2.push_back(i+1);
    }
    dump(dq1, dq2);
    REP(i, h) {
        if(i%2==0) {
            swap(dq1, dq2);
        } else {
            ll f = dq1.front(), t = dq2.back();
            dq1.pop_front();
            dq2.pop_back();
            swap(dq1, dq2);
            dq1.push_front(f);
            dq2.push_back(t);
        }

        for(auto j: v[i]) {
            if(j%2==0) {
                ll l = dq1[j/2], r = dq2[j/2];
                dq1[j/2] = r;
                dq2[j/2] = l;
            } else {
                ll l = dq1[(j+1)/2], r = dq2[j/2];
                dq1[(j+1)/2] = r;
                dq2[j/2] = l;
            }
        }
        dump(dq1, dq2);
    }

    vector<ll> ans(w);
    REP(i, w/2) {
        ans[dq1[i]] = i*2;
        ans[dq2[i]] = i*2+1;
    }
    for(auto i: ans) cout << i+1 << "\n";
    cout << flush;

    return 0;
}


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

typedef long long ll;
const int NMAX = 2e5 + 10;
const int MOD = 1e9 + 7;
int a[NMAX];
int main(int argc, char const *argv[])
{
	int n,ans = 0;
	scanf("%d",&n);
	for(register int i = 1;i <= n;i++)	scanf("%d",a+i),ans ^= a[i];
	for(register int i = 1;i <= n;i++)
		printf("%d%c",ans^a[i],i == n?'\n':' ' );
	return 0;
}

Measured memory_bytes: 4468
#include<cstdio>
#include<vector>

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

using namespace std;

typedef unsigned long long ull;

const int INF=1<<29;

int n,adj[100][100],deg[100];

void dfs(int u,bool *visited,vector<int> &cc){
	visited[u]=true;
	cc.push_back(u);
	rep(v,n) if(adj[u][v] && !visited[v]) dfs(v,visited,cc);
}

int calc(const vector<int> &cc){
	int res=0;
	for(int d=1;d<=14;d++){
		vector<int> S;
		rep(i,cc.size()){
			int u=cc[i];
			if(deg[u]>=d) S.push_back(u);
		}

		int m=S.size();
		if(m<d+1) continue;

		if(d==1){
			rep(j,m) rep(i,j) res=max(res,2*adj[S[i]][S[j]]);
		}
		else{
			ull T=(1<<d+1)-1;
			while(T<(1ULL<<m)){
				int w=0;
				bool ok=true;
				rep(i,m) if(T&(1ULL<<i)) {
					int w2=INF;
					rep(j,m) if(i!=j && T&(1ULL<<j)) w2=min(w2,adj[S[i]][S[j]]);
					if(w2==0){ ok=false; break; }
					else w+=w2;
				}
				if(ok) res=max(res,w);

				ull x=T&-T,y=T+x;
				T=((T&~y)/x>>1)|y;
			}
		}
	}

	return res;
}

int main(){
	int m; scanf("%d%d",&n,&m);
	rep(i,m){
		int u,v,w; scanf("%d%d%d",&u,&v,&w); u--; v--;
		adj[u][v]=adj[v][u]=w;
		deg[u]++;
		deg[v]++;
	}

	int ans=0;
	bool visited[100]={};
	rep(u,n) if(!visited[u]) {
		vector<int> cc;
		dfs(u,visited,cc);
		ans=max(ans,calc(cc));
	}
	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 804
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val A = scanner.nextInt()
    val B = scanner.nextInt()
    val C = scanner.nextInt()
    
    if (A + B >= C) {
        println("Yes")
    }
    else {
        println("No")
    }
}

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	if (s == "KIHBR" || s == "KIHABR" || s == "KIHBAR" || s == "KIHABAR"
			|| s == "AKIHBR" || s == "AKIHABR" || s == "AKIHBAR"
			|| s == "AKIHABAR" || s == "KIHBRA" || s == "KIHABRA"
			|| s == "KIHBARA" || s == "KIHABAR" || s == "AKIHABAR"
			|| s == "AKIHABRA" || s == "AKIHBARA" || s == "AKIHBRA"
			|| s == "AKIHABARA") {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
int main()
{
   int n;
   cin >> n;
   int a = n % 10;
   int b = n / 100;
   if (a == b)
   {
      cout << "Yes" << endl;
   }
   else
   {
      cout << "No" << endl;
   }
   return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <queue>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
#define MAX_V 100001
#define MOD 1000000007

int main(){
    int n;cin>>n;
    double count=0;
    double d=0;
    vector<int> v;
    for(int i=0;i<n;i++) v.push_back(i);
    vector<pair<double,double> > xy(n);
    for(int i=0;i<n;i++){
        double x,y;cin>>x>>y;
        xy[i]={x,y};
    }
    do{
        count++;
        for(int i=0;i<n-1;i++){
            double xx=xy[v[i]].first-xy[v[i+1]].first;
            double yy=xy[v[i]].second-xy[v[i+1]].second;
            d+=sqrt(xx*xx+yy*yy);
        }
    }while(next_permutation(v.begin(),v.end()));
    cout<<setprecision(10)<<d/count<<endl;
}

Measured memory_bytes: 256
// 参考: https://atcoder.jp/contests/abc148/submissions/9084449
// lupinthe14th さんありがとうございます m(_ _)m

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

const (
	// 初期バッファサイズ
	initBufSize = 1000
	// 上限バッファサイズ
	maxBufSize = 10000000
)

// stringToInt はstring型のスライスをint型のスライスにキャストする関数
func stringToInt(tSlice []string) (rSlice []int) {
	for _, str := range tSlice {
		num, err := strconv.Atoi(str)
		if err != nil {
			panic(err)
		}
		rSlice = append(rSlice, num)
	}
	return
}

// brickBreak は破壊したレンガの個数を返す関数
func brickBreak(tSlice []int) int {
	var broke, nowNum int = 0, 1
	for i := 0; i < len(tSlice); i++ {
		if tSlice[i] != nowNum {
			// N番目のレンガの番号が一致しなかったら破壊
			broke++
		} else {
			// 番号が一致したら次の番号に
			nowNum++
		}
	}
	// 用意されているレンガを全部壊したなら
	if broke == len(tSlice) {
		return -1
	}
	return broke
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var buf []byte = make([]byte, initBufSize)
	scanner.Buffer(buf, maxBufSize)

	scanner.Scan()
	_ = scanner.Text()

	scanner.Scan()
	var brickNums []int = stringToInt(strings.Split(scanner.Text(), " "))

	fmt.Println(brickBreak(brickNums))
}


Measured memory_bytes: 16384
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>

#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)

#define yes puts("Yes")
#define no puts("No")
#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

inline void io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;

int n;
int t,a;
vi h;
int ans=0;
double ansd=1e9;

signed main(){
    io();

    in(n);
    in(t,a);
    resz(n,h);
    in(h);
    rep(i,n){
        double res=t-h[i]*0.006;
        double d=fabs(a-res);
        if(d<ansd){
            ans=i+1;
            ansd=d;
        }
    }
    out(ans);

    return 0;
}


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

bool read_data(int* distances, int count, int& velocityA, int& velocityB)
{
	for (int i = 0; i < count; ++i) {
		if (scanf("%d,", &distances[i]) != 1) {
			return false;
		}
	}
	return (scanf("%d,%d", &velocityA, &velocityB) == 2);
}


int main()
{
	const int distance_count = 10;
	int distances[distance_count], velocityA, velocityB;

	while (read_data(distances, distance_count, velocityA, velocityB)) {
		int total_distance = 0;
		for (int i = 0; i < distance_count; ++i) {
			total_distance += distances[i];
		}
		int cross_point = (total_distance * velocityA + velocityA + velocityB - 1) / (velocityA + velocityB);
		int cumulative_distance = 0;
		for (int i = 0; i < distance_count; ++i) {
			cumulative_distance += distances[i];
			if (cross_point <= cumulative_distance) {
				std::cout << (i + 1) << std::endl;
				break;
			}
		}
	}

	return 0;
}

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

void solve(int n,int mn,int mx){
    int t,st=0,maxx=0,ans=0;
    vector<int> v;
    cin >> st;
    for(int i=0;i<n-1;i++){
        cin >> t;
        v.push_back(st-t);
        st=t;
    }
    for(int i=mn-1;i<mx;i++){
        if(maxx<v[i]){
            maxx=v[i];
        }
        if(maxx<=v[i]){
            ans=i+1;
        }
    }
    
    cout<<ans<<endl;
    
}

int main(void){
    int a,b,c;
    while(cin>>a>>b>>c,a){
        solve(a,b,c);
    }
    
    
    
}

Measured memory_bytes: 3128
while True:
	n = input()
	if n == 0: break

	a = 0
	b = 0
	for _ in range(n):
		a_, b_ = map(int, raw_input().split())
		sum = a_ + b_
		if a_> b_: 
			a += sum
		elif b_ > a_: 
			b += sum
		else:
			a += a_
			b += b_
	print a, b

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

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )
#define fore( x , j ) for( auto x : j )
#define se second
#define fr first
//#define c_b fflush(stdin);

const ll Long_max = numeric_limits < ll > :: max() ;
const int Int_max = numeric_limits < int > :: max() ;

void File_input( string pathIn ) {
    freopen( pathIn.c_str(), "r", stdin ) ;
}

void File_output( string pathOut ) {
    freopen( pathOut.c_str(), "w", stdout ) ;
}

int msg() {
    srand( time( 0 ) ) ;
    vector < string > st = {
        "Wish everyone high ratings!",
        "Good luck!",
        "Have fun!",
        "Please, read all the problems!",
        "Go Go fight!"
    } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}

void FastInputOutput() {
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

int a , b , c ;

int main() {
  cin >> a >> b >> c ;
  cout << min( a * b , c ) ;

  return 0 ;
}


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

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	int x;
	cin >> x;
	if(x >= 30) cout << "Yes";
	else cout << "No";

	return 0;
}



Measured memory_bytes: 3632