akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

vector<int> getDigits(int n) {
	vector<int> rD;
	while (n) {
		rD.push_back(n % 10);
		n /= 10;
	}
	reverse(rD.begin(), rD.end());
	return rD;
}

bool isDigitBad(vector<int> v, int n) {
	for (int i: v) {
		if (i == n) return true;
	}
	return false;
}

bool isNumberBad(vector<int> v, int n) {
	vector<int> dis = getDigits(n);
	for (int d: dis) {
		if (isDigitBad(v, d)) return true;
	}
	return false;
}

int main() {
	int n, k, lg;
	cin >> n >> k;
	vector<int> badd(k);
	for (int i = 0; i < k; i++) {
		cin >> badd[i];
	}
	while (isNumberBad(badd, n)) {
		n += 1;
	}
	cout << n << endl;
	return 0;
}

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

pair<unsigned long long ,unsigned long long> f(unsigned long long num)
{
    unsigned long long ans=num,temp=num,cnt=0;
    cnt++;
    if(num<10)
        return make_pair(1,ans);

    unsigned long long p=10;
    while(temp>p)
    {
        pair<unsigned long long,unsigned long long> pp= f(temp%p);
        ans+=pp.first*(temp/p)+pp.second;
        cnt+=pp.first;

        p*=10;
    }
    return make_pair(cnt,ans);
}

int main()
{
    unsigned long long n;
    cin>>n;
    cout<<f(n).second;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>//printf("%.9f\n",*********);
#include<vector>//文字列.erase(n),vector
#include<algorithm>//next_permutation
#include<set>
#include<string>//char(小文字-32=大文字) to_string,string,char
#include<sstream>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>//min,max
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swap
#define rt "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)//start==1
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)//end==1
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define Yay(ans) if(ans)cout<<"Yay!"<<rt;else cout<<":("<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())//標準=昇順
#define reve(s) reverse(s.begin(),s.end())//反転
#define str string
#define please return
#define AC 0
#define rapid_pleaseAC_fast cin.tie(0);ios::sync_with_stdio(false)
#define pi 3.1415926535897932384626//pi
#define nine 1000000000//10^9

using namespace std;
typedef vector<int> vint;
typedef long double ldouble;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef vector<double> vdouble;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

int tow(int n) {//2のn乗
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;//@domino
}

int SED(int n) { //Sum of Each Digit
	int sum = 0;
	while (n > 0) {
		sum += n % 10; n /= 10;
	}
	return sum;
}

unsigned ND(unsigned num) {//Number of Digits
	return std::to_string(num).length();//outmax=10
}//stringのほうが効率よくないか？

/*

 (char)toupper(a[n])=文字列のn文字目を大文字で出力

  pow(a,b)=aのb乗

  */


int main(void) {
	rapid_pleaseAC_fast;

	string s;
	cin >> s;

	bool a = false, b = false;
	bool c = false, d = false;

	rep(i, s.size()) {
		if (s[i] == 'N')a = true;
		if (s[i] == 'W')b = true;
		if (s[i] == 'S')c = true;
		if (s[i] == 'E')d = true;
	}

	Yes(a == c && b == d);

	please AC;
}

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

using namespace std;
using ll = long long;

int main()
{
    while (true) {
        int n, k, s;
        cin >> n >> k >> s;
        if (n == 0 and k == 0 and s == 0) {
            break;
        }
        vector<vector<int>> dp(n + 1, vector<int>(s + 1, 0));  // ?????????i??§??????j
        for (int i = 1; i <= min(n, s); i++) {
            dp[i][i] = 1;
        }
        for (int l = 1; l < k; l++) {
            auto tmp = dp;
            fill(dp.begin(), dp.end(), vector<int>(s + 1, 0));
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= s; j++) {
                    if (tmp[i][j] > 0) {
                        for (int m = i + 1; m <= min(n, s - j); m++) {
                            dp[m][j + m] += tmp[i][j];
                        }
                    }
                }
            }
        }
        int sum = 0;
        for (int i = 0; i <= n; i++) {
            sum += dp[i][s];
        }
        cout << sum << endl;
    }

    return 0;
}

Measured memory_bytes: 3048
#include <bits/stdc++.h>
#define rep2(i,m,n) for (int i = (int)(m); i < (int)(n); i++)
#define rep(i,n) rep2(i,0,n)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
using ll = long long;
template <typename T>
T sq(T x){
  return x * x;
}

signed main (){
  int N,M;
  cin >> N >> M;

  vector<int> ans(N);

  rep(i,M){
    int a,b;
cin >> a >> b;
ans.at(a-1)++;
ans.at(b-1)++;
  }
  rep(i,N){
cout << ans.at(i) << endl;
  }
    return 0;
}


Measured memory_bytes: 256
import java.util.NoSuchElementException

