akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define All(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()   //reverse
#define strall(v) (v).cbegin(),(v).cend() //const_itterator
#define IN(a, b, x) (a<=x&&x<b)
using namespace std;
using ll = long long;
using Pair = pair<int,int>;
using Graph = vector<vector<ll>>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename t, typename u, typename Comp=less<>>
bool chmax(t& xmax, const u& x, Comp comp={}) { if(comp(xmax, x)) { xmax = x; return true; } return false;}
template<typename t, typename u, typename Comp=less<>>
bool chmin(t& xmin, const u& x, Comp comp={}) { if(comp(x, xmin)) { xmin = x; return true;} return false;}
const int INF = 1e9;
const ll infl = ll(1e18)+5;

/*
*ios::sync_with_stdio(false);
*cin.tie(0);
*/
int main(){
  int H,W;
  cin >> H >> W;
  vector<string> vec(H);
  rep(i,H) cin >> vec[i];
  for(int i= -1;i<=H;i++){
    if(i == -1 || i == H){
      rep(i,W+2) cout << '#';
      cout << "\n";
      continue;
    }
    cout << '#' << vec[i] << "#\n";
  }
}

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

#define REP(i,n) for(int i=0; i<n; i++)

int calc(int a, int b, int x, int d)
{
	int tmp=d+a*x;
	if(tmp<0) return -1;
	
	return (tmp%b==0?tmp/b:-1);
}

pair<int, int> check(int a, int b, int x, int y, pair<int, int> tmp)
{
	if(tmp.first+tmp.second > x+y) return make_pair(x,y);
	if(a*tmp.first+b*tmp.second > a*x+b*y) return make_pair(x,y);

	return tmp;
}

int main()
{
	int a,b,d;
	while(scanf("%d%d%d", &a,&b,&d), (a||b||d))
	{
		pair<int, int> ret(100000000,100000000);
		REP(i,50001)
		{
			int tmp;
			tmp = calc(a,b,i,d);		if(tmp!=-1) ret=check(a,b,i,tmp,ret);
			tmp = calc(-a,b,i,d);	if(tmp!=-1) ret=check(a,b,i,tmp,ret);
			tmp = calc(-a,b,i,-d);	if(tmp!=-1) ret=check(a,b,i,tmp,ret);
			tmp = calc(a,b,i,-d);	if(tmp!=-1) ret=check(a,b,i,tmp,ret);
		}

		printf("%d %d\n", ret.first, ret.second);
	}
}

Measured memory_bytes: 756
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int N, sum; cin >> N; sum = 0;
    for (int i = 1; i <= N; i++) sum += i;
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
int gcd(int a, int b)
{
  if(a < b){
    int tmp = a; a = b; b = tmp;
  }
  if(a % b == 0) return b;
  else return gcd(b, a % b);
}
int main(void)
{
  int N, X, x[100000];
  int ans;
  std::cin >> N >> X;
  for(int i = 0; i != N; i++){
    std::cin >> x[i];
    x[i] = std::abs(x[i] - X);
    if(i == 0) ans = x[0];
    else ans = gcd(ans, x[i]);
  }
  std::cout << ans << std::endl;
  return 0;
}

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

#define NREP() for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<string> vvs;

const static ll MOD = 1e9 + 7;

int main(int argc, char *argv[]) {
    ll n;
    cin >> n;

    vi p, q, model;

    NREP() {
        model.push_back(i + 1);
    }

    NREP() {
        ll tmp;
        cin >> tmp;
        p.push_back(tmp);
    }

    NREP() {
        ll tmp;
        cin >> tmp;
        q.push_back(tmp);
    }

    ll ip, iq;
    ll idx = 0;
    do {
        if (model == p) {
            ip = idx;
        }
        if (model == q) {
            iq = idx;
        }
        idx++;
    } while (next_permutation(ALL(model)));

    MSG(abs(ip - iq))
}


Measured memory_bytes: 256
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	}
}

Measured memory_bytes: 22604
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define endl '\n'

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

const std::string ans[3] = { "Sunny", "Cloudy", "Rainy" };

std::string S;

int main() {
  std::cin >> S;

  ll idx = -1;

  rep( i, 3 ) if( ans[i] == S ) {
    idx = i;
    break;
  }

  std::cout << ans[(idx+1)%3] << endl;

  return 0;
}

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

using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================


