akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define inf (1e9 + 7)
#define mem(a, b) memset(a, b, sizeof(a))
using namespace std;

int pp[10000005], n, num[105], num2[205], nn = 0, ji = 0, ou = 0, lk[205], ans = 0;
bool vis[205];
vector<int> eg[205];
map<int, int> mps;

void inits()
{
    mem(lk, -1);
    for(int i = 2;i <= 10000000;i++)
    {
        if(!pp[i])
            pp[++pp[0]] = i;
        for(int j = 1;j <= pp[0]&&10000000 / i >= pp[j];j++)
        {
            pp[i * pp[j]] = 1;
            if(i % pp[j] == 0)
                break;
        }
    }
}

bool dfs(int u)
{
    int lim = eg[u].size();
    for(int i = 0;i < lim;i++)
    {
        int v = eg[u][i];
        if(!vis[v])
        {
            vis[v] = 1;
            if(lk[v] == -1||dfs(lk[v]))
            {
                lk[v] = u;
                return true;
            }
        }
    }
    return false;
}

int main()
{
    inits();
    int mx = 0;
    scanf("%d", &n);
    for(int i = 1;i <= n;i++)
        scanf("%d", &num[i]);
    sort(num + 1, num + 1 + n);
    num2[++nn] = num[1];
    mps[num[1]] = nn;
    for(int i = 2;i <= n;i++)
    {
        if(num[i] - 1 != num[i - 1])
        {
            num2[++nn] = num[i - 1] + 1;
            mps[num[i - 1] + 1] = nn;
            num2[++nn] = num[i];
            mps[num[i]] = nn;
        }
    }
    num2[++nn] = num[n] + 1;
    mps[num[n] + 1] = nn;
    mx = num[n] + 1;
    for(int i = 1;i <= nn;i++)
    {
        if(num2[i] % 2 == 0)
        {
            ou++;
            for(int j = 2;j <= pp[0];j++)
            {
                if(num2[i] + pp[j] > mx)
                    break;
                if(mps.find(num2[i] + pp[j]) != mps.end())
                {
                    int pos = mps[num2[i] + pp[j]];
                    eg[pos].push_back(i);
                }
            }
        }
        else
        {
            ji++;
            for(int j = 2;j <= pp[0];j++)
            {
                if(num2[i] + pp[j] > mx)
                    break;
                if(mps.find(num2[i] + pp[j]) != mps.end())
                {
                    int pos = mps[num2[i] + pp[j]];
                    eg[i].push_back(pos);
                }
            }
        }
    }
    int res = 0;
    for(int i = 1;i <= nn;i++)
    {
        if(num2[i] % 2 == 0)
            continue;
        mem(vis, 0);
        if(dfs(i))
            res++;
    }
    ans += res;
    ji -= res;
    ou -= res;
    ans += ji / 2 * 2;
    ji %= 2;
    ans += ou / 2 * 2;
    ou %= 2;
    if(ji||ou)
        ans += 3;
    printf("%d\n", ans);
    return 0;
}



Measured memory_bytes: 39424
from heapq import heappush, heappop
from collections import deque
import itertools
from itertools import permutations
import sys
import bisect
sys.setrecursionlimit(10**6)
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
YNeos='YNeos'
GYN=['Yes','trumpet']
mo=10**9+7
imp='IMPOSSIBLE'

a,b,c=MI()
print(max(0,c-a+b))


Measured memory_bytes: 38256
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [K, A, B] = [long(input_raw[0]), long(input_raw[1]), long(input_raw[2])]

    K_ = K - (A - 1)
    print max((B - A) * (K_/2) + A + K_% 2, K + 1)


if __name__ == '__main__':
    main()


Measured memory_bytes: 2932
<?php
class Line {
    protected $lineData;
    protected $pointer;
    public function __construct(array $line)
    {
        $this->lineData = $line;
        $this->pointer = 0;
        $this->count = count($line);
    }

    public function next()
    {
        if ($this->count > $this->pointer) {
            return $this->lineData[$this->pointer++];
        }
        return false;
    }

    public function getData()
    {
        return $this->lineData;
    }
}

class IOW {
    /**
     * @return Line
     */
    public static function nl()
    {
        $str = trim(fgets(STDIN));
        return new Line(explode(' ', $str));
    }

    public static function out($data)
    {
        print_r ($data . PHP_EOL);
    }
}

$line = IOW::nl();
$A = $line->next();
$P = $line->next();
IOW::out(floor(($A * 3 + $P) / 2));

Measured memory_bytes: 4856
def main()
  n = gets.to_i
  row1 = gets.split.map { |t| t.to_i }
  row2 = gets.split.map { |t| t.to_i }
  candies = []
  for i in 0..n-1
    candies.push((row1[0..i] + row2[i..-1]).inject(:+))
  end
  puts candies.max
end

main if __FILE__ == $0


Measured memory_bytes: 1916
#include <iostream>
#include <stdio.h>
#include <string.h>
#define LEN 100005
using namespace std;

typedef struct pp {
   char name[100];
   int t;
} P;

P Q[LEN];
int head, tail, n;

void enqueue(P x){
   Q[tail] = x;
   tail = (tail + 1) % LEN;
}

P dequeue(){
   P x = Q[head];
   head = (head + 1) % LEN;
   return x;   
}

int min(int a, int b){return a < b ? a : b;}

