akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <chrono>

using namespace std;

typedef signed long long ll;
typedef vector<int> vec;
const int TP = 26;

ll compute_score(int D, vector<int>& C, vector<vector<int>>& S, vector<int>& sol) {
    vector<int> last(TP, 0);
    ll score = 0;
    for (int i = 0; i < D; i++) {
        int j = sol[i];
        last[j] = i + 1;
        int tmp = 0;
        for (int k = 0; k < TP; k++)
            tmp -= C[k] * (i + 1 - last[k]);
        score += S[i][j] + tmp;
    }
    return score;
}

void compute_greedy_with_pen(int D, vector<int>& C, vector<vector<int>>& S, vector<int>* sol, double gamma) {
    vector<int> last(TP, 0);
    for (int i = 0; i < D; i++) {
        vector<double> scores(TP, 0.0);
        for (int k = 0; k < TP; k++) {
            scores[k] = S[i][k] + gamma * (i + 1 - last[k]) * C[k];
        }
        auto itp = std::max_element(scores.begin(), scores.end());
        int di = itp - scores.begin();
        last[di] = i + 1;
        (*sol)[i] = di;
    }
}

int main() {
    int D; cin >> D;
    vector<int> C(TP, 0);
    for (int i = 0; i < TP; i++) cin >> C[i];
    vector<vector<int>> S(D, vector<int>(TP, 0));
    for (int i = 0; i < D; i++)
        for (int j = 0; j < TP; j++)
            cin >> S[i][j];

    // greedy解
    auto start = std::chrono::system_clock::now();
    vector<int> sol(D, 0);
    vector<int> sol_best(D, 0);
    double gamma = 0.5;
    compute_greedy_with_pen(D, C, S, &sol, 1.0);
    for (int k = 0; k < D; k++) { sol_best[k] = sol[k]; }
    ll score_best = compute_score(D, C, S, sol);
    while (true) {
        compute_greedy_with_pen(D, C, S, &sol, gamma);
        ll score = compute_score(D, C, S, sol);
        if (score > score_best) {
            for (int k = 0; k < D; k++) { sol_best[k] = sol[k]; }
            score_best = score;
        }
        auto end = std::chrono::system_clock::now();
        double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count();
        if (elapsed >= 1900)
            break;
        gamma += 0.5;
    }
    for (auto v : sol_best) { cout << (v  + 1) << endl; }
}

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

int main(){
    while(true){
        string card;
        cin >> card;
        if(card == "-") break;
        int m,h;
        cin >> m;
        for(int i=0;i<m;++i){
            cin >> h;
            card = card.substr(h) + card.substr(0,h);
        }
        cout << card << endl;
    }
    return 0;
}



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

// Union-Find Tree
struct UnionFind {
  vector<int> par; // 親のid(親の場合, 集合の頂点数の-1倍)
  
  UnionFind(int n): par(n, -1) {}
  
  void init(int n) {
    par.assign(n, -1);
  }
  
  // 根の検索
  int find(int x) {
    if (par[x] < 0) return x;
    return par[x] = find(par[x]);
  }
  
  // xとyの属する集合を併合
  bool unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return false;
    if (par[x] > par[y]) swap(x, y);
    par[x] += par[y];
    par[y] = x;
    return true;
  }
  
  // xとyが同じ集合に属するか
  bool same(int x, int y) {
    return find(x) == find(y);
  }
  
  // 集合の頂点数
  int size(int x) {
    return -par[find(x)];
  }
};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, m;
  cin >> n >> m;
  
  UnionFind uf(n);
  
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    uf.unite(a, b);
  }
  
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (!uf.same(0, i)) {
      ans++;
      uf.unite(0, i);
    }
  }
  
  cout << ans << '\n';
}

