akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main(){
    int a, b;
    cin >> a >> b;
    
    int hig, sm;
    
    if(a > b){
    	hig = a;
    	sm = b;
	}
	else{
		hig = b;
		sm = a;
	}
	
	for(int i = 0; i < hig; ++i){
		cout << sm;
	}

	return 0;
}



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

int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (int i=0; i<n; ++i) cin >> a[i];

  long long ans = 0;
  for (int i=1; i<n; ++i) {
    if (a[i] >= a[i-1]) continue;
    else {
      ans += a[i-1]- a[i];
      a[i] = a[i-1];
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5148
a = list(input())
max = 0
n = 0
while len(a) != 0:
  if a[0] == 'A' or a[0] == 'T' or a[0] == 'G' or a[0] == 'C':
    n += 1
    a.pop(0)
  else:
    n = 0
    a.pop(0)
  if n >= max:
    max = n
print(max)
    

Measured memory_bytes: 3060
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();

		int B = sc.nextInt();

		int C = sc.nextInt();

		if(A==B && B==C && C==A) {

			System.out.println("Yes");

		}else {

			System.out.println("No");
		}
	}

}


Measured memory_bytes: 23636
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long
int sum[100010];
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    int A[100010];
    rep(i, N) cin >> A[i];
    sort(A, A + N);
    int ok = INF2;
    int ng = 0;
    rep(i, N) sum[i + 1] = sum[i] + A[i];    

    while(abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;
        int cnt = 0;
        rep(i, N) {
            int lower = mid - A[i];
            cnt += (A + N) - lower_bound(A, A + N, lower);
            //cout << cnt << endl;
        }
        //cout << mid << " " << cnt << endl;
        if(cnt <= M) ok = mid;
        else ng = mid;
    }
    int ans = 0;
    rep(i, N) {
        int lower = ok - A[i];
        int idx = (A + N) - lower_bound(A, A + N, lower);
        ans += idx * A[i];
        M -= idx;
        //cout << idx << endl;
    }
    //cout << M << endl;
    cout << ans * 2 + M * (ok - 1) << endl;


    return 0;
}


Measured memory_bytes: 5180
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		
		if(N%2==1) {
			System.out.println(0);
			return;
		}
		
		//偶数のときだけ
		long ans = 0;
		
//		for(int i=1;i<=18;i++) {
//			long r = (long)Math.pow(10, i);
//			long rem = N/r;
//			ans += rem;						
//		}
		ans = N/10;

		long num5 = 0;
		long r = 10;
		while(r*5<=N) {
			r *= 5;
			long rem = N/r;
			num5 += rem;						
		}
		ans += num5;
		System.out.println(ans);
	}
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define emp emplace
 
using namespace std;
using ll = long long int;
using ii = pair<int, int>;
 
const int MOD = 1000 * 1000 * 1000 + 7;
const int N = 100000;

std::vector<int> adj[N+1];
ll cnt[N+1] = {0};
ll dp[N+1];
bool visited[N+1] = {false};

void dfs(int node, int m){
    visited[node] = true;
    cnt[node] =1;

    for(auto child : adj[node]){
        if(!visited[child]){
            dfs(child, m);
            cnt[node] *= cnt[child]+1;
            cnt[node] %= m;
        }
    }
}

void cal_ways(int node, ll parent_cnt, int parent, int m){
    dp[node] = (cnt[node]*(parent_cnt+1))%m;
    // cout<<node<<" ";
    queue<ll> prefix;
    stack<ll> suffix;
    prefix.push(1);
    suffix.push(1);
    ll temp = 1;
    for (int i = 0; i < adj[node].size(); ++i)
    {
        if(adj[node][i]!=parent){
            temp *= cnt[adj[node][i]]+1;
            temp %= m;
            prefix.push(temp);
        }
    }
    temp = 1;
    for (int i = adj[node].size()-1; i >= 0; --i)
    {
        if(adj[node][i]!=parent){
            temp *= cnt[adj[node][i]]+1;
            temp %= m;
            suffix.push(temp);
        }
    }
    suffix.pop();

    for(auto child : adj[node]){
        if(child!= parent){
            ll t = parent_cnt+1;
            t = (t*prefix.front())%m;
            t = (t*suffix.top())%m;
            cal_ways(child, t, node, m);
            prefix.pop();
            suffix.pop();
        }
    }
}


int main()
{
    int n, m;cin>>n>>m;
    for (int i = 1; i < n; ++i)
    {
        int x,y;cin>>x>>y;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }

    dfs(1,m);

    cal_ways(1,0,0,m);

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

    return 0;
} 



Measured memory_bytes: 118400
from collections import deque
import sys
sys.setrecursionlimit(10**6)
n = int(input())
adjacent_list = [[] for i in range(n+1)]
for i in range(n-1):
    a,b = map(int, input().split())
    adjacent_list[a].append(b)
    adjacent_list[b].append(a)
dist = [0 for i in range(n+1)]
def bfs(node,pre_node):
    que = deque([(node, pre_node)])
    while que:
        node, pre_node = que.popleft()
        for i in adjacent_list[node]:
            if i != pre_node:
                dist[i] = dist[node] + 1
                que.append([i,node])
bfs(1,0)
index = dist.index(max(dist))
dist = [0 for i in range(n+1)]
bfs(index,0)
l = max(dist)
#一回の操作というのは,木の直径を1or2減らすことになる
if l % 3 == 1:
    print("Second")
