akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n;cin>>n;
  ll k;
  for(ll i=1;;i++){
    if(i*(i-1)>2*n){
      cout<<"No"<<endl;
      return 0;
    }
    if(i*(i-1)==2*n){
      k=i;
      break;
    }
  }
  cout<<"Yes"<<endl;
  cout<<k<<endl;
  vector<ll> v[k];
  ll now=1;
  for(ll i=0;i<k;i++){
    for(ll j=i+1;j<k;j++){
      
      v[i].push_back(now);
      v[j].push_back(now);
      now++;
    }
  }
  for(ll i=0;i<k;i++){
    cout<<k-1<<" ";
    for(ll j=0;j<k-1;j++)cout<<v[i][j]<<" ";
    cout<<endl;
  }
}

Measured memory_bytes: 3200
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 200005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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;
    }
}

ll 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;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k;
    cin >> n >> k;
    COMinit();
    ll ans = 1;
    rep(i,1,min(n,k+1)){
        (ans += COM(n,i)*COM(n-1,i)%MOD)%=MOD;
    }
    PRINT(ans);
}


Measured memory_bytes: 4992
julia -En,s,A=`tr '
' ,`"[];f(b,n)=n<b?n:f(b,n÷b)+n%b;g(b)=b>1&&f(b,n)==s&&push!(A,b);g(n+1);for b=1:isqrt(n);g(b);g((n-s)÷b+1);end;isempty(A)?-1:minimum(A)"

Measured memory_bytes: 153756
//n回hを読みこんで、全ての足し合わせ(sum)を文字列の長さで除した数だけケツの数字を頭に持っていく。

#include<iostream>
#include<string>

int main(){
    int n;
    int h;
    std::string str;

    while(1){
        std::cin>>str;
        if(str=="-"){
            break;
        }
        
        std::cin>>n;
        int i,sum=0;
        for(i=0;i<n;i++){
            std::cin>>h;
            sum+=h;
        }
        sum%=str.size();

    //std::cout<<sum<<std::endl;//sum%str.size()はok

        std::string str_part=str.substr(0,sum);

        std::string pre_ans=str+str_part;

        std::string ans=pre_ans.substr(str_part.size());
        std::cout<<ans<<std::endl;    
    
    }
    return 0;
}



Measured memory_bytes: 3168
#include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<cmath>

using namespace std;

int main(){
  int N,T;
  cin>>N>>T;
  int min=99999;
  int c,t;
  int K[N][2];
  for (int i=0;i<N;i++){
    cin>>c>>t;
    if (t<=T){
      if (c<min){
        min=c;
      }
    }
  }
  if (min==99999){
    cout<<"TLE";
  }
  else{
    cout<<min;
  }

  return 0;
}

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

from datetime import timedelta
import datetime

s_h, s_m, e_h, e_m, k = map(int, input().split())

start = datetime.datetime.combine(datetime.date.today(), datetime.time(s_h, s_m))
end = datetime.datetime.combine(datetime.date.today(), datetime.time(e_h, e_m))

total = end - start

study = timedelta(minutes = k)

print(int((total - study).seconds / 60))

Measured memory_bytes: 9412
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

int n;
int a[101];
int cnt[101];
int main(){
    cin >> n;
    REP(i, n)cin >> a[i];
    int k = 0;
    REP(i, n)k = max(k, a[i]);
    REP(i, n)cnt[a[i]]++;
    if(k % 2 == 0){
        if(cnt[k/2] < 1){
            cout << "Impossible" << endl;
            return 0;
        }
        cnt[k/2]--;
        for(int i = k/2 + 1;i <= k;i++){
            if(cnt[i] < 2){
                cout << "Impossible" << endl;
                return 0;
            }
            cnt[i] -= 2;
        }
        REP(i, n){
            if(!cnt[i])continue;
            if(i < k/2 + 1){
                cout << "Impossible" << endl;
                return 0;
            }
        }
    }else{
        for(int i = (k + 1)/2;i <= k;i++){
            if(cnt[i] < 2){
                cout << "Impossible" << endl;
                return 0;
            }
            cnt[i] -= 2;
        }
        REP(i, n){
            if(!cnt[i])continue;
            if(i < (k + 1)/2 + 1){
                cout << "Impossible" << endl;
                return 0;
            }
        }
    }
    cout << "Possible" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int x=0;
  int X=N;
  while(N != 0){//Nが０じゃない場合
    x += (N%10);//下１桁を取り出す
    N /= 10;//下１桁を削除
  }
  
  if(X % x == 0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int K=sc.nextInt();
		long ans=0L;

		for(int i=1;i<=K;i++) {
			for(int j=1;j<=K;j++) {
				for(int k=1;k<=K;k++) {
					long res= gcd(i,j);
					ans+=gcd(res,k);
				}
			}
		}
		System.out.println(ans);
	}
	public static long gcd(long a, long b) {
		if(a<b) {
			return gcd(b,a);
		}
		if(b==0) {
			return a;
		}
		return gcd(b,a%b);
	}

}