int main(){
   int elaps = 0, c;
   int i, q;
   P u;
   scanf("%d %d", &n, &q);

   for (i=1; i<=n; i++){
      scanf("%s", Q[i].name);
      scanf("%d", &Q[i].t);
   }
   head = 1; tail = n + 1;

   while (head != tail){
      u = dequeue();
      c = min(q, u.t);
      u.t -= c;
      elaps += c;
      if (u.t > 0) enqueue(u);
      else {
         printf("%s %d\n", u.name, elaps);
      }
   }

   return 0;
}







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

// #define fi first
// #define se second
#define rep(i, n) for (ll i=0;i<(n); i++)
#define ALL(v) (v).begin(), (v).end()
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;

const ll M=1000000007ll;
const ll MOD=1000000007ll;
const ll MAX=100000001ll;
//const ll M = 1000000000+7;

ll cnt = 0; 

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

mint f(ll n){
  if(n==0) return 1;
  mint ans = f(n/2);
  ans *= ans;
  if(n%2==1) ans*= 2;
  return ans;
}

mint choose(ll n, ll k){
  mint x=1, y=1;
  rep(i,k){
    x *= (n-i);
    y *= (i+1);
  }
  return x / y;
}

struct BIT {
  private:
   vector<ll> bit;
   ll N;
 
  public:
   BIT(ll size) {
     N = size;
     bit.resize(N + 1);
   }
 
   // 一点更新です
   void add(ll a, ll w) {
     for (ll x = a; x <= N; x += x & -x) bit[x] += w;
   }
 
   // 1~Nまでの和を求める。
   int sum(ll a) {
     ll ret = 0;
     for (ll x = a; x > 0; x -= x & -x) ret += bit[x];
     return ret;
   }
 };
 

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

  vector<ll> v(n);

  ll min_a = 1111111111;
  ll cnt = 0, ans=0;
  ll tmp;
  rep(i,n){
    cin>>tmp;
    if(tmp<0){
      cnt++;
      tmp *= -1;
    }
    chmin(min_a, tmp);
    ans += tmp;
  }

  if(cnt%2==1){
    ans -= min_a * 2;
  }
  //cout<<min_a<<endl;
  cout << ans << endl;
 
  
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
using namespace std;
 
struct node
{
    int i;
    int n;
    int p;
}num[200010];
 
bool cmp(node aa,node bb)
{
    return aa.n<bb.n;
}
 
bool cmp1(node aa,node bb)
{
    return aa.i<bb.i;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&num[i].n);
        num[i].i=i;
    }
    sort(num,num+n,cmp);
    int mid=n/2;
    for(int i=0;i<n;i++)
    {
        if(num[i].n<num[mid].n)
            num[i].p=num[mid].n;
        else
            num[i].p=num[mid-1].n;
    }
    sort(num,num+n,cmp1);
    for(int i=0;i<n;i++)
        printf("%d\n",num[i].p);
    return 0;
}


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

int main(){
	int X,A,B;
	cin >> X >> A >> B;
	
	int data = B-A;
	if(data <= 0){
		cout << "delicious" << endl;
	}
	else {
		if(data <= X){
			cout << "safe" << endl;
		}
		else {
			cout << "dangerous" << endl;
		}
	}

}





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

#define VIC ios::sync_with_stdio(0);cin.tie(0);ios_base::sync_with_stdio(0);
#define wtf(s) freopen((s), "w", stdout)
#define rff(s) freopen((s), "r", stdin)
#define pi (2 * acos(0))
typedef long double ld;
typedef long long ll;
typedef complex<ld> point;
#define endl '\n'
#define matrix vector<vector<ll>>
#define EPS 1e-9
#define X real()
#define Y imag()
#define vec(a, b) ((b) - (a))
#define dot(a, b) ((conj(a) * (b)).real())
#define cross(a, b) ((conj(a) *(b)).imag())
#define lengthsqr(v) (dot(v, v))
#define length(v) ((ld)hypot((v).Y, (v).X))
#define same(a, b) (lengthsqr(vec(a, b)) < EPS)

const int N = 15 + 5, inf = 2e9, mod = 1e9 + 7;

int main()
{
    VIC
    int n, x, ans = INT_MAX;
    cin >> n;
    while (n--)
    {
        int c = 0;
        cin >> x;
        while (x >= 2 && x % 2 == 0)
            c++,
            x /= 2;
        ans = min(ans, c);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<ll,ll,ll> T;
const long long INF = 1LL<<60;
const int MOD = 1000000000+7;
#define rev(s) (string((s).rbegin(), (s).rend()))
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
// cout << fixed << setprecision(10) << ans << endl;
// *min_element(c + l, c + r) *max_element(c + l, c + r)
// int dx[8]={1,1,0,-1,-1,-1,0,1};
// int dy[8]={0,1,1,1,0,-1,-1,-1};
// int dx[4]={1,0,-1,0};
// int dy[4]={0,1,0,-1};
// struct Edge {
//   int to, id;
//   Edge(int to, int id): to(to), id(id) {}
// };

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

// }

// #include <bits/stdc++.h>
// #define rep(i,n)for(int i=0;i<(n);i++)
// using namespace std;
// typedef long long ll;
// typedef pair<int,int> P;
// const long long INF = 1LL<<60;
// const long long MOD = 1000000000+7;
// #define rev(s) (string((s).rbegin(), (s).rend()))
// cout << fixed << setprecision(10) << ans << endl; 有効桁数指定
// *min_element(c + l, c + r) *max_element(c + l, c + r) 配列の中のmin-max

// UnionFind tree(n);  と宣言

class UnionFind {
public:
    vector <ll> par; // 各元の親を表す配列
    vector <ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_): par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_) {
        siz.assign(sz_, 1LL);  // assign: 再代入
        par.resize(sz_);  // resize: 再確保
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x) { // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x) { // 素集合のサイズ
        return siz[root(x)];
    }
};

