akhauriyash/Code-Regression huggingface dataset:
import sys#if RE->suspect recursion limit error
from collections import deque
sys.setrecursionlimit(10000)

class Dinic:
    """max-flow-min-cut
    faster than ford-fulkerson algorithm
    O(|V||E|)
    """

    def __init__(self,V:int):
        """
        Arguments:
            V:num of vertex
            adj:adjedscent list(adj[from]=(to,capacity,id))
        """
        self.V = V
        self.adj=[[] for _ in range(V)]
        self.level=[-1]*self.V
        self.iter=[-1]*self.V

    def add_edge(self,fro:int,to:int,cap:int):
        """
        Arguments:
            fro:from
            to: to
            cap: capacity of the edge
            f: max flow value
        """
        #edge
        self.adj[fro].append([to,cap,len(self.adj[to])])
        #rev edge
        self.adj[to].append([fro,0,len(self.adj[fro])-1])

    def bfs(self,s:int):
        """ bfs from s
        use deque to bfs
        """
        self.level=[-1]*self.V
        Q=deque()
        self.level[s]=0
        Q.append(s)

        while Q:
            v = Q.pop()
            for i in range(len(self.adj[v])):
                (nex_id,nex_cap,nex_rev) = self.adj[v][i]
                if nex_cap>0 and self.level[nex_id]<-0:
                    self.level[nex_id] = self.level[v]+1
                    Q.append(nex_id)


    def dfs(self,v,t,f):

        """
        search increasing path
        """
        if v==t:
            return f

        for i in range(self.iter[v],len(self.adj[v])):
            self.iter[v]=i
            (nex_id,nex_cap,nex_rev) = self.adj[v][i]
            if nex_cap>0 and self.level[v]<self.level[nex_id]:
                d = self.dfs(nex_id,t,min(f,nex_cap))
                if d>0:
                    #decrease capacity to denote use it with d flow
                    self.adj[v][i][1]-=d
                    self.adj[nex_id][nex_rev][1]+=d
                    return d
        return 0

    def max_flow(self,s:int,t:int):
        """calculate maxflow from s to t
        """
        flow=0
        self.used = [False]*self.V
        #while no increasing path is found
        while True:
            self.bfs(s)
            self.iter=[0]*self.V
            f = self.dfs(s,t,float("inf"))
            if f==0:
                return flow
            else:
                flow+=f

H,W = map(int,input().split())
grid=[[v for v in input()] for _ in range(H)]

F = Dinic(H+W+2)
for i in range(H):
    for j in range(W):
        if grid[i][j]=="S":
            sy,sx = i,j
            F.add_edge(0,i+1,float("inf"))
            F.add_edge(0,H+j+1,float("inf"))
        elif grid[i][j]=="T":
            gy,gx=i,j
            F.add_edge(i+1,H+W+1,float("inf"))
            F.add_edge(H+j+1,H+W+1,float("inf"))
        elif grid[i][j]=="o":
            F.add_edge(i+1,H+j+1,1)
            F.add_edge(H+j+1,i+1,1)

if sy==gy or sx==gx:
    print(-1)
    exit()
print(F.max_flow(0,H+W+1))


Measured memory_bytes: 80372
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef priority_queue<int, vector<int>, greater<int> > minque;

const int MOD = 1e9+7;
const int INF = 2e9;
const int MAX_N = 100000;

int N, M, a[MAX_N], x, y;
ll ans = 0;
bool used[MAX_N];
vvi edges(MAX_N);
vector<minque> forest;

void dfs(int x, minque* mq) {
  if (used[x]) return;
  used[x] = true;
  mq->push(a[x]);
  for (vi::iterator it=edges[x].begin(); it!=edges[x].end(); ++it) {
    dfs(*it, mq);
  }
}

int main() {
  cin >> N >> M;
  int need = 2*(N - M - 1);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    used[i] = false;
  }
  for (int i = 0; i < M; i++) {
    cin >> x >> y;
    edges[x].PB(y);
    edges[y].PB(x);
  }
  if (N-1 == M) {
    cout << 0 << endl;
    return 0;
  } else if (N < need) {
    cout << "Impossible" << endl;
    return 0;
  }

  for (int i = 0; i < N; i++) {
    if (used[i]) continue;
    minque mq;
    dfs(i, &mq);
    forest.PB(mq);
  }

  minque rest;
  for (vector<minque>::iterator it=forest.begin(); it!=forest.end(); ++it) {
    ans += it->top(); it->pop();
    while (!it->empty()) {
      rest.push(it->top()); it->pop();
    }
  }
  need -= N - M;
  while (need--) {
    ans += rest.top(); rest.pop();
  }

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


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

using namespace std;