Measured memory_bytes: 3728
#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rel register ll
#define rec register char
#define gc getchar
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) pc('-'),x=-x;
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
int d[999]={1};
int main(){
int i,j,n=read();
for (i=0;i<=n;i+=4){
  for (d[j=i]=1;j<=n;j+=7) d[j]=1;
  }
puts(d[n]?"Yes":"No");
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
ll ans;
int main(){
	ll N,K; scanf("%lld %lld",&N,&K);
	// ans=N*N;
	for(ll b=1;b<=N;b++){
		ll remain=min(K,b);
		if(!remain) continue;
		ans--;
		ans+=min(N%b+1,remain)*(N/b+1);
		// printf("%lld ",ans);
		remain-=N%b+1;
		if(remain<0) remain=0;
		// printf("%lld ",remain);
		ll t=remain/b;
		ans+=(N/b*t - t*(t+1)/2+t)*b;
		remain%=b;
		ans+=(N/b - t)*remain;
		// printf("%lld\n",ans);
	}
	printf("%lld",N*N-ans);

}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define RNG(i,from,to) for(int i=(from); i<(int)(to); i++)
#define gcd(i,j) __gcd((i), (j))
typedef long long ll;
typedef pair<int, int> pii;
template<typename S, typename T> string to_string(pair<S, T> p) { return "("+to_string(p.first)+","+to_string(p.second)+")"; }
template<typename T> string to_string(T p[2]) { return "["+to_string(p[0])+","+to_string(p[1])+"]"; }
template<typename T> void println(T e){ cout << to_string(e) << endl; }
template<typename T> void println(const vector<T>& v){ cout << "[";for(const auto& e : v){ cout << to_string(e) << ","; }cout << "]";cout << endl; }
template<typename T> void println(const vector<vector<T>>& vv){ for(const auto& v : vv){ println(v); } }
template<typename Iter> void println(Iter first, Iter last){ for(auto it=first; it != last; it++){ cout << *it << " "; }; cout << endl; }
const ll DVSR = 1e9+7;


int main(int argc, char const *argv[])
{
  ll R; cin >> R;
  if (R < 1200) {
    cout << "ABC" << endl;
  } else if (R < 2800) {
    cout << "ARC" << endl;
  } else {
    cout << "AGC" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
def rotation(st):
    return st[-1]+st[0:-1]
s = input()
t = input()
flg = 0
tmp_s = s
for _ in range(len(s)):
    tmp_s = rotation(tmp_s)
    if tmp_s ==t:
        print("Yes")
        flg = 1
        break
if flg==0:
    print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int n;
    cin>>n;
    int ans = -1;
    int l=1,r=n-1;
    cout << 0 << endl;
    string s;
    cin>>s;
    string fi = s;
    if(s == "Vacant") return 0;
    
    cout << n-1 << endl;
    cin>>s;
    string la = s;
    if(s=="Vacant")return 0;

    while(true){
        int mid = (l+r)/2;
        cout << mid << endl;
        cin >> s;
        if(s == "Vacant")return 0;
        if(mid%2 == 0){
            if(s == fi) l = mid;
            else r = mid;
        }
        else{
            if(s == la) l = mid;
            else r = mid;
        }
    }

}

Measured memory_bytes: 852
/* by Natsu Kinmoe */
#include <bits/stdc++.h>
using namespace std;
#define SZ(x)               ((int)(x).size())
#define all(x)              (x).begin(), (x).end()
#define loop(i, n)          for(int i = 0; i < (n); i++)
#define cont(i, n)          for(int i = 1; i <= (n); i++)
#define circ(i, a, b)       for(int i = (a); i <= (b); i++)
#define range(i, a, b, c)   for(int i = (a); ((c) > 0 ? i <= (b) : i >= (b)); i += (c))
#define foreach(it, v)      for(__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define y0          y0O0OO00OO0OO0OO0OOO00OO0OO0O0O000OO0
#define y1          y1II11II11III11I1III11II111IIII1II1I1
#define pub         push_back
#define pob         pop_back
#define mak         make_pair
typedef long long   ll;
typedef long double lf;
const int   Inf = 0x3f3f3f3f;
const ll    INF = 0x3f3f3f3f3f3f3f3fll;
/* Source code starts here */

string s;

int main() {
	cin >> s;
	if(s[SZ(s) - 1] == 's') cout << s + "es" << endl;
	else cout << s + "s" << endl;
	return 0;
}


Measured memory_bytes: 3600
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
 
#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e4 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	read(n);
	int sum = 0;
	FOR (i, 1, n)
    	FOR (j, 1, n)
    	    FOR (k, 1, n)
    	        sum += __gcd(i, __gcd(j, k));
    	        
	cout << sum;
        
}














Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int x, y;
    cin >> x >> y;
    if (x * 2 == y || x * 4 == y) {
        cout << "Yes" << endl;
        return 0;
    }
    int n = x;
    while (n) {
        int a = n - 1;
        if (y - (a * 2) == (x - a) * 4) {
            cout << "Yes" << endl;
            return 0;
        }
        n--;
    }
    cout << "No" << endl;
  
}

Measured memory_bytes: 3624
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<bitset>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=(ll)1e+18+1;
int INF=1e+9+1;
ll A,B,N;
ll f(ll x){
	return A*x/B-x/B*A;
}
int main(){

	scan(A>>B>>N);
	if(N<=100000000){
		ll ans=0;
		rep(x,N+1){
			ans=max(ans,f(x));
		}
		prin(ans);
		return 0;
	}
	ll xmin=-1,xmax=N+1;
	ll ans=max({f(0),f(N),f(1),f(N-1)});
	while(xmax-xmin>2){
		ll c1=(xmin*2+xmax)/3,c2=(xmin+xmax*2)/3;
		ll f1=f(c1),f2=f(c2);
		ans=max(ans,max(f1,f2));
		if(f1>=f2) xmax=c2;
		else xmin=c1;
	}
	/*rep(i,N+1){
		printf("i:%d f:%lld\n",i,f(i));
	}*/
	ans=max(ans,f((xmax+xmin)/2));
	prin(ans);
	return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>

using namespace std;

int main() {

    long N, M;
    cin >> N >> M;
    long A;
    long sum = 0;
    for (int i = 0; i < M; ++i) {
        cin >> A;
        sum += A;
    }

    if (sum <= N) {
        cout << N - sum << endl;
    } else {
        cout << -1 << endl;
    }

    return 0;

}

Measured memory_bytes: 3636
/*
    -ensure correct output format
    -ensure printing required output
    -reread the problem statement
  */

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pll;
typedef pair<ll,pair<ll,ll>>plll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
#define vll(v) v.begin(),v.end()
#define all(x) x.rbegin(),x.rend()
#define min3(a, b, c)   min(a, min(b, c))
#define max3(a, b, c)   max(a, max(b, c))
#define F first
#define S second
#define in  freopen("input.txt", "r", stdin)
#define out  freopen("output.txt", "w", stdout)
#define minheap int,vector<int>,greater<int>
#define pb push_back
#define eb emplace_back
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define bug cout<<"BUG"<<endl;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const double PI  =3.141592653589793238463;
bool compare(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
    return (a.first > b.first);
}
ll lcm(ll a,ll b)
{
    if(a==0 || b==0)return 0;

    return a/__gcd(a,b)*b;
}

void input(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)cin>>ara[i];
}
void print(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)
        cout<<ara[i]<<" ";
    cout<<endl;
}
ll tree[Max];

