akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for(inti=a;i<=b;i++)

#define MOD 1000000007
typedef long long int ll;
typedef vector<int>vi;
typedef pair<int,int>pi;


int main()
{
ll n ;
cin>>n;
if(n==1)
    cout<<"1"<<endl;
else
{
    ll now = 1, prev = 2;
    for(ll index = 3 ;index <=n+1;index++)
    {
        ll c = now;
        now+=prev;
        prev=c;
    }

    cout<<now<<endl;
}

 return 0;
}


Measured memory_bytes: 3636
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

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

    vector<pair<int, int> > p(m);
    for(int i=0; i<m; ++i){
        cin >> p[i].first >> p[i].second;
        -- p[i].first;
        -- p[i].second;
    }
    sort(p.begin(), p.end());

    int k = 0;
    int x = INT_MAX;
    int ans = 0;
    for(int a=0; a<n; ++a){
        if(a == x){
            x = INT_MAX;
            ++ ans;
        }
        while(k < m && p[k].first == a){
            x = min(x, p[k].second);
            ++ k;
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1152
//         PAR_YUMMM            //
                                            //           CPP                //
#include <bits/stdc++.h>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define ll long long
#define ld long double
ll const N=1e6+5;
 
#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second
 
#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define gcd __gcd
#define sexy ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
 
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
 
#define oset tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define osetlli tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
#define ofk order_of_key
#define fbo find_by_order
 
ll po(ll x,ll y){
    if(y==0){
        return 1;
    }
    ll temp=po(x,y/2);
    if(y%2==0){
        return ((temp%mod)*(temp%mod))%mod;
    }else{
        return (((x%mod)*(temp%mod))%mod*(temp)%mod)%mod;
    }
}
 
ll lcm(ll a, ll b){ 
    return (a*b)/(gcd(a, b));
}
ll max(ll a, ll b){
  if (a > b)
    return a;
  return b;
}
ll min(ll a, ll b){
  if (a < b)
    return a;
  return b;
}
 
ll bins(ll ar[],ll l,ll r,ll x) 
{ 
    if (r >= l) { 
        ll mid =l+((r-l)/2); 
        if(ar[mid]==x) 
            return mid; 
        if(ar[mid]>x) 
            return bins(ar,l,mid-1,x);
        return bins(ar,mid+1,r,x); 
    } 
    return -1; 
} 
ll dp[105][100005];
ll ar[N],arr[N];

ll solve(ll x,ll y){
    if(x<0||y<=0){
        return 0;
    }
    if(dp[x][y]!=-1){
        return dp[x][y];
    }
    ll ans=0;
    ans=max(ans,solve(x-1,y));
    if(y-ar[x]>=0){
        ans=max(ans,arr[x]+solve(x-1,y-ar[x]));
    }
    return dp[x][y]=ans;
}

int main(){
    sexy;
    ll x,y,z,p,q,r;
    cin>>x>>y;
    forz(i,x){
        cin>>ar[i]>>arr[i];
    }
    memset(dp,-1,sizeof(dp));
    z=solve(x-1,y);
    p1(z);
    return 0;
}


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

int main() {
	int n;
	string s;
	cin >> n >> s;
	int count = 1;
	for (int i = 0; i < n-1; i++) {
		if (s[i] == s[i + 1]) {

		}
		else {
			count++;
		}
	}
	cout << count << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

// 根が1
template<typename Monoid>
struct segtree {
    using T = typename Monoid::T;
    int n;
    vector<T> dat;

    segtree(int n_) {
        n = 1;
        while(n < n_) n <<= 1;
        dat.assign(n*2, Monoid::id());
    }
    void build(vector<T> v) {
        REP(i, v.size()) dat[i+n] = v[i];
        for(int i=n-1; i>0; --i) dat[i] = Monoid::op(dat[i*2], dat[i*2+1]);
    }

    T query(int a, int b) {
        if(a >= b) return Monoid::id();
        T l = Monoid::id(), r = Monoid::id();
        for(a+=n, b+=n; a<b; a>>=1, b>>=1) {
            if(a&1) l = Monoid::op(l, dat[a++]);
            if(b&1) r = Monoid::op(dat[--b], r);
        }
        return Monoid::op(l, r);
    }
    void update(int i, T v) {
        i += n;
        dat[i] = v;
        while(i >>= 1) {
            dat[i] = Monoid::op(dat[i*2], dat[i*2+1]);
        }
    }

    friend ostream &operator <<(ostream& out,const segtree<Monoid>& seg){
        out << "---------------------" << endl;
        int cnt = 1;
        for(int i=1; i<=seg.n; i*=2) {
            REP(j, i) {
                out << seg.dat[cnt] << " ";
                cnt++;
            }
            out << endl;
        }
        out << "---------------------" << endl;
        return out;
    }
};

template<typename Tp>
struct min_monoid {
    using T = Tp;
    static constexpr Tp id() { return {INF, -INF}; }
    static Tp op(const Tp &a, const Tp &b) { return PII(min(a.first, b.first), max(a.second, b.second)); }
};

int main(void) {
    ll n;
    cin >> n;
    vector<PII> vp(n);
    REP(i, n) cin >> vp[i].first >> vp[i].second;

    sort(ALL(vp));
    vector<ll> l(n), r(n);
    REP(i, n) l[i] = vp[i].first, r[i] = vp[i].second;

    ll mi = INF;
    REP(i, n) chmin(mi, r[i]);

    segtree<min_monoid<PII>> seg(n);
    vector<PII> init(n);
    REP(i, n) init[i] = PII(r[i], r[i]);
    seg.build(init);

    ll ans = 0;
    REP(i, n) chmax(ans, r[i]-l[i]+1);
    REP(i, n-1) {
        chmax(ans, seg.query(0, i+1).first-l[i]+1 + seg.query(i+1, n).first-l[n-1]+1);
        chmax(ans, seg.query(0, i+1).second-l[i]+1 + mi-l[n-1]+1);
    }
    cout << ans << endl;

    return 0;
}

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

#include<stdlib.h>
#include<iostream>
#include<math.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long
#define INF 2000000000
#define Min(a,b) (a<b?a:b)
#define Max(a,b) (a>b?a:b)
#define PI 3.1415926535897932
using namespace std;





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



return 0;
}



Measured memory_bytes: 3796
#include<iostream>
#include<string>
#include<algorithm>
#include <cmath>

using namespace std;

int main(){
 int a,b,c,d;
  cin >> a >>b>> c >> d;
  int count = 0;
  for(int i=0; i<= a; i++){
  	for(int j=0; j<= b; j++){
      for(int k=0; k<= c; k++){
        if(d == (i*500 + j*100 + k * 50)){
          count++;
        }
      }
    }
  
  }
  
  cout << count << endl;
 
  return 0;
}

Measured memory_bytes: 256
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <cmath>         // sqrt
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <bits/stdc++.h> // isupper, islower, isdigit, toupper, tolower
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pl;
typedef pair<int, int> P;
typedef tuple<ll, ll, string> Tlls;

// Greatest Common Divisor (最大公約数)
ll gcd(ll a, ll b)
{
  // Eucledean algorithm
  while (a)
  {
    if (a < b)
    {
      std::swap(a, b);
    }
    a %= b;
  }
  return b;
}

// Least Common Multiple 最小公倍数
ll lcm(ll a, ll b)
{
  return a / gcd(a, b) * b;
}

// key: value of prime factor素因数分解
// value: number of prime factor
map<ll, ll> prime_factorization(ll n)
{
  map<ll, ll> prime_factors;
  for (ll i = 2; i * i <= n; i++)
  {
    while (n % i == 0)
    {
      prime_factors[i]++;
      n /= i;
    }
  }
  if (n != 1)
    prime_factors[n] = 1;
  return prime_factors;
}

// 約数リスト約数の列挙
vector<ll> get_divisors(const ll n)
{
  vector<ll> divs;
  for (ll i = 1; i < (ll)sqrt((ld)n) + 1; i++)
  {
    if (n % i == 0)
    {
      divs.push_back(i);
      if (i != n / i)
      {
        divs.push_back(n / i);
      }
    }
  }

  // 必要に応じてソート
  // sort(divs.begin(), divs.end());

  return divs;
}

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()
{
  ll N, K;
  // ll INF = 100000000;
  const long long INF = 1LL << 60;
  cin >> N >> K;
  vector<ll> h(N + K + 1);
  vector<ll> dp(N + K + 1, INF);
  rep(i, N)
  {
    cin >> h.at(i);
  }
  dp.at(0) = 0;
  // dp.at(1) = abs(h.at(1) - h.at(0));
  rep(i, N)
  {
    rep2(j, 1, K + 1)
    {
      chmin(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
    }
  }

  cout << dp.at(N - 1) << endl;
  return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {

    double R;
    cin >> R;
    cout << 2 * R * 3.1415926535 << endl;
    
    return 0;
}

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

int main(){

	int K,S;
  	int count;
  	cin >> K >> S;
  	
  	for(int X = 0;X<=K;X++){
    	for(int Y = 0;Y<=K;Y++){
            if(S-X-Y>=0 && S-X-Y <= K){count++;}
    	}
    }
  
  
  cout << count << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
const long long INF = 1e15;



int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    int h,w;
    cin >> h >> w;

    int sx,sy,gx,gy;
    cin >> sy >> sx >> gy >> gx;
    sx--;sy--;gx--;gy--;

    pair<int,int> s = make_pair(sx,sy), g = make_pair(gx,gy); 
    vector<vector<int>> ans(h,vector<int>(w,mod));
    string sur[h];

    for(int i = 0; i < h; i++) cin >> sur[i];

    auto inout = [&](int x,int y){
        if(0 <= x && x < w && 0 <= y && y < h) return true;
        else return false;
    };

    auto add = [&](pair<int,int> now,int dx,int dy){
        pair<int,int> ret = make_pair(now.first+dx,now.second+dy);
        return ret;
    };

    queue<pair<int,int>> p,q;

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

    p.push(s);
    ans[s.second][s.first] = 0;

    int can = 0;

    while(!p.empty()){
        while(!p.empty()){
            pair<int,int> now = p.front();
            p.pop();
            q.push(now);
            bool first = true;
            for(int i = 0; i < 4; i++){
                pair<int,int> nxt = add(now,dx[i],dy[i]);
                if(inout(nxt.first,nxt.second)){
                    if(sur[nxt.second][nxt.first] == '.'){
                        if(nxt == g){
                            cout << can << endl;
                            return 0;
                        }
                        p.push(nxt);
                        sur[nxt.second][nxt.first] = '#';
                    }
                }
            }
        }
        can++;
        while(!q.empty()){
            pair<int,int> now = q.front();
            q.pop();
            for(int i = -2; i < 3; i++){
                for(int j = -2; j < 3; j++){
                    pair<int,int> nxt = make_pair(now.first+i,now.second+j);
                    if(inout(nxt.first,nxt.second)){
                        if(sur[nxt.second][nxt.first] == '.'){
                            p.push(nxt);
                            sur[nxt.second][nxt.first] = '#';
                            if(nxt == g){
                                cout << can << endl;
                                return 0;
                            }
                        }
                    }
                }
            }
        }
    }

    cout << -1 << endl;

    return 0;
}


Measured memory_bytes: 8764
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll i,j;
    ll co=0;
    for(i=0;i<n;i++)cin >> a.at(i);

    for(i=0;i<n-1;i++){
        if(a.at(i)==a.at(i+1)){
            co++;
            a.at(i+1)=1000;
        }
    }
    cout << co << endl;
    return 0;
}

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

using namespace std;

int n;
vector<int> edges[400];

int bfs(int s) {
    vector<int> dst(n, -1); dst[s] = 0;
    queue<int> q; q.push(s);
    int mx = 0;
    while (!q.empty()) {
        int v = q.front(); q.pop();
        mx = max(mx, dst[v]);
        for (int u : edges[v])
            if (dst[u] == -1) dst[u] = dst[v] + 1, q.push(u);
    }
    return mx;
}

char c[20][20];
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

void solve() {
    int h, w;
    cin >> h >> w;
    n = h * w;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> c[i][j];
        }
    }
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            for (int k = 0; k < 4; k++) {
                int ni = i + dx[k], nj = j + dy[k];
                if (ni < 0 || ni >= h || nj < 0 || nj >= w || c[ni][nj] == '#')
                    continue;
                int v = i * w + j, u = ni * w + nj;
                edges[v].push_back(u);
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (c[i][j] == '#') continue;
            int v = i * w + j;
            ans = max(ans, bfs(v));
        }
    }
    cout << ans;
}

