akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
using namespace std;

int main(){
  int n;
  int *a;
  int num=0;
  
  cin >> n;
  if((a=(int*)malloc(sizeof(int)*n))==NULL){
    printf("****Allocation ERROR***\n");
    exit(1);
  }
  
  rep(i,n){
    cin >> a[i];
  }
  do{
    int counter=0;
    rep(i,n){
      if(a[i]%2==0) counter++;      
    }
    if(counter==n){
      rep(i,n) a[i] /= 2;
      num++;
    }
    else break;
  }while(1);
  
  cout << num << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define x first
#define y second
using namespace std;
const int N = 1e6 + 10, Mod = 1e9 + 7;
int n, m, q, r, t, a, b, c, d, A[N];
int main()
{
    cin >> A[0] >> A[1] >> A[2] >> A[3];
    sort(A, A + 4);
    if (A[0] == 1 && A[1] == 4 && A[2] == 7 && A[3] == 9)
        return !printf("YES");
    printf("NO");
    return (0);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef pair<lli, lli> pii;
int main(){
  lli w, h;
  std::cin >> w >> h;
  vector<lli> p(w), q(h);
  lli a = w, b = h;
  vector<pii> hoge(w + h);
  for (int i = 0; i < w; i++) {
    std::cin >> p[i];
    hoge[i] = pii(p[i], 0);
  }
  for (int i = 0; i < h; i++) {
    std::cin >> q[i];
    hoge[w + i] = pii(q[i], 1);
  }
  lli ans = 0;
  sort(hoge.begin(), hoge.end());
  for (int i = 0; i < hoge.size(); i++) {
    if(hoge[i].second == 0){
      if(a == 0)continue;
      a--;
      ans += hoge[i].first*(b + 1);
    }else{
      if(b == 0)continue;
      b--;
      ans += hoge[i].first*(a + 1);
    }
  }
  std::cout << ans << std::endl;
  return 0;
}



Measured memory_bytes: 5120
#if 0

#endif

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void p(A a){cout << (a) << endl;}
template<class A,class B>void p(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void p(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void p(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for copy
// for(int i=0;i<N;++i) {

int main(void) {
  string s;cin>>s;
  int n = s.length();
  string bef_s = "";
  string aft_s = "";
  if(n%2==0) {
    bef_s = s.substr(0,n/2);
    aft_s = s.substr(n/2,n/2);
    reverse(aft_s.begin(), aft_s.end());
  } else {
    bef_s = s.substr(0,(n-1)/2);
    aft_s = s.substr((n+1)/2,(n-1)/2);
    reverse(aft_s.begin(), aft_s.end());
  }
  int cnt = 0;
  REP(i,bef_s.length()) {
    if(bef_s[i]!=aft_s[i]) cnt++;
  }
  p(cnt);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int s[10000000],s3[10000000]={0};
int main(){
	int n,i;
	int max=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&s[i]);
		s3[s[i]]++;
		s3[s[i]+1]++;
		s3[s[i]-1]++;
	}
	for(i=0;i<10000000;i++){
		if(s3[i]>max)max=s3[i];
	}
	printf("%d",max);
	
}

Measured memory_bytes: 2688
// KNOW NOTHING!
#include <bits/stdc++.h>
#define ll long long int
#define F(i,j,k,in) for(int i=j;i<k;i+=in)
#define DF(i,j,k,in) for(int i=j;i>=k;i-=in)
#define feach(it,l) for (auto it = l.begin(); it != l.end(); ++it)
#define fall(a) a.begin(),a.end()
#define sz(x) (int)x.size()
#define szs(x) (int)s.length()
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define eq equal_range
#define fs first
#define ss second
#define ins insert
#define mkp make_pair
#define endl "\n"
using namespace std;
typedef vector<ll> vll;
typedef vector<int> vin;
typedef vector<char> vch;
typedef vector<string> vst;
typedef set<ll> sll;
typedef set<int> sint;
typedef set<char> sch;
typedef set<string> sst;
typedef queue<ll> qll;
typedef queue<int> qin;
typedef deque<ll> dqll;
typedef deque<int> dqint;
typedef priority_queue<ll> pqll;
typedef priority_queue<int> pqin;
typedef map<ll,ll> mpll;
typedef map<int,int> mpin;
typedef pair<ll,ll> pll;
typedef pair<int,int> pin;
const ll MOD=1000000007;
const long double PI=3.1415926535897932384626433832795;
ll pwr(ll b,ll p){ll res=1;while(p){if(p&1) {res*=b; p--;}else{b*=b; p>>=1;}}return res;}

int main()
{
/*
freopen ("input.txt","r","stdin");
freopen ("output.txt","w","stdout");
*/
ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL);
ll n; cin>>n;
vin A (n);
F (i,0,n,1) cin>>A[i];
sort (fall(A)); reverse (fall(A));
ll ans = A[0];
int  j=1;
int go = (n-2)/2+1;
F (i,1,go,1) {
	ans+=2*A[i];
	j=i;
}
if ((n-2)%2) ans+=A[j+1];


cout<<ans;
return 0;
}
/* What we know is a drop , but what we don't know is an ocean !*/

Measured memory_bytes: 4000
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  bool a=false;
  while(n>0){    
    if(n%10==9){a=true;
               break;
               }
    else{n/=10;}
  }
  if(a){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
}
  


Measured memory_bytes: 3604
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

n,m,x = map(int, input().split())
a = [int(i) for i in input().split()]

cost_r=0
cost_l=0
i=0
while i < m :
    if a[i] > x :
        cost_r += 1
    i += 1
i=m-1
while i >= 0 :
    if a[i] < x :
        cost_l += 1
    i -= 1
answer = cost_r
if cost_l < answer:
    answer = cost_l

print(answer)


Measured memory_bytes: 13240
#include <stdio.h>
#include <string.h>

int main() {
	char s[100001];
	scanf("%s", s);
	int count = 0;
	for(int i = 0; i < strlen(s); i++){
		if(s[i] == '0' && s[i+1] == '0'){
			s[i+1] = '1';
			count++;
		}
		else
			if(s[i] == '1' && s[i+1] == '1'){
				s[i+1] = '0';
				count++;
			}
	}
	printf("%d\n", count);


	return 0;
}



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

using namespace std;

const int max_n = 111, inf = 1000111222;

int n, m, dp[max_n][max_n], ok[max_n][max_n];
bool f[max_n][max_n];
string s[max_n];

void proc(int x, int y, int tp) {
    ok[x][y] = 1;
    for (int i = x; i < n; ++i) {
        for (int j = y; j < m; ++j) {
            if (i == x && j == y) {
                continue;
            }
            ok[i][j] = 0;
            if (f[i][j] == tp) {
                if (i > x) {
                    ok[i][j] |= ok[i - 1][j];
                }
                if (j > y) {
                    ok[i][j] |= ok[i][j - 1];
                }
            }
        }
    }
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
        for (int j = 0; j < m; ++j) {
            f[i][j] = s[i][j] == '#';
            dp[i][j] = inf;
        }
    }
    proc(0, 0, f[0][0]);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (ok[i][j]) {
                dp[i][j] = f[0][0];
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            for (int tp = 0; tp < 2; ++tp) {
                proc(i, j, tp);
                for (int x = i; x < n; ++x) {
                    for (int y = j; y < m; ++y) {
                        if (x == i && y == j) {
                            continue;
                        }
                        if (ok[x][y]) {
                            dp[x][y] = min(dp[x][y], dp[i][j] + tp);
                        }
                    }
                }
            }
        }
    }
    /*for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/
    printf("%d\n", dp[n - 1][m - 1]);
    return 0;
}


Measured memory_bytes: 384
import numpy as np
N, D = map(int,input().split())
length_list = []
for i in range(N):
  X, Y = map(int,input().split())
  leng = np.sqrt(X**2 + Y**2)
  if leng <= D:
    length_list.append(leng)

print(len(length_list))

Measured memory_bytes: 34604
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i = 0; i < n; i++)
#define rep2(i,start,end) for(ll i = start; i < end; i++)
#define dwn(i,n) for(int i = n; i >= 0; i--)
#define dwn2(i,start,end) for(ll i = start; i >= end; i--)
#define pll pair<ll,ll>
#define mk(x,y) make_pair(x,y)
#define pdl pair<double, ll>
const ll N = 4e5 + 200;
const ll INF = 0x3f3f3f;
const ll Mode = 1e9 + 7;


int main(){
	int n,m;
	cin>>n;
	string s;
	cin>>s;
	if(n < 3200){
		cout<<"red"<<endl;
	}else{
		cout<<s<<endl;
	}
	
	
	


	return 0;
}








Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define sz(x) ((ll)(x).size())
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

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

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

int main() {
  string S;
  cin >> S;
  ll N = sz(S) + 1;
  reverse(all(S));
  S.pb('>');
  reverse(all(S));
  S.pb('<');

  vector<ll> a(N, -1);

  rep(i, N) {
    if (S[i] == '>' && S[i + 1] == '<')
      a[i] = 0;
  }

  repp(i, 1, N - 1) {
    if (S[i] == '<' && a[i - 1] != -1)
      chmax(a[i], a[i - 1] + 1);
  }

  repr(i, N - 2, 0) {
    if (S[i + 1] == '>' && a[i + 1] != -1)
      chmax(a[i], a[i + 1] + 1);
  }

  ll ans = 0;
  rep(i, N) {
    ans += a[i];
  }

  cout << ans << endl;

  // rep(i, N) {
  //   cout << a[i] << endl;
  // }
}

Measured memory_bytes: 4740
// #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fi first
#define se second
#define mp std::make_pair
#define Pair std::pair<ll, int>
#define Map std::map< int, int >
#define Vector std::vector<int>
#define LEAD (lead && !i)
#define LIM (lim && i == buc[pos])
 
using std::cin;
using std::cout;
using std::endl;
 
typedef long long ll;
typedef unsigned long long ull;
 
const int N = 100000 + 5;
const int M = 1000 + 5;
const int K = 1e7 + 5;
const int MOD = 1e9 + 7;
const int inv2 = 500000004;
const int LOG = 40;
const ull BASE = 19260817;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };
// const double PI = acos(-1);
const double PI = 3.14159;

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
 
template<class T>
inline T readT() {
    T res = 0, f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) res = (res << 1) + (res << 3) + ch - '0';
    return res * f;
}
#define read readT<int>

namespace Comb{
const int N = 10 + 5;
inline void exgcd(ll a, ll b, ll &g, ll &x, ll &y) {
    if (!b) g = a, x = 1, y = 0;
    else exgcd(b, a % b, g, y, x), y -= x * (a / b);
}
 
inline ll inv(ll a) {
    ll g, res, tmp;
    exgcd(a, MOD, g, res, tmp);
    return ((res % MOD) + MOD) % MOD;
}
 
ll f[N], invFact[N];
 
inline void prepare() {
    f[0] = 1;
    int n = 200000;
    for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i % MOD;
    invFact[n] = inv(f[n]);
    for (int i = n - 1; i >= 1; i--) invFact[i] = invFact[i + 1] * (i + 1) % MOD;
}
 
inline ll C(int n, int m) {
    if (!m) return 1;
    if (n == m) return 1;
    if (m > n) return 0;
    if (m < 0) return 0;
    return f[n] * invFact[m] % MOD * invFact[n - m] % MOD;
}
}

int xf, yf, n;
// bool vis[N];
std::map<char, int> vis;
char s[N];

int main() {
    scanf("%s", s);
    n = strlen(s);
    for (int i = 0; i < n; i++) {
        if (s[i] == 'S' && !vis['S']) yf++, vis['S'] = 1;
        if (s[i] == 'N' && !vis['N']) yf--, vis['N'] = 1;
        if (s[i] == 'W' && !vis['W']) xf++, vis['W'] = 1;
        if (s[i] == 'E' && !vis['E']) xf--, vis['E'] = 1;
    }
    if (!xf && !yf) puts("Yes");
    else puts("No");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>

using namespace std;

typedef long long ll;
typedef long double ld;

#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect
#define no {cout << "0\n"; return;}
#define mkp make_pair

void solve() {
    int n, k;
    cin >> n >> k;
    vector <int> a(n);
    loop(i, k) {
        int c; cin >> c;
        loop(i, c) {
            int x; cin >> x;
            ++a[x - 1];
        }
    }
    int ans = 0;
    loop(i, n)
        ans += (a[i] == 0);
    cout << ans;
}

signed main() {
    srand(time(NULL));
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    map<int, int> m;
    multiset<int> ms;
    for(int i = 1; i <= n; i++)
    {
        int a;
        cin >> a;
        m[a] = i;
    }
    ms.insert(n+1);
    ms.insert(n+1);
    ms.insert(0);
    ms.insert(0);
    auto itr = m.rbegin();
    ll ans = 0;
    while(itr != m.rend())
    {
        auto ritr = ms.lower_bound(itr->second);
        ll r1 = *ritr;
        ritr++;
        ll r2 = *ritr;
        ritr--;
        ritr--;
        ll l1 = *ritr;
        ritr--;
        ll l2 = *ritr;
        ans += (l1-l2) * (r1-itr->second) * itr->first + (r2-r1) * (itr->second-l1) * itr->first;
        ms.insert(itr->second);
        itr++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
#include <boost/foreach.hpp>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
#define _GLIBCXX_DEBUG
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
vector<long> Primelist;
//template functions
/////////////////////////
void Prinit(){
long PR=10000001;
vector<long> P(PR,0);
for(long i=2;i*i<PR;i++){
    if(P.at(i)==0){
        long j=i;
      j+=i;
        while(j<PR){
            P.at(j)=1;
             j+=i;         
        }
    }
}

for(long i=2;i*i<PR;i++){//Primelist.size()=446
    if(P.at(i)==0){
        Primelist.push_back(i);
    }
}
}

void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

long strtolong(string str){
istringstream ss;
ss=istringstream(str);
long num;
ss>>num;
return num;
}

long chartolong(char ch){
long num;
num=ch-'0';
return num;
}

string longtostr(long N){
    string str;
    str=to_string(N);
    return str;
}









/////////////////////////


//Answer


int main() {
long N,a=1,b=1,c=1,ans;
cin>>N;
for(long i=0;i<N;i++){
    a=a*10;
    a=a%MOD;
    b=b*9;
    b=b%MOD;
    c=c*8;
    c=c%MOD;
}
cout<<(a+c-2*b+2*MOD)%MOD<<endl;



}




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

int main(){
int n, k;
cin >> n >> k;
int arr[n];
for(int i = 0; i < n; i++){
cin >> arr[i];
}
for(int i = 0 ; i < n; i++){
if (i >= k){
	if(arr[i] > arr[i - k]){
	cout << "Yes" << endl;
	} else {
	cout << "No" << endl;
		}
	}
}


}


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

using namespace std;

#define N 120000

int n,ans,f[N];
vector<int> g[N];

void dfs(int u,int fa){
	int mx=0;
	for (int v:g[u])
		if (v!=fa){
			dfs(v,u);
			for (int i=0;i<20;++i)
				if ((f[u]&f[v])>>i&1) mx=max(mx,i+1);
			f[u]|=f[v];
		}
	for (;f[u]>>mx&1;++mx);
	f[u]=(f[u]>>mx|1)<<mx;
	ans=max(ans,mx);
}

int main(){
	scanf("%d",&n);
	for (int i=1;i<n;++i){
		int x,y; scanf("%d%d",&x,&y);
		g[x].push_back(y); g[y].push_back(x);
	}
	dfs(1,0);
	printf("%d\n",ans);
	
	return 0;
}
			

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

int main() {
    int a[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin >> k;
    cout << a[k-1] << endl;
}

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
long long res = 0;

void func(int value) {
	if (value == 0) {
		return;
	}
	if (value % 2 == 1) {
		return;
	}
	++res;
	func(value / 2);
	return;
}

int main() {
	int N;
	cin >> N;
	vector<int>  A;
	int tmp;
	for (int i = 0; i < N; ++i) {
		cin >> tmp;
		A.push_back(tmp);
	}

	for (int i = 0; i < N; ++i) {
		func(A[i]);
	}

	cout << res << endl;
}


Measured memory_bytes: 384
#include<cmath>
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cstdio>
#include<map>
#include<utility>
#include<list>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fori(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
struct XY
{
	int x;
	int y;
};

/*
(char)'1' - (int)48 = (int)1;


*/


int main()
{
	int n, q;
	vector<int> s;
	cin >> n;
	int j;
	rep(i, n)
	{
		cin >> j;
		s.push_back(j);
	}
	cin >> q;
	int ans = 0;
	rep(i, q)
	{
		cin >> j;
		int l = 0, r = n;
		if (binary_search(s.begin(), s.end(), j))ans++;
	}
	cout << ans << endl;

}

Measured memory_bytes: 1672
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}



///////////////////////////



int main() {

	map<ll, ll> mp;

	ll N;
	cin >> N;

	string ans = "YES";

	rep(i, N) {
		ll a;
		cin >> a;
		if (mp[a] == 1) { ans = "NO"; break; }
		mp[a] = 1;
	}

	cout << ans;


	system("PAUSE");

}


Measured memory_bytes: 12928
#include <bits/stdc++.h>
#define ALL(e) e.begin(), e.end()
#define RALL(e) e.rbegin(), e.rend()
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define dbg(x) (cerr << #x << ":" << x << endl)
#define mid (l + r) / 2
#define pii pair <int, int>
#define fi first
#define sc second
#define N 1000000009

using namespace std;

typedef long long int lli;

int main(){
	ios::sync_with_stdio(0);
	int h,n;
	cin >> h >> n;
	vector <int> ar(n);
	int sm = 0;
	for(int &x: ar){
		cin >> x;
		sm += x;
	}

	if(sm >= h) cout << "Yes";
	else cout << "No";


	return 0;
}

Measured memory_bytes: 640
function Main(input){
  var S = input.replace(/\r?\n/g, '');
  var alphabet = 'abcdefghijklmnopqrstuvwxyz';
  var cha = 0;
  for(var i of alphabet){
    if(S.indexOf(i)==-1){
      cha=i;
      break;
    }
  }
  if(cha==''){
    console.log('None');
  }else{
    console.log(cha);
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
typedef pair<long long, long long> P;
#define int long long
#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}
signed main(signed argc, char* argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    const int MOD = 1000000007;
    int r;
	cin>>r;
	printf("%.12f",r*2*3.14159265358979);
}


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

#define ll long long
#define d long double

#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define dscf(n) scanf("%Lf",&n)
#define pri(n) printf("%d ",(int)n)
#define lpri(n) printf("%lld ",n)
#define dpri(n) printf("%Lf ",n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define dprin(n) printf("%Lf\n",n)

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i,ini,n) for(ll i=ini;i<(int)n;i++)
#define all(x) x.begin(),x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define bitcount(n) __builtin_popcount(n)
#define tc   int tt; scf(tt); while(tt--)
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define PI 3.14159265358979323846264

const ll M =1e9+7;
const int N = 1e6+7;

ll n;
ll a[N];
ll sum=0,ans=0;

int main()
{
    lscf(n);
    rep(i,0,n){
    lscf(a[i]);
    sum=(sum+a[i])%M;  }

    rep(i,0,n-1)
    {
        sum=(sum-a[i]+M)%M;
        ans=(ans+a[i]*sum)%M;
    }
    lpri(ans);
return 0;
}

Measured memory_bytes: 5376
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;

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

    if(n % 500 <= a) cout << "Yes" << endl;
    else cout << "No" << endl; 



    return 0;
}

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


int main() {
    int x;
    cin >> x;
    if (400 <= x && x <= 599) {
        cout << 8 << endl;;
    } else if (600 <= x && x <= 799) {
        cout << 7 << endl;
    } else if (800 <= x && x <= 999) {
        cout << 6 << endl;
    } else if (1000 <= x && x <= 1199) {
        cout << 5 << endl;
    } else if (1200 <= x && x <= 1399) {
        cout << 4 << endl;
    } else if (1400 <= x && x <= 1599) {
        cout << 3 << endl;
    } else if (1600 <= x && x <= 1799) {
        cout << 2 << endl;
    } else if (1800 <= x && x <= 1999) {
        cout << 1 << endl;
    } 
    return 0;
}

Measured memory_bytes: 3640
#include <stdio.h>

int main()
{
    int N;
    int i;
    char S[100000];
    char last = 'A';
    int res = 0;

    scanf("%d", &N);
    (void)getchar();
    for (i = 0; i < N; i++)
    {
        scanf("%c", &S[i]);
        if (last != S[i])
        {
            last = S[i];
            res++;
        }
    }

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

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 1000000007;

#define M 1000000007

int main() {
    string S;
    cin >> S;
    reverse(S.begin(), S.end());
    S += string(1, '0');
    ll n = S.length();
    ll inf = 1e9;
    vector<vector<ll>> dp(n+1, vector<ll>(2, inf));
    dp[0][0] = 0;
    dp[0][1] = inf;
    for (ll i = 1; i <= n; ++i) {
        ll x = S[i-1] - '0';
        dp[i][0] = min(dp[i-1][0] + x, dp[i-1][1] + x + 1);
        dp[i][1] = min(dp[i-1][0] + (10 - x), dp[i-1][1] + (10 - x) - 1);
        //cerr << i << ": x = " << x << " -> " << dp[i][0] << ", " << dp[i][1] << endl;
    }
    cout << min(dp[n][0], dp[n][1]) << endl;
}


Measured memory_bytes: 55940
n=int(input())
s=list(map(int,input().split()))
flg=True
ans=True
for i in range(n-1):
  if s[i]>s[i+1]+1:
    ans=False
    break
  elif s[i]<s[i+1]:
    flg=True
  elif s[i]==s[i+1]:
    continue
  else:
    if flg==False:
      ans=False
      break
    else:
      flg=False
      s[i]-=1
  
if ans:
  print('Yes')
else:
  print('No')
  




Measured memory_bytes: 15020
#include <iostream>
#include <vector>
#include <cstdlib>  
#include <algorithm>
#include <string>
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long n,m;cin>>n>>m;
    long h[n];
    for(int i = 0;i<n;i++) cin>>h[i];
    sort(h,h+n,greater<long>());
    long sai = 10000000000;
    for(int i = 0;i<n-m+1;i++){
      if(h[i]-h[i+m-1] <= sai) sai = h[i]-h[i+m-1];
    }
    cout<<sai;
    return 0;
}

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

class Dise {
public:
	Dise(int*);
	//てっぺんは0番
	int DiseNumber[6];
};

Dise::Dise(int *InputNumber) 
{
	for (int i = 0; i < 6; i++) {
		DiseNumber[i] = InputNumber[i];
	}
}

//文字ごとに処理振り分け
void Distributes(char ch,Dise *dise) 
{
	if (ch == 'S') {
		swap(dise->DiseNumber[0], dise->DiseNumber[1]);
		swap(dise->DiseNumber[0], dise->DiseNumber[5]);
		swap(dise->DiseNumber[0], dise->DiseNumber[4]);
	}
	else if (ch == 'E') {
		swap(dise->DiseNumber[0], dise->DiseNumber[2]);
		swap(dise->DiseNumber[0], dise->DiseNumber[5]);
		swap(dise->DiseNumber[0], dise->DiseNumber[3]);
	}
	else if (ch == 'W') {
		swap(dise->DiseNumber[0], dise->DiseNumber[3]);
		swap(dise->DiseNumber[0], dise->DiseNumber[5]);
		swap(dise->DiseNumber[0], dise->DiseNumber[2]);
	}
	else {
		swap(dise->DiseNumber[0], dise->DiseNumber[4]);
		swap(dise->DiseNumber[0], dise->DiseNumber[5]);
		swap(dise->DiseNumber[0], dise->DiseNumber[1]);
	}
}

int main()
{
	//classDise
	int DiseNumber[6];
	string comand;

	//入力
	for (int i = 0; i < 6; i++) {
		cin >> DiseNumber[i];
	}

	Dise dise(DiseNumber);

	//命令入力
	cin >> comand;

	//転がす
	for (unsigned int i = 0; i < comand.size(); i++) {
		//処理ごとに振り分け
		Distributes(comand[i],&dise);
	}

	//結果
	cout << dise.DiseNumber[0] << endl;

	return 0;
}


Measured memory_bytes: 3188
import java.util.Scanner;

public class Main implements Runnable {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Thread(null, new Main(), "", 128 * 1024 * 1024).start();
    }

    private int N;

    public void run() {
        N = sc.nextInt();
        int ans = dfs(0);
        System.out.println(ans);
    }

    private int dfs(long x) {
        if (x > N) {
            return 0;
        }
        int count = 0;
        String s = String.valueOf(x);
        if (s.contains("3") && s.contains("5") && s.contains("7")) {
            count++;
        }
        count += dfs(10 * x + 3) + dfs(10 * x + 5) + dfs(10 * x + 7);
        return count;
    }
}

Measured memory_bytes: 28116
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <tuple>
 
using namespace std;
 
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a) for(int i = s; i < n; i++) cin >> a[i]
#define couta(n, a) for(int i = 0; i < n; i++) cout << a[i] << ' '
#define copy(s, n, a, b) for(int i = s; i < n; i++) b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD (ll)1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;


