akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var s = cin.next();            
            Console.WriteLine(s + (s[s.Length-1]=='s'?"es":"s"));
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 25812
// AOJ ITP2_2_D Splice
// 2019.3.21 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
	int n = 0, c = gc();
	while (isspace(c)) c = gc();
	if (c == '-') {
		c = gc();
		do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n)
{
	int i;
	char ob[30];

	if (!n) pc('0');
	else {
		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) ob[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(ob[i]);
	}
}

typedef struct { int x, nxt; } T;
T tbl[200000002]; int sz = 1;
int top[1010], end[1010]; int ava[1010];

int main()
{
	int n, q, c, s, t, f;

	n = in(), q = in();
	while (q--) {
		c = gc() & 0xf, gc();
		if (c == 0) {    // insert(t, x)
			t = in(), tbl[sz].x = in();
			if (ava[t] == 0) top[t] = sz;
			else tbl[end[t]].nxt = sz;
			ava[t] = 1;
			end[t] = sz++;
		}
		else if (c == 1) { // dump(t)
			t = in();
			if (ava[t]) {
				f = 0, s = top[t];
				while (s >= 0) {
					if (f) pc(' ');
					else f = 1;
					out(tbl[s].x);
					if (s == end[t]) break;
					s = tbl[s].nxt;
				}
			}
			pc('\n');
		}
		else {   // splice(s, t)
			s = in(), t = in();
			if (ava[s]) {
				if (!ava[t]) top[t] = top[s], ava[t] = 1;
				else tbl[end[t]].nxt = top[s];
				end[t] = end[s];
				end[s] = 0, ava[s] = 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 5488
#include <bits/stdc++.h>
using namespace std;
using vec = vector<int>;
using mat = vector<vec>;

int N, M;
mat A;

int solve(vector<bool> ok) {
  vec cnt(M, 0);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      if (ok[A[i][j]]) {
        cnt[A[i][j]]++;
        break;
      }
    }
  }
  int P, Q = 0;
  for (int i = 0; i < M; i++) {
    if (Q < cnt[i]) {
      P = i;
      Q = cnt[i];
    }
  }
  if (Q == 0) {
    return N;
  } else {
    ok[P] = false;
    return min(solve(ok), Q);
  }
}

main() {
  cin >> N >> M;
  A.resize(N, vec(M));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
      A[i][j]--;
    }
  }
  vector<bool> sports(M, true);
  cout << solve(sports) << endl;
}

Measured memory_bytes: 1152
#include<stdio.h>

int main(){
	int i,j,k,N,flag,tmp;
	int count=0;
	int A[101];
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&A[i]);
	}
	for(i=0;i<N-1;i++){
		for(j=N-1;j>i;j--){
			if(A[j-1]>A[j]){
				tmp = A[j];
				A[j] = A[j-1];
				A[j-1] = tmp;
				count++;
			}
		}
	}
	
	for(k=0;k<N;k++){
		if(k==N-1){
			printf("%d\n%d\n",A[k],count);
		}else{
			printf("%d ",A[k]);
		}
	}
}

Measured memory_bytes: 1028
S = input()
T = input()
max_count = 0
for i in range(len(S)-len(T)+1):
    count = 0
    for j in range(len(T)):
        if S[i+j] == T[j]:
            count += 1
    max_count = max(max_count, count)
print(len(T) - max_count)


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

int main(){
	int N;
	cin >> N;
	int H[N];
	int count = 1;
	int viewable = 0;
	for(int i = 0; i < N; i++){
		cin >> H[i];
	}
	for(int i = 1; i < N; i++){
		viewable = 1;
		for(int j = 0; j < i; j++){
			if(H[j] > H[i]){
				viewable = 0;
				break;
			}
		}
		if(viewable == 1){
			count++;
		}
	}
	cout << count;
	return 0;
}

Measured memory_bytes: 256
//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//数値計算 個数以外はdouble
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//数が大きい時の比較はstring型で行う
//全て0になったか調べたい->0になるたびにcntする
//例外処理は最初にする
//x = p^m + q^n...の約数の個数:(n+1)*(m+1)....
//N!のどの素因数で何回割れるか
//⇔1~Nまでの数がそれぞれどの素因数で何回割り切れるかの和
//パズルの問題->一般化して全探索
//stack<ll> s;
//s.push(要素);s.top();s.pop();
//queue<ll> q;
//q.push(要素);q.front();q.pop();
//同じ作業繰り返す系の問題：収束先を見つける
//過半数：N/2.0で判定
//優先度付きキュー
//priority_queue<
//ll,
//vector<ll>
//> q;
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
#define PI 3.14159265358979323846264338327950L
using namespace std;


//割るやつ
const ll MOD = (pow(10, 9) + 7);

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

//a,bの最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//階乗計算
ll f(ll n) {
	if (n == 0 || n == 1) return 1;
	else return (n * f(n - 1));
}

