akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<cstdio>

using namespace std;

int main(){
  int x1,y1,x2,y2;
  cin >> x1 >> y1 >> x2 >> y2;
  int vector_x = x2-x1;
  int vector_y = y2-y1;
  int x3 = x2 - vector_y;
  int y3 = y2 + vector_x;
  int x4 = x3 - vector_x;
  int y4 = y3 - vector_y;
  cout << x3 << ' ' << y3 << ' ' << x4 << ' ' << y4 << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int result;

int main() {
	int n, m, a, b, c, s[10000] = {};
	scanf("%d%d%d",&a,&b,&c);
	n = 0;
	if (a >= b && a >= c) { printf("%d", 10 * a + b + c); 
	return 0;
	}
	if (b >= a && b >= c) { printf("%d", a + 10 * b + c); 
	return 0;
	}
	if (c >= b && c >= a)printf("%d",  a + b +10*c);
}

Measured memory_bytes: 128
#include"bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
	ll n, m,g,ni=0,mi=0;
	string s, t;
	bool ans = true;
	cin >> n >> m >> s >>t;
	//if (s[0] != t[0]) { cout << -1 << endl; return 0; }
	g = lcm(n, m);
	vector<ll>narr(n), marr(m);
	map<ll, int>mp;
	rep(i, n) {
		narr[i] = (g * i) / n;
		mp[narr[i]]++;
	}
	rep(i, m) {
		marr[i] = (g * i) / m;
		mp[marr[i]]++;
	}
	for (auto p : mp) {
		if (p.second == 1)continue;
		ni = lower_bound(all(narr), p.first) - narr.begin();
		mi = lower_bound(all(marr), p.first) - marr.begin();
		if (s[ni] != t[mi])ans = false;
	}
	if (ans) {
		cout << g << endl;
	}
	else {
		cout << -1 << endl;
	}
	return 0;
}



Measured memory_bytes: 15032
/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 5e3 + 10;
const ll inf = 1e15 + 42;

int p[N];
ll dp[N][N];

int main() {
	fast_cin();
	int n; ll a, b;
	cin >> n >> a >> b;
	for (int i = 1; i <= n; ++i) {
		cin >> p[i];
	}
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			dp[i][j] = inf;
		}
	}
	dp[0][0] = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j <= n; ++j) {
			if (dp[i][j] == inf) {
				continue;
			}
			if (j >= p[i + 1]) {
				dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + b);
			} else {
				dp[i + 1][p[i + 1]] = min(dp[i + 1][p[i + 1]], dp[i][j]);
				dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + a);
			}
		}
	}
	ll ans = inf;
	for (int j = 0; j <= n; ++j) {
		ans = min(ans, dp[n][j]);
	}
	cout << ans << endl;
}

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

int main(){
    int x,a,b;
    cin >> x >> a >> b;
    x-=a;
    while(x>=b) x-=b;
    cout << x << endl;
    return 0;
}

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

//macro-----------------------------------------------------------------------------------------
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i=a;i>b;i--)
#define int long long

//constant--------------------------------------------------------------------------------------
const int inf = 100100100100000;
const int mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//general_method--------------------------------------------------------------------------------
vector<int> cs(vector<int> arr){vector<int> ret = arr;rep(i,1,arr.size()){ret[i] += ret[i-1];}return ret;}
int ceil(int a, int b){if(a%b == 0) return a/b;else return a/b + 1;}
int digitlen(int i){int t = i;int count = 0;while(t){count += 1;t /= 10;}return count;}
int gcd(int m, int n){if((0== m)||(0 == n))return 0;while(m != n){if(m > n)m = m - n;else n = n - m;}return m;}
int lcm(int n, int m){return n*m/gcd(n,m);}

//io_method-------------------------------------------------------------------------------------
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
void print(int n){cout << n << endl;}
void print(vector<int> arr){cout << arr[0];rep(i,1,arr.size()) cout << " " << arr[i];cout << endl;}
void print(string s){cout << s << endl;}
void print(pair<int, int> p){cout << p.first << " " << p.second;}
void print(vector<vector<int>> arr){rep(i,0,arr.size()){print(arr[i]);}}

//main------------------------------------------------------------------------------------------

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

    string s = raw_input();
    rep(i,0,s.size()){
        if(s[i] == '9') cout << '1';
        else if(s[i] == '1') cout << '9';
        else cout << s[i];
    }
    cout << endl;


}

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

#define FOR(i, s, e)   for(int i = (s); i < (e); i++)
#define FOR64(i, s, e) for(ll  i = (s); i < (e); i++)
#define ALL(x)         (x).begin(), (x).end()
#define SORT(b, e)     sort((b), (e))
#define REV(b, e)      reverse((b), (e))
#define VSORT(v)       sort((v).begin(), (v).end())
#define VREV(v)        reverse((v).begin(), (v).end())
#define pb(a)          push_back(a)
#define INF            999999999

