akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;


long long int Exp(long long int exp_n,long long int exp_e, long long exp_mod);


int main(){
  int N,num=0;
  cin >> N;
  char X[N];
  for(int i=0;i<N;i++){
    cin >> X[i];
    if(X[i]=='1'){
      num++;
    }
  }
  
  int p[N],m[N];
  p[0]=1;
  m[0]=1;
  for(int i=1;i<N;i++){
    p[i]=p[i-1]*2;
    if(p[i]>(num+1)){
      p[i]=p[i]%(num+1);
    }
    //cout << p[i] << ",";
  }
  //cout << endl;
  if(num>1){
    for(int i=1;i<N;i++){
      m[i]=m[i-1]*2;
      if(m[i]>(num-1)){
        m[i]=m[i]%(num-1);
      }
      //cout << m[i] << ",";
    }
  }else{
    for(int i=0;i<N;i++){
      m[i]=0;
    }
  }
  //cout <<endl;
  
  int t[2];
  for(int i=0;i<2;i++){
    t[i]=0;
  }
  for(int i=0;i<N;i++){
    if(X[i]=='1'){
      t[0]=t[0]+m[N-i-1];
      t[1]=t[1]+p[N-i-1];
      if(t[0]>2*(num-1)){
        t[0]=t[0]-(num-1);
      }
      if(t[1]>2*(num+1)){
        t[1] = t[1]-(num+1);
      }
    }
  }
  
  //cout << t[0] <<endl;
  //cout << t[1] <<endl;
  //cout << t[2] <<endl;
  int n,count,proc,tmp;
  for(int i=0;i<N;i++){
    count=0;
    if(X[i]=='1'){
      proc=num-1;
      n=t[0]-m[N-1-i];
    }else{
      proc=num+1;
      n=t[1]+p[N-1-i];
    }
    if(proc==0){
      n=0;
    }else if(n==0){
      count = 1;
    }
    //cout << proc <<":" << n <<endl;
    while(n != 0){
      n = n%proc;
      tmp = n;
      proc = 0;
      while(tmp>0){
        if(tmp%2==1){
          proc++;
        }
        tmp=tmp/2;
      }
      count++;
    }
    
    cout << count <<endl;
  }
  
}


long long int Exp(long long int exp_n,long long int exp_e, long long int exp_mod){
  long long int exp_o = 1;
  long long int exp_x=exp_n;
  long long int exp_tmp;
  
  while(0<exp_e){
    exp_tmp = exp_e/2;
    if(exp_e - exp_tmp*2 == 1){
      exp_o = exp_o*exp_x;
      if(exp_o>exp_mod){
        exp_o=exp_o%exp_mod;
      }
    }
    
    exp_x = exp_x*exp_x;
    if(exp_x>exp_mod){
      exp_x=exp_x%exp_mod;
    }
    exp_e = exp_tmp;
  }
  return exp_o;
}


Measured memory_bytes: 5276
#include <stdio.h>
#define rep(i,l,r) for((i)=(l);(i)<(r);(i)++)
int main(){
    int n;
    scanf("%d",&n);
    int i,j,h[n],ans=1,max=0,pla,flag=1;
    rep(i,0,n){
        scanf("%d",&h[i]);
        if(max<=h[i]){
            max=h[i];
            pla=i;
        }
    }
    if(pla!=0){
    for(j=pla-1;j>0;j--){
    for(i=j-1;i>=0;i--){
        if(h[i]<=h[j])flag*=1;
        else flag*=0;
    }
        if(flag==1)ans++;
        flag=1;
    }
    }
    if(pla!=0)printf("%d",ans+1);
    else printf("1");
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main() {
    int n;
    while (true) {
        int count = 0;
        cin >> n;
        if (cin.eof()) {
            return 0;
        }
        for (int a = 0; a < 10; ++a) {
            for (int b = 0; b < 10; ++b) {
                for (int c = 0; c < 10; ++c) {
                    for (int d = 0; d < 10; ++d) {
                        if (a + b + c + d == n) {
                            ++count;
                        }
                    }
                }
            }
        }
        cout << count << endl;
    }
}

Measured memory_bytes: 1160
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (ll i = (ll)(a); i<(ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a), end(a)
#define TPL template
#define TNM typename

using ll = long long;
using ull = unsigned long long;
TPL<TNM T> using vec = vector<T>;
TPL<TNM T> using vec2 = vec<vec<T>>;
TPL<TNM T> using vec3 = vec<vec2<T>>;
TPL<TNM T> using vec4 = vec<vec3<T>>;
TPL<TNM T> using vec5 = vec<vec4<T>>;

TPL<TNM K, TNM V> using umap = unordered_map<K, V>;
TPL<TNM K, TNM V> using uset = unordered_set<K, V>;

TPL <class T = ll> inline T IN() { T x; cin >> x; return x; }
TPL<class T> inline void OUT(const T &x) { cout << x << "\n"; }
void YESNO(bool c) { OUT(c ? "YES" : "NO"); };
void YesNo(bool c) { OUT(c ? "Yes" : "No"); };
void bOUT(bool c, string s, string t) { OUT(c ? s : t); }
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(6); } } pre__;

TPL<TNM V, TNM H> void resize(vector<V>& v, const H h) { v.resize(h); }
TPL<TNM V, TNM H, TNM ... T> void resize(vector<V>& v, const H& h, const T ... t) { v.resize(h); for (auto& _v : v) resize(_v, t ...); }
TPL<TNM V, TNM T> void fill(V& x, const T& val) { x = val; }
TPL<TNM V, TNM T> void fill(vector<V>& vec, const T& val) { for (auto& v : vec) fill(v, val); }
TPL<TNM T> vector<T> make_v(size_t a) { return vector<T>(a); }
TPL<TNM T, TNM... Ts> auto make_v(size_t a, size_t b, Ts... ts) { return vector<decltype(make_v<T>(b, ts...))>(a, make_v<T>(b, ts...)); }