int main(int argc, char* argv[])
{
  string n;
  cin >> n;
  int sum =0;
  for (int i = 0; i< n.size(); ++i)
		sum += n[i]-'0';
  if(sum%9==0)
	  cout << "Yes\n";
  else
	  cout <<"No\n";
  return 0;
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 922337203685477;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define maxN 200007
using namespace std;
int main() {
  fastio;
  ll n = 0;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 0, r = 0;
  for (ll i = 0; i < n; ++i) {
    if (s[i] == 'R')
      ++r;
  }
  for (ll i = r; i < n; ++i) {
    if (s[i] == 'R')
      ++ans;
  }
  cout << ans;
}

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

int main() {
  int n, ans, max_c = 0;
  cin >> n;

  for (int i = n; i > 0; i--) {
    int c = 0, v = i;

    while (v % 2 == 0) {
      v /= 2;
      c++;
    }

    if (c >= max_c) {
      max_c = c;
      ans = i;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define ep emplace_back
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){ if(y<h && y>=0 && x<w && x>=0) return true; return false; }
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true; } return false; }






int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<ll> a(n),b(n);
	rep(i,n) cin >> a.at(i);
	rep(i,n) cin >> b.at(i);
	ll cnt1 = 0, cnt2 = 0;
	rep(i,n){
		if(a.at(i) == b.at(i)) continue;
		if(a.at(i) > b.at(i)){
			cnt2 += a.at(i) - b.at(i);
		}
		else{
			if(a.at(i) % 2 != b.at(i) % 2){
				cnt1++;
				cnt2++;
				a.at(i) += 2;
				b.at(i)++;
			}
			cnt1 += (b.at(i) - a.at(i)) / 2;
		}
	}
	if(cnt1 >= cnt2) cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;

int main()
{
    int H, N;
    cin >> H >> N;
    ll sum = 0;
    vint A(N);
    rep(i, N)
    {
        ll a;
        cin >> a;
        sum += a;
    }
    if (sum >= H)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }

    return 0;
}

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

int main() {
    int n;
    cin >> n;
    int left = 0,right = n;
    cout << 0 << endl;
    string ls;
    cin >> ls;
    if (ls == "Vacant") return 0;

    for (int i = 0; i < 20; i++) {
        int mid = abs(left + right) / 2;
        cout << mid << endl;
        string ms;
        cin >> ms;
        if (ms == "Vacant") return 0;

        if ((abs(left - mid) % 2 == 0 && ls == ms) || (abs(left - mid) % 2 == 1 && ls != ms)) {
            ls = ms;
            left = mid;
        }
        else right = mid;
    }
}

Measured memory_bytes: 852
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define divup(a,b) ( ( (a) + ( (b) - 1u) ) / (b) ) // a/b の余り切り上げ
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
ll mod = 1000000007;
struct point{
    int x,y;
};
char c[25][25];
int dx[4] = {-1,0,1,0};
int dy[4] = {0,1,0,-1};
int dist[25][25];

signed main(){
    ll h,w;
    cin>>h>>w;
    rep(i,25) rep(j,25) dist[i][i]=-1;
    rep(i,h){
        rep(j,w){
            cin>>c[i][j];
        }
    }
    queue<point> Q;
    ll maxd = 0;
    rep(i,h){
        rep(j,w){
            rep(k,25) rep(l,25) dist[l][k]=-1;
            if(c[i][j]=='#') continue;
            Q.push({j,i});
            dist[i][j]=0;
            while(!Q.empty()){
                point now = Q.front();
                Q.pop();
                rep(k,4){
                    point next = {now.x + dx[k],now.y + dy[k]};
                    if(next.y <0 || next.y >= h) continue;
                    else if(next.x <0 || next.x >= w) continue;
                    else if(c[next.y][next.x] == '#') continue;
                    else if(dist[next.y][next.x] != -1) continue;
                    dist[next.y][next.x] = dist[now.y][now.x]+1;
                    maxd = max(maxd,dist[next.y][next.x]);
                    // cout<<i<<" "<<j<<" "<<next.y<<" "<<next.x<<" "<<dist[next.y][next.x]<<endl;
                    Q.push({next.x,next.y});
                }
            }
        }
    }
    cout<<maxd<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <functional>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <utility>
#include <memory>
#include <valarray>
#include <climits>

using namespace std;

using ll = long long int;

#define loop(i, N) for (int i = 0; i < N; ++i)
#define scanInt(x) int x; scanf("%d", &x); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &x); getchar();
#define scanVecInt(A, N) vector<int> A(N); loop(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); loop(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanInt(H);
    scanInt(W);
    scanInt(y);
    scanInt(x);
    constexpr int B = 1000000000;
    if (W % x == 0 && H % y == 0){
        puts("No");
    }else{
        puts("Yes");
        for (int i = 1; i <= H; ++i){
            for (int j = 1; j <= W; ++j){
                int num = 0;
                if (i % y == 0 && j % x == 0) num = -B;
                if ((i % y == 1 || y == 1) && (j % x == 1 || x == 1)) num = B - 1;
                if (j == W){
                    printf("%d\n", num);
                }else{
                    printf("%d ", num);
                }
            }
        }
    }
}


Measured memory_bytes: 2944
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 28 22:56:10 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

N = int(input())
#X, Y = map(int,input().split())
#ab = [list(map(int,input().split())) for i in range(N-1)]