int main() {
    int n,m;cin>>n>>m;
    UnionFind tree(n);
    tree.init(n);
    map<P,int> ma; 
    rep(i,m) {
        int a,b;cin>>a>>b;
        a--;b--;
        tree.merge(a,b);
        // if(ma[P(a,b)]==0) {
        //     tree.merge(a,b);
        //     ma[P(a,b)]++;
        //     ma[P(b,a)]++;
        // }
    }
    ll ans = 0;
    rep(i,n) {
        ans = max(ans,tree.size(i));
    }
    cout<<ans<<endl;
}

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

int main() {
  string s;
  cin >> s;
  
  int num0 = 0;
  int num1 = 0;
  for (int i = 0; i < s.size(); i += 2) {
    if (s.at(i) == '0') num0++;
    else num1++;
  }
  
  for (int i = 1; i < s.size(); i += 2) {
    if (s.at(i) == '0') num1++;
    else num0++;
  }

  if (num0 < num1) cout << num0 << endl;
  else cout << num1 << endl;
}


Measured memory_bytes: 512
#pragma region ヘッダー
#define _CRT_SECURE_NO_WARNINGS

#ifdef _____MY_DEBUG_____
#define VS_ENDPAUSE()	(system("pause"))
#define DEBUG_OUT(...)  (printf(__VA_ARGS__))
#else
#define VS_ENDPAUSE()
#define DEBUG_OUT(...)
#endif

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef signed long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
#define int int64

#ifndef INT8_MIN
#define INT8_MIN	(-127)
#endif
#ifndef INT8_MAX
#define INT8_MAX	( 128)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX	( 255)
#endif
#ifndef INT16_MIN
#define INT16_MIN	(-32768)
#endif
#ifndef INT16_MAX
#define INT16_MAX	( 32767)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX	( 65535)
#endif
#ifndef INT32_MIN
#define INT32_MIN	(-2147483648)	// -2 * 10^9
#endif
#ifndef INT32_MAX
#define INT32_MAX	( 2147483647)	//  2 * 10^9
#endif
#ifndef UINT32_MAX
#define UINT32_MAX	( 4294967295)	//  4 * 10^9
#endif
#ifndef INT64_MIN
#define INT64_MIN	(-9223372036854775808)	// -9 * 10^18
#endif
#ifndef INT64_MAX
#define INT64_MAX	( 9223372036854775807)	//  9 * 10^18
#endif
#ifndef UINT64_MAX
#define UINT64_MAX	( 18446744073709551615)	// 18 * 10^18
#endif

void func(void);
#pragma endregion

int32 main(void)
{
    func();
    VS_ENDPAUSE();
    return 0;
}

template <typename T> T gcd(T a, T b)
{
    T tmp;
    if(b > a){ swap(a, b); }
    while(b > 0){ tmp = a % b; a = b; b = tmp; }
    return a;
}
template <typename T> T gcd(const vector< T > &v)
{
    T ret = v[0];
    for(uint32 i=1; i<v.size(); i++){
        ret = gcd(ret, v[i]);
    }
    return ret;
}
// 最小公倍数
template <typename T> T lcm(T a, T b)
{
    if(b>a){ swap(a, b); }
    return a/gcd(a,b) * b;
}
template <typename T> T lcm(const vector< T > &v)
{
    T ret = v[0];
    for(uint32 i=1; i<v.size(); i++){
        ret = lcm(ret, v[i]);
    }
    return ret;
}

void func(void)
{
//DEBUG_OUT("----\n");
    uint32 N;
    cin >> N;

    vector<uint64> t(N);
    for(uint32 i=0; i<N; i++){
        cin >> t[i];
    }

DEBUG_OUT("-----\n");
    cout << lcm(t) << endl;
    
    return;
}



Measured memory_bytes: 256
/* 

*/
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <bitset>
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define LSOne(S) (S & (-S))
#define EPS 1e-9
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pd;
typedef tree<pi, null_type, less<pi>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0); // BEFORE SUBMIT DON'T FORGET TO UNCOMMENT THIS
    string str;
    cin >> str;
    bool ans = (str[2] == str[3]) && (str[4] == str[5]);
    (ans) ? cout << "Yes\n" : cout << "No\n";
    return 0; 
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main(){
  int h,w,d,a,q,r,s;
  vector<P> p(90010);
  int b[90010];
  cin>>h>>w>>d;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>a;
      p[a]=P(i,j);
    }
  }
  for(int i=1;i<=h*w;i++){
    if(i<=d) b[i]=0;
    else b[i]=b[i-d]+abs(p[i].first-p[i-d].first)+abs(p[i].second-p[i-d].second);
  }
  cin>>q;
  for(int i=0;i<q;i++){
    cin>>r>>s;
    cout<<b[s]-b[r]<<endl;
  }
}

Measured memory_bytes: 2176
#include<bits/stdc++.h>
using namespace std;
 int main()
 {
     int n;
     int a[200000],f[200000] = {0};
     cin>>n;
     for(int i=0;i<n;i++)
     {
         cin>>a[i];
         f[a[i]]++;
         f[a[i]-1]++;
         f[a[i]+1]++;
     }
     //for(int i=0; i<11; i++) cout<<f[i]<<" "; cout<<endl;
     cout<<*max_element(f,f+200000)<<endl;
     return 0;
}

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