//Nのd桁目の数
ll dignum(ll N, ll d) {
	ll x = pow(10, d);
	N %= x;
	ll y = pow(10, d - 1);
	N /= y;
	return N;
}

//Nをdで何回割れるか
ll divcnt(ll N, ll d) {
	ll ans = 0;
	while (1) {
		if (N%d == 0) {
			ans++;
			N /= d;
		}
		else break;
	}

	return ans;
}

//素数判定
bool prime(ll num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2) {
		if (num % i == 0) return false;
	}
	return true;
}

//フィボナッチ数列
vector<ll> memo(pow(10, 6) + 1);
ll fibo(ll n) {
	if (n == 1) return 1;
	else if (n == 2) return 1;
	else if (memo[n] != 0) return memo[n];
	else return memo[n] = fibo(n - 1) + f(n - 2);
}

ll RS(ll N, ll P, ll M) {
	if (P == 0) return 1;
	if (P % 2 == 0) {
		ll t = RS(N, P / 2, M);
		return t * t % M;
	}
	return N * RS(N, P - 1, M);
}

int main() {
	int x[5];rep(i,5)cin >> x[i];

	rep(i,5){
		if(x[i] == 0){
			cout << i + 1 <<  endl;
			return 0;
		}
	}
}

Measured memory_bytes: 11028
import sys
N = int(input())
X = [int(c) for c in input().split()]
l = [10**10]
for i in range(1,101):
    l.append(0)
    for j in range(len(X)):
        l[i] += (X[j]-i)**2
    
    if l[i-1] < l[i]:
        print(l[i-1])
        sys.exit(0)

Measured memory_bytes: 9192
#include <stdio.h>
#include <string.h>
int main(void){
  char s[100000];
  scanf("%s",s);
  int n=strlen(s),max=0;
  for(int i=0;i<n;i++){
    int cnt=0;
    for(int j=i;j<n;j++){
      if(s[j]=='A'||s[j]=='T'||s[j]=='C'||s[j]=='G') cnt++;
      else break;
    }
    if(max<cnt) max=cnt;
  }
  printf("%d",max);
  return 0;
}

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	int X, Y;
	cin >> X >> Y;
	vector<int> x, y;
	x.push_back(X);
	y.push_back(Y);
	for(int i = 0; i < n; i++) {
		int a;
		cin >> a;
		x.push_back(a);
	}
	for(int i = 0; i < n; i++) {
		int a;
		cin >> a;
		y.push_back(a);
	}
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());
	if(x.back() < y.front()) {
		puts("No War");
	}
	else{
		puts("War");
	}
	return 0;	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int>P;
#define PI 3.14159265359
#define MOD 1000000007
const int MAX =510000;
//この設定だとn<10^7が限界。maxの０を一個増やせば100msかかるが一桁増やせる。
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
  	COMinit();
	int N,K;cin >>N>>K;
  	rep(i,K){
    	ll g;	
    	g=((COM(N-K+1,i+1))*(COM(K-1,i)))%MOD;
      	cout<<g<<endl;
    }
}


Measured memory_bytes: 12160
// C - Unification
// https://atcoder.jp/contests/abc120/tasks/abc120_c
#include <bits/stdc++.h>
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007      //10^9+7
#define SORT(n) sort(n.begin(), n.end())
#define SORTR(n) sort(n.begin(), n.end(), greater<int>())
#define REV(n) reverse(n.begin(), n.end())
#define Vec(K, L, N, S) vector<L> K(N, S)
#define rt sqrt
#define pb push_back
#define eb emplace_back
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<lli>;
using P = pair<lli, lli>;
using vp = vector<P>;
using vs = vector<string>;
using ll = long long;
template <class T = string, class U = char>
int char_count(T text, U character)
{
  int ans = 0;
  for (U i : text)
  {
    ans += (i == character);
  }
  return ans;
}
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  // os << '}';
  return os;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli a = 0, b = 0, c, h, k, n, w, ans = 0, count = 0;
  string s, t;
  cin >> s;
  cout << min(char_count(s, '0'), char_count(s, '1')) * 2 << endl;
}

Measured memory_bytes: 640
#!/usr/bin/env python3
s = input()
k = int(input())
n = len(s)
ans = []
# kを減らしていく。もし、aまで戻せるならaまで進めてk をその分減らす。
for i in range(n):
    if s[i] == "a":
        ans.append("a")
    elif 123 - ord(s[i]) <= k:
        ans.append("a")
        k -= 123 - ord(s[i])
    else:
        ans.append(s[i])
# print(k)
k %= 26  # 26で割ったあまりに落とす
ans[-1] = chr((ord(ans[-1]) + k - 97) % 26 + 97)
print("".join(ans))


Measured memory_bytes: 10124
N = int(input())