template <class T, class Op>
class SegmentTree {
private:
    const Op op;
    const T ID;
    std::vector<T> vec;
    int sz;

public:
    explicit SegmentTree(int _n, Op _op, T _identity) noexcept
        : op(_op), ID(_identity) {
        sz = 1;
        while (sz < _n) sz <<= 1;
        vec.resize(sz * 2, ID);
    }
    explicit SegmentTree(const std::vector<T>& _vec, Op _op, T _identity) noexcept
        : op(_op), ID(_identity) {
        int n = _vec.size();
        sz = 1;
        while (sz < n) sz <<= 1;
        vec.resize(sz * 2, ID);
        set_array(_vec);
    }
    void set_value(int _idx, T _val) noexcept {
        vec[_idx + sz] = _val;
    }
    template <class RandomIt>
    void set_array(RandomIt _begin, RandomIt _end) noexcept {
        std::copy(_begin, _end, vec.begin() + sz);
    }
    void set_array(const std::vector<T>& _newvec) noexcept {
        set_array(_newvec.begin(), _newvec.end());
    }
    void build() noexcept {
        for (int i = sz - 1; i > 0; i--) {
            vec[i] = op(vec[i * 2], vec[i * 2 + 1]);
        }
    }
    void update(int _idx, T _val) noexcept {
        _idx += sz;
        vec[_idx] = _val;
        for (_idx >>= 1; _idx > 0; _idx >>= 1) {
            vec[_idx] = op(vec[_idx * 2], vec[_idx * 2 + 1]);
        }
    }
    T query(int _l, int _r) const noexcept {
        T l_val = ID, r_val = ID;
        _l += sz, _r += sz - 1;
        for (; _l <= _r; _l >>= 1, _r >>= 1) {
            if (_l & 1) l_val = op(l_val, vec[_l++]);
            if (!(_r & 1)) r_val = op(r_val, vec[_r--]);
        }
        return op(l_val, r_val);
    }
    const T& operator[](int _idx) const noexcept {
        return vec[_idx + sz];
    }
};


using alph = bitset<26>;

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

    int N;
    string S;
    cin >> N >> S;
    int Q;
    cin >> Q;

    auto fun = [](alph a, alph b) { return a | b; };

    SegmentTree<alph, decltype(fun)> seg(N, fun, 0);
    for (int i = 0; i < N; i++) {
        alph al(0);
        al.set(S[i] - 'a');
        seg.set_value(i, al);
    }
    seg.build();

    for (int i = 0; i < Q; i++) {
        int q;
        cin >> q;
        if (q == 1) {
            int idx;
            char c;
            cin >> idx >> c;
            alph al(0);
            al.set(c - 'a');
            seg.update(--idx, al);
        }
        else {
            int l, r;
            cin >> l >> r;
            cout << seg.query(--l, r).count() << "\n";
        }
    }

    return 0;
}

Measured memory_bytes: 9116
#include <bits/stdc++.h>
using namespace std;
						
#define fast_cin() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
#define int long long

const int N = 1e5, mod = 1e9 + 7;

int cnt[N + 1];

int binpow(int x, int y) {
    int res = 1LL;
    x %= mod;
    while (y) {
        if (y & 1) res = (res * x) % mod;
        y >>= 1;
        x = (x * x) % mod;
    }
    return res;
}

int mod_inv(int x) {
    return binpow(x, mod - 2);
}
				