int main(void) {
  int N,a[120];
  cin >> N;
  for(int i=0;i<N;++i){
  	cin >> a[i];
  }
  int min=a[0],max=a[0];
   for(int i=0;i<N;++i){
  	if(min > a[i]) min = a[i];
    if(max < a[i]) max = a[i];
  }
  cout << max - min <<endl;
	return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int main() {
    fastio();

    int x, a, b;
    cin >> x >> a >> b;
    if (abs(x - a) <= abs(x - b)) {
        cout << "A\n";
    } else {
        cout << "B\n";
    }

    return 0;
}

Measured memory_bytes: 256
fn solve() {
    let (h, w, k): (usize, usize, usize) = (read::<usize>(), read::<usize>(), read::<usize>());
    let mut map = vec![];
    for i in 0..h {
        let s: Vec<char> = read::<String>().chars().collect();
        map.push(s);
    }
    let mut ans = 0;

    for i in 0..(2usize.pow(h as u32) - 1) {
        for j in 0..(2usize.pow(w as u32) - 1) {
            let mut srow = HashSet::new();
            // 消す行
            for k in 0..h {
                if i >> k & 1 == 1 {
                    srow.insert(k);
                }
            }
            let mut scol = HashSet::new();
            // 消す列
            for k in 0..w {
                if j >> k & 1 == 1 {
                    scol.insert(k);
                }
            }
            let mut tmp = 0;
            for i1 in 0..h {
                for j1 in 0..w {
                    if map[i1][j1] == '#' && !srow.contains(&i1) && !scol.contains(&j1) {
                        tmp += 1;
                    }
                }
            }
            if tmp == k {
                ans += 1;
            }
        }
    }
    println!("{}", ans);
}

fn main() {
    let stack_size = 104_857_600;
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min, Reverse};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: usize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========


Measured memory_bytes: 2280
A,B = map(int,input().split())

flag=0
if A>=3 and A%3==0:
  flag=1
elif B>=3 and B%3==0:
  flag=1
elif (A+B)>=3 and (A+B)%3==0:
  flag=1
  
print('Possible' if flag==1 else 'Impossible')


Measured memory_bytes: 2940
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  int k, s;
  readf("%s %s\n", &k, &s);

  long res;

  foreach (x; 0..k+1) {
    foreach (y; 0..k+1) {
      auto z = s - x - y;
      if (z > k || z < 0) continue;
      if (x + y + z == s) {
        res++;
      }
    }
  }

  res.writeln;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int p[300010];
int val[2];
bool check(int l,int r)
{
	if(p[l]==l)l++;
	if(p[r]==r)r--;
	if(l>r)return true;
	val[0]=val[1]=0;
	for(int i=l;i<=r;i+=2)
	{
		if(p[i]<l||p[i]>r)return false;
		int x=p[i]>i;
		if(val[x]>p[i])return false;
		val[x]=p[i];
	}
	return true;
}
int main()
{
	int n;scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&p[i]);
	int lst=1;
	for(int i=1;i<=n;i++)
	{
		if((p[i]==i)^(p[i+1]==i+1))
			continue;
		if(!check(lst,i)){
			printf("No\n");
			return 0;
		}
		lst=i+1;
	}
	if(!check(lst,n)){
		printf("No\n");
		return 0;
	}
	printf("Yes\n");
	return 0;
}


Measured memory_bytes: 1536
#include <stdio.h>

int main(void)
{
	int n, b, i;
	int satisfaction = 0;
	int a[20], c[50];

	scanf("%d", &n);

	//食べた料理を配列aに代入
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}

	//満足度の合計を求める
	for (i = 0; i < n; i++) {
		scanf("%d", &b);
		satisfaction = satisfaction + b;
	}

	//追加の満足度を代入
	for (i = 0; i < n - 1; i++) {
		scanf("%d", &c[i]);
	}

	//料理iを食べたあとに料理i+1を食べた場合に追加の満足度を得る
	for (i = 0; i < n - 1; i++) {
		if (a[i] + 1 == a[i + 1]) {
			satisfaction = satisfaction + c[a[i] - 1]; 
		}
	}

	//満足度の合計を出力
	printf("%d\n", satisfaction);

	return 0;
}

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

typedef long long ll;

int main() {
    int N, A = 0, B = 0;
    cin >> N;
    vector<int> a(N);
    rep(i, N) cin >> a[i];
    sort(a.begin(), a.end());
    rep(i, N) {
        if (i % 2) B += a[N - 1 - i];
        else A += a[N - 1 - i];
    }
    cout << A - B << "\n";
}

Measured memory_bytes: 256
A = list()
A.append(list(map(int,input().split())))
A.append(list(map(int,input().split())))
A.append(list(map(int,input().split())))

N = int(input())
B = [0]*101

for i in range(N):
  b = int(input())
  B[b] = 1

bingo = 'No'

for j in range(3):
  t = 0
  y = 0
  for i in range(3):
    y += B[A[i][j]]
    t += B[A[j][i]]
  if y == 3 or t == 3:
    bingo = 'Yes'

# naname
if (B[A[0][0]] + B[A[1][1]] + B[A[2][2]] == 3) or (B[A[2][0]] + B[A[1][1]] + B[A[0][2]] == 3):
    bingo = 'Yes'

print(bingo)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a.at(i);
  int ans = 0;
  rep(i, n){
    if(i % 2 == 0 && a.at(i)% 2 == 1) ans++;
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;

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

  vector<int> ac(n, 0), wa(n, 0);
  
  for(int i = 0; i < m; i++){
    int p;
    string s;
    cin >> p >> s;
    if(s == "WA"){
      if(!ac[p - 1]) wa[p - 1]++;
    }else{
      ac[p - 1] = 1;
    }
  }

  int ans[2] = {0, 0};
  for(int i = 0; i < n; i++){
    ans[0] += ac[i];
    if(ac[i]) ans[1] += wa[i];
  }

  cout << ans[0] << " " << ans[1] << endl;
}