ll query(ll idx)
{
    ll sum=0;

    while(idx>0)
    {
        sum+=tree[idx];

        idx-= idx & (-idx);

    }

    return sum;
}

void update(ll idx,ll x,ll n)
{
    while(idx<=n)
    {
        tree[idx]+=x;

        idx+= idx & (-idx);
    }
}

 ll dp[12][12];


int main()
{

    fastread();

    ll i,j,n,m,p,sum=0,k,a,b,t,c,d,cnt=0,q,l,r,ans=0;

    bool flag=false;


   cin>>n;

   for(i=1; i<=n; i++)
   {
       string st=to_string(i);

       dp[st[0]-'0'][st[st.size()-1]-'0']++;
   }

   for(i=0; i<=9; i++)
   {
       for(j=0; j<=9; j++)
       {
           //cout<<i<<" "<<j<<endl;

           ans+=(dp[i][j]*dp[j][i]);
       }
   }

   cout<<ans<<endl;




}



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

using namespace std;

int main() {
	int m, k;
	scanf("%d%d", &m, &k);
	
	vector <int> a;
	
	if (m == 1) {
		if (k == 0) printf("0 0 1 1\n");
		else printf("-1\n");
	}
	else if (k >= (1 << m)) printf("-1\n");
	else {
		for (int i = 0; i < (1 << m); i++) {
			if (i == k) continue;
			a.push_back(i);
		}
		a.push_back(k);
		for (int i = (1 << m) - 1; i >= 0; i--) {
			if (i == k) continue;
			a.push_back(i);
		}
		a.push_back(k);
		
		for (int i = 0; i < a.size(); i++) {
			if (i == 0) printf("%d", a[i]);
			else printf(" %d", a[i]);
		}
		printf("\n");
	}
}


Measured memory_bytes: 2932
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
lis=LI()
q=I()
cou=Counter(lis)
ans=sum(lis)
for i in range(q):
    b,c=MI()
    x=cou[b]
    #y=cou[c]
    ans+=(c-b)*x
    print(ans)
    cou[c]+=cou[b]
    cou[b]=0
    
    


Measured memory_bytes: 24028
S = input()
Sr = S[::-1] # 一の位から考える

T = 0 # 部分文字列
mod = [0] * 2019 # mod数え上げ配列
mod[0] += 1 # 「部分文字列T = S」の場合の、 「0 % 2019 = 0」を予めカウント
d = 1 # 桁数
for i, s in enumerate(Sr):
  T += int(s) * d
  T %= 2019
  d = (d * 10) % 2019
  
  mod[T] += 1
  