int32_t main() {
	fast_cin();  
	int n, k;
	cin >> n >> k;
	for (int gd = k; gd >= 1; gd--) {
		int total = binpow(k / gd, n);
		int less = 0;
		for (int j = 2 * gd; j <= k; j += gd) {
			less +=  cnt[j];
			less %= mod;
		}
		cnt[gd] = total - less;
		cnt[gd] += mod;
		cnt[gd] %= mod;
	}
	int ans = 0;
	for (int gd = 1; gd <= k; gd++) {
		ans += gd * cnt[gd];
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4372
/****************************
    > File Name: c.cpp
    > Author: caoyu01
  	> Mail: yalecyu@gmail.com 
    > Created Time: 2016年10月15日 星期六 20时15分53秒
*****************************/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define cle(x) memset(x,0,sizeof(x))
#define rep(i,x) for(int i=0;i<x;i++)
#define Rep(i,x) for(int i=1;i<=x;i++)
const int N = 1000+10;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
int n;
ll t[N],a[N];
int main()
{
#ifndef ONLINE_JUDGE
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
#endif
	while(cin>>n){
		rep(i,n)cin>>t[i]>>a[i];
		ll mi=t[0],ma=a[0];
		Rep(i,n-1){
			ll l=1LL;
			ll r=1e18/max(t[i],a[i]);
			r++;
			ll tm;
			while(l<=r){
				ll mid=(l+r)>>1;
				if(t[i]*mid>=mi&&a[i]*mid>=ma){
					r=mid-1;
					tm=mid;
				}
				else l=mid+1;
			}
			mi=t[i]*tm;
			ma=a[i]*tm;
		}
		cout<<mi+ma<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
Set<Integer> num=new HashSet<>();
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int k=Integer.parseInt(sc.next());
for(int i=a;i<a+k&&i<=b;i++){num.add(i);}
for(int i=b;i>b-k&&i>=a;i--){num.add(i);}
Integer[] m=num.toArray(new Integer[0]);
Arrays.sort(m);
for(int i:m){System.out.println(i);}
}}

Measured memory_bytes: 21844
import java.util.*;

public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String args[]) {
        int N = sc.nextInt();
        int[] L = new int[N];
        for (int i = 0; i < N; i++) {
            L[i] = sc.nextInt();
        }
        Arrays.sort(L);
        int ans = 0;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                int l = j, r = N;
                while(r - l > 1) {
                    int m = (l + r) / 2;
                    if(L[m] < L[i] + L[j]) l = m;
                    else r = m;
                }
                ans += l - j;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 26584
#include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    typedef long double ld;
    typedef unsigned long long ull;
    typedef vector<int> vi;
    typedef vector<long long> vll;
    typedef pair<ll,ll> pll;
     
    const ll mod = 1e9 + 7;
    const ld PI = 3.1415926535897932384626;
    const ld eps = 1e-9;                            
     
    #define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define sidha(i,a,b) for(ll i=(ll)(a);i<(ll)(b);++i)
    #define ulta(i,a,b) for(ll i=(ll)(a);i>=(ll)(b);--i)
    #define stl(container,itr) \
        for(auto itr = container.begin(); itr != container.end(); itr++)
    #define sab(v) v.begin(), v.end()
    #define rall(v) v.rbegin(), v.rend()            
    #define test ll t;cin>>t;while(t--)
    #define sz size()
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define LOG2(X) (63ll - __builtin_clzll(X))
    #define endl '\n'
    #define modinv(x) power(x, mod-2)
    #define MAX 100005
     
    ll power(ll x, ll y) { 
        ll ans=1;
        x=x%mod;
        while(y>0) { 
            if (y&1) 
                ans=(ans*x)%mod; 
            y=y>>1;
            x=(x*x)%mod; 
        } 
        return ans; 
    }
    
    // vector<ll> arr[MAX];
    // ll visit[MAX];
    // void dfs(ll n){
    //     visit[n]=1;
    //     for(ll i=0;i<arr[n].size();++i){
    //         if(visit[arr[n][i]]==0) dfs(arr[n][i]);
    //     }
    // }
    
    // ll spf[MAX];
    // void sieve(){
    //     sidha(i,1,MAX)  spf[i]=i;
    //     for(ll i=4;i<MAX;i+=2)  spf[i]=2;
    //     for(ll i=3;i*i<=MAX;i++){
    //         if(spf[i]==i){
    //             for(ll j=i*i;j<MAX;j+=i){
    //                 if(spf[j]==j)   spf[j]=i;
    //             }
    //         }
    //     }
    // }

    int main()
    {
        boost;
        string s;
        cin>>s;
        ll maxx=0,cur=0;
        sidha(i,0,s.sz){
            if(s[i]=='S')   cur=0;
            else{
                cur++;
                maxx=max(maxx,cur);
            }
        }
        cout<<maxx;
        return 0;
    }
    

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MODADD(ADD_X,ADD_Y)  (ADD_X+ADD_Y)%MOD;
#define MODSUB(SUB_X,SUB_Y)  (SUB_X-SUB_Y)+MOD)%MOD;
#define MODMUL(MUL_X,MUL_Y)  (MUL_X*MUL_Y)%MOD;
#define LCM(LCM_X,LCM_Y) (LCM_X*LCM_Y)/__gcd(LCM_X,LCM_Y);
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
int dx[]= {1,0,-1,0,1,-1,1,-1};
int dy[]= {0,1,0,-1,1,-1,-1,1};
vector<int>v[20];
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    ll l,r;
    cin>>l>>r;
    ll mn=INT_MAX;
   r=min(l+2001,r);
    for(ll i=l; i<=r; i++)
    {
        for(int j=i+1; j<=r; j++)
        {
            ll cur=i*(j);
            cur%=2019;
            mn=min(mn,cur);
        }
    }
    cout<<mn<<endl;


    return 0;
}


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

int main() {
  int N; cin >> N;
  vector<int> A(N), B(N), C(N);
  for(int i = 0; i < N; ++i) cin >> A[i], A[i]--;
  for(int i = 0; i < N; ++i) cin >> B[i];
  for(int i = 0; i < N-1; ++i) cin >> C[i];
  int ans = 0;
  for(int i = 0; i < N; ++i) {
    ans += B[A[i]];
    if(A[i]+1 == A[i+1]) ans += C[A[i]];
  }
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>

using namespace std;
typedef long long ll;
ll N;

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

    ll K;
    vector<vector <ll > > balb;
    for(ll i = 0; i < M; i++){
        cin >> K;
        vector<ll > s(K);
        for(ll j = 0; j < K; j++){
            cin >> s[j];
        }
        balb.push_back(s);
        /*
        for(ll j = 0; j < balb[i].size(); j++){
            cout << balb[i][j] << ",";
        }
        cout << endl;
        */
    }

    vector<ll > P(M, 0);
    for(ll i = 0; i < M; i++){
        cin >> P[i];
    }

    //bit全探査
    ll sum = 0;
    for(ll bit = 0; bit < (1<<N); ++bit){
        //電球ごとに点灯するかチェック
        bool check = true;
        for(ll i = 0; i < M; i++){
            ll count = 0;
            for(ll j = 0; j < balb[i].size(); j++){
                //どのスイッチがONになっていて何個ONになっているか確認
                //cout <<balb[i][j] << endl;
                //つじつまをあわせるために-1する
                if(bit & (1<<balb[i][j]-1)){
                    count++;
                   
                }
            }
            //P次第で，偶数または奇数の場合光るかどうかを判断する
            if(count % 2 != P[i]){
                check = false;
            }

        }
        if(check == true){
            sum++;
        }
    }

    cout << sum << endl;

} 

Measured memory_bytes: 256
// Code Forces
#include<bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define pi 3.1415926535
#define fi first
#define se second
#define vec vector
#define str string
#define FOR(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL);
#define dvec(v) vec < ll > v
#define sortA(v) sort(v.begin(),v.end())
#define sortD(v) sort(v.begin(),v.end(),greater <int> ())

using namespace std;

int main(){
    fast
    str s;
  	cin>>s;
  	if((s[2]==s[3])&&(s[4]==s[5])) cout<<"Yes";
  	else cout<<"No";
    // my code
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define lli long long int

using namespace std;

const int N = 1001;

lli func(int n, lli a[1002])
{
	if(n <= 0){
		return 1;
	}
	if(a[n] != 0){
		return a[n];
	}
	
	return a[n] = (func(n-1, a) + func(n-2, a))%N;
}

int main()
{
	int v, d, s, p;
	lli a[1001], b[1001];
	fill(a, a+1002, 0);
	
	for(int i = 0; i <= N; i++){
		a[i] = func(i, a);
	}
	
	while(cin >> v >> d){
		for(int i = 1; i <= v; i++){
			b[i-1] = a[i];
		}
		sort(b, b+v);
		s = 1;
		for(int i = 1; i < v; i++){
			if(b[i]-b[i-1] >= d){
				s++;
			}
		}
		cout << s << endl;
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  ll a, b, c;
  cin >> a >> b >> c;
  c = min(c, a + b + 1);
  cout << b + c << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1001001001
#define LINF (1LL << 62)
using namespace std;
using ll = long long;
using P = pair<int, int>;

void solv() {
    int a, b;
    cin >> a >> b;
    int min;
    int show;
    if (a >= b) {
        min = b;
        show = a;
    } else {
        min = a;
        show = b;
    }
    rep(i,show){
        cout << min;
    }
    cout << endl;

}

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

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

int main(void) {
    string S;
    cin >> S;

    bool ok[3] = {false, false, false};

    for (int i = 0; i < 3; i++) {
        char c = S[i];
        if (c == 'a') {
            ok[0] = true;
        } else if (c == 'b') {
            ok[1] = true;
        } else if (c == 'c') {
            ok[2] = true;
        }
    }

    if (ok[0] && ok[1] && ok[2]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
int N;
vector<string>ans;
void find(string s,int var,char ch)
{
	if(var==0){
	 ans.push_back(s);
	 return ;
    }
	set<char>store;
	for(int i=0; i<N-var; i++){
		store.insert(s[i]);
	}
	string t=s+ch;
	find(t,var-1,ch+1);
	for(char letter : store){
		string p=s+letter;
		find(p,var-1,ch);
	}
}
int main()
{
	cin>>N;
	string s="";
	find(s,N,'a');
//	cout<<ans.size();
	sort(ans.begin(),ans.end());
	for(int i=0; i<ans.size(); i++)
	 cout<<ans[i]<<"\n";
	return 0;
}

Measured memory_bytes: 7476
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD 1000000007
#define MOD2 998244353
#define MOD3 1000000009
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
//ifstream cinn("in.in");ofstream coutt("out.out");
int poww(const int &a,int b,const int &m=MOD){if(b==0)return 1;int x=poww(a,b/2,m);x=x*x%m;if(b&1)x=x*a%m;return x;}
int ceil(const int &a,const int &b){return (a+b-1)/b;}
////Read:
//Check corner cases, n==1;
//
////Some function:
//__builtin_popcountll(), 

int n;
int h[200005],a[200005];
int dp[200005];
int tree[4*200005];

void updatee(int s,int e,int idx,int SE,int val){
    if(s>SE || e<SE)return;
    if(s==e){
        tree[idx]=val;
        return;
    }
    int mid=(s+e)/2;
    updatee(s,mid,idx*2+1,SE,val);
    updatee(mid+1,e,idx*2+2,SE,val);
    tree[idx]=max(tree[idx*2+1],tree[idx*2+2]);
}

int gett(int s,int e,int idx,int S,int E){
    if(s>E || e<S)return 0;
    if(s>=S && e<=E)return tree[idx];
    int mid=(s+e)/2;
    return max(gett(s,mid,idx*2+1,S,E),gett(mid+1,e,idx*2+2,S,E));
}

signed main(){
    FASTER;
    cin>>n;
    int mxH=0;
    for(int i=0;i<n;i++)cin>>h[i],mxH=max(mxH,h[i]);
    for(int i=0;i<n;i++)cin>>a[i];
    
    for(int i=0;i<n;i++){
        dp[h[i]]=gett(0,mxH-1,0,0,h[i]-1)+a[i];
        updatee(0,mxH-1,0,h[i],dp[h[i]]);
    }
    
    cout<<*max_element(dp,dp+200005);
    
}

Measured memory_bytes: 12460
from collections import defaultdict
import math

n = int(input())

primes = defaultdict(int)
t = n
for i in range(2, int(math.sqrt(n)) + 1):
    while t % i == 0:
        primes[i] += 1
        t //= i
if t != 1:
    primes[t] += 1

count = 0
for cn in primes.values():
    count += int((-1 + math.sqrt(1 + 8 * cn)) / 2)

print(count)


Measured memory_bytes: 68300
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;
// ceil() 切り上げ, floor() 切り捨て
// next_permutation(all(x))

int		main(void)
{
	string S;
	cin >> S;
	for (int i = 0; i < (int)S.size(); i+=2)
		cout << S[i];
	cout << endl;
}



Measured memory_bytes: 512
package main

import "fmt"

func main() {
  var N int
  fmt.Scan(&N)
  
  cnt := 0
  for i := 1; i < N+1; i++ {
    if i % 2 == 1 {
      cnt++
    }
  }
  fmt.Println(float64(cnt) / float64(N))
}

Measured memory_bytes: 512
using System;
using System.Linq;

namespace Sample
{
  class Sample
  {
    static void Main(string[] args)
    {
    string[] str1=Console.ReadLine().Split(' ');
      int x=int.Parse(str1[0]);
      int N=int.Parse(str1[1]);
if(N!=0){
    string[] str2=Console.ReadLine().Split(' ');
      int[] str2ToInt=new int[N];
      int xp=x;
      int xm=x;
      int xpflg=0;
      int xmflg=0;
      
      for(int i=0;i<N;i++){
        str2ToInt[i]=int.Parse(str2[i]);
      }while((xpflg==0)&&(xmflg==0)){
        if(!str2ToInt.Contains(x)){
          Console.WriteLine(x);
          break;
        }
            xm--;
           if(!str2ToInt.Contains(xm)){
             xmflg=1;
             break;
           }
        xp++;
        if(!str2ToInt.Contains(xp)){
          xpflg=1;
          break;
        }
       
      }if(xmflg==1){
        Console.WriteLine(xm);
      }
  
else  if(xpflg==1){
        Console.WriteLine(xp);
      }
    
}else{
  Console.WriteLine(x);
}

           }
  }

}

Measured memory_bytes: 27844
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int const N = 1e5 + 5;
int a[N], b[N];
int n, w;
ll dp[105][N];
ll oo = (ll)0x3f3f3f3f * (ll)0x3f3f3f3f;
ll iterative_dp(){

    for(int j=0; j<=w; j++)
        dp[n][j] = 0;

    for(int i=n-1; i>=0; i--){
        for(int j=0; j<=w; j++){
            dp[i][j] = max(dp[i+1][j], (j>=a[i]?dp[i+1][j-a[i]] + b[i]:-oo));
        }
    }
    ll res = -oo;
    for(int i=0; i<=w; i++){
        res = max(res, dp[0][i]);
    }
    return res;
}

int main() {
#ifdef ONLINE_JUDGE
    ios::sync_with_stdio(false), cin.tie(0);
#endif
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    cin>>n>>w;
    for(int i=0; i<n; i++)
        cin>>a[i]>>b[i];
    cout<<iterative_dp()<<'\n';
}


Measured memory_bytes: 82444
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <random>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0)
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

lli n;
string s;

const char* c0[] = { "SS", "SW", "WS", "WW" };

char flip(char c) { return c=='S' ? 'W' : 'S'; }

bool valid(char tl, char tm, char tr, char sm) {
  bool eq = (sm=='o' && tm=='S') || (sm=='x' && tm=='W');
  return (eq && tl==tr) || (!eq && tl!=tr);
}

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

  for (lli ci=0; ci<4; ++ci) {
    string t(n, '?');
    t[0] = c0[ci][0]; t[1] = c0[ci][1];
    for (lli i=1; i<n-1; ++i) {
      if (s[i] == 'o') {
        if (t[i] == 'S') t[i+1] = t[i-1];
        else t[i+1] = flip(t[i-1]);
      } else {
        if (t[i] == 'S') t[i+1] = flip(t[i-1]);
        else t[i+1] = t[i-1];
      }
    }
    cerr << c0[ci] << "->" << t << '\n';

    bool ok = valid(t[n-2], t[n-1], t[0], s[n-1])
      && valid(t[n-1], t[0], t[1], s[0]);
    if (ok) {
      cout << t << '\n';
      return 0;
    }
  }
  cout << -1 << '\n';
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;


int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  cout << min(n*a,b) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt();
    vector <int> v(n+1);
    map <int,int> m2;
    for(int i=2;i<=n;i++){
        cin>>v[i];
        m2[v[i]]+=1;
    }
    for(int i=1;i<=n;i++)
    {
        cout<<m2[i]<<endl;

    }
   // cout<<endl;


    
    
    
    return 0;   
}




 
 


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)q

int dp[114514];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, h[114514];
	cin>>n;
	REP(i, n){
		cin>>h[i];
	}
	FOR(i, 1, n){
		dp[i]=MOD;
	}
	REP(i, n-1){
		CHMIN(dp[i+1], dp[i]+abs(h[i]-h[i+1]));
		if(i+2<n){
			CHMIN(dp[i+2], dp[i]+abs(h[i]-h[i+2]));
		}
	}
	cout<<dp[n-1]<<'\n';
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

int main(){
    ll n,k;
    cin>>n>>k;
    int a[n];
    rep(i,n){
        cin>>a[i];
        --a[i];
    }
    int dp[n][61];
    rep(i,n){
        dp[i][0]=a[i];
    }
    for(int i=1;i<=60;++i){
        rep(j,n){
            dp[j][i]=dp[dp[j][i-1]][i-1];
        }
    }
    int t=0,now=0;
    while(k>0){
        if(k&1)now=dp[now][t];
        k/=2;
        ++t;
    }
    cout<<now+1<<endl;
}


Measured memory_bytes: 52076
// Author: getharshkumar

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
const ll N = 1e6 + 6, M = 1e9 + 7;
int main()
{
    ios::sync_with_stdio(false), cin.tie(nullptr);
    ll n;
    double s, a;
    cin >> n;
    while (n--)
    {
        cin >> a;
        s += 1 / a;
    }
    cout << 1 / s;
    return 0;
}

Measured memory_bytes: 256
def dis(xi, xj, yi, yj):
    return abs(xi - xj) + abs(yi - yj)
n = int(input())
coords = [tuple(map(int, input().split())) for _ in range(n)]
grids = [(i, j) for i in range(101) for j in range(101)]
for x, y, h in coords:
    if h > 0:
        break    
for xj, yj in grids:
    flag = True
    base = dis(x, xj, y, yj) + h
    for xi, yi, hi in coords:
        if hi != max(base-abs(xi-xj)-abs(yi-yj), 0):
            flag = False
    if flag:
        break
print(xj, yj, dis(x, xj, y, yj) + h)

Measured memory_bytes: 3700
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int a[N];
int main()
{
    int n,k;
    cin>>n>>k;
    long long ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    sort(a+1,a+n+1);
    int j=n;
    while(k>0&&j>0)
    {
        a[j]=0;
        j--;
        k--;
    }
    for(int i=1;i<=n;i++)
    {
        ans+=a[i];
    }
    cout<<ans<<endl;
    //cout << "Hello world!" << endl;
    return 0;
}


Measured memory_bytes: 1024
function main(input){
  var num = 0;//来た順
  var inputA=0;
  var inputB=0;
  input = input.split(' ');
  inputA = parseInt(input[0]);
  inputB =  parseInt(input[1]);

  if(inputA <= inputB*2){
    num = 0
  }
  else if(inputA > inputB*2){
    num = inputA -inputB*2
  }

  console.log(num);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
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; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll a, b;
  cin >> a >> b;
  cout << (a+b) % 24 << endl;

  return 0;
}


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



typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define MOD 1000000007
const double PI=3.14159265358979323846;

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 (b<a) { a=b; return 1; } return 0; }

void print(const vint& v)
{
  for(auto e:v)cout<<e<<" ";
  cout<<endl;
}

int cnt[1000];

void show(vint &v){
  if(v.size()==1){
    // print(v);
    cnt[v[0]]++;
    return;
  }
  vint nxt(v.size()-2);
  rep(i,nxt.size()){
    vint tmp(3);
    repf(j,i,i+3){
      tmp[j-i] = v[j];
    }
    sort(ALL(tmp));
    nxt[i] = tmp[1];
  }

  show(nxt);
  // print(v);
  return;

}

int main() {


  cout<<fixed<<setprecision(10);

  ll n,x; cin>>n>>x;

  if(x==1 || x==2*n-1){
    puts("No");
  }else{
    puts("Yes");
    vint ans(2*n-1, -1);
    ans[n-1] = x;
    ans[n] = 2*n-1;
    ans[n-2] = 1;
    
    queue<ll> q;
    repf(i,2,x) q.push(i);
    repf(i,x+1,2*n-1) q.push(i);

    rep(i, n-2){
      ans[i] = q.front(); q.pop();
    }
    repf(i, n+1, 2*n-1){
      ans[i] = q.front(); q.pop();
    }

    for(auto e:ans) cout<<e<<endl;
  }

}
//


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

int main(){
    string a, b, c;
    cin >> a >> b >> c;
    if(a[a.size()-1] == b[0]
    && b[b.size()-1] == c[0])
        cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


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

using namespace std;
using ll = long long;

void dfs(int parent, int root, vector<vector<int>> &G, vector<int> &score) {
  for (int node : G[root]) {
    if (node != parent) {
      score[node] += score[root];
      dfs(root, node, G, score);
    }
  }
}

int main(int argc, char const *argv[]) {
  int n, q, a, b, p, x;
  cin >> n >> q;
  vector<vector<int>> G(n);
  vector<int> score(n, 0);

  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--, b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  for (int i = 0; i < q; i++) {
    cin >> p >> x;
    p--;
    score[p] += x;
  }

  dfs(-1, 0, G, score);
  for (int i = 0; i < n; i++) {
    cout << score[i] << endl;
  }

  return 0;
}


Measured memory_bytes: 29696
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
        int n;
        cin >> n;
        int a[n+2];
        int sum=0;int sum1;
        a[0]=0; a[n+1]=0;
        for(int i=1; i<n+1; i++) {
                cin >> a[i];
        }
        for(int i=0; i<n+1; i++) {
                sum+=abs(a[i]-a[i+1]);
                sum1=sum;
        }
        for(int i=1; i<=n; i++) {
                int hi=abs(a[i]-a[i-1])+abs(a[i+1]-a[i]);
                sum-=hi;
                int pl=abs(a[i+1]-a[i-1]);
                sum+=pl;
                cout << sum << endl;
                sum=sum1;
        }
}


Measured memory_bytes: 1664
import java.util.*;
import java.io.*;
class Main{
  static int count = 0;
  public static void main(String args[])throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    int array[] = new int[n];
    StringTokenizer token = new StringTokenizer(br.readLine());

    for(int i = 0; i<n; i++){
      array [i] = Integer.parseInt(token.nextToken());
    }

    merge_sort(array,n,0,n);
    for(int i = 0; i<n-1; i++){
      System.out.print(array[i]+" ");
    }
    System.out.println(array[n-1]);
    System.out.println(count);
  }

  static void merge(int A[], int left, int mid, int right){
    int n1 = mid - left;
    int n2 = right - mid;
    int L[] = new int[n1+1];
    int R[] = new int[n2+1];
    for(int i = 0; i<n1;i++){
      L[i] = A[left+i];
    }
    for(int i =0; i<n2; i++){
      R[i] = A[i+mid];
    }
    L[n1] = (int)Double.POSITIVE_INFINITY;
    R[n2] = (int)Double.POSITIVE_INFINITY;
    int i = 0;
    int j = 0;
    for(int k = left; k<right; k++){
      count++;
      if(L[i]<=R[j]){
        A[k] = L[i++];
      }else{
        A[k] = R[j++];
      }
    }
  }

  static void merge_sort(int A[], int n, int left, int right){
    if(left+1<right){
      int mid = (left+right)/2;
      merge_sort(A, n, left, mid);
      merge_sort(A, n, mid, right);
      merge(A, left, mid, right);
    }
  }
}


Measured memory_bytes: 128292
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
#include <functional>
#include <map>
#include <set>
#include <cmath>
#include <string>
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int N;
ll K;

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

int main()
{
	scanf("%d%lld",&N,&K);
	ll A;
	ll GCD;
	ll MAX=0;
	for(int i=0;i<N;i++){
		scanf("%lld",&A);
		if(i==0)GCD=A;
		else GCD = gcd(GCD,A);
		MAX = max(MAX,A);
	}
	if(K%GCD==0 && K<=MAX)puts("POSSIBLE");
	else puts("IMPOSSIBLE");
	return 0;
}


Measured memory_bytes: 256
/*
 *
 * Author: r3gz3n
 * 
 * 3b 13 12 9 56 4e
 * 6 56 a a 5f f
 * 6 56 47 18 56 d
 * 13 46 14 1f 13 27
 * 52 52 a 5a 47 1
 * 1d 13 b 1b 49 17
 *
 */


#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;


#define all(x) (x).begin(),(x).end()


#define siz(x) ((int)x.size())
#define endl '\n'


class Solution {
public:
    void solve(std::istream& in, std::ostream& out) {
        string s, s1, a, b;
        int n;
        in >> s;
        s1 = s;
        reverse(all(s1));
        if (s1 == s) {
            n = siz(s);
            a = s.substr(0, (n-1)/2);
            b = a;
            reverse(all(b)); 
            if (a == b) {
                a = s.substr((n+3)/2 - 1, n);
                b =  a;
                reverse(all(b));
                if (a == b) out << "Yes" << endl;
                else out  << "No" << endl;
            }
            else out << "No" << endl;
        }
        else {
            out << "No" << endl;
        }
    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}


#include <fstream>
#include <iostream>


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


    istream& in = cin;


    ostream& out = cout;

    solve(in, out);
    return 0;
}




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

using namespace std;

string s, t;
int dp[3001][3001];

int main() {
	cin >> s >> t;
	for (int i = 0; i < s.size(); i++) {
		for (int j = 0; j < t.size(); j++) {
			if (s[i] == t[j]) {
				dp[i + 1][j + 1] = dp[i][j] + 1;
			}
			else {
				dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1]);
			}
		}
	}

	string ans = "";

	int i = s.size(), j = t.size();
	while (i > 0 && j > 0) {
		if (dp[i][j] == dp[i - 1][j - 1] + 1 && s[i - 1] == t[j - 1]) {
			ans = s[i - 1] + ans;
			i--, j--;
		}
		else if (dp[i][j] == dp[i - 1][j]) {
			i--;
		}
		else if (dp[i][j] == dp[i][j - 1]) {
			j--;
		}
	}

	cout << ans << endl;

	return 0;
}

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