typedef long long ll;

int main()
{
	char S[12];
	cin >> S;

	int N = strlen(S);

	int d = INF;

	FOR(i, 0, N-3+1){
		int x = int(S[i] - '0') * 100 + int(S[i+1] - '0') * 10 + int(S[i+2] - '0');
		d = min(d, abs(x - 753));
	}

	cout << d << endl;

	return 0;
}



Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main (final String[] args) {
        final Scanner s = new Scanner(System.in);
      	int num = Integer.parseInt(s.next());
      
      	long result = 0;
      	
      	for(int i = 1; i <= num; i++) {
          	if(i%3 != 0 && i%5 != 0) result += (long)i;
        }
      	
      	System.out.println(result);
    }
}

Measured memory_bytes: 35668
#define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define rep(i,n) for(int i=0;i<(lint)(n);i++)
#define REP(i,n) for(int i=1;i<=(lint)(n);i++)
#define all(V) V.begin(),V.end()
#define stackReplaceBegin(size)\
	void* p=malloc(size);\
	esp_new=(lint)p+size-1;\
	void * stack_extend_memory_ = malloc(size);\
	void * stack_extend_origin_memory_;\
	char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);\
	*stack_extend_dummy_memory_ = 0;\
	asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
typedef long long lint;
typedef unsigned long long ulint;
typedef std::pair<int, int> P;
constexpr int INF = INT_MAX/2;
constexpr lint LINF = LLONG_MAX/2;
constexpr double eps = DBL_EPSILON;
constexpr double PI=3.141592653589793238462643383279;
lint esp_new;
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
inline lint gcd(lint a, lint b) {
	while (b) {
		lint c = a;
		a = b; b = c % b;
	}
	return a;
}
inline lint lcm(lint a, lint b) {
	return a / gcd(a, b) * b;
}
bool isprime(lint n) {
	if (n == 1)return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)return false;
	}
	return true;
}
template<typename T>
T mypow(T a, unsigned int b) {
	T res(1),now(a);
	while(b){
		if(b&1)res*=now;
		b>>=1;
		now*=now;
	}
	return res;
}
template<typename T>
void printArray(std::vector<T>& vec) {
	rep(i, vec.size() - 1)std::cout << vec[i] << " ";
	std::cout << vec.back() << std::endl;
}
template<typename T>
void printArray(T l, T r) {
	T rprev = r;
	rprev--;
	for (T i = l; i != rprev; i++) {
		std::cout << *i << " ";
	}
	std::cout << *rprev << std::endl;
}
int a[110];
int main() {
	int N;
	std::cin>>N;
	for(int i=0;i<N;i++)std::cin>>a[i];
	int ans=0,cnt=0,color=-1;
	for(int i=0;i<N;i++){
		if(color!=a[i]){
			ans+=cnt/2;
			color=a[i];
			cnt=1;
		}
		else cnt++;
	}
	ans+=cnt/2;
	std::cout<<ans<<std::endl;
	return 0;
}

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



int main()
{
    //ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    int a[n];
    cin >> a[0];
    long long int sum = 0;
    for(int i = 1; i < n; i++)
    {
        cin >> a[i];
        if(a[i] < a[i-1])
        {
            sum += a[i-1] - a[i];
            a[i] = a[i-1];
            //cout << a[i];
        }
    }
    cout << sum;
}


Measured memory_bytes: 3972
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//
ll dp[1 << 21];
bool A[21][21];
int main() {
    init();
    ll N;
    cin >> N;
    rep(i, N) rep(j, N) cin >> A[i][j];
    dp[0] = 1;

    // n bitからn+1 bitへの遷移のとき、小さいindexへの更新は無いため、昇順に更新すればin-placeに計算できる
    ll cnt;
    rep(bit, (1<<N)-1){
        cnt = __builtin_popcount(bit);
        if(dp[bit])rep(j,N){
            if (!(bit & 1 << j) and A[cnt][j]) (dp[bit | 1 << j] += dp[bit]) %= MOD;
        }
    }

    cout << dp[(1 << N) - 1] << endl;
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

int main() {
source:
    char b;
    cin >> b;
    if (b == 'A') {
        cout << "T" << endl;
    } else if (b == 'T') {
        cout << "A" << endl;
    } else if (b == 'G') {
        cout << "C" << endl;
    } else {
        cout << "G" << endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
	int N, K;
	string S;
	cin >> N >> K;
	cin >> S;
	int max = 0;
	int i;
	for (i = 0;i < N;i++)//统计初始max
	{
		if (S[i] == 'L')
			if (i - 1 >= 0 && S[i - 1] == 'L')
				max++;
		if (S[i] == 'R')
			if (i + 1 < N&&S[i + 1] == 'R')
				max++;
	}
	for (i = 0;i < K;i++)
		max += 2;
	if (max > N-1)
		max = N-1;
	cout << max;
	return 0;
}

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

int main(){
	string s;
	cin >> s;
	if(s[5] == '0' && s[6] <= '4'){
		cout << "Heisei" << endl; 
	}else{
		cout << "TBD" << endl;
	}
}

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

typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,a,b) for(int i=(a);i<(b);++i)


int main() {
  int N,cnt=0,p,ans=0;
  cin >> N;
  // vector<int> P(N,0);
  rep(i,N) {
    cin >> p;
    if (p==i+1) cnt++;
    else {
      ans += (cnt+1)/2;
      cnt = 0;
    }
  }
  ans += (cnt+1)/2;
  cout << ans << endl;
}

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

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

    int cnt[N+1] = {0};

    for (int i = 1; i <= 100; ++i) {
        for (int j = 1; j <= 100; ++j) {
            for (int k = 1; k <= 100; ++k) {
                const int v = i * i + j * j + k * k + i * j + j * k + k * i;
                if (v <= N) {
                    cnt[v] += 1;
                }
            }
        }
    }
   
    for (int i = 1; i <= N; ++i) {
        std::cout << cnt[i] << std::endl;
    }

    return 0;
}


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

