akhauriyash/Code-Regression huggingface dataset:
{
  const main = (input: string): void | string | number => {
    const r = _reader(input)
    const [x, a, b] = r.nn()
    // k日前に食べた
    const k = a - b

    if (k >= 0) {
      return 'delicious'
    } else if (x + 1 > -k) {
      return 'safe'
    }
    return 'dangerous'
  }

  const _reader = (str: string, i = 0) => {
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')
    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map(v => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  const _getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')
  const _res = main(_getInput())

  if (typeof _res === 'number' || typeof _res === 'string') console.log(_res)
}


Measured memory_bytes: 7372
int main(void){
  int n, m;
  scanf("%d%d", &n, &m);
  long sum=0;
  for(int i=0; i<m; i++){
    int a;
    scanf("%d", &a);
    sum+=a;
  }
  printf(sum>n?"-1\n":"%d\n", n-sum);
}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define sort(a) sort(a.begin(),a.end())
typedef long long ll;
const int MOD = (int)(1e9+7);
const int INF = (int)(1e9+1e7);
const ll INFL = (ll)(1e17);
const double EPS = 1e-8;
using namespace std;
int main()
{
  int N;
  cin >> N;
  string S,T;
  cin >> S >> T;
  rep(i,N){
      cout << S[i] << T[i];
  }
  cout << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

void main(void)
{
  char str[4];
  scanf("%s",str);
  if((str[0]=='7')||(str[1]=='7')||(str[2]=='7')){
    printf("Yes");
  }else{
    printf("No");
  }

}

Measured memory_bytes: 1732
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

char str[100005];
ll dp[100005][13];

int main(int argc, char* argv[])
{
    scanf("%s", str);
    int n=strlen(str);

    dp[0][0]=1;
    int i,j;
    for(i=0; i<n; i++) {
        for(j=0; j<13; j++) {
            if(dp[i][j]) {
                if(str[i]=='?') {
                    int k;
                    for(k=0; k<10; k++) {
                        dp[i+1][(j*10+k)%13] = (dp[i+1][(j*10+k)%13] + dp[i][j])%MOD;
                    }                    
                }
                else {
                    int k=str[i]-'0';
                    dp[i+1][(j*10+k)%13] = (dp[i+1][(j*10+k)%13] + dp[i][j])%MOD;
                }                
            }
        }
    }
    printf("%lld\n", dp[n][5]);

    return 0;
}


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

int main(){
  int N;
  cin>>N;
  vector<int> data(N);
  for(int i=0;i<N;i++){
    cin>>data.at(i);
  }
  sort(data.begin(),data.end());
  reverse(data.begin(),data.end());
  int sum = 0;
  for (int i = 0; i < N; i++)
  {
    if(i%2==0)
      sum += data.at(i);
    else
      sum -= data.at(i);
  }
  cout << sum << endl;
}

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

int main(){
	int a,b;
	while(cin>>a>>b){
		int a2=a;
		int b2=b;
		while(true){
			if(a>b){
				a=a%b;
			}else{
				b=b%a;
			}
			if(a==0||b==0)break;
		}
	cout<<max(a,b)<<" "<<a2/max(a,b)*b2<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cctype>
#include <ctime>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define eps 1e-9
#define PI acos(-1.0)
#define lc id << 1
#define rc id << 1 | 1
#define lson low, mid, lc
#define rson mid + 1, high, rc

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

const int maxn = 1e5 + 10;
int n, a, b, edge = 0, key;
int head[maxn * 2], Next[maxn * 2], to[maxn * 2], path[maxn], size[maxn];
bool vis[maxn];

inline void add_edge(int u, int v) {
    to[edge] = v; Next[edge] = head[u]; head[u] = edge++;
}

int dfs(int u, int _depth) {
    path[_depth] = u; vis[u] = true;
    if (u == n) { key = path[_depth / 2 + 1]; }
    for (int i = head[u]; i != -1; i = Next[i]) {
        if (vis[to[i]]) { continue; }
        size[u] += dfs(to[i], _depth + 1);
    }
    return size[u];
}

int main() {
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif // __AiR_H
    scanf("%d", &n); memset(head, -1, sizeof(head));
    for (int i = 0; i < n - 1; ++i) {
        scanf("%d %d", &a, &b); add_edge(a, b); add_edge(b, a);
    }
    for (int i = 1; i <= n; ++i) { size[i] = 1; }
    dfs(1, 0);
//    for (int i = 1; i <= n; ++i) {
//        printf("i = %d, %d\n", i, size[i]);
//    }
    int ans1 = size[1] - size[key], ans2 = size[key];
//    printf("ans1 = %d, ans2 = %d\n", ans1, ans2);
    if (ans1 > ans2) { printf("Fennec\n"); }
    else { printf("Snuke\n"); }
#ifdef __AiR_H
    printf("Time used = %.2fs\n", (double)clock() / CLOCKS_PER_SEC);
#endif // __AiR_H
    return 0;
}


Measured memory_bytes: 6528
N,M=map(int,input().split(' '))
l = [[] for i in range(N)]
ans = ''
for i in range(M):
    s,c=map(int,input().split(' '))
    s = s-1
    l[s].append(c)
for n,i in enumerate(l):
    if len(set(i)) >=2:
        print(-1)
        exit()
    elif N != 1 and n==0 and i==[]:
        ans += '1'
    elif i==[]:
        ans +='0'
    else:
        ans += str(i[0])
if len(str(int(ans))) == N:
    print(ans)
else:
    print(-1)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner N =new Scanner(System.in);
		int l = N.nextInt();
		if((l-9)%10==0) {
			System.out.println("Yes");
		} else if(90<=l && l<99) {
			System.out.println("Yes");}
		else {
			System.out.println("No");
		}
		
			
	}

}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);




int main()
{
    int q=1;

    while(q--)
    {
       ll n;  cin>>n;
        int arr[n];
        for(int i=0;i<n;i++)
            cin>>arr[i];
        sort(arr,arr+n);
        ll sum=arr[n-1];
        int time=n-2;
        for(int i=n-2;i>=0&&time;i--)
            {
                sum+=arr[i];
                time--;
                if(time==0)
                    break;
                sum+=arr[i];
                time--;
            }
        cout<<sum;
    }


    return 0;
}


Measured memory_bytes: 4376
#!/usr/bin/env python3
x, y = map(int, input().split())
ans = float('inf')
f = lambda z: [ z, float('inf') ][ z < 0 ]
ans = min(ans, f(   y  -    x )    )
ans = min(ans, f(   y  - (- x)) + 1)
ans = min(ans, f((- y) -    x ) + 1)
ans = min(ans, f((- y) - (- x)) + 2)
print(ans)

Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdlib.h>
#include<stdio.h>
#include<vector>
#include<utility>
#include<queue>
#include<stdbool.h>
#include<math.h>
typedef long long ll;
#define N (1000000000+7)
using namespace std;
typedef pair<int, int> P;

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

ll prime[100010];
ll kaijo[200010];
void init() {
	kaijo[0] = 1;
	for (ll i = 1;i <= 200000;i++)kaijo[i] = (kaijo[i - 1] * i) % N;
}

ll inv(ll x) {
	ll res = 1;
	ll k = N - 2;
	ll y = x;
	while (k) {
		if (k & 1)res = (res*y) % N;
		y = (y%N*y%N) % N;
		k /= 2;
	}
	return res;
}

ll Comb(ll n, ll k) {
	ll b = kaijo[n];
	ll c = kaijo[n - k];
	ll d = kaijo[k];
	ll cd = (c*d) % N;
	return ((b%N)*(inv(cd)%N) + N) % N;
}


int main(void) {
	ll x, y, ans = 1;
	cin >> x >> y;
	while (true) {
		if (2 * x <= y) {
			x *= 2;
			ans++;
		}
		else break;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
"""bfs"""

import sys
sys.setrecursionlimit(10**6)

n = int(input())

to = [[] for _ in range(n)]
cost = [[] for _ in range(n)]

for i in range(n-1):
    a,b,w = map(int, input().split())
    a -= 1; b -= 1
    to[a].append(b); cost[a].append(w)
    to[b].append(a); cost[b].append(w)

ans = [-1]*n # 頂点を探索済みかどうか判定するために初期値を-1に
ans[0] = 0

import queue

q = queue.Queue()
q.put(0)

while not q.empty():
    v = q.get()
    for i in range(len(to[v])):
        u = to[v][i]
        w = cost[v][i]
        if ans[u] != -1: continue
        ans[u] = (ans[v]+w)%2
        q.put(u)
        
print(*ans)

Measured memory_bytes: 41524
#include <stdio.h>
#include <math.h>

struct Point { double x, y; };

void koch(int n, Point a, Point b){
    if (n == 0) return;
    Point s, t, u;
    double th = M_PI * 60.0 / 180.0;

    s.x = (2.0 * a.x + 1.0 * b.x) / 3.0;
    s.y = (2.0 * a.y + 1.0 * b.y) / 3.0;
    t.x = (1.0 * a.x + 2.0 * b.x) / 3.0;
    t.y = (1.0 * a.y + 2.0 * b.y) / 3.0;
    u.x = (t.x - s.x) * cos(th) - (t.y - s.y) * sin(th) + s.x;
    u.y = (t.x - s.x) * sin(th) + (t.y - s.y) * cos(th) + s.y;

    koch(n - 1, a, s);
    printf("%.8f %.8f\n", s.x, s.y);
    koch(n - 1, s, u);
    printf("%.8f %.8f\n", u.x, u.y);
    koch(n - 1, u, t);
    printf("%.8f %.8f\n", t.x, t.y);
    koch(n - 1, t, b);
}

int main()
{
    Point a, b;
    int n;

    scanf("%d", &n);
    a.x = 0;
    a.y = 0;
    b.x = 100;
    b.y = 0;

    printf("%.8f %.8f\n", a.x, a.y);
    koch(n, a, b);
    printf("%.8f %.8f\n", b.x, b.y);
    return 0;
}


Measured memory_bytes: 2696
import sys
input=sys.stdin.readline
n=int(input())
l=[int(input()) for i in range(n)]
if l[0]!=0:
    print(-1)
    quit()
l.reverse()
l+=[0]
ans=0
i=0
while i<n-1:
    if l[i]>n-i-1:
        print(-1)
        quit()
    if l[i+1]+1==l[i]:
        ans+=l[i]
        while l[i+1]+1==l[i]:
            i+=1
        i+=1
    elif l[i+1]+1<l[i]:
        print(-1)
        quit()
    else:
        ans+=l[i]
        i+=1
print(ans)

Measured memory_bytes: 11052
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<bitset>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<queue>
#include<map>

using namespace std;

int read()
{
	int ans=0,f=1;
	char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
	return ans*f;
}

const int N=2e5+5;
int n,k,l,r,a[N],ans;

inline bool check(int x);

int main()
{
	n=read();k=read();
	for(int i=1;i<=n;++i)
		a[i]=read(),r=max(r,a[i]);
	l=1;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(check(mid))
		{
			ans=mid;
			r=mid-1;
		}
		else l=mid+1;
	}
	printf("%d\n",ans);
	return 0;
} 

inline bool check(int x)
{
	int sum=0;
	for(int i=1;i<=n;++i)
	{
		sum+=a[i]/x;
		if(a[i]%x==0)
			sum--;
	}
		
	if(sum<=k) return 1;
	return 0;
}

Measured memory_bytes: 4404
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
 
typedef long long ll;
typedef vector <bool> v_bool;
typedef vector <ll> v_ll;
typedef vector <vector <ll> > vv_ll;
typedef vector < pair <ll,ll> > vp_ll;
typedef pair <ll,ll> p_ll;
 
bool TEST=false;
ll MOD = 1000000007;
 
void show(){if (TEST){cout << endl;}}
void show(string x){if (TEST){cout << x;}}
void show(string x,bool enter){
  if (TEST){if (enter) cout << "<#> " << x << endl;else cout << x;}
}
void show(ll x){if (TEST){cout << x;}}
void show(ll x,bool enter){
  if (TEST){if (enter) cout << "<#> " << x << endl;else cout << x;}
}
void show(p_ll p){
  if (TEST){cout << "{ ";show(p.first);cout << " ";show(p.second);cout << " }";}
}
void show(v_ll v){
  if (TEST){
    cout << "<begin> ";
    for (ll i=0;i<v.size();i++){show(v[i]); cout << " ";}cout <<"<end>"<< endl;
}}
void show(vv_ll v){
  if (TEST){
    cout << "//////////" << endl;
    for (ll i=0;i<v.size();i++){
      show(v[i]); cout << endl;
}}}
void show(vp_ll v){
  if (TEST){
    cout << "//////////" << endl;
    for (ll i=0;i<v.size();i++){
      show(v[i]); cout << endl;
}}}
 
ll mod(ll x){
  ll n=MOD;
  ll ret=x%n;
  if (ret<0)ret+=n;
  return ret;
}
void mod_self(ll &x){
  x=mod(x);
}
ll mod_inv(ll x){
  ll n=MOD;
  ll y = x,z = n-2, ret=1;
  y=mod(y);
  while (z>0){
    if(z%2==1) ret=mod(ret*y);
    y=mod(y*y);
    z/=2;
  }
  return ret;
}
ll mod_pow(ll x,ll a){
  ll y = x,z = a,ret=1;
  y=mod(y);
  if (z<0)z=-z;
  while (z>0){
    if(z%2==1) ret=mod(ret*y);
    y=mod(y*y);
    z/=2;
  }
  if (a<0) ret=mod_inv(ret);
  return ret;
}
v_ll mod_nck(ll n){
  v_ll nck(n+1,0);
  nck[0]=1;
  for (ll i=1;i<=n;i++){
    nck[i]=mod(nck[i-1]*(n+1-i));
    nck[i]=mod(nck[i]*mod_inv(i));
  }
  return nck;
}
v_ll mod_factorial(ll n){
  v_ll fct(n+1,0);
  fct[0]=1;
  for (ll i=1;i<=n;i++){
    fct[i]=mod(fct[i-1]*i);
  }
  return fct;
}
 
ll N;
int main(){
  cin >> N;
  cout << setprecision(12) << ((double)((N+1)/2)/(double)N) <<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;


int main()
{
	int A, B, C;
	int arr[11] = {};
	cin >> A >> B >> C;
	arr[A]++;
	arr[B]++;
	arr[C]++;
	if (2 == arr[5] && 1 == arr[7]) cout << "YES" << endl;
	else cout << "NO" << endl;
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

LL fl(LL a, LL b) { assert(b > 0); return (a > 0 ? a / b : (a - b + 1) / b); }
LL ce(LL a, LL b) { assert(b > 0); return (a < 0 ? a / b : (a + b - 1) / b); }

int n, a, b, c[300000];
vector<int> v;

int main() {
	cin >> n >> a >> b;
	
	if(! (a + b - 1 <= n && a >= ce(n, b) && b >= ce(n, a))) { cout << -1 << endl; return 0; }
	
	int w = n - (a + b - 1);
	inc(i, a) {
		if(i == 0) { v.PB(b); }
		else {
			v.PB(min(w, b - 1) + 1);
			w -= min(w, b - 1);
		}
	}
	assert(w == 0);
	
	int p = 0;
	inc(i, a) {
		inc(j, v[i]) {
			c[p + j] = p + v[i] - j;
		}
		p += v[i];
	}
	
	inc(i, n) { cout << (i == 0 ? "" : " ") << c[i]; }
	cout << endl;
	
	return 0;
}


Measured memory_bytes: 4212
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;

    if(a==b && b!=c)
    {
        cout<<"Yes";
    }
    else if(a==c && b!=a)
    {
        cout<<"Yes";
    }
    else if(b==c && b!=a)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }

}


Measured memory_bytes: 256
#include <stdio.h>

int N;
long long a;
int main(){
        long long cnt = 0;
        scanf("%d",&N);
        for(int i = 0; i < N; i++){
                scanf("%lld", &a);
                while(a%2==0){ a /= 2; cnt++;}
        }
        printf("%lld\n",cnt);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

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

	int s, w;
	cin >> s >> w;
	if (w >= s)
		cout << "unsafe" << endl;
	else
		cout << "safe" << endl;
}



Measured memory_bytes: 3648
import sys
input=sys.stdin.readline
K = int(input())
LEN = 32345666
#S = input()[:-1]
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = list(map(int,input().split()))
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
def enqueue(Q,x,tail):#末尾にクラスPの要素xを加える。ぐるっと回った場合
    Q[tail] = x       #以前dequeueで取り出したものが書き換えられる。
    if tail+1 == LEN: #headは先頭のindex,tailは末尾のindex+1
        tail = 0
    else:
        tail += 1
    return tail
def dequeue(Q,head):
    x = Q[head]
    if head+1 == LEN:
        head = 0
    else:
        head += 1
    return x,head
Q = [1,2,3,4,5,6,7,8,9]+[0]*(LEN-9)
head = 0
tail = 9

i = 0
while i < K:
    x,head = dequeue(Q,head)
    if x % 10 == 0:
        tail = enqueue(Q,10*x,tail)
        tail = enqueue(Q,10*x+1,tail)
    elif x % 10 == 9:
        tail = enqueue(Q,10*x+8,tail)
        tail = enqueue(Q,10*x+9,tail)
    else:
        y = x%10
        tail = enqueue(Q,10*x+y-1,tail)
        tail = enqueue(Q,10*x+y,tail)
        tail = enqueue(Q,10*x+y+1,tail)
    i += 1
print(x)

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

int main(){
    int n,c;
    cin>>n;
    c=n;
    char a[n];

    for(int i=0;i<n;i++){
        cin>>a[i];
    }
     for(int i=0;i<n;i++){
        if(a[i]==a[i+1])
            c=c-1;
    }
    cout<<c;
return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define END return 0
typedef int64_t ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    while(1) {
        c -= b;
        if(c <= 0) {cout << "Yes" << endl; END;}
        a -= d;
        if(a <= 0) {cout << "No" << endl; END;}
    }
}


Measured memory_bytes: 3596
#include <iostream>
using namespace std;
 
int main() {
    //入力を受け取る
    int D, T, S;
    cin >> D >> T >> S;
 
    //高橋君の移動時間を計算する
    int dist = S * T;
 
    //Dとdistの大小関係に応じて出力をする
    if (dist >= D) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
int n,k,i,x,ma,r,cm;
int main()
{
   // freopen("a.in","r",stdin);
//freopen("a.out","w",stdout);
    scanf("%d%d",&n,&k);
    for(i=1; i<=n; ++i)
    {
        scanf("%d",&x);
        if(i==1)cm=x;
        ma=max(ma,x);
        r=cm%x;
        while(r!=0)
        {
            cm=x;
            x=r;
            r=cm%x;
        }
        cm=x;
    }
    if(ma<k||k%cm!=0||k<cm)printf("IMPOSSIBLE");
    else printf("POSSIBLE");
    return 0;
}


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

int main() {
	// your code goes here
	int n,i;
	double v[100],x;
	cin >> n;
	for(i=0;i<n;i++) cin >> v[i];
	sort(v,v+n);
	x=v[0];
	for(i=1;i<n;i++){
		x=(x+v[i])/2;
	}
	printf("%.10f",x);
	return 0;
}

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

int main() {

    long long N, M;
    cin >> N >> M;
    long long result;

    if(N > (M/2)){ // Sの方が多い
        result = M / 2;
    }else{ // cの方が多い
        M -= 2 * N;
        result = N + (M / 4);
    }

    cout << result << endl;
}

Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define Nmax 200010
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define RFOR(i,a,b) for(long long i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<P> Graph;

int main() {
	string s1,s2,s3;
	cin >> s1 >> s2 >> s3;
	if(s1[0]>=97&&s1[0]<=122) s1[0]=s1[0]-32;
	if(s2[0]>=97&&s2[0]<=122) s2[0]=s2[0]-32;
	if(s3[0]>=97&&s3[0]<=122) s3[0]=s3[0]-32;
	cout<< s1[0];
	cout<< s2[0];
	cout<< s3[0]<<endl;
	
	return 0;
}

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

#define ll long

struct Angle {
	ll x,y;
	Angle():x(0),y(1){}
	Angle(ll x_,ll y_) : x(x_),y(y_){}
};

bool startwith( const string &str, const string &s)
{
	if(str.length()<s.length()){
		return false;
	}
	for(int i=0;i<s.size();i++){
		if(str[i]!=s[i]){
			return false;
		}
	}
	return true;
}

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

Angle sum(Angle a0,Angle a1)
{
	Angle a;
	a.x = a0.x*a1.y + a1.x*a0.y;
	a.y = a0.y*a1.y;
	if(a.x!=0){
		ll g = gcd(a.x,a.y);
		a.x/=g;
		a.y/=g;
	}
	return a;
}

int angle(Angle &a, string str)
{
	if( str == "north" ){
		a = Angle(0,1);
		return 1;
	}
	if( str == "west" ){
		a = Angle(90,1);
		return 1;
	}
	
	if( startwith(str,"north")){
		int n = angle( a, str.substr(5,str.length()) );
		a = sum ( a , Angle(-90,(1<<n) ) );
		return n+1;
	}else{
		int n = angle( a, str.substr(4,str.length()) );
		a = sum ( a , Angle(+90,(1<<n) ) );
		return n+1;
	}
}

int main() {
	
	while(true)
	{
		string str;
		cin >> str;
		if( str=="#" ) break;
	
		Angle ans;
		angle( ans, str );

		if( ans.x==0 ){
			cout << "0" << endl;
		}else{
			if( ans.y==1 ){
				cout << ans.x << endl;
			}else{
				cout << ans.x << "/" << ans.y << endl;
			}
		}
	}

	// your code goes here
	return 0;
}

Measured memory_bytes: 1200
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

using namespace std;
typedef long long unsigned int ll;

int main() {
  int S;
  cin >> S;
  int ans = 1;
  int B[1000000] = {};
  while (1) {
    if (B[S]) {
      cout << ans << endl;
      break;
    }
    B[S]++;
    ans++;
    if (S % 2 == 0) {
      S /= 2;
    }
    else {
      S = 3 * S + 1;
    }
  }
  
  return 0;
}

Measured memory_bytes: 4096
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            if ((a & b & 1) == 1)
                out.println("Yes");
            else
                out.println("No");
        }

    }

    static class FastScanner {
        private InputStream in;
        private byte[] buffer;
        private int bufPointer;
        private int bufLength;

        public FastScanner(InputStream in) {
            this.in = in;
            buffer = new byte[1024];
        }

        private boolean hasNextByte() {
            if (bufPointer < bufLength) return true;
            bufPointer = 0;
            try {
                bufLength = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (bufLength > 0);
        }

        private int readByte() {
            return hasNextByte() ? buffer[bufPointer++] : -1;
        }

        private static boolean isPrintableChar(int c) {
            return (c >= 33 && c <= 126);
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[bufPointer]))
                bufPointer++;
            return hasNextByte();
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

        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' || b > '9')
                throw new NumberFormatException();

            while (true) {
                if (b >= '0' && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (!isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

    }
}



Measured memory_bytes: 21076
package main

import (
	"fmt"
	"io"
	"os"
)

func solve(w io.Writer, r io.Reader) {
	var N, K int
	var S string
	fmt.Fscan(r, &N, &S, &K)

	t := S[K-1]
	for i := 0; i < len(S); i++ {
		if S[i] == t {
			fmt.Fprintf(w, "%c", t)
		} else {
			fmt.Fprint(w, "*")
		}
	}
	fmt.Fprint(w, "\n")
}

func main() {
	solve(os.Stdout, os.Stdin)
}


Measured memory_bytes: 512
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define type 26

int constant(int day)//1~26 順番
{
  return day%type+1;
}
int get_random()//1~26 ランダム
{
  return rand()%type+1;
}
int max(int s[][type+1],int day)//その日の最大の満足度選ぶ
{
  int m,max_score=0,i;
  for(i=1;i<=type;i++)
  {
    if(s[day][i]>max_score){
      max_score=s[day][i];
      m=i;
    }
  }
  return m;
}
void cal(int select,int c[type+1],int last[type+1],int s[][type+1],int day,int sum[])
{
  int i;
  sum[day]=sum[day-1]+s[day][select];
  for(i=1;i<=type;i++){
    sum[day]-=c[i]*(day-last[i]);
  }
}
void change(int c[type+1],int last[type+1],int s[][type+1],int sum[],int schedul[],int D)
//ランダムに変更
{
  int d,t,old,total=0,i,j;
  d=rand()%D+1;
  t=rand()%type+1;
  old=schedul[d];
  schedul[d]=t;
  for(i=1;i<=type;i++) last[i]=0;
  for(i=1;i<=D;i++){
    total+=s[i][schedul[i]];
    last[schedul[i]]=i;
    for(j=1;j<=type;j++){
     total-=c[j]*(i-last[j]);
   }
  }
  if(total>sum[D]){
  //  printf("change\n");
    sum[D]=total;
  }
  else{
    schedul[d]=old;
  }
}
int main(void)
{
  int D,c[type+1],i,j;
  clock_t start,stop;
  srand((unsigned int)time(NULL));
  scanf("%d",&D);//D=365
  int s[D+1][type+1],last[type+1],sum[D+1],schedul[D+1];
  for(i=0;i<=D;i++) sum[i]=0;
  for(i=1;i<=type;i++) last[i]=0;
  for(i=1;i<=type;i++) scanf("%d",&c[i]);
  for(i=1;i<D+1;i++){
    for(j=1;j<=type;j++) scanf("%d",&s[i][j]);
  }
  start=clock();
  for(i=1;i<D+1;i++){
    int select;
    select=constant(i);
    last[select]=i;
    schedul[i]=select;
    cal(select,c,last,s,i,sum);
    //printf("%d\n",sum[i]);
  }
  int count=0;
  stop=start;
  while((double)(stop - start) / CLOCKS_PER_SEC<1.98){
    change(c,last,s,sum,schedul,D);
    count++;
    stop=clock();
  }
  /*
  printf("count:%d\n",count);
  printf("time:%f\n",(double)(stop - start) / CLOCKS_PER_SEC);
  printf("%d\n",sum[D]);
  printf("確認\n");
  int total=0;
  for(i=1;i<=type;i++) last[i]=0;
  for(i=1;i<=D;i++){
    total+=s[i][schedul[i]];
    last[schedul[i]]=i;
    for(j=1;j<=type;j++){
     total-=c[j]*(i-last[j]);
   }
  }
  printf("%d\n",total);
*/
  for(i=1;i<=D;i++) printf("%d\n",schedul[i]);
  return 0;
}


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

using namespace std;
#define ll long long
#define INF 1000007
#define MOD 1000000007
#define maxn 100
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

typedef std::pair<int, int> P;

vector<bool> prime(maxn + 1, true); //素数テーブル
void prime_table(void) {
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= maxn; i++) {
        if (!prime[i]) {
            continue;
        }
        for (int j = i + i; j <= maxn; j += j + i) {
            prime[j] = false;
        }
    }
}

bool IsPrime(int num) //素数判定
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2) {
        if (num % i == 0) {
            return false;
        }
    }

    return true;
}

vector<int> divisor(int n) //約数列挙
{
    vector<int> ret;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i - 1);
            if (i * i != n) {
                ret.push_back((n / i) - 1);
            }
        }
    }
    sort(ret.begin(), ret.end());
    return (ret);
}