void solve(){
    int n;
    cin >> n;
    vector <vi> a(n, vi (26, 0));
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        for(int j = 0; j < s.size(); j++){
            a[i][s[j] - 'a'] += 1;
        }
    }
    for(int i = 0; i < 26; i++){
        int cnt = INT_MAX;
        for(int j = 0; j < n; j++){
            cnt = min(a[j][i], cnt);
        }
        while(cnt--) cout << char(i + 'a');
    }
}

int main(){
    ios::sync_with_stdio(false); cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int q = 1;
    //cin >> q;
    for(int i = 1; i <= q; i++){
        solve();
    }
}


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


int main(){
  string s;
  cin >> s;
  if((s[0] == s[1] && s[1] == s[2]) || (s[1] == s[2] && s[2] == s[3])){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
  return 0;
}


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





int r1, r2;
//-----------------------------------------------------------------------------------
int main() {
	cin >> r1 >> r2;

	if (r1 > r2) swap(r1, r2);

	int d = r2 - r1;
	if (180 < d) r2 -= 360;
	double ans = (r1 + r2) / 2.0;
	if (ans < 0) ans += 360;
	printf("%.10f\n", ans);
}

Measured memory_bytes: 3220
#include <iostream>
#include <cmath>

using namespace std;

int main(int argc, char* argv[]) {
  int a, b;
  cin >> a >> b;

  int c;

  if (b < 10) {
    c = 10 * a + b;
  } else if (b < 100) {
    c = 100 * a + b;
  } else {
    c = 1000 * a + b;
  }

  int root_c = int(sqrt(c));

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

  return 0;
}

Measured memory_bytes: 256
a,b,c = map(int,input().split())

div = [c]

for i in range(1,int(c*0.5)+1):
    if c % i == 0:
        div.append(i)

ans = []
sorted_div = sorted(div)
for j in range(len(sorted_div)):
    if a <= sorted_div[j] <= b:
        ans.append(sorted_div[j])
print(len(ans))


Measured memory_bytes: 5616
N = int(input())
a = list(map(int, input().split()))
dp = [[0 for i in range(N+1)] for j in range(N+1)]
for len in range(1, N+1):
    for i in range(N - len + 1):
        j  = i + len
        if (N - len) % 2 == 0:
            dp[i][j] = max(dp[i+1][j] + a[i], dp[i][j-1] + a[j-1])
        else:
            dp[i][j] = min(dp[i+1][j] - a[i], dp[i][j-1] - a[j-1])
print(dp[0][N])

Measured memory_bytes: 152888
#include <cstdio>
#include <cstring>

#define M 1046527
#define NIL (-1)
#define L 14

typedef long long ll;

char H[M][L];

// 文字から数値に変換
int getChar(char ch) {
	if (ch == 'A') return 1;
	else if (ch == 'C') return 2;
	else if (ch == 'G') return 3;
	else if (ch == 'T') return 4;
	else return 0;
}

// 文字列から数値へ変換して key を生成する
ll getKey(char str[]) {
	ll sum = 0, p = 1;
	for (int i = 0; i < strlen(str); ++i) {
		sum += p * (getChar(str[i]));
		p *= 5;
	}
	return sum;
}

int h1(int key) { return key & M; }
int h2(int key) { return 1 + (key % (M - 1)); }

int find(char str[]) {
	ll key, h;
	key = getKey(str);
	for (int i = 0;; ++i) {
		h = (h1(key) + i * h2(key)) % M;
		if (!strcmp(H[h], str)) return true;
		else if (!strlen(H[h])) return false;
	}
	return false;
}

bool insert(char str[]) {
	ll key, h;
	key = getKey(str);
	for (int i = 0;; ++i) {
		h = (h1(key) + i * h2(key)) % M;
		if (!strcmp(H[h], str)) return true;
		else if (!strlen(H[h])) {
			strcpy(H[h], str);
			return false;
		}
	}
	return false;
}

int main() {
	int n, h;
	char str[L], com[9];
	for (int i = 0; i < M; ++i) H[i][0] = NULL;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf("%s%s", com, str);

		if (com[0] == 'i') insert(str);
		else {
			if (find(str)) printf("yes\n");
			else printf("no\n");
		}
	}
}