int main(){
  int N,r=0,b=0;
  string s;
  cin>>N>>s;
  for(int i=0;i<N;i++){
    if(s.at(i)=='R'){
      r++;
    }
    else{
      b++;
    }
  }
    if(r>b){
      cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
    return 0;
  }
  

Measured memory_bytes: 256
#include "bits/stdc++.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<ll> vecll;
typedef vector<string> vecs;
template<class T,class U> using Hash=unordered_map<T,U>;

#define REP(i, a, n) for(ll i = a; i < (ll)n; i++)
#define RREP(i, a, n) for(ll i = n-1; i >= (ll)a; i--)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, 0, n)
#define MD 1000000007

template<class T> T read(){T a;cin >> a;return a;}
template<class T> void read(T& a){cin >> a;}
template<class T, class ...Args> void read(T& a, Args&... args){cin >> a; read(args...);} 
template<class T> void rarr(T a, int n){for(int i = 0; i < n; i++) {cin >> a[i];}}
template<char c = ' ',class T> void write(T a){cout << fixed << setprecision(4) << a << endl;}
template<char c = ' ',class T,class ...Args> void write(T a, Args... args){cout << fixed << setprecision(4) << a << c; write<c>(args...);}
template<class T> void warr(vector<T> a, const char* c = " "){cout << a[0];for(int i = 1; i < (int)a.size(); i++)cout << c << a[i];cout << endl;;}
template<class T> void warr(T a, int n, const char* c = " "){cout << a[0];for(int i = 1; i < n; i++)cout << c << a[i];cout << endl;}
void split(string s, string delim, veci& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(atoi(s.substr(pos).data()));break;}else {result.push_back(atoi(s.substr(pos, p - pos).data()));}pos = p + delim.size();}}
void split(string s, string delim, vecs& result){result.clear();string::size_type pos = 0;while(pos != string::npos){string::size_type p = s.find(delim, pos);if(p == string::npos){result.push_back(s.substr(pos));break;}else {result.push_back(s.substr(pos, p - pos));}pos = p + delim.size();}}
ull gcd(ull a, ull b){while(true){ull k = a % b;if(k == 0)return b;a = b;b = k;}}
ull comb(ull n, ull m){ull p=1;m=min(m,n-m);for(ull i=1;i<=m;i++){p*=n-i+1;p/=i;}return p;}

struct DynamicRMQ {
	typedef int Val;
    const int INF=(int)1e9;
	int n;
	vector<Val> d;
	void init(int nmin) {
		for(n = 1; n < nmin; n *= 2);
		d.assign(n * 2, INF);
	}
	void update(int i, Val x) {
		d[n+i] = x;
		for(int k = (n+i)/2; k > 0; k >>= 1) 
			d[k] = min(d[k * 2], d[k * 2 + 1]);
	}
	Val get(int i) const { return d[n+i]; }
	//[l, r)
	Val query(int l, int r) const {
		Val m(INF);
		for(; l && l + (l&-l) <= r; l += l&-l)
			m = min(m, d[(n+l) / (l&-l)]);
		for(; l < r; r -= r&-r)
			m = min(m, d[(n+r) / (r&-r) - 1]);
		return m;
	}
};


int main(void)
{
    int n;
    read(n);
    DynamicRMQ r;
    r.init(n);
    rep(i,n){
        int x;
        read(x);
        r.update(i,x);
    }
    int res=(int)-1e9-10;
    REP(i,1,n){
        int le=0;
        int pl=r.query(le,i);
        int pr=r.get(i);
        res=max(res,pr-pl);
    }
    write(res);
    return 0;
}