int a, b;

void f(int x) {
    a = x % 10;
    b = 0;
    while (x) {
        b = x;
        x /= 10;
    }
}

signed main() {
    ll N;
    cin >> N;
    ll ans = 0;
    for (int i = 1; i <= N; i++) {
        if (i % 3 != 0 && i % 5 != 0) {
            ans += i;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3612
#include <stdio.h>

int main()
{
    int th,ts,ah,as;
    scanf("%d %d",&th,&ts);
    scanf("%d %d", &ah,&as);
    while(1){
        ah-=ts;
        if(ah<=0) break;
        th-=as;
        if(th<=0) break;
    }
    if(th>0) printf("Yes");
    else printf("No");
    return 0;
}

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

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

    vector<int> a(n);
    rep(i, 0, n) cin >> a[i];

    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());

    if (a.size() < n) cout << "NO" << endl;
    else cout << "YES" << endl;
    
    return 0;
}

Measured memory_bytes: 1024
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define all(x) x.begin(),x.end()
#define ln '\n'
const long double PI = acos(-1.0L);
const long long MOD = 1000000007LL;
// const long long MOD = 998244353LL;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
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; }
////////////////////////////////////////////////////////////////////////////////////////////////////////

template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};

using mint = modint<MOD>;


struct ModCombination {
    vector<mint> Fac;
    vector<mint> Facinv;