Measured memory_bytes: 16992
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define push push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
int main(){
    ll k,a,b;
    ll ans=0;
    cin >>k>>a>>b;
    ll smart=b-a;
    ll st=a-1;
    ans=1+k;
    if(smart>1 and k-st>1){
        ans = smart * ((k - st) / 2);
        if((k-st)%2==1){
           ans++;
        }
        ans+=a;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
#define stop(x) {cout<<x<<endl;exit(0);}
#define all(x) x.begin(),x.end()
#define szz(s) int(s.size())
#define endl '\n'
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
typedef long long ll;
using namespace std;

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


string s, k , ans;
int memo[5002][5002];

int solve(int i, int j) {
    if (i >= szz(s) || j >= szz(k))return 0;
    
    int& ret = memo[i][j];
    if (~ret)return ret;
    ret = 0;

    if (s[i] == k[j])
        ret = solve(i + 1, j + 1)+1;
    ret = max(ret, solve(i + 1, j));
    ret = max(ret, solve(i , j + 1));
    return ret;
}

void build(int i, int j) {
    if (i >= szz(s) || j >= szz(k))return;

    int optimal = solve(i, j);

    int ch1 = -1, ch2 = -1, ch3 = -1;

    if(s[i]==k[j])
         ch1 = solve(i+1, j+1)+1;
    ch2 = solve(i + 1, j);
    ch3 = solve(i, j + 1);

    if (ch1==optimal){
        ans += s[i];
        build(i + 1, j + 1);
    }
    else if (ch2 == optimal)
        build(i + 1, j);
    else
        build(i, j + 1);
}



int main() {
    //file();

    memset(memo, -1, sizeof memo);
    cin >> s >> k;
    solve(0, 0);
    build(0,0); 
    cout << ans << endl;

}

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

int N, X[1009], Y[1009], H[1009]; vector<tuple<int,int,int> >vec;

int main() {
  cin >> N; tuple<int,int,int>G = make_tuple(-1, -1, -1);
	for (int i = 1; i <= N; i++) {
		cin >> X[i] >> Y[i] >> H[i];
		if (H[i] >= 1) G = make_tuple(X[i], Y[i], H[i]);
	}
	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			int V = get<2>(G) + abs(get<0>(G) - i) + abs(get<1>(G) - j);  bool flag = true;
			for (int k = 1; k <= N; k++) {
				int VV = V - abs(X[k] - i) - abs(Y[k] - j); VV = max(VV, 0);
				if (H[k] != VV) flag = false;
			}
			if (flag == true) vec.push_back(make_tuple(i, j, V));
		}
	}
	if (vec.size() == 1) {
		cout << get<0>(vec[0]) << " " << get<1>(vec[0]) << " " << get<2>(vec[0]) << endl;
	}
	return 0;
}


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