int main(void) {
	int A, B, C, K;
	cin >> A >> B >> C >> K;
	int mx = max({ A, B, C });
	int ans = A + B + C;
	ans -= mx;
	mx *= pow(2, K);
	OUT(ans + mx);
	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) throws Exception {
		
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(in.readLine());
		
		int K = Integer.parseInt(st.nextToken());
		int N = Integer.parseInt(st.nextToken());
		
		int[] nums = new int[2*N];
		
		st = new StringTokenizer(in.readLine());
		for(int i = 0; i < N; i++) {
			nums[i] = Integer.parseInt(st.nextToken());
			nums[i+N] = nums[i] + K;
		}
		
		int min = Integer.MAX_VALUE;
		for(int i = 0; i + N-1 < 2*N; i++) {
			min = Math.min(min, nums[i+N-1] - nums[i]);
		}
		
		System.out.println(min);
	}
}


Measured memory_bytes: 48732
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
res = [-1] * (n+1)
for i in range(n+1):
    if res[a[i]] == -1:
        res[a[i]] = i
    else:
        d = a[i]
        l, r = res[d], n-i


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range(2, n + 2):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod//i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


for i in range(1, n+2):
    print((cmb(n+1, i, mod)-cmb(l+r, i-1, mod)) % mod)


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

int main(){

  int b[11] = {63,6,91,79,102,109,125,39,127,111,0};
  int now = 11;
  int k;
  int n;
  int p;

  while(cin >> n){
    if(n == -1) break;
    
    for(int i=0;i<n;i++){
      cin >> k;
      if(i) p = (b[now]^b[k]);
      else p = b[k];
      for(int i=6;i>-1;i--) printf("%d", (p>>i)&1);
      printf( "\n" );
      now = k;
    }
  }

}

Measured memory_bytes: 1148
#include<bits/stdc++.h>
using namespace std;
int main()
{
    vector<int>a;
   int i,n,t,r,cnt=0,x,s=0;
   char ch[100];
     cin>>t>>n;
     for(i=0;i<t;i++)
     {
         cin>>r;
         a.push_back(r);
     }
     sort(a.begin(),a.end());
     for(x=0;x<n;x++)
     {
         s+=a[x];
     }
     cout<<s<<endl;
}


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

int main(void){
    int N,min,max;
    cin >> N;
    vector<int> color(9);
    for(int i = 0;i < 9;i++){
        color[i] = 0;
    }
    min = 0;
    max = 0;
    for(int i = 0;i < N;i++){
        int tmp;
        cin >> tmp;
        if(tmp >= 1 && tmp < 400){
            color[0]++;
        }else if(tmp >= 400 && tmp < 800){
            color[1]++;
        }else if(tmp >= 800 && tmp < 1200){
            color[2]++;
        }else if(tmp >= 1200 && tmp < 1600){
            color[3]++;
        }else if(tmp >= 1600 && tmp < 2000){
            color[4]++;
        }else if(tmp >= 2000 && tmp < 2400){
            color[5]++;
        }else if(tmp >= 2400 && tmp < 2800){
            color[6]++;
        }else if(tmp >= 2800 && tmp < 3200){
            color[7]++;
        }else if(tmp >= 3200 && tmp <= 4800){
            color[8]++;
        }
    }
    for(int i = 0;i < 9;i++){
        max = color[i] != 0 && i != 8 ? max + 1 : max;
        min = color[i] != 0 && i != 8 ? min + 1 : min;
    }
    max = color[8] + max;
    min = min != 0 ? min : 1;
    cout << min << " " << max << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int n,k;
    cin >> n >> k;
    ll ans = k;
    REP(i,n - 1){
        ans *= k - 1;
    }
    cout << ans << endl;
}

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


void pus(int i,int n, string s){
    if (i==(n-1)){
        cout << s << endl;
    }
}

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

  
    vector<string> ss{"a","b","c","d","e","f","g","h","i","j"};
    // vector<vector<string>> w(100, vector<string>(100));
    // vector<vector<int>> v(100, vector<int>(100));
    // w[0][0]="a";
    // v[0][0]=1;

    vector<string> a;
    vector<string> b;
    a.push_back("a");
    if(n==1){
        cout << a[0] << endl;
        return 0;
    }

    for(int i=1;i<n;i++){
        b.erase(b.begin(), b.end());
        for(int j=0;j<a.size();j++){
            for(int k=0;k<10;k++){
                b.push_back(a[j]+ss[k]);
                if(a[j].find(ss[k]) == std::string::npos){
                    // cout << ss[k] << endl;
                    break;
                }
            }
        }
        a = b;
        

    }

    
    for(int i=0;i<b.size();i++){
        cout << b[i] << endl;
    }

    // int ind;
    // for(int i=1;i<n;i++){
    //     ind=0;
    //     for(int j=0;j<w[i-1].size();i++){
    //         for (int k=0;k<=i;k++){
    //             w[i][ind] = w[i-1][j]+ss[k];
    //             v[i][ind] = v[i-1][j];
    //             pus(i,n,w[i][ind]);
    //             ind ++;
    //             if(w[i-1][j].find(ss[k]) != std::string::npos){
    //                 v[i][ind]++;
    //                 break;
    //             }
    //         }
    //     }
    // }

    // for (int i=0;i<len(w[n-1]);i++){
    //     cout <<w[n-1][i] << endl;
    // }

    // if(n==1){
    //     cout << "a" <<;
    // } else if (n==2){
    //     cout << "aa" << endl;
    //     cout << "ab" << endl;
    // }else if(n=3){
    //     cout << "aaa" << endl;
    //     cout << "aab" << endl;
    //     cout << "aba" << endl;
    //     cout << "abb" << endl;
    //     cout << "abc" << endl;
    // }
}

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