Measured memory_bytes: 4952
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
//#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int32_t main()
{
	c_p_c();
    int n;
    scanf("%d", &n);
    map<pair<int,int>, int> cnt;
    for(int rep = 0; rep < n; ++rep) {
        double x;
        scanf("%lf", &x);
        long long i = llround(x * 1e9);
        int two = 0, five = 0;
        while(i % 2 == 0) {
            two++;
            i /= 2;
        }
        while(i % 5 == 0) {
            five++;
            i /= 5;
        }
        ++cnt[{two,five}];
    }
    long long answer = 0;
    for(auto p1 : cnt) {
        for(auto p2 : cnt) {
            if(p1.first.first+p2.first.first >= 18 && p1.first.second+p2.first.second >= 18) {
                if(p1 < p2) {
                    answer += (long long) p1.second * p2.second;
                }
                else if(p1 == p2) {
                    answer += (long long) p1.second * (p1.second - 1) / 2;
                }
            }
        }
    }
    printf("%lld\n", answer);
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

// a^b mod を計算する
ll mod_pow(ll a, ll b, ll p) {
    if (b == 0) return 1;
    if (b & 1) return (a * mod_pow(a, b - 1, p)) % p;
    ll t = mod_pow(a, b / 2, p);
    return (t * t) % p;
}

signed main()
{   
    gearup;
    ll n;cin>>n;
    ll res = 1;
    rep1(i,n+1){
        res *= i;
        res %= MOD;
    }
    out(res);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int  N;
  cin >> N;
  vector<string> vec1(N);
  for (int i=0;i<N;i++){
    cin >> vec1.at(i);  
  }
  int  M;
  cin >> M;
  vector<string> vec2(M);
  for (int i=0;i<M;i++){
    cin >> vec2.at(i);
  }
  
  int maxsum=0,dsum=0,Nsum=0,Msum=0;
  string a;
  for (int i=0;i<N;i++){
    Nsum=0;
    Msum=0;
    a=vec1.at(i);
    for (int i=0;i<N;i++){
      if (vec1.at(i)==a)
        Nsum++;
    }
    for (int i=0;i<M;i++){
      if (vec2.at(i)==a)
        Msum++;
    }
    dsum=Nsum-Msum;
    if (dsum > maxsum)
      maxsum=dsum;
  }
  cout << maxsum << endl;
}

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

int x[300001];
ll dl[100001], dr[100001], s[300001];

inline ll gt(int l, int r) { return s[r] - s[l - 1]; }

int main(){
	int n;
	scanf("%d", &n);
	f(i, 1, 3 * n + 1)scanf("%d", x + i), s[i] = x[i] + s[i - 1];
	multiset<int> st;
	f(i, 1, n + 1)st.insert(x[i]);
	f(i, 1, n + 1){
		st.insert(x[i + n]);
		dl[i] = *st.begin() + dl[i - 1];
		st.erase(st.begin());
	}
	st.clear();
	f(i, 1, n + 1)st.insert(x[(n << 1) + i]);
	f(i, 1, n + 1){
		st.insert(x[(n << 1) - (i - 1)]);
		dr[i] = *st.rbegin() + dr[i - 1];
		st.erase(--st.end());
	}
	ll an = -1e18;
	f(i, 0, n + 1)an = max(an, gt(1, n + i) - dl[i] - (gt(n + i + 1, n * 3) - dr[n - i]));
	printf("%lld\n", an);
}

Measured memory_bytes: 9984
#include <bits/stdc++.h>
using namespace std;
int main(){
  	int X;cin>>X;
  	int Y;cin>>Y;
  	int Z;cin>>Z;
  	int K;cin>>K;
  	long long A[1009]={};
  	long long B[1009]={};
  	long long C[1009]={};
  	for(int i=0;i<X;i++)cin>>A[i];
  	for(int i=0;i<Y;i++)cin>>B[i];
  	for(int i=0;i<Z;i++)cin>>C[i];
  	sort(A,A+X,greater<long long>());
  	sort(B,B+Y,greater<long long>());
  	sort(C,C+Z,greater<long long>());
    long long XY[K*K+10]={};
  	long long k;k=0;
  	for(int i=0;i<K;i++){
      	if(A[i]==0)break;
    	for(int j=0;j<K;j++){
          	if(B[j]==0)break;
        	XY[k]=A[i]+B[j];
          	k++;
        }
    }
  	sort(XY,XY+K*K+10,greater<>());
  	long long XYZ[K*K+10]={};
  	k=0;
  	for(int i=0;i<K;i++){
    if(XY[i]==0)break;
    	for(int j=0;j<K;j++){
          	if(C[j]==0)break;
        	XYZ[k]=XY[i]+C[j];
          	k++;
        }
    }
  	sort(XYZ,XYZ+K*K+10,greater<>());
  	
    for(int i=0;i<K;i++)cout<<XYZ[i]<<endl;
}



Measured memory_bytes: 141056
# C - Skill Up
from itertools import product


def main():
    N, M, X, *CA = map(int, open(0).read().split())
    conditions = tuple(zip(*[iter(CA)] * (M + 1)))
    ans = 1 << 30
    for p in product(range(2), repeat=N):
        cur = [0] * (M + 1)
        for is_available, condition in zip(p, conditions):
            if not is_available:
                continue
            for i, (x, y) in enumerate(zip(cur, condition)):
                cur[i] = x + y
        if all(i >= X for i in cur[1:]):
            ans = min(ans, cur[0])
    print(ans if ans != 1 << 30 else -1)


if __name__ == "__main__":
    main()


Measured memory_bytes: 9224
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <functional>

#define ll long long
using namespace std;

const ll mod = 1e9 + 7;

int main(){
    ll N,K,Q;
    cin >> N >> K >> Q;
    vector<ll> v(N,0);
    for(int i=0; i < Q ;i++){
        int j;
        cin >> j;
        v[j-1]++;
    }
    for(int i=0;i<N;i++){
        if(v[i] - Q + K > 0)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

using ll = long long;
using pii = pair<int, int>;

int n;

void	dfs(string s, char mx) {
	if ((int)s.size() == n) {
		cout << s << "\n";
		return;
	}
	for (char c = 'a'; c <= mx + 1; c++) {
		string t = s;
		t += c;
		dfs(t, max(mx, c));
	}
}

int		main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	dfs("", 'a' - 1);
}


Measured memory_bytes: 1536
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 2e5 + 10;
int N;
int P[MAX];
int rev_p[MAX];

int main(void) {
    cin >> N;
    REP(i, N) {
        cin >> P[i];
        P[i]--;
        rev_p[P[i]] = i;
    }
    int ans = N - 1, cnt = 1;
    FOR(i, 1, N) {
        if (rev_p[i - 1] > rev_p[i]) {
            cnt = 1;
        } else {
            cnt++;
        }
        chmin(ans, N - cnt);
    }
    chmin(ans, N - cnt);
    cout << ans << endl;
}


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

using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define debug(x) cerr << #x << " = " << (x) << endl;
template<typename T>
ostream& operator<<(ostream& o, vector<T>& v) {
    for (auto& x : v) o << x << ' ';
    return o;
}

int n;
vi mul(const vi &v, const vi &p){
    vi nv(n-1);
    for (int i = 0; i < n-1; i++) nv[i] = v[p[i]];
    return nv;
}

vi exp(vi &v, vi &p, ll k){
    if (k == 0) {
        vi res(n-1);
        iota(res.begin(), res.end(), 0);
        return res;
    }
    if (k & 1){
        return mul(exp(v, p, k-1), p);
    }
    vi tmp = exp(v, p, k/2);
    return mul(tmp, tmp);
}

int main(){
    std::ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    int m; cin >> m;
    ll k; cin >> k;
    vi brr(m);
    for (int i = 0; i < m; i++){
        cin >> brr[i];
        brr[i] -= 2;
    }
    vi diff;
    for (int i = 0; i < n-1; i++){
        diff.push_back(arr[i + 1] - arr[i]);
    }
    vi p(n-1);
    iota(p.begin(), p.end(), 0);
    for (int i = 0; i < m; i++){
        swap(p[brr[i]], p[brr[i]+1]);
    }
    vi perm(n-1), nperm(n-1);
    iota(perm.begin(), perm.end(), 0);
    // for (; k; k >>= 1){
    //     if (k & 1){
    //         for (int i = 0; i < m; i++){
    //             nperm[i] = perm[swaps[i]];
    //         }
    //         perm = nperm;
    //     }
    //     for (int i = 0; i < n-1; i++){

    //     }
    // }
    vi res = exp(perm, p, k);
    ll ans = arr[0];
    cout << ans << endl;
    for (int i = 0; i < n-1; i++){
        ans += diff[res[i]];
        cout << ans << endl;
    }
}


Measured memory_bytes: 4456
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        ss: [chars;n]
    }
    for c in (b'a'..b'z'+1) {
        let n = ss.iter().map(|s|{
            s.iter().filter(|&a| *a == (c as char)).count()
        }).min().unwrap();
        for _ in 0..n {
            print!("{}", c as char);
        }
    }
}