int main() {
    ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
    cout.setf(ios::fixed), cout.precision(20);
    solve();
}


Measured memory_bytes: 256
n = int(input())

l = []
for _ in range(n):
    tmp = list(map(int,input().split()))
    l.append([tmp[0] - tmp[1],tmp[0] + tmp[1]])

l.sort()
l = l[::-1]
now = l[0][0]
ans = 1
for i in range(1,n):
    if now >= l[i][1]:
        now = l[i][0]
        ans += 1

print(ans)


Measured memory_bytes: 20900
N = gets.chomp.to_i
T, A = gets.split.map(&:to_i)
site_array = gets.split.map(&:to_i)

temp_array = site_array.map{|item|
  (T-(item*0.006))
}

diff_array = temp_array.map.with_index{|item, index|
  {index: index, value: (item-A).abs}
}

puts diff_array.sort{|a, b|
  a[:value] <=> b[:value]
}[0][:index]+1


Measured memory_bytes: 2044
#include <bits/stdc++.h>
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
using namespace std;

using pii = pair<int, int>;
#define fst first
#define snd second

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

inline bool check(int i, int j, int h, int w) {
	if (i < 0 or h <= i) return false;
	if (j < 0 or w <= j) return false;
	return true;
}

auto convert(vector<string> board) {
	const int h = board.size();
	const int w = board[0].size();

	vector<vector<int>> used(h, vector<int>(w, -1));


	vector<int> ret;
	int total = 0;

	while (1) {
		int ci = -1, cj = -1;
		rep(i, h)rep(j, w) {
			if (used[i][j] == -1) {
				ci = i, cj = j;
				i = h, j = w;
			}
		}

		if (ci == -1) break;

		int par = -1;
		const int num = (board[ci][cj] == '#') ? 8 : 4;

		rep(i, num) {
			pii nxt = pii(ci, cj);
			nxt.fst += dy[i], nxt.snd += dx[i];
			if (check(nxt.fst, nxt.snd, h, w) == false) continue;

			if (used[nxt.fst][nxt.snd] != -1) {
				par = used[nxt.fst][nxt.snd];
				break;
			}
		}

		ret.push_back(par);

		queue<pii> q;
		q.push(pii(ci, cj));
		used[ci][cj] = total;


		while (!q.empty()) {
			pii cur = q.front(); q.pop();
			rep(i, num) {
				pii nxt = cur;
				nxt.fst += dy[i], nxt.snd += dx[i];

				if (check(nxt.fst, nxt.snd, h, w) == false) continue;

				if (used[nxt.fst][nxt.snd] == -1 and board[nxt.fst][nxt.snd] == board[ci][cj]) {
					used[nxt.fst][nxt.snd] = total;
					q.push(nxt);
				}
			}
		}

		total++;
	}

	return ret;
}