int main()
{
    int a,b,c,c1=1,c2=0,i,j;
    int x[3][3];
    for(i = 0; i < 3; i++)
    {
         for(j = 0; j < 3; j++)
         {
              cin>>x[i][j];
         }
    }
    cin>>c;
    int y[c];

    for(i = 0; i < c; i++)
     cin>>y[i];
     sort(y,y+c);

     if(binary_search(y,y+c,x[0][0]))
     {
          if(binary_search(y,y+c,x[1][1]))
          {
               if(binary_search(y,y+c,x[2][2]))
                    {
                         c2=1;
                         cout<<"Yes\n";
                    }
          }
     }
     if(c2!=1){
     if(binary_search(y,y+c,x[0][2]))
     {
          if(binary_search(y,y+c,x[1][1]))
          {
               if(binary_search(y,y+c,x[2][0]))
                    {
                         c2=1;
                         cout<<"Yes\n";
                    }
          }
     }
     }
     if(c2!=1){
     for(i = 0; i < 3; i++)
     {
          for(j = 0; j < 1; j++)
          {
               if(binary_search(y,y+c,x[i][j]))
               {
                    if(binary_search(y,y+c,x[i][j+1]))
                    {
                         if(binary_search(y,y+c,x[i][j+2]))
                         {
                              cout<<"Yes\n";
                              c2=1;
                              break;
                         }
                    }
               }

          }
          if(c2==1)
               break;
     }
     }
     if(c2!=1){
     for(i = 0; i < 1; i++)
     {
          for(j = 0; j < 3; j++)
          {
               if(binary_search(y,y+c,x[i][j]))
               {
                    if(binary_search(y,y+c,x[i+1][j]))
                    {
                         if(binary_search(y,y+c,x[i+2][j]))
                         {
                              cout<<"Yes\n";
                              c2=1;
                              break;
                         }
                    }
               }
         }
         if(c2==1)
          break;

     }

     if(c2!=1)
          cout<<"No\n";
     }
}




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

#define rep(i, n) REP(i, 0, n)
#define REP(i, k, n) for(auto i = k; i != n; i++)
#define rrep(i, n) RREP(i, n, -1)
#define RREP(i, n, k) for(auto i = n; i != k; i--)

#define debug(x) cerr << #x << " " << x << endl
#define print(x) cout << x;
#define println(x) cout << x << endl;
#define spc << " " <<

#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define ppf pop_front
#define ppb pop_back
#define eb emplace_back
#define np next_permutation

using ll = long long;
using Pii = pair<int, int>;
using Tiii = tuple<int, int, int>;
template<typename T>using V = vector<T>;
template<typename T>using VV = vector<vector<T>>;
using Vi = vector<int>;
using VVi = vector<vector<int>>;

struct State {
   ll ai, bi, ci;
   ll total;
   State(ll ai, ll bi, ll ci, const V<ll>& A, const V<ll>& B, const V<ll>& C):
      ai(ai), bi(bi), ci(ci), total(A[ai] + B[bi] + C[ci]) {};
};

bool operator < (const State& left, const State& right) {
   return left.total < right.total;
}

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

   int X, Y, Z, K; cin >> X >> Y >> Z >> K;
   V<ll> A(X), B(Y), C(Z);
   rep(i, X) cin >> A[i];
   rep(i, Y) cin >> B[i];
   rep(i, Z) cin >> C[i];

   sort(A.rbegin(), A.rend());
   sort(B.rbegin(), B.rend());
   sort(C.rbegin(), C.rend());

   priority_queue<State> heapq;
   heapq.emplace(0, 0, 0, A, B, C);
   int cnt = 0;

   V<V<V<bool>>> closed(X, V<V<bool>>(Y, V<bool>(Z, false)));

   while (cnt < K) {
      State state = heapq.top(); heapq.pop();

      if (closed[state.ai][state.bi][state.ci]) continue;
      closed[state.ai][state.bi][state.ci] = true;

      cout << state.total << endl;

      if (state.ai != X-1) {
         heapq.emplace(state.ai+1, state.bi, state.ci, A, B, C);
      }

      if (state.bi != Y-1) {
         heapq.emplace(state.ai, state.bi+1, state.ci, A, B, C);
      }

      if (state.ci != Z-1) {
         heapq.emplace(state.ai, state.bi, state.ci+1, A, B, C);
      }

      ++cnt;
   }

   return 0;
}


Measured memory_bytes: 180480
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll = long long;
const int INF = 1e9;
const int MOD = 1e9+7;

int main(){
    int n,a;
    cin>>n>>a;
    vector<ll> x(n+5);
    vector<vector<vector<ll>>> dat(60,vector<vector<ll>>(60,vector<ll>(3050)));
    rep(i,n) cin>>x[i+1];
    dat[0][0][0]=1;
    for(int i=1;i<=n;i++){
        for(int j=0;j<=i;j++){
            for(int k=0;k<=3000;k++){
                dat[i][j][k]+=dat[i-1][j][k];
                if(j>=1&&k-x[i]>=0)
                dat[i][j][k]+=dat[i-1][j-1][k-x[i]];
            }
        }
    }

    ll ans=0;
    for(int k=1;k<=n;k++){
        ans+=dat[n][k][k*a];
    }
    cout<<ans;
}


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

int main() {
  int n;
  cin >> n;
  
  float sum = 0;
  
  vector<float> a(n);
  for (int i=0; i<n; i++){
    cin >> a.at(i);
    a.at(i) = 1/a.at(i);
    sum += a.at(i);
  }
  
  float res;
  
  res = 1/sum;
  
  cout << res << endl;
  
}


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

using namespace std;

char s[200005];
int n,a,b,c,d;
bool ra[200005],rb[200005];