else:
    print("First")

Measured memory_bytes: 63460
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<pair<ll, ll>>> vvpll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll x, y, z;
    cin >> x >> y >> z;
    out(x*y/2);
    re0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i = 0; i < (n); i++)
typedef long long ll;
// Welcome to my source code!

int main() {
    char c[6];
    REP(i,6) cin >> c[i];
    int j = 5;
    bool flag = true;
    REP(i,3) {
        if (c[i] != c[j--]) flag = false;
    }
    if (flag) cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

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

using namespace std;

typedef pair<int,int> ii;
const int IINF = INT_MAX;

int h,w,supply,u[33][33],lower;
ii memo[33][33][33][33];//[upper left][upper left][lower right][lower right] := ii(the number of groups, maximum value)
int dp[34][34];

ii dfs(int xL,int yL,int xR,int yR){
  ii &ret = memo[xL][yL][xR][yR];
  if( ret != ii(-1,-1) ) return ret;
  int sum = dp[yR+1][xR+1] - dp[yR+1][xL] - dp[yL][xR+1] + dp[yL][xL];
  if( sum < lower ) return ret; // invalid group

  bool success = false;  
  ret = ii(0,IINF);
  // split : row
  REP(x,xL,xR){
    ii temp1 = dfs(xL,yL,x,yR);
    ii temp2 = dfs(x+1,yL,xR,yR);
    if( temp1 != ii(-1,-1) && temp2 != ii(-1,-1) ) {
      success = true;
      ii temp = ii(temp1.first+temp2.first,min(temp1.second,temp2.second));
      if( ret < temp ) ret = temp;
    }
  }
  
  // split : column
  REP(y,yL,yR){
    ii temp1 = dfs(xL,yL,xR,y);
    ii temp2 = dfs(xL,y+1,xR,yR);
    if( temp1 != ii(-1,-1) && temp2 != ii(-1,-1) ) {
      success = true;
      ii temp = ii(temp1.first+temp2.first,min(temp1.second,temp2.second));
      if( ret < temp ) ret = temp;
    }
  }
  if( !success ) ret = ii(1,sum);
  return ret;
}

int main(){
  while( cin >> h >> w >> supply, h|w|supply ){
    rep(i,h) rep(j,w) cin >> u[i][j];
    rep(i,h+1) rep(j,w+1) rep(k,h+1) rep(l,w+1) memo[j][i][l][k] = ii(-1,-1);
    rep(i,h+1) rep(j,w+1) dp[i][j] = 0;
    REP(i,1,h+1) REP(j,1,w+1) dp[i][j] = dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1] + u[i-1][j-1];
    lower = dp[h][w] - supply;
    ii temp = dfs(0,0,w-1,h-1);
    printf("%d %d\n",temp.first,(int)abs(supply-(dp[h][w]-temp.second)));
  }
  return 0;
}

Measured memory_bytes: 10420
#include <stdio.h>

int main(void) {
  int A;
  int B;
  int C;
  int D;
  scanf("%d%d%d%d", &A, &B, &C, &D);
  while (1) {
    C = C - B;
    if (C <= 0) {
      printf("Yes\n");
      return 0;
    }
    A = A - D;
    if (A <= 0) {
      printf("No\n");
      return 0;
    }
  }
}

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

using namespace std;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    int T[n];
    for (int i=0;i<n;i++)
    {
        T[i]=i+1;
    }
    int T1[n],T2[n];
    for (int i=0;i<n;i++)
    {
        cin>>T1[i];
    }
    for (int i=0;i<n;i++)
    {
        cin>>T2[i];
    }
    int j=1,a=0,b=0;
    int test1=1,test2=1;
        for (int i=0;i<n;i++)
            if (T1[i]!=T[i])
            {
                test1=0;
                break;
            }
        for (int i=0;i<n;i++)
        {
            if (T2[i]!=T[i])
            {
                test2=0;
                break;
            }
        }
        if (test1==1)
            a=j;
        if(test2==1)
            b=j;
    while (next_permutation(T,T+n))
    {
        j++;
        int test1=1,test2=1;
        for (int i=0;i<n;i++)
            if (T1[i]!=T[i])
            {
                test1=0;
                break;
            }
        for (int i=0;i<n;i++)
        {
            if (T2[i]!=T[i])
            {
                test2=0;
                break;
            }
        }
        if (test1==1)
            a=j;
        if(test2==1)
            b=j;
    }
    cout<<abs(a-b);
    return(0);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
 
using namespace std;
 
int main() {
  int n; cin >> n;
  vector<int> ls(n, 0);
  for (int i = 0; i < n; i++) cin >> ls[i];
  int sum = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        //cout << i << " " << j << " "<< k << endl;
        if (ls[i] != ls[j] && 
            ls[j] != ls[k] && 
            ls[k] != ls[i] &&
            (ls[i] + ls[j] > ls[k] &&
             ls[j] + ls[k] > ls[i] && 
             ls[k] + ls[i] > ls[j])
            ) {
          //cout << "valid " << ls[i] << " " << ls[j] << " "<< ls[k] << endl;
          sum++;
        }
      }
    }
  }
  cout << sum << endl;
}

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

using namespace std;

