akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
#define mod 1000000007
bool isPerfectSquare(int x) 
{   
    long double xx=(long double)x;
  long double sr = sqrt(xx); 
  
  // If square root is an integer 
  return ((sr - floor(sr)) == 0); 
} 
int main() 
{  
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    
   ll n,x=0;
   cin>>n;
   ll arr[n];
   for(int i=0;i<n;i++){
   cin>>arr[i];arr[i]*=2;}
   ll sum=arr[n-1];
   for(int i=n-2;i>=0;i--)
   {
       if(x%2==0)
       sum-=arr[i];
       else
       sum+=arr[i];
       x++;
   //    cout<<sum<<" ";
   }
   ll a=sum/2;
   cout<<a<<' ';
   for(int i=0;i<n-1;i++)
   {
       cout<<arr[i]-a<<" ";
       a=arr[i]-a;
   }


    return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define all(x) x.begin(), x.end()
#define arrAll(x, n) (x, x + n)
#define trav(a, x) for (auto &a : x)
#define rall(x) x.rbegin(), x.rend()
#define endl "\n"

using namespace std;

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

const int mod = 1e9 + 7;
const int N = 1e6 + 5;

void solve() {
    int d, t, s; cin >> d >> t >> s;
    if ((d/(double)s) <= (double)t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return;
}

int main() {
  
    FIO
    solve();
}

Measured memory_bytes: 3644
import queue

n=int(input())

q=queue.Queue()

q.put(3)
q.put(5)
q.put(7)

c=0
num=q.get()
while num<=n:
    if "3" in str(num) and "5" in str(num) and "7" in str(num):
        c+=1
    q.put(num*10+3)
    q.put(num*10+5)
    q.put(num*10+7)
    num=q.get()

print(c)


Measured memory_bytes: 6640
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
using namespace std;
typedef long long ll;
ll N;
ll ans=0;
vector<ll> primes;
int main(int argc,char const* argv[])
{
  cin >> N;
  for (ll i=1;i<=sqrt(N);i++)
    {
      if(N%i==0)
	{
	  if(i!=1)
	    {
	      primes.push_back(i);
	    }
	  if(i!=(N/i))
	    {
	      primes.push_back(N/i);
	    }
	}
    }
  sort(primes.begin(),primes.end());
  for (int i = 0; i < int(primes.size()); ++i)
    {
      if(N/(primes[i]-1)==N%(primes[i]-1))
	{
	  ans+=primes[i]-1;
	}
	
    }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        int gcd = Gcd(x, y);
        System.out.println(gcd);
    }

    public static int Gcd(int x, int y)
    {
        int i = x % y;
        if (i == 0)
        {
            return y;
        }
        else if (x >= y)
        {
            return Gcd(y, i);
        }
        else
        {
            return Gcd(y, x);
        }
    }
}



Measured memory_bytes: 26324
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

const int magic=2000;

char s[2111][10111];
int n,k,l[2111];
bool dp[2111][10111];
vector<pii> pos,npos;
int main()
{
	get2(n,k);
	for(int i=1;i<=n;i++)
	{
		scanf("%s",s[i]+1);
		l[i]=strlen(s[i]+1);
	}
	dp[n+1][0]=1;
	for(int i=n;i>=1;i--)
	{
		for(int j=0;j<=k;j++)
		{
			dp[i][j]=dp[i+1][j];
			if(j>=l[i])dp[i][j]|=dp[i+1][j-l[i]];
		}
	}
	for(int i=1;i<=n;i++)if(dp[i+1][k-l[i]])pos.pb(mp(i,1));
	for(int _=1;_<=k;_++)
	{
		npos.clear();
		char cur='z';for(int i=0;i<(int)pos.size();i++)cur=min(cur,s[pos[i].ff][pos[i].ss]);
		putchar(cur);
		
		int mn=n;
		for(int i=0;i<(int)pos.size();i++)
		{
			if(s[pos[i].ff][pos[i].ss]!=cur)continue;
			if(l[pos[i].ff]==pos[i].ss)
				mn=min(mn,pos[i].ff);
			else npos.pb(mp(pos[i].ff,pos[i].ss+1));
		}
		for(int i=mn+1;i<=n;i++)if(_+l[i]<=k&&dp[i+1][k-_-l[i]])npos.pb(mp(i,1));
		if((int)npos.size()>magic)
		{
			random_shuffle(npos.begin(),npos.end());
			npos.resize(magic);
		}
		
		pos.swap(npos);
	}
	return 0;
}


Measured memory_bytes: 41344
#include<bits/stdc++.h>
using namespace std;
#define cs const 
#define int long long
#define low(i) (i&(-i))
#define mid ((l+r)>>1)
#define ls (now<<1)
#define rs (now<<1|1)
#define par pair<int,int>
#define mp make_pair
#define pb push_back
#define fr first 
#define se second
#define cn(x) memset(x, 0, sizeof(x))
#define rep(i, x, y) for(int i=x; i<=y; ++i)
#define drep(i, x, y) for(int i=x; i>=y; --i)
#define fore(i, x) for(int i=fir[x]; i; i=nex[i])
#define dbg cout << "---------------------------------\n"
cs int base = 233;
cs int ff = 1e6+1;
cs int mod = 1e9+7;
cs int inf = 1e17+1;
inline int read() { int x; scanf("%lld", &x); return x; }
int fir[ff], nex[ff], to[ff], va[ff], tot;
void add(int x, int y, int z)
{
    nex[++tot] = fir[x];
    fir[x] = tot;
    to[tot] = y;
    va[tot] = z;
}
int ksm(int a, int b) { return ( b % 2 == 1 ? a : 1 ) * ( b? ksm( a * a % mod, b>>1 ) : 1 ) % mod; }
int getinv(int x) { return ksm(x, mod-2); }
int n, k;
int C(int x, int y)
{
	int s1 = 1, s2 = 1;
	rep(i, 1, x) s1 = s1 * i % mod, s2 = s2 * y % mod, y--;
	return s2 * getinv(s1) % mod;
}
int qz[ff];
int c(int x, int y) { return qz[y] * getinv(qz[y-x]) % mod * getinv(qz[x]) % mod; }
int calc(int x, int y) { return C(x-1, x+y-1);  } // put y people into x rooms
int ccf(int ans = 0) { rep(i, 0, k) ( ans += c(i, n) * c(i, n-1) % mod ) %= mod; return ans; }
void init()
{
	qz[0] = qz[1] = 1; rep(i, 2, 1e6) qz[i] = qz[i-1] * i % mod;
	cin >> n >> k;
	if( k + 1 >= n ) cout << calc(n, n) % mod;
	else cout << ccf() % mod;
}
signed main()
{
    int T = 1;
    while(T--) 
        init();
} 

Measured memory_bytes: 8448
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> sum(n, 0);

    map<int, int> mp;
    int cursum = 0;
    mp[0]++;
    rep(i, n) {
        cursum += a[i];
        mp[cursum]++;
    }
    int ans = 0;
    for(auto &i : mp) {
        ans += i.second * (i.second - 1) / 2;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 15872
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <functional>

#define REP(i,n) for(int i = 0; i < (n); ++i)
using namespace std;

int main(){
	vector<int> ret;
	int a;
	while(cin>>a) ret.push_back(a);
	sort(ret.begin(), ret.end() ,greater<int>());
	REP(i, ret.size()) {
		cout<<ret[i];
		if (i != ret.size() -1) cout << " ";
	}
	cout<<endl;
	return 0;
}

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

using namespace std;

void solve()
{
    long long n, x = 26, pre = 1;
    cin >> n;
    string s;
    while (n > 0)
    {
        long long c = n % x;
        if (!c) c = x;
        n -= c;
        s += ((c / pre - 1) + 'a');
        x *= 26;
        pre *= 26;
    }
    reverse(s.begin(), s.end());
    cout << s << endl;
}

int main() 
{
    int tt = 1;
    //cin >> tt;
    while (tt--) solve();
}


Measured memory_bytes: 3600
#include<iostream>
#include<string>
#include <stdio.h>
#include <vector> 
#include <algorithm>
#include <functional>
#include<map>

using namespace std;

long long func(int n);

int main(){
  int n;
  map<vector<char>,long long> m;
  cin >> n;
  for(int i=0;i<n;i++) {
    vector<char> v(10);
  	for(int j=0;j<10;j++){
      char c;
      cin >>c;
      v[j]=c;
    }
    sort(v.begin(),v.end());
    m[v]++;
  }
  long long ans = 0;
  for(auto itr = m.begin();itr != m.end();itr++){
    ans += (itr->second*(itr->second-1))/2;
  }
  cout << ans;
  return 0;
}



Measured memory_bytes: 11136
n = gets.chomp.to_i

n.times do
  (x1, y1, x2, y2, x3, y3) = gets.chomp.split
  x1 = x1.to_f
  y1 = y1.to_f
  x2 = x2.to_f
  y2 = y2.to_f
  x3 = x3.to_f
  y3 = y3.to_f
  a1 = 2*(x2-x1)
  b1 = 2*(y2-y1)
  c1 = x1**2 - x2**2 + y1**2 - y2**2
  a2 = 2*(x3-x1)
  b2 = 2*(y3-y1)
  c2 = x1**2-x3**2+y1**2-y3**2
  x = (b1*c2-b2*c1)/(a1*b2-a2*b1)
  y = (c1*a2-c2*a1)/(a1*b2-a2*b1)
  r = Math::sqrt((x1-x)**2 + (y1-y)**2)
  x = ((x*1000).round)/1000.to_f
  y = ((y*1000).round)/1000.to_f
  r = ((r*1000).round)/1000.to_f
  printf("%.3f %.3f %.3f\n", x, y, r)
end

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

int main(){
    string s;
    cin >> s;
    int64_t ans = 0;
    int64_t tmp;
    for (int bit = 0; bit < (1<<(s.size()-1)); ++bit) {
        tmp = s[0] - '0';
        for (int i = 0; i < s.size()-1; ++i) {
            if (bit&(1 << i)) {
                ans += tmp;
                tmp = 0;
            }
            tmp = tmp * 10 + (s[i + 1] - '0');
        }
        ans += tmp;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
s = input()
k = int(input())
ans = 0
cnt = 1
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        cnt += 1
    else:
        ans += (cnt//2)*k
        cnt = 1
ans += ((cnt)//2)*k
if cnt == len(s):
    ans = len(s)*k//2
elif s[0] == s[-1]:
    l = 1
    r = 1
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            l += 1
        else:
            break
    for i in range(len(s)-1,0,-1):
        if s[i] == s[i-1]:
            r += 1
        else:
            break
    ans -= (l//2 + r//2 - ((l+r)//2))*(k-1)
print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<cstring>
#include<queue>
using namespace std;

#define REP(i,a,b) for(i=a; i<b; ++i)
#define rep(i,n) REP(i,0,n)

vector<int> cv,pv;
int n,U;

bool visited[1<<20];

struct state {
  int used,cost;
  state(int used,int cost) : used(used), cost(cost) {;}
};

int pop(int x) {
  int n = 0;
  while(x != 0) {
    n++;
    x &= (x-1);
  }
  return n;
}

int bfs() {
    queue<state> Q;
    Q.push(state(0,0));
    int i;

    while(!Q.empty()) {
        state ns = Q.front(); Q.pop();
        if(visited[ns.used]) continue;
        if(ns.cost >= U) {
            return pop(ns.used);
        }

        visited[ns.used] = 1;

        for(i=0; i<n; ++i) {
            if(!(ns.used&(1<<i)) && (ns.used & pv[i])==pv[i]) {
                Q.push( state(ns.used|(1<<i), ns.cost+cv[i]) );
            }
        }
    }
    return 0;
}

int main() {
    int i,j,k,c,r,tmp;
    while(cin>>n>>U, n|U) {
        cv.clear();
        pv.clear();
        pv.resize(n);

        memset(visited, false, sizeof(visited));
        rep(i,n) {
            cin>>c>>k;
            cv.push_back(c);
            tmp = 0;
            rep(j,k) {
                cin>>r;
                tmp |= (1<<r);
            }
            pv[i] = tmp;
        }

        cout<<bfs()<<endl;
    }
}

Measured memory_bytes: 17000
ss = input()
s = int(ss)
nums = list(map(int,input().split()))
count = 0
for val in range(s -2):
    if nums[val] > nums[val + 1] > nums[val + 2] or nums[val] < nums[val + 1] < nums[val + 2]:
        count += 1
        
print(count)

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

int main (){
  ll n,t,a;
  cin >> n >> t >> a;
  
  ll ans = 200000000;
  ll h;
  ll index = 0;
  for(ll i=0; i<n; i++){
    cin >> h;
    int temp = 1000 * t - 6 * h;
    if(ans > abs(1000 * a - temp)){
      index = i;
      ans = abs(1000 * a - temp);
    }
  }
  
  cout << index + 1 << endl;
}


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

#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
#define mp make_pair

using namespace std;

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

int main()
{

    //ifstream cin("input.txt");
    //ofstream cout("output.txt");
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    //ios_base::sync_with_stdio(false);
    //cin.tie(0);

    ll a, b, c;
    cin >> a >> b >> c;

    if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
        cout << "0\n";
        return 0;
    }

    ll ans = a * b;
    ans = min(ans, a * c);
    ans = min(ans, b * c);
    cout << ans << "\n";

}


Measured memory_bytes: 256
#include <cstdio>
using namespace std;
int n;
char c;
char t;
int ans;
int main(){
    scanf("%d",&n);
    getchar();
    while (n--){
        t=getchar();
        if (t!=c){
            c=t;
            ans++;
        }
    }
    printf("%d\n",ans);
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<set>
#include<map>
#define ll long long
using namespace std;

int main() {
	ll a, b, x;
	cin >> x >> a >> b;
	x -= a;
	while (x >= b) {
		x -= b;
	}
	cout << x << endl;
}

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

using namespace std;

#define INF 1000000007
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int N, A, B, C;
vector<int> l;
int dfs(int n, int a, int b, int c)
{
    if (n == N)
    {
        if (min({a, b, c}) > 0)
        {
            return abs(a - A) + abs(b - B) + abs(c - C) - 30;
        }
        else
        {
            return INF;
        }
    }
    int score1 = dfs(n + 1, a, b, c);
    int score2 = dfs(n + 1, a + l[n], b, c) + 10;
    int score3 = dfs(n + 1, a, b + l[n], c) + 10;
    int score4 = dfs(n + 1, a, b, c + l[n]) + 10;

    return min({score1, score2, score3, score4});
}
signed main()
{
    cin >> N >> A >> B >> C;
    rep(i, N)
    {
        int s;
        cin >> s;
        l.push_back(s);
    }
    cout << dfs(0, 0, 0, 0) << endl;
}


Measured memory_bytes: 256
//#define anjn
//      Anjan Agarwala - anjn98

//#define opti
#ifdef opti
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#endif

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, 
                  tree_order_statistics_node_update> ordered_set;

//ll power(ll x,ll y,ll p){ll r=1; x=x%p; while(y){ if(y&1) r= r*x%p; y=y>>1; x=x*x%p; } return r; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int csrand(int l=0, int r=1e9){
  uniform_int_distribution<int> uid(l, r);
  return uid(rng);
}

#define PR(x) cout<<#x<<": "<<x<<"\n";
#define PR1(x,y) cout<<#x<<": "<<x<<"  |  "<<#y<<": "<<y<<"\n";
#define PR2(x,y,z) cout<<#x<<": "<<x<<"  |  "<<#y<<": "<<y<<"  |  "<<#z<<": "<<z<<"\n";
#define ED cout<<'\n';

#define IO              ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FILEIO          freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define all(v)          v.begin(),v.end()
#define endl            '\n'
#define fr1(j,n)        for(int j=0;j<n;j++)
#define fr(n)           for(int i=0;i<n;i++)
#define trav(x,s)       for(auto x:s)
#define PB              push_back
#define pii             pair<int,int>
#define pll             pair<long long int,long long int>
#define F               first
#define S               second 
#define binf            2000000000000000001
#define mod             1000000007

const int N=2e5+99; 
vector<int> g[N];

ll ans=1,n,k;

void dfs(int v,int p)
{
    ll cnt=k-1;
    if(p!=-1) cnt--;

    trav(x,g[v])
    if(x!=p)
    {
        ans=(ans*cnt)%mod;
        cnt--;
        dfs(x,v);
    }

}


int32_t main() 
{
    IO
        

    
    cin>>n>>k;
    
    fr(n-1)
    {
        int x,y;
        cin>>x>>y;
        g[x].PB(y);
        g[y].PB(x);
    }

    ans=k;
    dfs(1,-1);


    cout<<ans<<endl;    

}




 
    
    

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

const int ma=1000000000;

int main(){
  int n,i;
  cin >> n;
  vector<int> x(n),l(n);
  vector<int> a(n,0);
  vector<pair<int,int>> xl(n);
  for(i=0;i<n;++i){
    cin >> x[i] >> l[i];
    xl[i]=make_pair(x[i]+l[i],x[i]-l[i]);
  }
  sort(xl.begin(),xl.end());
  int ans=0;
  int cal=-ma;
  for(i=0;i<n;++i){
    if(cal<=xl[i].second){
      ans++;
      cal=xl[i].first;
    }
  }
  cout << ans << endl;
  return 0;
}


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

 public class Main{
// taking inputs
static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;}
static int int_v (String s1){return Integer.parseInt(s1);}
static long long_v(String s1){return Long.parseLong(s1);}
static int[] int_arr() throws IOException{String[] a=read().split(" ");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}
static long[] long_arr() throws IOException{String[] a=read().split(" ");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}
static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}

//......................................@uthor_Alx..............................................


   public static void main(String[] args) throws  IOException{
	        		  assign();
	        		  //aint n=int_v(read());
	        		  int[] n=int_arr();
	        		  int j=1;
	        		  while(n[0]>0&&n[2]>0){
	        		  	 if(j%2==1){
	        		  	 	n[2]-=n[1];
	        		  	 }
	        		  	 else{n[0]-=n[3];}
	        		  	 j++;
	        		  }
	        	
	        		 if(n[0]>0){out.write("Yes");}
	        		 else{out.write("No");}
                      out.flush();
	        		 
	}
}
	       
	          



	
  





Measured memory_bytes: 32664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main(){

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, m;
	cin >> n >> m;
	vector<int> V(n);
	int sum = 0;
	for(int i = 0; i < n; i++){
		cin >> V[i];
		sum += V[i];
	}
	double leastVotes = (double)sum / (4 * m);
	sort(V.begin(), V.end());
	reverse(V.begin(), V.end());
	cout << (V[m-1] >= leastVotes ? "Yes" : "No");


}

Measured memory_bytes: 256
while True:
    x =int(input())

    if x == 0:
        break

    y = input()
    list = y.split()
    list_i = [int(s) for s in list]

    list2 = []
    ave = sum(list_i) / len(list_i)

    for a in range(0, x):
        b = list_i[a] - ave
        b2 = b ** 2
        list2.append(b2)

    ave2 = sum(list2) / len(list2)
    ans = ave2 ** 0.5
    print(ans)


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

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> A(n);
    for (auto &a: A) cin >> a;
    vector<int> C(n + 1);
    for (auto &a: A)
        C[a]++;

    priority_queue<int, vector<int>, greater<int>> Q;
    for (auto &c: C){
        if (c > 0)
            Q.push(c);
    }

    vector<int> ans(n + 1);

    for (int i = n; i > 0; i--){
        if (Q.size() < i)
            continue;
        ans[i] = Q.top();
        if (i == 1)
            break;
        int a, b;
        a = Q.top(); Q.pop();
        for (int j = 0; j < a; j++){
            b = Q.top(); Q.pop();
            Q.push(++b);
        }
    }

    for (int i = 1; i <= n; i++)
        cout << ans[i] << endl;
}

Measured memory_bytes: 5488
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define sz(a)  int((a).size())
#define pb  push_back
#define eb  emplace_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define repC3(vari,varj,vark,n)  for(int vari=0;vari<(n)-2;++vari)for(int varj=vari+1;varj<(n)-1;++varj)for(int vark=varj+1;vark<(n);++vark)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
using namespace std;
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }


int main() {
    int N;
    int ans=0;
    cin>>N;
    int B[N-1]={};
    rep(i,N-1){
        cin>>B[i];
        if(i==0){
            ans+=B[i];
        }else{
            ans+=min(B[i],B[i-1]);
        }
    }
    ans+=B[N-2];
    Out(ans);
    return 0;
}


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

int cnt[400000] = {};

int main() {
	long long int N, A, B;
	cin >> N >> A >> B;
	if(A + B > N + 1 || A * B < N || max(A, B) > N){
		cout << "-1" << endl;
		return 0;
	}
	cnt[0] = B;
	for(int i = 1; i < A; i++){
		cnt[i] = (N - B) / (A - 1);
		if((N - B) % (A - 1) >= i){
			cnt[i]++;
		}
	}
	int sum = 0;
	for(int i = 0; i < A; i++){
		for(int j = sum + cnt[i]; j > sum; j--){
			if(i == A - 1 && j == sum + 1){
				cout << j << endl;
			}else{
				cout << j << " ";
			}
		}
		sum += cnt[i];
	}
	return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include<complex>
#include <cassert>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n; i > 0; i--)
#define mod 1000000007
#define MOD 998244353
#define inf 1e20
typedef long long int ll;
typedef pair<ll, ll> pr;
typedef complex<double> com;


int main(){
	string s,a,d;
	cin >> a>>s>>d;
	cout << "A";
	cout << s[0];
	cout << "C";
	return 0;
}
//Ctrl+Aを使わない

Measured memory_bytes: 256
#include <stdio.h>

int judge ( int a, int b, int c ) {
	if ( a * a + b * b == c * c ) return 1;
	if ( b * b + c * c == a * a ) return 1;
	if ( a * a + c * c == b * b ) return 1;
	else return 0;
}

int main (void) {
	int n , i , a , b , c , flg;
	
	scanf("%d",&n);
	
	for ( i = 0; i < n; i++ ) {
		scanf("%d %d %d",&a,&b,&c);
		
		flg = judge(a,b,c);
		
		if ( flg == 1 ) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	return 0;
}

Measured memory_bytes: 0
import sys
input=lambda: sys.stdin.readline().rstrip()
mod=10**9+7
n=int(input())
edge=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)
inf=10**6
Par=[inf]*n
Par[0]=-1
Deg=[0]*n
Deg[0]=0
Chk=[0]
while Chk:
  c=Chk.pop()
  for next in edge[c]:
    if Par[next]==inf:
      Par[next]=c
      Deg[next]+=1
      Chk.append(next)

from collections import deque
TS=list(v for v in range(n) if Deg[v]==0)
D=deque(TS)
while D:
  v=D.popleft()
  for t in edge[v]:
    if t!=Par[v]:
      Deg[t]-=1
      if Deg[t]==0:
        D.append(t)
        TS.append(t)

Used=[False]*n
C=[0]*n
for i in reversed(range(n)):
  v=TS[i]
  Used[v]=True
  for g in edge[v]:
    if not Used[g]:
      C[g]+=C[v]+1

H=[0]*n
H[0]=1
H[1]=pow(2,mod-2,mod)
for i in range(2,n):
  H[i]=(H[i-1]*H[1])%mod

ans=0
for i in range(n):
  if len(edge[i])==1:
    continue
  else:
    A=[]
    for e in edge[i]:
      if e==Par[i]:
        A.append(n-1-C[i])
      else:
        A.append(C[e]+1)
    cur=1+(len(edge[i])-1)*H[-1]
    for a in A:
      cur-=H[n-1-a]
    ans=(ans+cur)%mod
print((ans*H[1])%mod)


Measured memory_bytes: 61348
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Stack;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
	    Scanner s = new Scanner(System.in);
        int x = s.nextInt(),y=s.nextInt();
        boolean flag =false;

        if(y%2==1)flag=true;

        int max = y/2;
        int min = y/4 + (y%4)/2;

        if(x<min||x>max||flag){
            System.out.println("No");
        }
        else System.out.println("Yes");
    }
}





class Scanner
{
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

    public String next() throws IOException
    {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

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

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

    public String nextLine() throws IOException {return br.readLine();}

    public double nextDouble() throws IOException
    {
        String x = next();
        StringBuilder sb = new StringBuilder("0");
        double res = 0, f = 1;
        boolean dec = false, neg = false;
        int start = 0;
        if(x.charAt(0) == '-')
        {
            neg = true;
            start++;
        }
        for(int i = start; i < x.length(); i++)
            if(x.charAt(i) == '.')
            {
                res = Long.parseLong(sb.toString());
                sb = new StringBuilder("0");
                dec = true;
            }
            else
            {
                sb.append(x.charAt(i));
                if(dec)
                    f *= 10;
            }
        res += Long.parseLong(sb.toString()) / f;
        return res * (neg?-1:1);
    }

    public boolean ready() throws IOException {return br.ready();}


}


Measured memory_bytes: 25408
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for (int i=a; i<b; ++i)
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll X;
    cin >> X;
    ll angle = 0;
    double Xcoor=0,Ycoor=0;
    ll num=0;
    double pi =M_PI;
    while (1)
    {
        angle+=X;
        if (angle>=360) angle-=360;
        Xcoor+=cos((pi/180) * angle);
        Ycoor+=sin((pi/180) * angle);
        ++num;
        if (abs(Xcoor)<=(double)0.0000001 && abs(Ycoor)<=(double)0.0000001) 
        {
            cout << num << "\n";
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 4016
import java.util.Map.Entry;
import java.io.*;
import java.util.*;

public class Main {
	
	static double[] dp;
	static int[] pow;
	
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		int N = sc.nextInt();
		int H = sc.nextInt();
		int W = sc.nextInt();
		int ans = 0;
		for(int i = 0; i < N; i++){
			int A = sc.nextInt();
			int B = sc.nextInt();
			if(A >= H && B >= W) ans++;
		}
		System.out.println(ans);
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}


Measured memory_bytes: 22228
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 0) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll N, M, X;
  std::cin >> N >> M >> X;
  std::vector< ll > va(N+1, 0LL);
  for (ll i = 0; i < M; i++) {
    ll a;
    std::cin >> a;
    va[a]++;
  }

  ll cost1 = 0LL;
  for (ll x = X; x >= 0; x--) {
    if (va[x] > 0) cost1++;
  }

  ll cost2 = 0LL;
  for (ll x = X; x <= N; x++) {
    if (va[x] > 0) cost2++;
  }

  print(std::min(cost1, cost2));
  return 0;
}


Measured memory_bytes: 256
# ABC161D

def f(k):
    if 1 <= k <= 9:
        print(k)
    else:
        nxt = [[0,1], [0,1,2], [1,2,3], [2,3,4], [3,4,5], [4,5,6], [5,6,7], [6,7,8], [7,8,9], [8,9]]
        cum_npi = [0, 9, 35, 110, 327, 956, 2782, 8089, 23527, 68468, 199368]
        for length, begin in enumerate(cum_npi):
            if k < begin:
                found = cum_npi[length - 1]
                break
        begin = 10 ** (length - 1)
        # length, begin, found
        k -= found
        x = [[]] * (length + 1)
        x[1] = list(range(1, 10))
        # x

        terminate = False
        i = 1
        while True:
            #print(f"a) i = {i}  x = {x}")
            if len(x[i]): # len(x[i])
                digit = x[i][0]
                if i < length: # i, length
                    i += 1
                    x[i] = nxt[digit].copy()
                    #print(f"x) digit = {digit}  nxt[digit] = {nxt[digit]}  i = {i}  x[i] = {x[i]}")
                    #print(f"b) i = {i}  x = {x}")
                    if i == length: # i, length
                        while len(x[i]): # i, x[i]
                            k -= 1
                            #print(f"c) i = {i}  x = {x}, k = {k}")
                            if k == 0:
                                x.pop(0)
                                #print("answer =", x)
                                ans = "".join([str(j.pop(0)) for j in x])
                                print(ans)
                                terminate = True
                                break
                            else:
                                x[i].pop(0)
                            #print(f"d) i = {i}  x = {x}")
                        else:
                            #print(f"e) i = {i}  x = {x}")
                            while len(x[i]) == 0:
                                i -= 1
                                x[i].pop(0)
                        if terminate:
                            break

f(int(input()))


Measured memory_bytes: 9324
from sys import stdin
def main():
  from builtins import range
  readline = stdin.readline
  h, w = map(int, readline().split())
  s = [readline().rstrip('\r\n') + '#' for _ in range(h)]
  s.append('#' * w)
  yoko = [[0] * w for _ in range(h)]
  for i in range(h):
    start = -1
    si = s[i]
    yokoi = yoko[i]
    for j in range(w + 1):
      if si[j] == '#':
        if start != -1:
          t = j - start
          yokoi[start:j] = [t] * t
          start = -1
      else:
        if start == -1:
          start = j
  result = 0
  for i in range(w):
    start = -1
    for j in range(h + 1):
      if s[j][i] == '#':
        if start != -1:
          t = yoko_max + j - start - 1
          if t > result:
            result = t
          start = -1
      else:
        yji = yoko[j][i]
        if start == -1:
          start = j
          yoko_max = yji
        else:
          if yji > yoko_max:
            yoko_max = yji
  print(result)
main()

Measured memory_bytes: 38900
N,M,Q = map(int,input().split())
src = [input() for i in range(N)]
qs = [tuple(map(int,input().split())) for i in range(Q)]

blue_cum = [[0 for j in range(M+1)] for i in range(N+1)]
for i in range(N):
    for j in range(M):
        blue_cum[i+1][j+1] += blue_cum[i+1][j] + int(src[i][j])
for i in range(N):
    for j in range(M+1):
        blue_cum[i+1][j] += blue_cum[i][j]

h_edge = [[0 for j in range(M)] for i in range(N+1)]
for i in range(N):
    for j in range(M-1):
        h_edge[i+1][j+1] += h_edge[i+1][j] + int(src[i][j:j+2]=='11')
for i in range(N):
    for j in range(M):
        h_edge[i+1][j] += h_edge[i][j]

v_edge = [[0 for j in range(M+1)] for i in range(N)]
for i in range(N-1):
    for j in range(M):
        v_edge[i+1][j+1] += v_edge[i+1][j] + int(src[i][j]=='1' and src[i+1][j]=='1')
for i in range(N-1):
    for j in range(M+1):
        v_edge[i+1][j] += v_edge[i][j]

ans = []
for y1,x1,y2,x2 in qs:
    y1 -= 1
    x1 -= 1
    blue = blue_cum[y1][x1] - blue_cum[y1][x2] - blue_cum[y2][x1] + blue_cum[y2][x2]
    edge = h_edge[y1][x1] - h_edge[y1][x2-1] - h_edge[y2][x1] + h_edge[y2][x2-1]
    edge+= v_edge[y1][x1] - v_edge[y1][x2] - v_edge[y2-1][x1] + v_edge[y2-1][x2]
    ans.append(blue - edge)
print(*ans, sep='\n')

Measured memory_bytes: 201296
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define REP(i, n) for(i=0; i<n; i++)
#define REPR(i, n) for(i=n; i>=0; i--)
#define FOR(i, m, n) for(i=m; i<n; i++)
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 10000000000
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int main(void) {
    ll N, M, i, j;
    cin >> N >> M;
    P p[100001] ;
    ll ans=0, t;
    for(i=1; i<=M; i++) {
        cin >> p[i].second >> p[i].first;
    }
    sort(p+1, p+M+1);
    
    t=p[1].first-1;
    ans++;
    for(i=1; i<=M; i++) {
        if(p[i].second<=t && t<p[i].first) continue;
        else {
            ans++;
            t=p[i].first-1;
        }
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 1920
n = int(input())
l = [list(map(int, input().split())) for i in range(2)]
ans = 0

def f(y, x, count):
  global ans

  if y == 1 and x == n-1:
    ans = max(ans, count+l[y][x])
    return
  
  if x == 0 and y == 0 and not x + 1 > n-1:
    f(y, x+1, count+l[y][x])
  else:
    if not y + 1 > 1:
      f(y+1, x, count+l[y][x])
    
    if not x + 1 > n-1:
      f(y, x+1, count+l[y][x])
  
f(0, 0, 0)

print(max(ans, l[0][0] + sum(l[1])))


Measured memory_bytes: 3064
import java.util.*;
public class Main {

	public static void main(String[] args) {		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next() , T = sc.next();
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<N;i++) {
			
			sb.append(S.charAt(i));
			sb.append(T.charAt(i));
			
		}
		System.out.println(sb.toString());
	}

	
}



Measured memory_bytes: 21716
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[][] dp = new long[n-1][21];
        int[] a = new int[n-1];
        for (int i = 0; i < a.length; i++) {
            a[i]=sc.nextInt();
        }
        int ans = sc.nextInt();
        dp[0][a[0]]=1;
        for (int i = 1; i < dp.length; i++) {
            for (int j = 0; j < dp[i].length; j++) {
                if(j-a[i]>=0 && j-a[i]<=20)
                    dp[i][j] += dp[i-1][j-a[i]];
                if(j+a[i]>=0 && j+a[i]<=20)
                    dp[i][j] += dp[i-1][j+a[i]];
            }
        }
        System.out.println(dp[dp.length-1][ans]);
    }

}

Measured memory_bytes: 18136
import java.util.*;

public class Main{
    public static void main(String[] args)throws Exception{
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        
        if(a<b && b<c){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}


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

// definitions
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i, l, r) for (long long i = (l); i < (long long)(r); i++)
#define repb(i, r, l) for (long long i = (r); i > (long long)(l); i--)
#define high(x) __builtin_popcountll(x)
#define pb push_back
#define pf push_front
#define mod1 998244353
#define mod 1000000007
#define MAX_CHAR 256
#define pi 3.1415926535897932384



using namespace std;
typedef vector<long long> vl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector< pair<long long, long long> > vp;
typedef vector<tuple<long long , long long , long long> > vtup;
typedef deque <long long> dql;
typedef deque <char> dqc;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

ll INF=1e18;



// prevent collisions in unordered_map
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

template <class T>
void read(T arr[],ll n) {rep(i,0,n) cin>> arr[i];}

typedef unordered_map <long long, long long, custom_hash> umap;


// standard functions
ll mystoi(string str)
{
    stringstream ss(str);
    ll ans=0;
    ss >> ans;

    return ans;
}

ll exp(ll x, ll ex, ll p) {
    ll ans = 1ll;
    while (ex > 0) {
        if (ex & 1ll) ans = (ans * x)%p;
        ex >>= 1ll;
        x = (x * x)%p;
    }
    return ans;
}

bool sort_cond(const pair<ll,ll> &a, const pair <ll,ll> &b)
{
    return ((a.f-a.s)>(b.f-b.s));
}


// code beigns in main
int main()
{

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
    
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll t=1;
    // cin >> t;
    while(t--)
    {
        ll n;
        cin >> n;

        cout << ((n%2)?(n/2+1):(n/2)) << endl;
    }
}

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

namespace QQ
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 1; i <= 9; ++i)
            {
                for (int j = 1; j <= 9; ++j)
                {
                    Console.WriteLine(i + "x" + j + "=" + i * j);
                }
            }
        }
    }
}



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