Measured memory_bytes: 1024
n = int(input())
h = list(map(int, input().split()))
a = 1
m = h[0]
# 西から最も高い場所にある旅館であれば、海を眺めることが出来る。
for i in range(1, n):
    m = max(h[i-1], m)
    if m <= h[i]:
        a += 1
print(a)


Measured memory_bytes: 9120
N=int(input())
A=[int(x)for x in input().split()]
B=[]
p = 10 ** 9 + 7
if N%2==0:
    B= sorted([2*i-1 for i in range(1,N//2+1)]*2)
    if sorted(A)==B:
        ans=(pow(2,int(N/2)))%(10 ** 9 + 7)
    else:
        ans=0
else:
    B= [0]+sorted([2*i for i in range(1,N//2+1)]*2)
    if sorted(A)==B:
        ans=(pow(2,int(N/2)))%(10 ** 9 + 7)
    else:
        ans=0
print(int(ans))
 


Measured memory_bytes: 13880
#include<bits/stdc++.h>
using namespace std;
int f(int x)
{
    int c=0;
    while(x){
        x/=10;
        c++;
    }
    return c;
}
int main ()
{
    int n,ans=0;
    cin >> n;
    for(int i=1;i<=n;i++){
        if(f(i)%2)ans++;
    }
    cout<<ans;
    return 0;
}


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

int main(){
  int A,B,C,N;
  
  std::cin>>A>>B>>C;
  std::cin>>N;
  
	if(A>=B&&A>=C){
		std::cout<<A*std::pow(2,N)+B+C<<std::endl;
    }else if(B>=A&&B>=C){
		std::cout<<B*std::pow(2,N)+C+A<<std::endl;
    }else if(C>=B&&C>=A){
      		std::cout<<C*std::pow(2,N)+A+B<<std::endl;
    }
}


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

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray();

            var front = new List<int>();
            var back = new List<int>();
            for(var i = 1; i <= n; i++){
                if(i % 2 != 0){
                    front.Add(a[i - 1]);
                }else{
                    back.Add(a[i - 1]);
                }
            }

            if(n % 2 != 0){
                front.Reverse();
                var s = front.Concat(back);
                Console.WriteLine(string.Join(" ", s.Select(i => i.ToString())));
            }else{
                back.Reverse();
                var s = back.Concat(front);
                Console.WriteLine(string.Join(" ", s.Select(i => i.ToString())));
            }
        }
    }
}


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

int main(void)
{
	int oi,len;

	while(cin >> oi, oi){
		cin >> len;

	string ioi,instr;
	ioi += "IOI";
	oi -= 1;
	for(int i = 0; i < oi; i++)
		ioi += "OI";

	cin >> instr;

	int c = 0;
	//cout << ioi << endl;
	for(int i = ioi.length()-1; i < instr.length(); i++){
		if( instr.substr(i-ioi.length()+1,ioi.length()) == ioi)
			c++;
	}
	cout << c << endl;
	}

	return 0;
}

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

int main() {
	ll N;
	cin >> N;
	vector<ll> X(N);
	vector<ll> Y(N);
	vector<ll> h(N);
	for (int i = 0; i < N; ++i) {
		cin >> X[i] >> Y[i] >> h[i];
	}

	if (N == 1) {
		cout << X[0] << " " << Y[0] << " " << h[0] << endl;
		return 0;
	}

	for (ll x = 0; x <= 100; ++x) {
		for (ll y = 0; y <= 100; ++y) {
			ll H = -1;
			bool ok = true;
			for (int n = 0; n < N; ++n) {
				if (h[n] == 0) { continue; }

				if (H < 0) {
					H = h[n] + abs(x - X[n]) + abs(y - Y[n]);
					continue;
				}

				ll tmp = h[n] + abs(x - X[n]) + abs(y - Y[n]);
				if (tmp != H) { ok = false; }
			}

			if (ok && (H >= 1)) {
				bool ok2 = true;
				for (int n = 0; n < N; ++n) {
					ll tmp = max(H - abs(X[n] - x) - abs(Y[n] - y), 0LL);
					if (tmp != h[n]) { ok2 = false; }
				}

				if (ok2) {
					cout << x << " " << y << " " << H << endl;
					return 0;
				}
			}
		}
	}

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define INF 100000000000000000
#define modulo 1000000007
#define mod 998244353
#define int long long int
using namespace std;


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

	
	long double l;
	cin >> l;
	l = l / 3;
	l = l * l * l;
	cout <<setprecision(30)<<fixed<< l;
	
}

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

int main()
{
    int64_t n, a, b;
    std::cin >> n >> a >> b;

    auto full_groups = n / (a + b);
    auto total = full_groups * a;

    auto left = n - full_groups * (a + b);
    total += std::min(a, left % (a + b));

    std::cout << total << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdio>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef pair<ll,ll> P;
int c,n,ans,s;
int p[2005][2005];
bool v[1005][1005];
int main(void){
    cin>>c>>n;
    for(int i=0;i<n;i++){
        char f[1005];
        cin>>f;
        for(int j=0;j<n;j++)if(f[j]=='1')p[i][j]=1;
    }
    for(int i=0;i<n/2;i++){
        for(int j=0;j<n/2;j++){
            int x=n-1-i,y=n-1-j;
            if(p[i][j]==p[x][j]&&p[x][j]==p[i][y]&&p[i][y]==p[x][y])v[i][j]=true;
            if(!v[i][j])ans++;
        }
    }
    if(ans==0)s++;
    c--;
    while(c){
        int d;
        cin>>d;
        for(int i=0;i<d;i++){
            int x,y,z,w;
            cin>>x>>y;
            x--;y--;
            z=n-1-x;
            w=n-1-y;
            p[x][y]=(p[x][y]+1)%2;
            bool q=false;
            if(p[x][y]==p[x][w]&&p[x][w]==p[z][y]&&p[z][y]==p[z][w])q=true;
            bool u=v[min(x,z)][min(y,w)];
            if(u&&!q)ans++;
            if(!u&&q)ans--;
            v[min(x,z)][min(y,w)]=q;
        }
        if(ans==0)s++;
        c--;
    }
    cout<<s<<endl;
}


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

int main()
{
	int N;
	scanf("%d", &N);
	
	int maximum;
	scanf("%d", &maximum);
	
	long long ans = 0;
	for(int i = 1; i < N; i++)
	{
		int person;
		scanf("%d", &person);
		
		if(person >= maximum)
			maximum = person;
			
		else
			ans += maximum - person;
	}
	
	printf("%lld", ans);
}


Measured memory_bytes: 3696
#include<bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define umax(x,y) x=max(x,y)
#define umin(x,y) x=min(x,y)
#define ll long long 
#define ii pair<int,int>
#define iii pair<int,ii>
#define iiii pair<ii,ii>
#define sz(x) ((int) x.size())
#define orta ((bas+son)/2)
#define all(x) x.begin(),x.end()
#define pw(x) (1<<(x))
#define inf 1000000005
#define MOD 1000000007 
#define N 100005
#define M 1000003
#define LOG 19
#define KOK 250
#define EPS 0.0000001
using namespace std;

int c[N],val[N];
int n,ptr;
vector<int> v[N];
ll sum;

void dfs(int node,int ata) {

	val[node]=c[++ptr];

	for(int i:v[node]) {

		if(i==ata) continue ;

		dfs(i,node);

	}

}

int main() {

	scanf("%d",&n);

	for(int i=1;i<n;i++) {

		int x,y;

		scanf("%d %d",&x,&y);

		v[x].pb(y);
		v[y].pb(x);

	}

	for(int i=1;i<=n;i++) {

		scanf("%d",&c[i]);

		sum+=c[i];

	}

	sort(c+1,c+1+n,greater<int>());

	sum-=c[1];

	dfs(1,0);

	printf("%lld\n",sum);

	for(int i=1;i<=n;i++) printf("%d ",val[i]);
}

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

int main()
{
  int r,g,b,ans; cin >>r >>g >>b;
  if((r*100+g*10+b) % 4 == 0) cout << "YES" << endl;
  else cout <<"NO" <<endl;
  return 0;
}

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

typedef long long int ll;
typedef long double ld;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define mod 1000000007
#define lp(start,end) for(ll i=start;i<=end;i++) 
#define deb1(a) cout<<#a<<" = "<<(a)<<endl;
#define deb2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define deb3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;


ll modu(ll a, ll b)
{
	ll ans =1;
	while(b>0)
	{
		if(b&1)
		ans = (ans*a)%mod;
		b/=2;
		a = (a*a)%mod;
	}
	return ans;
}

int main()
{
	fastio
	ll n;
	cin >> n;
	ll ac=0;
	ll wa =0;
	ll tle=0;
	ll re =0;
	while(n--)
	{
		string s;
		cin >> s;
		if(s[0]=='A')
		{
			ac++;
		}
		else if(s[0]=='W')
		{
			wa++;
		}
		else if(s[0]=='T')
		{
			tle++;

		}
		else
		{
			re++;
		}

	}
	cout << "AC x " << ac << endl;
	cout << "WA x " << wa << endl;
	cout << "TLE x " << tle << endl;
	cout << "RE x " << re << endl;
	return 0;	
}


Measured memory_bytes: 3656
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<int,int> P;
int const INF=1001001001;
ll const LINF=1001001001001001001;
ll const MOD=1000000007;

ll mpow(ll x,ll n){
    if(n==0) return 1;
    else if(n%2) return x*mpow(x,n-1)%MOD;
    return mpow(x*x%MOD,n/2)%MOD;
}

ll mfrac(ll n){
    if(n==0) return 1;
    else return n*mfrac(n-1)%MOD;
}

ll mperm(ll n,ll r){
    ll res=1;
    for(ll i=0;i<r;i++) res=res*(n-i)%MOD;
    return res;
}

ll mcomb(ll n,ll r){
    if(r>n-r) r=n-r;
    ll res=mperm(n,r);
    return res*mpow(mfrac(r),MOD-2)%MOD;
}

ll N;

int main(){
    cin>>N;

    if(N==1){
        cout<<0<<endl;
        return 0;
    }

    ll ans=mpow(10,N)-2*mpow(9,N)+mpow(8,N);
    ans+=2*MOD;
    ans%=MOD;

    cout<<ans<<endl;
}

Measured memory_bytes: 3632
import java.util.Scanner;
//import java.util.Arrays;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		//
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		System.out.println(Math.abs(a-c) <= d || (Math.abs(a-b) <= d && Math.abs(b-c) <= d) ? "Yes" : "No");
	}
}


Measured memory_bytes: 35804
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

int main(){
    ll n,m;
    cin>>n>>m;
    ll a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]/=2;
    }
    ll lcm_=1;
    set<int> st;
    for(int i=0;i<n;i++){
        lcm_=lcm_/__gcd(lcm_,a[i])*a[i];
        if(lcm_>m){
            cout<<0<<endl;
            return 0;
        }
        ll t=a[i];
        ll cnt=0;
        while(t%2==0){
            t/=2;
            cnt++;
        }
        st.insert(cnt);
    }
    if(st.size()!=1){
        cout<<0<<endl;
        return 0;
    }
    ll ans=(m/lcm_+1)/2;
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    vec p(a),q(b),r(c);
    rep(i,a) cin>>p[i];
    rep(i,b) cin>>q[i];
    rep(i,c) cin>>r[i];
    sort(rall(p));
    sort(rall(q));
    sort(rall(r));
    int sumx=0;
    int sumy=0;
    PQIG xx,yy;
    rep(i,x){
        xx.push(p[i]);
        sumx+=p[i];
    }
    rep(i,y){
        yy.push(q[i]);
        sumy+=q[i];
    }
    rep(i,c){
        int xm=xx.top();
        int ym=yy.top();
        int mini=min(xm,ym);
        if(r[i]>mini){
            if(xm>=ym){
                sumy-=ym;
                sumy+=r[i];
                yy.pop();
                yy.push(r[i]);
            }
            else{
                sumx-=xm;
                sumx+=r[i];
                xx.pop();
                xx.push(r[i]);
            }
        }
        else{
            break;
        }
    }
    cout<<sumx+sumy<<endl;
    
}