Measured memory_bytes: 4352
import math


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

    def __add__(self, v):
        return Vector2(self.x+v.x, self.y+v.y)

    def __sub__(self, v):
        return Vector2(self.x-v.x, self.y-v.y)

    def __mul__(self, v):
        return Vector2(self.x*v, self.y*v)

    def __truediv__(self, v):
        return Vector2(self.x/v, self.y/v)

    def __abs__(self):
        return math.sqrt(float(self.x*self.x+self.y*self.y))

    def dot(self, v):
        return self.x*v.x+self.y*v.y

    def cross(self, v):
        return self.x*v.y-self.y*v.x

    def norm(self):
        d = abs(self)
        return Vector2(self.x/d, self.y/d)


def distanceLP(v1, v2, p):
    '''
    v1 -> v2の直線とpとの距離
    '''
    return abs((v2-v1).cross(p-v1))/abs(v2-v1)


def distanceSP(v1, v2, p):
    '''
    v1 -> v2の線分とpとの距離
    '''
    if (v2-v1).dot(p-v1) < 0.0:
        return abs(p-v1)
    if (v1-v2).dot(p-v2) < 0.0:
        return abs(p-v2)
    return distanceLP(v1, v2, p)


def intersect(p1, p2, p3, p4):
    '''
    p1p2とp3p4の交差判定
    '''
    #t1 = (p1.x-p2.x)*(p3.y-p1.y)+(p1.y-p2.y)*(p1.x-p3.x)
    #t2 = (p1.x-p2.x)*(p4.y-p1.y)+(p1.y-p2.y)*(p1.x-p4.x)
    #t3 = (p3.x-p4.x)*(p1.y-p3.y)+(p3.y-p4.y)*(p3.x-p1.x)
    #t4 = (p3.x-p4.x)*(p2.y-p3.y)+(p3.y-p4.y)*(p3.x-p2.x)
    # return (t1*t2) <= 0.0 and (t3*t4) <= 0.0
    c1 = ccw(p1, p2, p3)*ccw(p1, p2, p4)
    c2 = ccw(p3, p4, p1)*ccw(p3, p4, p2)
    return c1 <= 0.0 and c2 <= 0.0


