akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define ct(string) cout << string << endl

int main() {
    int n;
    int64_t ans=0;
    cin >> n;
    map<string, int64_t> data;
    rep(i,n) {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        data[s]++;
    }
    for (auto x: data) {
        if (x.second > 1) {
            ans += x.second*(x.second-1)/2;
        }
    }
    ct(ans);
}

Measured memory_bytes: 11136
#include <stdio.h>

int main(void){
int a, b, c;

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

int ispoor = 0;
if (a == b && b != c) ispoor = 1;
if (b == c && c != a) ispoor = 1;
if (c == a && a != b) ispoor = 1;

if (ispoor) {
    puts("Yes");
 } else {
 puts("No");
 }

 return 0;
 }

Measured memory_bytes: 128
#include <iomanip>
#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  double a[n];
  rep(i, n) cin >> a[i];
  double sum = 0;
  rep(i, n) sum += 1 / a[i];
  cout << fixed << setprecision(10) << 1 / sum << endl;
  return 0;
}


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

#define MAXN 207

int n ;
long long a[ MAXN ] ;
string s ;

int sz ;
long long f[ MAXN ] ;
int bit[ MAXN ] ;

long long calc ( long long x ) {
    for ( int i = 0 ; i < sz ; ++ i ) {
        if ( ( x & ( 1LL << bit[ i ] ) ) > 0 ) {
            x ^= f[ i ] ;
        }
    }
    return x ;
}

void add ( long long x ) {
    x = calc ( x ) ;
    if ( x != 0 ) {
        f[ sz ] = x ;
        bit[ sz ] = 0 ;
        while ( ( x & ( 1LL << bit[ sz ] ) ) == 0 ) { ++ bit[ sz ] ; }
        for ( int i = 0 ; i < sz ; ++ i ) {
            if ( ( f[ i ] & ( 1LL << bit[ sz ] ) ) > 0 ) {
                f[ i ] ^= f[ sz ] ;
            }
        }
        ++ sz ;
    }
}

void input ( ) {
    cin >> n ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        cin >> a[ i ] ;
    }
    cin >> s ;
}

void solve ( ) {
    sz = 0 ;
    for ( int i = n ; i >= 1 ; -- i ) {
        if ( s[ i - 1 ] == '1' ) {
            if ( calc ( a[ i ] ) != 0 ) {
                cout << "1\n" ;
                return ;
            }
        }
        else {
            add ( a[ i ] ) ;
        }
    }
    cout << "0\n" ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    int t ;
    cin >> t ;
    while ( t -- ) {
        input ( ) ;
        solve ( ) ;
    }
    return 0 ;
}


