akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <queue>
#include <cstdint>

inline uint64_t sub_abs(uint64_t a, uint64_t b)
{
  return (a > b) ? a - b : b - a;
}

int main(void)
{
  uint64_t N, Z, W;
  std::cin >> N >> Z >> W;
  
  std::vector<uint64_t> a(N);
  for (uint64_t n = 0; n < N; ++n) {
    std::cin >> a[n];
  }
  
  if (N == 1) {
    std::cout << sub_abs(a[0], W) << std::endl;
  } else {
    std::cout << std::max(sub_abs(a[N - 1], W), sub_abs(a[N - 2], a[N - 1])) << std::endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,A=0,B=0;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  for (int i = 0; i < N; i++){
    if(i%2 == 0) A += a[i];
    else B += a[i];
  }
  cout << A - B;
}


Measured memory_bytes: 3660
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
// #pragma GCC optimize("unroll-loops")



#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include <ext/rope>
// using namespace __gnu_pbds;
// using namespace __gnu_cxx;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// #define Find order_of_key
// #define at find_by_order
#define x first
#define y second
#define ll long long
#define lll __int128
#define ull unsigned long long
#define ulll unsigned __int128
#define pii pair<ll,ll>
#define pb push_back
#define eb emplace_back
#define gu getchar_unlocked()
#define pu putchar_unlocked()
#define all(x) x.begin(),x.end()
#define endl '\n'
const int mx=200010;
int n;
pii p[mx];
int main()
{
	cin>>n;
	ll a=-1e18,b=-1e18,c=-1e18,d=-1e18;
	for(int i=0;i<n;i++){
		cin>>p[i].x>>p[i].y;
		a=max(a,p[i].x+p[i].y);
		b=max(b,p[i].x-p[i].y);
		c=max(c,-p[i].x+p[i].y);
		d=max(d,-p[i].x-p[i].y);
	}
	ll an=-1;
	for(int i=0;i<n;i++){
		an=max(an,a+(-p[i].x-p[i].y));
		an=max(an,b+(-p[i].x+p[i].y));
		an=max(an,c+(+p[i].x-p[i].y));
		an=max(an,d+(+p[i].x+p[i].y));
	}
	cout<<an<<endl;
	return 0;
}

Measured memory_bytes: 6736
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

ll x[20][20], y[20][20];

int main() {
    ll N;
    cin >> N;
    vll a(N);
    rep(i, N) {
        cin >> a[i];
        rep(j, a[i]) {
            cin >> x[i][j] >> y[i][j];
            x[i][j]--;
        }
    }

    ll ans = 0;
    rep(bit, 1<<N) {
        bool ok = true;
        rep(i, N) {
            if(!(bit>>i&1)) continue;
            rep(j, a[i]) {
                if((bit>>x[i][j]&1) && y[i][j] == 0) ok = false;
                if(!(bit>>x[i][j]&1) && y[i][j] == 1) ok = false;
            }
        }
        if(ok) chmax(ans, __builtin_popcountll(bit));
    }
    cout << ans << endl;
}

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

C = []
for _ in range(N):
    x, y, z = map(int, input().split())
    C.append((x, y, z))

ans = 0
for i in range(2 ** 3):
    flg = [1, 1, 1]
    for j in range(3):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            flg[j] = -1
    C = sorted(C, key=lambda p: sum(
        [a*b for a, b in zip(p, flg)]), reverse=True)

    X, Y, Z = 0, 0, 0
    for x, y, z in C[:M]:
        X += x
        Y += y
        Z += z
    ans = max(ans, abs(X)+abs(Y)+abs(Z))

print(ans)


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

int main() {
  string s;
  cin >> s;

  int cnt = 0;
  if(s[0] == '1') ++cnt;
  if(s[1] == '1') ++cnt;
  if(s[2] == '1') ++cnt;
  cout << cnt << endl;
}

Measured memory_bytes: 256
class C{
  // public:
  long[] fac, inv;
  long mod=1_000_000_000+7;
  this(int n){
    fac.length=n+1;
    fac[0]=fac[1]=1;
    for(int i=2; i<=n; i++) fac[i]=i*fac[i-1]%mod;
    inv.length=n+1;
    for(int i=0; i<=n; i++) inv[i]=pow(fac[i], mod-2);
  }
  long pow(long a, long x){
    if(x==0) return 1;
    else if(x==1) return a;
    else if(x%2==0) return pow(a*a%mod, x/2);
    else return a*pow(a, x-1)%mod;
  }
  long comb(int n, int k){
    if(n<k) return 0;
    else return (fac[n]*inv[n-k]%mod)*inv[k]%mod;
  }
}


void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n; rd(n);
  auto d=readln.split.to!(int[]);
  int m; rd(m);
  auto t=readln.split.to!(int[]);

  if(n<m){writeln("NO"); return;}

  sort(d); sort(t);
  int i=0, j=0;
  while(j<m){
    while(i<n && d[i]<t[j]) i++;
    if(i>=n) break;
    if(d[i]!=t[j]) break;
    i++; j++;
  }

  if(j==m) writeln("YES");
  else writeln("NO");
}