int main(){
//	freopen("A.in","r",stdin);
//	freopen("A.out","w",stdout);
	cin >> n >> a >> b >> c >> d;
	int i;
	ra[a] = rb[b] = 1;
	scanf("%s",s + 1);
	for(i = a;i <= n;i++){
		if(s[i] == '#' && s[i-1] == '#')break;
		ra[i] = 1;
	}
	for(i = b;i <= n;i++){
		if(s[i] == '#' && s[i-1] == '#')break;
		rb[i] = 1;
	}
//for(i = 1;i <= n;i++)cout<<ra[i]<<" ";cout<<endl;
//for(i = 1;i <= n;i++)cout<<rb[i]<<" ";cout<<endl;
	if(!ra[c] || !rb[d])puts("No");
	else if(c < d)puts("Yes");
	else{
		int blank = 0;
		bool bo = 0;
		for(i = b - 1;i <= d + 1;i++){
			if(s[i] == '.')blank++;else blank = 0;
			if(blank >= 3){
				bo = 1;
				break;
			}
		}	
		if(bo)puts("Yes");else puts("No");
	}
//	fclose(stdin);
//	fclose(stdout);
	return 0;
}

Measured memory_bytes: 768
#include <stdio.h>
int main(){
	int tate=0, yoko=0,a=0,b=0,d=0;
	int c[100][100]={0};
	int f[100]={0};
	scanf("%d %d", &tate, &yoko);
	if(tate<1 || yoko>100 )return 1;
	for(a=0;a<tate;a++){
		for(b=0;b<yoko;b++){
			
			scanf("%d", &c[a][b]);
		}
	}
	for(a=0;a<tate;a++){
		d=0;
		for(b=0;b<yoko;b++){
			printf("%d ", c[a][b]);
			d+=c[a][b];
			f[b]+=c[a][b];
		}printf("%d\n", d);
	}
	d=0;
	for(a=0;a<yoko;a++){
		d+=f[a];
		printf("%d ",f[a]);
	}
	printf("%d\n",d);

	
	scanf("%d", &a);

	return 0;
}

Measured memory_bytes: 648
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3e3+9;
int a[N],b[N],p;
int fac[N],inv[N];
void init(){
    fac[0]=fac[1]=inv[0]=inv[1]=1;
    for(int i=2;i<p;i++)fac[i]=fac[i-1]*i%p,inv[i]=(p-p/i)*inv[p%i]%p;
    for(int i=2;i<p;i++)inv[i]=inv[i]*inv[i-1]%p;
}
int C(int i,int j){
    return fac[i]*inv[j]%p*inv[i-j]%p;
}
int main(){
    cin>>p;init();
   // for(int i=1;i<=10;i++)cout<<fac[i]<<" "<<fac[i]*inv[i]%p<<endl;
    for(int i=0;i<p;i++)cin>>a[i];
    for(int i=0;i<p;i++)if(a[i]){
        b[0]++;
        int t=-1;if(p==2)t=1;
        for(int j=p-1;j>=0;j--){
            (b[j]+=t*C(p-1,j)%p)%=p;
            (t*=-i)%=p;
        }
    }
    for(int i=0;i<p;i++)cout<<(b[i]%p+p)%p<<" ";
    cout<<endl;
    return 0;
}


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