Measured memory_bytes: 4852
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
int getval(const vl& v) {
  vl tmp = v;
  vl next_tmp;
  vl sorter(3);
  while (tmp.size() > 1) {
    next_tmp.clear();
    rep(i, tmp.size() - 2) {
      rep(k, 3) { sorter[k] = tmp[i + k]; }
      sort(ALL(sorter));
      next_tmp.emplace_back(sorter[1]);
    }
    tmp = next_tmp;
  }
  return tmp[1];
}
int main() {
  //
  ll n, x;
  cin >> n >> x;
  if (x == 1 || x == 2 * n - 1) {
    cout << "No" << endl;
    return 0;
  }
  vl ans(2 * n - 1, -1);
  ans[n - 1] = x;
  ans[n - 2] = 1;
  ans[n] = 2 * n - 1;
  int idx = 0;
  for (int val = 2; val < 2 * n - 1; val++) {
    if (val == x) continue;
    while (ans[idx] != -1) idx++;
    ans[idx] = val;
  }
  cout << "Yes" << endl;
  // cout << getval(ans) << endl;
  for (auto& x : ans) cout << x << endl;
  return 0;
}


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

int main(){
  ll n; cin >> n;
  ll ans = 0;
  for(ll i = 1; i <= n; i++){
    ll a = n / i, b = n % i;
    //cout << n / i << " " << n % i << endl;
    if(a > b) continue;
    i += b / a;
    if(b % a == 0) ans += i - 1;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3600
n = int(input())
h = list(map(int,input().split()))

ans = 0
f = [0] * n
while True:
    flg = 0
    for i, ff in enumerate(f):

        if ff < h[i]:
            f[i] += 1
            flg = 1
            if i == n-1:
                ans += 1
        else:
            if flg == 1:
                ans += 1
                flg = 0

    if f == h:
        print(ans)
        break


Measured memory_bytes: 3060
/*------------------------------------------------,
|  __                                       __    |
| |  |--.-----.---.-.----.----.-----.-----.|  |_  |
| |  _  |  -__|  _  |  __|  __|  -__|  _  ||   _| |
| |_____|_____|___._|____|____|_____|   __||____| |
|                                   |__|          |
`------------------------------------------------*/
#include<algorithm>
#include<array>
#include<bitset>
#include<cmath>
#include<complex>
#include<cstdint>
#include<deque>
#include<functional>
#include<iomanip>
#include<ios>
#include<iostream>
#include<iterator>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
typedef long long ll; using namespace std;
#define INF 2147483647
#define MOD 10000007
#define REP(counter, limit) for (long long counter = 0; counter < limit; counter++)
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }
int lcm(int a, int b) { return a * b / gcd(a, b); }
bool primenum(int a) { if (a == 1) { return false; }if (a == 2) { return true; }if (a % 2 == 0) { return false; }for (int i = 3; i < sqrt(a) + 1; i += 2) { if (a != i) { if (a % i == 0) { return false; } } }return true; }
struct setupios{setupios(){cin.tie(0);ios::sync_with_stdio(0); /*cout<<fixed<<setprecision(20);*/};}setupios;
int main() {
  int x,y;
  cin>>x>>y;
  REP(i,100){
    REP(j,100){
      if(i+j==x and i*2+j*4==y){
        cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;
}


Measured memory_bytes: 3128
import sys
input = sys.stdin.readline

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
sys.setrecursionlimit(2000)
N = int(input().rstrip('\n'))
res = 0
if N>=3:
  en = N//3
  for i in range(en):
    if i == 0:
      res += 1
    else:
      x = N-2*(i+1)-1
      a = cmb(x,i)
      res += a
      if res > 1000000007:
        res = res%1000000007
print(res)
      

Measured memory_bytes: 161716
IDENTIFICATION DIVISION.
        PROGRAM-ID. AtCoder.
      
        ENVIRONMENT DIVISION.
      
        DATA DIVISION.
        WORKING-STORAGE SECTION.
        01 INP PIC X(100).
        01 A PIC 9(05)V9(15).
        01 B PIC 9(05)V9(15).
      	01 C PIC 9(05)V9(15).
      	01 E PIC 9(05)V9(15).
      	01 D PIC ZZZZ9.9(15).
      	01 X PIC 9(15).
      	01 Y PIC 9(15).
      	01 W PIC 9(15).
      	01 F PIC 9(10).
      	01 t PIC 9(15).
	    01 temp1 PIC 9(15).
        01 temp2 PIC 9(15).
      	01 temp3 PIC 9(15).
        01 N PIC 9(15).
        PROCEDURE DIVISION.
      	MAIN.
      		ACCEPT INP.
			PERFORM VARYING temp1 FROM 1 BY 1
            UNTIL INP(temp1:1) = SPACE
        	END-PERFORM.
        	SUBTRACT 1 FROM temp1.
        	MOVE INP(1:temp1) TO X.
        	ADD 2 TO temp1.
        	PERFORM VARYING temp2 FROM temp1 BY 1
            UNTIL INP(temp2:1) = SPACE
        	END-PERFORM.
        	COMPUTE N = temp2 - temp1.
        	MOVE INP(temp1:N) TO Y.
      		ADD 1 TO temp2.
      		PERFORM VARYING temp3 FROM temp2 BY 1
            UNTIL INP(temp3:1) = SPACE
        	END-PERFORM.
        	COMPUTE N = temp3 - temp2.
        	MOVE INP(temp2:N) TO W.
      		IF X + Y + W >= 22 THEN
      			DISPLAY "bust"
      		ELSE
      			DISPLAY "win"
      		END-IF.
		STOP RUN.

Measured memory_bytes: 1020
#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<int, int>;
vector<bool> sieve(1000010, false);
int main() {
    int n, r = 0;
    cin >> n;
    if (n == 1) return cout << 1, 0;
    vector<int> a(n);
    for (int& i : a) cin >> i;
    sort(a.begin(), a.end());
    if (a[1] == 1) return cout << 0, 0;
    if (a[0] == 1) return cout << 1, 0;
    for (int i = 0; i < n; ++i) {
        if (sieve[a[i]] == false) {
            for (int j = a[i]; j <= 1000000; j += a[i]) sieve[j] = true;
            if (i >= n - 1 || a[i] != a[i + 1]) ++r;
        }
    }
    cout << r;
    return 0;
}


Measured memory_bytes: 4304
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define mod 1000000007
#define INF 1e9+100
#define pair<int,int> pii
#define ff first
#define ss second
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define FOR(i,n) for(i=0;i<n;i++)
#define REP(i,n) for(i=1;i<=n;i++)
#define pb push_back
main()
{
	int n,i,j,k;
	cin>>n;
	map<string,int>s;
	string x;
	int mx=-1;
	while(n--)
	{
		cin>>x;
		s[x]++;
		mx=max(mx,s[x]);
	}
	for(auto it : s)
	{
		if(mx==(it).ss) cout<<(it).ff<<endl;
	}
}


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

using namespace std;

typedef long long ll;

int vp(int n) {
  int ans = 0;
  n /= 2;
  while (n) {
    ans += n;
    n /= 2;
  }
  return ans;
}

int vpn(int n, int k) {
  return vp(n) - vp(k) - vp(n - k);
}


int e(int n, int i) {
  if (vpn(n - 1, i - 1)) {
    return 0;
  } else {
    return 1;
  }
}

vector<int> step(vector<int> v) {
  vector<int> a;
  for (int i = 0; i + 1 < (int) v.size(); i++) {
    a.push_back(abs(v[i] - v[i + 1]));
  }
  return a;
}

int g(vector<int> v) {
  v = step(v);
  int f[3];
  f[0] = f[1] = f[2] = 0;
  for (auto &x : v) {
    f[x]++;
  }
  if (f[1] == 0 || f[2] == 0) {
    int n = (int) v.size();
    int sol = 0;
    for (int i = 1; i <= n; i++) {
      if (e(n, i)) {
        sol ^= v[i - 1];
      }
    }
    return sol;
  }
  return g(step(v));
}


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

  int n;
  string s;
  cin >> n >> s;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
  }
  cout << g(a) << "\n";

}


Measured memory_bytes: 161320
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
M = list(map(int, input().split()))
ans = set()
for i in range(1, (1 << N)):
    tmp = 0
    for j in range(0, N):
        if (i >> j) & 1:
            tmp += A[j]
    ans.add(tmp)
for m in M:
    if m in ans:
        print('yes')
    else:
        print('no')



Measured memory_bytes: 5652
from collections import deque
n,m=map(int,input().split())
l=[[0] for _ in range(n+1)]
vi=[0 for _ in range(n+1)]
vi[1]=-1

for i in range (m):
  a,b=map(int,input().split())
  l[a].append(b)
  l[b].append(a)
st=deque([1])
e=set()
f=set()


while st:
    x=st.popleft()
    if x not in e:
      e.add(x)
      for k in l[x]:
        if k not in f:
          st.append(k)
          f.add(k)
          vi[k]=x   
  
print("Yes")
for m in vi[2:]:
  print(m)
  
  

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

int main(){
	int five = 0,seven = 0,tmp;
	for(int i = 0;i < 3;i++){
		cin >> tmp;
		if(tmp == 5) five++;
		if(tmp == 7) seven++;
	}
	cout << (five == 2 && seven == 1 ? "YES" : "NO") << endl;
}

Measured memory_bytes: 256
import math
from decimal import *
getcontext().prec = 500
x = list(map(Decimal, input().split())) 
a = Decimal(x[0]).sqrt()
b = Decimal(x[1]).sqrt()
c = Decimal(x[2]).sqrt()

if a + b < c:
	print("Yes")
else:
	print("No")



Measured memory_bytes: 5076