fact = [1, 1] # 元テーブル
fact_inv = [1, 1] # 逆元テーブル
tmp_inv = [0, 1] # 逆元テーブル計算用テーブル
for i in range(2, N+1):
    fact.append((fact[-1] * i) % mod)
    tmp_inv.append((-tmp_inv[mod % i] * (mod//i)) % mod)
    fact_inv.append((fact_inv[-1] * tmp_inv[-1]) % mod)
def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return fact[n] * fact_inv[r] * fact_inv[n-r] % mod
#逆元作成
def inv(a,mod):
    return pow(a,mod-2,mod)

graph = [[] for _ in range(N+1)]
for _ in range(N-1):
    a, b = map(lambda x : int(x)-1, input().split())
    graph[a].append(b)
    graph[b].append(a)

dp = [1] * (N + 0)
size = [0] * (N + 0)
def dfs(par, v):
    for u in graph[v]:
        if par == u:
            continue
        dfs(v, u)
        size[v] += size[u]
        dp[v] = dp[v] * dp[u] * fact_inv[size[u]] % mod
    dp[v] = dp[v] * fact[size[v]] % mod
    size[v] += 1

ans = [0] * (N + 0)
def reroot(par, val_par, size_par, v):
    ans[v] = val_par * dp[v] * cmb(N-1, size_par, mod) % mod
    for u in graph[v]:
        if par == u:
            continue
        val = ans[v] * inv(dp[u] * cmb(N-1, size[u],mod),mod) % mod
        reroot(v, val, N - size[u], u)

dfs(-1,1)
reroot(-1,1,0,1)
print(*ans, sep='\n')

Measured memory_bytes: 89312
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
	int n;
	cin >> n;
	vector<queue<int>> q(n + 1);
	int a;
	REP(i, n) {
		REP(j, n - 1) {
			cin >> a;
			q[i + 1].push(a);
		}
	}
	VI t(n + 1, 0);
	int i, flaga, flagb;
	for (i = 0; 1; i++) {
		flaga = 0; flagb = 0;
		for(int j = n;j >= 1;j--) {
			if (!q[j].empty()) {
				flaga = 1;
				if (t[j] != 1 && t[q[j].front()] != 1) {
					if (q[q[j].front()].front() == j) {
						//cout << j << ' ' << q[j].front() << ' ' << i << '\n';
						flagb = 1;
						t[j] = 1;
						t[q[j].front()] = 1;
						q[q[j].front()].pop();
						q[j].pop();
					}
				}
			}
		}
		REP(i, n)
			t[i + 1] = 0;
		if (flaga == 0)
			break;
		else if (flagb == 0) {
			i = -1;
			break;
		}
	}
	cout << i;
}

Measured memory_bytes: 6784
#include <iostream>

int main(int argc, char** argv) {
	long long A, B, K;
	std::cin >> A >> B >> K;
	A = A - K;
	if (A < 0) {
		B += A;
		A = 0;
		if (B < 0) B = 0;
	}
	std::cout << A << ' ' << B << '\n';

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
using P = pair<int, int>;
const ll inf =1e9;

struct edge{
    int to;
    int cost;
};
using graph = vector<vector<edge>>;

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

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

int n, m, k;
char grid[11][1010];
int dp[11][1010];
int ans;

bool check(int l, int r, int a, int b)
{
	return dp[a][b] - dp[l - 1][b] - dp[a][r - 1] + dp[l - 1][r - 1] <= k;
}

vector<int> pos = {1};

bool testC(int last, int j)
{
	bool fl = true;
	for(int i = 0; i < pos.size() - 1; i++)
	{
		int r1 = pos[i];
		int r2 = pos[i + 1] - 1;
		if(!check(r1, last, r2, j))
			return false;
	}
	return true;
}

void gen(int cur)
{
	if(cur == n + 1)
	{
		pos.push_back(n + 1);
		int cnt = 0, last = 1;
		bool ok = true;
		for(int j = 1; j <= m and ok; j++)
		{
			if(testC(last, j)) continue;
			if(j - 1 >= last and testC(last, j - 1))
			{
				cnt++;
				last = j;
				continue;
			}
			ok = false;
		}
		if(ok) ans = min(ans, (int)pos.size() - 2 + cnt);
		pos.pop_back();
		return;
	}
	gen(cur + 1);
	pos.push_back(cur);
	gen(cur + 1);
	pos.pop_back();
}

int32_t main()
{
	cin >> n >> m >> k;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			cin >> grid[i][j];

	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			dp[i][j] = dp[i - 1][j] + dp[i][j - 1] - dp[i - 1][j - 1] + (grid[i][j] == '1');
	
	ans = (n - 1) * (m - 1);
	gen(2);
	cout << ans << endl;

	
	return 0;
}

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

using namespace std;

int main() {
    int H,W;
    cin >> H >> W;
    char tmp;
    int count = 0;
    int finished = 0;

    vector<string> a(H);

    for (int i = 0; i < H; i++) {
		cin >> a.at(i);
	}

    do {
        finished = 0;
        for(int i = 0; i < H; i++) {
            count = 0;
            for(int j = 0; j < W; j++) {
                if(a[i][j] == '.') {
                    count++;
                }
            }

            if(count == W) {
                a.erase(a.begin() + i);
                finished = 1;
                H -= 1;
            }
        }

        for(int i = 0; i < W; i++) {
            count = 0;
            for(int j = 0; j < H; j++) {
                if(a[j][i] == '.') {
                    count++;
                }
            }

            if(count == H) {
                for(int j = 0; j < H; j++) {
                    a[j].erase(a[j].begin() + i);
                }
                finished = 1;
                W -= 1;
            }
        }

    } while(finished != 0);

    for (int i = 0; i < H; i++) {
		cout << a.at(i) << endl;
	}

	return 0;
}

Measured memory_bytes: 3632
#include<algorithm>//everybody dies in their nightmares
#include<iostream>
#include<cstring>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<string>
#include<vector>
#include<sstream>
#include<cmath>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#define f(i,a,b) for(register int i=a;i<=b;++i)
#define ff(i,a,b) for(register int i=a;i>=b;--i)
#define debug(x) cerr << #x << " : " << x << " " << endl
#define eb(a) emplace_back(a)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const ll mod = 1e18 + 7;
const double tiaohe = 0.57721566490153286060651209;
ll oula(ll x) { ll res = x;f(i, 2, x / i) { if (x % i == 0) { res = res / i * (i - 1);while (x % i == 0) x /= i; } }if (x > 1) res = res / x * (x - 1);return res; }
ll quickmod(ll a, ll n, ll m) { ll s = 1;while (n) { if (n & 1) { s = s * a % m; }a = (a*a) % m;n = n / 2; }return s; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
void ex_gcd(ll a, ll b, ll &x, ll &y, ll &d) { if (!b) { d = a, x = 1, y = 0; } else { ex_gcd(b, a % b, y, x, d);y -= x * (a / b); } }
ll inv(ll t, ll p) { ll d, x, y;ex_gcd(t, p, x, y, d);return d == 1 ? (x % p + p) % p : -1; }
bool isPrime(ll x) { if (x == 2)return true;if (x % 2 == 0)return false;for (ll i = 2;i*i <= x;i++) if (x % i == 0)return false; return true; }
//double a = log(n) +tiaohe + 1.0 / (2 * n);
double eqa = (1 + sqrt(5.0)) / 2.0;
const int N = 4e5 + 5;
int t;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	swap(a, b);
	swap(a, c);
	cout << a << " "<<b <<" "<< c << endl;
	return 0;
}


Measured memory_bytes: 256
/*
    Life Before Death, Strength Before Weakness, Journey Before Destination
    ------------------------------------------------------------------------
    You don't become great by trying to be great.
    You become great by wanting to do something,
    and then doing it so hard that you become great in the process.
    */

    //#pragma comment(linker, "/stack:200000000")
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    #include <bits/stdc++.h>
    using namespace std;
    
    #define TRACE
    
    #ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
    }
    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 trace(...)
    #endif
    
    #define rep(i, n)    for(int i = 0; i < (n); ++i)
    #define repA(i, a, n)  for(int i = a; i <= (n); ++i)
    #define repD(i, a, n)  for(int i = a; i >= (n); --i)
    #define trav(a, x) for(auto& a : x)
    #define all(x) x.begin(), x.end()
    #define sz(x) (int)(x).size()
    #define fill(a)  memset(a, 0, sizeof (a))
    #define fst first
    #define snd second
    #define mp make_pair
    #define pb push_back
    //#define M_PI           3.1415926535  /* pi */
    typedef long double ld;
    typedef long long ll;
    typedef pair<int, int> pii;
    typedef vector<ll> vi;
    const int maxN = 100224;

    void solve(){
      ll n;
      cin >> n ;
      cout <<n*(n-1)/2 - n/2 << endl;
      repA(i, 1, n) repA(j, i+1, n){
        if(i+j == n && n%2) continue;
        if(i+j == n+1 && n%2 == 0) continue;
        cout << i << " " << j << endl;
      }
    }

    
    int main() {
      cin.sync_with_stdio(0); cin.tie(0);
      cin.exceptions(cin.failbit);
      solve();
      return 0;
    }     

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

using namespace std;

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

}


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

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

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

/* const */
const int ARRAY = 100005;
const int INF = 1e9;
const ll LINF = 1e16;
const int MOD = 1e9 + 7;

ll N, M, L, Q;
ll dist[305][305];
ll supply[305][305];
ll s[105000];
ll t[105000];
ll ret = 0;

void input() {
  IN(N);
  IN(M);
  IN(L);
  FOR(i, 1, N+1) {
    FOR(j, 1, N+1) {
      if (i == j) {
        dist[i][j] = 0;
      } else {
        dist[i][j] = LINF;
      }
    }
  }
  ll A, B, C;
  REP(i, M) {
    IN(A);
    IN(B);
    IN(C);
    dist[A][B] = C;
    dist[B][A] = C;
  }
  IN(Q);
  FOR(i, 1, Q+1) {
    ll _s, _t;
    IN(_s);
    IN(_t);
    s[i] = _s;
    t[i] = _t;
  }

  //ワーシャルフロイド法
  FOR(k, 1, N+1) {
    FOR(i, 1, N+1) {
      FOR(j, 1, N+1) {
        //現時点でのi->jの最短路と、i->k->jの経路を比較する
        chmin(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }

  FOR(i, 1, N+1) {
    FOR(j, 1, N+1) {
      if (i == j) {
        supply[i][j] = 0;
      } else if (dist[i][j] <= L) {
        supply[i][j] = 1;
      } else {
        supply[i][j] = LINF;
      }
      // DEBUG(dist[i][j]);
    }
    // LN();
  }

  FOR(k, 1, N+1) {
    FOR(i, 1, N+1) {
      FOR(j, 1, N+1) {
        //現時点でのi->jの最短路と、i->k->jの経路を比較する
        chmin(supply[i][j], supply[i][k] + supply[k][j]);
      }
    }
  }

  // FOR(i, 1, N+1) {
  //   FOR(j, 1, N+1) {
  //     DEBUG(supply[i][j]);
  //   }
  //   LN();
  // }

  FOR(i, 1, Q+1) {
    if (supply[s[i]][t[i]] < LINF) {
      PRINT(supply[s[i]][t[i]] - 1);
    } else {
      PRINT(-1);
    } 
  }
}

void solve() {

}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 3328
#include <stdio.h>

int selectionSort(int A[],int n);

int main(){

  int A[100];
  int n,i,c;

  i=0;
  while(1){
    scanf("%d",&n);
    if(1<=n&&n<=100){
      while(1){
	if(n==i) break;
	scanf("%d", &A[i]);
	if(0<=A[i]&&A[i]<=100) i++;
      }
      break;
    }
  }

  c=selectionSort(A,n);

  for(i=0;i<n;i++){
    if(i>0) printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",c);

  return 0;
}

int selectionSort(int A[],int n){
  int i,j,c=0,t,min;
  for(i=0;i<n;i++){
    min=i;
    for(j=i;j<n;j++){
      if(A[min]>A[j]) min=j;
    }
    if(A[min]!=A[i]){
      t=A[i];
      A[i]=A[min];
      A[min]=t;
      c++;
    }
  }
  return c;
}



Measured memory_bytes: 2148
import java.util.*;

class Main{

    void solve(){
        Scanner sc = new Scanner(System.in);

        int INF = Integer.MAX_VALUE/2;
        int n = sc.nextInt();
        
        int[] A = new int[n+1];
        int[] B = new int[n+1];
        for(int i=1; i<=n; i++){
            A[i] = sc.nextInt();
            B[i] = sc.nextInt();
        }

        for(int i=1; i<=n; i++){
            int minIdx = i;
            for(int j=i; j<=n; j++){
                if(B[j]<B[minIdx]){
                    minIdx = j;
                }
            }
            int tmp = A[i];
            A[i] = A[minIdx];
            A[minIdx] = tmp;
            tmp = B[i];
            B[i] = B[minIdx];
            B[minIdx] = tmp;
        }
        
        int[][] dp = new int[n+1][n+1];
        for(int i=0; i<=n; i++) Arrays.fill(dp[i], INF);
        dp[0][0] = 0;
        for(int i=1; i<=n; i++){
            for(int j=0; j<=n; j++){
                int sum = A[i];
                if(j!=0) sum += dp[i-1][j-1];
                if(sum<=B[i]) dp[i][j] = Math.min(dp[i][j], sum);
                dp[i][j] = Math.min(dp[i][j], dp[i-1][j]);
            }
        }
        
        int max = 0;
        for(int i=0; i<=n; i++){
            if(dp[n][i]!=INF) max = i;
            //System.out.println(Arrays.toString(dp[i]));
        }
        System.out.println(max);
    }
    public static void main(String[] args){
        new Main().solve();
    }
}

Measured memory_bytes: 17368
#include<bits/stdc++.h>
using namespace std;
int main(){
	string a,b;
	cin>>a>>b;
	if(a=="H"&&b=="H"){
	
		printf("H\n");
}
	else if(a=="D"&&b=="D"){
	
	printf("H\n");
}
	else{
	
		printf("D\n");
	
}}


Measured memory_bytes: 384
//
// Created by yamunaku on 2019/09/07.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> mti;
typedef vector<ll> vl;
typedef vector<vector<ll>> mtl;

int main(){
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int ans=0;
    rep(i,n){
        if(s[i]=='L'){
            if(i>0) if(s[i-1]=='L'){
                ans++;
            }
        }else{
            if(i<n-1) if(s[i+1]=='R'){
                ans++;
            }
        }
    }
    cout << min(ans+2*k,n-1) << endl;
    return 0;
}


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

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

    int n;
    cin >> n;
    vector<int> ans(n + 1);
    for (int x = 1;; x++) {
        if (x * x > n) break;
        for (int y = 1;; y++) {
            if (x * x + y * y + x * y > n) break;
            for (int z = 1;; z++) {
                int s = x * x + y * y + z * z + x * y + y * z + z * x;
                if (s <= n) {
                    ans[s]++;
                } else {
                    break;
                }
            }
        }
    }
    for (int i = 1; i <= n; i++) {
        cout << ans[i] << endl;
    }
}


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

int main() {
    ll N, K;
    string S;
    cin >> N >> K;
    cin >> S;
    S[K - 1] -= ('A' - 'a');
    cout << S << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import (
  "fmt"
  "os"
  "bufio"
  "strconv"
)

func main() {
  sc := bufio.NewScanner(os.Stdin)
  sc.Split(bufio.ScanWords)

  sc.Scan()
  r, _ := strconv.Atoi(sc.Text())

  fmt.Println(3 * r * r)
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mst(a,b) memset(a,b,sizeof(a))
#define lowbit(x) ((x)&(-x))
#define X first
#define Y second
#define lc o<<1
#define rc o<<1|1
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
typedef long long LL;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 100000+10;
const int maxm = 2000+10;
const int mod = 1e9+7;
const double eps = 1e-8;
int main() {
#ifdef local
    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int a,b,k; cin>>a>>b>>k;
    for (int i=min(a,b);i>=1;i--){
        if (a%i==0 && b%i==0) k--;
        if (!k){
            cout<<i<<"\n";
            return 0;
        }
    }
    return 0;
}


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

int main(){
int x,y;
cin >> x >> y;
for(int i = 0;i <= x;i++){
    if(2*i + 4*(x-i) == y){
        cout << "Yes" << endl;
        return 0;
    }
}
cout << "No" << endl;
return 0;
}

Measured memory_bytes: 3636
n,m = map(int,input().split())
req = [list(map(int,input().split())) for i in range(m)]

req.sort(key=lambda x: x[1])

cnt=0
for i in range(m):
    
    if(i==0):
        last = req[i][1]
        cnt+=1
        continue
    now = req[i][0]
    if(now < last):
        continue
    last = req[i][1]
    cnt+=1

print(cnt)


Measured memory_bytes: 30120
import sys

N = int(sys.stdin.readline().rstrip())
S = sys.stdin.readline().rstrip()

if len(set(S)) == 1 or N < 3:
    print(0)
    sys.exit()

Rs = S.count("R")
Gs = S.count("G")
Bs = S.count("B")
ans = Rs * Gs * Bs


for i in range(N - 1):
    for j in range(i + 1, N):
        k = j + (j - i)
        if k >= N: break
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1
print(ans)

Measured memory_bytes: 9220
#include<stdio.h>
 
int main(void)
{
  int A,B;
  scanf("%d",&A);
  scanf("%d",&B);
  int diff;
  if(A > 2*B)
    diff = A -2*B;
  else
    diff = 0;
  
  printf("%d",diff);
  
  return 0;
}

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

int ytod( int year )
{
	bool leap = false;
	if( year % 4 == 0 ){
		if( year % 100 == 0 ){
			if( year % 400 == 0 ){
				leap = true;
			}
		}else{
			leap = true;
		}
	}

	return ( 365 + ( leap ? 1 : 0 ) );
}

int mtod( int month, int year )
{
	int monthes[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	int ret = monthes[ month ];
	if( month == 2 ){
		ret += ( ytod( year ) == 365 ? 0 : 1 );
	}
	return ret;
}

int dateToSerial( int year, int month, int day )
{
	int serial = 0;
	year -= 1;
	serial = year * 365 + ( year / 4 - year / 100 + year / 400 );
	for( int i = 1; i < month; ++i ){
		serial += mtod( i, year + 1 );
	}
	serial += day;
	return serial;
}

int main()
{
	int y1, m1, d1, y2, m2, d2;
	while( cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 ){
		if( y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0 ){
			break;
		}
		cout << dateToSerial( y2, m2, d2 ) - dateToSerial( y1, m1, d1 ) << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
import sys
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()
sys.setrecursionlimit(10**6)
"""========main code==============="""

t=1
for _ in range(t):
    x=ii()
    j=8
    for i in range(400,1801,200):
        if(x>=i and x<(i+200)):
            print(j)
        j-=1
        

Measured memory_bytes: 65100
#include<cstdlib>
#include<cstdio>

int main(){
	int H, W, D;
	scanf("%d %d %d", &H, &W, &D);
	int row[H*W], column[H*W];
	for (int i = 0; i < H; ++i)	{
		for (int j = 0; j < W; ++j)	{
			int tmp;
			scanf("%d", &tmp);
			tmp--;
			row[tmp] = i;
			column[tmp] = j;
		}
	}
	unsigned long long ruiseki[H*W];
	for (size_t i = 0; i < D; i++){
		ruiseki[i] = 0;
		for (size_t j = i + D; j < H*W; j+=D){
			ruiseki[j] = ruiseki[j - D] + abs(row[j] - row[j - D]) + abs(column[j] - column[j - D]);
		}
	}
	int Q;
	scanf("%d", &Q);
	for (int i = 0; i < Q; ++i) {
		unsigned l, r;
		scanf("%u %u", &l, &r);
		l--;r--;
		printf("%lld\n", ruiseki[r] - ruiseki[l]);
	}
	return 0;
}

Measured memory_bytes: 3132
#include<bits/stdc++.h>
using namespace std;
int N,K,dp[1<<17],h[1<<17];
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>N>>K;
	for(int i=1;i<=N;i++){
		cin>>h[i]; dp[i]=1e9;
	} dp[1]=0;
	for(int i=1;i<N;i++)
		for(int j=1;j<=K;j++)
			dp[i+j]=min(dp[i+j],dp[i]+abs(h[i]-h[i+j]));
	cout<<dp[N];
}

Measured memory_bytes: 1024
fun main(args: Array<String>) {
    val (n, c, k) = readLine()!!.split(' ').map { it.toInt() }
    val t = Array(n) { readLine()!!.toInt() }

    var ans = 0
    var waitStart = 0
    var waitPeople = 0

    for (ti in t.sorted()) {
        if (ti - waitStart > k || waitPeople == c) {
            waitPeople = 0
        }
        waitPeople++

        if (waitPeople == 1) {
            waitStart = ti
            ans++
        }
    }
    println(ans)
}


Measured memory_bytes: 44008
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main()
{
ll ans=100000,d,g;
cin >> d>>g;
ll que[d];
ll comp[d];
rep(i,d){
    cin >>que[i]>>comp[i];
}

for(int i=0;i< (1<<d);i++){
    ll sco=0,q=0,dd;
    rep(j,d){
        if(i>>j&1){sco+=(j+1)*100*que[j]+comp[j];q+=que[j];}
    }
    for(ll j = d-1; j >=0 ; j--){
        if(sco>=g)break;
        if(!(i>>j&1)){dd=j;break;}
    }
    //cout << q <<' '<<sco<<' '<<dd<<' ';
    
    rep(i,que[dd]){
        if(sco>=g)break;
        sco+=(dd+1)*100;
        q++;
    }
    //cout << q <<' '<<sco<< endl;
    if(ans>q&&sco>=g)ans=q;
}


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





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

using namespace std;

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

	vector<int> a(2*N);
	for (int i = 0; i < 2*N; i++){
		cin >> a[i];
	}

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

	int ans = 0;
	for (int i = 0; i < 2*N; i+=2){
		ans += a[i];
	}

	cout << ans << endl;

	return 0;
}

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


using namespace std;

#define fastio() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()


void go(){
	string n;cin>>n;
	if((n[0]==n[1]&&n[1]==n[2])||(n[1]==n[2]&&n[2]==n[3])) cout << "Yes";
	else cout << "No";
}
int main(){
   
   fastio();
   cin.tie(0);
   cout.tie(0);

   go();

   return 0;
}




Measured memory_bytes: 3572
#include<stdio.h>
int main()
{
        int a,i,even=0,odd=0;

        scanf("%d",&a);
        for(i=1;i<=a;i++)
        {
             if(i%2==0)
                even++;
             else odd++;

        }
          printf("%d\n",even*odd);




    return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
//#define uint __int128_t
 
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<vint> vvint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
const ll MOD=1000000007,INF=1e18;

int N,M;
int group[200020];
vint g[200020];
int flag=1;

void dfs(int now,int tmp){
    group[now]=tmp;
    tmp^=1;
    for(auto e:g[now]){
        if(group[e]==-1)dfs(e,tmp);
        else if(group[e]!=tmp)flag=0;
    }
}

signed main() {
    IOS();
    //(1ll<<N)シフト演算のオーバーフローに気をつける
    //MOD同士の引き算に注意
    cin>>N>>M;
    rep(i,0,M){
        int a,b;
        cin>>a>>b;
        a--;b--;
        g[a].pb(b);
        g[b].pb(a);
    }
    memset(group,-1,sizeof(group));
    dfs(0,1);
    if(flag==0)cout<<N*(N-1)/2-M<<endl;
    else{
        int cnt=0;
        rep(i,0,N)if(group[i]==1)cnt++;
        cout<<cnt*(N-cnt)-M<<endl;
    }
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

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

int main(){
    int a, b, c;
    int n,A,B,C;
    cin >> n;
 
    for(int i=0;i<n;i++){
        cin >> a >> b >> c;       
        A = a * a;
        B = b * b;
        C = c * c;
        if(A+B==C||B+C==A||C+A==B){
            cout << "YES" << endl;
        }else{
            cout << "NO" << endl;
        }
    }
}


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

// Begin {{{
using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0; i < (n); ++i)
#define reps(i, s, n) for (i64 i = (s); i <= (n); ++i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)

#ifdef DEBUG
#define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__);
#else
#define dump(...)
#endif

using i64 = int_fast64_t;
using pii = pair<i64, i64>;

template <class A, class B>
inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }

template <class A, class B>
inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

// input
void input() {}
template <class Head, class... Tail>
void input(Head&& head, Tail&&... tail) {
  cin >> head;
  input(forward<Tail>(tail)...);
}

// ouls
void outs() {}
template <class Head, class... Tail>
void outs(Head&& head, Tail&&... tail) {
  cout << head << " \n"[sizeof...(tail)==0];
  outs(forward<Tail>(tail)...);
}

template <class T>
void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; }

template <class T>
void outs(vector<vector<T>> &df) { for (auto &vec : df) OUTS(vec); }

// outl
void outl() {}
template <class Head, class... Tail>
void outl(Head&& head, Tail&&... tail) {
  cout << head << "\n";
  outl(forward<Tail>(tail)...);
}

template <class T>
void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

// outn
void outn() {}
template <class Head, class... Tail>
void outn(Head&& head, Tail&&... tail) {
  cout << head;
  outn(forward<Tail>(tail)...);
}

template <class T>
void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

// dump
template <class T>
void dump_(const char *s, T&& x) {
  clog << '{';
  while(*s != '\0') clog << *(s++);
  clog << ": " << x << '}' << "\n";
}

template <class Head, class... Tail>
void dump_(const char *s, Head&& head, Tail&&... tail) {
  clog << '{';
  while(*s != ',') clog << *(s++);
  clog << ": " << head << "}, ";
  for (++s; !isgraph(*s); ++s);
  dump_(s, forward<Tail>(tail)...);
}
// }}} End

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

  var(int, N);
  outl(pow(N, 3));
  return 0;
}


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

int main() {
  int H,W;
  while(1){
  cin >> H >> W;
    if(H==0 && W==0)
      break;
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
    
    cout << '#';
    }
    cout << endl;
    }
    cout <<endl;
  }
}



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

int main() {
	 
	 int n;
	    cin>>n;
	    int sum=0;
	     for(int i=0 ;i<n ;i++)
	     { int k;
	        cin>>k;
	        if(sum+1==k)
	     	  sum++;
	     }
	      if(sum==0)
	        cout<<-1<<endl;
	        else
	        cout<<n-sum<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s=new Scanner(System.in);
		int a=s.nextInt();
		int b=s.nextInt();
		int c=s.nextInt();
		
		if((b-a)==(c-b))System.out.print("YES");
		else System.out.print("NO");
		
		

	}

}

Measured memory_bytes: 21972
#ifdef LOCAL111
	#define _GLIBCXX_DEBUG
#else
	#pragma GCC optimize ("O3")
	#define NDEBUG
#endif
// #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
template<typename T, typename U> ostream& operator<< (ostream& os, const pair<T,U>& p) { os << '(' << p.first << ' ' << p.second << ')'; return os; }

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
	template<typename T> void dpite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
#else
	#define DEBUG(x) true
	template<typename T> void dpite(T a, T b){ return; }
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
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 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 U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

const array<int, 4> dx = {0, 1, 0, -1};
const array<int, 4> dy = {1, 0, -1, 0};


typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);
}

int main()
{
	ios_init();
	int n;
	while(cin >> n) {
		int ans = 0;
		FOR(i, 1, n + 1) {
			ans += (SZ(to_string(i))%2 == 1);
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        mut v: [(usize, usize); n]
    }
    v.sort_by_key(|x| x.1);
    let mut t = 0;
    for (a, b) in v {
        if t + a > b {
            println!("No");
            return;
        }
        t += a;
    }
    println!("Yes");
}


Measured memory_bytes: 10492
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n;
vvp a;

int main(){
	cin>>n;
	a=vvp(2*n);
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		a[x].push_back({y,0});
	}
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		a[x].push_back({y,1});
	}
	set<int> st;
	int res=0;
	for(int i=0;i<2*n;i++){
		sort(a[i].begin(),a[i].end());
		for(auto p:a[i]){
			int y=p.first,t=p.second;
			if(t){
				auto it=st.lower_bound(y);
				if(it!=st.begin()){
					st.erase(--it);
					res++;
				}
			}
			else st.insert(y);
		}
	}
	cout<<res<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int X[N];
    for (int i=0; i<N; i++){
        cin >> X[i];
    }

    int min=1000000;

    for (int p=1; p<100; p++){
        int power=0;
        for (int i=0; i<N; i++){
            power += (X[i]-p)*(X[i]-p);
        }
        if (power<min)  min=power;
    }
    cout << min << endl;
}

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