int main()
{
	int h, w;
	cin >> h >> w;
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
		{
			string s;
			cin >> s;
			if (s == "snuke")
				cout << (char)('A' + j) << i + 1 << endl;
		}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
struct Point
{
	int r,c,a;
	bool operator<(const Point &p)const
	{
		if(r!=p.r)
			return r<p.r;
		return c<p.c;
	}
}p[101010];
long long v[101010],mi[101010];
int rt[101010];
int getr(int x)
{
	if(x==rt[x])
		return x;
	int h=rt[x];
	rt[x]=getr(rt[x]);
	v[x]+=v[h];
	return rt[x];
}
int main()
{
	int rr,cc,n,now,rx,ry;
	scanf("%d%d",&rr,&cc);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d%d%d",&p[i].r,&p[i].c,&p[i].a);
	sort(p+1,p+1+n);
	for(int i=1;i<=cc;i++)
	{
		rt[i]=i;
		v[i]=0;
		mi[i]=1000000000ll;
	}
	now=1;
	for(int i=1;i<=n;i++)
	{
		if(p[now].r!=p[i].r)
			now=i;
		rx=getr(p[now].c);
		ry=getr(p[i].c);
		if(rx==ry)
		{
			if(p[i].a-p[now].a!=v[p[i].c]-v[p[now].c])
			{
				printf("No");
				return 0;
			}
			mi[rx]=min(mi[rx],p[i].a-v[p[i].c]);
		}
		else
		{
			mi[ry]=min(mi[ry],p[i].a-v[p[i].c]);
			v[ry]=v[p[now].c]+p[i].a-p[now].a-v[p[i].c];
			rt[ry]=rx;
			mi[rx]=min(mi[rx],mi[ry]-v[ry]);
		}
	}
	for(int i=1;i<=cc;i++)
		if(mi[getr(i)]+v[i]<0)
		{
			printf("No");
			return 0;
		}
	printf("Yes");
	return 0;
}

Measured memory_bytes: 3328
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] array=new int[s];
		int sum=0;
		for(int i=0;i<s;i++) {
			array[i]=sc.nextInt();
		}
		Arrays.sort(array);
		for(int i=0;i<s-1;i++) {
			sum+=array[i];
		}
		if(array[s-1]<sum) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}

//Arrays.sort(array, (a, b) -> Integer.compare(a[0], b[0]));




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

#define FAST ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end()) 
#define cpresent(c,x) (find(all(c),x) != (c).end()) 
#define what_is(x) cout << #x << " is: " << x << endl;
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define ll long long int

#define vi vector<int>
#define pii pair<int,int>
#define vl vector<ll>
#define pll pair<ll, ll>

template<typename T>
T extgcd(T a, T b, T &x, T &y) { if (b == 0) {x = 1;y = 0;return b;}T x1, y1;T g = extgcd(b, a % b,x1, y1);x = y1; y = x1 - (a/b)*y1;return g;}
template<typename T>
T fast_power(T a, T b){T res = (T)1;while( b ){if( b & 1 ) res = res * a;b >>= 1;a *= a; } return res;}
template<typename T>
T fast_powerModulo( T a, T b, T M){T res = (T)1;a %= M;while( b ){if( b & 1 ) res = (res * a) % M;b >>= 1;a *= a;a %= M; }return res;}
template<typename T>
T LCM(T a, T b){ T gd = __gcd(a, b); T ml = a * b; return ml/ gd;}

const int MOD = 1e9 + 7;

int main(){
    FAST
    int n; cin >> n;
    vector<pair<string, int>> sp(n);
    for( int i = 0; i < n; ++i){
        cin >> sp[i].first >> sp[i].second;
    }
    string x; cin >> x;
    ll total = 0;
    int poss = 0;
    for( int i = 0; i < n; ++i){
        if( poss ){
            total += sp[i].second;
        }
        if( sp[i].first == x){
            poss = 1;
        }
    }
    cout << total << '\n';

    return 0;
}

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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}



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

#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a)		cerr<<#a<<" : "<<a<<endl
#else
#define tr(a)    
#endif

#define LL          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)	for(int i=a;i<b;i++)
using namespace std;
struct Edge {
    int u, v;
    LL cap, flow;
    Edge() {}
    Edge(int _u, int _v, LL _cap): u(_u), v(_v), cap(_cap), flow(0) {}
};

struct Dinic {
    int N;
    vector<Edge> E;
    vector<vector<int>> g;
    vector<int> d, pt;
    Dinic(int _N): N(_N), E(0), g(_N), d(_N), pt(_N) {}
    void AddEdge(int u, int v, LL cap) {
        if (u != v) {
            E.emplace_back(Edge(u, v, cap));
            g[u].emplace_back(E.size() - 1);
            E.emplace_back(Edge(v, u, 0));
            g[v].emplace_back(E.size() - 1);
        }
    }
    bool BFS(int S, int T) {
        queue<int> q({S});
        fill(d.begin(), d.end(), N + 1);
        d[S] = 0;
        while(!q.empty()) {
            int u = q.front(); q.pop();
            if (u == T) break;
            for (int k: g[u]) {
                Edge &e = E[k];
                if (e.flow < e.cap && d[e.v] > d[e.u] + 1) {
                    d[e.v] = d[e.u] + 1;
                    q.emplace(e.v);
                }
            }
        }
        return d[T] != N + 1;
    }
    LL DFS(int u, int T, LL flow = -1) {
        if (u == T || flow == 0) return flow;
        for (int &i = pt[u]; i < g[u].size(); ++i) {
            Edge &e = E[g[u][i]];
            Edge &oe = E[g[u][i]^1];
            if (d[e.v] == d[e.u] + 1) {
                LL amt = e.cap - e.flow;
                if (flow != -1 && amt > flow) amt = flow;
                if (LL pushed = DFS(e.v, T, amt)) {
                    e.flow += pushed;
                    oe.flow -= pushed;
                    return pushed;
                }
            }
        }
        return 0;
    }