Measured memory_bytes: 27084
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
#include<deque>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
const int mod = 1000000007;
const int INF = 1001001001;

P convert(int x) {
  P res;
  res.second = x % 10;
  while (x > 0) {
    res.first = x % 10;
    x /= 10;
  }
  return res;
}

int main(){
  int n;
  cin >> n;
  map<P, int> freq;
  for (int i = 1; i <= n; ++i) {
    P p = convert(i);
    freq[p]++;
  }
  ll ans = 0;
  for (int i = 1; i <= n; ++i) {
    P p = convert(i);
    P q = P(p.second, p.first);
    ans += freq[q];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int h, w;
	bool tate[100] = {}, yoko[100] = {};
	cin >> h >> w;
	string s[100];
	for (int i = 0; i < h; ++i)
	{
		cin >> s[i];
	}
	for (int i = 0; i < h; ++i)
	{
		int way = 0;
		for (int j = 0; j < w; ++j)
		{
			way += (s[i][j] == '.');
		}
		if (way == w)
		{
			yoko[i] = 1;
		}
	}
	for (int i = 0; i < w; ++i)
	{
		int way = 0;
		for (int j = 0; j < h; ++j)
		{
			way += (s[j][i] == '.');
		}
		if (way == h)
		{
			tate[i] = 1;
		}
	}
	for (int i = 0; i < h; ++i)
	{
		if (!yoko[i])
		{
			for (int j = 0; j < w; ++j)
			{
				if(!tate[j])
				{
					cout << s[i][j];
				}
			}
			cout << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
s = int(input())
a = [s]

def func(n):
  if n % 2 == 0:
    return n // 2
  else:
    return 3 * n + 1

while(a.count('1') != 2):
  a.append(func(a[-1]))
  for i in range(len(a) - 1):
    if a[-1] == a[i]:
      print(len(a))
      exit()


Measured memory_bytes: 3060
import itertools
N = int(input())
s = list(map(lambda x: True if x == "o" else False, list(input())))

f = lambda x,y: not(x^y)

def hantei(N,s):
    for onetwo in itertools.product((True, False), (True, False)):
        res = {}
        for n in range(N):
            if n == 0:
                res[n] = onetwo[0]
            elif n == 1:
                res[n] = onetwo[1]
            else:
                res[n] = f(res[n-2], f(res[n-1], s[n-1]))
        # check s[0]
        if not ((res[1] == res[N-1]) ^ res[0]) == s[0]:
            if not ((res[0] == res[N-2]) ^ res[N-1]) == s[N-1]:
                print(''.join(map(lambda x: "S" if x == True else "W", res.values())))
                return True

    return False

if not hantei(N, s):
    print(-1)

Measured memory_bytes: 19396
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vs = vector<string>;
#define  rep(i,n) for(ll i = 0; i < (n); ++i)
#define  red(i,n) for(ll i = (n)-1; i >= 0; --i)
#define  all(a)   begin(a),end(a)
#define  pb(a)    push_back(a)
#define  yn       cout<<"Yes\n"; else cout<<"No\n";
inline ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; }
const int INF=1000000009;
const ll LINF = 1e18;


int main()
{
    ll x;
    bool a[1007]={0};
    for(ll i=1;i<32;i++){
        ll q=i;
        rep(j,10){
            q*=i;
            if(q>1000)break;
            a[q]=1;
        }
    }
    cin>>x;
    red(i,x+1) if(a[i]==1)cout<<i<<endl,exit(0);

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
int main()
{
    char s[200];
    scanf("%s",s);

    int len=0,i,j,c=0;
    for(i=0;s[i]!=0;i++)
    len++;

    for(i=0,j=len-1;i<j;i++,j--)
    {
        if(s[i]!=s[j])
        c++;
    }
    printf("%d",c);
    return 0;
}


Measured memory_bytes: 256
# ABC100C - *3 or /2
n = int(input())
lst = [i for i in list(map(int, input().rstrip().split())) if i % 2 == 0]
ans = 0
for i in lst:
    cnt = 0
    while i % 2 == 0:
        i //= 2
        cnt += 1
    ans += cnt
print(ans)

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

lst = [input() for i in range(N)]

lst2 = []
lst2.append(lst[0])
ans = "Yes"
for i in range(1, N):
	if (lst[i] in lst2 or lst[i-1][-1] != lst[i][0]):
		ans = "No"
		break
	else:
		lst2.append(lst[i])

print(ans) 

Measured memory_bytes: 3064
import bisect

n = int(input())
ll = list(map(int, input().split()))
ll.sort()

ans = 0
for i in range(n-2):
    e1 = ll[i]
    for j in range(i+1, n-1):
        e2 = ll[j]
        cnt = bisect.bisect_left(ll, e1+e2)
        cnt -= (j+1)
        ans += max(cnt,0)

print(ans)



Measured memory_bytes: 74428
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
#define double long double
#define EPS 1e-9
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < A[i].size(); j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}
template < typename T, typename U >
ostream &operator<<(ostream &os, const pair< T, U > &p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}

typedef pair< int, int > pii;
typedef long long ll;

struct edge {
	int from, to, d, c, i;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1LL << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

template < typename A, size_t N, typename T >
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;
signed main() {
	cin >> N;
	vector< vector< int > > G(N);
	edges es;
	rep(i, N - 1) {
		int u, v;
		cin >> u >> v;
		--u;
		--v;
		G[u].push_back(v);
		G[v].push_back(u);
		es.push_back(edge(u, v));
	}
	int ans = 0;
	rep(i, N) {
		ans += (i + 1) * (N - i);
	}
	for (auto &e : es) {
		int a = e.from, b = e.to;
		if (a > b)
			swap(a, b);
		ans -= (a + 1) * (N - b);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 24176
data=list(map(int,input().split()))
data.sort()

ans="No"
if data[0]==data[1]:
    if data[1]==data[2]:
        ans="No"
    elif data[1]!=data[2]:
        ans='Yes'
elif data[0]!=data[1]:
    if data[1]==data[2]:
        ans="Yes"
print(ans)

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

#define fi first
#define se second
#define SZ(x) (int)x.size()
#define ll long long
#define MP make_pair
#define pb push_back
#define pq priority_queue
#define pii pair<int,int>
#define mod 998244353
#define inf 0x3f3f3f3f
#define debug(x) cerr<<#x<<"="<<x<<'\n'
#define rep(i,a,b) for (int i=a;i<(b);i++)

const int maxn=333;

int n;
ll a[maxn];
ll sum=0,xsum=0;
int f[maxn];
int cnt=0;
vector <int> pos;
ll p0w[60];

int main(){
	std::ios::sync_with_stdio(false);
	cin>>n;
	p0w[0]=1;
	rep(i,1,60) p0w[i]=p0w[i-1]*2ll;
	rep(i,0,n) {
		cin>>a[i];
		if (i<2) sum+=a[i];
		else xsum^=a[i];
	}
	ll tmp=max(sum,xsum);
	while (tmp>0) tmp>>=1,cnt++;
	rep(i,0,cnt) {
		f[i]=((sum>>(i+1))&1)^((xsum>>(i+1))&1);
	}
	ll ans=0;
	if (((sum&1)^(xsum&1))==1) {
		cout<<-1;
		return 0;
	}
	else {
		if (f[0]==1) {
			if ((xsum&1)==1) {
				cout<<-1;
				return 0;
			}
			ans++;
		}
		else if ((xsum&1)==1) pos.pb(0);
	}
	for (int i=cnt-1;i>0;i--) {
		if (f[i]==1&&f[i-1]==1) {
			if ((xsum>>i)&1) pos.pb(i);
			else ans+=p0w[i];
		}
		else if (f[i]==0&&f[i-1]==0) {
			if ((xsum>>i)&1) pos.pb(i);
		}
		else {
			if (((xsum>>i)&1)==1) {
				cout<<-1;
				return 0;
			}
			if (f[i]==1) ans+=p0w[i];
		}
//		debug(ans);
		if (ans>a[0]) {
			cout<<-1;
			return 0;
		}
	} 
	for (int i=0;i<SZ(pos);i++) {
		if (ans+p0w[pos[i]]<=a[0]) ans+=p0w[pos[i]];
	}
	if (ans==0) cout<<-1;
	else cout<<a[0]-ans;
	return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<long> lucas(n + 1);
    lucas.at(0) = 2;
    lucas.at(1) = 1;
    rep(i, n - 1) lucas.at(i + 2) = lucas.at(i) + lucas.at(i + 1);
    cout << lucas.at(n) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<58;
 
int main(){
    ll N,K;
  	cin >> N >> K;
  	vector<ll> A;
  	A.resize(N);
  	for(ll i = 0; i < A.size(); ++i) cin >> A[i];
  	sort(all(A), greater<int>());
  	ll g = A[0];
  	if(A[0] < K){
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  	for(ll i = 1; i < A.size(); ++i){
      g = gcd(g, A[i]);
    }
  	if(K % g == 0) cout << "POSSIBLE" << endl;
  	else cout << "IMPOSSIBLE" << endl;
  
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
    int n, x,y, m, k;
    while(cin>>n>>m){
        if(n==m){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
  return 0;
}




Measured memory_bytes: 256
#include<stdio.h>

#define MAX_N 10000
#define MAX_Q 500

int main(){

    int i, j, key, sum, s_n, t_n, s[MAX_N], t[MAX_Q];

    scanf("%d",&s_n);
    for(i=0; i<s_n;i++){
        scanf("%d", &s[i]);
    }

    scanf("%d",&t_n);
    for(i=0; i<t_n;i++){
        scanf("%d", &t[i]);
    }

    sum = 0;
    for(i=0;i<t_n;i++){
        key = t[i];
        for(j=0;j<s_n;j++){
            if(s[j] == key){
                sum++;
                break;
            }
        }
    }

    printf("%d\n", sum);
   
    return 0;
}

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

#define cn count
#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define len length
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i < (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

int main(){
	IO;
	ll n,ans=0;
	cin>>n;
	ll a[n];
	forn(i,n){
		cin>>a[i];
	}
	for(ll i = 1; i<n-1; i++){
		if(a[i]<a[i-1] && a[i]>a[i+1]) ans++;
		if(a[i]<a[i+1] && a[i]>a[i-1]) ans++;
	}
	cout<<ans<<"\n";
	return 0;
}

// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""


Measured memory_bytes: 3600
def main():
    ans = 10**19
    l, r = map(int, input().split())
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            ans = min(ans, (i * j) % 2019)
            if ans == 0:
                print(0)
                return
    print(ans)              
        
    
if __name__ == '__main__':
    main()

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

using namespace std;

typedef long long ll;
typedef vector<int> pi;
typedef pair<int,int> vi;

#define F first
#define S second
#define PB push_back
#define MK make_pair
#define REP(i, a, b) for (int i=a; i < b; i++)


bool sort_by(vi c, vi d){
	return c.S < d.S;
}

int main() {
	int a, b, c, x, p = 0;
	cin >> a >> b >> c >> x;
	REP(i, 0, a+1){
		REP(j, 0, b+1){
			REP(z, 0, c+1){
				if(i*500 + j*100 + z*50 == x) ++p;
			}
		}
	}
	cout << p;

}


Measured memory_bytes: 256
n = int(input())
a = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]
 
for _ in range(n):
  b, f, r, v = map(int, input().split())
  a[b-1][f-1][r-1] += v
 
for i in range(4):
  for j in range(3):
    print(' '+' '.join(map(str, a[i][j])))
 
  if i != 3:
    print('#'*20)


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

/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

using namespace std;

typedef long long ll;

const int N_MAX = 82;

int n;

ll a[N_MAX];

ll dp[N_MAX];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    dp[0] = 1000;
    for(int i = 1; i <= n; i++)
    {
        dp[i] = 1000;
        ll mx = a[i];
        for(int j = i - 1; j >= 1; j--)
        {
            dp[i] = max(dp[i], dp[j] % a[j] + dp[j] / a[j] * mx);
            mx = max(mx, a[j]);
        }
    }
    cout << dp[n] << "\n";
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int A, B, C;
	cin >> A >> B >> C;

	if (C>=A&&C<=B) {
		cout << "Yes" << "\n";
	}
	else {
		cout << "No" << "\n";
	}
}


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

int main() {
  string s, c[4] = {"Sunny", "Cloudy", "Rainy", "Sunny"};
  cin >> s;
  for(int i = 0; i < 3; i++)
    if(s == c[i])
      cout << c[i + 1] << endl;
}

Measured memory_bytes: 256
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())

b = [0]*n
c = [0]*n
b[0] = a[0]
c[n-1] = a[n-1]
for i in range(1,n):
    b[i]=max(b[i-1],a[i])
    c[n-1-i]=max(c[n-i],a[n-1-i])

for i in range(n):
    if i==0:
        print(c[1])
    elif i==n-1:
        print(b[n-2])
    else:
        print(max(b[i-1],c[i+1]))


Measured memory_bytes: 15676
#include<iostream>
#include <algorithm>
#include<string>
#include <numeric>
#include<math.h>
#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int a,b,c,d;
    cin >>a>>b>>c>>d;
    if(a*b>c*d) cout<<a*b<<endl;
    else cout<<c*d<<endl;
}


Measured memory_bytes: 256
# 1回で+1 か2回でA枚-> Bのどちらか
# B / A > 2 なら、可能な限りAB変換して余りの回数を+1
K, A, B = map(int, input().split())

ans = 1

# まずは A枚ビスケットを作る
if K > A - 1:
  ans += A - 1
  K -= A - 1
else:
  print(ans + K)
  exit()

# B - A > 2なら変換。  
if B - A > 2:
  d, m = divmod(K, 2)
  ans += d * (B - A) + m
else:
  ans += K
print(ans)


Measured memory_bytes: 2940
import sys

H, N = map(int, input().split())
MAGICS = list(list(map(int, input().split())) for _ in range(N))

INF = sys.maxsize
MAX = max(x[0] for x in MAGICS)
DP = [INF] * (H+1)

DP[0] = 0

for h in range(H+1):
    for (damage, mp) in MAGICS:
        DP[h] = min(DP[max(h - damage, 0)] + mp, DP[h])

print(DP[H])

Measured memory_bytes: 42476
require 'prime'

n = gets.to_i

h = Hash.new(0)
1.upto(n) {|i| i.prime_division.each {|k,v| h[k] += v}}

h = h.values.sort_by {|e| -e}
s = h.size
x = [[74, s], [24, s], [14, s], [4, s], [2, s]]
i = 0
h.each_with_index do |e, j|
    while i < 5 && x[i][0] > e
        x[i][1] = j
        i += 1
    end
end

#p x, h
x.map!{|e| e[1]}
ans = x[0]
ans += x[1] * (x[4] - 1)
ans += x[2] * (x[3] - 1)
ans += x[3] * (x[3] - 1) * (x[4] - 2) / 2
p ans

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

factorial=[1]
for i in range(1,s+1):
    factorial.append(factorial[i-1]*i%mod)
inverse=[0]*(s+1)
inverse[-1]=pow(factorial[-1],mod-2,mod)
for i in range(s-1,-1,-1):
    inverse[i]=inverse[i+1]*(i+1)%mod
def comb(n,r):
    if n<r:
        return 0
    return factorial[n]*inverse[r]*inverse[n-r]%mod

c=comb(n*m-2,k-2)
ans=0
for i in range(1,n):
    ans+=i*(n-i)*(m**2)*c
    ans%=mod
for i in range(1,m):
    ans+=i*(m-i)*(n**2)*c
    ans%=mod
print(ans)

Measured memory_bytes: 54256
month_1={}
month_2={}
answer=[]
while 1:
    try:c,d=map(int,input().split(","))
    except:break
    if c in month_1:month_1[c] +=1
    else:month_1[c]=1
while 1:
    try:c,d=map(int,input().split(","))
    except:break
    if c in month_2:month_2[c] +=1
    else:month_2[c]=1
for v,m in month_1.items():
    if v in month_2:
        answer.append([v,month_1[v]+month_2[v]])
answer=sorted(answer)
for i in answer:
    print(i[0],i[1])



Measured memory_bytes: 5600
#include <iostream>
#include <algorithm>

using namespace std;

constexpr int X = 1e9;

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

    int n;
    cin >> n;
    int x[n], y[n];
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
    }

    int m00, m01, m10, m11;
    m00 = m01 = m10 = m11 = 2 * X;
    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans = max({0ll + ans, 0ll + x[i] + y[i] - m00, 0ll + x[i] - y[i] - m01,
                   0ll + -x[i] + y[i] - m10, 0ll + -x[i] - y[i] - m11});
        m00 = min(m00, x[i] + y[i]);
        m01 = min(m01, x[i] - y[i]);
        m10 = min(m10, -x[i] + y[i]);
        m11 = min(m11, -x[i] - y[i]);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 5196
from operator import itemgetter

N = int(input())
XL = [list(map(int,input().split())) for i in range(N)]
a = []
b = []

for i in range(N):
    a_temp = XL[i][0] - XL[i][1]
    b_temp = XL[i][0] + XL[i][1]
    a.append(a_temp)
    b.append(b_temp)

XL = sorted([(a[i], b[i]) for i in range(N)], key=itemgetter(1))

ans = 1
last = XL[0][1]

for i in range(N):
    if last <= XL[i][0] :
        last = XL[i][1]
        ans += 1

print(ans)

Measured memory_bytes: 44612
#include<stdio.h>
#include<math.h>

int main(void)
{
  int N;
  int i;
  int j;
  int k;
  int I[101][4];
  scanf ("%d",&N);
  int P[N+1][4];
  int Pv[N+1];
  for (j=1;j<=3;j++){ 
  for (i=1;i<=100 ; i++){
    I[i][j]=0;
  }
  }
  for (i=1; i<=N;i++){
    scanf("%d%d%d",&P[i][1],&P[i][2],&P[i][3]); 
      Pv[i]=0;
}
  for (j=1;j<=3;j++){ 
  for (i=1;i<=100 ; i++){
    for (k=1;k<=N;k++){
      if (P[k][j]==i){
	I[i][j]++;
      }
    }
  }
  }
  for (j=1;j<=3;j++){ 
  for(i=1;i<=N ; i++){
     if (I[P[i][j]][j]==1){
    
          Pv[i] += P[i][j];
	  	   } 
  }
  }
  for(i=1;i<=N;i++){
    printf("%d\n",Pv[i]);
}
  return 0;
}

Measured memory_bytes: 600
#include <stdio.h>
#include <ctype.h>
 
int main(void){
    char ch;
    int alfa[27] = {};
    int i;
    i=0;
    while(scanf("%c", &ch) != EOF){
        if(isupper(ch)){
            ch = tolower(ch);
        }
        i = ch - 'a';
        alfa[i] += 1;
    }
    for(i=0;i<26;i++){
        printf("%c : %d\n",i+'a',alfa[i]);
    }
    return(0);
}
	

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


using namespace std;

using ll   = long long;
using ii   = pair   < int , int >;
using i3   = pair   < int , ii  >;
using li   = pair   < ll  , int >;
using lii  = pair   < ll  , ii  >;
using pll  = pair   < ll  , ll  >;
using vi   = vector < int       >;
using vl   = vector < ll        >;
using vii  = vector < ii        >;
using vli  = vector < li        >;
using vpll = vector < pll       >;
using vi3  = vector < i3        >;
using vlii = vector < lii       >;


const int N = 2e5 + 5 , L = 100;
const ll INF = 1e17 + 7;
const double eps = 1e-9 , PI = acos(-1);



ll m;
int n;

int to[N][L];


void solve(int testCase){

    scanf("%d %lld" , &n , &m);

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

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

    int u = 1;
    for(ll i = 0 ; i < 61*1ll ; i ++) {
            if(m & (1ll << i)) u = to[u][i];
    }

    printf("%d\n" , u);
}

main(){

    int t = 1;
    // scanf("%d" , &t);

    for(int testCase = 1 ; testCase <= t ; testCase ++){
            solve(testCase);
    }

    return 0;
}


Measured memory_bytes: 81896
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cmath>

using namespace std;

int main() {
    int a, b, c, x, y;
    cin >> a >> b>> c >> x >> y;
    int ans = a*x + b*y;
    for (int i = 0; i <= max(x, y); i++) {
        ans = min(ans, a*max(x-i, 0) + b*max(y-i, 0) + c*i*2);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if ((c - a) * (b - c) > 0) {
	  cout << "Yes" << endl;
	} else {
	  cout << "No" << endl;
	}
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
using namespace std;
int main(){
  string s;
  cin>>s;
  if(s[0]==s[s.length()-1]){
    if(s.length()%2==0)
      cout<<"First"<<endl;
    else cout<<"Second"<<endl;
  }
  else {
    if(s.length()%2==0)
      cout<<"Second"<<endl;
    else cout<<"First"<<endl;
  }
  return 0;
}


Measured memory_bytes: 764
#include <stdio.h>

int main(){
  int a, b, i, res = 0;
  scanf("%d %d", &a, &b);
  for (i=0; i<2; i++) {
    if (a > b) {
      /* code */
      res += a;
      a--;
    } else {
      /* code */
      res += b;
      b--;
    }
  }
  printf("%d\n", res);
  return 0;
}


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

#define f(i, a, b, c) for(int i = a ; i < b ; i += c)
#define fr(i, a, b, c) for(int i = a ; i >= b ; i -= c)
#define fit(it, v) for(auto it = v.begin() ; it != v.end() ; ++it)
#define frit(it, v) for(auto it = v.rbegin() ; it != v.rend() ; ++it)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define eb emplace_back
#define pb push_back
#define lli long long int
#define modn 998244353
#define NL '\n'

using namespace std;

typedef vector< int > vi;
typedef vector< char > vc;
typedef vector< bool > vb;
typedef vector< string > vs;
typedef vector< lli > vli;
typedef vector< vector< char > > vvc;
typedef vector< vector< int > > vvi;
typedef pair< int, int > ii;
typedef vector< ii > vii;
typedef pair< lli, int> pli;
typedef pair< lli, lli> pll;
typedef set< int > si;
typedef set< ii > sii;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	#ifdef LOCAL_TEST
		clock_t z = clock();
    	ifstream h("in");
	    ofstream g("out");
	#else
	    #define h cin
	    #define g cout
	#endif // LOCAL_TEST

	int n, k;
	h >> n >> k;
	vli v(n);
	f(i, 0, n, 1)
		h >> v[i];
	sort(all(v));
	lli sum = 0;
	f(i, 0, n - k, 1)
		sum += v[i];
	g << sum;

	#ifdef LOCAL_TEST
		cerr << "Time taken is: " << fixed << double(clock() - z) / CLOCKS_PER_SEC << NL;
		h.close();
		g.close();
	#endif // LOCAL_TEST
}




Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxx = 1e5+10;
vector<int> v[maxx];
int cnt = 0;
int a[maxx],b[maxx];
void dfs(int x,int y)
{
    if(a[x])
        return ;
    a[x]=y;
    for(int i=0;i<v[x].size();i++)
        dfs(v[x][i],y+1);
}
void dfs2(int x,int y)
{
    if(b[x])
        return ;
    b[x]=y;
    for(int i=0;i<v[x].size();i++)
        dfs2(v[x][i],y+1);
}
int main()
{
    int n,x,y;
    scanf("%d",&n);
    for(int i=1;i<n;i++){
        scanf("%d%d",&x,&y);
        v[x].push_back(y),v[y].push_back(x);
    }
    dfs(1,1);
    dfs2(n,1);
    int cnt1 = 0,cnt2 = 0;
    for(int i=1;i<=n;i++){
        if(a[i] <= b[i])
            cnt1++;
        else
            cnt2++;
    }
    //cout<<cnt1<<" "<<cnt2<<endl;
    if(cnt1 - cnt2 > 0)
        cout<<"Fennec\n";
    else
        cout<<"Snuke\n";
    return 0;
}


Measured memory_bytes: 11136
k = int(input())

term = [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(term[k - 1])


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
#define pb push_back


const int MAX = 5100;
const int MOD = 1000000007;
ll 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;
}

void solve(){
    int N, M;
    cin >> N >> M;
    COMinit();
    cout << (COM(floor(N), 2) +COM(floor(M), 2)) << endl; 
}

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

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

ll Pow(ll a, ll b, ll c){
    ll ans = 1;
    a %= c;
    while (b){
        if (b & 1) ans = (ans * a) % c;
        a = (a * a) % c;
        b >>= 1;
    }
    return (ans % c);
}

bool cmp(const int &a, const int &b){
    return a < b;
}

ll gcd(ll x, ll y){
    return x % y == 0 ? y : gcd(y, x % y);
}

ll lcm(ll x, ll y){
    return x / gcd(x, y) * y;
}

const int MAXN = 2000 + 5;
const int mod = 1e9 + 7;
ll comb[MAXN][MAXN];

void init(){
	for (int i = 0; i < MAXN; i++){
		comb[i][0] = comb[i][i] = 1;
		for (int j = 1; j < i; j++){
			comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1];
			comb[i][j] %= mod;
		}
	}
}

const int MAXM = 1e6;
int primes[MAXM], cnt;
bool st[MAXN];

void get_prime(int n){
	for (int i = 2; i <= n; i++){
		if (!st[i]) primes[cnt++] = i;
		for (int j = 0; j < cnt && i * primes[j] <= n; j++){
			st[i * primes[j]] = true;
			if (i % primes[j] == 0) break;
		}
	}
}

ll mult_mod(ll a, ll b, ll c){
    a %= c;
    b %= c;
    ll res = 0;
    while (b){
        if (b & 1){
            res += a;
            res %= c;
        }
        a <<= 1;
        a %= c;
        b >>= 1;
    }
    return res;
}

int main(){
    int n;
    scanf("%d", &n);
    int a[100005];
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int b[100005];
    memset(b, 0, sizeof(b));
    for (int i = 1; i <= n; i++){
        if (i & 1) b[1] += a[i];
        else b[1] -= a[i];
    }
    b[n] = 2 * a[n] - b[1];
    for (int i = n - 1; i >= 2; i--)
        b[i] = 2 * a[i] - b[i + 1];
    for (int i = 1; i < n; i++) printf("%d ", b[i]);
    printf("%d\n", b[n]);
    return 0;
}


Measured memory_bytes: 2048
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    int n; int k; cin >> n >> k;
    vector<bool> ng(10,0);
    rep(i,k){
        int d; cin >> d;
        ng[d]=1;
    }
    for(int i=n;i<1001001;i++){
        int j=i;
        bool ng2=0;
        string s=to_string(j);
        rep(k,s.size()){
            if(ng[(s[k]-'0')]) ng2=1;
        }
        if(ng2) continue;
        cout << i << endl;
        return 0;
    }
}


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

int main(){
    int n, m, maxi=0;
    cin >> n;
    string s[n];
    map<string, int> map;
    for(int i=0; i<n; i++){
        cin >> s[i];
        if(map.count(s[i])) map[s[i]]++;
        else map[s[i]] = 1;
    } 
    cin >> m;
    string t[m];
    for(int i=0; i<m; i++) {
        cin >> t[i];
        if(map.count(t[i])) map[t[i]]--;
        else map[t[i]] = -1;
    }
    for(int i=0; i<n; i++){
        maxi = max(map[s[i]], maxi);
    }
    cout << maxi << endl;
}

Measured memory_bytes: 256
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (Windows, macOS, Linux)
 * Author: alireza_kaviani
 * Time: 2020-06-13 16:32:07
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

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

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define sep                         ' '
#define endl                        '\n'
#define SZ(x)                       ll(x.size())

ll poww(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * poww(a * a % md, b / 2, md) % md : poww(a * a % md, b / 2, md) % md));
}

const ll MAXN = 1e6 + 10;
const ll LOG = 22;
const ll INF = 8e18;
const ll MOD = 1e9 + 7; // 998244353; // 1e9 + 9;

string s;

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

    cin >> s;
    cout << s.substr(0 , 3) << endl;

    return 0;
}
/*

*/


Measured memory_bytes: 3652
import sys
input = sys.stdin.readline

n, m, Q = [int(x) for x in input().split()]

table = [[0]*(n + 1) for _ in range(n + 1)]

for _ in range(m):
    l, r = [int(x) for x in input().split()]
    table[l][r] += 1
# print(table)

# l固定で累積和
for i in range(1, n + 1):
    for j in range(1, n + 1):
        table[i][j] += table[i][j - 1]

for _ in range(Q):
    p, q = [int(x) for x in input().split()]
    res = 0
    for i in range(p, n + 1):
        res += table[i][q]
    print(res)

Measured memory_bytes: 59484
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstring>
#include<utility>
#include<cmath>
#include<assert.h>

#define int long long
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound

int N, Ma, Mb;
int A[44], B[44], C[44];
int dp[44][440][440];

signed main() {
    cin >> N >> Ma >> Mb;
    rep(i, N) {
        cin >> A[i] >> B[i] >> C[i];
    }
    rep(i, 44)rep(j, 440)rep(k, 440)dp[i][j][k] = INF;
    dp[0][0][0] = 0;
    rep(i, N) {
        rep(j, 440) {
            rep(k, 440) {
                dp[i + 1][j][k] = dp[i][j][k];
                if (j - A[i] >= 0 && k - B[i] >= 0)
                    dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j - A[i]][k - B[i]] + C[i]);
            }
        }
    }
    int k = 1;
    int ans = INF;
    while (k * Ma <= 400 && k * Mb <= 400) {
        ans = min(ans, dp[N][k * Ma][k * Mb]);
        k++;
    }
    if (ans == INF)
        cout << -1 << endl;
    else
        cout << ans << endl;
    return 0;
}