int main() {
	int n,k;
	cin>>n>>k;
	vector<int>arr(n);
	vector<int>val(n);
	for(int i=0;i<n;i++){
		cin>>arr[i]>>val[i];
	}
	vector<long long>dp(k+1,0);
	dp[0]=0;
		for(int j=0;j<n;j++){
			for(int i=k;i>0;i--){
			if(i-arr[j]>=0) dp[i]=max(dp[i],dp[i-arr[j]]+val[j]);
		}
	}
	cout<<dp[k]<<endl;
	return 0;
}

Measured memory_bytes: 4052
N, M = map(int, input().split())

if N == 1 and M == 0:
  print(0)				# 1桁かつ無条件の場合は0
  exit()

sc = [list(map(int, input().split())) for i in range(M)]

ans = ['x'] * N			# 解答の整数を初期化

for i in range(M):
  s = sc[i][0]
  c = sc[i][1]
  if s == 1 and c == 0 and N != 1:
    print(-1)			# 1桁以外の整数で先頭桁が0はNG
    exit()
  if ans[s-1] == 'x':
    ans[s-1] = str(c)	# 指定桁の数値を置換
  else:
    if ans[s-1] != str(c):
      print(-1)			# 同一の桁に対して異なる数値を挿入できない
      exit()

for index, char in enumerate(ans):
  if char == 'x':
    if index == 0:
      ans[index] = '1'	# 先頭桁が未置換ならば最小値の1で置換
    else:
      ans[index] = '0'	# 先頭桁以外で未置換の桁があれば最小値の0で置換