X = []
L = []
Y = []
for i in range(N):
  tx,tL = map(int,input().split())
  X.append(tx)
  L.append(tL)
  Y.append((tx-tL,tx+tL))

Y.sort(key=lambda x : x[1])

select = 0
for i in range(N):
  if i == 0:
    temp = Y[i][1] #今の終わり
    select += 1
  else:
    if Y[i][0] >= temp: #今の終わりより次の始まりの方が後ならおｋ
      temp = Y[i][1]
      select += 1
print(select)



Measured memory_bytes: 26460
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define endl "\n"
#define all(v) (v).begin(),(v).end()
#define sz(v) (v).size()
// #define int long long
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<endl
bool desc_sort(const int & lhs,const int & rhs)
{
    return lhs>rhs;
}
bool desc_pii_sort(const pii & lhs , const pii & rhs)
{
    return lhs>rhs;
}
bool second_sort(const pii & lhs , const pii & rhs)
{
    pii a,b;
    a.F = lhs.S;
    a.S = lhs.F;
    b.F = rhs.S;
    b.S = rhs.F;
    return a<b;
}
template<class T> ostream& operator<<(ostream &os, vector<T> V) {
    os << "[ ";
    for(auto v : V) os << v << " ";
    return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){
    os << "{ ";
    for(auto s:S) os<<s<<" ";
    return os<<"}";
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
    return os << "(" << P.first << "," << P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
    os << "{ ";
    for(auto m:M) os<<"("<<m.F<<":"<<m.S<<") ";
    return os<<"}";
}
#define TRACE
#ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " : " << arg1<<" | ";
        __f(comma+1, args...);
    }
#else
    #define trace(...)
#endif


// #define int long long
#define modd 1e0



inline ll fast_expo(ll base,ll power,ll modulo=modd){
    base%=modulo;
    if (base<0LL) base+=modulo;
    ll x=base,cnt=power,ans=1LL;
    while(cnt){
        if (cnt&1LL) ans=(ans*x)%modulo;
        x=(x*x)%modulo;
        cnt>>=1LL;
    }
    // int tmp=ans;
    return ans;
}
inline ll inv(ll base,ll modulo=modd){
    return fast_expo(base,modulo-2LL,modulo);
}