void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}

Measured memory_bytes: 19300
#include <iostream>

using namespace std;

int main(){
    int n;
    while(cin >> n, n){
        int field[n][5];
        for(int i=0; i < n; i++){
            for(int j=0; j < 5; j++) cin >> field[i][j];
        }


        int point = 0;
        while(1){
            int save = point;
            for(int i=0; i < n; i++){
                for(int j=0; j < 5; j++){
                    if(field[i][j] == field[i][j+1]){
                        int count = 0;
                        for(int k=j; k < 5; k++){
                            if(field[i][j] == field[i][k]) count++;
                            else break;
                        }
                        if(3 <= count){
                            point += field[i][j]*count;
                            for(int k=0; k < count; k++) field[i][j+k] = 0;
                        }
                    }
                }
            }

            if(point == save || n == 1) break;

            for(int i = n-1; 0 < i; i--){
                for(int j=0; j < 5; j++){
                    if(field[i][j] == 0){
                        for(int k=0; 0 <= i-k; k++){
                            if(field[i-k][j] != 0){
                                field[i][j] = field[i-k][j];
                                field[i-k][j] = 0;
                                break;
                            }
                        }
                    }
                }
            }
        }
        cout << point << endl;
    }
}

Measured memory_bytes: 1160
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

	public static void countingSort(int[] a, int[] b, int k, int n){
		int[] c = new int[k + 1];

		for(int i = 0; i < n; i++) {
			c[a[i]]++;
		}

		for(int i = 1; i < k + 1; i++) {
			c[i] = c[i] + c[i - 1];
		}

		for(int i = n - 1; i >= 0; i--) {
			b[c[a[i]] - 1] = a[i];
			c[a[i]]--;
		}
	}

	public static void main(String[] args) throws NumberFormatException, IOException{
		Scanner scan = new Scanner(new InputStreamReader(System.in));

		int ElementCount = scan.nextInt();

		int[] cInt = new int[ElementCount];

		int cIntMaxNum = 0;
		for(int i = 0; i < ElementCount; i++) {
			cInt[i] = scan.nextInt();
			cIntMaxNum = Math.max(cIntMaxNum, cInt[i]);
		}

		int[] cIntSort = new int[ElementCount];

		countingSort(cInt, cIntSort, cIntMaxNum, ElementCount);

		StringBuilder sb = new StringBuilder();

		for(int i = 0; i < cIntSort.length; i++) {
			sb.append(cIntSort[i]);
			if(i == cIntSort.length - 1){
				break;
			}
			sb.append(" ");
		}
		System.out.println(sb.toString());
	}
}

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

typedef long long ll;

int main()
{
    ll n,k;
    cin >> n >> k;
    int i;
    ll ans = 0;
    if(k == 0){
        cout << n*n << endl;
        return 0;
    }
    for(i = k+1;i <= n;++i){
        int temp= n/i;
        int spare = n%i;
        ans += temp*(i-k);
        if(spare >= k){
            ans += spare-k+1;
        }
    }
    cout << ans << endl;
    return 0;
}

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

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

  if (N/100 == 7) {
    cout << "Yes" << endl;
  }
  else if (N/10-N/100*10 == 7) {
    cout << "Yes" << endl;
  }
  else if (N-(N/10-N/100*10)*10-N/100*100 == 7) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

}




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

const int MAX_N = 90000;

char A[20];

int num[10];

int main() {
	int n,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",&A);
		if(A[0]=='M')num[0]++;
		if(A[0]=='A')num[1]++;
		if(A[0]=='R')num[2]++;
		if(A[0]=='C')num[3]++;
		if(A[0]=='H')num[4]++;
	}
	long long int sum = 0;
	for(i=4;i>=1;i--)
	for(j=i-1;j>=1;j--){
		sum+=(long long int)num[i]*num[j]*num[0];
	}
	for(i=4;i>=2;i--)
	for(j=i-1;j>=2;j--){
		sum+=(long long int)num[i]*num[j]*num[1];
	}
	sum+=(long long int)num[4]*num[3]*num[2];
	
	printf("%lld",sum);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

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