int main(){
  long n, ans = 0, max_to_now = 0;
  cin >> n;
  for(int i=0; i<n; i++){
    long a;  cin >> a;
    if(max_to_now > a)
      ans += max_to_now - a;
    else
      max_to_now = a;
  }
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <map>

using namespace std;
map<char, int> roman;

void init() {
    roman['I'] = 1    ;
    roman['V'] = 5    ;
    roman['X'] = 10   ;
    roman['L'] = 50   ;
    roman['C'] = 100  ;
    roman['D'] = 500  ;
    roman['M'] = 1000 ;
}

int to_alnum(const string &s) {
    int alnum = 0;

    int i;
    for (i = 0; i < s.size()-1; i++) {
        if (roman[s[i]] < roman[s[i+1]]) {
            alnum += roman[s[i+1]] - roman[s[i]];
            i++;
        } else {
            alnum += roman[s[i]];
        }
    }

    if (i != s.size()) {
        alnum += roman[s[s.size()-1]];
    }

    return alnum;
}
int main() {
    string s;
    init();
    while (cin >> s) {
        cout << to_alnum(s) << endl;
    }
    return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define repi(i, a, b) for (int i = (a); i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))

using namespace std;
using i32 = long long;
using u32 = unsigned long long;
using i64 = long long;
using u64 = unsigned long long;
using f64 = double;
using vi32 = vector<i32>;
using vu32 = vector<u32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf64 = vector<f64>;
using vstr = vector<string>;
using vvi32 = vector<vi32>;
using vvu32 = vector<vu32>;
using vvi64 = vector<vi64>;
using vvu64 = vector<vu64>;
using vvf64 = vector<vf64>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

i64 dp[100010];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  int n, k;
  cin >> n >> k;
  vi32 h(n + 1);
  reps(i, n) cin >> h[i];
  dp[1] = 0;
  reps(i, n - 1) dp[i + 1] = 1e18;
  reps(i, n - 1) reps(j, k) {
    if (i + j > n) continue;
    amin(dp[i + j], dp[i] + abs(h[i + j] - h[i]));
  }
  cout << dp[n] << endl;
  return 0;
}


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