using ll = long long;
ll R[410];

const ll mod = 1000000009LL;

ll dfs(vector<int> tree, int v, int d) {
	const int n = tree.size();

	vector<ll> ary;
	rep(v2, n) if (tree[v2] == v) ary.push_back(dfs(tree, v2, d + 1));

	ll ret = 1LL;
	for (auto &it : ary) ret = 1LL * ret * (R[d] + it) % mod;
	return ret;
}


int main(void) {
	int h, w;

	random_device rnd;
	mt19937 mt(rnd());
	uniform_int_distribution<ll> rand(0, mod);

	rep(i, 400) R[i] = rand(mt);

	while (cin >> h >> w, h) {
		vector<int> tree, tree2;

		{
			vector<string> board(h + 2, string(w + 2, '.'));
			rep(i, 1, h + 1)rep(j, 1, w + 1) cin >> board[i][j];
			tree = convert(board);
		}

		cin >> h >> w;

		{
			vector<string> board(h + 2, string(w + 2, '.'));
			rep(i, 1, h + 1)rep(j, 1, w + 1) cin >> board[i][j];
			tree2 = convert(board);
		}

		if (dfs(tree, 0, 0) == dfs(tree2, 0, 0))
			puts("yes");
		else
			puts("no");

		/*
		for(auto &it:tree) cerr << it << " ";
		cerr << endl;

		for(auto &it:tree2) cerr << it << " ";
		cerr << endl;
		*/
	}

	return 0;
}

