akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define int long long

struct IoSetup {
    IoSetup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout <<fixed<<setprecision(12);
        cerr <<fixed<<setprecision(12);
    }
}IoSetup;

typedef long long ll;
typedef pair < int , int >  pii;
static constexpr const signed int INF = 0x3f3f3f3f;
static constexpr const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static constexpr const signed int SMOD = 1000000007;
static constexpr const signed int NMOD = 998244353;
static constexpr const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static constexpr const signed int dy[]={0,-1,0,1,-1,1,-1,1};

inline bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>bool chmax(T &a, const T &b){return(a=max(a,b))==b;}
template<class T>bool chmin(T &a, const T &b){return(a=min(a,b))==b;}
inline int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}



signed main() {

    int x, y, a, b, c;

    cin >> x >> y >> a >> b >> c;

    vector<int> p(a), q(b), r(c);

    for(auto&&i:p) cin >> i;
    for(auto&&i:q)cin >> i;
    for(auto&&i:r)cin >> i;

    sort(ALL(p), greater<int>());
    sort(ALL(q), greater<int>());

    for(int i = 0; i < x; i++) r.bash(p[i]);
    for(int i = 0; i < y; i++) r.bash(q[i]);

    sort(ALL(r), greater<int>());
    
    ll sum = 0;

    for(int i = 0; i < x + y; i++) sum +=  r[i];
    
    cout << sum << endl;
  
    return 0;
}



Measured memory_bytes: 6512
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n,s;
	while(cin>>n>>s,n>0){
		vector<int> m(n*2,0);
		for(int j=0;j<m.size();++j) cin >> m[j];
		vector< vector<bool> > dp(s + 1, vector<bool>(m.size(),false));
		for(int i=1;i<=s;++i){
			for(int j=0;j<m.size();++j){
				if(!dp[i][j]){
					int prev = (j + m.size() - 1) % m.size();
					for(int k=1;k<=m[prev];++k){
						if(i+k<dp.size()) dp[i+k][prev]=true;
					}
				}
			}
		}
		cout<<dp[s][0]<<endl;
	}
	return 0;
}

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

using namespace std;
typedef long long ll;
    