using namespace std;
#define int long long
int MOD;
void extgcd(int a, int b, int& x, int& y) {
	if (b != 0) {
		extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	} else {
		x = 1;
		y = 0;
	}
}

int mod_inverse(int a, int m) {
	int x, y;
	extgcd(a, m, x, y);
	return (m + x % m) % m;
}
int add(int& a, const int b) {
	a += b;
	if (a >= MOD) a -= MOD;
}
vector<int> fact;
vector<int> inv_fact;
vector<int> p2;
vector<int> inv_p2;
vector<int> inv_p6;
int C(int a, int b) {
	if (a < b || b < 0) return 0;

	return ((fact[a] * inv_fact[a - b]) % MOD) * inv_fact[b] % MOD;
}
int P(int a, int b) {
	if (a < b || b < 0) return 0;

	return ((fact[a] * inv_fact[a - b]) % MOD);
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N >> MOD;
	fact.resize(3 * N + 2, 1);
	inv_fact.resize(fact.size(), 1);
	p2.resize(3 * N + 2, 1);
	inv_p2.resize(3 * N + 2, 1);
	inv_p6.resize(3 * N + 2, 1);
	int inv2 = (MOD + 1) / 2;
	int inv6 = mod_inverse(6, MOD);
	for (int i = 1; i < fact.size(); i++) {
		fact[i] = (fact[i - 1] * i) % MOD;
		p2[i] = (p2[i - 1] * 2) % MOD;
		inv_fact[i] = mod_inverse(fact[i], MOD);
		inv_p2[i] = (inv_p2[i - 1] * inv2) % MOD;
		inv_p6[i] = (inv_p6[i - 1] * inv6) % MOD;
	}
	int res = 0;
	for (int n2 = 0; n2 <= 3 * N; n2++) {
		for (int n1 = 0; n1 <= 3 * N; n1++) {
			if (n2 * 2 + n1 > 3 * N) break;
			if (n2 > n1) continue;
			int n3 = 3 * N - n2 * 2 - n1;
			if (n3 % 3 != 0) continue;
			int ans = 1;
			n3 /= 3;

			ans = (ans * C(3 * N, n1)) % MOD;

			ans = (ans * P(3 * N - n1, n2 * 2)) % MOD;
			ans = (ans * inv_fact[n2]) % MOD;
			ans = (ans * inv_p2[n2]) % MOD;

			ans = (ans * fact[n3 * 3]) % MOD;
			ans = (ans * inv_fact[n3]) % MOD;
			ans = (ans * inv_p6[n3]) % MOD;
			ans = (ans * p2[n3]) % MOD;

			//cerr << n1 << " " << n2 << " " << n3 << " " << ans << endl;
			add(res, ans);
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 512
_ = input()
ts = [int(i) for i in input().split(" ")]
m = int(input())
res = []
sumres = sum(ts)
for i in range(m):
    p, x = [int(i) for i in input().split(" ")]
    res.append(sumres - ts[p-1] + x)

for i in res:
    print(i)


Measured memory_bytes: 3060