signed main()
{
    #ifdef _SUBLIME
    ifstream cin("input.txt");
    ofstream cout("output.txt");
    #endif
    fio;
    string s,t;
    cin>>s>>t;
    int cc=0;
    for(int i=0;i<sz(s);i++)
    {
        if(s[i]!=t[i])
            cc++;
    }
    d1(cc);
    return 0;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
int main(){
long long int n,ans=0;
  cin >> n;
  long long int a[3*n];
  for (int i=0;i<3*n;i++)cin >> a[i];
  sort(a,a+3*n);
  reverse (a,a+3*n);
  for (int i=0;i<n;i++)ans+=a[1+2*i];
  cout << ans <<endl;
}


Measured memory_bytes: 2560
s = input()
l = len(s)

if s[:(l-1)//2:] == s[(l-1)//2-1::-1] and s[(l-1)//2+1::] == s[:(l-1)//2:-1] and s[:(l-1)//2:] == s[(l-1)//2+1::]:
    print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char *c) {return to_string((string) c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

template<class T>
bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;}
template<class T>
bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> a(3);
    for(int i = 0; i < 3; i++) cin >> a[i];
    vector<ll> b(3);
    for(int i = 0; i < 3; i++) cin >> b[i];
    vector<ll> dp(n + 1);
    rep(i,0,3){
        rep(j,0,n+1){
            chmax(dp[j], j);
            if(j >= a[i])chmax(dp[j], dp[j - a[i]] + b[i]);
        }
    }
    debug(dp);
    ll m = dp.back();
    vector<ll> dp2(m + 1);
    rep(i,0,3){
        rep(j,0,m+1){
            chmax(dp2[j], j);
            if(j >= b[i])chmax(dp2[j], dp2[j - b[i]] + a[i]);
        }
    }

    cout << dp2.back() << "\n";
}

Measured memory_bytes: 198440
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main() {
    cin>>S;
    rep(i,3) cout<<(S[i] == '1' ? '9' : '1');
    cout<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

char str[5];

void solve()
{
    scanf("%s", str);
    if (str[0] != str[1] || str[1] != str[2] || str[2] != str[0]) {
        printf("Yes\n");
    }
    else {
        printf("No\n");
    }

    return;
}

int main(int argc, char* argv[])
{
    solve();

	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ignore ignore
#define pb emplace_back
#define mt make_tuple
#define gcd __gcd
#define bitcount(x)  __builtin_popcount(x)
#define bitcountll(x)  __builtin_popcountll(x)
// Input
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define llin(a) cin >> a
#define inl(a) scanf("%lld",&a)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
// Output
#define pr(a) printf("%d ",a)
#define pr2(a,b) printf("%d %d\n",a,b)
#define pr3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out(a) printf("%d\n",a)
#define outl(a) printf("%lld\n",a)
#define llpr(a) cout << a << " "
#define llout(a) cout << a << "\n"
#define YES printf("YES\n")
#define NO printf("NO\n")
#define yes printf("Yes\n")
#define no printf("No\n")
#define lin printf("\n")
// Iterator
#define rep(i,n) for(i=0;i<n;++i)
#define rrep(i,n) for(i=n-1;i>=0;--i)
#define lp(i,a,b) for(i=a;i<b;++i)
#define rlp(i,a,b) for(i=a;i>=b;--i)
#define all(vec) vec.begin(),vec.end()
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
// function
#define sz(x) x.size()
#define inrange(i,a,b) (i>=a && i<=b)
#define FLUSH fflush(stdout)
#define precision(x) cout << setprecision(x) << fixed
#define remax(a,b) a=max(a,b)
#define remin(a,b) a=min(a,b)
// Debug
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define what(x) cerr << #x << " : " << x << "\n"
#define ck printf("continue\n")
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
	cerr << *it << " = " << a << "\n";
	err(++it, args...);
}
// Data Type
#define ll long long int
#define ii pair<int,int>
#define pli pair<ll,int>
#define triple tuple<int,int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
// Constant
const double PI = acos(-1);
const double eps = (1e-9);
const ll INF = 2e9;
const int M = (1e9)+7;
const int N = (1e6)+3;  // check the limit, man
int cnt[N];
int main()
{
    int n,k,q,i,a;
    in3(n,k,q);
    rep(i,q)
    {
        in(a);
        a--;
        cnt[a]++;
    }
    rep(i,n)
        cnt[i]=cnt[i]-q+k;
    rep(i,n)
    {
        if(cnt[i]>0)
            yes;
        else
            no;
    }
}





Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,d,cnt=0;
  cin>>n>>m>>d;
  for(int i=n;i<=m;i++)
  {
    if(i%d==0)
    {
      cnt++;
    }
  }
  cout<<cnt<<endl;
  return 0;
}

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


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

int main(){
	long long int n, a, b;
	scanf(" %lld %lld %lld", &n, &a, &b);
	if(n==1){
        if(a != b){
            printf("0");
        }
        else{
            printf("1");
        }
        return 0;
    }
    if(a>b){
        printf("0");
        return 0;
    }
	else{
		printf("%lld", (n-2) * (b-a) + 1);
	}
	return 0;
}


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

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

        public void Solve(ConsoleInput cin)
        {
            var A = cin.ReadInt;
            var B = cin.ReadInt;
            var C = cin.ReadInt;

            var ret = A * B / 2;
            Console.Write(ret);
        }
    }

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

Measured memory_bytes: 13268
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=(input.trim()).split("\n");
var x=arr[0]-0;
for(var i=1;i<arr.length;i=i+2){
if(arr[i]=="=")break;
if(arr[i]=="+")x+=(arr[i+1]-0);
if(arr[i]=="-")x-=(arr[i+1]-0);
if(arr[i]=="*")x*=(arr[i+1]-0);
if(arr[i]=="/")x/=(arr[i+1]-0);
x=parseInt(x);
}
console.log(x);

Measured memory_bytes: 7644
#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<cmath>
#include<stack>
#include<algorithm>
#define rg register
#define ll long long
#define LDB long double
#define ull unsigned long long
#define view(i,x) for(rg int i=hd[x];i!=-1;i=e[i].nt)
#define go(i,x,a) for(rg int i=a;i<x;i++)
#define inf 0x3f3f3f3f
#define INF 0x7fffffff
using namespace std;

const int maxn=2e5+5;
int n,m,a[maxn],hd[maxn],k,in[maxn],rt;
int fl=0,tl;
ll up[maxn],q[maxn];
struct edd{
	int nt,v;
}e[maxn*2];

inline int rd(){
	int ret=0,af=1; char gc=getchar();
	while(gc < '0' || gc > '9'){ if(gc=='-') af=-af; gc=getchar(); }
	while(gc >= '0' && gc <= '9') ret=ret*10+gc-'0',gc=getchar();
	return ret*af;
}

inline void add(int a,int b){
	e[k].v=b; e[k].nt=hd[a]; hd[a]=k++;
	e[k].v=a; e[k].nt=hd[b]; hd[b]=k++;
}