    ModCombination(int x) {
        Fac.resize(x+1);
        Facinv.resize(x+1);
        Fac[0] = 1;
        for (long long i = 1; i <= x; i++) Fac[i] = Fac[i-1]*i;
        Facinv[x] = Fac[0]/Fac[x];
        for (long long i = x; i > 0; i--) Facinv[i-1] = Facinv[i]*i;
    }

    mint get(int n, int k) {
        if (k < 0 || k > n) return 0;
        return Fac[n]*Facinv[k]*Facinv[n-k];
    }
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int H,W,A,B; cin >> H >> W >> A >> B;
    ModCombination MC(H+W+5);

    mint ans = 0;
    for (int i = B; i < W; ++i) {
        ans += MC.get(H-A-1+i,i)*MC.get(A-1+W-i-1,A-1);
    }

    cout << ans.a << ln;
}



Measured memory_bytes: 3328
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>

using namespace std;

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

int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};

static const double EPS = 1e-8;

double dp[100001][21];

int main(){
	int n;
	
	while(~scanf("%d",&n)){
		if(n==0) break;
		memset(dp,0,sizeof(dp));

		double exp = 0;
		dp[1][1] = 1.0;

		for(int i=1;i<=n;i++){
			for(int j=1;j<=20;j++){
				//dp[i][j]
				//i:day
				//j:success time
				exp += dp[i][j] * pow(0.5,j-1);

				if(j==1){
					dp[i+1][j+1] += dp[i][j];
					continue;
				}

				dp[i+1][1] += dp[i][j] * (1.0 - pow(0.5,j-1));
				dp[i+1][j+1] += dp[i][j] * pow(0.5,j-1);
			}
		}

		printf("%.8lf\n",exp);
	}
}