int main()
{
    int N, A, B;
    cin >> N >> A >> B;

    int plan1 = N * A;
    int plan2 = B;

    if (plan1 < plan2) {
        cout << plan1;
    } else {
        cout << plan2;
    }

    return 0;
}


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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 1e9;                          // 十分大きな値にansを設定
    for (char ch = 'a'; ch <= 'z'; ch++) {  // character 'a' to 'z' 全探索
        string t = s;            // sをコピーした文字列tを作る
        for (int i = 0;; i++) {  // iを0から初めて無限にインクリメント
            if (t.empty()) {  // もし文字列tが空になったら終了
                break;
            }
            if (t == string(t.size(), ch)) {  // 文字列tがすべてchの文字列になったら色をansを更新して終了
                ans = min(ans, i);
                break;
            }
            string nt = "";  // 空の文字列ntを作る
            for (int j = 0; j < t.size() - 1; j++) {  // jを0->文字列tの大きさ-1まで増やす
                if (t[j] == ch ||
                    t[j + 1] == ch) {  // tのjかj+1文字目chならntにchを加える
                    nt += ch;
                } else {  // それ以外はそのまま
                    nt += t[j];
                }
            }
            // 上の作業で|nt| = |t| - 1になる
            t = nt;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
const int N=2e5+5;
int n;
pair<int,int>a[N];
bool judge(int k,int x,int y)
{
    int l=0,r=0;
    for(int i=1;i<=n;i++)
    {
        if(a[i].fi<=k) l++;
        if(a[i].se>=k) r++;
    }
    return l>=x&&r>=y;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&a[i].fi,&a[i].se);
    sort(a+1,a+1+n);
    if(n&1)
    {
        int m=n/2+1;
        int l=a[m].fi,r=1e9,ans;
        while(l<=r)
        {
            int mid=l+r>>1;
            if(judge(mid,n/2,n-n/2)) ans=mid,l=mid+1;
            else r=mid-1;
        }
        printf("%d\n",ans-a[m].fi+1);
    }
    else
    {
        int m=n/2,low=a[m].fi+a[m+1].fi;
        for(int i=1;i<=n;i++) swap(a[i].fi,a[i].se);
        sort(a+1,a+1+n);
        int up=a[m].fi+a[m+1].fi;
        printf("%d\n",up-low+1);
    }
}


Measured memory_bytes: 5392
#include <iostream>
using namespace std;
int main(void){
  int a,b;
  cin >> a >> b;
  if(a==1&&b==1){
    cout << 1000000 << endl;
  }
  else if(a==3&&b==3){
    cout << 200000 << endl;
  }
  else if(a==3&&b==2){
    cout << 300000 << endl;
  }
  else if(a==3&&b==1){
    cout << 400000 << endl;
  }
  else if(a==2&&b==3){
    cout << 300000 << endl;
  }
  else if(a==2&&b==2){
    cout << 400000 << endl;
  }
  else if(a==2&&b==1){
    cout << 500000 << endl;
  }
  else if(a==1&&b==3){
    cout << 400000 << endl;
  }
  else if(a==1&&b==2){
    cout << 500000 << endl;
  }
  else if(a==1&&b>=4){
    cout << 300000 << endl;
  }
  else if(a==2&&b>=4){
    cout << 200000 << endl;
  } 
  else if(a==3&&b>=4){
    cout << 100000 << endl;
  }
  else if(a>=4&&b==1){
    cout << 300000 << endl;
  }
  else if(a>=4&&b==2){
    cout << 200000 << endl;
  }
  else if(a>=4&&b==3){
    cout << 100000 << endl;
  }
  else if(a >= 4 && b >= 4){
    cout << "0" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.sql.SQLOutput;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.plaf.IconUIResource;


 class Main {

  public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

  static class FastReader {

    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
      br = new BufferedReader(new
          InputStreamReader(System.in));
    }

    String next() {
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

    double nextDouble() {
      return Double.parseDouble(next());
    }

    String[] nextSArray() {
      String sr[] = null;
      try {
        sr = br.readLine().trim().split(" ");
      } catch (IOException e) {
        e.printStackTrace();
      }
      return sr;
    }

    String nextLine() {
      String str = "";
      try {
        str = br.readLine();
      } catch (IOException e) {
        e.printStackTrace();
      }

      return str;
    }
  }

  //  static int MOD=1000000000+7;
//  public static void sortbyCol(int arr[][],int col)
//  {
//    Arrays.sort(arr,new Comparator<int[]>(){
//      @Override
//      public int compare(int[] o1, int[] o2) {
//        // To sort in descending order revert
//        // the '>' Operator
//        if(o1[col]>o2[col])
//          return 1;
//        else
//          return -1;
//      }
//    });
//  }
static int countbits(int a)
{
  if(a==0)
    return 0;
  return  (int)(Math.log(a)/Math.log(2)+1);
}

static int reversebits(int n, int pos)
{
  while(pos>0)
  {
    if((n&pos)>0)
    {
      n-=pos;
    }
    else
      n+=pos;
      pos=pos>>1;
  }
  return n ;
}
  public static void main(String[] args) throws java.lang.Exception {
    FastReader sc = new FastReader();
//   int t1=sc.nextInt();
//
//   for(int t=0;t<t1;++t)
//   {
//
//   }

    String s=sc.nextLine();
    char ch=s.charAt(0);
    if (Character.isUpperCase(ch)) {
      System.out.println("A");
    } else {
      System.out.println("a");
    }

    }

  }



// out.println(al.toString().replaceAll("[\\[|\\]|,]",""));


Measured memory_bytes: 25468
#include <iostream>
#include <queue>
#include <utility>
#include <map>
using namespace std;

typedef long long lint;
typedef unsigned long long ulint;

int main(){
    lint N;
    cin >> N;
    ulint X=0,E=0;
    for(lint i=0;i<N;i++){
        ulint A;
        cin >> A;
        X^=A;
        E|=(A^(A-1))+1;
    }

    lint cnt=0;
    for(int i=31;i>=0;i--){
        if(X&(1<<i)){
            if((E&(1<<(i+1)))==0){
                cout << "-1" << endl;
                return 0;
            }
            cnt++;
            X^=(1<<(i+1))-1;
        }
    }
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repeat(i,a,b) for(int i=(a),_=(b);i<_;i++)
#define repeat_back(i,a,b) for(int i=(b)-1,_=(a);i>=_;i--)
#define mst(a,x) memset(a,x,sizeof(a))
#define vector basic_string
#define fi first
#define se second
#ifndef qwq
int cansel_sync=(ios::sync_with_stdio(0),cin.tie(0),0);
#endif
//mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N=200010; const double err=1e-11; typedef long long ll; const int inf=~0u>>2; const ll INF=~0ull>>2; ll read(){ll x; if(scanf("%lld",&x)==-1)exit(0); return x;} typedef double lf; typedef long double llf; const lf pi=acos(-1.0); lf readf(){lf x; if(scanf("%lf",&x)==-1)exit(0); return x;} template<typename T> T sqr(const T &x){return x*x;} typedef pair<int,int> pii; template<typename A,typename B> ostream &operator<<(ostream &o,const pair<A,B> &x){return o<<'('<<x.fi<<','<<x.se<<')';}
const int mod=(1?1000000007:998244353); ll mul(ll a,ll b,ll m=mod){return a*b%m;} ll qpow(ll a,ll b,ll m=mod){ll ans=1; for(;b;a=mul(a,a,m),b>>=1)if(b&1)ans=mul(ans,a,m); return ans;} ll getinv(ll v,ll m=mod){return qpow(v,m-2,m);}
#define int ll
int ans,n;
void divisor(int n){
	for(int i=1;i<n;i=n/(n/(i+1)))
	if(n%i==0)
		ans++;
}
void test(int n,int i){
	if(i==1)return;
	while(n%i==0)n/=i;
	if(n%i==1)ans++;
}
signed main(){
	cin>>n;
	divisor(n-1);
	for(int i=1;i<n;i=n/(n/(i+1)))
	if(n%i==0)
		test(n,i);
	test(n,n);
	cout<<ans<<endl;
	return 0;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> v[n];
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }

    rep(i, n) cout << v[i].size() << endl;

    return 0;
}


Measured memory_bytes: 3612
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
typedef long long ll;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD1 1000000007
 
int main() {
 
 
  int N;
  cin >> N;
  vector<int> a(N + 1, 0);
  rep(i, N) cin >> a.at(i + 1);
  vector<int> b(N + 1, 0);
 
  for (int i = (N / 2) + 1 ; i <= N ; i++) {
    b.at(i) = a.at(i);
  }
 
  for (int i = (N / 2)  ; i >= 1 ; i--) {
    int sum = 0;
    for (int j = 2 * i ; j <= N; j += i) {
      sum += b.at(j);
    }
    sum &= 1;
    if (sum != a.at(i)) b.at(i) = 1;
  }
 
  int M = 0;
  rep(i, N) {
    if (b.at(i + 1) == 1) M++;
  }
 
  cout << M << endl;
  rep(i, N) {
    if (b.at(i + 1) == 1) cout << i + 1 << " ";
  }
 
  cout << endl;
 
}

Measured memory_bytes: 2560
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()

y = []
for i in range(m-1):
  y += [x[i+1]-x[i]]
# print(x)
# print(y)

y.sort()
print(sum(y[:max(m-n,0)]))

Measured memory_bytes: 13968
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace __gnu_pbds;
using namespace std;
#define testing 0
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >= (ll)(ee); --ii)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << endl
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<endl
#define dbv(v) cerr << #v << ":"; for (auto it : v) cerr << it << ' '; cerr << endl
#define dbvp(v) cerr << #v << ":"; for (auto it : v) cerr << "{"  << it.f << ',' << it.s << "} "; cerr << endl
#define dba(a,ss,ee) cerr << #a << ":"; FOR(i,ss,ee) cerr << a[i] << ' '; cerr << endl
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define inf (int)1e9+500
#define oo (ll)1e18
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "hi\n";
typedef pair <int, int> pi;
typedef pair <ll,ll> pl;
typedef pair <pi, int> pii;
typedef tuple<int,int,int> ti3;
string cts(char x) {string s(1,x); return s;}
const int MOD = 1e9 + 7;
template <typename T> void maxself(T& a, T b) {
	a = max(a, b);
}
template <typename T> void minself(T& a, T b) {
	a = min(a, b);
}
#define MAXN
#if !testing
#define cerr if(0)cout
#endif
struct SparseTable {
    vector<vector<int> > ST;
    int N, K;
    SparseTable(int _N, int a[]): N(_N) {
        K = MSB(N);
        ST.resize(K);
        ST[0] = vector<int>(a, a+N);
        for (int k = 1; k < K; ++k) 
            for (int i = 0; i+(1<<k) <= N; ++i) 
                ST[k].push_back( __gcd(ST[k-1][i], ST[k-1][i+(1<<(k-1))]) ); //min
    }
    
    /* returns most significant bit of an integer */
    inline int MSB(unsigned int x) { return 32-__builtin_clz(x); }
    
    /* Min of range (x, x + 2^k-1) and (y-2^k+1, y) */
    int query(int x, int y) {
        int k = MSB(y-x+1) - 1;
        return __gcd(ST[k][x], ST[k][y-(1<<k)+1]);
    }
    
} *dense;
int A[100005];
int32_t main() {
	IAMSPEED
	// set testing to 0 when submitting to judge
	int n; cin >> n;
	FOR(i,0,n-1)cin>>A[i];
	dense = new SparseTable(n,A);
	int gcd= max(dense->query(1,n-1),dense->query(0,n-2));
	FOR(i,1,n-2) {
		maxself(gcd,__gcd(dense->query(0,i-1),dense->query(i+1,n-1)));
	}
	cout<<gcd;
}


Measured memory_bytes: 7288
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
using namespace std;
typedef long long ll;
int main()
{
    ll a,b;
    cin>>a>>b;
    if(a>0 && b>=a)puts("Positive");
    else if(a<=0 && b>=0)puts("Zero");
    else if(b<0 && a<=b)
    {
        if( (b-a+1)%2 )puts("Negative");///number within that range is ODD
        else puts("Positive");
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree = 
//  tree<key, val, less<key>, rb_tree_tag, tree_order_statistics_node_update>;
using namespace std;
typedef long long int64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = 1'000'000'007;//998244353;
const int base = 2187;
const double eps = 1e-8;
const int N = 5'000;

int n, m, k;

void solve(int test)
{
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int> ans;
  ans.reserve(n);
  for (int i = 0; i < n; ++i) {
    int p = n;
    for (int j = n - i - 1; j >= 0; --j) {
      if (a[j] - 1 == j && p == n)
        p = j;
    }
    if (p == n) break;
    ans.push_back(a[p]);
    a.erase(a.begin() + p);
  }
  if ((int)ans.size() == n) {
    reverse(ans.begin(), ans.end());
    for (auto val : ans)
      cout << val << '\n';
  } else {
    cout << "-1\n";
  }
}

void precalc()
{
}

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i)
    solve(i);
  //cerr << endl << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count();
  return 0;
}


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

struct Problem {
public:

	ULL BitNum(ULL a) {
		a = (a & 0x5555555555555555) + ((a >> 1) & 0x5555555555555555);
		a = (a & 0x3333333333333333) + ((a >> 2) & 0x3333333333333333);
		a = (a & 0x0f0f0f0f0f0f0f0f) + ((a >> 4) & 0x0f0f0f0f0f0f0f0f);
		a = (a & 0x00ff00ff00ff00ff) + ((a >> 8) & 0x00ff00ff00ff00ff);
		a = (a & 0x0000ffff0000ffff) + ((a >> 16) & 0x0000ffff0000ffff);
		a = (a & 0x00000000ffffffff) + ((a >> 32) & 0x00000000ffffffff);
		return a;
	}

	void Solve() {
		UL Q; scanf("%u", &Q);
		ULL M = 0;
		while (Q--) {
			UL c; scanf("%u", &c);
			switch (c) {
			case 0: {
				UL i; scanf("%u", &i);
				printf("%llu\n", (M >> i) & 1ull);
			} break;
			case 1: {
				UL i; scanf("%u", &i);
				M |= (1ull << i);
			} break;
			case 2: {
				UL i; scanf("%u", &i);
				M &= ~(1ull << i);
			} break;
			case 3: {
				UL i; scanf("%u", &i);
				M ^= (1ull << i);
			} break;
			case 4: {
				printf("%u\n", !~M);
			} break;
			case 5: {
				printf("%u\n", !!M);
			} break;
			case 6: {
				printf("%u\n", !M);
			} break;
			case 7: {
				printf("%llu\n", BitNum(M));
			} break;
			case 8: {
				printf("%llu\n", M);
			} break;
			}
		}
	}
};

int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}



Measured memory_bytes: 3192
#include<stdio.h>
#include<math.h>
int main(){
  long int n,k,a,b,x,y,i;

  scanf("%ld",&n);
  scanf("%ld%ld",&x,&y);
  for(i=1;i<n;i++){
    scanf("%ld%ld",&a,&b);
    k=(x-1)/a<(y-1)/b?(y-1)/b+1:(x-1)/a+1;
    x=a*k;y=k*b;
  }
  printf("%ld",x+y);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n'
#define fast ios::sync_with_stdio(false); cin.tie(NULL);
#define loop(n) for(ll i=0; i<n; i++)
#define loopo(i,n) for(ll i=0; i<n; i++)
using namespace std;


int main(){
    fast;
    
    int h1,s1,h2,s2;cin>>h1>>s1>>h2>>s2;
    
    
    bool first = true;
    
    while( h1>0 || h2>0 ){
        h2-=s1;
        if( h2<=0 ){
            first=true;
            break;
        }
        h1-=s2;
        if( h1<=0 ){
            first=false;
            break;
        }
    }
    if(first)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    return 0;
}



Measured memory_bytes: 3640
antennas = []
for i in range(5):
    antennas.append(int(input()))
k = int(input())

flg = False
for i in range(5):
    for j in range(5):
        if i == j:
            continue
        if abs(antennas[i]-antennas[j]) > k:
            flg = True
            break
if flg:
    print(':(')
else:
    print('Yay!')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,l;
  cin >> n >> l;
  int min,min_aji_i;
  for(int i=0;i<n;i++){
    if(i==0){
      min = abs(l+i);
      min_aji_i = 0;
    }
    if(min > abs(l+i)){
      min = abs(l+i);
      min_aji_i = i;
    }
  }
  int pi_aji=0;
  for(int i=0;i<n;i++){
    if(i==min_aji_i) continue;
    pi_aji += l+i;
  }
  cout << pi_aji << endl;
  return 0;
}


Measured memory_bytes: 256
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)*}
    };
}

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, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

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

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