    LL MaxFlow(int S, int T) {
        LL total = 0;
        while (BFS(S, T)) {
            fill(pt.begin(), pt.end(), 0);
            while (LL flow = DFS(S, T))
                total += flow;
        }
        return total;
    }
};

void solve(){
	int N;
	cin>>N;
	Dinic x(2*N+2);
	vector<pii>a(N),b(N);
	rep(i,0,N)cin>>a[i].F>>a[i].S;
	rep(i,0,N)cin>>b[i].F>>b[i].S;
	rep(i,0,N)x.AddEdge(0,i+1,1);
	rep(i,0,N)x.AddEdge(N+i+1,2*N+1,1);
	rep(i,0,N){
		rep(j,0,N){
			if(a[i].F<b[j].F and a[i].S<b[j].S)x.AddEdge(i+1,N+1+j,1);
		}
	}
	cout<<x.MaxFlow(0,2*N+1)<<endl;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 608
import java.io.*;
import java.util.StringTokenizer;

//solution classes here

public class Main {

    //main solution here

    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);
    static long mod = (long)1e9+7;
    static long MOD = 998244353;
    //static ArrayList<Integer> list[] = new ArrayList[(int)1e6+1];
    //static int color[] = new int[(int)1e6+1];
    //static int visit[] = new int[(int)1e5+1];
    //static Deque<Integer> q = new ArrayDeque<>();

    public static void main(String[] args) throws IOException {
        long n = sc.nextLong();
        long k = sc.nextLong();
        long ans[] = new long[(int)k+1];
        for(long i=k;i>=1;i--) {
            long mul = power(k/i,n);
            long ex=0;
            mul%=mod;
            for(long j=1;j*i<=k;j++) {
                ex = (ex+ans[(int)(j*i)])%mod;
            }
            ans[(int)i]=(mod+mul-ex)%mod;
        }

        long sum=0;
        for(int i=1;i<=k;i++) {
            sum=(sum+(i*ans[i]))%mod;
        }

        out.println(sum);


        out.flush();
        out.close();
    }
    //solution functions here
    static long power(long x, long y)
    {
        long res = 1;
        x = x % mod;
        if (x == 0) return 0;
        while (y > 0)
        {
            if((y & 1)==1)
                res = (res * x) % mod;
            y = y >> 1;
            x = (x * x) % mod;
        }
        return res;
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

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

        public Scanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        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 boolean ready() throws IOException {
            return br.ready();
        }
    }
}

/* *****************************************************************************************************************************
 * I'M NOT IN DANGER, I'M THE DANGER!!!
 * *****************************************************************************************************************************
 */

Measured memory_bytes: 33772
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    ll r=a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}
int main (){
    int n;
    int ans=0;
    cin >> n;
    map<int,int>mp;
    rep(i,n){
        int x;
        cin >> x;
        mp[x]++;
    }
    for(auto p:mp){
        if(p.first<p.second) ans+=p.second-p.first;
        else if(p.first>p.second) ans+=p.second;
        else continue;
    }
    cout << ans <<endl;
    return 0;
}



Measured memory_bytes: 4736
from functools import reduce
# 入力
N, M = map(int, input().split())
A, B = zip(*(map(int, input().split()) for _ in range(N)))

# 1本あたりの値段が安い店から順に購入
ans, _ = reduce(
    lambda acc, t:
        (
            acc[0] + t[0] * min(t[1], M - acc[1]),
            acc[1] + t[1]
        ) if acc[1] < M else
        acc,
    sorted(zip(A, B)),
    (0, 0)
)

# 出力
print(ans)


Measured memory_bytes: 58824
#include<stdio.h>
int main(void)
{
	int i,k;
	char c;
	c='x';
	for(i=1;i<=9;i++){
		for(k=1;k<=9;k++){
			printf("%d%c%d=%d\n",i,c,k,i*k);
		}
	}
	return 0;
}



Measured memory_bytes: 2040
#include <iostream>
#include <algorithm>
using namespace std;
#define X 2000000

int H,A[X+1];

int parent(int i) {return i/2;}
int left(int i) {return 2*i;}
int right(int i) {return 2*i+1;}

void maxHeapify(int k){
    int l=left(k);
    int r=right(k);
    int largest;
    if(l<=H&&A[l]>A[k]) largest=l;
    else largest=k;
    if(r<=H&&A[r]>A[largest]) largest=r;
    if(largest!=k){
        swap(A[largest],A[k]);
        maxHeapify(largest);
    }
}

void buildMaxHeap(){
    for(int i=H/2;i>0;i--){
        maxHeapify(i);
    }
}


int main(void){
    cin >> H;
    
    for(int i=1;i<=H;i++){
        cin >> A[i];
    }
    
    buildMaxHeap();
    
    for(int i=1;i<=H;i++){
        cout << " " << A[i];
    }
    
    cout << endl;
    
    return 0;
}



Measured memory_bytes: 5072
#include <stdio.h>