void dfs(int x,int fa){
	int sz=0;
	for(rg int i=hd[x];i!=-1;i=e[i].nt){
		int v=e[i].v; if(v == fa) continue;
		sz++;
		dfs(v,x);
		if(fl) return ;
	}
	if(sz == 0) up[x]=a[x];
	else{
		tl=0; ll ss=0,d,f,sf=0;
		for(rg int i=hd[x];i!=-1;i=e[i].nt){
			int v=e[i].v; if(v == fa) continue;
			q[++tl]=up[v]; ss=ss+up[v];
		}
		if(a[x]>ss){
			fl=1;return;
		}
		f=1ll*2*a[x]-ss; d=ss-f;
		if(f < 0 || d%2 != 0){ fl=1; return ; }
		go(i,tl+1,1)
			sf=sf+(q[i] > d/2 ? q[i]-d/2 : 0);
		if(sf > f){ fl=1; return ; }
		up[x]=f;
	}
}

int main(){
	#ifndef ONLINE_JUDGE
	//freopen("data.in","r",stdin);
	//freopen("1.out","w",stdout);
	#endif
	memset(hd,-1,sizeof(hd)); k=0;
	n=rd(); int x,y;
	go(i,n+1,1) a[i]=rd();
	go(i,n,1){ x=rd(); y=rd(); add(x,y); in[x]++; in[y]++; }
	if(n == 2){
		if(a[1] != a[2]) puts("NO");
		else puts("YES");
		return 0;
	}
	go(i,n+1,1)
		if(in[i] != 1){ rt=i; break; }
	dfs(rt,0);
	if(up[rt] != 0) fl=1;
	if(fl) puts("NO");
	else puts("YES");
	return 0;
}//Faze


Measured memory_bytes: 12032
#include <stdio.h>

int main(void){
  int num, tmp, max;
  int i, j, k;
  int e[3];

  scanf("%d", &num);

  for(i=0;i<num;i++){
    scanf("%d %d %d", &e[0], &e[1], &e[2]);
    for(j=0;j<2;j++){
      for(k=2;j<k;k--){
        if(e[j] <= e[k]){
          tmp = e[j];
          e[j] = e[k];
          e[k] = tmp;
        }
      }
    }
    if(e[0] * e[0] == e[1] * e[1] + e[2] * e[2]){
      printf("YES\n");
    }else{
      printf("NO\n");
    } 
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include <string> 
#include <vector>  
#include<math.h>
#include <algorithm>
#include<iomanip>
#define INF 1000000000
#define LM 55555
#define LL long long
using namespace::std;


long long a, b, c,now, N, K, M, ans, A[100000], AA[100000];
string S, s[100];
bool h, k[100];
char cc;

int main() {
	cin >> N;
	h = false;
	for (int i = 0; i < N; i++) {
		cin >> s[i];
		if (i > 0) {
			if (cc != s[i][0]) {
				h = true;
			}
		}
		cc = s[i][s[i].size() - 1];
	}
	if (h) {
		cout << "No" << endl;
		return 0;
	}
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {

			if (s[i] == s[j]) {
				cout << "No" << endl;
				return 0;
			}



		}
	}

		cout << "Yes"<< endl;

	return 0;

}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main{
	static final double EPS = 0.00000000001;
	static final int COUNTER_CLOCKWISE = 1;
	static final int CLOCKWISE = -1;
	static final int ONLINE_BACK = 2;
	static final int ONLINE_FRONT = -2;
	static final int ON_SEGMENT = 0;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int q = scan.nextInt();
		for(int i = 0; i < q; i++) {
			int[]p0 = new int[2];
			int[]p1 = new int[2];
			int[]p2 = new int[2];
			int[]p3 = new int[2];
			p0[0] = scan.nextInt();
			p0[1] = scan.nextInt();
			p1[0] = scan.nextInt();
			p1[1] = scan.nextInt();
			p2[0] = scan.nextInt();
			p2[1] = scan.nextInt();
			p3[0] = scan.nextInt();
			p3[1] = scan.nextInt();
			if(intersect(p0, p1, p2, p3)) {
				System.out.println(1);
			}else {
				System.out.println(0);
			}
		}
		scan.close();

	}
	static boolean intersect(int[]p1, int[]p2, int[]p3, int[]p4) {
		if(ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 && ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0) {
			return true;
		}else {
			return false;
		}
	}
	static int ccw(int[]p0, int[]p1, int[]p2) {
		int[]a = {p1[0] - p0[0], p1[1] - p0[1]};
		int[]b = {p2[0] - p0[0], p2[1] - p0[1]};
		if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
		if(cross(a, b) < -EPS) return CLOCKWISE;
		if(dot(a, b) < -EPS) return ONLINE_BACK;
		if(norm(a) < norm(b)) return ONLINE_FRONT;
		return ON_SEGMENT;
	}
	static int norm(int[]p) {
		return p[0] * p[0] + p[1] * p[1];
	}
	static int[] vec(int[]p1, int[]p2) {
		int[]u = {p2[0] - p1[0], p2[1] - p1[1]};
		return u;
	}
	static int dot(int[]u, int[]v) {
		return u[0] * v[0] + u[1] * v[1];
	}
	static int cross(int[]u, int[]v) {
		return u[0] * v[1] - u[1] * v[0];
	}
}