int main(){
	int a,b,c,x,cnt=0;
	cin >> a >> b >> c >> x;
	for(int i=0;i<=a;i++){
		for(int j=0;j<=b;j++){
			for(int k=0;k<=c;k++){
				if(500*i+100*j+50*k==x){
					cnt++;
				}
			}
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define mp make_pair
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using ll = long long;
using namespace std;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int C[3][3];
int main(){
    rep(i,3) rep(j,3) cin >> C[i][j];
    int val = C[0][0] + C[1][1] + C[2][2];
    bool flag = true;
    rep(i,3) rep(j,3) if(i<=j) {
        int c = 0;
        rep(k,3) c += C[(i+k)%3][(j+k)%3];
        if(c!=val) flag = false;
    } 
    if(flag) cout << "Yes" << '\n';
    else cout << "No" << '\n';
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i< 1<<n;i++)
    {
        cout<<i<<":";
        for(int j=0;j<n;j++)
        {
            if(i>>j & 1) cout<<" "<<j;
        }
        cout<<endl;
    }
}


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

string s,b[10]={" ","',.!?","abcABC","defDEF","ghiGHI","jklJKL","mnoMNO","pqrsPQRS","tuvTUV","wxyzWXYZ"};

string conv(int p,int t) {
    if(p==s.length()) return "";
    int c=0;
    while(p<s.length() && s[p]==t+'0')c++,p++;
    return string((t==0)?(c-1):1,b[t][(c-1)%(b[t].length())]) + conv(p,s[p]-'0');
}

int main() {
    while(cin>>s) cout<<conv(0,s[0]-'0')<<endl;
}

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

using namespace std;

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

int main() {
    ll n, m, i, j, k;
    cin >> n;
    vector<pair<ll, ll>> v(n);
    for(i = 0; i < n; i++) {
        cin >> v[i].first;
        v[i].second = i + 1;
    }
    sort(v.rbegin(), v.rend());

    multiset<ll> st;
    st.insert(0);
    st.insert(0);
    st.insert(n + 1);
    st.insert(n + 1);

    ll ret = 0;

    for(auto x : v) {
        ll num = x.first;
        auto it = st.lower_bound(x.second);
        ll L1, L2, R1, R2;
        R1 = *it++;
        R2 = *it--;
        it--;
        L2 = *it--;
        L1 = *it;

        ret += (L2 - L1) * (R1 - x.second) * num;
        ret += (x.second - L2) * (R2 - R1) * num;
        st.insert(x.second);
    }
    cout << ret << endl;
}

Measured memory_bytes: 6528
#(46)未提出者は誰だ?
a=[0]
for i in range(28):
     n=int(input())
     a.append(n)
a.append(31)
a.sort()
i=1
j=0
while True:
     if a[i]-a[j]>1:
          print(a[j]+1)
     i+=1          
     j+=1
     if i==30:
          break


Measured memory_bytes: 5600
n, k, q = list(map(int, input().split()))
a = [int(input()) for i in range(q)]
p = [k - q] * n
for i in range(q):
    p[a[i] - 1] += 1
for i in range(n):
    if(p[i] > 0):
        print('Yes')
    else:
        print('No')

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

using namespace std;

#define PB push_back
#define SZ(a) (int)a.size()
#define MP make_pair

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;

int main() {

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

	sort(A.begin(), A.end());

	int maxd = A[0]+K - A[N-1];
	for(int i = 1; i < N; i++) {
		maxd = max(maxd, A[i]-A[i-1]);
	}

	printf("%d\n", K-maxd);

	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}

map<ll,ll> p;

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

  ll N ;
  cin >> N;
  rep(i,N){
    ll inp;cin >> inp;
    p[inp]++;
  }

  ll M;
  cin >> M;
  rep(i,M){
    ll inp; cin >> inp;
    p[inp]--;
    if(p[inp]<0) {cout << "NO" << endl;return 0;}
  }
  cout << "YES " << endl;
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 12800
while True :
    H, W = map(int, input().split())
    if H == 0 and W == 0 :
        break
    
    for j in range(H) :
        for i in range(W) :
            if j == 0 or i == 0 or j == H - 1 or i == W - 1 :
                print("#", end = "")
            
            else :
                print(".", end = "")
        print()
    print()


Measured memory_bytes: 7000
N, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(N)]
def dfs(i, a, b, c):
    if i == N:
        if a == 0 or b == 0 or c == 0:
            return float('inf')
        else:
            return abs(A-a)+abs(B-b)+abs(C-c)-30
    four = dfs(i+1, a, b, c)
    one = dfs(i+1, a+l[i], b, c) + 10
    two = dfs(i+1, a, b+l[i], c) + 10
    three = dfs(i+1, a, b, c+l[i]) + 10
    return min(one, two, three, four)
print(dfs(0, 0, 0, 0))

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

int main() {
    int n;
    string s;
    cin >> n >> s;
    if(n == 1){
        cout << "No" << endl;
        return 0;
    }
    if(n % 2 != 0){
        cout << "No" << endl;
        return 0;
    }
    for (int i = 0; i < n/2; i++){
        if(s.at(i) != s.at(i+n/2)){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 256
import sys
from collections import Counter

input = sys.stdin.readline


def S():
    return input().rstrip()


def I():
    return int(input())


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


n = I()
al = list(MI())
q = I()

a = Counter(al)

s = sum(al)
for _ in range(q):
    b, c = MI()
    if b in a.keys():
        v = a.pop(b)
        if c in a.keys():
            a[c] += v
        else:
            a[c] = v
        s += (c - b) * v
    print(s)


Measured memory_bytes: 85692
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,n) for(int i = (a); i < (n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define debug_v(v,N) for(int i=0;i<N;i++) { cout << v[i] << " "; } cout << endl;
#define debug_vv(v,H,W) for(int i=0;i<H;i++) { for(int j=0;j<W;j++) { cout << v[i][j] << " "; } cout << endl; }

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

ll dp[105][100005];

void Main()
{
    int MOD = 1000000007;
    int N, K; cin >> N >> K;
    vi A(N);
    rep(i,N) cin >> A[i];
    rep(i,N + 1) {
        dp[i][0] = 1;
    }
    vector<vector<ll>> sums(N, vector<ll>(K + 2, 0));
    rep(i, K + 1) {
        sums[0][i + 1] = dp[0][i] + sums[0][i];
    }
    rep(i, N) {
        REP(j, 1, K + 1) {
            ll tmp = sums[i][j + 1] - sums[i][j - A[i] >= 0 ? j - A[i] : 0];
            tmp %= MOD;
            if (tmp < 0) tmp += MOD;
            dp[i + 1][j] = tmp;
        }
        if (i == N - 1) break;
        rep(j, K + 1) {
            sums[i + 1][j + 1] = (dp[i + 1][j] + sums[i + 1][j]) % MOD;
        }
    }
    cout << dp[N][K] << endl;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 157808
#include<stdio.h>
int main(){
	int y[10],i,t[3]={0,0,0};
	for(i=0;i<10;i++){
		scanf("%d",&y[i]);
	}
	for(i=0;i<10;i++){
		if(t[0]<y[i]){
			t[2]=t[1];
			t[1]=t[0];
			t[0]=y[i];
		}else if(t[1]<y[i]){
			t[2]=t[1];
			t[1]=y[i];
		}else if(t[2]<y[i]){
			t[2]=y[i];
		}
	}
	printf("%d\n%d\n%d\n",t[0],t[1],t[2]);
	return 0;
}

Measured memory_bytes: 1820
def resolve():
    n, k, q = map(int, input().split())
    points = [k] * n
    for _ in range(q):
        temp = int(input())
        points[temp - 1] += 1
    points = map(lambda x: x - q, points)
    for i in points:
        if i <= 0:
            print('No')
            continue
        print('Yes')
resolve()

Measured memory_bytes: 11772
#include <bits/stdc++.h>
#define Maxn 100007
using namespace std;
int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int n,ans=0;
int a[Maxn],l,r,q=0;
int main()
{
	n=read();
	for (int i=1;i<=n;i++)
		a[i]=read();
	for (int i=1;i<=n;i++)
	{
		int now=a[i];
		l=0;
		while (now>1)
		{
			++l;
			now/=2;
		}
		if (a[i]!=(1<<l)) r=1; else r=0;
		if (l>q) ans+=l-q; if (l<q) r=0;
		q=l;
		if (r==1)
		{
			++ans;
			++q;
		}
	}
	printf("%d\n",ans);
	return 0;
}


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair


int main() {
  int n;
  cin >> n;
  vl a(n);
  rep (i, n) {
    cin >> a[i];
  }
  vll dp(n + 1, vl(n + 1));
  rep (i, n + 1) {
    dp[i][i] = 0;
  }
  bool turn = n % 2;
  for (int len = 1; len <= n; len++) {
    rep (i, n) {
      int j = i + len;
      if (j > n) break;
      ll temp;
      if (turn) {
        temp = -INF;
        chmax(temp, dp[i + 1][j] + a[i]);
        chmax(temp, dp[i][j - 1] + a[j - 1]);
      }
      else {
        temp = INF;
        chmin(temp, dp[i + 1][j] - a[i]);
        chmin(temp, dp[i][j - 1] - a[j - 1]);
      }
      dp[i][j] = temp;
    }
    turn = !turn;
  }
  cout << dp[0][n] << endl;
}


Measured memory_bytes: 70784
import java.util.Scanner;
import java.io.*;
import java.util.Arrays;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int k= sc.nextInt();
		int cnt = 0;
		while(true) {
			if(a >= b) {
				b *= 2;
				++cnt;
			}
			if(a < b || cnt > k) {
				break;
			}
		}
		while(true) {
			if(b >= c) {
				c *= 2;
				++cnt;
			}
			if(b < c || cnt > k) {
				break;
			}
		}
		if(cnt > k) {
			System.out.println("No");
		}else {
			System.out.println("Yes");
		}
	}
	
}


Measured memory_bytes: 27036
#include<stdio.h>
#include<stdlib.h>

int dice[120][6];
int i,j,k,t,clear=0;

int ue=1;
int hid=4;
int mig=3;
int mae=2;
int usi=5;
int sit=6;

void Move2(int j,int k);
void rndMove();
void eMove();
void nMove();
void sMove();
void wMove();

int main(){
	int n;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		for(j=0;j<6;j++){
			scanf("%d",&dice[i][j]);
		}
	}
	for(j=0;j<n-1;j++){
		for(k=j+1;k<n;k++){
			Move2(j,k);
		}
	}
	
	if(clear==1)printf("No\n");
	else printf("Yes\n");
	
	return 0;
}

void Move2(j,k){
	for(i=0;i<5000;i++){
		rndMove();
		
		if((dice[j][0]==dice[k][ue-1])&&(dice[j][1]==dice[k][mae-1])&&
			(dice[j][2]==dice[k][mig-1])&&(dice[j][3]==dice[k][hid-1])&&
			(dice[j][4]==dice[k][usi-1])&&(dice[j][5]==dice[k][sit-1])){
			clear=1;
			break;
		}
	}
	return;
}

void rndMove(){
	int rnd=rand()%4;
		
	if(rnd==0)eMove();
	else if(rnd==1)nMove();
	else if(rnd==2)sMove();
	else wMove();
	
	return;
}

void eMove(){
	t=ue;
	ue=hid;
	hid=sit;
	sit=mig;
	mig=t;
	return;
}

void nMove(){
	t=ue;
	ue=mae;
	mae=sit;
	sit=usi;
	usi=t;
	return;
}

void sMove(){
	t=ue;
	ue=usi;
	usi=sit;
	sit=mae;
	mae=t;
	return;
}

void wMove(){
	t=ue;
	ue=mig;
	mig=sit;
	sit=hid;
	hid=t;
	return;
}


Measured memory_bytes: 2100
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#define pb push_back
using namespace std;

int main(void){
  int i,n;
  vector<int> res;
  int t;
  cin>>n;
  for(i=0;i<n;i++){
    cin>>t;
    if(i%2){
      res.pb(t);
    }
    else{
      res.insert(res.begin(),t);
    }
  }
  if(n%2==0){
    for(i=n-1;i>=0;i--){
      i==0?cout<<res[i]<<endl:cout<<res[i]<<" ";
    }
  }
  else{
    for(i=0;i<n;i++){
      i==n-1?cout<<res[i]<<endl:cout<<res[i]<<" ";
    }
  }
  return 0;
}

Measured memory_bytes: 3060
//#####   #####   #####   #####   #####   #       #####   #   #//
//#   #   #   #   #       #       #   #   #       #   #   ## ##//
//#####   #####   #####   #       #####   #       #####   # # #//
//##      #   #       #   #       #   #   #       #   #   #   #//
//# #     #   #       #   #       #   #   #       #   #   #   #//
//#  #    #   #       #   #       #   #   #       #   #   #   #//
//#   #   #   #   #####   #####   #   #   #####   #   #   #   #//


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ppb pop_back
#define cs(n) cout<<n<<" "
#define cn(n) cout<<n<<"\n"
#define rep(i,j,k) for(ll i=j;i<k;i++)
#define rrep(i,j,k) for(ll i=j;i>=k;i--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll bin(ll a, ll b, ll mod)
{
	if (b == 0)
		return 1;
	if (b % 2 == 0)
		return bin((a * a) % mod , b / 2 , mod) % mod;
	return ((a % mod) * (bin((a * a) % mod , b / 2 , mod) % mod)) % mod;
}
void solve()
{
	ll n;
	double d;
	cin >> n >> d;
	ll c = 0;
	rep(i, 0, n) {
		ll x, y;
		cin >> x >> y;
		double dist = sqrt(x * x + y * y);
		if (dist <= d) {
			c++;
		}
	}
	cout << c;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif
	fastio;
	ll t;
	t = 1;
	//cin>>t;
	while (t--)
	{
		solve();
	}
#ifndef ONLINE_JUDGE
	cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
	return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

ll N, K;
ll a[101];
ll dp[101][101010];

ll rec(ll i, ll j){
	if(dp[i][j]>=0) return dp[i][j];
	if(i==0){
		if(j==K) return 1;
		else return 0;
	}
	ll res = 0;
	REP(k, a[i-1]+1){
		if(j+k<=K) res += rec(i-1, j+k);
		res %= mod;
	}
	dp[i][j] = res;	
	return res;
}

int main(){
	cin >> N >> K;
	REP(i, N) cin >> a[i];
	REP(i, 101)REP(j, 101010) dp[i][j] = 0;

	dp[0][K] = 1;
	REP(i, N){
		REP(j, 101000){
			dp[i+1][max(j-a[i], 0ll)] += dp[i][j];
			dp[i+1][max(j-a[i], 0ll)] %= mod;
			dp[i+1][j+1] -= dp[i][j];
			dp[i+1][j+1] += mod;
			dp[i+1][j+1] %= mod;
		}
		REP(j, 101000){
			dp[i+1][j+1] += dp[i+1][j];
			dp[i+1][j] %= mod;
		}
	}
	cout << dp[N][0] << endl;
    return 0;
}

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


using namespace std;
long long a[100005];
int cmp(int x,int y) {


   return x>y;
}
int main() {

    int n;
    cin>>n;
    string a,b;
    cin>>a>>b;
    int flag=0;
    long long ans=1;
    for(int i=0;i<n;i++) {
        if(flag==0) {
            if(a[i]==b[i]) {
             ans*=3;
             ans%=1000000007;
             flag=1;
            }

           else {
            ans*=6;
            ans%=1000000007;
            flag=2;
            i++;
           }
           continue;
        }


        if(flag==1) {
           if(a[i]==b[i]) {
            ans*=2;
            ans%=1000000007;
            flag=1;
           }
           else {
            ans*=2;
            ans%=1000000007;
            flag=2;
            i++;
           }
           continue;

        }
        if(flag==2) {
            if(a[i]==b[i]) {
                flag=1;

            }
            else {
                ans*=3;
                ans%=1000000007;
                flag=2;
                i++;
            }
        }
        continue;

    }


    cout<<ans%1000000007<<endl;

    return 0;
}


Measured memory_bytes: 256
def ok(i, D):
    for n in range(D):
        if i == 0 or i % 100 != 0:
            return False
        i = int(i / 100)
    if i % 100 != 0:
        return True
    return False


D, N = map(int, input().split())

i = 1
count = 0
while count < N:
    # iが100でちょうどD回割り切れる？
    if ok(i, D):
        count += 1
    i += 1
print(i - 1)


Measured memory_bytes: 3060
#include <iostream>
#include <string>

using namespace std;

int main () {
    string S, T;

    cin >> S >> T;

    for(int i = 0; i < S.size(); i++) {
        if(S[i] != T[i]) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 3624
N = int(input())
from math import log

max6 = int(log(N, 6))
max9 = int(log(N, 9))
dp = [10**18]*(N+1)
dp[0] = 0
for i in range(1, N+1):
    dp[i] = dp[i-1]+1
    for j in range(max6+2):
        if 6**j>i:
            break
        dp[i] = min(dp[i-6**j]+1, dp[i])
    for k in range(max9+2):
        if 9**k>i:
            break
        dp[i] = min(dp[i-9**k]+1, dp[i])

print(dp[-1])

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


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

	int r = X % 100;
	int q = X / 100;

	if(r <= q * 5){
		cout << 1 << endl;
	}
	else{
		cout << 0 << endl;
	}
		

	return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var dishes = new int[]{
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()),
                int.Parse(Console.ReadLine()) }
            .Select(x => new { t = x, u = ((x + 9) / 10) * 10 })
            .OrderByDescending(x => x.u - x.t);

            Console.WriteLine(dishes.Skip(1).Select(x => x.u).Sum() + dishes.First().t);
        }
    }
}


Measured memory_bytes: 13524
l=raw_input()
k=l.split()
k.sort()
f=0
#
while f==0:
        a=int(k[0])
        b=int(k[1])
        if a==b==0:
                break
        else:
                if a<b:
                        print a,b
                else:
                        print b,a
        l=raw_input()
        k=l.split()
        k.sort()

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i_len=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back
#define mp make_pair

int main()
{
    ll W, H, x, y;
    cin >> W >> H >> x >> y;

    cout << setprecision(12) << W * H / 2.0 << " ";
    if(x * 2 == W && y * 2 == H) PR(1);
    else PR(0);

    return 0;
}

/*



*/

Measured memory_bytes: 256
import sys
import os
if sys.platform=="darwin":
	base = os.path.dirname(os.path.abspath(__file__))
	name = os.path.normpath(os.path.join(base, '../Documents/input.txt'))
	#print(name)
	sys.stdin = open(name)

a,b = map(int,input().split())

ans = 1

if a > 0 and b > 0:
	print("Positive")
elif a <= 0 and b >=0:
	print("Zero")
else:
	if (a-b)%2 == 0:
		print("Negative")
	else:
		print("Positive")



Measured memory_bytes: 38576
import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

alias tuple = Tuple!(long,long,long);

void main() {
  long n = readln.chomp.to!long;
  long[] a = readln.chomp.split.to!(long[]);
  long[long] l;
  long[long] r;
  for(long i=0; i<n; i++) {
    l[i+1+a[i]]++;
    r[i+1-a[i]]++;
  }
  long result = 0;
  foreach(k;l.byKey) {
    result += l[k]*r.get(k, 0);
  }
  result.writeln;
}


Measured memory_bytes: 37400
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
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; }
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;}