def distance(a1, a2, b1, b2):
    '''
    線分a1a2とb1b2の距離
    '''
    if intersect(a1, a2, b1, b2):
        return 0.0
    return min([
        min([distanceSP(a1, a2, b1), distanceSP(a1, a2, b2)]),
        min([distanceSP(b1, b2, a1), distanceSP(b1, b2, a2)])
    ])


def ccw(p0, p1, p2):
    c = (p1-p0).cross(p2-p0)
    if math.isclose(c, 0.0, abs_tol=1e-10):
        d = (p1-p0).dot(p2-p0)
        if d < 0.0:
            return 1
        else:
            d1 = abs(p1-p0)
            d2 = abs(p2-p0)
            if d1 < d2:
                return -1
            else:
                return 0
    elif c < 0.0:
        return -1
    else:
        return 1


q = int(input())
for i in range(q):
    x0, y0, x1, y1, x2, y2, x3, y3 = map(int, input().split())
    p0 = Vector2(x0, y0)
    p1 = Vector2(x1, y1)
    p2 = Vector2(x2, y2)
    p3 = Vector2(x3, y3)
    print("1" if intersect(p0, p1, p2, p3) else "0")



Measured memory_bytes: 5752
#include <stdio.h>
int main()
{
    int h,s,m,S;
    scanf("%d",&S);
    if(0<=S&&S<86400){
        s= S%60;
        m = S/60 %60;
        h = S/3600 %60;
        printf("%d:%d:%d\n",h,m,s);
    }
    return 0;
}



Measured memory_bytes: 2104
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
 
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define lb lower_bound
#define ub upper_bound
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
 
const ll oo=1e18;
const int MOD=1000000007;
const int INF=1000000000;
const ld EPS=0.000000001;
 
signed main() {
    ll n,a,b;
  	cin>>n>>a>>b;
  	cout<<min(n*a,b);
    return 0;
}

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

class Program
{
    static void Main(string[] args)
    {
        //整数の入力
        string c = Console.ReadLine();

        //値の判定
        switch (c)
        {
            case "a":
                Console.WriteLine("b");
                break;
            case "b":
                Console.WriteLine("c");
                break;
            case "c":
                Console.WriteLine("d");
                break;
            case "d":
                Console.WriteLine("e");
                break;
            case "e":
                Console.WriteLine("f");
                break;
            case "f":
                Console.WriteLine("g");
                break;
            case "g":
                Console.WriteLine("h");
                break;
            case "h":
                Console.WriteLine("i");
                break;

            case "i":
                Console.WriteLine("j");
                break;
            case "j":
                Console.WriteLine("k");
                break;
            case "k":
                Console.WriteLine("l");
                break;
            case "l":
                Console.WriteLine("m");
                break;
            case "m":
                Console.WriteLine("n");
                break;
            case "n":
                Console.WriteLine("o");
                break;
            case "o":
                Console.WriteLine("p");
                break;
            case "p":
                Console.WriteLine("q");
                break;
            case "q":
                Console.WriteLine("r");
                break;
            case "r":
                Console.WriteLine("s");
                break;
            case "s":
                Console.WriteLine("t");
                break;
            case "t":
                Console.WriteLine("u");
                break;
            case "u":
                Console.WriteLine("v");
                break;
            case "v":
                Console.WriteLine("w");
                break;
            case "w":
                Console.WriteLine("x");
                break;
            case "x":
                Console.WriteLine("y");
                break;
            case "y":
                Console.WriteLine("z");
                break;
        }
    }
}

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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
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<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }


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

    int x;
    cin >> x;
    if (x < 1200) {
        cout << "ABC" << endl;
    } else {
        cout << "ARC" << endl;
    }
}

Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