fun main(args: Array<String>) = FastScanner().run {
    val x = LongArray(3){nextLong()}
    val hist = mutableSetOf<List<Long>>()
    var cnt = 0
    val pre = LongArray(3)
    while (x.count{it % 2 != 0L} == 0 && !hist.contains(x.toList())) {
        hist.add(x.toList())
        cnt++
        for (i in 0 until 3)
            pre[i] = x[i]
        for (i in 0 until 3)
            x[i] = pre[(i+1)%3]/2 + pre[(i+2)%3]/2
    }
    if (hist.contains(x.toList())) {
        println(-1)
    } else {
        println(cnt)
    }
}

class FastScanner {
    private val printable = 33..126
    val `in` = System.`in`
    val buffer = ByteArray(1024)
    var ptr = 0
    var buflen = 0
    fun hasNextByte(): Boolean {
        if (ptr < buflen) {
            return true
        } else {
            ptr = 0
            buflen = `in`.read(buffer)
            if (buflen <= 0) {
                return false
            }
        }
        return true
    }
    fun readByte(): Byte {
        return if (hasNextByte()) buffer[ptr++] else return -1
    }
    fun hasNext(): Boolean {
        while (hasNextByte() && buffer[ptr] !in printable) ptr++
        return hasNextByte()
    }
    fun next(): String {
        if (!hasNext()) throw NoSuchElementException()
        val sb = StringBuilder()
        var b = readByte()
        while (b in printable) {
            sb.appendCodePoint(b.toInt())
            b = readByte()
        }
        return sb.toString()
    }
    fun nextLong(): Long {
        if (!hasNext()) throw NoSuchElementException()
        var n = 0L
        var minus = false
        var b = readByte()
        if (b == '-'.toByte()) {
            minus = true
            b = readByte()
        }
        if (b !in '0'.toByte()..'9'.toByte()) {
            throw NumberFormatException()
        }
        while (true) {
            if (b in '0'.toByte()..'9'.toByte()) {
                n *= 10
                n += b - '0'.toByte()
            } else if (b == (-1).toByte() || b !in printable) {
                return if (minus) -n else n
            } else {
                throw NumberFormatException()
            }
            b = readByte()
        }
    }
    fun nextInt(): Int {
        val nl = nextLong()
        if (nl !in Integer.MIN_VALUE..Integer.MAX_VALUE) throw NumberFormatException()
        return nl.toInt()
    }
    fun nextDouble(): Double {
        return next().toDouble()
    }
}

Measured memory_bytes: 33864
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T> using treap = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<int, int>;
vector<ii> dirs = {
  {1, 0}, {0, 1}, {-1, 0}, {0, -1},  // 4方向
  {1, 1}, {-1, 1}, {-1, -1}, {1, -1},  // 斜め
  {0, 0},  // 自身
};
template <class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template <class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <class T, class S> vector<T> make_vec(size_t n, S x) { return vector<T>(n, x); }
template <class T, class... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(n, make_vec<T>(ts...)); }

// debug
template <class T> ostream& operator<<(ostream& s, vector<T>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : " "); return s; }
template <class T> ostream& operator<<(ostream& s, vector<vector<T>>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : "\n"); return s; }
template <class T, class S> ostream& operator<<(ostream& s, pair<T, S>& p) { s << "{" << p.first << ", " << p.second << "}"; return s; }
template <class T, class S> ostream& operator<<(ostream& s, map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
template <class T, class S> ostream& operator<<(ostream& s, unordered_map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
#ifdef _MY_DEBUG
  #define dump(...) cerr << "/* " << #__VA_ARGS__ << " :[" << __LINE__ << ":" << __FUNCTION__ << "]" << endl, dump_func(__VA_ARGS__), cerr << "*/\n\n";
#else
  #define dump(...)
  #define endl "\n"
#endif
void dump_func() { cerr << endl; }
template <class Head, class... Tail> void dump_func(Head&& h, Tail&&... t) { cerr << h << (sizeof...(Tail) == 0 ? "" : ", "), dump_func(forward<Tail>(t)...); }

struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = 1000000007;
// *************** TEMPLATE END *************** 

signed main() {
  int n, d; cin >> n >> d;
  int tmp = 2 * d + 1;
  cout << (n + tmp - 1) / tmp << endl;
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define sumvec(v) accumulate(all(v),0LL)
#define mapmax(v) v.rbegin()->first
#define mapmin(v) v.begin()->first
#define pb push_back
#define pf push_front
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef long long ll;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;

typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;

const double pi = acos(-1.0);
const int mod=1000000007;
const int mod2=998244353;

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

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

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

void YES(bool b) {cout << (b?"YES\n":"NO\n");}
void Yes(bool b) {cout << (b?"Yes\n":"No\n");}
void yes(bool b) {cout << (b?"yes\n":"no\n");}
void Yay(bool b) {cout << (b?"Yay!\n":":(\n");}

long long powmod(long long a,long long b){
    long long c=1;
    while(b>0){
        if(b&1) c=a*c%mod;
        a=a*a%mod;
        b>>=1;
    }
    return c;
}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n,ans=0;
	cin >> n;
	vll a(n);
	rep(i,n) cin >> a[i];
	sort(all(a));
	cerr << a;
	rep(i,n-1){
		if(a[i]*2<a[i+1]) ans=0;
		else ans++;
		a[i+1]+=a[i];
	}
	ans++;
	cout << ans << endl;
	return 0;
}


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

const int MAXN = 200005;

char str[MAXN];
int n;
int nxt[MAXN][26];

vector<int> que[26];

int f[MAXN], tr[MAXN];

int main()
{
	scanf("%s", str+1);
	n = strlen(str+1);
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j < que[str[i]-'a'].size(); j++)
			nxt[que[str[i]-'a'][j]][str[i]-'a'] = i;
		que[str[i]-'a'].clear();
		for (int j = 0; j < 26; j++) que[j].push_back(i);
	}
	for (int i = 0; i <= n; i++)
		for (int j = 0; j < 26; j++)
			if (nxt[i][j] == 0)
				nxt[i][j] = n+1;
	memset(f, 127/3, sizeof f);
	f[n+1] = 0;
	for (int i = n; i >= 0; i--) {
		for (int j = 0; j < 26; j++)
			f[i] = min(f[i], f[nxt[i][j]]+1);
		for (int j = 0; j < 26; j++)
			if (f[i] == f[nxt[i][j]]+1) {
				tr[i] = j;
				break;
			}
	}
	// cerr << f[0] << endl;
        for (int i = 0; i <= n; i = nxt[i][tr[i]])
		putchar(tr[i]+'a');
	puts("");
	return 0;
}


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