Measured memory_bytes: 3244
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;

#define MOD 998244353


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

bool primeNumber(ll n){
    if(n < 2) return false;
    else{
        for(ll i = 2; i * i <= n; i++){
            if(n % i == 0) return false;
        }
        return true;
    }
}
  
  

int main(){
    char C;
    cin>>C;
    char ans = C + 1;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N,M;
set<ll> nowStackingSet;
vector<ll> shutVec[100010];
int main(){
    cin>>N>>M;
    for(ll i=0;i<M;i++){
        ll a,b;
        cin>>a>>b;
        shutVec[a].push_back(b);
    }
    set<ll> shutSet;
    ll ans=0;
    for(ll i=0;i<N;i++){
        for(auto j:shutVec[i]){
            shutSet.insert(j);
        }
        if(shutSet.count(i+1)!=0){
            shutSet.clear();
            ans++;
        }
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 6784
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
      	int N = sc.nextInt();
      
      	Integer p[] = new Integer[N];
        for (int i=0; i<N; i++) {
            p[i] = sc.nextInt();
        }
		
      	int ans = 0;
      	int dis = 100;
		for(int i = 0;i<=220;i++){
          if(Arrays.asList(p).contains(i)) continue;
          //System.out.println(Math.abs(X - i));
          if(Math.abs(X - i) < dis) {
            dis = Math.abs(X - i);
            ans = i;
          }
        }
      	if (N == 0)
            System.out.println(X);
        else
            System.out.println(ans);
    }
}

Measured memory_bytes: 35916
-module('Main').
-export([main/1]).

solve() ->
    [A, B, C, X] = input("~d~d~d~d"),
    io:format("~B~n", [length(
        [ ok || I <- lists:seq(0, A), J <- lists:seq(0, B), K <- lists:seq(0, C), 500 * I + 100 * J + 50 * K =:= X]
    )]),
    ok.

main(_) ->
    solve(),
    halt().

input(Pat) ->
    {ok, L} = io:fread("", Pat),
    L.


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

#define Y second
#define X first
#define pb push_back
#define mp make_pair

typedef long long ll;

using namespace std;

ll n, ans;
pair<ll, ll>a[200];

ll f(ll x, ll y){
	return x * x + y * y;
}

int main(){
	cin >> n;
	for(ll i = 1; i <= n; i++){
		cin >> a[i].X >> a[i].Y;
	}
	cout << '\n';
	for(ll k = 1; k <= 1000; k++){
		random_shuffle(a + 1, a + 1 + n);
		ll x, y;
		x = y = 0;
		for(ll i = 1; i <= n; i++){
			if(f(x + a[i].X, y + a[i].Y) > f(x, y)){
				x += a[i].X;
				y += a[i].Y;
			}
		}
		ans = max(ans, f(x, y));
	}
	printf("%.10f", sqrt(ans));
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;

int main(){
    ull memo[2001];

    REP(i, 2001){
        memo[i] = 0;
    }

    REP(i, 1001){
        REP(j, 1001){
            memo[i+j]++;
        }
    }

    int N;
    while(std::cin >> N, !std::cin.eof()){
        ull res = 0;
        REP(i, std::min(2001, N+1)){
            if(0 <= i && i <= 2000 && 0 <= N-i && N-i <= 2000){
                res += memo[i] * memo[N-i];
            }
        }

        std::cout << res << std::endl;
    }
}

Measured memory_bytes: 1168
x, y = map(int, input().split())
if x <= y and x < 0 and y > 0:
    print(abs(abs(y) - abs(x)) + 1)
elif x <= y :
    print(y-x)
elif abs(x) == abs(y):
    print(1)
elif x >= 0 and y <= 0:
    print(abs(abs(y)-abs(x))+1)
else:
    print(abs(abs(y)-abs(x))+2)

Measured memory_bytes: 3060
import java.util.Arrays;

public class Main {

  private static void solve() {
    char[] s = ns();
    int n = s.length;
    int[] bit = new int[n + 1];
    for (int i = 0; i < n; i ++) {
      bit[i + 1] = bit[i] ^ (1 << (s[i] - 'a'));
    }

    int[] min = new int[1 << 26];
    Arrays.fill(min, Integer.MAX_VALUE / 2);
    min[0] = 0;
    for (int i = 1; i <= n; i ++) {
      for (int j = 0; j < 26; j ++) {
        min[bit[i]] = Math.min(min[bit[i] ^ (1 << j)] + 1, min[bit[i]]);
      }
    }
    System.out.println(Math.max(min[bit[n]], 1));
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = System.getProperty("debug");
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

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

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 294484
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AOJ
{
	class Program
	{
		static void Main(string[] args)
		{
			var s = "";
			while ((s = Console.ReadLine()) != null)
			{
				var r = 0;
				for(int i=0;i<s.Length;i++)
				{
					r += f(s[i]);
					if (i > 0 && (f(s[i]) > f(s[i - 1]))) r -= f(s[i - 1]) * 2;
				}
				Console.WriteLine(r);
			}
		}

		static int f(char c)
		{
			return
				c == 'I' ? 1 : c == 'V' ? 5 :
				c == 'X' ? 10 : c == 'L' ? 50 :
				c == 'C' ? 100 : c == 'D' ? 500 :
				c == 'M' ? 1000 : 0;
		}
	}
}

Measured memory_bytes: 5552
#include <iostream>
#include <vector>

int main(int argc, char** argv) {
  unsigned long N;
  std::cin >> N;
  std::vector<char> S(N);
  for (auto& e : S) std::cin >> e;
  unsigned long cnt {1};
  for (auto i = 1;i < N;++i) {
    if (S[i] != S[i-1]) ++cnt;
  }
  std::cout << cnt << '\n';
}


Measured memory_bytes: 384
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                         \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
       << " " << __FILE__ << endl;

// typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

// constant
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
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() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int N;
  cin >> N;

  int ans = 0;
  for (int i = 1; i < (N + 1) / 2; i++) {
    ans++;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
//Abhinav ---IIIT_A
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define f(i,x,n) for(int i=x;i<(int)n;++i)
#define vpii vector<pair<int,int>> 
ld pie=3.141592653589793238462643383279;
int mod=1e9+7;
int dx[]={-1,1,0,0};
int dy[]={0,0,1,-1};


int dig(int a){
  int r=0;
  while(a!=0){
    int xp=a%10;
    a/=10; if(xp==1) ++r;
  }
  return r;
}

int sp(int a){
  int s=0;
  int ano=a-1;
  while(a!=0){
    s+=a%10;
    a/=10;
  }
  while(ano!=0){
    s+=ano%10;
    ano/=10;
  }
  return s;
}

int fun(int a){
  int r=1;
  f(i,0,10) r*=a;
  return r;
}

void q1(){
  int n,b,q; cin>>n>>b>>q;
  int a[n];  f(i,0,n) a[i]=i/b;
  int curr=-1;
  int load=0;
  while(q--){
    int x; cin>>x;
    if(a[x]!=curr){
      curr=a[x];
      load++;
    }
  }
  cout<<load<<"\n";
}
void q2(){
  int t; cin>>t;
  while(t--){
    int n; cin>>n;
    int a[2*n+5];
    f(i,0,2*n) cin>>a[i];
    int o=0,e=0;
    vector<int> odd,even;
    f(i,0,2*n) if(a[i]%2==1) {
      ++o; odd.pb(i+1);
    }
    else {
      ++e; even.pb(i+1);
    }
    vpii vt;
    if(o&1){
      for(int i=0;i<odd.size()-1;i+=2)
        vt.pb({odd[i],odd[i+1]});
      for(int i=0;i<even.size()-1;i+=2)
        vt.pb({even[i],even[i+1]});
    }else{
      if(o>0){
        for(int i=2;i<odd.size();i+=2)
        vt.pb({odd[i],odd[i+1]});
      for(int i=0;i<even.size();i+=2)
        vt.pb({even[i],even[i+1]});
      }else{
          for(int i=2;i<even.size();i+=2)
        vt.pb({even[i],even[i+1]});
      }
    }
    for(auto it : vt) cout<<it.ff<<" "<<it.ss<<"\n";
  }
}
void q3(){
  int t; cin>>t;
  vector<int> xx;
  int pr[100005]={0};
  f(i,2,100005) if(pr[i]==0){
    if(i&1){
      xx.pb(i); for(int j=2*i;j<100005;j+=i) pr[j]=i;
   }
  }
  while(t--){
    int n; cin>>n;
    if(n==1) cout<<"FastestFinger\n";
    else if (n&1) cout<<"Ashishgup\n";
    else{
      int curr=0;
      while(n!=1){
        if(n&1){
          ++curr;
          break;
        }
        int mx=-1;
        for(auto it : xx) if(n%it==0) mx=it;
        if(mx==-1){
          if(n==2){
            break;
          }else{
            ++curr;
            break;
          }
        }else{
          n/=mx;
          curr++;
        }
      }
      if(curr%2==0) cout<<"Ashishgup\n";
      else cout<<"FastestFinger\n";
    }
  }
}
int32_t main(){
#ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n,k; cin>>n>>k;
  vector<int> ret;
  f(i,0,n){
    int x; cin>>x; ret.pb(x);
  }
 sort(ret.begin(),ret.end());
 int sim=0;
 f(i,0,k) sim+=ret[i];
 cout<<sim;
  return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <tuple>
#include <cmath>
using namespace std;
int main()
{
    int N, K;
    cin >> N >> K;
    int D = K*2;
    vector<int> area(D*D);
    for (int i = 0; i < N; i++) {
        int x, y;
        char c;
        cin >> x >> y >> c;
        if (c == 'B') {
            area[D*(y%D)+(x%D)]++;
        } else {
            area[D*(y%D)+((x+K)%D)]++;
        }
    }
    vector<int> sum(2*D*2*D);
    auto sumget = [&](int x, int y) {
        if (x < 0 || y < 0) return 0;
        return sum[2*D*y+x];
    };
    auto sumset = [&](int x, int y, int val) {
        sum[2*D*y+x] = val;
    };
    auto sumarea = [&](int x1, int y1, int x2, int y2) {
        return sumget(x2, y2) - sumget(x1-1, y2) - sumget(x2, y1-1) + sumget(x1-1, y1-1);
    };
    for (int y = 0; y < 2*D; y++) {
        for (int x = 0; x < 2*D; x++) {
            sumset(x, y, sumget(x-1, y) + sumget(x, y-1) - sumget(x-1, y-1) + area[D*(y%D)+(x%D)]);
        }
    }
    int maxscore = 0;
    for (int y = 0; y < K; y++) {
        for (int x = 0; x < D; x++) {
            int score = sumarea(x, y, x+K-1, y+K-1) + sumarea(x+K, y+K, x+2*K-1, y+2*K-1);
            maxscore = max(maxscore, score);
        }
    }
    cout << maxscore << endl;
    return 0;
}

Measured memory_bytes: 78336
#include<bits/stdc++.h>
#define forn(i, n) for(int i=0;i<(int)(n);i++)
#define for1(i, n) for(int i=1;i<=(int)(n);i++)
#define fore(i, l, r) for(int i=(int)(l);i<=(int)(r);i++)
#define ford(i, n) for(int i=(int)(n)-1;i>=0;i--)
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define endl "\n"
#define MAX 1000000007
using namespace std;
typedef int64_t ll;
typedef vector<int> vi;
typedef vector<int64_t> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;

int main(int argc, char *argv[]){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.precision(10);
	cout << fixed;
	int n;
	cin>>n;
	ll max1=INT_MIN;
	ll min1=INT_MAX;
	ll max2=INT_MIN;
	ll min2=INT_MAX;
	for(int i=0;i<n;i++){
	int x,y;
	cin>>x>>y;
	ll sum=x+y;
	ll diff=x-y;
	if(diff>max2)
		max2=diff;
	if(diff<min2)
		min2=diff;
	if(sum>max1)
		max1=sum;
	if(sum<min1)
		min1=sum;
	}
	cout<<max(max1-min1,max2-min2);
	return 0;
}



Measured memory_bytes: 3628
#include "bits/stdc++.h"
#define YES "YES"
#define NO "NO"
#define Yes "Yes"
#define No "No"
#define DEFAULT LL ans=solve();\
 	if(ans==NONE){\
 	}else{\
 		cout << ans << endl;\
 	}
#define YESNO three(solve(),OUT(YES),OUT(NO))
#define YesNo three(solve(),OUT(Yes),OUT(No))
#define ECHO OUT(solve())
#define three(A,B,C) ((A)?(B):(C))
#define FOR(i,a,b)  for(LL i=(a);i< (LL)(b);i++)
#define EFOR(i,a,b) for(LL i=(a);i<=(LL)(b);i++)
#define RFOR(i,a,b) for(LL i=(b-1);i>=(LL)(a);i--)
#define REP(i,b) FOR(i,zero,b)
#define rep REP
#define EREP(i,b) EFOR(i,zero,b)
#define RREP(i,b) RFOR(i,zero,b)
#define ALL(c) c.begin(),c.end()
#define UNIQUE(c) sort(ALL(c));c.erase(unique(ALL(c)),c.end())
#define MAX(c) (*max_element(ALL(c)))
#define MIN(c) (*min_element(ALL(c)))
#define MP make_pair
#define FI first
#define SE second
#define SI(x) (LL(x.size()))
#define PB push_back
#define DEBUG(a) OUT(a)
#define DEBUG2(a,b) OUT2(a,b)
#define cat cout << __LINE__ << endl
#define OUT(a) cout << (a) << endl
#define OUT2(a,b) cout << (a) <<" "<<(b) << endl
#define zero 0LL
#define all ALL
#define pb emplace_back
#define eb pb
#define int long long
using namespace std;
template<typename T> inline void maximize(T &a, T b) { a = max(a, b); }
template<typename T> inline void minimize(T &a, T b) { a = min(a, b); }
template<typename T> inline bool middle(T a, T b, T c) { return b <= a && a <= c; }
template<class T> inline bool MX(T &l, const T &r) { return l < r ? l = r, 1 : 0; }
template<class T> inline bool MN(T &l, const T &r) { return l > r ? l = r, 1 : 0; }
typedef int LL;
typedef double ld;
typedef int ut;
typedef vector<ut> VI;
typedef vector<VI> VII;
typedef pair<ut, ut> pr;
typedef pair<ut, pr> ppr;
typedef vector<pr> Vpr;
typedef vector<ppr> Vppr;
typedef tuple<int, int, int, int> tapu;
typedef vector<tapu> Vtapu;
typedef priority_queue<pr, Vpr > PQ;
inline void outputVI(VI x) { REP(i, SI(x)) { cout << three(i, " ", "") << x[i]; }OUT(""); }
const int SIZE1 = 5e5 + 1000;
const int SIZE2 = 5010;
const int SIZE3 = 430;
const int SIZE = SIZE1;
const int MAPSIZE = 40;
const LL p = 7 + 1e9;
const LL INF = 1LL << 60;
const long double EPS = 1e-7;
const LL NONE=-2;
typedef pair<ld, ut> pld;
ut N, M, K, Q, D, H, W,R;
VI edges[SIZE];
LL vals[SIZE], answer = zero;
LL A[SIZE]={0,3,2,1},B[SIZE]={0,3,2,1};
LL sum[SIZE];
LL solve(){
	cin >> N;
	REP(i,N){
		LL x;
		cin >> x;
		sum[i+1]=sum[i]+x;
	}
	LL ans=INF;
	REP(i,N+1){
		MN(ans,abs(sum[i]-(sum[N]-sum[i])));
	}
	return ans;
}
 signed main() {
 
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	string s;
	LL T;
	DEFAULT;
	
//	YesNo;
//	YESNO;
//	three(solve(),OUT("First"),OUT("Second"));
	//cin >> N;
	return 0;
 
}

Measured memory_bytes: 15744
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		long num1 = Long.parseLong(line[0]);
		long num2 = Long.parseLong(line[1]);

		if(num1%2 == num2%2) {
			long num3 = num1 + num2 ;
			System.out.println(num3/2);
		}else {
			System.out.println("IMPOSSIBLE");
		}
}

}

Measured memory_bytes: 21844
program main
  implicit none
  integer :: N
  integer :: i,j

  read(*,*) N
  do i = 1,9
     do j = 1,9
        if (i*j == N) then
           write(*,*) 'Yes'
           stop
        end if
     end do
  end do
  write(*,*) 'No'
  stop
end program main


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

typedef long long ll;
const ll mod = 1e9+7;
const int N = 1e5;
int arr[N+100];
ll fact[N+100];
ll bigmod(ll a,ll b)
{
	if(b==0)return 1;
	ll x = bigmod(a,b/2);
	x = (x*x)%mod;
	if(b%2)x = (x*a)%mod;
	return x;
}
int main()
{
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++){
		scanf("%d",&arr[i]);
	}
	fact[0] = 1;
	for(int i=1;i<=N;i++){
		fact[i] = (fact[i-1]*i)%mod;
	}
	sort(arr+1,arr+1+n);
	ll plus = 0,minus = 0;
	for(int i=1;i<=n;i++){
		int cnt = n-i;
		if(cnt<k-1)continue;
		ll t1 = bigmod(fact[k-1],mod-2)%mod;
		ll t2 = bigmod(fact[cnt-k+1],mod-2)%mod;
		ll tmp = (fact[cnt]*t1)%mod;
		tmp = (tmp*t2)%mod;
		arr[i] = (arr[i]+mod)%mod;
		tmp = (arr[i]*tmp)%mod;
		minus = (minus+tmp)%mod;
	}
	for(int i=n;i>0;i--){
		int cnt = i-1;
		if(cnt<k-1)continue;
		ll t1 = bigmod(fact[k-1],mod-2)%mod;
		ll t2 = bigmod(fact[cnt-k+1],mod-2)%mod;
		ll tmp = (fact[cnt]*t1)%mod;
		tmp = (tmp*t2)%mod;
		arr[i] = (arr[i]+mod)%mod;
		tmp = (arr[i]*tmp)%mod;
		plus = (plus+tmp)%mod;
	}
	printf("%lld\n",(plus-minus+mod)%mod);
}


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

void judge()
{
  int num;
  cin >> num;

  if(num%10 == 2 || num%10 == 4 || num %10 == 5 || num%10 == 7 || num%10 == 9)
  {
    cout << "hon" << endl;
  }
  //else if(num%10 == 0 || num%10 == 1 || num%10 == 6 || num%10 == 8)
  else if(num%10 == 3)
  {
    cout << "bon" << endl;
  }
  else
  {
    cout << "pon" << endl;
  }
}
int main()
{
  judge();
}


Measured memory_bytes: 3648
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var Y = cin.ReadInt;

            for(int x = 0; x <= N; x++){
                for (int y = 0; y <= N; y++){
                    int z = N - x - y;
                    if (z < 0){
                        continue;
                    }
                    if (10000 * x + 5000 * y + 1000 * z == Y){
                        WriteLine(x + " " + y + " " + z);
                        return;
                    }
                }
            }
            WriteLine("-1 -1 -1");

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 11220
#include <algorithm>
#include <cassert>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

struct Range {
    long lb;
    long ub;
};

int main()
{
    int N;
    long A, B, C, D;
    cin >> N >> A >> B >> C >> D;

    long dest = B - A;

    vector<Range> rs = {{0, 0}};

    for (int i = 0; i < N - 1; ++i) {
        vector<Range> nrs;

        for (Range r : rs) {
            nrs.push_back({r.lb - D, r.ub - C});
        }

        nrs.push_back({rs.back().lb + C, rs.back().ub + D});

        for (size_t j = 0; j + 1 < nrs.size(); ) {
            if (nrs[j].ub >= nrs[j + 1].lb) {
                nrs[j].ub = nrs[j + 1].ub;
                nrs.erase(nrs.begin() + j + 1);
            } else {
                ++j;
            }
        }

        if (nrs.size() == 4) {
            const Range& r1 = nrs[1];

            if (r1.ub >= dest) {
                nrs.erase(nrs.end() - 1);
            } else {
                nrs.erase(nrs.begin());
            }
        }

        assert(nrs.size() <= 3);

        rs.swap(nrs);
    }

    bool ans = false;
    for (Range r : rs) {
        if (r.lb <= dest && dest <= r.ub) {
            ans = true;
            break;
        }
    }

    cout << (ans ? "YES" : "NO") << '\n';

    return 0;
}


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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef long long lli;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, str>> vpls;
typedef vector<tuple<str, ll, ll>> vtsl;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

ll GetDigit(ll num)
{
  return log10(num) + 1;
}

//実行部
void Main()
{
  ll n, d, x; cin >> n >> d >> x;
  vll a(n); rep(i, n) cin >> a[i];
  ll ans = n + x;
  rep(i, n)
  {
    if(a[i] > d) continue;
    else
    {
      ans += (d-1) / a[i];
    }
  }
  fin(ans)
}

//前処理
int main()
{
  //ios::sync_with_stdio(false);
  //cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <cassert>
#include <random>


int main() {
	double PI = 3.1415926535897932;
	double r; std::cin >> r;
	printf("%.15f\n", 2 * PI*r);
	return 0;
}


Measured memory_bytes: 3792
/*
Saurabh Joshi
IIIT Jabalpur
*/
#include<bits/stdc++.h>
#define LL long long int
#define M 1000000007
#define endl "\n"
#define eps 0.00000001
LL pow(LL a,LL b,LL m){LL x=1,y=a;while(b > 0){if(b%2 == 1){x=(x*y);if(x>m) x%=m;}y = (y*y);if(y>m) y%=m;b /= 2;}return x%m;}
LL gcd(LL a,LL b){if(b==0) return a; else return gcd(b,a%b);}
LL gen(LL start,LL end){LL diff = end-start;LL temp = rand()%start;return temp+diff;}
using namespace std;
LL a[1001];
LL pref[1001];
vector<LL> v;
int main()
    {
        ios_base::sync_with_stdio(0);
        int n , k;
        cin >> n >> k;
        for(int i = 1; i <= n; i++){
            cin >> a[i];
            pref[i] = pref[i - 1] + a[i];            
        }
        for(int i = 1; i <= n; i++) {
            for(int j = i; j <= n; j++) {
                v.push_back(pref[j] - pref[i - 1]);
            }
        }
        vector<int> cur;
        for(int i = 40; i >= 0; i--)    {
            int ctr = 0;
            for(int j = 0; j < v.size(); j++)   {
                LL temp = v[j];
                bool flag = 1;
                for(int bit: cur)   {
                    if(!(temp & (1LL << bit)))  {
                        flag = 0;
                        break;
                    }
                }
                if(flag == 1)   {
                    if(temp & (1LL << i))   {
                        ++ctr;
                    }
                }
            }
            if(ctr >= k)    {
                cur.push_back(i);
            }
        }
        LL ans = 0;
        for(int bit: cur) {
            ans += (1LL << bit);
        }
        cout << ans;
    }

Measured memory_bytes: 6512
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
Q = int(input())
prime = set()
cuml = []
count = 0
for i in range(1,100000,2):
    if len(make_divisors(i)) == 2:
        if len(make_divisors((i+1)//2)) == 2:
            prime.add(i)
for i in range(1,100000,2):
    if i in prime:
        count += 1
    cuml.append(count)
for i in range(Q):
    l,r = (int(x) for x in input().split())
    if l > 1:
        print(cuml[(r-1)//2]-cuml[(l-3)//2])
    else:
        print(cuml[(r-1)//2])

Measured memory_bytes: 52952
#include <iostream>
#include <algorithm>

int main()
{
  int64_t a, b, x;
  std::cin >> a >> b >> x;
  if (a % x == 0)
  {
    std::cout << b / x - a / x + 1 << std::endl;
  }
  else
  {
    std::cout << b / x - a / x << std::endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,X;
  cin>>N>>X;
  vector<int>m(N);
  int sum=0;
  for(int i=0;i<N;i++){
    cin>>m.at(i);
    sum=sum+m.at(i);
  }
  sort(m.begin(),m.end());
  cout<<N+(X-sum)/m.at(0)<<endl;
}
    

Measured memory_bytes: 256
use std::io::stdin;

fn main(){
    let n = getvec()[0];
    println!("{}", n*800 - n/15*200);
}

#[allow(dead_code)]
fn getline() -> String {
    let mut s = String::new();
    match stdin().read_line(&mut s){
        Ok(_) => {s.trim().to_string()}
        Err(_) => String::new()
    }
}

#[allow(dead_code)]
fn getvec() -> Vec<i64>{
    let line = getline();
    line.split_whitespace().map(|x| x.parse().unwrap()).collect()
}

Measured memory_bytes: 4352