print(int(''.join(ans)))


Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>

using namespace std;

typedef int itn;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef map<int, int> M;
typedef pair<int, int> P;
typedef stack<int> S;
typedef queue<int> Q;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string a, b, c;
    cin >> a >> b >> c;
    int x = stoi(a);
    int y = stoi(b);
    int z = stoi(c);
    cout << x+y+z+9*max(x, max(y, z)) << endl;
    
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-12;

template <typename T>
void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}
ll powm(ll a, ll b, ll c) {
	if (b == 0)
		return 1;
	else if (b % 2 == 0) {
		ll d = powm(a, b / 2, c);
		return (d * d) % c;
	} else
		return (a * powm(a, b - 1, c)) % c;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

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



int main() {
	IOS();
	ld W, H, x, y;
	cin >> W >> H >> x >> y;
	bool ok = x * 2 == W && y * 2 == H;
	cout << setprecision(9) << fixed << H * W / 2 << " " << ok << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
const ll INF=1000000000000000001;
 
int N,Q;
 
ll q[100000],p[100001],c[100001],g[100001];
vector<ll> a;
 
int main(){
   
  cin>>N>>Q;  ll M=INF;
  
  if(Q==0){
    for(int i=0; i<N; i++) printf("%d\n",1);
    return 0;
    }
   
  for(int i=0; i<Q; i++) scanf("%lld",&q[i]);
 
  for(int i=Q-1; i>=0; i--){
    if(q[i]<M){
      a.push_back(q[i]); M=q[i];
    }
  }
 
  sort(a.begin(),a.end());
 
  if(a[0]>N){ 
    a.push_back(N); sort(a.begin(),a.end()); 
  }
 
 p[a.size()-1]++;
 
 for(int i=a.size()-1; i>=0; i--){
    
    ll R=a[i];
    
while(R>a[0]){
    int X =
    lower_bound(a.begin(),a.end(),R)-a.begin()-1; 
    p[X]+=(R/a[X])*p[i];
    R%=a[X]; 
    }
    
    c[R]+=p[i];
  
  }
  
  ll S=0; c[0]=0;
  
  for(int i=1; i<=a[0]; i++) S+=c[i];
  
  for(int i=1; i<=a[0]; i++){
    S-=c[i-1];
    g[i]=S;
    }
    
  for(int i=1; i<=N; i++) printf("%lld\n",g[i]);
  
  return 0;
 
}

Measured memory_bytes: 5748
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include <sstream>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include <iomanip>
using namespace std;


int main(void){
    int N;
    cin >> N;
    if(N % 1000 == 0){
        cout << 0 << endl;
    }else{
        cout << 1000 - (N%1000) << endl;
    }

    return 0;
}

Measured memory_bytes: 3636
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(v)";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
    var s = o.a(1);
    var ans1 = 0;
    var ans2 = 0;
    for(var i = 0; i < s.length; i++){
        if(i&1){
            if(s[i] == 0)ans1++;
            else ans2++;
        }else{
            if(s[i] == 1)ans1++;
            else ans2++;
        }
    }
    return Math.min(ans1,ans2);
}

Measured memory_bytes: 7500
#include <bits/stdc++.h>
     
using namespace std;
 
std::ostream& operator<<(std::ostream& os, const __int128 i) noexcept
{
  std::ostream::sentry s(os);
  if (s) {
    unsigned __int128 tmp = i < 0 ? -i : i;
    char buffer[128];
    char *d = std::end(buffer);
    do {
      --d;
      *d = "0123456789"[tmp % 10];
      tmp /= 10;
    } while (tmp != 0);
    if (i < 0) {
      --d;
      *d = '-';
    }
    int len = std::end(buffer) - d;
    if (os.rdbuf()->sputn(d, len) != len) {
      os.setstate(std::ios_base::badbit);
    }
  }
  return os;
}

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    int n;
    long long int k,t;
    vector <__int128> a,f;
 	
 	//ifstream cin("sub1_09.txt");

    cin >> n >> k;
 
    for(int i=0;i<n;i++)
    {
    	cin >> t;
    	a.push_back(t);
    }

    for(int i=0;i<n;i++)
    {
    	cin >> t;
    	f.push_back(t);
    }
 	
 	sort(a.begin(),a.end());
 	sort(f.rbegin(),f.rend());

   	__int128 lo = 0;
   	__int128 hi = 1e18;
   	__int128 res = 1e18;
   	while(lo<=hi)
   	{
   		__int128 mid = (lo + hi)/2;
   		__int128 sum = 0;
   		for(int i=0;i<n;i++)
   		{
   			__int128 x = mid/f[i];
   			if(x < a[i])
   			{
   				sum += a[i] - x;
   			}
   		}
   		if(sum <= k)
   		{ 	 	
   			res = min(res,mid);         			   				
   			hi = mid - 1;
   		}
   		else
   		{    			
   			lo = mid + 1;
   		}
   	}
 
   	cout << res << '\n';
 
    return 0;
}

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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

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

  ll n, m, v, p; cin >> n >> m >> v >> p;
  vll a(n);
  for(int i=0;i<n;++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  ll ans = p;
  if(v <= p) {
    for(int i=0;i<n-p;++i) {
      auto it = upper_bound(a.begin(), a.end(), a[i] + m);
      if(distance(a.begin(), it) > n-p) {
        ans++;
      }
    }
    cout << ans << endl;
  } else {
    vll su(n+1);
    for(int i=0;i<n;++i) {
      su[i+1] = su[i] + a[i];
    }

    for(int i=0;i<n-p;++i) {
      auto it = upper_bound(a.begin(), a.end(), a[i]+m);
      if(distance(a.begin(), it) <= n-p) {
        continue;
      }

      ll tmp = v - p - i;
      if(tmp <= 0) {
        
        ans++;
        continue;
      }
      
      ll su1 = su[n-p+1] - su[i+1];
      su1 = (a[i]+m) * (n-p-i) - su1;
      if(su1 >= m * (tmp)) {
        ans++;
      }

    }
    cout << ans << endl;


  }







}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    int N;cin>>N;
    vector<int> v(N);
    REP(i,N) cin>>v[i];
    vector<pair<int,int>> ev(100001),od(100001);
    REP(i,100001){
        ev[i].second=i;
        od[i].second=i;
    }
    REP(i,N){
        if(i&1) ev[v[i]].first++;
        else od[v[i]].first++;
    }
    sort(rAll(ev));
    sort(rAll(od));
    if(ev[0].second!=od[0].second){
        cout<<N-ev[0].first-od[0].first<<endl;
    }
    else{
        cout<<N-max(ev[0].first+od[1].first,ev[1].first+od[0].first)<<endl;
    }
}