int from, to;
int d[15] = {0,1,2,3,4,5,6,7,8,9,5,4,3,2,1};
int p[2][15];

int calc(int pos, int k) {
  int cost = 0;
  p[k][0] = d[pos];
  while(d[pos] != to) {
    pos = (pos+1)%15;
    cost++;
    p[k][cost] = d[pos];
  }
  return cost;
}

void solve() {
  int k = 0;
  int mini = 999999;
  int mink = -1;
  for(int i = 0; i < 15; ++i) {
    if(d[i] == from) {
      int c1 = calc(i, k);
      if(c1 < mini) {
	mini = c1;
	mink = k;
      }
      k++;
    }
  }
  for(int i = 0; i <= mini; ++i) {
    if(i != 0) cout << " ";
    cout << p[mink][i];
  }
  cout << endl;
}

main() {
  int n;
  cin >> n;
  for(int i = 0; i < n; ++i) {
    cin >> from >> to;
    solve();
  }
}

Measured memory_bytes: 0
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  priority_queue<P> pque;
  ll n, m;
  cin >> n >> m;
  rep(i, n) { ll a;
    cin >> a;
    pque.emplace(a, 1);
  }
  rep(i, m) { ll b, c;
    cin >> b >> c;
    pque.emplace(c, b);
  }
  ll ans = 0;
  ll res = n;
  while(res > 0){
    ll num, dup;
    tie(num, dup) = pque.top();
    dup = min(dup, res);
    res -= dup;
    ans += num * dup;
    pque.pop();
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 6384
import java.util.Scanner;

/**
 * Station and Bus
 * 
 * https://atcoder.jp/contests/abc158/tasks/abc158_a
 */
public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        long m = N / (A + B);

        long ans = A * m + Math.min(A, N - (A + B) * m);

        System.out.println(ans);
    }

}


Measured memory_bytes: 35764
#include <bits/stdc++.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P, ll> T;
 
long long int INF = 2e18;
const ll fact_table = 1200008;
double Pi = 3.1415926535897932384626;

priority_queue <ll> pql;
priority_queue <P> pqp;
priority_queue <P> bag;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//↓,→,↑,←

#define endl "\n"
#ifdef ENJAPMA
    #undef endl
#endif
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
#define pc(x) cout << x << ",";
#define rep(i,n) for (ll i = 0; i < (n); i++)
 
const ll mod = 998244353ll;
// const ll mod = 1000000007ll;
  