Measured memory_bytes: 39872
#include<bits/stdc++.h>
        #define ll long long
        #define rep(i,a,b) for(i=a;i<b;i++)
        #define pb push_back
        #define all(v) v.begin(),v.end()
        #define F first
        #define S second
        #define vi vector < ll  int >
        #define CLR(a) memset((a),0,sizeof(a))
        #define mp make_pair
        #define hell 1000000007`
using namespace std;

void solve() {
    ll n,m,i,j,k,f1=1,f2=2,y=0,k1=0,k2=0,k3=0,x;
    cin>>n>>m;
    cout<<max(n+m,max(n*m,n-m));
}



    signed main()
        {
            ios::sync_with_stdio(false);
            cin.tie(0);
            cout.tie(0);
            int t=1;
            //cin>>t;
            while(t--)
            solve();
        }


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int n,card[201]={0},x,t,ba,i,cnt,c;
	while(1){
	cin>>n;
		if(n==0)
		break;
		for(i=0;i<201;i++){
			card[i]=0;
		}
	for(i=0;i<n;i++){
		cin>>c;
		card[c]=1;
	}
	ba=0;
	t=0;
	x=0;
	cnt=0;
	while(1){
		if(ba==0){
			for(i=1;i<=2*n;i++){
				if(card[i]==(t+1)%2){
					ba=i;
					card[i]=2;
					break;
				}
			}
		}
		else{
			x=0;
			for(i=1;i<=2*n;i++){
				if(card[i]==(t+1)%2&&ba<i){
					ba=i;
					x=1;
					card[i]=2;
					break;
				}
			}
			if(x==0){
				ba=0;
			}
		}
		x=0;
		for(i=1;i<=2*n;i++){
			if(card[i]==1){
				x=2;
			}
		}
		if(x==0){
			break;
		}
		x=1;
		for(i=1;i<=2*n;i++){
			if(card[i]==0){
				x=2;
			}
		}
		if(x==1){
			break;
		}
		t++;
	}
	if(x==0){
		for(i=1;i<2*n;i++){
			if(card[i]==x){
				cnt++;
			}
		}
		cout<<cnt<<endl<<0<<endl;
	}
	else{
		for(i=1;i<2*n;i++){
			if(card[i]==x){
				cnt++;
			}
		}
		cout<<0<<endl<<cnt<<endl;
	}
	}
	return 0;
}

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

int main() {
        int x;
        cin>>x;
        if(x==0 || x==1)
        {
                if(x == 0)
                cout<<"1"<<endl;
                else if(x >= 1)
                cout<<"0"<<endl;
        }
	
	return 0;
}


Measured memory_bytes: 3612
H, W = map(int, input().split())
grid = []
for i in range(H):
    a = input()
    assert len(a) == W
    grid.append(a)

whiterow = [all(c == '.' for c in row) for row in grid]
whitecol = [all(row[i] == '.' for row in grid) for i in range(W)]

for r, row in enumerate(grid):
    if whiterow[r]: continue
    comp = [c for i, c in enumerate(row) if not whitecol[i]]
    print(''.join(comp))


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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

// テーブルを作る前処理
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }
    
    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }

};

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

    set<int> se;
    REP(i,N){
        int a;
        cin >> a;
        se.insert(a);
    }

    if(se.size()%2==0){
        pl(se.size()-1)
    } else {
        pl(se.size())
    }
    

    return 0;
}


Measured memory_bytes: 4992
#include<stdio.h>

int main(){

int a,b,c,i,j,k,n,m;
scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d %d %d",&a,&b,&c);


if(a>b){
m=a;
a=b;
b=m;
}
if(b>c){
m=b;
b=c;
c=m;
}
if(a>b){
m=a;
a=b;
b=m;
}

if((a*a)+(b*b)==c*c){
printf("YES\n");
}
else{
printf("NO\n");
}

}

return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;

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

    int n;
    cin >> n;
    int m = 0;
    int sum = 0;
    rep(i, n){
        int p;
        cin >> p;
        m = max(m, p);
        sum += p;
    }

    cout << sum - (m/2) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
      int sum=0;
       sum+=b;
       if(c>=b)
       {
            sum+=b;
             c-=b;
             if(c>a)
                 sum+=a+1;
             else
                sum+=c;
          printf("%d\n",sum);
       }
       else
        {
            sum+=c;
            c-=c;
            printf("%d\n",sum);
        }
}


Measured memory_bytes: 256
#ifdef __GNUC__
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#endif

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>

#include <string>
#include <cstring>
#include <vector>
#include <valarray>
//#include <array>//x C++ (G++ 4.6.4)

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <cassert>//assert();
#include <fstream>
#include <random>
/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)

/////////
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#define PII pair<int,int>
/////////
using namespace::std;