Measured memory_bytes: 17628
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#define REP(i,a,b) for(register int i=(a); i<(b); i++)
#define REPE(i,a,b) for(register int i=(a); i<=(b); i++)
#define PERE(i,a,b) for(register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
#define MAXN 100007
int a[MAXN],b[MAXN];
int main() {
	int A,B,M;
	scanf("%d%d%d", &A, &B, &M);
	REP(i,0,A) scanf("%d", &a[i]);
	REP(i,0,B) scanf("%d", &b[i]);
	int ma=0x3f3f3f3f, mb=0x3f3f3f3f;
	REP(i,0,A) ma=min(ma,a[i]);
	REP(i,0,B) mb=min(mb,b[i]);
	int ans = ma+mb;
	REP(i,0,M) {
		int x,y,c; scanf("%d%d%d", &x, &y, &c);
		x--,y--;
		ans = min(ans, a[x]+b[y]-c);
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 896
#include <iostream>
#include <cmath>
#include <string>
#include <stack>
using namespace std;

int main() {
	int a, b;
	int n;
	int max,min;
	cin >> n;
	cin >> a;
	cin >> b;

	if (a > b) {
		max = b;
	}
	else {
		max = a;
	}

	min = a + b - n;

	if (min < 0) {
		min = 0;
	}
	cout << max << " " << min << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main()
{
	string s,t;
	cin>>s;
	cin>>t;
	int commonLength = 0;
	for(int i = 0; i <= s.length() - t.length(); i++){
		int localSum = 0;
		for(int j = 0; j < t.length(); j++){
			if( s[i+j] == t[j]) localSum++;
		}
		//cout<<i<<" "<<localSum<<endl;
		commonLength = max(commonLength,localSum);

	}
	cout<<t.length() - commonLength<<endl;
	return 0;
}



Measured memory_bytes: 3168
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
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; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }

int main(void){
    // Your code here!
    int a,b;cin >> a >> b;
    cout << a*b << endl;
}


Measured memory_bytes: 3580
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;
int main() {
  long long N;
  cin >> N;
  cout << N * (N - 1) / 2 << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
p = [int(x) for x in input().split(" ")]

count = 0
for i in range(1, n - 1):
    torio = [p[i - 1], p[i], p[i + 1]]
    if p[i] == sorted(torio)[1]:
        count += 1

print(count)

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

#define F first
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 200010, M = 1010;

int n;
int a[N], f[N];
LL m;

bool check(LL x)
{
	LL cnt = 0;
	for (int i = 1; i <= n; i ++ )
		if ((LL)a[i] * f[i] > x)
			cnt += (LL)a[i] - x / (LL)f[i];
	return cnt <= m;
}

int main()
{
	scanf("%d%lld", &n, &m);
	for (int i = 1; i <= n; i ++ ) scanf("%d", &a[i]);
	for (int i = 1; i <= n; i ++ ) scanf("%d", &f[i]);
	sort(a + 1, a + 1 + n);
	sort(f + 1, f + 1 + n, greater<int>());
	
	LL l = 0, r = 1e12 + 10;
	while (l < r)
	{
		LL mid = l + r >> 1;
		if (check(mid)) r = mid;
		else l = mid + 1LL;
	}
	
	printf("%lld\n", r);
	return 0;
}

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

int main()
{
 
	string a, b;
	cin >> a >> b;
	long c = 0;
	for (int i = 0; i < a.size(); i++)
	{
		if (a[i] != b[i])
			c++;
	}
	cout << c;
}

Measured memory_bytes: 3920
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF (long long)(1e18)
#define EPS (1e-20)
#define MOD (int)(1e9+7)

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

signed main(){
	cout<<fixed<<setprecision(7);
	
	bool flag = true;
	
	int n, m;
	int a, b, c;

	
	cin>>a>>b>>c;
	
	
	cout<<b*a/2<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stdio.h>
#include<deque>
#include<map>
#include<queue>
#include<cmath>

typedef long long ll;

#define debug(x) cout << #x << '=' << x << endl;
#define debug_arr(a, n) for(ll i = 0; i < n; i++)cout << a[i] << ' '
#define inf 100000000000
#define loop(i,n) for(ll i = 0; i < n; i++)
#define graph vector<vector<ll>>
#define P pair<ll,ll>

using namespace std;

ll doXor(ll n){
    if(n % 2 == 1){
        ll count = (n + 1) / 2;
        return count % 2;
    }else{
        ll count = n / 2;
        if(count % 2 == 1){
            return n + 1;
        }else{
            return n;
        }
    }
};

int main(){
    ll a,b;
    cin >> a >> b;
    
    ll xora, xorb;
    if(a == 0) xora = 0;
    else xora = doXor(a-1);
    xorb = doXor(b);
    
    ll result = xora ^ xorb;

    cout << result << endl;
    return 0; 
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define ll long long
#define vi vector<int>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

double A,B;

int main(){
    cin >> A >> B;

    cout << ceil((A+B)/2.0) << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = 998244353; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

struct Combination {
    static ll mpow(ll x, ll n) { ll y = 1; for (; n > 0; n /= 2) { y = n % 2 ? y * x % MOD : y; x = x * x % MOD; } return y; }
    vector<ll> fact, ifact;
    Combination(int n) : fact(n + 1), ifact(n + 1) {
        fact[0] = 1; for (int i = 0; i < n; ++i) fact[i + 1] = fact[i] * (i + 1) % MOD;
        ifact[n] = mpow(fact[n], MOD - 2); for (int i = n; i > 0; --i) ifact[i - 1] = ifact[i] * i % MOD;
    }
    ll operator ()(int n, int k) { return k < 0 || k > n ? 0 : fact[n] * ifact[n - k] % MOD * ifact[k] % MOD; }
} C(1e7);

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

    vector<ll> pow2(N + 1);
    pow2[0] = 1;
    rep(i, N) pow2[i + 1] = pow2[i] * 2 % MOD;

    ll ans = 1;
    rep(i, N) ans = ans * 3 % MOD;

    rep(i, N / 2 + 1, N + 1) {
        ans = (ans - 2 * C(N, i) * pow2[N - i]) % MOD;
    }
    if (ans < 0) ans += MOD;

    write(ans);
}

Measured memory_bytes: 234624
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define fi                      first
#define se                      second
#define pb                      push_back
#define pbb                     pop_back
#define mp                      make_pair
#define pii     	            pair<int,int>
#define all(x)                  x.begin(), x.end()
#define mem(array, value)       memset(array, value, sizeof(array))
#define fastRead 	            ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#ifdef Lollipop
    #define line                    cout << "\n===================\n"
    #define trace(...)              __f( #__VA_ARGS__ , __VA_ARGS__ )
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " = " << arg1 << "\n";
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " = " << arg1 << " , ";
    __f(comma + 1, args...);
    }
#else
    #define line
    #define trace(...)
#endif


int main ()
{
    #ifdef Lollipop
        //freopen ("in1.txt", "r", stdin);
        //freopen ("ans1.txt", "w", stdout);
    #endif
    ll n, k;
    cin >> n >> k;
    cout << min(n % k, abs(k - (n % k))) << endl;
    return 0;
}


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

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)

int main() {

    int n, k, p;
    vector<double> pv;
    cin >> n >> k;
    rep(i, n) {
        cin >> p;
        pv.pb((1+p)/2.0);
    }

    double e_max, e=0.0;
    rep(i, k) {
        e += pv[i];
    }
    e_max = e;
    for(int i=k; i<n; i++) {
        e = e + pv[i] - pv[i-k];
        e_max = e_max > e ? e_max : e;
    }

    vector<long double> ev{0};
    long double e_acc = 0;
    rep(i, n) {
        e_acc += pv[i];
        ev.pb(e_acc);
    }
    long double e_max2 = 0;
    long double e2;
    rep(i, n - k + 1) {
        e2 = ev[i+k] - ev[i];
        e_max2 = e_max2 > e2 ? e_max2 : e2;
    }
    cout << setprecision(15) << e_max2 << endl;
    return 0;
}

Measured memory_bytes: 7920
N,K=list(map(int,input().split()))

AB =sorted([tuple(map(int,input().split())) for i in range(N)])

B=0

for a,b in AB:
  #print(K,N,a,b,B)
  B+=b
  if B>=K :
    print(a)
    quit()
  #B+=b
  


Measured memory_bytes: 17816
N = int(input())
S = [int(input()) for _ in range(N)]
if sum(S)%10 != 0:
    print(sum(S))
else:
    ans = 0
    for e in S:
        if (sum(S)-e)%10 != 0:
            ans = max(ans,sum(S)-e)
    print(ans)


Measured memory_bytes: 2940