def main():
    n = inp()
    s = input()
    x = 0
    res = 0
    for i,j in enumerate(s):
        if j == 'I':
            x += 1
        else:
            x -= 1
        res = max(res, x)
    print(res)
if __name__ == '__main__':
    main()

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

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

    if(day == 25) cout << "Christmas" << endl;
    else if(day == 24) cout << "Christmas Eve" << endl;
    else if(day == 23) cout << "Christmas Eve Eve" << endl;
    else cout << "Christmas Eve Eve Eve" << endl;

    return 0;
}

Measured memory_bytes: 256
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
lli n;
map<pair<lli, lli>, lli> m;
lli dp(lli x, lli y)
{
    if(m.count({x,y}))
        return m[{x,y}];
    if(x==0ll&&y==0ll)
        return m[{x,y}]=1ll;
    lli res=dp(x/2ll,y/2ll);
    if(x>=1ll&&y>=1ll)
        res=(res+dp((x-1ll)/2ll,(y-1ll)/2ll))%MOD;
    if(x>=2ll)
        res=(res+dp((x-2ll)/2ll,y/2ll))%MOD;
    return m[{x,y}]=res;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    cout<<dp(n,n)<<endl;
}

Measured memory_bytes: 256
from itertools import product
N,A,B,C = map(int, input().split())
L = [int(input()) for _ in range(N)]
ans = float('inf')
for p in product(range(4), repeat=N): # 4^Nループ
    take = [[] for _ in range(4)] # [A,B,C,使わない]
    for i in range(N):
        take[p[i]].append(L[i])
    a,b,c = take[0],take[1],take[2]
    if len(a)*len(b)*len(c)==0:
        continue 
    cost = (len(a)+len(b)+len(c)-3)*10
    cost += abs(sum(a)-A)+abs(sum(b)-B)+abs(sum(c)-C)
    ans = min(ans, cost)
print(ans)

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

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

Measured memory_bytes: 256
import math
n = int(input())
x = list(map(int, input().split()))
a,b = math.ceil(sum(x)/n), math.floor(sum(x)/n)
if a==b:
    print(sum([(i-a)**2 for i in x]))
else:
    print(min(sum([(i-a)**2 for i in x]),sum([(i-b)**2 for i in x])))

Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;

int cut(string s, int pos) {
	bool ac[26], bc[26];
	memset(ac, 0, sizeof ac); memset(bc, 0, sizeof bc);
	for (int i=0; i<pos; i++) {
		ac[s[i]-'a'] = true;
	}
	for (int i=pos; i<s.size(); i++) {
		bc[s[i]-'a'] = true;
	}
	int co = 0;
	for (int i=0; i<26; i++) co += (ac[i] && bc[i]);
	return co;
}

int main() {
    
	int n;
	cin >> n;
	string s;
	cin >> s;
	int mx = 0;
	for (int i=1; i<n; i++) { // before i
		mx = max(mx, cut(s, i));
	}
	cout << mx << endl;
	
}


Measured memory_bytes: 764
#include <cstdio>
#include <iostream>
#include <cstdlib>

namespace IO
{
//    inline char gc()
//    {
//        static char s[1<<20|1]={0},*p1=s,*p2=s;
//        return (p1==p2)&&(p2=(p1=s)+fread(s,1,1<<20,stdin),p1==p2)?EOF:*(p1++);
//    }
	inline char gc() { return getchar(); }
	inline long long read()
	{
		long long ret=0;bool flag=0;char c=gc();
		while ((c<'0')|(c>'9')) flag ^= !(c^'-'),c=gc();
		while ((c>='0')&(c<='9')) ret=(ret<<1)+(ret<<3)+(c^'0'),c=gc();
		return flag?-ret:ret;
 	}
 	char OutputAns[1<<20|1],*OutputCur = OutputAns;
 	inline void output()
 	{
 		OutputCur -= fwrite(OutputAns,1,OutputCur - OutputAns,stdout);
	}
	inline void print(long long ans)
	{
		char s[20]={0};
		if (OutputCur - OutputAns + sprintf(s,"%lld",ans) >> 20) output();
		OutputCur += sprintf(OutputCur,"%lld",ans);
	}
	inline void printc(char c)
	{
		if (OutputCur - OutputAns + 1 >> 20) output();
		*(OutputCur++) = c;
	}
}

using IO::read;
using IO::print;
using IO::printc;
using IO::output;

const int M = 3e5 + 11;

const int INF = 1e9 + 7;

int End[25][M], Fir[25][M], Dp1[M], Dp2[M], Pos[M], T[25];

int n, lim, top, sumBlock;