# ペアを合計
# n個から2通り選ぶ（nC2）
mod = [n * (n-1) // 2 for n in mod]
print(sum(mod))

Measured memory_bytes: 9256
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> istream& operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream& operator<<(ostream &os, vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream& operator<<(ostream &os, set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream& operator<<(ostream &os, pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream& operator<<(ostream &os, map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

int N;
vector<double> A, B, C;

// 1-indexed BIT (i : [1, len])
template<typename T, int len>
struct BIT
{
    array<T, len + 1> val;
    void reset() { val.fill(0); }
    BIT() { val.fill(0); }
    void add(int pos, T v)
    {
        while (pos > 0 && pos <= len)
        {
            val[pos] += v;
            pos += pos & -pos;
        }
    }
    T sum(int pos)
    {
        T res = 0;
        while (pos > 0)
        {
            res += val[pos];
            pos -= pos & -pos;
        }
        return res;
    }
};

BIT<int, 40001> bit;

int cnt(const vector<int> &vec)
{
    bit.reset();
    int ans = 0;
    for (auto v : vec)
    {
        ans += bit.sum(v);
        bit.add(v, 1);
    }
    return ans;
}

double solve(const vector<double> &A, const vector<double> &B, const vector<double> &C)
{
    using p = pair<double, double>;
    vector<p> info(N);
    REP(i, N) info[i] = p((double)A[i] / B[i], (double)C[i] / B[i]);
    sort(info.begin(), info.end());

    double l = -2E8, r = 2E8;
    while (r - l > 1E-10 and (r - l) > (abs(l) + abs(r)) * 1E-10)
    {
        double c = (l + r) / 2;
        vector<pair<double, int>> vec(N);
        REP(i, N) vec[i] = make_pair(info[i].second - info[i].first * c, i + 1);
        sort(vec.begin(), vec.end());
        vector<int> vec2(N);
        REP(i, N) vec2[i] = vec[i].second;
        if (cnt(vec2) > N * (N - 1) / 2 / 2) l = c;
        else r = c;
    }
    return l;
}

int main()
{
    cin >> N;
    A.resize(N);
    B.resize(N);
    C.resize(N);
    REP(i, N) cin >> A[i] >> B[i] >> C[i];

    cout << solve(A, B, C) << " " << solve(B, A, C) << endl;
}


Measured memory_bytes: 2816
#include <stdio.h>

int main(){
	int i,d,sum=0;
	while(scanf("%d",&d)!=EOF){
		sum=0;
		for(i=0;i*d<600;i++){
			sum+=d*(i*d*i*d);
		}
		printf("%d\n",sum);
	}
	return 0;
}

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

using namespace std;

#define int long long
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define Endl '\n'
#define cont continue
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/__gcd(a,b)
#define pb push_back
#define mp make_pair
#define mem(x) memset(x, 0, sizeof(x))

const ll inf=1e18;
const int mod=1e9+7;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}
const int mxn = 2e5+10;

int Mod(int a) {
	return (a+mod)%mod;
}
int Mul(int a, int b) {
	return Mod(Mod(a) * Mod(b));
}
int Add(int a, int b) {
	return Mod(Mod(a) + Mod(b));
}
//ll fact[mxn];
//ll in_fact[mxn];
//fact[0] = 1;
//for(ll i = 1; i < mxn; i++) {
	//fact[i] = (i*fact[i-1])%mod;
//}
//in_fact[mxn-1] = bigmod(fact[mxn-1],mod-2);
//for(ll i = mxn-2; i >= 0; i--) {
	//in_fact[i] = (in_fact[i+1] * (i+1))%mod;
//}
//ll c(ll n,ll r) {
	//ll ans = (fact[n] * (in_fact[r] * in_fact[n-r]%mod))%mod;
	//return ans;
//}


signed main(){
    fast;
	//freopen ("input.txt", "r", stdin);
	//freopen ("output.txt", "w", stdout);
    int tt = 1;
    //cin>>tt;
    for(int tc = 1; tc <= tt; tc++) {
        string s;
        cin>>s;
        if(s[s.size()-1] == 's') {
			cout<<s;
			cout<<"es";
		}
		else{
			cout<<s;
			cout<<"s";
		}
			
        
        
    }



return 0;
}


Measured memory_bytes: 3628
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        static void Main(string[] args)
        {
            SolveA(args);
            //SolveB(args);
            //SolveC(args);
            //SolveD(args);


        }
        static void SolveA(string[] args)
        {
            var nmxy = ReadAndParseIntArr();
            int N = nmxy[0];
            int M = nmxy[1];
            int X = nmxy[2];
            int Y = nmxy[3];
            var x = ReadAndParseIntArr();
            var y = ReadAndParseIntArr();

            bool war = true;
            for(int z = X + 1;z < Y;++z)
            {
                if(!IsWar(x,y,X, Y, z))
                {
                    war = false;
                    break;
                }
            }
            if( war)
            {
                Console.WriteLine("War");
            }
            else
            {
                Console.WriteLine("No War");
            }
        }
        static bool IsWar(int[] x, int[] y, int X, int Y, int z)
        {
            foreach (int tmp in x)
            {
                if (tmp >= z)
                {
                    return true;
                }
            }
            foreach (int tmp in y)
            {
                if (tmp < z)
                {
                    return true;
                }
            }
            return false;
        }
    }
}

Measured memory_bytes: 11092
// Tue Jun 30 14:06:52 IST 2020  
#include <bits/stdc++.h>        
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define forn(ii,a,b)        for(int ii = (int)a ; ii < (int)b  ; ii++ )
#define debug(x)           cerr << #x << " " << x << " -- \n"
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define int64              long long    
#define pb                 push_back
#define f1                 first 
#define s1                 second    
#define all(x)             (x).begin(),(x).end() 
#define precise(x)         cout << fixed << setprecision(12) << x << '\n'; 
#define tough_nut          numeric_limits<int64>::min()
const int MOD = 1e9+7;
const double pi = 3.141592653589793238;
using namespace  std ;       
using namespace __gnu_pbds;
 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
const int N = 3e5+7; 
const int64 INF = INT64_MAX;  

const int len = 1e5+7;
vector <int> a(len);
int64 tests(){ 
    int n;
    cin >> n;
    forn(ii,1,n+1)
        cout << a[ii] << '\n';
    return 0;
}
int32_t main(){
    I__O ;     
    int cases = 1 ;  
    forn(i,1,101)
        forn(j,1,101)
            forn(k,1,101){
                int val = ((i+j)*(i+j) + (k+j)*(k+j) + (i+k)*(i+k));
                val >>= 1;
                if(val < len)
                    a[val]++ ; 
            }
    // cin >> cases ;  
    while(cases--) 
        tests();      
    return 0 ; 
}


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

using namespace std;

int A, B, K;

int main() {

	cin >> A >> B >> K;

	for (int i = A; i <= B; i++) {
		if (i<A + K || i>B - K) {
			cout << i << endl;
		}
	}

	return 0;
}

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

using namespace std;

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

const double PI=3.14159265358979323846;

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

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

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

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


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

    int n, m;
    cin >> n >> m;

    vs32 ball(n, 1);
    vector< bool > dict(n, false);
    dict[0] = true;
    rep (i, m)
    {
        int x, y;
        cin >> x >> y;
        --x, --y;
        if (dict[x])
        {
            if (ball[x] == 1)
            {
                dict[x] = false;
            }
            dict[y] = true;
        }
        --ball[x];
        ++ball[y];
    }

    int ans = 0;
    rep (i, n)
    {
        if (ball[i] > 0 && dict[i])
        {
            ++ans;
        }
    }

    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 640
val MOD = 1000000007L

fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() }
    val abs = mutableMapOf<Int, Int>()

    aa.forEach {
        abs[it] = (abs[it] ?: 0)+1
    }

    var prev = -1

    abs.entries.sortedBy { it.key }.forEach {
        if (prev == -1) {
            if (n % 2 == 0 && (it.key != 1 || it.value != 2)) {
                println(0)
                return
            }
            if (n % 2 == 1 && (it.key != 0 || it.value != 1)) {
                println(0)
                return
            }
            prev = it.key
            return@forEach
        }

        if (it.key - prev != 2 || it.value != 2) {
            println(0)
            return
        }

        prev = it.key
    }

    var ans = 1L
    repeat(n/2) {
        ans *= 2
        ans %= MOD
    }

    println(ans)
}

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