// 最大公約数
template<class T>
inline T gcd(T a, T b){return b ? gcd(b, a % b) : a;}
//inline T gcd(T a, T b){return b == 0 ? a : gcd(b, a % b);}
/*inline T gcd(T a,T b){
	while(b != 0 ){
		a = a % b;
		swap(a,b);
	}
	return a;
}*/

// 最小公倍数
template<class T>
inline T lcm(T a, T b){return a / gcd(a, b) * b;}
//inline T lcm(T a, T b){return a * b / gcd(a, b);}
////////////////////////////////


inline void solve(){
	LL S,C;
	cin >> S >> C;
	LL ans = 0;
	LL CC = C/2;
	LL SCC = min(S,CC);
	S -= SCC;
	C -= SCC*2;
	ans += SCC;
	if( S == 0 ){
		ans += C/4;
	}
	cout << ans << endl;
}

signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	//std::cout << std::fixed;//小数を10進数表示
	//cout << setprecision(16);//小数点以下の桁数を指定
	
	solve();
}


Measured memory_bytes: 256
n,k = map(int,input().split())
mod = 10**9+7

fact = [1,1]
finv = [1,1]
inv = [0,1]
 
for i in range(2,2010):
    fact.append((fact[-1]*i)%mod)
    inv.append((inv[mod%i]*(mod-mod//i))%mod)
    finv.append((finv[-1]*inv[-1])%mod)
 
def nCr(n,r,mod):
    if n < r : 
        return 0
    else:
        return fact[n]*finv[r]*finv[n-r]%mod

for i in range(1,k+1):
    print((nCr(n-k+1,i,mod)*nCr(k-1,i-1,mod))%mod)

Measured memory_bytes: 3572
n=int(input())
l=list(map(int,input().split()))
k=[]
a=min(l)
b=max(l)
for i in range(a,b+1):
  c=0
  for j in range(n):
    c=c+(l[j]-i)**2
  k.append(c)
print(min(k))

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    string s, t; cin >> s >> t;
    for (int i = 0; i < n; i++) {
        bool ok = true;
        for (int j = 0; i + j < n; j++) {
            ok &= s[i+j] == t[j]; 
        }
        if (ok) {
            cout << i + n << "\n";
            return 0;
        }
    }
    cout << 2 * n << "\n";
    return 0;
}

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

#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)


using namespace std;
using ll = long long;

template<class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

void solve() {
    int n;
    cin >> n;
    vector<vector<ll>> in(n, vector<ll>(3));
    for (auto &&t  :in) {
        cin >> t[0] >> t[1] >> t[2];
    }
    vector<vector<ll>> dp(n + 1, vector<ll>(3, 0));
    for (int i = 1; i < n + 1; ++i) {
        for (int j = 0; j < 3; ++j) {
            for (int k = 0; k < 3; ++k) {
                if (j == k)continue;
                chmax(dp[i][k], dp[i - 1][j] + in[i - 1][k]);
            }
        }
    }
    cout << *whole(max_element, dp[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: 11264
// clang-format off
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
#define DEB(variable) cout << #variable << '=' << variable << endl

#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

using llint = long long int;

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr long long int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;
// clang-format on

struct req{
    llint a,b,c,d;
};

llint dfs(llint n,llint m,vector<req> v,vector<llint> now){
    llint result=0;
    if(now.size()==n+1){
        for(auto x:v){
            if(now[x.b]-now[x.a]==x.c){
                result += x.d;
            }
        }
    }else{
        FOR(i,now[now.size()-1],m+1){
            now.push_back(i);
            result = max(result, dfs(n, m, v, now));
            now.resize(now.size() - 1);
        }
    }
    return result;
}
int main(){

    llint n,m,q;
    cin>>n>>m>>q;
    vector<req> v(q);
    REP(i,q){
        cin >> v[i].a >> v[i].b >> v[i].c >> v[i].d;
    }
    vector<llint> start(1,1);
    cout << dfs(n, m, v, start) << endl;
    return 0;
}


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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }

using namespace std;

int main(int argc, char** argv) 
{
#ifdef HOME
	if(IsDebuggerPresent())
	{
		freopen("../in.txt", "rb", stdin);
		freopen("../out.txt", "wb", stdout);
	}
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(10);
	cout << fixed;
	uint64_t N;
	cin >> N;
	string r;
	while (N)
	{
		N--;
		r += (N % 26) + 'a';
		N /= 26;
	}
	reverse(all(r));
	cout << r << endl;
	return 0;
}


Measured memory_bytes: 3664
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	      int value;
	      value = Integer.parseInt(in.readLine());
	      System.out.println(value*value*value);
	      in.close();
		
	}

}

Measured memory_bytes: 24416
#include<bits/stdc++.h>
using namespace std;
int n,k,h[200010];
int main()
{
	cin>>n>>k;
	for(int i=0;i<n;i++)
		cin>>h[i];
	sort(h,h+n);
	long long ans=0;
	for(int i=0;i<n-k;i++)
		ans+=h[i];
	cout<<ans;
	return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    if (A <= 8 && B <= 8) {
      System.out.println("Yay!");
    } else {
      System.out.println(":(");
    }
  }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
using ll = long long;
const ll MOD = 1000000007;//998244353;
int main() {
   ios::sync_with_stdio(false);
   cin.tie(0);
   int n; cin >> n;
   n %= 1000;
   if (n==0)cout << 0 << endl;
   else cout << (1000-n) << endl;
}

Measured memory_bytes: 3636
#include<stdio.h>
int main()

{
    
    int a,b,i,j,max,p=0,q=0;
    scanf("%d",&a);
    int ara[a+10];
    for(i=0;i<a;i++)
    {
        scanf("%d",&ara[i]);
        p=p+ara[i];
    }
    max=ara[0];
    for(j=0;j<a;j++)
    {

        if(ara[j]>max)
        {
            max=ara[j];
        }
    }
    
    
        if(p-max>max)
        {
            printf("Yes\n");
        }
    
    else
        {
            printf("No\n");
        }



}









Measured memory_bytes: 1608
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define forn(i,a,b) for(int i =a;i<b;i++)
#define fi first
#define se second
#define fast ios_base::sync_with_stdio(false);
using namespace std;

//for debugging 
/*
g++ -D_GLIBCXX_ASSERTIONS -DDEBUG -ggdb3 -std=c++14 
*/
int recur_depth = 0;
#ifdef DEBUG
#define dbg(x) {++recur_depth; auto x_=x; --recur_depth; cerr<<string(recur_depth, '\t')<<"\e[91m"<<__func__<<":"<<__LINE__<<"\t"<<#x<<" = "<<x_<<"\e[39m"<<endl;}
#else
#define dbg(x)
#endif
template<typename Ostream, typename Cont>
typename enable_if<is_same<Ostream,ostream>::value, Ostream&>::type operator<<(Ostream& os,  const Cont& v){
	os<<"[";
	for(auto& x:v){os<<x<<", ";}
	return os<<"]";
}
template<typename Ostream, typename ...Ts>
Ostream& operator<<(Ostream& os,  const pair<Ts...>& p){
	return os<<"{"<<p.first<<", "<<p.second<<"}";
}
// debugging ends here

typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;

const int mxn = 5e3+99;
vi adj[mxn];

void solve(){
	ll n,k;
	cin >> n >> k;
	ll p[n];
	for(ll i =0;i<n;i++){
		cin >> p[i];
		p[i]--;
		adj[i].pb(p[i]);
	}
	ll c[n];
	ll ans = LLONG_MIN;

	for(ll i =0;i<n;i++){
		cin >> c[i];
		ans = max(ans,c[i]);
	}

	for(ll i =0;i<n;i++){
		ll cur_max = LLONG_MIN;
		ll cyclen = 1;
		ll cur = 0;
		ll nxt = adj[i][0];
		int ck = k;
		ll onlyk = 0;
		while(nxt!=i){
			if(ck<=0)
				break;
			else{
				// cout << i << " " << nxt << endl;
				cyclen++;
				cur+=c[nxt];
				cur_max = max(cur,cur_max);
				// if(ck>0){
				// 	onlyk=cur;
					ck--;
				// }
			}
			nxt = adj[nxt][0];
		}
		if(ck!=0)
			cur+=c[nxt];
		cur_max = max(cur_max,cur);
		// cout << cur << " " << cur_max << " " << cyclen << endl;
		if(cyclen/k>=1){
			ans = max(ans,cur_max);
		}
		else{
			if(cur>0){
				ll times = k/cyclen-1;
				cur = (k/cyclen-1) * cur;
				// dbg(cur);
				// cout << i << " " << times << endl;
				ll ck= k- (times)*cyclen;
				nxt = i;
				while(ck>0){
					nxt = adj[nxt][0];
					cur+=c[nxt];
					cur_max = max(cur,cur_max);
					ck--;
				}
				ans = max(ans,cur_max);
			}
			else{
				ans = max(ans,cur_max);
			}

		}
	}
	cout << ans << endl;

}

//int

int main(){
	fast;
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif

	// int t;cin >> t;while(t--)
		solve();
}


Measured memory_bytes: 4008
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

int main() {
  ll a,b,k;
  cin >> a >> b >> k;
  if(b-a<=2*k-1){
    FOR(i,a,b+1){
      cout << i << endl;
    }
  }
  else{
    FOR(i,a,a+k){
      cout << i << endl;
    }
    FOR(i,b-k+1,b+1){
      cout << i << endl;
    }
  }
}

Measured memory_bytes: 256