int main(void) {
  int A;
  int B;
  int C;
  int K;
  scanf("%d", &A);
  scanf("%d", &B);
  scanf("%d", &C);
  scanf("%d", &K);
  int s_max = 0;
  if (A >= K) {
    s_max = K;
  } else if (A + B >= K) {
    s_max = A;
  } else {
    s_max = A - (K - (A + B));
  }
  printf("%d\n", s_max);
  return 0;
}

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

int main() {
	string a, b, c, d;
	cin >> a >> b >> c >> d;
	string s = a+b+c+d;
	sort(s.begin(), s.end());

	if ( s[0] == '1' && s[1] == '4' && s[2] == '7' && s[3] == '9' ) cout << "YES" << endl;
	else cout << "NO" << endl;
}


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

int n,a,m;
long long ans;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin>>n;
    while(n--){
        cin>>a;
        ans+=max(0,m-a);
        m=max(m,a);
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 3620
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

const int N = 100005;
LL dp[2][N];
bool visit[N];

void dfs(VVI& g, int u) {
	visit[u] = true;
	LL b = 1, w = 1;
	dp[0][u] = dp[1][u] = 1;
	for (int v : g[u]) {
		if (visit[v])continue;
		dfs(g, v);
		//black
		b = (b * dp[0][v]) % MOD;
		w = (w * (dp[0][v] + dp[1][v])) % MOD;
		dp[0][u] = (dp[0][u] * (dp[0][v] + dp[1][v])) % MOD;
		dp[1][u] = (dp[1][u] * dp[0][v]) % MOD;
	}
}

int main() {
	int n;
	scanf("%d", &n);
	VVI g(n);
	REP(i, n - 1) {
		int x, y;
		scanf("%d%d", &x, &y);
		x--, y--;
		g[x].PB(y);
		g[y].PB(x);
	}
	dfs(g, 0);
	cout << (dp[0][0] + dp[1][0])%MOD << endl;
	return 0;
}

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

int main()
{
    int r;
    cin >> r;
    if(r < 1200){
        cout << "ABC" << endl;
    }else if(r >= 1200 && r < 2800){
        cout << "ARC" << endl;
    }else if(r >= 2800) {
        cout << "AGC" << endl;
    }
 
}


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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
using ld = long double;
ll mod = 1000000007;

int main() {
    ll l, r, d;
    cin >> l >> r >> d;
    ll ans = 0;
    repd(i, l, r + 1) {
        if (i % d == 0)
            ans++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3500
#include <iostream>
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll num=1e9+7;
ll mod(ll n)
{
    return (n%num+num)%num;
}
ll add(ll x,ll y)
{
    return mod(mod(x)+mod(y));
}
ll mult(ll x,ll y)
{
    return mod(mod(x)*mod(y));
}
ll sub(ll x,ll y)
 {
     return mod(mod(x)-mod(y));
 }
 ll pt(ll n,ll p)
 {
      if(p==0)
       return 1;
       if(p==1)
        return n%num;
        ll t=pt(n,p/2);
        if(p%2==0)
         return mult(t,t);
         else
          return mult(n,mult(t,t));
 }
 const int num1=100001;
 vector<ll>ad[num1];
ll vt[100001];
void dfs( ll i,ll pt)
{
    vt[i]=1;
    for(auto it:ad[i])
    {
        if(it!=pt && vt[it]==0)
         dfs(it,i);
    }
    
}

 void solve()
 {
   ll n,m;
   cin>>n>>m;
   memset(vt,0,sizeof(vt));
   for(ll i=0;i<m;i++)
   {
       ll x,y;
       cin>>x>>y;
       ad[x].push_back(y);
       ad[y].push_back(x);
       
   }
    ll ans=0;
   for(ll i=1;i<=n;i++)
   {
       if(vt[i]==0)
        {
            dfs(i,-1);
            ans++;
        }
   }
  // dfs(vt,ad,1,-1);
  
   
     cout<<ans-1<<endl;
     
      
 }
int main(){
   ll t;
   t=1;
   while(t--)
   {
       solve();
   }
    
}


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

int main() {
    int r, g, b;
    cin >> r >> g >> b;

    int num = 100 * r + 10 * g + 1 * b;

    if (num % 4 == 0) {  // 4の倍数
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
<?php
while (true) {
    $inputString = getInputStringBothEndsRemovedSpaces();
    list($a, $operator, $b) = explodeStringWithSpaces($inputString);
    
    switch ($operator) {
        case '+':
            $result = addingTwoNum($a, $b);
            break;
        case '-':
            $result = subTractTwoNum($a, $b);
            break;
        case '*':
            $result = multiplyTwoNum($a, $b);
            break;
        case '/':
            $result = divideTwoNumByFloorPoint($a, $b);
            break;
        case '?':
            exit;
    }
    echo $result, PHP_EOL;
}
 
function getInputStringBothEndsRemovedSpaces()
{
    return trim(fgets(STDIN));
}
 
function explodeStringWithSpaces($inputString)
{
    return explode(' ', $inputString);
}
 
function addingTwoNum($a, $b)
{
    return $a + $b;
}
 
function subTractTwoNum($a, $b)
{
    return $a - $b;
}
 
function multiplyTwoNum($a, $b)
{
    return $a * $b;
}
 
function divideTwoNumByFloorPoint($a, $b)
{
    return floor($a / $b);
}

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

#ifdef MYDEBUG
#define dbp(x) cout<<#x<<": "<<x<<endl
#define dbp2(x,y) cout<<#x<<","<<#y<<": "<<x<<","<<y<<endl
#define dbp3(x,y,z) cout<<#x<<","<<#y<<","<<#z<<": "<<x<<","<<y<<","<<z<<endl
#else
#define dbp(x)
#define dbp2(x,y)
#define dbp3(x,y,z)
#endif
#define ll long long
#define ull unsigned long long
#define eps 1e-14
#define all(x) x.begin(), x.end()
#define rep(i, from, to) for(int i=from; i<to; ++i)

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last)
      out << ",";
  }
  out << "]";
  return out;
}

ll max3(ll a, ll b, ll c) {
  return max(a, max(b, c));
}

ll min3(ll a, ll b, ll c) {
  return min(a, min(b, c));
}

ll h, w;
void solve() {
  cin >> h >> w;
  ll ans = 1e17;
  for (int j = 1; j < w; ++j) {
    ll r1 = h * j;
    ll r2, r3;
    if (h % 2 == 0) {
      r2 = r3 = (h / 2) * (w - j);
    } else {
      r2 = (h / 2) * (w - j);
      r3 = (h - h / 2) * (w - j);
    }
    ll big = max3(r1, r2, r3);
    ll small = min3(r1, r2, r3);
    ans = min(ans, big - small);

    if ((w - j) % 2 == 0) {
      r2 = r3 = ((w - j) / 2) * h;
    } else {
      r2 = ((w - j) / 2) * h;
      r3 = ((w - j) - (w - j) / 2) * h;
    }
    big = max3(r1, r2, r3);
    small = min3(r1, r2, r3);
    ans = min(ans, big - small);
  }

  swap(h, w);
  for (int j = 1; j < w; ++j) {
    ll r1 = h * j;
    ll r2, r3;
    if (h % 2 == 0) {
      r2 = r3 = (h / 2) * (w - j);
    } else {
      r2 = (h / 2) * (w - j);
      r3 = (h - h / 2) * (w - j);
    }
    ll big = max3(r1, r2, r3);
    ll small = min3(r1, r2, r3);
    ans = min(ans, big - small);

    if ((w - j) % 2 == 0) {
      r2 = r3 = ((w - j) / 2) * h;
    } else {
      r2 = ((w - j) / 2) * h;
      r3 = ((w - j) - (w - j) / 2) * h;
    }
    big = max3(r1, r2, r3);
    small = min3(r1, r2, r3);
    ans = min(ans, big - small);
  }

  cout << ans << endl;
}

int main() {
  solve();
  return 0;
}


Measured memory_bytes: 256
# include <stdio.h>
# include <bits/stdc++.h>
using namespace std;
# define fi cin
# define fo cout
# define x first
# define y second
# define ll long long
# define IOS ios_base :: sync_with_stdio(0);cin.tie(0)
# define p(v) cerr << #v << " = " << v << '\n'
# define p2(v) cerr << #v << " = " << (complex < int > (v.x,v.y)) << '\n'
# define vi vector < int >
# define vll vector < ll >
# define pii pair < int , int >
# define mp make_pair
int main(void)
{
    #ifdef CF
    freopen("input","r",stdin);
    #endif // CF
    srand(time(0));
    fo << fixed << setprecision(7);
    cerr << fixed << setprecision(7);
    int n;
    fi>>n;
    --n;
    ll A,B;
    fi>>A>>B;
    while (n --)
    {
        int a,b;
        fi>>a>>b;
        ll nxt = max(A / a + (bool)(A % a),B / b + (bool)(B % b));
        A = a * nxt;
        B = b * nxt;
    }
    fo << (A + B) << '\n';
    cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}

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

typedef long long LL;
const int N = 1e6 + 50;
const int mod = 998244353;

namespace MathCal {
  LL fac[N], inv[N];

  inline LL Pow(LL x, LL exp) {
    LL res = 1;
    for (; exp; exp >>= 1, x = x * x % mod)
      if (exp & 1) res = res * x % mod;
    return res;
  }
  inline void Init() {
    for (int i = fac[0] = 1; i < N; i ++) fac[i] = fac[i - 1] * i % mod;
    inv[N - 1] = Pow(fac[N - 1], mod - 2);
    for (int i = N - 1; i; i --) inv[i - 1] = inv[i] * i % mod;
  }
  inline LL C(int x, int y) {
    return y > x ? 0 : fac[x] * inv[y] % mod * inv[x - y] % mod;
  }
}
using MathCal :: C;

int n, k;

inline LL calc(int x, int y, int k) {
  k ++;
  return C(x + y, x) - C(x + y, x + k);
}

int main() {
  MathCal :: Init();
  scanf("%d%d", &n, &k);
  LL ans = 0;
  for (int A = n, B; A <= k; A ++) {
    B = k - A;
    if (A < B) continue;
    if (A == B) ans += calc(A, A - 1, A - n);
    else ans += calc(A, B, A - n);
  }
  printf("%lld\n", (ans % mod + mod) % mod);
  return 0;
}

Measured memory_bytes: 15872
Q, H, S, D = tuple(map(int, input().split()))
N = int(input())
if N == 1:
    print(min(4 * Q, 2 * H, S))
    exit()

min2l = min(8 * Q, 4 * H, 2 * S, D)
min1l = min(4 * Q, 2 * H, S)
print((N // 2) * min2l + (N % 2) * min1l)


Measured memory_bytes: 3060
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	if((n+m)%2==0)	printf("%d\n",(n+m)/2);
	else printf("%d\n",(n+m)/2+1);
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;

string S, T;
int N;

bool solve(){
    for(int i=0; i<N; i++){
        string a = S.substr(N-i, i);
        string b = S.substr(0, N-i);
        
        if(a+b == T) return true;
    }
    return false;
}

int main() {
    cin >> S >> T;
    N = S.size();
    
    if(solve()) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}





Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include<iostream>
#include <iosfwd>
#include<limits.h>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <algorithm>
#include <limits>
#include<stdio.h>
#include <queue>
#include <stack>
#include <math.h>
#include<string.h>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include<vector>
#include <chrono>
#include <random>
using namespace std;
using namespace std::chrono;
#define fr(i,j,n)   for(lli i=j;i<(n);++i)
#define bk(i,j,n)   for(lli i=j;i>=n;--i)
#define pb push_back
#define m_p make_pair
#define Fs first
#define Sc second
#define endl "\n"
#define MOD 2147483647
#define present(c,x)    ((c).find(x) != (c).end())
#define run ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ordered_set tree<lli, null_type,less<lli>, rb_tree_tag,tree_order_statistics_node_update>
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define mem(p,v) memset(p,(lli)v,sizeof p);
#define ub upper_bound
#define lb lower_bound
typedef long long int lli;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<lli> vl;
typedef pair<lli,lli> pl;
inline lli max(lli a,lli b){ return a>b?a:b;}
inline lli min(lli a,lli b){ return a<b?a:b;}
void show(vector<lli> v)
{
    fr(i,0,v.size())
    cout<<v[i]<<" ";
    cout<<endl;
}
void show(vector<int> v)
{
    fr(i,0,v.size())
    cout<<v[i]<<" ";
    cout<<endl;
}
void show(int a[], int arraysize)
{
    for (int i = 0; i < arraysize; ++i)
        cout << a[i] << " ";
    cout<<endl;
}
void show(lli a[], lli arraysize)
{
    for (lli i = 0; i < arraysize; ++i)
        cout << a[i] << " ";
    cout<<endl;
}
void show(unordered_set<int> s)
{
    for (auto it = s.begin(); it != s.end(); it++)
    {
        cout << *it << " ";
    }
    cout<<endl;
}
void show(unordered_map<int,int> mp)
{
    for (auto it = mp.begin(); it != mp.end(); it++)
    {
        cout << it->first << " "<<it->second<<endl;
    }
    cout<<endl;
}
int main()
{
    lli t,n,m,q;
    t=1;
    while(t)
    {
        cin>>n;
        lli s=0;
        lli a[n];
        fr(i,0,n)
        {
            cin>>a[i];
            s=s^a[i];
        }
        fr(i,0,n)
        {
            cout<<(s^a[i])<<" ";
        }
        cout<<endl;
        t--;
    }
    return 0;
}





Measured memory_bytes: 5196
n = int(input())
s = []
for i in range(n):
    s.append(input())

numbers = dict()
maxval = 1
for val in s:
    if val in numbers:
        if maxval == numbers[val]:
            maxval = maxval + 1
        numbers[val] += 1
    else:
        numbers[val] = 1

ret = [kv[0] for kv in numbers.items() if kv[1] == maxval]
for v in sorted(ret):
    print(v)


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

int main(){
    int n,c,k;
    cin >> n >> c >> k;
    vector<int> Ts(n);
    for (int i=0; i<n; i++){
        cin >> Ts.at(i);
    }
    sort(Ts.begin(),Ts.end());
    int ans =0;
    int Tmin = Ts[0];
    int wait = 1;
    for (int i=0; i<n; i++){
        if (i==n-1) ans ++;
        else if(Ts[i+1]-Tmin>k){
            ans ++;
            Tmin = Ts[i+1];
            wait =1;
        }
        else if (wait == c){
            ans ++;
            Tmin = Ts[i+1];
            wait = 1;
        }
        else wait ++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main(){
	int m,f,r;char s;
	while(true){
	cin>>m>>f>>r;
	if(m==-1&&f==-1&&r==-1)break;
	if(m==-1||f==-1)s='F';
	else if(m+f>=80)s='A';
	else if(m+f>=65)s='B';
	else if(m+f>=50||m+f>=30&&r>=50)s='C';
	else if(m+f>=30)s='D';
	else s='F';
	cout<<s<<endl;
	}

 return 0;
}

Measured memory_bytes: 1156
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を文字列で返却する
def gets_s()
  gets.chomp
end
# S = gets_s

# 入力値を文字の配列で返却する
def gets_nsp_list()
  gets.chomp.split("")
end

chars = ('a'..'z').to_a
s_list = gets_nsp_list

if s_list.size != 26
  s_list.push((chars - s_list).first)
  puts s_list.join
else
  candidates = [s_list.last]
  25.downto(1) do |i|
    if s_list[i] < s_list[i-1]
      candidates.push(s_list[i-1])
    else
      break
    end
  end
  if candidates.size == 26
    puts -1
  else
    ans = (s_list - candidates)
    last = ans.pop
    candidates.sort.each do |c|
      if c > last
        last = c
        break
      end
    end
    ans.push(last)
    puts ans.join
  end
end


Measured memory_bytes: 2044
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<climits>

#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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



/******************************************************************************************/


const ll INF = 1e9 + 7;
const ll MOD = 1e9 + 7;



template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}

int main() {
	
	int a, b, c;
	cin >> a >> b >> c;
	if (a+b >= c) {
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

}


Measured memory_bytes: 256
/////////////////////////////////////////////

//
//	FileName	:	First.cpp
//	Creator		:	Fm
//	Date		:	2019-10-25 00:08
//	Comment		:	OJ(AT2685)
//
///////////////////////////////////////////

//#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <stack>
#include <list>
#include <string>
#include <string.h>
#include <set>
#include <queue>
#include <map>

using namespace std;
#define	MAXNUM		10010
#define	EPS         0.0001
#define MODNUM		1000000007


typedef unsigned char       BYTE;
typedef int                 BOOL;
typedef unsigned long       DWORD;


int main(int argc, char* argv[])
{
	string			szInput;

	cin >> szInput;

	cout << szInput[0] << szInput.length() - 2 << szInput[szInput.length() - 1];

Exit0:

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = (1e+9)+7;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  ll sm = 0;
  for(int i=0; i<n; i++){
    cin >> a[i];
    sm = (sm + a[i]) % MOD;
  }
  ll ans = 0;
  for(int i=0; i<n; i++){
    sm -= a[i];
    if(sm < 0) sm += MOD;
    ans = (ans + (a[i] * (sm)) % MOD) % MOD;
  }
  cout << ans << endl;
}

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

int main ()
{
    string s;
    int i,l,j,flag=0;
    cin>>s;
    l=s.size();
    for(i=0;i<l;i++)
    {
        for(j=i+1;j<l;j++)
        {
            if(s[i]==s[j])
                {flag=1;
                s[i]='0';}

        }
    }
    if(flag==0)
        cout<<"yes"<<endl;
    else
        cout<<"no"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
#include <numeric>
#include <iomanip>
#include <cstring> 
using namespace std;
using ll=long long;

#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define LLONG_MAXs 9223372036854775800

#include <iostream>
#include <cmath>
using namespace std;
 

 
bool isPrimeNum( ll x ){ // 素数である場合 true を返す
  if( x <= 1 ){ // 1以下である場合は素数でないことがすぐにわかる
    return false;
  }
  // sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト
  int n = (int)sqrt( (double)x );
  for( int i = 2; i <= n; i++ ){
    if( x % i == 0 ){ // 割り切る整数がある場合、即判定終了
      return false;
    }
  }
  return true; // 割り切る整数がない場合、素数である
}

constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
constexpr ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll abs(ll a,ll b){
if(a>=b)return a-b;
if(a<b)return b-a;
}
constexpr ll min(ll a,ll b){
if(a>=b)return b;
if(a<b)return a;
}

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

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

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main() {
  ll ans=9999999999999;
  ll N;

  cin>>N;

  string S;
  cin>>S;

  ll W[N],E[N];
  W[0]=0;

    if(S[0]=='W'){
      W[0]=1;
    }

  FOR(i,1,N-1){
    if(S[i]=='W'){
      W[i]=W[i-1]+1;
    }else{
      W[i]=W[i-1];
    }

  }

    ans=min(W[N-1],N-W[N-1]);

  FOR(i,1,N-2){
    ll tmp;
    tmp=W[i-1]+(N-i-1)-(W[N-1]-W[i]);
    ans=min(ans,tmp);
//cout<<tmp<<endl;
  }





cout<<ans<<endl;
return 0;

}
 


Measured memory_bytes: 3076
#include<iostream>
#include<set>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<queue>
#include<stdio.h>
#include<math.h>
#include<stdio.h>
#include<complex>
using namespace std;

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

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

const ll INF = ll(1e18) + 1;
const int intINF = 1e9 * 2 + 3;
//--------------------------------------------------

ulli gcd(ulli a, ulli b) {return (b <= 0) ? a : gcd(b, a % b);}
ulli lcm(ulli a, ulli b) {return a * b / gcd(a, b);}

bool isPrime(int n)
{
	if (n <= 3)return n > 1;
	if (n % 2 == 0)return false;
	if (n % 3 == 0)return false;
	for (int i = 5; i * i < n; i += 6) {
		if (n % i == 0 || n % (i + 2) == 0) { return false; }
	}
	return true;
}
//---------------------------------------------------



void Main()
{
	ulli a, b;
	cin >> a >> b;
	ulli ans = lcm(a, b);
	cout << ans << endl;
}


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

Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vpii> vvpii;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

template<typename V>
constexpr string join(const V &v, const string &sep) {
  stringstream ss;
  if (v.size()) ss << v[0];
  loop(i, 1, v.size()) ss << sep << v[i];
  return ss.str();
}

void solve() {
  int x;
  vs a;
  while (cin >> x, x) {
    vi v(4);
    rep(i, 4) cin >> v[3 - i];
    vi t  = {500, 100, 50, 10};
    int s = 0;
    rep(i, 4) s += v[i] * t[i];
    s -= x;
    rep(i, 4) while (s >= t[i]) s -= t[i], v[i]--;
    reverse(all(t)), reverse(all(v));
    stringstream ss;
    rep(i, 4) if (v[i] > 0) ss << t[i] << ' ' << v[i] << endl;
    a.pb(ss.str());
  }
  cout << join(a, "\n");
}

Measured memory_bytes: 3344