use std::cmp;

fn main() {
    input!{
        n: usize,
        d: usize,
        ds: [usize; n],
        q: usize,
        qs: [usize; q]
    }
    let mut p: Vec<usize> = ds.iter().scan(d, |ac,&x| {*ac = cmp::min(*ac,(*ac as i64 - x as i64).abs() as usize); Some(*ac)}).collect();
    p.insert(0,d);
    let mut min: Vec<usize> = vec![1;n+1];
    for i in 1..n+1 {
        min[n-i] = min[n-i+1];
        if min[n-i+1] * 2 > ds[n-i] {
            min[n-i] += ds[n-i];
        }
    }
    for x in qs {
        println!("{}",if p[x-1] >= min[x] {"YES"} else {"NO"});
    }
}


Measured memory_bytes: 23416
n, d = map(int, input().split())

ans = 0

n -= (d+1)  # 一人目の立つ場所
ans += 1
if n <= 0:
    print(ans)
    exit()
while True:
    if (n - d) <= 0:
        break
    else:
        n -= (2*d + 1)
        ans += 1
        if n <= 0:
            break

print(ans)


Measured memory_bytes: 3060
import java.util.*;

public class Main {
	public static void main(String... args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int sum = 0;
		int min = 1000;
		while (sc.hasNext()) {
			int min2 = sc.nextInt();
			sum = sum + min2;
			if (min2 < min) min = min2;
		}
		System.out.println((x - sum) / min + n);
	}
}