ll mypow(ll number1,ll number2, ll mod){
    if(number2 == 0){
        return 1ll;
    }else{
        ll number3 = mypow(number1,number2 / 2, mod);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
void YES(bool condition){
    if(condition){ p("YES"); }else{ p("NO"); }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

ll mygcd(ll a, ll b){
    if(b > a)swap(a, b);
    if(a == b || b == 0)return a;
    return mygcd(b, a % b);
}
/*

ll fact[fact_table + 5],rfact[fact_table + 5]; 
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table],mod - 2, mod);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    assert(n >= r);
    assert(n >= 0);
    assert(r >= 0);
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
*/

// auto res = NTT::conv(mod, 3ll, atable, btable);

bool multicase = false;

ll n,m,num,a,b,c,d,e,q, w, ans ;
ll x[500005], y[500005];
ll r, k;
string s;

ll calc(ll a, ll b){
    if(a > b)return INF;
    return b - a;
}

void solve(){
    cin >> a >> b;
    ans = INF;
    ans = min(ans, calc(-a, b) + 1);
    ans = min(ans, calc(a, -b) + 1);
    ans = min(ans, calc(a, b));
    ans = min(ans, calc(-a, -b) + 2);
    p(ans);
    return;
}

int main(){
    // init();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll q, testcase = 1;
    if(multicase){
        cin >> q;
    }else{
        q = 1; 
    }
    while(q--){
        // pu("Case ");pu("#");pu(testcase);pu(": ");
        solve();
        testcase++;
    }
    // solve();
    return 0;
}
















Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int n = nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        double Answer = 0;

        for (int i = 0; i < n; i++) {
        	x[i] = nextInt();
        	y[i] = nextInt();
        }

        for (int i = 0; i < n - 1; i++) {
        	for (int j = i + 1; j < n; j++) {
        		Answer += calcLength(x[i], y[i], x[j], y[j]);
        	}
        }
        println(Answer * 2 / n);
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static String next() {
        return sc.next();
    }

    static String nextLine(){
        return sc.nextLine();
    }

    static void println(Object o) {
        out.println(o);
        out.flush();
    }

    static double calcLength(int x1, int y1, int x2, int y2) {
    	double xx = x1 - x2;
    	double yy = y1 - y2;
    	return Math.sqrt((xx * xx) + (yy * yy));
    }
}


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

signed main(void)
{
	vector<int> v(3);
	int ans;
	bool ok;
	
	rep(i, 3) cin >> v[i];
	ans = 0;
	ok = true;
	if (v[0] == v[1] && v[1] == v[2] && v[2] == v[0])
	{
		ok = false;
		rep(i, 3)
		{	
			if (v[i] % 2 != 0)
				ok = true;
		}
		if (!ok)
			ans = -1;
	}
	while(ok)
	{
		int tmp, tmp2;
		rep(i, 3)
		{
			if (v[i] % 2 != 0)
			{
				ok = false;
				break;
			}
		}
		sort(v.begin(), v.end());
		tmp = v[0];
		tmp2 = v[1];
		v[0] = (v[1] + v[2]) / 2;
		v[1] = (tmp + v[2]) / 2;
		v[2] = (tmp + tmp2) / 2;
		if (ok) ans++;
	}
	cout << ans << endl;
	return 0;
}


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

using namespace std;

int main()
{
    int N, A[4], sum = 0;
    string S;
    cin >> N;
    for(int n = 0; n < N; n++) {
        cin >> S;
        if(S == "P")
            A[0]++;
        else if(S == "W")
            A[1]++;
        else if(S == "G")
            A[2]++;
        else if(S == "Y")
            A[3]++;
    }
    
    for(int i = 0; i < 4; i++)
        if(!A[i])
            sum++;
    
    if(sum == 1)
        cout << "Three" << endl;
    else if(!sum)
        cout << "Four" << endl;
}

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

if (len(set(W))) != len(W):
  print("No")
else:
  f = True
  for i in range(n-1):
    if W[i][-1] != W[i+1][0]:
      f = False
  if f: print("Yes")
  else: print("No")

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

int main() 
{
    int K, X;
    cin >> K >> X;
    for (int i = K-1; i > 0; i--) {
        cout << X - i << " ";
    }
    for (int i = 0; i < K; i++) {
        cout << X + i << " ";
    }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std ;
typedef long long ll ;
ll dp[105][100005],weight[105],value[105],n,cap,ans,m=0;
int main()
{
    cin >> n >> cap ;
    for(int i=1;i<=n;i++){ll x,y ; cin >> x >> y ; weight[i]=x;value[i]=y;}
    for(int i=1;i<=n;i++)
    {
        ll w=weight[i],v=value[i];
        for(int j=1;j<=100002;j++)
        {
            if(j>=v)
            {
            if(j==v)
            {
                if(dp[i-1][j]==0){dp[i][j]=w;}
                else
                {
                    dp[i][j]=min(w,dp[i-1][j]);
                }
            }
            else if (dp[i-1][j-v]!=0)
            {
                ll x = dp[i-1][j-v]+w;
                if(x>cap)
                {
                  dp[i][j]=dp[i-1][j];
                }
                else
                {
                  if(dp[i-1][j]!=0)
                  {dp[i][j]=min(x,dp[i-1][j]);}
                  else{dp[i][j]=x;}
                }
            }
            else
            {
                dp[i][j]=dp[i-1][j];
            }
        }
        else{dp[i][j]=dp[i-1][j];}
        if(dp[i][j]!=0 && j>m)
        {
            m=j;
        }
    }
    }
   /* for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=15;j++)
        {
            cout << dp[i][j] << " " ;
        }
        cout << endl;
    }*/
    cout << m << endl;
    return 0 ;
}


Measured memory_bytes: 79488
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
const int INF = 1<<30;
const ll MOD = 1000000007;

int main(void) {

    ll a, b, c, k; cin >> a >> b >> c >> k;
    if (a >= k) cout << k << endl;
    else if (a + b >= k) cout << a << endl;
    else cout << a - (k - a - b) << endl;


    return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <math.h>

long long int n;
int main() {
	scanf("%lld", &n);
	if(n % 2 == 0) {
		printf("%lld\n", n);
	}
	else {
		printf("%lld\n", n * 2);
	}
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <utility>

using namespace std;

typedef long long ll;

vector<vector<pair<ll, ll> > > G(1000010);
vector<ll> d(1000010);


void dfs(ll s) {
    for (int i = 0; i < G[s].size(); i++) {
        ll v = G[s][i].first;
        ll dist = G[s][i].second;
        if (d[v] < 0) {
            d[v] = (d[s] + dist);
            dfs(v);
        }
    }
}

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

    for (int i = 0; i < n-1; i++) {
        ll x, y, w;
        cin >> x >> y >> w;
        G[x-1].push_back(pair<ll,ll> (y-1, w));
        G[y-1].push_back(pair<ll,ll> (x-1, w));
    }

    for (int i = 0; i < n; i++)
        d[i] = -1;
    d[0] = 0;

    dfs(0);

    for(int i = 0; i < n; i++) {
        cout << d[i]%2 << endl;
    }
    return 0;
}

Measured memory_bytes: 37632
#include <iostream>
#include <string>
#include <map>
#include <queue>
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
using namespace std;
typedef long long ll;
static const ll MOD = 1e9 + 7;

map<ll, priority_queue<ll>> m;

int main() {
	ll n; cin >> n;
	ll maxT = 0;
	rep(i, 0, n) {
		ll a, b; cin >> a >> b;
		m[b].push(a);
		maxT = max(b, maxT);
	}

	bool ok = true;
	ll t = 0;
	for (map<ll, priority_queue<ll>>::iterator it = m.begin(); it != m.end(); it++) {
		while (it->second.size() != 0) {
			ll p =  it->second.top();
			it->second.pop();
			t += p;
			if (t > it->first) {
				ok = false;
				break;
			}
			//maxT -= p;
			//if (maxT < 0) {
			//	ok = false;
			//	break;
			//}
		}
	}
	cout << (ok ? "Yes" : "No") << endl;

	return 0;
}

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

int main(void)
{
    string str;
    cin >> str;
    int q;
    cin >> q;
    for(int i=0;i<q;i++){
        string temp, temp2;
        int a,b;
        cin >> temp;
        if(temp == "replace"){
            cin >>a>>b>>temp2;
            str.replace(a,b-a+1,temp2);
        }else if(temp == "reverse"){
            cin >>a>>b;
            reverse(str.begin()+a, str.begin()+b+1);
        }else{
            cin >>a>>b;
            cout <<str.substr(a,b-a+1)<<endl;
        }
    }
}


Measured memory_bytes: 3208
#include <iostream>

using namespace std;

int main()
{
  int n, b;
  cin >> n >> b;
  if (b == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (n >= b) {
    cout << 1 << endl;
    return 0;
  }
  int cnt = 1;
  b -= n;
  while (b > 0) {
    b -= n - 1;
    cnt += 1;
  }
  cout << cnt << endl;
  // cout << (b - 2) / (n - 1) + 1 << endl;
}

Measured memory_bytes: 256
from string import ascii_lowercase
def count(x):
    res = {c:0 for c in ascii_lowercase}
    for d in x:
        res[d] += 1
    return res

n = int(input())
maxs = {c:float('inf') for c in ascii_lowercase}
for _ in range(n):
    for k, v in count(input()).items():
        maxs[k] = min(maxs[k], v)

ans = ''
for k, v in sorted(maxs.items(), key=lambda x: x[0]):
    ans += v*k
print(ans)

Measured memory_bytes: 3768
from math import cos, sin, pi

class Coordinate:
    def __init__(self, x, y):
        self.x = x
        self.y = y

def kock(n, p1, p2):
    if n == 0:
        return

    s = Coordinate((2*p1.x+p2.x)/3, (2*p1.y+p2.y)/3)
    t = Coordinate((p1.x+2*p2.x)/3, (p1.y+2*p2.y)/3)
    ux = (t.x-s.x)*cos(pi/3) - (t.y-s.y)*sin(pi/3) + s.x
    uy = (t.x-s.x)*sin(pi/3) + (t.y-s.y)*cos(pi/3) + s.y
    u = Coordinate(ux, uy)
    
    kock(n-1, p1, s)
    print("%f %f"%(s.x, s.y))
    kock(n-1, s, u)
    print("%f %f"%(u.x, u.y))
    kock(n-1, u, t)
    print("%f %f"%(t.x, t.y))
    kock(n-1, t, p2)
    
n = int(input())
p1 = Coordinate(0, 0)
p2 = Coordinate(100, 0)

print("%f %f"%(p1.x, p2.y))
kock(n, p1, p2)
print("%f %f"%(p2.x, p2.y))


Measured memory_bytes: 5784
const lines = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
const line1st = lines[0].split(' ');
const N = +line1st[0];
const K = +line1st[1];
const d = [];
const A = [];
for (let i = 1; i < 2 * K; i += 2) {
    d.push(+lines[i]);
    A.push(lines[i + 1].split(' ').map(v => +v));
}

// console.log(`N=${N}`);
// console.log(`K=${K}`);
// console.log(d);
// console.log(A);

let sum = N;
const S = {};
A.forEach(v => {
    v.forEach(i => {
        if (!S[i]) {
            sum --;
            S[i] = true;
        }
    })
});

console.log(sum);

Measured memory_bytes: 29868
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 234567;
const int MOD = 998244353;
char s[MAXN];
int sdig[MAXN];
bool visit[8787];
int dp[2][MAXN][3][3];

int solveMin(int N) {
    if (N == 2) {
       if (s[1] == s[2]) return 1;
       return 2;
    }
    queue<int> qu;
    qu.push(sdig[1] * 100 + sdig[2] * 10 + sdig[3]);
    int ans = 0;
    while (!qu.empty()) {
          int tp = qu.front();
          qu.pop();
          if (visit[tp]) continue;
          visit[tp] = 1;
          ans++;
          int f1 = tp / 100, f2 = (tp / 10) % 10, f3 = (tp % 10);
          if (f1 != f2) {
             int tmp = ((f1 + f2) * 2) % 3;
             qu.push(tmp * 100 + tmp * 10 + f3);
          }
          if (f2 != f3) {
             int tmp = ((f2 + f3) * 2) % 3;
             qu.push(f1 * 100 + tmp * 10 + tmp);
          }
    }
    return ans;
}

int add(int a, int b) {
    int ans = a + b;
    if (ans >= MOD) ans -= MOD;
    return ans;
}

void update(int i, int st, int sum, int cur) {
     for (int num = 0; num < 3; num++) {
         int nst = st | (cur == num);
         int nsum = (sum + num) % 3;
         dp[nst][i + 1][nsum][num] = add(dp[nst][i + 1][nsum][num], dp[st][i][sum][cur]);
     }
}

int main() {
    scanf("%s", s + 1);
    int N = strlen(s + 1);
    int sum = 0;
    for (int i = 1; i <= N; i++) {
        sdig[i] = s[i] - 'a';
        sum = (sum + sdig[i]) % 3;
    }
    if (N < 4) {
       return !printf("%d\n", solveMin(N));
    }
    bool allSame = true;
    for (int i = 2; i <= N; i++) {
        if (s[i] != s[i - 1]) allSame = false;
    }
    if (allSame) return !printf("1\n");
    for (int i = 0; i < 3; i++) dp[0][1][i][i] = 1;
    for (int i = 1; i < N; i++) {
        for (int st = 0; st < 2; st++) {
            for (int tsum = 0; tsum < 3; tsum++) {
                for (int cur = 0; cur < 3; cur++) {
                    update(i, st, tsum, cur);
                }
            }
        }
    }
    int ans = 0;
    bool noPair = true;
    for (int i = 2; i <= N; i++) {
        if (s[i] == s[i - 1]) noPair = false;
    }
    for (int i = 0; i < 3; i++) {
        ans = add(ans, dp[1][N][sum][i]);
    }
    printf("%d\n", add(ans, noPair));

    return 0;
}


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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

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 GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }

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

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

const int MAXV = 2505;
vi to[MAXV];
vi rto[MAXV];
bool reachableFrom1[MAXV];
bool reachableToN[MAXV];
bool ok[MAXV];

void dfs(int v){
  if(reachableFrom1[v])return;
  reachableFrom1[v]=true;
  for(int u:to[v]){
    dfs(u);
  }
}
void rdfs(int v){
  if(reachableToN[v])return;
  reachableToN[v]=true;
  for(int u:rto[v]){
    rdfs(u);
  }
}

signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  int n,m,p;
  cin>>n>>m>>p;
  vector<tuple<int,int,int>> edges;
  rep(i,m){
    int a,b,c;
    cin>>a>>b>>c;
    a--; b--;
    c=(c-p)*-1;
    edges.emplace_back(a,b,c);
    to[a].push_back(b);
    rto[b].push_back(a);
  }
  dfs(0);
  rdfs(n-1);
  rep(i,n) ok[i]=reachableFrom1[i]&&reachableToN[i];
  
  vector<int> d(n,INF);
  d[0] = 0;
  bool upd = true;
  int step = 0;
  while(upd){
    upd = false;
    rep(i,m){
      int a,b,c;
      tie(a,b,c)=edges[i];
      if(!ok[a]) continue;
      if(!ok[b]) continue;
      int newD = d[a]+c;
      if(newD < d[b]){
        upd = true;
        d[b] = newD;
      }
    }
    step++;
    if(step > n){
      cout<<-1<<endl;
      return 0;
    }
  }
  
  cout<<max(-d[n-1],0)<<endl;
  
}


Measured memory_bytes: 640
import numpy as np
from numba import njit
N, K, *XY = [int(_) for _ in open(0).read().split()]
XY = np.array(XY, dtype=np.int64).reshape((N, 2)).T
X = np.sort(XY[0])
Y = np.sort(XY[1])

@njit
def solve(XY, X, Y):
    v = 4 * 10**18 + 1
    ans = np.array([0, 0, 0, 0], dtype=np.int64)
    for i1 in range(N - 1):
        x1=X[i1]
        for i2 in range(i1 + 1, N):
            x2=X[i2]
            for j1 in range(N - 1):
                y1=Y[j1]
                for j2 in range(j1 + 1, N):
                    y2 = Y[j2]
                    if np.sum((x1 <= XY[0]) * (XY[0] <= x2) * (y1 <= XY[1]) * (XY[1] <= y2)) < K:
                        continue
                    v2 = (x2 - x1) * (y2 - y1)
                    v = min(v, v2)
    return v

ans = solve(XY, X, Y)
print(ans)


Measured memory_bytes: 116120
#include<stdio.h>

int main(void){
 
  int n;
  scanf("%d", &n);
  
  int a[100000];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  
  int count=0;
  
  for(int i=0;i<n;i++){
   	if(a[i]%2 == 1)count++; 
  }
  
  if(count%2==0){
    printf("YES");
  }else{
  	printf("NO"); 
  }
  return 0;
}

Measured memory_bytes: 640
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class Solve
{
    static void Main(string[] args)
    {
        new ABC_C();
    }
}

public class ABC_C
{
    int n;
    int[] arr;
    double[,] distance = new double[8, 8];
    List<Tuple<int, int>> pos = new List<Tuple<int, int>>();

    public ABC_C()
    {
        In();


        for (int i = 0; i < n; i++)
        {
            for (int j = i + 1; j < n; j++)
            {
                var x = (pos[i].Item1 - pos[j].Item1);
                var y = (pos[i].Item2 - pos[j].Item2);
                distance[i, j] = Math.Sqrt(x * x + y * y);
                distance[j, i] = distance[i, j];
            }
        }

        List<double> all = new List<double>();
        arr = Enumerable.Range(0, n).ToArray();
        do
        {
            double d = 0;
            for (int i = 1; i < n; i++)
            {
                d += distance[arr[i], arr[i - 1]];
            }
            all.Add(d);
        } while (NextPermutation(arr));

        Console.WriteLine(all.Sum() / all.Count);
    }

    void In()
    {
        n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++)
        {
            var p = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            pos.Add(new Tuple<int, int>(p[0], p[1]));
        }
    }

    void swap(int[] nums, int i, int j)
    {
        var tmp = nums[i];
        nums[i] = nums[j];
        nums[j] = tmp;
    }

    void reverse(int[] nums, int start)
    {
        int i = start;
        int j = nums.Length - 1;
        while (i < j)
        {
            swap(nums, i, j);
            i++;
            j--;
        }
    }

    bool NextPermutation(int[] nums)
    {
        int i = nums.Length - 2;
        while (i >= 0 && nums[i + 1] < nums[i])
        {
            i--;
        }
        if (i >= 0)
        {
            int j = nums.Length - 1;
            while (j >= 0 && nums[j] <= nums[i])
            {
                j--;
            }
            swap(nums, i, j);
        }
        reverse(nums, i + 1);
        return (i >= 0);
    }
}

Measured memory_bytes: 14176
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const int mod = 1e9 + 7;
//const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}


int main() {
  string s;
  cin >> s;
  bool ok=false;
  rep(i,3) if(s[i]-'0'==7) ok=true;
  YesNo(ok);
  return 0;
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main()
{
   int n,k,i,j;int count=0;
   cin>>n>>k;
   for(i=1;i<=n;i++)
   {  int p=0;
       for(j=i;j<=n;j++)
       {   p++;
           
           //cout<<j<<" ";
           if(p==k)
           break;
       }
       if(p==k)
       count++;
      
   }
   cout<<count<<endl;
   
   return 0;
}

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

struct Point
{
  int x;
  int y;
};

class Campus
{
  public:
    Campus(int x, int y, int width, int height);
    bool inCampus(Point p);

  private:
    int m_x, m_y, m_width, m_height;
};

Campus::Campus(int x, int y, int width, int height)
{
  m_x = x -1;
  m_y = y -1;
  m_width = width;
  m_height = height;
}

bool Campus::inCampus(Point p)
{
  return (m_x <= p.x and p.x <= m_x + m_width + 1) and
         (m_y <= p.y and p.y <= m_y + m_height + 1);
}

int main(void)
{
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i)
  {
    int x, y, width, height;
    cin >> x >> y >> width >> height;
    Campus campus(x, y, width, height);

    int result = 0;
    int cat_num;
    cin >> cat_num;
    for (int j = 0; j < cat_num; ++j)
    {
      Point cat;
      cin >> cat.x >> cat.y;
      if (campus.inCampus(cat) )
      {
        ++result;
      }
    }
    cout << result << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
//https://atcoder.jp/contests/abc075/tasks/abc075_b

#include <iostream>
using namespace std;

int main(void){
    int H,W;
    int counter = 0;
    // string S[51][51];
    string S[50];

    cin >> H >> W;
    for (int i = 0; i < H; i++){
        cin >> S[i];
    }
    // for (int i = 0; i < H; i++){
    //         cout << S[i] << endl;
    // }

    // string num[H][W];
    // int num[H][W];
    // for (int i = 0; i < H; i++){
    //     for (int j = 0; j < W; j++){
    //         num[H][W] = 0;
    //     }
    // }
    int dx[8] = {1,0,-1,0,1,-1,-1,1};
    int dy[8] = {0,1,0,-1,1,1,-1,-1};
    int ii = 0;
    int jj = 0;

    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            counter = 0;
            // if (S[i][j] == '.') printf("S[%d][%d]=clear\r\n",i,j);
            if (S[i][j] == '.'){
                for (int p = i-1; p <= i+1; p++){
                    for (int q = j-1; q <= j+1; q++){
                        if(p >= 0 && q >= 0 && p < H && q < W && S[p][q] == '#') counter ++;
                    }
                }
                S[i][j] = '0' + counter;
                // printf("num[%d][%d] = %d\r\n",i,j,num[i][j]);

                // for (int k = 0; k < 8; k++){
                //     ii = i + dx[k];
                //     jj = j + dy[k];
                //     if(ii >= 0 && jj >= 0 && ii < H && jj < W && S[ii][jj] == '#') counter ++;
                // }
                // S[i][j] = '0' + counter;
            }
        }
    }
    // for (int i = 0; i < H; i++){
    //     for (int j = 0; j < W; j++){
    //         if (S[i][j] == '.'){
    //             S[i][j] = char('0' + num[i][j]);
    //         }
    //     }
    // }
    for (int i = 0; i < H; i++) {
        cout << S[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int imos[10005];

int main(void) {
    long long W, H, x, y; cin >> W >> H >> x >> y;
    printf("%.12f ", W*H/2.0);
    if (x*2 == W && y*2 == H) cout << 1 << endl;
    else cout << 0 << endl;
}   


Measured memory_bytes: 256
/*
	Author: zhaodeyin
	Time: 2018.4.7
*/
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
const int MaxN = 1e5 + 4;
typedef long long LL;
int a[4];
int main(){
	cin>>a[1]>>a[2]>>a[3];
	sort(a+1,a+4);
	int ans = 0;
	int x = a[3]-a[1];
	int y = a[3]-a[2];
	if(x % 2 == 0 && y % 2 == 0) ans = x/2+y/2;
	else if(x % 2 && y % 2) ans = min(x,y)+abs(x-y)/2;
	else{
		if(x % 2 && y % 2 == 0) ans = x/2+2+y/2;
		else if(y % 2 && x % 2 == 0) ans = y/2+2+x/2;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
// #include <atcoder/all>

using boost::multiprecision::cpp_int;
using namespace std;
// using namespace atcoder;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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; }

typedef long long ll;
typedef pair<ll, ll> p;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<ll> y(n), x(n);
  rep(i, n) cin >> x[i] >> y[i];
  vector<ll> v1(n), v2(n);
  rep(i, n){
    v1[i] = x[i]+y[i];
    v2[i] = x[i]-y[i];
  }
  sort(ALL(v1));
  ll res = v1[n-1] - v1[0];
  sort(ALL(v2));
  chmax(res, v2[n-1]-v2[0]);

  cout << res << endl;



}



Measured memory_bytes: 9516
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=200005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll a,v,b,w,t;cin>>a>>v>>b>>w>>t;
    ll d=abs(a-b);
    
    if((v-w)*t>=d) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}



Measured memory_bytes: 3656
#include<iostream>
#include<stdio.h>

using namespace std;
int m, n, t[101];

int cnt(int w){
    int v=0, ret=1;
    for(int i=0; i<n; i++){
        if(t[i]>w) return 1500001;
        if(v+t[i]>w){
            v=0;
            ret++;
        }
        v+=t[i];
    }
    return ret;
}

int main(){

    while(1){
        cin>> m>> n;
        if(m==0&&n==0) break;
        for(int i=0; i<n; i++){
            scanf("%d", &t[i]);
        }

        int l=1, r=1500000;
        while(r-l>1){
            int md=(l+r)/2;
            if(cnt(md)>m){// exceeded
                l=md;
            }else{
                r=md;
            }
        }
        cout<< r<< endl;
    }

    return 0;
}

Measured memory_bytes: 3136
_=input()
S=input()
cnt,ladd,radd=0,0,0
for c in S:
    if c=="(":
        cnt+=1
    elif c==")":
        if cnt==0:
            ladd+=1
        else:
            cnt-=1
radd=cnt
print("("*ladd + S + ")"*radd)


Measured memory_bytes: 38384