Measured memory_bytes: 66816
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    
    def ch(s):
        n=len(s)
        s1=s[:n//2]
        s2=s[n//2:]
        if s1==s2:
            return True
        else:
            return False
        
    S=input()    
    N=len(S)-1
    ans=0
    for i in range(1,N):
        S2=S[:N-2*i]
        if ch(S2):
            ans=N-2*i
            break
    print(ans)

main()


Measured memory_bytes: 38384
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
s =input()
N = len(s)
re = 1000
for i in range(N-2):
    g = s[i:i+3]
    g = int(g)
    g = abs(g- 753)
    re = min(g, re)

print(re)






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

int main()
{
	long long int n,m;
	scanf("%lld %lld", &n, &m);
	vector<pair<int,int> >ar(m);
	for(int i=0;i<m;i++)
{	scanf("%d %d",&ar[i].first,&ar[i].second);}

	sort(ar.begin(),ar.end());
	int l=ar[0].first;
	int r=ar[0].second;
	int ans=0;
	for(int i=1;i<m;i++)
	{
	   
	    if(ar[i].first>=r)
	    {
	        ans++;l=ar[i].first;
	        r=ar[i].second;
	    }
	    r=min(ar[i].second,r);
	}
	printf("%d\n",ans+1);
return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	int a,b;
	cin>>a>>b;
	cout<<(a*3+b)/2<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
namespace nmy
{
	template<typename T>inline void check_max(T a,T &b){if(a>b)b=a;}
	template<typename T>inline void check_min(T a,T &b){if(a<b)b=a;}
	const int N=101000,M=N*2,K=20;
	int begin[N],next[M],to[M];
	int kjd[N],hdd[N];
	int n,e,ans;
	void add(int x,int y,bool k=1)
	{
		to[++e]=y;
		next[e]=begin[x];
		begin[x]=e;
		if(k)add(y,x,0);
	}
	void initialize()
	{
		scanf("%d",&n);
		for(int i=1,u,v;i<n;i++)
			scanf("%d%d",&u,&v),add(u,v);
	}
	void dfs(int p=1,int h=0)
	{
		int cnt[K+1];
		memset(cnt,0,sizeof(cnt));
		for(int i=begin[p],q;i;i=next[i])
			if((q=to[i])!=h)
			{
				dfs(q,p);
				for(int k=0;k<=K;k++)
					if(kjd[q]&(1<<k))cnt[k]++;

				for(int k=hdd[q];k<=K;k++)
					kjd[p]|=kjd[q]&(1<<k);
			}

		hdd[p]=K;
		for(int k=K;k>=0 && cnt[k]<=1;k--)
			if(!cnt[k])check_min(k,hdd[p]);
		kjd[p]|=1<<hdd[p];

		for(int k=0;k<hdd[p];k++)kjd[p]^=kjd[p]&(1<<k);

//		printf("f[%d] = %d\n",p,hdd[p]);

		check_max(hdd[p],ans);
	}
	void solve()
	{
		initialize();
		ans=0,dfs();
		printf("%d\n",ans);
	}
}
int main()
{
	nmy::solve();
	return 0;
}


Measured memory_bytes: 15488
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    int A, P;
    cin >> A >> P;
    int k = 0;
    int cnt = 0;
    k = A*3;
    k += P;
    while(k/2 > 0) {
        cnt++;
        k-=2;
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#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;
const double pi=acos(-1);





int main() 
{
  ll N; cin>>N;
  vector<string> s(N);
  rep(i,N)
  {
    string hoge; cin>>hoge;
    sort(hoge.begin(),hoge.end());
    s.at(i)=hoge;
  }
  sort(s.begin(),s.end());
  ll ans=0;
  ll count=0;
  rep(i,N)
  {
    if(i==0) {count++; continue;}
    if(s.at(i)==s.at(i-1)) {count++; continue;}
    ans+=count*(count-1)/2;
    count=1;
  }
  ans+=count*(count-1)/2;
  
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 5760