Measured memory_bytes: 21972
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]", B: "List[int]"):
    As = sorted(A)
    Bs = sorted(B)

    if N % 2 == 1:
        min_ = As[(N-1)//2]
        max_ = Bs[(N-1)//2]

        print(max_-min_ + 1)
    else:
        min_1 = As[N//2]
        # if N <= 2: min_2 = min_1
        min_2 = As[N//2-1]
        min_ = (min_1 + min_2)/2
        max_1 = Bs[N//2]
        # if N <= 2: max_2 = max_1
        max_2 = Bs[N//2-1]
        max_ = (max_1 + max_2)/2
        # print(min_, max_)
        print(int((max_ - min_)//0.5 + 1))


    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(N, A, B)

if __name__ == '__main__':
    main()


Measured memory_bytes: 28508
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  bitset<30> ans;
  int K,X;
  cin>>K;
  for(int i=0;i<K;i++){
    cin>>X;
    ans.set(X-1);
    }
  for(int i=1;i<N;i++){
    cin>>K;
    bitset<30> sum;
    for(int j=0;j<K;j++){
      cin>>X;
      sum.set(X-1);
      }
    ans=ans&sum;
    }
  cout<<ans.count()<<endl;
  }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
   vector<int> vec(3);
   cin >> vec.at(0) >> vec.at(1) >> vec.at(2);
   sort(vec.begin(), vec.end());
  
  
   cout << vec.at(0)+vec.at(1) << endl;
  
  
  
  
  
  
  
  
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <random>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")
#define ll long long
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define pll pair<ll,ll>
#define ld long double
#define pld pair<ld,ld>
#define pii pair<int,int>
#define sqr(a) ((a)*(a))
#define all(v) v.begin(),v.end()

using namespace std;
//using namespace __gnu_pbds;

const ll MOD = 998244353;
const ll INF = 1e18;
const ld E = 1e-8;
mt19937_64 rnd(time(0));
ll p1 = 31, p2 = 29, p3 = 7, p4=rnd()%100+1, md1 = MOD, md2 = 998244353, md3=998244357, md4=rnd()%1000000000;

//using ord_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

ll n, m, k, h, T, dp[3001];
ll a[300001];

ll binpow(ll h, ll r, ll md = MOD)
{
    ll l = 1;
    while (r)
    {
        if (r & 1) l *= h, l %= md;
        h *= h;
        h %= md;
        r /= 2;
    }
    return l;
}

ll gcd(ll x, ll y)
{
    if (x < y) swap(x, y);
    while (x && y)
    {
        x %= y;
        swap(x, y);
    }
    return x + y;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //freopen("capitals.in","r",stdin);
    //freopen("capitals.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a+1,a+n+1);
    ll o=binpow(2,MOD-2);
    dp[0]=binpow(2,n);
    for (int i = 1; i <= n; i++)
    {
        for (int j = m-a[i]; j > -1; j--)
            dp[j+a[i]]=(dp[j+a[i]]+dp[j]*o%MOD)%MOD;
    }
    cout << dp[m] << "\n";
    return 0;
}

/*
4
1 4 3 6
3
1 2 3
4
6 3 4 1
*/


Measured memory_bytes: 3712
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

k = int(input())
a, b = map(int, input().split())
ok = False
for i in range(1, 1001):
    if a <= k * i <= b:
        ok = True
if ok:
    print("OK")
else:
    print("NG")

Measured memory_bytes: 9180
a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i
k = gets.to_i

puts (a - b).abs <=  k && (a - c).abs <= k && (a - d).abs <= k && (a - e).abs <= k && (b - c).abs <= k && (b - d).abs <= k && (b - e).abs <= k && (c - d).abs <= k && (c - e).abs <= k && (d - e).abs <= k ? 'Yay!' : ':('


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

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

Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
  int main() {
  char C;
  cin >> C;
  if ( C == 'a' || C == 'e' || C ==  'i'|| C ==  'o' || C =='u'){
   cout << "vowel" << endl;
  }else{
   cout << "consonant" << endl;  
  }
}

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

const long mod=998244353;

int c[100010], d[100010];

long mpow(long x, long n)
{
    long res=1;
    for(; n>0; n>>=1) {
        if (n%2) res=res*x%mod;
        x=x*x%mod;
    }
    return res;
}

int main()
{
    int n; cin>>n;
    for(int i=0; i<n; ++i) {
        cin>>d[i];
        c[d[i]]++;
    }

    if (d[0]!=0 or c[0]!=1) {
        cout<<0<<endl;
        return 0;
    }
    else {
        for(int i=0; i<n; ++i) {
            if (c[i+1]>0 and c[i]==0) {
                cout<<0<<endl;
                return 0;
            }
        }
        long res=1;
        for(int i=1; i<n and c[i]; ++i) {
            res=res*mpow(c[i], c[i+1])%mod;
        }
        cout<<res<<endl;
    }
}


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

typedef long long ll;

ll gcd(ll num1, ll num2){ return num2 == 0?num1:gcd(num2, num1 % num2); }
ll lcm(ll num1, ll num2){ return num1 * num2 / gcd(num1, num2); }

int main(){
    int a,b;
    while(cin >> a >> b){
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
    return 0;
}

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

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

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

inline auto divisors(lint x) {
  std::vector< lint > ret;
  std::stack < lint > stk;
  for (lint i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      ret.emplace_back(i);
      if (i * i < x)
        { stk.emplace(x / i); }
    }
  }
  while (!stk.empty())
    { ret.emplace_back(stk.top()), stk.pop(); }
  return ret;
}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  lint n; std::cin >> n;
  auto a = divisors(n);
  auto b = a;
  std::reverse(all(b));
  // debug(a, b);
  int sz = a.size();
  lint ret = std::numeric_limits< lint >::max();
  rep(i, 0, sz) {
    cmn(ret, a.at(i) + b.at(i) - 2);
  }
  std::cout << ret << std::endl;
  return 0;
}


Measured memory_bytes: 384
mycode = r'''
# distutils: language=c++
# cython: language_level=3, boundscheck=False, wraparound=False
# cython: cdivision=True
# False:Cython はCの型に対する除算・剰余演算子に関する仕様を、(被演算子間の符号が異なる場合の振る舞いが異なる)Pythonのintの仕様に合わせ、除算する数が0の場合にZeroDivisionErrorを送出します。この処理を行わせると、速度に 35% ぐらいのペナルティが生じます。 True:チェックを行いません。
ctypedef long long LL

import numpy as np
from functools import partial
array=partial(np.array, dtype=np.int64)
zeros=partial(np.zeros, dtype=np.int64)
full=partial(np.full, dtype=np.int64)

import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.readline #文字列読み込む時はこっち

cdef ints(): return np.fromstring(readline(), sep=' ', dtype=np.int64)

cdef read_matrix(LL H,LL W):
    #return np.ndarray shape=(H,W) matrix
    lines=[]
    cdef LL _
    for _ in range(H): 
        lines.append(read())
    lines=' '.join(lines) #byte同士の結合ができないのでreadlineでなくreadで
    return np.fromstring(lines, sep=' ',dtype=np.int64).reshape(H,W)

cdef class UnionFind:
    cdef:
        public LL N,n_groups
        public LL[::1] parent

    def __init__(self, LL N):
        self.N = N  # ノード数
        self.n_groups = N  # グループ数
        # 親ノードをしめす。負は自身が親ということ。
        self.parent = full(N,-1)  # idxが各ノードに対応。

    cdef LL root(self, LL A):
        # print(A)
        # ノード番号を受け取って一番上の親ノードの番号を帰す
        if (self.parent[A] < 0):
            return A
        self.parent[A] = self.root(self.parent[A])  # 経由したノードすべての親を上書き
        return self.parent[A]

    cdef LL size(self, LL A):
        # ノード番号を受け取って、そのノードが含まれている集合のサイズを返す。
        return -self.parent[self.root(A)]

    cdef bint unite(self,LL A,LL B):
        # ノード番号を2つ受け取って、そのノード同士をつなげる処理を行う。
        # 引数のノードを直接つなぐ代わりに、親同士を連結する処理にする。
        A = self.root(A)
        B = self.root(B)

        # すでにくっついている場合
        if (A == B):
            return False

        # 大きい方に小さい方をくっつけたほうが処理が軽いので大小比較
        if (self.size(A) < self.size(B)):
            A, B = B, A

        # くっつける
        self.parent[A] += self.parent[B]  # sizeの更新
        self.parent[B] = A  # self.rootが呼び出されればBにくっついてるノードもすべて親がAだと上書きされる
        self.n_groups -= 1

        return True

    cdef bint is_in_same(self,LL A,LL B):
        return self.root(A) == self.root(B)


cdef LL N,M

N, M = ints()
AB=read_matrix(M,2)-1
cdef UnionFind uf = UnionFind(N)
cdef LL a,b
for a,b in AB:
    uf.unite(a, b)

print(-np.min(uf.parent))
'''

import sys
import os
if sys.argv[-1] == 'ONLINE_JUDGE':  # コンパイル時
    with open('mycode.pyx', 'w') as f:
        f.write(mycode)
    os.system('cythonize -i -3 -b mycode.pyx')

import mycode


Measured memory_bytes: 44232
#include<stdio.h>

int main(void)
{
	int H, W, i, j;

	while (1)
	{
		scanf("%d%d", &H, &W);
		if (H == 0 && W == 0) {
			break;
		}
		for (i = 0; i < H; i++) {
			for (j = 0; j < W; j++) {
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
	
	return 0;
}


Measured memory_bytes: 2048
X,Y=map(int,input().split())

if X>=0:
    if Y>=X:
        print(Y-X)
    elif -X<=Y<=0:
        print(Y-(-X)+1)
    elif 0<Y<X:
        print(X-Y+2)
    else:
        print(-Y-X+1)
else:
    if Y>=abs(X):
        print(Y-(-X)+1)
    elif X<=Y<=0:
        print(Y-X)
    elif 0<Y<abs(X):
        print(abs(X)-Y+1)
    else:
        print(abs(Y)-abs(X)+2)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;

namespace AOJGRL_1_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var VE = ReadInt();
            int V = VE[0];
            int E = VE[1];

            int INF = int.MaxValue;

            int[,] dp = new int[V, V];
            for (int i = 0; i < V; i++)
            {
                for (int j = 0; j < V; j++)
                {
                    if (i != j) dp[i, j] = INF;
                }
            }

            for (int i = 0; i < E; i++)
            {
                var input = ReadInt();
                int s = input[0];
                int t = input[1];
                int d = input[2];
                dp[s, t] = d;   //■有向グラフ
            }

            bool negativeCycle = false;
            for (int k = 0; k < V; k++)
            {
                for (int i = 0; i < V; i++)
                {
                    for (int j = 0; j < V; j++)
                    {
                        if (dp[i, k] == int.MaxValue || dp[k, j] == int.MaxValue) continue;
                        dp[i, j] = Math.Min(dp[i, j], dp[i, k] + dp[k, j]);
                    }

                    if (dp[i, i] < 0) negativeCycle = true;
                }
            }
            if (negativeCycle)
            {
                Console.WriteLine("NEGATIVE CYCLE");
            }
            else
            {
                for (int i = 0; i < V; i++)
                {
                    for (int j = 0; j < V; j++)
                    {
                        if (dp[i, j] != INF) Console.Write(dp[i, j]);
                        else Console.Write("INF");

                        if (j != V - 1) Console.Write(" ");
                    }
                    Console.WriteLine();
                }
            }
            Console.ReadKey();
        }

        static int[] ReadInt()
        {
            int[] ret = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return ret;
        }
        static long[] ReadLong()
        {
            long[] ret = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return ret;
        }
    }
}



Measured memory_bytes: 20460
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;


using namespace std;

#define debug(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(int i=0;i<(int)(n);i++)
#define foi(i,k,n) for(int i=(k); i<(int)(n); i+=1)
#define fod(i,n,k) for(int i=k; i>=(int)n; i-=1)
#define fast_io ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define endl "\n"

#define int long long
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

#define fir first
#define sec second
#define pb push_back
#define mp make_pair

typedef long long llint;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<llint> VL;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MII;
typedef set<int> SI;
string tostr(int n) {stringstream rr;rr<<n;return rr.str();}
llint toint(string s) {stringstream ss(s); llint x; ss >> x; return x;}
//typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//gp_hash_table<string, llint> table;


//int mpow(llint base, llint exp) {
  //base %= MOD;
  //llint result = 1;
  //while (exp > 0) {
    //if (exp & 1) result = ((llint)result * base) % MOD;
    //base = ((llint)base * base) % MOD;
    //exp >>= 1;
  //}
  //return result;
//}


//void makegraph(int n, int m){
	//int i, u, v;
	//while(m--){
		//cin>>u>>v;
		//u--, v--;
		//g[u].pb(v);
		//g[v].pb(u);
	//}
//}

//void dfs(int u, int par){
	//for(int v:g[u]){
		//if (v == par) continue;
		//dfs(v, u);
	//}
//}


// ------------------------------------------------------------------ILB----------------------------------------------------------------  //



void solve(){
	int x;
	cin >> x;
	cout << (x ^ 1);
}




int32_t main() {
	fast_io;
    int t = 1;
    //cin >> t;
    //int xx = 0
    while(t--) {
		//xx++;
		//cout << "Case ";
      solve();
    }
    return 0;
}



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

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	rep(i,n) cin >> a[i];
	rep(i,n) cin >> b[i];
	int maxim = 0;
	rep(i,n){
		int sum = 0;
		rep(j,i+1){
			sum += a[j];
		}
		for(int k = i; k < n; k++){
			sum += b[k];
		}
		maxim = max(maxim, sum);
	}
	cout << maxim << endl;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

const int MOD = 1000000007;

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

    int ans = S.size();
    rep(i, 2) {
        int cnt = 0; // 変える必要のあるタイルの数
        rep(j, S.size()) {
            // (char) (0 + '0') => '0'
            // (char) (1 + '0') => '0'
            if (j % 2 == 0 && S[j] != (char) (i + '0')) cnt++;
            if (j % 2 == 1 && S[j] == (char) (i + '0')) cnt++;
        }
        ans = min(ans, cnt);
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,x;
  cin>>n;
  x=0;
  vector<int>a(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
    if(i%2==0){
      if(a.at(i)%2==1){
        x++;
      }
    }
  }
  cout<<x<<endl;
}

Measured memory_bytes: 3632
/*

import "core"
import "procon"

fn main() {
  n := read_int()
  sold := n * 800
  bonus := cast[Int](n / 15) * 200
  println(sold - bonus)
}

main()

*/

#include "stdbool.h"
#include "stdint.h"
#include "math.h"
#include "stdio.h"
#include "string.h"
#include "inttypes.h"


struct core_string_String {
char* p;
int64_t len;
};
struct Array1024_core_prelude_Char { char data[1024]; };



bool core_prelude_true;
bool core_prelude_false;
bool core_definitions_is_windows;
bool core_definitions_is_compiletime;
bool core_definitions_is_runtime;
bool core_definitions_is_jscodegen;
float core_math_M_PI;
void* core_pointer_nullGG_() {
void* core_pointer_tmpid27 = ((void*)(0));
return core_pointer_tmpid27;
}
void* core_pointer_null;
char* core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(char* core_pointer_p, int64_t core_pointer_i) {
return ((char*)((((int64_t)(core_pointer_p)) + core_pointer_i)));
}
char core_string_getGG_core_prelude_CString_core_prelude_Int(char* core_string_cs, int64_t core_string_i) {
char core_string_tmpid28 = (*(core_pointer_plusexclGcore_prelude_CharG_core_pointer_Ptr_core_prelude_Char_core_prelude_Int(((char*)(core_string_cs)), core_string_i)));
return core_string_tmpid28;
}
char core_string_charGG_core_prelude_Int(int64_t core_string_c) {
char core_string_tmpid30 = ((char)(core_string_c));
return core_string_tmpid30;
}
char core_string_cr;
char core_string_lf;
int64_t procon_read_intGG_() {
int64_t procon_ret;
scanf("%" PRId64, &procon_ret);
int64_t procon_tmpid46 = procon_ret;
return procon_tmpid46;
}
bool procon_is_debug;
void a_mainGG_() {
int64_t a_n = procon_read_intGG_();
int64_t a_sold = (a_n * 800);
double __floritmp0 = (((double)(a_n)) / ((double)(15)));
int64_t a_bonus = (((int64_t)(__floritmp0)) * 200);
printf("%lld", (a_sold - a_bonus));
;
;
printf("%s", "\n");
;
;
;
}

void flori_main() {
core_prelude_true = 1;
core_prelude_false = 0;
core_definitions_is_windows = 
#ifdef _WIN32
#define is_windows true
#elif _WIN64
#define is_windows true
#else
#define is_windows false
#endif
  is_windows;
core_definitions_is_compiletime = 
#ifdef FLORI_COMPILETIME
#define is_compiletime true
#else
#define is_compiletime false
#endif
  is_compiletime;
core_definitions_is_runtime = !(core_definitions_is_compiletime);
core_definitions_is_jscodegen = 
#ifdef FLORI_JSCODEGEN
#define is_jscodegen true
#else
#define is_jscodegen false
#endif
  is_jscodegen;
core_math_M_PI = M_PI;
core_pointer_null = core_pointer_nullGG_();
core_string_cr = core_string_charGG_core_prelude_Int(13);
core_string_lf = core_string_charGG_core_prelude_Int(10);
procon_is_debug = core_prelude_true;
a_mainGG_();
}
int main(int argc, char** argv) { flori_main(); }


Measured memory_bytes: 128
#include<stdio.h>

int main(){
	
	int a, o, j, i, z, u;
	
	scanf("%d", &a);
	
	for(o = 0; o < a; o++){
		
		scanf("%d%d%d", &i, &z, &u);
		
		if(i > z){
			
			if(i > u){
				
				if(i * i == z * z + u * u){
					
					printf("YES\n");
					
				}else{
					
					printf("NO\n");
					
				}
				
			}else{
				
				if(u * u == z * z + i * i){
					
					printf("YES\n");
					
				}else{
					
					printf("NO\n");
					
				}
				
			}
			
		}else if(z > i){
			
			if(z > u){
				
				if(z * z == i * i + u * u){
					
					printf("YES\n");
					
				}else{
					
					printf("NO\n");
					
				}
				
			}else{
				
				if(u * u == z * z + i * i){
					
					printf("YES\n");
					
				}else{
					
					printf("NO\n");
					
				}
				
			}
			
		}else{
			
			printf("NO\n");
			
		}
	}
	
    return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <string>
#include <set>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;
int main(){
    int n, m, x, y;
    string war = "War";
    cin >> n >> m >> x >> y;
    int xx[n];
    int yy[m];
    for(int i = 0; i < n; i++) cin >> xx[i];
    for(int i = 0; i < m; i++) cin >> yy[i];
    sort(xx, xx + n);
    sort(yy, yy + m);
    for(int i = -100; i <= 100; i++) {
        if (xx[n - 1] < i) {
            if (yy[0] >= i) {
                if (x < i) {
                    if (i <= y) {
                        war = "No War";
                    }
                }
            }
        }
    }
    cout << war << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
long mod=998244353,dp[4004][4004];
string s;
main()
{
	cin>>s;
	int cr=0,cb=0;
	dp[0][0]=1;
	for(int i=1;i<=s.size()*2;i++)
	{
		if(i<=s.size())
		{
			if(s[i-1]=='0')cr+=2;
			else if(s[i-1]=='1')cr++,cb++;
			else cb+=2;
		}
		for(int j=0;j<=i;j++)
		{
			dp[i][j]=((i-j<=cr&&j<=cb?dp[i-1][j]:0)+(j&&i-j<=cr&&j<=cb?dp[i-1][j-1]:0))%mod;
		}
	}
	cout<<dp[s.size()*2][cb]<<endl;
}

Measured memory_bytes: 123648
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define lint long long

using namespace std;

int main()
{
  vector<vector<int> > bingo(3,vector<int>(3));
  vector<vector<int> > judge(3,vector<int>(3,0));

  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      int a;
      cin >> a;
      bingo.at(i).at(j) = a;
    }
  }

  int n;
  cin >> n;

  for(int i=0;i<n;i++){
    int b;
    cin >> b;
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        if(b==bingo.at(i).at(j)){
          judge.at(i).at(j) = 1;
          break;
        }
      }
    }
  }

  bool flag = false;
  for(int i=0;i<3;i++){
    if(judge.at(i).at(0)+judge.at(i).at(1)+judge.at(i).at(2)==3||judge.at(0).at(i)+judge.at(1).at(i)+judge.at(2).at(i)==3){
      flag = true;
    }
  }
  if(judge.at(0).at(0)+judge.at(1).at(1)+judge.at(2).at(2)==3||judge.at(0).at(2)+judge.at(1).at(1)+judge.at(2).at(0)==3){
    flag = true;
  }

  if(flag){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
const long long INF = LLONG_MAX / 2;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(int i = (ll)(r); i < (ll)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ll long long int
using namespace std;
ll ans = 0, sum = 0, n, k, counter = 0, w, h;
string s;
vector<ll> v;
vector < pair<ll, ll > > vp;
vector<vector<ll> > vv(50, vector<ll>(50, INF));
vector<string> sv;

int main() {
	ll a, b;
	char y;
	char x = '+';
	cin >> a >> y >> b;
	if (y==x) {
		ans = a + b;
	}
	else {
		ans = a - b;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define the_flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
 
using namespace std;
 
int main()
{
    the_flash;
    string x;
    cin >> x;

    int sum = 0;
    for (int i = 0; i < x.size(); i++)
    {
        sum = sum * 10 + (x[i] - '0');
        sum = sum % 9;
    }

    if (sum)
        cout << "No" << "\n";
    else 
        cout << "Yes" << "\n";
    return 0;
}

Measured memory_bytes: 3720
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    max_A = max(A)
    counts = [0] * (max_A + 2)
    for a in A:
        if a > 0:
            counts[a-1] += 1
        counts[a] += 1
        counts[a+1] += 1
    print(max(counts))


if __name__ == '__main__':
    main()


Measured memory_bytes: 13964
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 1000000000000000000
#define int long long int

signed main(void)
{
    int flag = 0;
    int Q, H, S, D;
    int N;
    int sum = 0;
    int cost = 0;
    cin >> Q >> H >> S >> D;
    cin >> N;
    N *= 4;
    int A[4];
    A[0] = Q * 8;
    A[1] = H * 4;
    A[2] = S * 2;
    A[3] = D;
    int B[4] = {Q, H, S, D};
    int C[4] = {1, 2, 4, 8};
 
    do{
    for( int i = 3; i > 0; i--){
        for( int j = i-1; j >= 0; j--){
            if( A[i] > A[j] ) A[i] = INF;
        }
    }
    int min = 0;
    for( int i = 1; i < 4; i++){
        if( A[min] > A[i] ) min = i;
    }
    if( N > 2000 && flag == 0){
        sum += C[min]*((N-1000)/C[min]);
        cost += B[min]*((N-1000)/C[min]);
    }
    flag = 1;
    while( N > sum){
        sum += C[min];
        cost += B[min];
    }
    if ( N == sum) break;
    sum -= C[min];
    cost -= B[min];

    A[min] = INF;
}while( N != sum);

cout << cost << endl;
    


    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int wolves, sheeps;
  	cin>>sheeps>>wolves;
  	if(wolves==sheeps)cout<<"unsafe"<<endl;
  	else if(min(wolves, sheeps)==wolves)
      cout<<"safe"<<endl;
  	else cout<<"unsafe"<<endl;
}


Measured memory_bytes: 3636