Measured memory_bytes: 3544
#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)2e9 + 7)
#define INF ((int)2e9)
#define INFLL ((LL)2e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (2 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 2, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 1) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL res = 2;
    LL sum = a;
    while(b){
        if(b&2)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

double exp(double a, LL b){
    double res = 1;
    double sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

PII operator+(const PII &a, const PII &b){
    return PII(a.first + b.first, a.second + b.second);
}

vector<vector<int> > xc(100001), yc(100001);

PII func(PII p){
    PII res(0, 0);
    if(!xc[p.first].empty()){
        vector<int> line = xc[p.first];
        xc[p.first].clear();
        ++res.first;
        for(auto &i:line){
            res = res + func(PII(p.first, i));
        }
    }
    if(!yc[p.second].empty()){
        vector<int> line = yc[p.second];
        yc[p.second].clear();
        ++res.second;
        for(auto &i:line){
            res = res + func(PII(i, p.second));
        }
    }
    return res;
}

signed  main(){
    int N;
    cin >> N;
    vector<int> line(N);
    REP(i, N)cin>>line[i];
    int ans = 0;
    REP(i, N-2){
        vector<int> d;
        REP(j, 3)d.push_back(line[i+j]);
        sort(ALL(d));
        if(d[1]==line[i+1])++ans;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define Mashu cout << "UUZ ate it." << endl
#define RE register int
#define ll long long
using namespace std;

inline int read(){
	char ch=getchar();
	int x=0,cf=1;
	while(ch<'0'||ch>'9') {
		if(ch=='-') cf=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9') {
		x=(x<<3)+(x<<1)+(ch^48);
		ch=getchar();
	}
	return x*cf;
}

int G[55];
template<class T> inline void write(T x){
	int g=0;
	do{G[++g]=x%10;x/=10;}while(x);
	for(int i=g;i>=1;--i)putchar('0'+G[i]);putchar('\n');
}

int main(){
	int x;
	cin >> x;
	if (x >= 30) cout << "Yes" << endl;
	else cout <<"No" << endl; 
	return 0;
	Mashu;
}


Measured memory_bytes: 3528
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define IREP(v, i) for(auto i = (v).begin(); i != (v).end(); ++i)
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define REV(x) reverse(ALL(x))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

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


map<ll, int> primeFactorisation_Map(ll n){
    map<ll, int> mp;
    for(ll i = 2; i * i <= n; ++i)
        while(!(n % i)){
            ++mp[i]; n /= i;
        }
    if(n > 1) ++mp[n];
    return mp;
}

int main(){
    ll N, P, ans(1); cin >> N >> P;
    map<ll, int> mp = primeFactorisation_Map(P);
    IREP(mp, itr){
        int a(itr->second / N);
        REP(i, a){
            ans *= itr->first;
        }
    }
    cout << ans << endl;
    return 0;
}


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

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

int32_t main(){
   fast;
   int a[5];
   int ans ;
   f(i,0,5) {
      cin >> a[i];
      if(a[i] == 0) ans = i+1;
   }

   cout << ans << "\n";

}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

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

    int i     = 1;
    int count = 0;
    while (true) {
        int now     = i;
        int waru100 = 0;
        while (now >= 100 && (now % 100 == 0)) {
            now /= 100;
            waru100++;
        }
        if (waru100 == D) count++;
        if (count == N) {
            cout << i << endl;
            return 0;
        }
        i++;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#include <ctime>


using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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; }

using Graph = vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;
const double PI = 3.1415926535897932;


int main(void)

{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << ketasitei;

	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int ans = (a + d - 1) / d;
	int ans2 = (c + b - 1) / b;
	if (ans < ans2)
	{
		cout << "No" << endl;
	}
	else
	{
		cout << "Yes" << endl;
	}
	

	return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <stdlib.h>
#include <vector> //vector
#include <cmath>

#define rep(i, n) for(int i=0; i<(int)(n);i++)
#define all(x) (x).begin(), (x).end()
#define debug(a) if(flagdebug){cout << "debug (" #a "):" << endl << (a) << endl;}

typedef uint64_t ulint;
typedef int64_t lint;

using namespace std;



lint a,b,c,d,e,f,g,h,i,j,k,l,m,o,p,q,r,s,t,u,v,w,x,y,z;

bool flagdebug = false;

int main(){
//////////////////////////////////////////////////////
    // flagdebug = true;

    string s;

    cin >> s;

    vector<lint> al(26,0);

    rep(i,4)
    {
        al[s[i] - 'A'] ++;
    }

    lint c=0;

    rep(i,26)
    {
        if(al[i]==2)c++;
    }

    if(c==2)
    {
        cout <<  "Yes"  << endl;
    }
    else
    {
        cout << "No" << endl;
    }


//////////////////////////////////////////////////////
// Ctrl + Opt + N to make
    return 0;
}


Measured memory_bytes: 256
import heapq

N,M = map(int, input().split())
nl = {i:[] for i in range(1,N+1)}
rlt = [-1]*(N+1)

for _ in range(M):
  a,b = map(int, input().split())
  nl[a].append(b)
  nl[b].append(a)

ds = [float('inf')]*(N+1)
ds[1] = 0
h = []
heapq.heappush(h,[0,1])

while(len(h) > 0):
  tmp = heapq.heappop(h)
  v = tmp[1]
  if ds[v] < tmp[0]:
    continue
  for j in nl[v]:
    if ds[j] > ds[v] + 1:
      ds[j] = ds[v] + 1
      rlt[j] = v
      heapq.heappush(h,[ds[j],j])

if -1 in rlt[2:]:
  print('No')
else:
  print('Yes')
  for i in rlt[2:]:
    print(i)

Measured memory_bytes: 109888
n = int(input())
l = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
a = []
def h(i, s, t):
	if i == 0:
		a.append(s)
		print(s)
	else:
		for j in range(t+1):
			ns = s+l[j]
			nt = max([j+1, t])
			h(i-1, ns, nt)
h(n, "", 0)

Measured memory_bytes: 12776
#include <iostream>
#include <string>
using namespace std;
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) FOR(i,0,n)
 

int main(){
	
	string s;cin >>s;
	
	for(int i = 0;i<s.size();i+=2)cout << s[i];
	cout << endl;
	
}

//cout << ans << endl;

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


class Program
{
    public void Slove()
    {    
        string[] inputs = Console.ReadLine().Split();
        int n = int.Parse(inputs[0]);
        int x = int.Parse(inputs[1]);
        Console.WriteLine((double)n / x);
    }
    static void Main(string[] args)
    {
        var p = new Program();
        p.Slove();
    }
}


Measured memory_bytes: 11092
def resolve():
    N = int(input())
    A = [int(input()) for n in range(N)]
    B = A.copy()
    B.sort()
    mx = max(A)
    count = A.count(mx)

    for i in range(N):
        if mx > A[i]:
            print(mx)
        elif mx == A[i]:
            if count >= 2:
                print(mx)
            else:
                print(B[-2])
    return


resolve()

Measured memory_bytes: 14168
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	int a, b, c, d;
	cin>>a>>b>>c>>d;
	a += b; c += d;
	if(a>c) cout<<"Left"<<endl;
	else if(a<c) cout<<"Right"<<endl;
	else cout<<"Balanced"<<endl;
	return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

#define _upgrade ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

//ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
//ll lcm(ll x, ll y) {return x / gcd(x, y) * y;}

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const long double PI = 3.14159265358979323846;

// ****************************************CODE***************************************//








int main(){



    int M, D;
    cin >> M >> D;

    int number = 0;

    for(int i = 1; i <= M; i++){
        for(int j = 1; j <= D; j++){
            int a,b;
            a = j / 10;
            b = j % 10;

            if(a >= 2 && b >= 2 && a * b == i){
                number++;
            }
        }
    }


    cout << number << endl;


    return 0;












}












































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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

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

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

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

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int64 N;
  cin >> N;
  cout << N * (N - 1) / 2 << endl;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector> 
#define MAX_ITER 200

int main() {
  int ans, total_num, num, count = 0;
  std::vector<int> num_list(MAX_ITER);
  std::cin >> total_num;
   
  for (int i = 0; i < total_num; i++) {
    std::cin >> num;
    num_list[i] = num;
  }
  
  for (int i = 0; i < MAX_ITER; i++) {
    for (int j = 0; j < total_num; j++) {
      if (num_list[j] % 2 != 0) { num = 0; break; }
      else {
        num_list[j] = num_list[j]/2;
        count++;
      }
    }
    ans = count / total_num;
  }
  std::cout << ans << std::endl;
}

Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define fore(x, c) for(auto &&x : c)
#define rep(i, a, n) for(int i = a, i##len = (int)(n); i < i##len; ++i)
#define rrep(i, a, n) for(int i = (int)(n - 1); i >= a; --i)
#define sz(c) ((int)c.size())
#define contains(c, x) (c.find(x) != end(c))
#define inseg(l, x, r) ((l) <= (x) && (x) < (r))
#define dump(...)
#define pb push_back
#define eb emplace_back
#define _ 0
const signed INF_ = 1001001001; const long long INF = 1001001001001001001LL;
const int DX[9] = {0,1,0,-1,1,1,-1,-1,0}, DY[9] = {-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
  is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a, const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a, const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap = priority_queue<T, deque<T>, greater<T>>;
struct before_main_function {
  before_main_function() {
      cin.tie(nullptr); ios::sync_with_stdio(0);
      cout << setprecision(15) << fixed;
  }
} before_main_function;
// clang-format on
//------------------8<------------------------------------8<--------------------

signed main() {
  int k;
  cin >> k;
  vi a = {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};
  cout << a[k - 1] << endl;
  return (0 ^ _ ^ 0);
}



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

int main() {
	int k,s;cin>>k>>s;
	long long ans=0;
	for(int i=0;i<=k;i++){
		for(int j=0;j<=k;j++){
			int l=s-i-j;
			if(l<0)continue;
			if(l>k)continue;
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
void main() {
  problem();
}

void problem() {
  const N = scan!int;
  const X = scan!int;
  const Y = scan!int;

  void solve() {
    int[int] counts;

    foreach(i; 1..N) {
      foreach(j; i+1..N+1) {
        auto liner = j - i;
        auto linerIToX = X - i;
        if (linerIToX < 0) linerIToX *= -1;

        auto winded = j - Y;
        if (winded < 0) winded *= -1;
        winded += linerIToX + 1;

        deb([i, j, liner, winded]);

        auto distance = min(liner, winded);
        counts[distance]++;
      }
    }
    
    foreach(i; 1..N) {
      writeln(i in counts ? counts[i] : 0);
    }
  }

  solve();
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

// -----------------------------------------------


Measured memory_bytes: 1404
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

bool oc[334];

int main(void){
	int x,n,p,i,ans=INF;
	std::cin >> x; x+=100;
	std::cin >> n;
	for(i=0; i<n; ++i){
		std::cin >> p; p += 100;
		oc[p] = true;
	}
	for(i=0; i<334; ++i){
		if(oc[i]){
			continue;
		}
		ans = std::min(ans,std::max(i-x,x-i));
	}
	for(i=0; i<334; ++i){
		if(oc[i]){
			continue;
		}
		if(ans == std::max(i-x,x-i)){
			std::cout << (i-100) << std::endl;
			break;
		}
	}
	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
    vector<int> freq(100003,0);
    int n,tmp;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>tmp;
        freq[tmp]++;
        freq[tmp+1]++;
        freq[tmp+2]++;
    }
    auto iter=max_element(freq.begin(),freq.end());
    cout<<*iter;
    
}



Measured memory_bytes: 640
#include <iostream>
using namespace std;
int main(void){
    // koronyan888's code
    // Your code here!
    int n;
    cin>>n;
    int k;
    k=0;
    int a[20];
    for(int i=0;i<20;i++){
        a[i]=0;
    }
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int b[50];
    for(int i=0;i<50;i++){
        b[i]=0;
    }
    for(int i=0;i<n;i++){
        cin>>b[i];
    }
    int c[20];
    for(int i=0;i<20;i++){
        c[i]=0;
    }
    for(int i=0;i<n;i++){
        cin>>c[i];
    }
    for(int i=0;i<n;i++){
        k+=b[a[i]-1];
        if(a[i]==a[i+1]-1){
            k+=c[a[i]-1];
        }
    }

    cout<<k;
    return 0;
}


Measured memory_bytes: 256
// Shinchan Loves Coding :)))
#include<bits/stdc++.h>
#include<map>
#include<set>
#include<stack>

using namespace std;

#define night_rider ios::sync_with_stdio(false);cin.tie(NULL);
#define int long long int
#define double long double
#define en "\n"
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define toUpper(x) transform(x.begin(), x.end(), x.begin(),::toupper);
#define toLower(x) transform(x.begin(), x.end(), x.begin(),::tolower);
#define rep(i,x,y) for(int i=x ; i<y ; i++)
#define erep(i,x,y) for(int i=x ; i<=y ; i++)
#define erepr(i,x,y) for(int i=x ; i>=y ; i--)
#define repr(i,x,y) for(int i=x ; i>y ; i--)
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef pair<int,int> pi;
typedef vector<pair<int,int>> pii;
bool secdes(const pair<int,int>&a , const pair<int,int>&b){if(a.se==b.se){return a.fi>b.fi;}else{return a.se>b.se;}}//second descending !
bool sir(const pair<int,int>&a , const pair<int,int>&b){if(a.fi==b.fi){return a.se>b.se;}else{return a.first>b.first;}}//first descending !
bool bysec(const pair<int,int>&a , const pair<int,int>&b){if(a.se==b.se){return a.fi<b.fi;} else{return a.se<b.se;}}//second ascending !

//--------------------------------------------------------------------------------------------------------------------------------------------------------------

const int no=3e6+5;
const int modulo=1e9+7;
const int inf=1e18;
const int N=2001;
int ar[no],br[no],mat[N][N];
int dx[]={-1 , 0 , 1 , 0};
int dy[]={0 , 1 , 0 , -1};
char dc[]={'L', 'D' , 'R' ,'U'};

//--------------------------------------------------------------------------------------------------------------------------------------------------------------
int mul(int x , int y , int mod) {
	return ((x%mod)*(y%mod))%mod;
}

int powwmod(int x, int y , int mod) { int res=1; while (y) { if (y & 1){ y--; res=mul(res,x,mod); res%=mod; } else { y/=2; x=mul(x,x,mod); x%=mod; } } return res%mod; }

int poww(int x , int y) { int res=1; while(y) { if(y%2) { y--; res=res*x; } else { y/=2; x=x*x; } } return res; }

int div(int x , int y , int mod) {
	return x*poww(y,mod-2)%mod ;
}

bool comp(int x, int y) {
	return (x < y);   // MAXIMUM
	return (x > y);   // MINIIMUM
}

int gcd(int x, int y) { if(y==0) return x; else return gcd(y,x%y); }

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

//--------------------------------------------------------------------------------------------------------------------------------------------------------------
vi adj[no];
int used[no];

void solve (){
	int n=0,m=0,a=0,b=0,x=0,y=0,z=0,w=0,k=0;
	cin>>n;
	pii v;
	rep(i,0,n) {
		cin>>x;
		cin>>y;
		v.PB({x,y});
	}
	rep(i,0,n-2) {
		if(v[i].fi==v[i].se && v[i+1].fi==v[i+1].se && v[i+2].fi==v[i+2].se) {cout<<"Yes"<<en; return ;}
	}
	cout<<"No"<<en;
}

inline void runn(){
	#ifndef ONLINE JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
}

signed main()
{
	night_rider
	//runn();
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}


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

// Define
using ll = int64_t;
using ul = uint64_t;
using ld = long double;
const ll MOD = 1e9 + 7;
const ll INF = LONG_MAX;
const ul MAX = ULONG_MAX;
const char nl = '\n';

#define elif else if
#define def inline auto
#define run __attribute__((constructor)) def _

// Debug
#define debug(x) cerr << (x) << " (L:" << __LINE__ << ")" << '\n'

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i < _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i > _##i; --i)
#define rep(i, n) inc(i, 0, n)
#define be(c) begin(c), end(c)

// Stream
#define fout(n) cout << fixed << setprecision(n)
#define fasten cin.tie(0), ios::sync_with_stdio(0)

// Speed
run() { fasten, fout(10); }
#pragma GCC optimize("-O3")
#pragma GCC target("avx")

ll x(ll a) {
    if (a % 4 == 0) return a;
    if (a % 4 == 1) return 1;
    if (a % 4 == 2) return a + 1;
    return 0;
}

signed main() {
    int x, y, z, K;
    cin >> x >> y >> z >> K;
    vector<ll> as(x), bs(y), cs(z);
    rep(i, x) cin >> as[i];
    rep(i, y) cin >> bs[i];
    rep(i, z) cin >> cs[i];
    sort(be(as), greater<ll>());
    sort(be(bs), greater<ll>());
    sort(be(cs), greater<ll>());

    vector<ll> ans;
    rep(i, x) {
        rep(j, y){
            rep(k, z) {
                if ((i+1)*(j+1)*(k+1) > K) break;
                ans.push_back(as[i]+bs[j]+cs[k]);
            }
        }
    }
    sort(be(ans), greater<ll>());
    ans.resize(K);
    for(auto e: ans) {
        cout << e << nl;
    }
}


Measured memory_bytes: 1404
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
    string s,t;
    cin>>s>>t;
    
    int len1=s.length();
    int len2=t.length();
    
    int dp[len1+1][len2+1];
    for(int i=0;i<=len1;i++){
        for(int j=0;j<=len2;j++){
            if(i==0||j==0){
             dp[i][j]=0;
             continue;
            }
             
            if(s[i-1]==t[j-1]){
                dp[i][j]=1+dp[i-1][j-1];
            }
            else{
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
        }
    }
    int i=len1;
    int j=len2;
    string str="";
    while(i>0 && j>0){
        if(s[i-1]==t[j-1]){
            str=str+s[i-1];
            i--;
            j--;
        }
        else if(dp[i-1][j]>dp[i][j-1]){
            i--;
        }
        else{
            j--;
        }
    }
    reverse(str.begin(),str.end());
    cout<<str;
	return 0;
}

Measured memory_bytes: 35456
N = int(input())
A = list(map(int,input().split()))

flg = 1
for i in A:
    if i%2 ==0:
        if i%3 ==0 or i%5==0:
            continue
        else:
            flg = 0
            break
if flg:
    print("APPROVED")
else:
    print("DENIED")

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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}

int main() {
  int a,p;cin>>a>>p;
  cout << (3*a+p)/2 << endl;
}


Measured memory_bytes: 256
a = list(map(int,input().split()))
i = a[0]
m = 0
while i <= a[1]:
	n1 = i % 10
	n2 = (i % 100) // 10
	n3 = (i % 1000) // 100
	n4 = (i % 10000) // 1000
	n5 = i // 10000
	if n1 == n5 and n2 == n4:
		m += 1
	i += 1
print(m)

Measured memory_bytes: 3060
d,G = map(int,input().split())
g = G//100
plist = [list() for _ in range(d)]
pp = []
pe = []
for i in range(d):
    p,C = map(int,input().split())
    c = C//100
    pp += [p]
    if p==1:
        pe += [i]
    plist[i] += [i+1]*(p-1)
    plist[i] += [i+1+c]

poli = [list() for _ in range(d)]
for i in range(d):
    poli[i] += [plist[i][0]]
    for j in range(pp[i]-1):
        poli[i] += [poli[i][j]+plist[i][j+1]]

import math
numli = []
for i in range(2**d):
    kari = 0
    nkanli = []
    karimon = 0
    for j in range(d):
        if (i>>j)&1 == 1:
            kari += poli[j][-1]
            karimon += pp[j]
        else:
            nkanli +=[j]
    if kari>=g:
        numli += [karimon]
    else:
        if nkanli == []:
            continue
        else:
            for k in range(len(nkanli)-1,-1,-1):
                if nkanli[k] in pe:
                    continue
                else:
                    if kari + poli[nkanli[k]][-2]>=g:
                        karimon += math.ceil((g-kari)/(nkanli[k]+1))
                        numli += [karimon]
                        break
                    else:
                        break
    #print(kari,nkanli,karimon)
#print(numli)
print(min(numli))

Measured memory_bytes: 9324
package main

import "fmt"

func main() {
	var N int
	var S string
	fmt.Scan(&N, &S)
	dp1 := map[int]struct{}{}
	dp2 := map[int]struct{}{}
	ans := map[int]struct{}{}
	for _, r := range S {
		c := int(r - '0')
		for i := range dp2 {
			ans[i*10+c] = struct{}{}
		}
		for i := range dp1 {
			dp2[i*10+c] = struct{}{}
		}
		dp1[c] = struct{}{}
	}
	fmt.Println(len(ans))
}


Measured memory_bytes: 896
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int t=63500;
	for(int i=t;i;i--){
		for(int j=max(i,9);j;j--){
			if(i<10&&j<10)cout<<10-i<<"x"<<10-j<<"="<<(10-i)*(10-j)<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 2916
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        sx: i64,
        sy: i64,
        tx: i64,
        ty: i64,
    }
    for _ in 0..((tx - sx).abs() as usize) {
        print!("R")
    }
    for _ in 0..((ty - sy).abs() as usize) {
        print!("U")
    }
    print!("R");
    for _ in 0..((ty - sy).abs() as usize + 1usize) {
        print!("D")
    }
    for _ in 0..((tx - sx).abs() as usize + 1usize) {
        print!("L")
    }
    print!("U");

    for _ in 0..((ty - sy).abs() as usize) {
        print!("U")
    }
    for _ in 0..((tx - sx).abs() as usize) {
        print!("R")
    }
    print!("U");
    for _ in 0..((tx - sx).abs() as usize + 1usize) {
        print!("L")
    }
    for _ in 0..((ty - sy).abs() as usize + 1usize) {
        print!("D")
    }
    println!("R");

}


Measured memory_bytes: 4352
#include<cstdio>
#include<algorithm>
int n,k,q,a[2005];
int ls[2005],st[2005],con;
int work(int mini){
	int last=-1;
	con=0;
	for(int i=1;i<=n;i++) ls[i]=a[i];
	for(int i=1;i<=n+1;i++){
		if(a[i]>=mini&&last==-1) last=i;
		if(a[i]<mini&&~last){
			std::sort(ls+last,ls+i);
			for(int j=last;j<=i-k;j++) st[con++]=ls[j];
			last=-1;
		}
	}
	if(con<q) return 0x3f3f3f3f;
	std::sort(st,st+con);
	return st[q-1]-mini;
}
int main(){
	scanf("%d%d%d",&n,&k,&q);
	a[n+1]=-1;
	int ans=0x3f3f3f3f;
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
		ans=std::min(ans,work(a[i]));
	printf("%d\n",ans);
}

Measured memory_bytes: 128
-- Atcoder Beginner Contest 042 A - 和風いろはちゃんイージー / Iroha and Haiku (ABC Edition)

import Data.List

main :: IO()
main = do
    ls <- map read . words <$> getLine
    putStrLn $ if (sort ls) == [5,5,7] then "YES" else "NO"


Measured memory_bytes: 508
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
using namespace std;


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


int main(){
  double W, H, x, y;
  cin >> W >> H >> x >> y;
  int ans1;
  double ans2 = 0;
  if(x == W / 2 && y == H / 2){
    ans1 = 1;
  } else {
    ans1 = 0;
  }


  ans2 = W * H / 2.0;

  cout << ans2 << " " << ans1 << endl;
}


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

using namespace std;

int main()
{
  string str;
  cin>>str;
  
  if(str.size()>2&&str.size()%2==0)
  { 
    int ch=0;
    for(int i=0;i<str.size();i++)
    {
      if(i%2==0)
      {
        if(str.at(i)!='h')
          ch++;
      }
      else
      {
        if(str.at(i)!='i')
          ch++;
      }
  	}
    if(ch==0)
    	cout<<"Yes"<<endl;
    else
    	cout<<"No"<<endl;
  }
  else if(str.size()==2)
  {
    if(str.at(0)=='h'&&str.at(1)=='i')
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  else
    cout<<"No"<<endl;
}

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

int main() {
  int N;
  cin>>N;
  vector<vector<int>> data(N, vector<int>(2));
 
  
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> data.at(i).at(j);
    }
  }
  double a=0;
  
  for (int k = 0; k < N; k++) {
    for (int l = k+1; l < N; l++) {
      a+=sqrt((data.at(k).at(0)-data.at(l).at(0))*(data.at(k).at(0)-data.at(l).at(0))+(data.at(k).at(1)-data.at(l).at(1))*(data.at(k).at(1)-data.at(l).at(1)));
    }
  }
  cout << fixed << setprecision(10);
  cout<<2*a/N<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5 << 28, MOD = 1e9 + 7;

int N, M, K;
vector<int> A, B;
string S, T;

void input() {
  int x, y, z;
  cin >> N;
  cin >> K;
  ;
}
void solve() {
  int ans = 1;
  rep(xxx, 1, N) {
    ;
    ans = min(ans + K, ans * 2);
  }
  cout << ans << endl;
  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#define rep(i,n) for(int i = 0; i< (n);i++)
#define SORT(a) sort((a).begin(),(a).end());
#define che(a,string) cout<<string<<":"<<(a)<<endl;
#define ch(a,string) cout<<string<<":"<<(a)<<" ";
using namespace std;
typedef pair<int,int> p;
#define INF 2000000000
	int main(){
		vector<int> a(3);
		rep(i,3){
			cin>>a[i];
		}
		SORT(a)
		int k;cin>>k;
		int sum = 0;
		rep(i,3){
			if(i==2){
				int p =pow(2,k);
				sum +=  a[2] * p;
				}
				else{
				sum+=a[i];
					}
		}
		cout<<sum<<endl;

	}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<unordered_map>
#include<set>
#include<cstring>
#include<iomanip> //cout << fixed << setprecision(15) << x << endl;

using namespace std;
typedef long long ll;
const ll INF = 1e9 + 6;
const ll MOD = 1e9 + 7;
const ll LLINF = 1e18;
#define Pint pair<int, int>
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rnr(i,a,b) for(int i=int(a);i>=int(b);i--)
#define rep(i,b) rng(i,0,b)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
/* -- template -- */

int main() {
    int n; cin >> n;
    cout << (1000 - n % 1000) % 1000 << endl;
}


Measured memory_bytes: 3632
#include<iostream>
 using namespace std ;
 int main()
{
short int c=0;
char s[3];

cin>>s;

if(((s[0]=='a')&&(s[1]=='b')&&(s[2])=='c')||
  ((s[0]=='a')&&(s[1]=='c')&&(s[2])=='b')||
  
((s[0]=='b')&&(s[1]=='a')&&(s[2])=='c')||
((s[0]=='b')&&(s[1]=='c')&&(s[2])=='a')||

((s[0]=='c')&&(s[1]=='b')&&(s[2])=='a')||
((s[0]=='c')&&(s[1]=='a')&&(s[2])=='b'))

 cout<<"Yes";
else
cout<<"No";

}

Measured memory_bytes: 3600
n = int(input())
m = int(input())
lst = [i + 1 for i in range(2 * n)]
for _ in range(m):
  k = int(input())
  if k == 0:
    lst1 = lst[0:n]
    lst2 = lst[n:2 * n]
    lst = [lst2[i//2] if i % 2 else lst1[i//2] for i in range(n * 2)]
  else:
    lst1 = lst[0:k]
    lst2 = lst[k:2 * n]
    lst = lst2 + lst1
for i in lst:
  print(i)


Measured memory_bytes: 5628
#include<bits/stdc++.h>
using namespace std;
#define LL long long 
#define pb push_back
#define mem(a, b) memset(a, b, sizeof(a))

int main() {
	int a[3];
	scanf("%d%d%d", &a[0], &a[1], &a[2]);
	sort(a, a + 3);
	printf("%d\n", (a[2] - a[1]) + ((a[1] - a[0]) % 2? (a[1] - a[0]) / 2 + 2 : (a[1] - a[0]) / 2));
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

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

int main(int argc, char* argv[]) {
	
	ll n;
	cin >> n;


	int cnt = 0;

	for (ll i = 2; i * i <=n; i++) {
		ll num = n;

		if (num % i != 0) {
			continue;
		}

		while (num % i == 0) {
			num /= i;
		}

		num %= i;

		if (num == 1) {
			cnt++;
			
		}
	}

	ll num = n - 1;


	 
	map<int, int> m;

	for (ll i = 2; i * i <= n; i++) {
		
		while (num % i == 0) {
			num /= i;
			m[i]++;
		}
	
	}

	if (num != 1) {
		m[num]++;
	}

	int c = 1;
	for (auto it = m.begin(); it != m.end(); it++) {
		c *= (it->second + 1);
	}
	

	cnt += c;

	cout << cnt << endl;
	
}

Measured memory_bytes: 3612
#include <stdio.h>

long long int name[5] = {0};
long long int out = 0;

int main() {
    int i, N;
    int a, b, c;
    char s[10];

    scanf("%d", &N);
    for (i=0; i < N ;i++) {
        scanf("%s", s);
        if (s[0] == 'M') name[0]++;
        if (s[0] == 'A') name[1]++;
        if (s[0] == 'R') name[2]++;
        if (s[0] == 'C') name[3]++;
        if (s[0] == 'H') name[4]++;
    }
    // printf("%d %d %d %d %d\n", name[0], name[1], name[2], name[3], name[4]);
    // a = (name[0]?1:0) + (name[1]?1:0) + (name[2]?1:0) + (name[3]?1:0) + (name[4]?1:0);
    for (i=0; i < 5 ;i++) {
        for (b=i+1; b < 4 ;b++) {
            for (c=b+1; c < 5 ;c++) {
                out += name[i] * name[b] * name[c];
            }
        }
    }
    printf("%lld\n", out);
    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
#include <functional>
#include <map>
#include <set>
#include <cmath>
#include <string>
#define SIZE 100005
#define INF 1000000005LL
#define MOD 1000000007

#include<iostream>

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

ll dpA[SIZE],dpB[SIZE],dpC[SIZE],dp[SIZE];

int main()
{
	string S;
	cin >> S;
	const int n = S.size();
	dp[0] = 1;
	dpA[0]=dpB[0]=dpC[0]=0;
	for(int i=0;i<n;i++){
		if(S[i] == 'A'){
			dpA[i+1] = dpA[i] + dp[i];
			dpB[i+1] = dpB[i];
			dpC[i+1] = dpC[i];
			dp[i+1] = dp[i];
		}else if(S[i] == 'B'){
			dpA[i+1] = dpA[i];
			dpB[i+1] = dpB[i] + dpA[i];
			dpC[i+1] = dpC[i];
			dp[i+1] = dp[i];
		}else if(S[i] == 'C'){
			dpA[i+1] = dpA[i];
			dpB[i+1] = dpB[i];
			dpC[i+1] = dpC[i] + dpB[i];
			dp[i+1] = dp[i];
		}else if(S[i] == '?'){
			dpA[i+1] = dpA[i]*3 + dp[i];
			dpB[i+1] = dpB[i]*3 + dpA[i];
			dpC[i+1] = dpC[i]*3 + dpB[i];
			dp[i+1] = dp[i]*3;
		}
		dpA[i+1] %= MOD;
		dpB[i+1] %= MOD;
		dpC[i+1] %= MOD;
		dp[i+1] %= MOD;
	}
	cout << dpC[n] << endl;
	return 0;
}


Measured memory_bytes: 3584
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define rep(i, s, n) for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t) for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(type, ...) \
    type __VA_ARGS__;  \
    read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U>
inline bool chmax(T &a, const U &b) {
    return b > a && (a = b, true);
}
template <class T, class U>
inline bool chmin(T &a, const U &b) {
    return b < a && (a = b, true);
}
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(
        sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream &operator>>(istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail &... tail) {
    cin >> head;
    read(tail...);
}

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream &operator<<(ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = {" ", ""};
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}

template <class Container>
struct Rev {
    Container &x_;
    inline Rev(Container &x) : x_(x) {}
    inline auto begin() { return rbegin(x_); }
    inline auto end() { return rend(x_); }
};
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    var(double, r);
    cout << fixed << setprecision(12);
    print(2 * r * M_PI);

    return 0;
}


Measured memory_bytes: 3796
//#include <tourist>
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//g++ yarudake.cpp -std=c++17 -I .
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// 繰り返し二乗法
ll pow_mod(ll x, ll n)
{
    if (n == 0)
        return 1;
    ll ret = pow_mod((x * x) % MOD, n / 2);
    if (n & 1)
        ret = (ret * x) % MOD;
    return ret;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll ans = pow_mod(10, n);
    ans -= (2*pow_mod(9, n))%MOD;
    ans=(ans+MOD)%MOD;
    ans += pow_mod(8, n);
    cout<<ans%MOD<<"\n";
}

Measured memory_bytes: 3624