inline void Input()
{
	n = read(), lim = read(); for (int i = 1;i <= n; ++i) Pos[i] = read();
	int tmp = lim; while (tmp) { T[top++] = tmp >> 1; tmp >>= 1; } T[top] = lim;
}

inline void Solve()
{
	for (int i = 0;i <= top; ++i)
	{
		Fir[i][1] = 1;
		for (int j = 2;j <= n; ++j)
		{
			if (Pos[j] - Pos[j - 1] <= T[i]) Fir[i][j] = Fir[i][j - 1];
			else Fir[i][j] = j;
		}
	}
	for (int i = 0;i <= top; ++i)
	{
		End[i][n] = n;
		for (int j = n - 1; j >= 1; --j)
		{
			if (Pos[j + 1] - Pos[j] <= T[i]) End[i][j] = End[i][j + 1];
			else { End[i][j] = j; if (i == top) ++sumBlock; }
		}
	} 
	if (sumBlock > top)
	{
		for (int i = 1;i <= n; ++i) puts("Impossible");
		exit(0);
	} int all = (1<<top);
	for (int s = 0;s < all; ++s) Dp2[s] = n + 1;
	for (int S = 0;S < all; ++S)
		for (int i = 0;i <= top; ++i)
			if (!((1<<i) & S))	
				Dp1[S | (1<<i)] = std::max(Dp1[S | (1<<i)], End[i][Dp1[S] + 1]),
				Dp2[S | (1<<i)] = std::min(Dp2[S | (1<<i)], Fir[i][Dp2[S] - 1]);
	for (int i = 1;i <= n; ++i)
	{
		bool ok = 0;
		for (int S = 0;S < all; ++S)
		{
			int ss = (all - 1) ^ S;
			if (Dp1[S] >= i - 1 && Dp2[ss] <= End[top][i] + 1) { ok = 1; break; }
		}
		for (int j = i;j <= End[top][i]; ++j)
		{
			if (ok) puts("Possible");
			else puts("Impossible");
		} i = End[top][i];
	}
}

int main(void)
{
//	freopen("jump.in","r",stdin);
///	freopen("jump.out","w",stdout);
	Input();
	Solve();
	return 0;
}

Measured memory_bytes: 51200
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1ll << 60;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

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

  while (A > 0 || C > 0){
    C -= B;
    if (C <= 0){
      cout << "Yes" << endl;
      return 0;
    }
    A -= D;
    if (A <= 0){
      cout << "No" << endl;
      return 0;
    }
  }
  

  return 0;
}


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

int main(){
  string s;
  
  int k;
  cin >> k;
  cin >> s;
  if(s.size() > k){
    for(int i =0; i < k; i++){
      cout << s[i];
    }
    cout << "..." << endl;
  }
  else cout << s << endl;
}


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

int main(){
      int arr[5];
      int minn = INT_MAX;
      for(int i = 0;i < 5;i++){
            cin >> arr[i];
            if(arr[i] < minn)minn = arr[i];
      }
      int k;cin >> k;
      for(int i = 0;i < 5;i++){
            if(arr[i] - minn > k)return cout << ":(", 0;
      }
      cout << "Yay!";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int		long long
#define mp		make_pair
#define pb		push_back
#define pf		push_front
#define fi 		first
#define se		second
#define db(x)	{ cerr << #x << " = " << x << endl; }
#define sz(x)	((int)(x).size())
#define w(x)		int x; cin>>x; while(x--)
#define rep(i,a,n)		for (int i=a;i<n;i++)
#define per(i,a,n)		for (int i=n-1;i>=a;i--)
#define mod		1000000007
#define inf		1e18

void c_p_c(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int32_t main(){
	c_p_c();
	int n,k; cin>>n>>k;
	unordered_set <int> s;
	for(int i=0;i<k;i++){
		int d; cin>>d;
		for(int j=0;j<d;j++){
			int x; cin>>x;
			s.insert(x);
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++){
		if(s.count(i)==0) {cnt++;}
	}
	cout<<cnt;
	return 0;
}

// g++ -std=c++17 -Wshadow -Wall -o "b" "b.cpp" -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG1

Measured memory_bytes: 3652
#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 i;
    char s[20];
    char t[20];
    bool ans = true;

    cin >> s;
    cin >> t;

    for(i=0; s[i] != '\0'; i++){
    	if(s[i] == t[i]){
    		continue;
    	} else{
    		ans = false;
    		break;
    	}
    }

	if(t[i] == '\0'){
		ans = false;
	}
	if(t[i+1] != '\0'){
		ans = false;
	}

	if(ans){
		cout << "Yes";
	} else{
		cout << "No";
	}

    return 0;
}



Measured memory_bytes: 3636
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    // while true {
    input! {
        s: String,
    }
    if s == "ABC" {
        println!("ARC");
    } else {
        println!("ABC");
    }
    //}
}


Measured memory_bytes: 2092