int main(){
  int X, Y; cin >> X >> Y;
  for(int c=0;c<1000;c++){
    for(int t=0;t<1000;t++){
      if(c+t==X && c*2+t*4==Y){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3636
// by Balloons
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)

using namespace std;

typedef long long LL;

const int inf = 1e9,maxn=2e5+5;
int n,m;
struct po{int x,y,ty;}p[maxn],q[maxn];
int g[205][205],vis[2005],lk[2005];
int dfs(int x){
	for(int i=1;i<=100;i++){
		if(g[x][i] && !vis[i]){
			vis[i]=1;
			if(!lk[i] || dfs(lk[i])){lk[i]=x;return 1;}
		}
	}
	return 0;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d%d",&p[i].x,&p[i].y);
	for(int i=1;i<=n;i++)scanf("%d%d",&q[i].x,&q[i].y);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			if(p[i].x <= q[j].x && p[i].y <= q[j].y)g[i][j] = 1;
	int ans=0;for(int i=1;i<=n;i++,memset(vis,0,sizeof vis))
		if(dfs(i))++ans;
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 2432
n=int(input())
check1=[[i,i,0] for i in range(1,10)]
check2=[[i,j,0] for i in range(1,10) for j in range(i+1,10)]
l=len(check2)
check3=[[check2[i][1],check2[i][0],0] for i in range(l)]

for i in range(1,n+1):
    s=str(i)
    s1=int(s[0])
    s2=int(s[-1])
    if s2!=0:
        if s1==s2:
            check1[s1-1][2]+=1
        elif s1<s2:
            x=[0,8,15,21,26,30,33,35]
            check2[x[s1-1]+(s2-s1-1)][2]+=1
        else:
            x=[0,8,15,21,26,30,33,35]
            check3[x[s2-1]+(s1-s2-1)][2]+=1
cnt=0
for i in range(9):
    cnt+=(check1[i][2])*(check1[i][2])
for i in range(l):
    cnt+=2*(check2[i][2]*check3[i][2])
print(cnt)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
#define vecout(V) for(int i=0;i<V.size();i++) {cout<<V[i]<<endl;}

ll INF=1e15;

int main(void){
    int n;
    cin>>n;
    vector<ll> v(n);
    rep(i, n) cin>>v[i];
    vector<ll> max_vec;
    rep(i, n){
        auto itr = lower_bound(max_vec.rbegin(), max_vec.rend(), v[i]);//lower_boundは配列の要素のポインタを返す関数
        if (itr == max_vec.rbegin()) {
            max_vec.push_back(v[i]);
        } else {
            --itr;
            *itr = v[i];
        }
    }
    int ans=max_vec.size();
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 2168
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
using namespace std;

int main(){
    string s;
    cin >> s;
    int count = 0;
    for(auto c: s){
        if(c == 'o'){
            count++;
        }
    }
    if(count+(15-s.size()) >= 8){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define pb push_back 
const int M=1000000007;
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int modpow(int x, int n , int m)
{
 if(n==0)
  return 1;
 else if(n%2==0)
  return modpow((x*x)%m,n/2,m);
 else
  return (x*modpow((x*x)%m,n/2,m))%m;
}
signed main()
{
  fastio;
  int t=1;
  //cin>>t;
  while(t--)
  {
    int n,zero=0,flag=0;
    cin>>n;
    int arr[n];
    map<int,int> mp;
    for(int i=0;i<n;i++)
    {
      cin>>arr[i];
      mp[arr[i]]++;

      if(arr[i]==0)
        zero++;

      if(mp[arr[i]]>2)
        flag=1;
    }

    for(auto x:mp)
    {
      if(x.first && x.second!=2)
      {
        flag=1;
        break;
      }
    }

    if(flag || (n&1 && zero>1))
    {
      cout<<"0";
      return 0;
    }

    if(n%2==0 && zero!=0)
    {
      cout<<"0";
      return 0;
    }
    
    if(n%2==0)
      cout<<modpow(2,n/2,M);
    else
    {
      n--;
      cout<<modpow(2,n/2,M);
    }
  }
  return 0;
}


Measured memory_bytes: 8296
n,m,q = map(int,input().split())
abcd = [list(map(int,input().split())) for i in range(q)]
ls = [1]
ans=0
def dfs(n,m,i,ls,abcd):
    global ans
    temp=0
    if len(ls)==n:
        for j in abcd:
            if ls[j[1]-1] - ls[j[0]-1] == j[2]:
                temp+=j[3]
        ans=max(ans,temp)
    else:
        for j in range(i,m+1):
            dfs(n,m,j,ls+[j],abcd)
dfs(n,m,1,ls,abcd)
print(ans)

Measured memory_bytes: 9204
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

signed main() {
    int n, m;
    cin >> n >> m;
    priority_queue<pair<int, int>> p;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        p.emplace(x, 1);
    }
    for (int i = 0; i < m; i++) {
        int b, c;
        cin >> b >> c;
        p.emplace(c, b);
    }
    int ans = 0;
    int cnt = 0;
    int pos = 0;
    while (cnt < n) {
        auto x = p.top();
        p.pop();
        if (cnt + x.second <= n) {
            ans += x.first * x.second;
            cnt += x.second;
        }
        else {
            ans += x.first * (n - cnt);
            cnt = n;
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 6512
#include "bits/stdc++.h"
using namespace std;

#define db(x) cerr << #x << " == " << x << endl
#define all(container) container.begin(), container.end()
#define mp(i,j) make_pair(i,j)
#define pb push_back

typedef pair<int,int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<pii> vii;

template<typename T>
void print_vector_debug(const T& t) {
	cout << "[DEBUG] VECTOR:";
	for (auto i = t.cbegin(); i != t.cend(); ++i) {
		if ((i + 1) != t.cend()) {
			cout << *i << " ";
		} else {
			cout << *i << endl;
		}
	}
}
#define MAXN 105
#define MAXW 100005
#define INF 2000000000

int N, W;
ll vals[MAXN], w[MAXN];
int vis[MAXN][MAXW];
ll dp[MAXN][MAXW];


ll solve(int idx, int used)
{
	if (used > W)
	{
		return -INF;
	}
	
	if (idx == N)
	{
		return 0;
	}
	
	if (vis[idx][used])
	{
		return dp[idx][used];
	}
	vis[idx][used] = 1;
	
	ll res = max(solve(idx + 1, used), solve(idx + 1, used + w[idx]) + vals[idx]);
	dp[idx][used] = res;
	
	return res;
}

int main() 
{
	scanf("%d%d", &N, &W);
	
	for (int i = 0; i < N; i++)
	{
		scanf("%lld%lld", &w[i], &vals[i]);
	}
	
	printf("%lld\n", solve(0, 0));
	
	return 0;
}


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

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

int main()
{
    int N;
    cin >> N;
    int one = 0;
    if(N <= 9){
        one = N;
    }else if(N <= 99){
        one = N - (N / 10) * 10;
    }else{
        int tmp = N - (N / 100) * 100;
        one = tmp - (tmp / 10) * 10;
    }

    if(one == 2 || one == 4 || one == 5 || one == 7 || one == 9){
        cout << "hon" << endl;
    }else if(one == 0 || one == 1 || one == 6 || one == 8){
        cout << "pon" << endl;
    }else{
        cout << "bon" << endl;
    }
}



Measured memory_bytes: 3624