int main() {
  int N,K,Q;
  cin >> N >> K >> Q;
  int s = Q - K ;
  int a[100100];
  for(int i=0;i<N;i++){
    a[i]=0;
  }
  for(int i=0;i<Q;i++){
    int x;
    cin >> x;
    a[x-1] +=1;
  }       
  for(int i=0;i<N;i++){
    if(a[i]>s) cout << "Yes" <<endl;
    else  cout << "No" <<endl;
  }
}

Measured memory_bytes: 1024
# C
N = int(input())
A_list = list(map(int, input().split()))

# LCM
def LCM(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        a, b = b, a % b
        if b == 0:
            break
    return a
res = A_list[0]
for i in range(N):
    res = LCM(res, A_list[i])
print(res)

Measured memory_bytes: 14252
#include <stdio.h>

int main()
{
	int a,b;
	scanf("%d %d", &a, &b);
	if(a<b){
		printf("a < b\n");
	}
	else if(a==b){
		printf("a == b\n");
	}
	else{
		printf("a > b\n");
	}
	return 0;
}

Measured memory_bytes: 580
program b175

implicit none
integer(16) :: n, i, j, k, z, m
integer(16), allocatable :: l(:)

z = 0

read *, n

allocate(l(1:n))

read *, l(:)

!print '(I1)', l(:)

  do i=1,n-1
     do j=i+1,n
        if(l(i) < l(j))then
           m = l(i)
           l(i) = l(j)
           l(j) = m
        end if
     end do
  end do

!print '(I1)', l(:)

do i = 1, n
 do j = i+1, n
  do k = j+1, n
   !print '(3(I1))', l(i), l(j), l(k)
   if(l(i) - l(j) < l(k) .and. l(j) /= l(k) .and. l(i) /= l(j)) then
   !print *, 'o'
   z = z + 1
   end if
  end do
 end do
end do

print *, z

end program b175

Measured memory_bytes: 2864
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string s;
    int n;
    cin>> n >> s;
    for(int i=0; i<s.size(); i++){
        if(s[i]+n>90){
            cout<< (char)(s[i]+n-26);
        }
        else{
            cout<<  (char)(s[i]+n);
        }
    }
    cout << endl;
}

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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

#define INF 1e9
bool cmp(pair<ll, ll> l, pair<ll, ll> r){
  return l.first+l.second < r.first + r.second;

}
int main(){
  int N;
  cin >> N;
  vector<pair<ll, ll>> XL(N);
  REP(i, N){
    cin >> XL[i].first >> XL[i].second;
  }
  sort(XL.begin(), XL.end(), &cmp);
  ll ans = 0, pre = -INF-5;
  REP(i, N){
    // cout << "XL" << XL[i].first << " " << XL[i].second << endl;
    if(pre <= XL[i].first - XL[i].second){
      ans++;
      pre = XL[i].first + XL[i].second;
      // cout << i << " " << pre << endl;
    }
  }
  cout << ans << endl;
  return 0; 
}

Measured memory_bytes: 1792