Measured memory_bytes: 2176
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
    int sx,sy,tx,ty;
    cin >> sx >> sy >> tx >> ty;
    for(int i=0;i<(tx-sx);i++)  cout << "R";
    for(int i=0;i<(ty-sy);i++)  cout << "U";
    for(int i=0;i<(tx-sx);i++)  cout << "L";
    for(int i=0;i<(ty-sy);i++)  cout << "D";
    cout << "D";
    for(int i=0;i<=(tx-sx);i++)  cout << "R";
    for(int i=0;i<=(ty-sy);i++)  cout << "U";
    cout << "LU";
    for(int i=0;i<=(tx-sx);i++)  cout << "L";
    for(int i=0;i<=(ty-sy);i++)  cout << "D";
    cout << "R";
    cout << endl;
    return 0;
}


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

int main(){
  string s;
  cin >> s;
  int counter = 0;
  if (s[0] == '1') ++counter;
  if (s[1] == '1') ++counter;
  if (s[2] == '1') ++counter;
  cout << counter << endl;
}

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

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

const int N=2e5+100;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;

int x[100],y[100],xx[100],yy[100];
int n,k;
ll check(int l,int r,int d,int u)
{
    ll sum=0;
    for(int i=1;i<=n;i++){
        if(x[i]>=l&&x[i]<=r&&y[i]<=u&&y[i]>=d) sum++;
    }
    if(sum>=k) return 1ll*(r-l)*(u-d);
    return -1;
}
int main()
{

      cin>>n>>k;
      for(int i=1;i<=n;i++){
        cin>>x[i]>>y[i];
        xx[i]=x[i],yy[i]=y[i];
      }
      sort(xx+1,xx+n+1);
      sort(yy+1,yy+n+1);
      ll ans=5e18;
      for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            for(int r=1;r<=n;r++){
                for(int k=r+1;k<=n;k++){
                   ll kk=check(xx[i],xx[j],yy[r],yy[k]);
                   if(kk>-1) ans=min(ans,kk);
                }
            }
        }
      }
      cout<<ans<<endl;
}



Measured memory_bytes: 3648
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <tuple>
#include <cassert>
#include <memory>
using namespace std;
typedef long long ll;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int main ()
{
    int A,B,C;
    cin >> A >> B >> C;
    cout << C << " " << A << " " << B << endl;    

    return 0;
}


Measured memory_bytes: 256