using namespace std;
#define int long long
const int MOD = 1000000007;

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int K, A, B;
	cin >> K >> A >> B;
	string res = "NG";
	for (int i = 0; i < 1000000; i++) {
		if (A <= i * K && i * K <= B) {
			res = "OK";
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
int main(){
    int A,B,ans = 0;
    cin >> A >> B;
    for(int i = A;i <= B;i ++){
        string si = to_string(i);
        reverse(si.begin(),si.end());
        if(to_string(i) == si) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
 
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for f in range(m)]
if n == 1:
    start = 0
    end = 10
else:
    start = 10**(n-1)
    end = 10**n
for i in range(start, end):
  x = False
  for j in sc:
    if str(i)[j[0]-1] != str(j[1]):
      x = True
      break
  if x:
    continue
  print(i)
  sys.exit()
print(-1)  

Measured memory_bytes: 9128
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<62;
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; }
// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

const int MOD = 1000000007;

int main(){
    int N; cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];

    ll ans = 1000;
    rep(i,N-1){
        // 翌日の方が株価が高い場合
        if (A[i] < A[i+1]){
            // 当日に株を買い、翌日に売る。
            ll count = ans/A[i];
            ans %= A[i];
            ans += count*A[i+1];
        }
    }

    cout << ans << endl;
}



Measured memory_bytes: 3592
package main

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

type bufReader struct {
	r   *bufio.Reader
	buf []byte
	i   int
}

var reader = &bufReader{
	bufio.NewReader(os.Stdin),
	make([]byte, 0),
	0,
}

func (r *bufReader) readLine() {
	if r.i < len(r.buf) {
		return
	}
	r.buf = make([]byte, 0)
	r.i = 0
	for {
		line, isPrefix, err := r.r.ReadLine()
		if err != nil {
			panic(err)
		}
		r.buf = append(r.buf, line...)
		if !isPrefix {
			break
		}
	}
}

func (r *bufReader) next() string {
	r.readLine()
	from := r.i
	for ; r.i < len(r.buf); r.i++ {
		if r.buf[r.i] == ' ' {
			break
		}
	}
	s := string(r.buf[from:r.i])
	r.i++
	return s
}

func (r *bufReader) nextLine() string {
	r.readLine()
	s := string(r.buf[r.i:])
	r.i = len(r.buf)
	return s
}

var writer = bufio.NewWriter(os.Stdout)

func next() string {
	return reader.next()
}

func nextInt64() int64 {
	i, err := strconv.ParseInt(reader.next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func nextInt() int {
	return int(nextInt64())
}

func nextLine() string {
	return reader.nextLine()
}

func out(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func max64(x, y int64) int64 {
	if x > y {
		return x
	}
	return y
}

func max(x, y int) int {
	return int(max64(int64(x), int64(y)))
}

func min64(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func min(x, y int) int {
	return int(min64(int64(x), int64(y)))
}

func abs64(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

func abs(x int) int {
	return int(abs64(int64(x)))
}

func joinInt64s(a []int64, sep string) string {
	b := make([]string, len(a))
	for i, v := range a {
		b[i] = strconv.FormatInt(v, 10)
	}
	return strings.Join(b, sep)
}

func joinInts(a []int, sep string) string {
	b := make([]string, len(a))
	for i, v := range a {
		b[i] = strconv.Itoa(v)
	}
	return strings.Join(b, sep)
}

func divUp64(x, y int64) int64 {
	return (x + y - 1) / y
}

func divUp(x, y int) int {
	return int(divUp64(int64(x), int64(y)))
}

func gcd64(x, y int64) int64 {
	if x < y {
		x, y = y, x
	}
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func gcd(x, y int) int {
	return int(gcd64(int64(x), int64(y)))
}

func lcm64(x, y int64) int64 {
	return x * y / gcd64(x, y)
}

func lcm(x, y int) int {
	return int(lcm64(int64(x), int64(y)))
}

func pow64(x, y int64) int64 {
	return int64(math.Pow(float64(x), float64(y)))
}

func pow(x, y int) int {
	return int(pow64(int64(x), int64(y)))
}

func main() {
	solve()
	writer.Flush()
}

type pair struct {
	i, j int
}

func solve() {
	x, y := nextInt(), nextInt()
	ans := math.MaxInt64
	if x <= y {
		ans = min(ans, y-x)
	}
	if x <= -y {
		ans = min(ans, 1-y-x)
	}
	if -x <= y {
		ans = min(ans, 1+y+x)
	}
	if -x <= -y {
		ans = min(ans, 2-y+x)
	}
	out(ans)
}


Measured memory_bytes: 640