int main(int argc, char** argv) {
  ll N;
  cin >> N;

  vector<ll> factors;
  for (ll k = 2; k <= N; ++k) {
    ll n = k;

    // Calculate prime factors.
    ll i = 2;
    while (i * i <= n) {
      while ((n % i) == 0) {
        factors.push_back(i);
        n /= i;
        // For Debug
      }
      ++i;
    }
    if (n > 1) {
      factors.push_back(n);
    }
  }
  map<ll, ll> mp;
  for (auto x : factors) {
    ++mp[x];
  }

  // For Debug
  // for (auto x : mp) {
  //   cout << x.first << ": " << x.second << endl;
  // }

  // Here, we calculate the count of 74, 24, 14, 4, 2
  // (75) -> 1C1 = 1
  // (25, 3) -> 3C1 * (15-1)C1 = 42
  // (15, 5) -> 4C1 * (9-1)C1 = 32
  // (5, 5, 3) -> 9C2 * (15-2)C1 = 468
  ll c74 = 0;
  ll c24 = 0;
  ll c14 = 0;
  ll c4 = 0;
  ll c2 = 0;
  for (auto x : mp) {
    if (x.second >= 74) { ++c74; }
    if (x.second >= 24) { ++c24; }
    if (x.second >= 14) { ++c14; }
    if (x.second >= 4)  { ++c4; }
    if (x.second >= 2)  { ++c2; }
  }

  ll ans = 0;
  if (c74 > 0) {
    ans += c74;
  }
  if ((c24 > 0) && (c2 > 1)) {
    ans += c24 * (c2 - 1);
  }
  if ((c14 > 0) && (c4 > 1)) {
    ans += c14 * (c4 - 1);
  }
  if ((c4 >= 2) && (c2 >= 3)) {
    ans += c4*(c4-1)/2 * (c2-2);
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

h, w = map(int, input().split())

a = [list(input()) for i in range(h)]

# あー､ループの中で元の配列を変えちゃってるからエラー出てたのか

a_new = list()

for i, li  in enumerate(a):
    if a[i].count('.')  != w:
        a_new.append(a[i])

b = [list(i) for i in zip(*a_new)]


b_new = list()

for i, li  in enumerate(b):
    if b[i].count('.')  != len(b[0]):
        b_new.append(b[i])

c = [list(i) for i in zip(*b_new)]
for i in c:
    print(''.join(i))





Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define foreach(it,v) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define chmax(a,b) a=max(a,b)
int n;
int a[6005];
int dp[2005][2005];
void upd(int x,int y,int v){
	chmax(dp[x][y],v);
	chmax(dp[y][x],v);
	chmax(dp[x][n],v);
	chmax(dp[n][x],v);
	chmax(dp[n][y],v);
	chmax(dp[y][n],v);
	chmax(dp[n][n],v);
} 
struct node{
	int x;
	int y;
	int v;
	node(int _x=0,int _y=0,int _v=0):x(_x),y(_y),v(_v){}
};
int main(){
	cin>>n;
	int nn=n*3;
	for(int i=0;i<nn;++i){
		cin>>a[i];
		a[i]--;
	}
	for(int i=0;i<=n;++i){
		for(int j=0;j<=n;++j){
			dp[i][j]=-2e9;
		}
	}
	upd(a[0],a[1],0);
	int cnt=0;
	for(int i=2;i<nn-1;i+=3){
		int x=a[i],y=a[i+1],z=a[i+2];
		if(x==y&&y==z){
			cnt++;
			continue;
		}
		vector<node> v;
		for(int j=0;j<3;++j){
			{
				for(int k=0;k<=n;++k){
					int now=dp[k][n];
					if(y==z){
						chmax(now,dp[k][y]+1);
					}
					v.push_back(node(k,x,now));
				}
			}
			{
				int now=max(dp[n][n],dp[z][z]+1);
				v.push_back(node(x,y,now));
			}
			swap(x,y);
			swap(y,z);
		}
		for(node nd:v){
			int x=nd.x;
			int y=nd.y;
			int v=nd.v;
			upd(x,y,v);
		}
	}
	int ans=dp[n][n];
	int l=a[nn-1];
	chmax(ans,dp[l][l]+1);
	ans+=cnt;
	cout<<ans<<'\n';
	return 0;
}


Measured memory_bytes: 19428
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <map>
#include <vector>
#include <unordered_map>

#define div 1000000000+7

using ll = long long;
using namespace std;

void solve() {
    int n, m;
    cin >> n >> m;
    bool a[n], b[n];

    for(int i = 0; i < n; i++){
        a[i] = 0;
        b[i] = 0;
    }
    for(int i = 0; i < m; i++){
        int x, y;
        cin >> x >> y;
        if(x == 1){
            //cout << x << ", " << y << endl;
            a[y] = true;
        }else if(y == n){
            b[x] = true;
        }
    }
    for(int i = 1; i < n; i++){
        //cout << a[i] << " " << b[i] << endl;
        if(a[i] && b[i]){
            cout << "POSSIBLE" << endl;
            return;
        }
    }
    cout << "IMPOSSIBLE" << endl;
}

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


Measured memory_bytes: 640
#include<iostream>
#include<string>
using namespace std;
int main() {
	string s;
	cin >> s;
	if (s[0] == s[1]) {
		if (s[1] == s[2]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int main(){
	int N;
	cin>>N;
	vector<int> a(N),b(N);
	rep(i,N) cin>>a[i];
	rep(i,N) cin>>b[i];
	int ans = 0;
	rep(t,29){
		int T = 1<<(t+1);
		vector<int> xs,ys;
		rep(i,N){
			xs.pb(a[i]%T);
			ys.pb(b[i]%T);
			ys.pb(b[i]%T+T);
		}
		sort(all(xs));
		sort(all(ys));
		bool odd = 0;
		for(int x: xs){
			int s = (T-x)%T;
			int num = N - (lower_bound(all(ys),s+T/2) - lower_bound(all(ys),s));
			if(num%2) odd = !odd;
		}
		if(odd) ans |= 1<<t;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 7144
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String[] t = sc.nextLine().split(" ");
		int n = Integer.parseInt(t[0]);
		int k = Integer.parseInt(t[1]);

		String[] x = sc.nextLine().split(" ");
		int[] list = new int[k];
		int max = 0;

		for(int i = 0; i < k; i++) {
			list[i] = Integer.parseInt(x[i]);
		}

		for(int i = 0; i < k; i++) {
			if(i != 0 && i != k-1) {

				max = Math.max(max, Math.max(list[i] - list[i - 1], list[i + 1] - list[i]));
			}
		}
		System.out.println(n - Math.max(max, n - list[k - 1] + list[0]) );
	}
}


Measured memory_bytes: 71428
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA() cerr << "AAAAA" << endl
#define debug_() cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

using Graph = vector<vector<int>>;
using P = pair<int, int>;

int main()
{
    int n, m;
    cin >> n >> m;
    priority_queue<int, vector<int>, less<int>> que;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        que.push(a);
    }
    for (int i = 0; i < m; i++)
    {
        int x = que.top();
        que.pop();
        que.push(x / 2);
    }
    ll ans = 0;
    while (!que.empty())
    {
        ans += que.top();
        que.pop();
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  





void solve(){
	int a , b , k; 
	cin >> a >> b >> k; 
	int res = min(a,k);
	a-=res;
	k-=res;
	res = min(b,k);
	b-=res;
	k-=res;
	cout << a << ' ' << b << endl;
}

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3636
pub struct ProconReader<R: std::io::Read> {
    reader: R,
}

impl<R: std::io::Read> ProconReader<R> {
    pub fn new(reader: R) -> Self {
        Self { reader }
    }
    pub fn get<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&byte| byte == b' ' || byte == b'\n' || byte == b'\r')
            .take_while(|&byte| byte != b' ' && byte != b'\n' && byte != b'\r')
            .collect::<Vec<_>>();
        std::str::from_utf8(&buf)
            .unwrap()
            .parse()
            .ok()
            .expect("Parse Error.")
    }
}

fn main() {
    let stdin = std::io::stdin();
    let mut rd = ProconReader::new(stdin.lock());

    let n: String = rd.get();
    let n = n.chars().collect::<Vec<_>>();
    let s = n
        .iter()
        .map(|&c| c as u8 - '0' as u8)
        .map(|c| c as u32)
        .sum::<u32>();
    println!("{}", if s % 9 == 0 { "Yes" } else { "No" });
}

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

#define sc(a) scanf("%d",&a)
#define scm(a,b) scanf("%d%d",&a,&b)
#define fl(c,i,n) for(int i=c;i<n;i++)
#define f(i,n) for(int i=0;i<n;i++)
#define mem(a) memset(a,0,sizeof(a))
#define ll long long int
#define ull unsigned long long int
#define inf INT_MAX
#define linf LLONG_MAX
#define pb push_back
#define pp pop_back()
#define aov(a) a.begin(),a.end()
//#define mp make_pair
#define nl printf("\n")
#define PI 2.0*acos(0.0) //#define PI acos(-1.0)
#define xx first
#define yy second
#define mxv(a) *max_element(aov(a))
#define mnv(a) *min_element(aov(a))
#define LB(a,x) (lower_bound(aov(a),x)-a.begin())
#define UB(a,x) (upper_bound(aov(a),x)-a.begin())
#define to_c_string(a) a.c_str()
#define strtoint(c) atoi(&c[0])
#define pii pair<int,int>
#define MAXN 500005
#define MOD 1000000007

template <class T> inline T bigmod(T p,T e,T M){
    ll ret = 1;
    for(; e > 0; e >>= 1){
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
/*int fact[MAXN];
int invfact[MAXN];
int inv(int a, int b){
    if(b==0)
        return 1;
    if(b&1)
        return (long long)a*inv(a, b-1)%MOD;
    else{
        int res = inv(a, b>>1);
        return (long long)res*res%MOD;
    }
}
void init(){
    fact[0] = 1;
    for(int i=1;i<MAXN;i++){
        fact[i] = (long long)fact[i-1]*i%MOD;
    }
    invfact[MAXN-1] = inv(fact[MAXN-1], MOD-2);
    for(int i=MAXN-1;i>0;i--){
        invfact[i-1] = (long long)invfact[i]*i%MOD;
    }
}
int C(int n, int r){
    if(r>n || r<0)
        return 0;
    return (long long)((long long)fact[n]*invfact[r]%MOD)*invfact[n-r]%MOD;
}*/
int a, b, c;
void solve(){
    cin>>a>>b>>c;
    if(b-a==c-b){
        cout<<"YES";
    }
    else{
        cout<<"NO";
    }
}
int main(){
    /*FILE *fin = freopen("C-small-attempt0.in", "r", stdin);
	assert( fin!=NULL );
	FILE *fout = freopen("C-small.out", "w", stdout);*/
	//init();
    solve();
    return 0;
}


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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  string a,b;
cin >> a >> b;
for(int i = 0; i < a.size()+b.size(); i++){
if(i % 2 == 0) cout << a[i/2];
else cout << b[(i-1)/2];
}
cout << endl;

}


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


int main() {
  
  int A,B;
  
  cin>>A>>B;
  
  int E=1;
  int F=0;
  
  if(B==1){
    cout<<F<<endl;
    return 0;
  }
  
  int sw=0;
  
  if(B<=A){
    cout<<E<<endl;
    return 0;
  }
  
  int C=(B-A)/(A-1);
  int D;
  
  if((A-1)*C+A==B){
    D=C+1;
  }else{
    D=C+2;
  }
  
  //int D=C+1;
  
  cout<<D<<endl;
  
}





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

int main(){
    string M;
    cin >> M;

    for (int i = 0; i < M.length(); i++){
        if(M.substr(i, 1) == "P"){
            if(M.substr(i+1, 1) == "?" || M.substr(i+1, 1) == "D"){
                cout << "PD";
                i++;
            }
            else    cout << "P";
            continue;
        }
        else if(M.substr(i, 1) == "D"){
            cout << "D";
            continue;
        }
        else{
            if(M.substr(i+1, 1) == "D" || M.substr(i+1, 1) == "?"){
                cout << "PD";
                i++;
            }
            else    cout << "D";
            continue;
        }
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fi first
#define se second
#define endl '\n'
#define y1 holyshit
#define all(x) x.begin(),x.end()
const int inf=0x3f3f3f3f;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int S,W; cin>>S>>W;
    if(S>W) cout<<"safe";
    else cout<<"unsafe";
    return 0;
}

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

int main() {
  long long n, m;
  std::cin >> n >> m;
  
  long long ans = std::min(n, m / 2);
  n -= ans;
  m -= 2 * ans;
  ans += m / 4;
  std::cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 3616
//HMD
#include<iostream>
using namespace std;

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


Measured memory_bytes: 3064
#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 dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
    int n, m;
    cin >> n >> m;
    vector<string> grid(n);
    for( int i = 0; i < n; ++i){
        cin >> grid[i];
    }
    int sx, sy;
    vector<pii> posspoints;
    for(int i = 0; i < n; ++i){
        for( int j = 0; j < m; ++j){
            if(grid[i][j] == '.'){
                posspoints.push_back({i, j});
            }
        }
    }
    int mx = 0;
    int dist[n + 1][m + 1];
    bool vis[n+1][m+1];
    queue<pii> q;
    //do bfs from all non wall points
    for( auto & pt: posspoints){
        memset(dist, INT_MAX, sizeof(dist));
        memset(vis, false, sizeof(vis));
        int sx = pt.first;
        int sy = pt.second;
        q.push({sx,sy});
        vis[sx][sy] = 1;
        dist[sx][sy] = 0;
        int currmx = 0;
        while(!q.empty()){
            pii now = q.front();
            int x = now.first;
            int y = now.second;
            q.pop();
            for( int i = 0; i < 4; ++i){
                int newx = x + dx[i];
                int newy = y + dy[i];
                if(newx>= 0 and newx < n and newy >=0 and newy < m and vis[newx][newy] == false and grid[newx][newy] == '.'){
                    q.push({newx, newy});
                    dist[newx][newy] = dist[x][y] + 1;
                    currmx = max(currmx, dist[newx][newy]);
                    vis[newx][newy] = true;
                }
            }
        }
        mx = max(mx, currmx);
    }
    cout << mx << '\n';
    return 0;
}




Measured memory_bytes: 256
a, b, k = map(int, input().split())
for i in range(k):
  if i % 2 == 0:
    if a % 2 == 1:
      a -= 1
    num = a // 2
    a, b = a - num, b + num
  else:
    if b % 2 == 1:
      b -= 1
    num = b // 2
    a, b = a + num, b - num
print(a, b)

Measured memory_bytes: 9112
package main

import (
	"fmt"
	"sort"
)

func main() {
	var x, y, z, k int
	fmt.Scan(&x, &y, &z, &k)
	a := make([]int, x)
	for i := 0; i < x; i++ {
		fmt.Scan(&a[i])
	}
	b := make([]int, y)
	for i := 0; i < y; i++ {
		fmt.Scan(&b[i])
	}
	c := make([]int, z)
	for i := 0; i < z; i++ {
		fmt.Scan(&c[i])
	}
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	sort.Sort(sort.Reverse(sort.IntSlice(b)))
	sort.Sort(sort.Reverse(sort.IntSlice(c)))

	t := make([]int, 110000)
	for ia, va := range a {
		for ib, vb := range b {
			for ic, vc := range c {
				if (ia+1)*(ib+1)*(ic+1) <= k {
					t = append(t, va+vb+vc)
				} else {
					break
				}
			}
		}
	}
	sort.Sort(sort.Reverse(sort.IntSlice(t)))

	for i := 0; i < k; i++ {
		fmt.Println(t[i])
	}
}


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

public class Main {
	void run() {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		String s = str.substring(0,str.length()-8);
		System.out.println(s);
		sc.close();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().run();
	}
}


Measured memory_bytes: 21716
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U>
inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U>
inline void cmin(T& a, U b) { if (a > b) a = b; }

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cerr << fixed << setprecision(15);
  }
} io_setup;

constexpr char el = '\n';

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U>& p) {
  os << p.first << " " << p.second;
  return os;
}
template<typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template<typename T>
ostream &operator<<(ostream &os, const vector< T > &v) {
  rep(i, v.size())
    os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template<typename T>
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}
#line 2 "a.cpp"

int main() {
  string s;
  cin >> s;
  if (s[2] == s[3] and s[4] == s[5]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<iomanip>
typedef long long LL;

using namespace std;



int main(void) {
	int n;
	cin >> n;
	vector<int>a(n);
	double ave = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		ave += a[i];
	}
	ave /= n;
	double d = 10e9;
	for (int i = 0; i < n; i++) {
		d = min(d, abs(ave - a[i]));
	}
	for (int i = 0; i < n; i++) {
		if (d == abs(a[i] - ave)) {
			cout << i;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
import math

l = input().split()
N = float(l[0])
X = float(l[1])

a = []
for i in range(int(N)):
    a.append(float(input()))

sum = 0
for n in a:
    sum += n

min = min(a)
b = int(math.floor((X - sum) / min))

print(int(N) + b)


Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a;
  cin>>a;
  string b;
  int i=0;
  int d=0;
  for(i=0;i<a;i++){
    cin>>b;
    if(b=="Y")
      d++;
  }
  if(d==0)
    cout<<"Three"<<endl;
  else
    cout<<"Four"<<endl;
}

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

string s;
int N;
int c;

int expr();
int term();
int factor();
int num();

void debug(string text){
	return;
	cout << text + " ";
	for(int i = 0; i < N; i++){
		if(i == c) cout << '[' << s[i] << ']';
		else cout << s[i];
	}
	cout << endl;
}

int expr(){
	debug("expr");
	int x = term();
	while(c < N){
		if(s[c] == '+'){
			c++;
			x += term();
		}
		else if(s[c] == '-'){
			c++;
			x -= term();
		}
		else break;
	}
	return x;
}

int term(){
	debug("term");
	int x = factor();
	while(c < N){
		if(s[c] == '*'){
			c++;
			x *= factor();
		}
		else if(s[c] == '/'){
			c++;
			x /= factor();
		}
		else break;
	}
	return x;
}

int factor(){
	debug("factor");
	if(s[c] == '('){
		c++;
		int ret = expr();
		assert(s[c] == ')');
		c++;
		return ret;
	}
	return num();
}

int num(){
	debug("num");
	int ret = 0;
	while(c < N && isdigit(s[c])){
		ret = ret * 10 + s[c] - '0';
		c++;
	}
	return ret;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	int n;
	cin >> n;
	while(n--){
		cin >> s;
		s.pop_back();
		N = s.size();
		c = 0;
		cout << expr() << endl;
	}
}

Measured memory_bytes: 3048
#include<cstdio>
#include<iostream>
using namespace std;
int i;
char cf[3]="CF",a[105];
int main(){
	scanf("%s",a);
	for(int j=0;a[j];j++){
		if(a[j]==cf[i])i++;
		if(i==2){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}


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

using namespace std;

long long f(long long n, long long x)
{
    if(x==0)
        return 0;
    if(2*x>=n)
        return 2*x+n/(n-x)*(n-x)-((n-x)-(n%(n-x)))+f(n-x, n%(n-x));
    long long t=(n-1)/(2*x);
    return 3*x*t+f(n-x*t, x);
}

int main()
{
    long long N, X;
    cin>>N>>X;
    cout<<f(N, X)<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const ll INF = 1LL << 60;
const ll MOD = (ll) 1e9 + 7;

int main(){
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<char>());
    cout << (s < t ? "Yes" : "No") << "\n";
}

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

int main(void){
 char S[3];
 char *ad1;
 char *ad2;
  
  scanf("%s",S);
  
  ad1=strstr(S,"AAA");
  ad2=strstr(S,"BBB");
  
  if((ad1!=NULL)||(ad2!=NULL)){
    printf("No\n");
  }
  else{
    printf("Yes\n");
  }
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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() {
    double a,b,c;
    cin >> a >> b >> c;
    double PI = acos(-1);
    c = c*PI/180;
    double s = 0.5*a*b*sin(c);
    double l = a+b + sqrt(a*a + b*b -2*a*b*cos(c));
    double h = 2*s/a;
    cout << fixed << setprecision(10);
    cout << s << "\n" << l << "\n" << h << "\n";
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/


Measured memory_bytes: 3516
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int A, B, C;

	public static void main(String[] args) {
		while (true) {
			A = sc.nextInt();
			if (A == 0) break;
			B = sc.nextInt();
			C = sc.nextInt();
			int[] ans = solve();
			if (ans != null) {
				if (ans[0] < ans[2]) {
					swap(ans);
				} else if (ans[0] == ans[2] && ans[1] < ans[3]) {
					swap(ans);
				}
				System.out.println(ans[0] + " " + ans[1] + " " + ans[2] + " " + ans[3]);
			} else {
				System.out.println("Impossible");
			}
		}
	}

	static void swap(int[] ans) {
		int tmp = ans[0];
		ans[0] = ans[2];
		ans[2] = tmp;
		tmp = ans[1];
		ans[1] = ans[3];
		ans[3] = tmp;
	}

	static int[] solve() {
		int[] ret = new int[4];
		if (C == 0) {
			ret[0] = A;
			ret[1] = B;
			ret[2] = 1;
			return ret;
		}
		ArrayList<Integer> bp = new ArrayList<Integer>();
		for (int i = 1; i <= Math.abs(C); ++i) {
			if (C % i == 0) {
				bp.add(i);
				bp.add(-i);
			}
		}
		for (int i = 1; i <= A; ++i) {
			if (A % i != 0) continue;
			int p = i;
			int r = A / i;
			for (int q : bp) {
				int s = C / q;
				if (p * s + q * r == B) {
					ret[0] = p;
					ret[1] = q;
					ret[2] = r;
					ret[3] = s;
					return ret;
				}
			}
		}
		return null;
	}
}

Measured memory_bytes: 27348
#include <stdio.h>
int main(){
    int n;
	scanf("%d",&n);
	int i;
	int num;
	int min = 2147483640;
	int maxValue = -2147483640;
	for(i=0;i<n;i++){
		scanf("%d",&num);
		if(num - min > maxValue){
			maxValue = num-min;
		}
		if(num < min){
			min = num;
		}
	} 
	printf("%d\n",maxValue);
}


Measured memory_bytes: 2112
#include <stdio.h>

int main(void)
{
    int n;
    int i;
    int mini = 1024;

    scanf("%d", &n);
    for (i = 1; i <= n - 1; ++i){
        int a = i, b = n - i;
        int sum = 0;
        while (a || b){
            sum += a % 10 + b % 10;
            a /= 10;
            b /= 10;
        }
        mini = sum < mini ? sum : mini;
    }
    printf("%d\n", mini);

    return 0;
}


Measured memory_bytes: 128
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())




if e-d>k or e-c>k or d-c>k or e-b>k or d-b>k or c-b>k or e-a>k or d-a>k or c-a>k or b-a>k:
    print(":(")
else:
    print("Yay!")

Measured memory_bytes: 3060
use std::io::*;

mod disjoint_set {
    pub struct DisjointSet {
        parent: Vec<usize>,
        size: Vec<usize>,
    }
    impl DisjointSet {
        pub fn new(n: usize) -> DisjointSet {
            DisjointSet {
                parent: (0..n).collect(),
                size: vec![1; n],
            }
        }
        fn root(&mut self, x: usize) -> usize {
            if x == self.parent[x] {
                x
            } else {
                let tmp = self.parent[x];
                self.parent[x] = self.root(tmp);
                self.parent[x]
            }
        }
        pub fn merge(&mut self, x: usize, y: usize) {
            let x = self.root(x);
            let y = self.root(y);
            if x == y {
                return;
            }
            if self.size[x] > self.size[y] {
                self.size[x] += self.size[y];
                self.parent[y] = x;
            } else {
                self.size[y] += self.size[x];
                self.parent[x] = y;
            }
        }

        pub fn size(&mut self, x: usize) -> usize {
            let x = self.root(x);
            self.size[x]
        }
    }
}

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let m: usize = itr.next().unwrap().parse().unwrap();

    let mut ds = disjoint_set::DisjointSet::new(n);
    let mut lang: Vec<Vec<usize>> = vec![Vec::new(); m];
    for i in 0..n {
        let k: usize = itr.next().unwrap().parse().unwrap();
        for _ in 0..k {
            let l = itr.next().unwrap().parse::<usize>().unwrap() - 1;
            lang[l].push(i);
        }
    }
    for i in 0..m {
        if lang[i].len() == 0 {
            continue;
        }
        for j in 0..lang[i].len() - 1 {
            ds.merge(lang[i][j], lang[i][j + 1]);
        }
    }
    if ds.size(0) == n {
        println!("YES");
    } else {
        println!("NO");
    }
}


Measured memory_bytes: 12540
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) cin >> a[i];
    for (int i = 0; i < N-1; i++) { if (a[i] < a[i+1]) a[i+1]--; }
    for (int i = 0; i < N-1; i++) {
        if (a[i] > a[i+1]) {
            cout << "No" << '\n';
            return 0;
        }
    }
    cout << "Yes" << '\n';
}


Measured memory_bytes: 3792
#include <stdio.h>


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




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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define ll long long
static const ll MAX = 10000;
static const ll INFTY = 1e12;
static const ll MOD = 1e9+7;

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



int main() {

  ll N, A, B;
  cin >> N >> A >> B;
  ll ans = 0;

  REP(i, N+1){
    ll num = i;
    ll sum = 0;
    while(num > 0){
      sum += num - (num / 10 * 10);
      num /= 10;
    }
    if(sum >= A && sum <= B){
      // cout << i << endl;
      ans += i;
    }
  }
  cout << ans << endl;


}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n,m;
    cin>>n>>m;
    if(n==1&&m==1) cout<<1;
    else if(n==1||m==1) cout<<max(n,m)-2;
    else cout<<(n-2)*(m-2);
}

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

int main(void) {
    string s;
    array<int, 'z' - 'a' + 1> a = {};
    while (cin >> s) {
        for (int i = 0; i < s.size(); i++) {
            if (s[i] < 'A' || s[i] > 'z') continue;
            if (s[i] >= 'A' && s[i] <= 'Z') a[s[i] - 'A']++;
            else a[s[i] - 'a']++;
        }
    }
    char c;
    for (int i = 0; i < a.size(); i++) {
        c = i + 'a';
        cout << c << " : " << a[i] << endl;
    }
}


Measured memory_bytes: 3128
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static void Main()
    {
        string[] input = Console.ReadLine().Split();
        long H = long.Parse(input[0]);
        long N = long.Parse(input[1]);
        long[] DP = new long[H + 1];
        DP[0] = 0;
        for(int i = 1; i <= H; i++) { DP[i] = long.MaxValue; }
        for(int i = 0; i < N; i++)
        {
            input = Console.ReadLine().Split();
            long a = int.Parse(input[0]);
            long b = int.Parse(input[1]);
            for(int j = 0; j < H; j++)
            {
                if (DP[j] == long.MaxValue) continue;
                int k = (int)Math.Min(j + a, H);
                DP[k] = Math.Min(DP[k], DP[j] + b);
            }
        }
        Console.WriteLine(DP[H]);
    }
}

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

vector <int> v;
vector <int>::iterator ite;
int k = 0;

int power(int m, int n)
{
  int x = 1;
  for(int i = 0; i < n; i++)
    x *= m;
  return x;
}

void makeNumber(int array[], int x)
{
  int n = 0, max, min;
  sort(array, array + x, greater<int>());
  for(int i = 0; i < x; i++)
    n += array[i] * power(10, x - i - 1);
  max = n;
  n = 0;
  sort(array, array + x);
  for(int i = 0; i < x; i++)
    n += array[i] * power(10, x - i - 1);
  min = n;
  for(int i = 0; i < x; i++)
    array[i] = (max - min) / power(10, x - i - 1) % 10;  
  v.push_back(max - min);
  k++;
  if(std::count(v.begin(), v.end(), v.back()) == 1)
    makeNumber(array, x);
}
    
int main()
{
  while(1){
    int b, L;
    int a[1000000];
    cin >> b >> L;
    v.push_back(b);
    for(int i = 0; i < L; i++)
      a[i] = b / power(10, L - i - 1) % 10;
    if(b == 0 && L == 0){
      break;
    }else{
      makeNumber(a, L);
      ite = v.begin();
      for(int j = 0; j < v.size(); j++, ite++)
	if(*ite == v.back()){
	  cout << j << " " << v.back() << " " << k - j << endl;
	  k = 0;
	  v.clear();
	  break;
	}
    }
  }
}

Measured memory_bytes: 1232
#include <iostream>
using namespace std;
 
int main() {
    int n, ans = 0;
    cin >> n;
    int p[n];
    for(int i = 0; i < n; ++i) {
        cin >> p[i];
    }
    for(int i = 0; i < n-2; ++i) {
        if((p[i] < p[i+1] && p[i+2] > p[i+1]) || (p[i] > p[i+1] && p[i+2] < p[i+1])) {
            ans++;
        }
    }

    cout << ans << '\n';
}


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

int main(void){
   int A,B,C;
   cin>>A>>B>>C;
   if(A<B&&B<C){
      cout<<"No"<<endl;
      return 0;
   }
   if(A>B&&B>C){
      cout<<"No"<<endl;
      return 0;
   }
   if(B<A&&A<C){
      cout<<"No"<<endl;
      return 0;
   }
   if(C<A&&A<B){
      cout<<"No"<<endl;
      return 0;
   }
   cout<<"Yes"<<endl;
   return 0;
}


Measured memory_bytes: 3568
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	int n;
    cin>>n;
    vi ans(n+1,0);
    FOR(x,1,101){
        FOR(y,1,101){
            FOR(z,1,101){
                LL t=x*x+y*y+z*z+x*y+y*z+z*x;
                if(t<=n){
                    ans[t]++;
                }
            }
        }
    }
    FOR(i,1,n+1){
        cout<<ans[i]<<endl;
    }

}


Measured memory_bytes: 3556