ll n,h;
ll a[100005],b[100005];

int main(){
    cin >> n >> h;
    for(ll i=0;i<n;i++){
        cin >> a[i] >> b[i];
    }
    sort(a,a+n,greater<ll>());
    sort(b,b+n,greater<ll>());
    vector<ll> vec;
    vec.push_back(0);
    for(ll i=0;i<n;i++){
        ll memo=vec[vec.size()-1];
        if(b[i]>a[0]){
            memo+=b[i];
            vec.push_back(memo);
        }
        else{
            break;
        }
    }
    ll m=vec.size();
    if(vec[m-1]>=h){
        ll ng=0;
        ll ok=m;
        while(abs(ok-ng)>1){
            ll mid=(ng+ok)/2;
            if(vec[mid]>=h) ok=mid;
            else ng=mid;
        }
        cout << ok << endl;
    }
    else{
        cout << m-1+(h-vec[m-1]+a[0]-1)/a[0] << endl;
    }
}


Measured memory_bytes: 5788
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 5e5+5;
const int mod =  1e9+7;
const int N = (1<<20)+5;
ll f[N],g[N];//F[N]所有dp[n]的和，g[n]-所有dp[n]-zero的和。 
int sum[maxn],n;
int zero[maxn];
int num[N];
int last[N];
int main() {
	cin>>n;
	for(int i=1; i<=n; i++) {
		scanf("%d",&sum[i]);
		sum[i]^=sum[i-1];
		zero[i]=zero[i-1]+(sum[i]==0);
	}
	for(int i=1;i<n;i++){
		if(!sum[i])continue;
		int t = sum[i];
		int dp = (f[t]*zero[i]%mod-g[t]+1+mod)%mod;//还要加上自己的贡献 
		f[t] = (f[t]+dp)%mod;
		g[t] = (g[t]+(ll)dp*zero[i]%mod)%mod;	
	}
	if(sum[n]){
		int t = sum[n];
		ll ans = (f[t]*zero[n]%mod-g[t]+1+mod)%mod;
		cout<<ans<<endl;
	}else{
		ll ans = 0;
		for(int i=1;i<(1<<20);i++){
			if(f[i]){
				ans+=f[i];
				ans%=mod;
			}
		}
		ll ret=1; 
		for(int i=1;i<zero[n];i++){
			ret = ret*2%mod;
		}
		ans = (ans+ret)%mod;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 20608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define INF 1e9

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

    ll N, M;
    cin >> N >> M;

    ll ans = 1;
    if (N==1) {
        cout << M << endl;
        exit(0);
    }
    for (ll i = 2; i*i <= M; i++) {
        if(M%i == 0) {
            if (M/i >= N) ans = max(i, ans);
            if (i >= N) ans = max(ans, M/i);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#063_D
n, a, b = map(int, input().split())
h = [int(input()) for _ in range(n)]
x = a - b

l, r = 0, 10 ** 9
while r - l > 1:
    k = (r + l) // 2
    
    tmp = sum([max(0, -(-(h[i] - k * b) // x)) for i in range(n)])
    if tmp > k:
        l = k
    else:
        r = k
        
print(r)

Measured memory_bytes: 11060
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
using namespace std;
const int mod=1000000007;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    string s;
    cin >> s;
    int n = sz(s);
    string rs = s;
    reverse(rs.begin(),rs.end());
    int ans = 0;
    rep(i,0,n/2-1){
        if(s[i]!=rs[i])++ans;
    }

    cout << ans << endl;
//  printf("%.10f\n",ans);

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
void initialize(){
    
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0;
  int a[LIMIT2]={0};
  char s[LIMIT1];
  
  scanf("%lld %lld",&n,&m);
  while(n<=m){
    result++;
    n*=2;
  }
  
  printf("%lld", result);
  
  return 0;
}

Measured memory_bytes: 128
from typing import List, Tuple


def main():
    n, m = map(int, input().split())
    g = []
    for _ in range(m):
        a, b = map(int, input().split())
        g.append((a, b))
    print(osp(n, g))


def osp(n: int, g: List[Tuple[int, int]]) -> int:
    v = [False] * n

    return dfs(0, v, n, g)


def dfs(i, v, n, g):
    v[i] = True
    if all(v):
        v[i] = False
        return 1

    cnt = 0
    for j in range(n):
        if v[j]:
            continue
        if not ((i + 1, j + 1) in g or (j + 1, i + 1) in g):
            continue
        cnt += dfs(j, v, n, g)

    v[i] = False
    return cnt


if __name__ == '__main__':
    main()


Measured memory_bytes: 10256
#include <iostream>
#include <vector>

using namespace std;

int main(void){
	while (1) {
		int n; cin >> n;
		if (!n) break;

		vector<char> v1, v2;
		for (int i = 0; i < n; i++) {
			char c;
			cin >> c; v1.push_back(c);
			cin >> c; v2.push_back(c);
		}

		int m; cin >> m;
		for (int i = 0; i < m; i++) {
			char b; cin >> b;
			for (int j = 0; j < n; j++) {
				if (b == v1[j]) {
					b = v2[j];
					break;
				}
			}

			cout << b;
		}

		cout << endl;
	}
}
 

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

int main(){
  int N,K,A;
  cin >> N >> K;
  A = 1;
  for(int i=0 ; i<N ; i++ ){
    if(A < K){
      A *= 2;
      continue;
    }
    if(A >= K){
      A += K;
      continue;
    }
  }
  cout << A;
}

Measured memory_bytes: 256
n = int(input())
s = []
div = -2
i = 0
while n!=0:
    r = n % div
    if r == 0:
        s.append(0)
    else:
        s.append(1)
        n -= (-2) ** i
    div *= 2
    i += 1
ans = ""
for i in range(len(s)):
    ans =  str(s[i]) + ans
if ans != "":
    print(ans)
else:
    print(0)

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

//#define DEBUG
#define REP(i,n) for(int i=1;i<=n;i++)
int m,n;
char s[2002],t[2002];
int a[2002][2002][2];

int main(){
  cin>>m>>n;
  REP(i,m)cin>>s[i];
  REP(j,n)cin>>t[j];
  REP(i,m){
    if(s[i]=='I')
      a[i][0][1]=max(a[i][0][1],a[i-1][0][0]+1);
    if(s[i]=='O')
      a[i][0][0]=max(a[i][0][0],a[i-1][0][1]+1);
  }
  REP(j,n){
    if(t[j]=='I')
      a[0][j][1]=max(a[0][j][1],a[0][j-1][0]+1);
    if(t[j]=='O')
      a[0][j][0]=max(a[0][j][0],a[0][j-1][1]+1);
  }
  REP(i,m)REP(j,n){
    if(s[i]=='I')
      a[i][j][1]=max(a[i][j][1],a[i-1][j][0]+1);
    if(s[i]=='O')
      a[i][j][0]=max(a[i][j][0],a[i-1][j][1]+1);
    if(t[j]=='I')
      a[i][j][1]=max(a[i][j][1],a[i][j-1][0]+1);
    if(t[j]=='O')
      a[i][j][0]=max(a[i][j][0],a[i][j-1][1]+1);
  }
  #ifdef DEBUG
  REP(i,m+1){
    REP(j,n+1)cout<<a[i-1][j-1][0]<<" ";
    cout<<endl;
  }
  cout<<endl;
  REP(i,m+1){
    REP(j,n+1)cout<<a[i-1][j-1][1]<<" ";
    cout<<endl;
  }
  #endif
  int ans=0;
  REP(i,m+1)REP(j,n+1)ans=max(ans,a[i-1][j-1][1]);
  if(ans!=0)ans=((ans+1)&(~1))-1;
  cout<<ans<<endl;
  //cout<<a[m][n][1]<<endl;
  return 0;
}

Measured memory_bytes: 34316
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if(a + b + c >= 22) {
        cout << "bust" << endl;
    }   
    else if(a + b + c <= 21) {
        cout << "win" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int a,b,d,r;
	double f;
	scanf("%d %d",&a,&b);
	d=a/b;
	r=a%b;
	f=(double)a/b;
	printf("%d %d %lf\n",d,r,f);
	return 0;
} 

Measured memory_bytes: 632
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N;
    cin >> N;
    vector<ll> A(3 * N);
    rep(i, 3 * N) cin >> A[i];
    sort(all(A));
    reverse(all(A));
    ll ans = 0;
    rep(i, N){
        ans += A[2 * i + 1];
    }
    output(ans);
    
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long ll;
#define REP(i, n) for (ll i = 0; i < n; i++)

int n, k, w[100001];

bool f(int x) {
    int cnt = 1, p = x;
    REP(i, n) {
        if (w[i] > x) return false;
        if (p < w[i]) {
            cnt++;
            p = x - w[i];
        } else
            p -= w[i];
    }
    return cnt <= k;
}

int search() {
    int ok = int(1e9) + 1, ng = 0;
    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;
        if (f(mid)) {
            ok = mid;
        } else {
            ng = mid;
        }
    }
    return ok;
}

int main() {
    cin >> n >> k;
    REP(i, n) cin >> w[i];
    cout << search() << endl;
    return 0;
}



Measured memory_bytes: 3480
#include <stdio.h>

int main(){
  int N;
  int A[210] = {};

  scanf("%d", &N);
  for(int i = 0; i < N; i++){
    scanf("%d", &A[i]);
  }

  int min = 32;
  for(int i = 0; i < N; i++){
    int count = 0;
    int buf = A[i];
    while(buf%2 == 0){
      count++;
      buf /= 2;
    }
    if(count < min){
      min = count;
    }
  }

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

  return 0;
}


Measured memory_bytes: 128
#ifndef Local
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
#endif

#include <bits/stdc++.h>

#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;

#define popCnt(x) (__builtin_popcountll(x))
#define sz(x) ((int)(x.size()))
#define all(v) begin(v), end(v)
typedef long long Long;
typedef long double Double;

const int N = 4e5 + 5;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifdef Local
  freopen("test.in", "r", stdin);
#else
#define endl '\n'
#endif

  int n;
  cin >> n;

  vector<pair<int, int>> v(n);
  for (auto& x : v) {
    cin >> x.first >> x.second;
  }

  auto v_a = v;
  sort(all(v_a));
  auto v_b = v;
  sort(all(v_b),
       [](const auto& a, const auto& b) { return a.second < b.second; });

  if (v.size() % 2 == 0) {
    int l1 = v_a[(n - 1) / 2].first;
    int r1 = v_b[(n - 1) / 2].second;
    int l2 = v_a[n / 2].first;
    int r2 = v_b[n / 2].second;
    cout << r2 + r1 - l2 - l1 + 1 << endl;
  } else {
    int lowest = v_a[n / 2].first;
    int highest = v_b[n / 2].second;
    cout << highest - lowest + 1 << endl;
  }
  return 0;
}

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

#define zton(i,n) for(int i=0;i<=n;i++)
#define oneton(i,n) for(int i=1;i<=n;i++)
#define fo(i,n) for(int i=0;i<n;i++)
#define fab(i,a,b) for(int i=a;i<b;i++)
#define loop(i,b,a) for(int i=a;i>=b;i--)
#define dsort(arr,n) sort(arr, arr + n, greater<int>())
#define vsortd(a) sort(a.begin(), a.end(), greater<double>())
#define vsort(a) sort(a.begin(), a.end())
#define ll long long int
#define test int tc;cin>>tc;while(tc--)
#define dbg(x) cout<<#x<<'='<<(x)<<endl;
#define dbg2(x,y) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl;
#define dbg3(x,y,z) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl;
#define dbg4(x,y,z,w) cout<<#x<<'='<<(x)<<endl<<#y<<'='<<(y)<<endl<<#z<<"="<<(z)<<endl<<#w<<"="<<(w);
#define minheap priority_queue <int, vector<int>, greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define ff first
#define ss second
#define mpr make_pair
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define mkv vector<int>
#define allzero(dp) memset(dp,0,sizeof(dp))
#define endl "\n"
#define print(x) cout<<x<<endl;

const int mod=1e9+7;
using namespace std;
bool sortcol( const vector<int>& v1,const vector<int>& v2 ) {return v1[1] < v2[1];}

void fastio()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}

bool sortbysecdesc(const pair<ll,ll> &a,const pair<ll,ll> &b){
    if(a.first>b.first)return true;
    if(a.first==b.first)return a.second<b.second;
    return false;
}

ll power(ll x, ll y){
    ll res = 1;x=x%mod;
    while(y>0){
        if(y&1)res=(res*x)%mod;
        y=y>>1;x=(x*x)%mod;}
    return res;
}



void solve()
{
    int n;cin>>n;
    if(n<600){
        print(8)
        return;
    }
    if(n<800){
        print(7)
        return;
    }
    if(n<1000){
        print(6)
        return;
    }
    if(n<1200){
        print(5)
        return;
    }
    if(n<1400){
        print(4)
        return;
    }
    if(n<1600){
        print(3)
        return;
    }
    if(n<1800){
        print(2)
        return;
    }
    if(n<2000){
        print(1)
        return;
    }

}

int main()
{
  //  fastio();
   // test
    solve();
}


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

using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILL(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define INF (1 << 29)
#define MOD 1000000007
//int dx[4] = {1,0,0,-1};
//int dy[4] = {0,1,-1,0};


int main(){

  int n;
  string s;
  cin >> n >> s;
  if(n >= 3200)cout << s;
  else cout << "red";


  return 0;
}


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

int main()
{
	int N;
	cin >> N;
	vector<int> A( N );
	for( int i = 0; i < N; i++ ) {
		cin >> A[i];
	}

	map<int, int> mp;
	for( int i = 0; i < N; i++ ) {
		mp[ A[i] ]++;
	}
	string ans = "NO";
	if( mp.size() == N ) ans = "YES";

	cout << ans << endl;
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int h, w;
  cin >> h >> w;
  VVI a(h, VI(w));
  rep(i, h) rep(j, w) cin >> a[i][j];
  struct ddd {int aa, bb, cc, dd;};
  vector<ddd> ans;
  rep(i, h * w - 1) {
    int hei = i / w;
    int wid = hei % 2 == 0 ? i % w : (w - 1 - i % w);
    int heigo = (i + 1) / w;
    int widgo = heigo % 2 == 0 ? (i + 1) % w : (w - 1 - (i + 1) % w);
    if(a[hei][wid] % 2 == 1) {
      ans.push_back({hei + 1, wid + 1, heigo + 1, widgo + 1});
      a[heigo][widgo] += 1;
    }
  }
  out(ans.size());
  for(auto &e : ans) {
    cout << e.aa << " " << e.bb << " " << e.cc << " " << e.dd << endl;
  }
  return 0;
}


Measured memory_bytes: 5236
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
/*
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
namespace mp = boost::multiprecision;// 任意長整数型
using bint = mp::cpp_int;// 仮数部長が32の浮動小数点数型
using real32 = mp::number<mp::cpp_dec_float<32>>;// 仮数部長が1024の浮動小数点数型
using real1024 = mp::number<mp::cpp_dec_float<1024>>;// ついでに有理数型
using rat = boost::rational<bint>;
*/
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
int main(){ //srand((unsigned)time(NULL));
  while(1){
    ll a,b;
    cin >> a >> b;
    if(a == 0 && b == 0)break;
    cout << (a < b ? a : b) << " " << (a < b ? b : a) << endl;
  }
}



Measured memory_bytes: 3028
N,X,Y = map(int,input().split())
ans = [0]*(N-1)
for i in range(1,N):
  for j in range(i+1,N+1):
    if j <= X or Y <= i:
      ans[j-i-1] += 1
    elif i <= X and Y <= j:
      ans[(X-i)+1+(j-Y)-1] += 1
    elif i <= X and X < j and j < Y:
      a = min(j-X,1+Y-j)
      ans[X-i+a-1] += 1
    elif X < i and i < Y and Y <= j:
      a = min(Y-i,i-X+1)
      ans[a+j-Y-1] += 1
    elif X < i and j < Y:
      a = min(j-i,i-X+1+Y-j)
      ans[a-1] += 1
for r in ans:
  print(r)

Measured memory_bytes: 3444
#include <iostream>
using namespace std ;
int main()
{
  int num1 , num2 ;
  
  cin >> num1 >> num2 ;
  
  int num3 , num4 , num5 ;
  
  num3 = num1 + num2 ;
  num4 = num1 - num2 ;
  num5 = num1 * num2 ;
  
  if(num3 >= num4 && num3 >= num5){
    cout << num3 << endl  ;
  }
  
  else if(num4 >= num3 && num3 >= num5){
    cout << num4 <<endl ;
  }
  
  else if(num5 >= num3 && num5 >= num5){
    cout << num5 << endl ;
  }
  
  return 0 ;
}

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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vs = vector<string>;

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

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

    int H, W;
    cin >> H >> W;

    vvb red(H, vb(W)), blue(H, vb(W));
    for (int r = 0; r < H; r++) {
        for (int c = 0; c < W; c++) {
            if (c == 0) red[r][c] = true;
            else if (c == W - 1) blue[r][c] = true;
            else if (r&1) red[r][c] = true;
            else blue[r][c] = true;
        }
    }

    string row;
    for (int r = 0; r < H; r++) {
        cin >> row;
        for (int c = 0; c < W; c++) {
            if (row[c] == '#')
                red[r][c] = blue[r][c] = true;
        }
    }

    for (const auto& g : { red, blue }) {
        for (int r = 0; r < H; r++) {
            for (int c = 0; c < W; c++) {
                cout << (g[r][c] ? '#' : '.');
            }
            cout << "\n";
        }
        cout << "\n";
    }

    return 0;
}



Measured memory_bytes: 1024