akhauriyash/Code-Regression huggingface dataset:
#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'
#define debug(x) std::cerr << #x << " = " << (x) << endl;

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 ll mod = 1000000007;

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

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

struct combination {
  std::vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

ll N;
std::string S;
combination comb( 200000 );

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

  ll k = 0;
  mint ans = 1;

  rep( i, 2*N ) {
    if( (k&1)^(S[i]=='W') ) {
      if( !k ) {
        ans = 0;
        break;
      }

      ans *= k;
      --k;
    } else {
      ++k;
    }
  }

  if( k ) {
    ans = 0;
  }

  ans *= comb.fact[N];

  std::cout << ans.x << endl;

  return 0;
}

Measured memory_bytes: 6760
<?php
fscanf(STDIN, '%d', $n);
$tarray[0] = 0;
$xarray[0] = 0;
$yarray[0] = 0;
for($i = 1; $i <= $n; $i++){
    fscanf(STDIN, '%d %d %d', $t, $x, $y);
    $tarray[$i] = $t;
    $xarray[$i] = $x;
    $yarray[$i] = $y;
}
$ans = 'Yes';
for($i = 1; $i <= $n; $i++){
    $d = ($tarray[$i] - $tarray[$i-1]) -(($xarray[$i] - $xarray[$i-1]) + ($yarray[$i] - $yarray[$i-1]));
    if(($d < 0) | ($d % 2 != 0)){
        $ans = 'No';
        break;
    }
}
print $ans;

Measured memory_bytes: 18932
#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
  int N;
  cin>>N;
  std::vector<int> p(20),m(20),px(20),mx(20);
  p[0]=1;m[0]=-2;px[0]=1;mx[0]=-2;
  for(int i=1;i<20;i++){
    p[i]=p[i-1]*4;
    px[i]=px[i-1]+p[i];
    m[i]=m[i-1]*4;
    mx[i]=mx[i-1]+m[i];
  }
  std::vector<int> v(40,0);
  int ma=0;
  while(N!=0){
    if(N>0){
      int k=0;
      while(px[k]<N)k++;
      N-=p[k];
      v[k*2]=1;
      ma=max(ma,k*2);
    }
    else{
      int k=0;
      while(mx[k]>N)k++;
      N-=m[k];
      v[k*2+1]=1;
      ma=max(ma,k*2+1);
    }
  }
  for(int i=ma;i>=0;i--)cout<<v[i];
  cout<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    string s; cin >> s;
    REP(i, 0, s.size()) if (s[i] == '7') {
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <bitset>
#include <tuple>
#include <time.h>
using namespace std;
typedef long long ll;


int main() {
    int n, c[13] = {}, d[55];
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> d[i];
        c[d[i]]++;
    }
    if (c[0] >= 1 || c[12] >= 2) {
        cout << 0 << endl;
        return 0;
    }
    int s = 0;
    for (int i = 0; i <= 12; i++) {
        if (c[i] > 2) {
            cout << 0 << endl;
            return 0;
        }
        s += c[i];
    }
    for (int i = 1; i <= 11; i++) {
        if (max(c[i], c[i + 1]) == 2 && min(c[i], c[i + 1]) == 1) {
            cout << 1 << endl;
            return 0;
        }
        s += c[i];
    }

    int ans = 0;
    vector<int> t;
    t.resize(n + 1);
    for (int i = 0; i < pow(2, n); i++) {
        t[0] = 0;
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) t[j + 1] = d[j];
            else t[j + 1] = 24 - d[j];
        }
        sort(t.begin(), t.end());
        //for (int j = 0; j < n + 1; j++) cout << t[j] << " ";
        //cout << endl;

        int mn = 24;
        for (int j = 0; j < n; j++) {
            mn = min(mn, t[j + 1] - t[j]);
        }
        mn = min(mn, 24 + t[0] - t[n]);
        ans = max(ans, mn);
    }

    cout << ans << endl;
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==v.size()-1?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

bool dp[8100][17000];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    string s;
    int x,y;
    cin >> s >> x >> y;
    x += 8000;
    y += 8000;
    int n = s.size();
    vi vx;
    vi vy;
    int cnt = 0;
    vector<pair<char,int>> v;
    rep(i,n) {
        if(i == 0 or s[i] == s[i-1]) cnt++;
        else {
            v.eb(s[i-1],cnt);
            cnt = 1;
        }
    }
    v.eb(s[n-1],cnt);
    int now = 0;
    int st = 0;
    rep(i,v.size()) {
        if(i == 0 && v[i].first == 'F') {
            st = v[i].second;
            continue;
        }
        if(v[i].first == 'F') {
            (now ? vy : vx).pb(v[i].second);
        } else {
            if(v[i].second&1) now = 1-now;
        }
    }
    rep(_,2) {
        rep(i,8100) rep(j,17000) dp[i][j] = false;
        dp[0][8000+st] = true;
        rep(i,vx.size()) rep(j,17000) {
            if(!dp[i][j]) continue;
            dp[i+1][j+vx[i]] = true;
            dp[i+1][j-vx[i]] = true;
        }
        if(!dp[vx.size()][x]) {
            Yes(0);
            return 0;
        }
        swap(x,y);
        swap(vx,vy);
        st = 0;
    }
    Yes(1);
}


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

#ifdef _DEBUG
    #include "/home/v-o_o-v/deb.h"
    #define deb(x...)cerr << "[" << #x << "] = [";_print(x);
#else
    #define deb(x...)
#endif

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

bool used[100050];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)cin >> a[i];
    sort(a, a + n);
    int ans = 0;
    for(int i = 0; i < n - 1; i++){
        ans += (a[i + 1] - a[i]);
    }
    cout << ans << '\n';
    return 0;
}
// Write Here


Measured memory_bytes: 3636
#include "bits/stdc++.h"
using namespace std;
typedef long long lint;
int main() {
	lint n; cin >> n;
	bool f = 0;
	for (int i = 0; i <= n / 4; ++i)for (int j = 0; j <= n / 7; ++j) {
		if (4 * i + 7 * j == n) { f = 1; break; }
	}
	cout << (f ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define MAX 10001
#define B 100
#define dmp make_pair
#define dpb push_back
#define fi first
#define se second
#define P pair<int,int>
typedef long long ll;
const int inf = 1e9;
const ll INF = 1e18;
using namespace std;
//__gcd(a,b), __builtin_popcount(a);
/*chrono::system_clock::time_point  start;
void timerstart(){start = chrono::system_clock::now();}
void timerend(){
	auto end = chrono::system_clock::now();
	int elapsed = chrono::duration_cast<chrono::milliseconds>(end-start).count();
	printf("%d[ms]\n", elapsed);
}*/

int n, k, fld[110][110][110];
int cx[102][2], cy[102][2], cz[102][2];
int dx[102], dy[102], dz[102];
int compress1(int x1[52], int x2[52]){
	vector<int> xs;
	for(int i = 0;i < n;i++){
		xs.push_back(x1[i]);
		xs.push_back(x2[i]);
	}
	sort(xs.begin(), xs.end());
	xs.erase(unique(xs.begin(), xs.end()), xs.end());
	for(int i = 0;i < xs.size();i++)dx[i] = xs[i];
	for(int i = 0;i < n;i++){
		cx[i][0] = find(xs.begin(), xs.end(), x1[i])-xs.begin();
		cx[i][1] = find(xs.begin(), xs.end(), x2[i])-xs.begin();
	}
	return xs.size();
}

int compress2(int x1[52], int x2[52]){
	vector<int> xs;
	for(int i = 0;i < n;i++){
		xs.push_back(x1[i]);
		xs.push_back(x2[i]);
	}
	sort(xs.begin(), xs.end());
	xs.erase(unique(xs.begin(), xs.end()), xs.end());
	for(int i = 0;i < xs.size();i++)dy[i] = xs[i];
	for(int i = 0;i < n;i++){
		cy[i][0] = find(xs.begin(), xs.end(), x1[i])-xs.begin();
		cy[i][1] = find(xs.begin(), xs.end(), x2[i])-xs.begin();
	}
	return xs.size();
}

int compress3(int x1[52], int x2[52]){
	vector<int> xs;
	for(int i = 0;i < n;i++){
		xs.push_back(x1[i]);
		xs.push_back(x2[i]);
	}
	sort(xs.begin(), xs.end());
	xs.erase(unique(xs.begin(), xs.end()), xs.end());
	for(int i = 0;i < xs.size();i++)dz[i] = xs[i];
	for(int i = 0;i < n;i++){
		cz[i][0] = find(xs.begin(), xs.end(), x1[i])-xs.begin();
		cz[i][1] = find(xs.begin(), xs.end(), x2[i])-xs.begin();
	}
	return xs.size();
}

void paint(int w, int h, int d){
	for(int i = 0;i < n;i++){
		for(int x = cx[i][0]+1;x <= cx[i][1];x++){
			for(int y = cy[i][0]+1;y <= cy[i][1];y++){
				for(int z = cz[i][0]+1;z <= cz[i][1];z++){
					fld[x][y][z]++;
				}
			}
		}
	}
}

int main(){
	int X1[52], X2[52], Y1[52];
	int Y2[52], Z1[52], Z2[52];
	scanf("%d%d", &n, &k);
	rep(i,n){
		scanf("%d%d%d", &X1[i], &Y1[i], &Z1[i]);
		scanf("%d%d%d", &X2[i], &Y2[i], &Z2[i]);
	}
	int w = compress1(X1, X2);
	int h = compress2(Y1, Y2);
	int d = compress3(Z1, Z2);
	paint(w, h, d);
	
	ll ans = 0, t1, t2, t3;
	for(int x = 1;x < w;x++){
		for(int y = 1;y < h;y++){
			for(int z = 1;z < d;z++){
				if(fld[x][y][z] >= k){
					t1 = dx[x]-dx[x-1];
					t2 = dy[y]-dy[y-1];
					t3 = dz[z]-dz[z-1];
					ans += (ll)t1*t2*t3;
				}
			}
		}
	}
	
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 7356
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
// #define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long lint;
lint mod = 998244353;

int n,s,a[3030];
int dp[3030],ndp[3030],p2[3030];

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  

  cin >> n >> s;
  for(int i=1;i<=n;i++){
    cin >> a[i];
  }
  p2[0]=1;
  for(int i=1;i<=3000;i++){
    p2[i]=p2[i-1]*2%mod;
  }
  int ans = 0;
  dp[0]=1;
  for(int i=1;i<=n;i++){
    for(int j=0;j<=s;j++){
      if(a[i]+j<=s){
        ndp[a[i]+j] = (ndp[a[i]+j]+dp[j])%mod;
      }
      ndp[j] = (dp[j]*2%mod + ndp[j])%mod;
    }
    for(int j=0;j<=s;j++){
      dp[j]=ndp[j];
      ndp[j]=0;
    }
    // ans = (ans+ dp[s]*p2[n-i]%mod)%mod;
  }
  cout << dp[s] << endl;
  // cout << ans << endl;

return 0;
}
///....


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

int main(){

	int q;
	cin >> q;
	for (int i = 0; i < q; i++){

		int c, a, n;
		int count = 0;

		cin >> c >> a >> n;

		for (; c > 0 && a > 0 && n > 0; count++){
			c--; a--; n--;
		}
		for (; c >= 2 && a > 0; count++){
			c -= 2; a--;
		}
		for (; c >= 3; count++)
			c -= 3;

		cout << count << endl;
	}
}

Measured memory_bytes: 1164
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define MAX_V 400010
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
template<typename A, size_t NNN, typename T>
void Fill(A (&array)[NNN], const T &val){
    fill( (T*)array, (T*)(array+NNN), val );
}
#define INF 1e9+7
#define LLINF 1e18+7
ll MOD=1e9+7;
#define N 610000
ll n,m,k;
ll dp[4000][4000];
ll a[N];
ll b[N];
int main(){
    string s,t;
    cin>>s>>t;
    rep2(i,1,s.size()){
        rep2(j,1,t.size()){
            ll temp=0;
            if(s[i-1]==t[j-1]){
                temp=dp[i-1][j-1]+1;
            }
            temp=max(temp,dp[i-1][j]);
            temp=max(temp,dp[i][j-1]);
            dp[i][j]=temp;
        }
    }
    vector<char> ans;
    int now1=s.size(),now2=t.size();
    int temp=dp[s.size()][t.size()];
    while(now1||now2){
        if(now1&&dp[now1-1][now2]==temp) now1--;
        else if(now2&&dp[now1][now2-1]==temp) now2--;
        else {
            now1--;now2--;
            ans.pb(s[now1]);
            temp--;
        }
    }
    rep3(i,ans.size()-1,0){
        cout<<ans[i];
    }
    return 0;
}

Measured memory_bytes: 96512
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)



def make_primes(n): #nまでの素数列挙
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass  


def prime_decomposition(n): #素因数分解
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(int(n))
  return table

def make_divisors(n): #約数列挙
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

data = make_primes(10**6+1)

ppp = cl.defaultdict(int)

for i in range(len(data)):
    ppp[data[i]] = 1
n = onem()

a = l()

data = gcd_list(a)

if data != 1:
    print("not coprime")

else:
    a.sort()
    for i in range(n):
        po = prime_decomposition(a[i])
        po = s(po)
        fl = 0
        for j in range(len(po)):
            if po[j][0] == 1:
                continue
            if ppp[po[j][0]] == 1:
                ppp[po[j][0]] = 2
            else:
                fl = 1
        if fl:
            print("setwise coprime")
            break
    else:
        print("pairwise coprime")








Measured memory_bytes: 194192
#include <iostream>
using namespace std;
int main(void){
    string S;
    cin >> S;
    
    if(S[0] == S[1] && S[0] == S[2] && S[0] == S[3]){
        cout << "No" << endl;
        return 0;
    }    
    if(S[0] == S[1] && S[2] == S[3]){
        cout << "Yes" << endl;
        return 0;
    }
    if(S[0] == S[2] && S[1] == S[3]){
        cout << "Yes" << endl;
        return 0;
    }
    if(S[0] == S[3] && S[1] == S[2]){
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;
}


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

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

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

  int a, b, c;
  cin >> a >> b >> c;

  if (c <= a + b) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
from collections import deque

X = input()
N = len(X)
S = "S"
T = "T"
stack = deque("")

for i,str in enumerate(X):
  if str == S:
    stack.append(str)
  elif str == T:
    if len(stack) == 0:
      stack.append(str)
    elif stack[-1] == T:
      stack.append(str)
    elif stack[-1] == S:
      stack.pop()
      
print(len(stack))

Measured memory_bytes: 5092
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(obj) (obj).begin(),(obj).end() 
#define dump(x)  cout << #x << " = " << (x) << endl;
typedef long long lint;
using namespace std;
int main(){
	int n;
	cin>>n;
	map<int,int> s;
	for(int i=1;i<=n;i++){
		int v;
		cin>>v;
		s.insert(make_pair(v,i));
	}
	for(auto& itr:s)cout<<itr.second<<"  ";
	cout<<endl;
}


Measured memory_bytes: 5632
import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint
N, K = map(int, input().split())

1行のstring
S, T = input().split()

1行の整数配列
P = list(map(int,input().split()))

改行あり
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

N行M列の初期化
dp = [[INF] * M for i in range(N)]

'''


N = int(input())
C = list(map(int,input().split()))

# コストの小さいものから更新していけばいい
C.sort()

# 2のべき乗は先に計算しておく
beki = [1]
for i in range(1, 3*N+20):
    beki.append((beki[i-1]*2)%MOD)


ans = 0
for i in range(N):
    ans += (C[i] * beki[2*N-2] * (N-i+1))%MOD
    

print(ans % MOD)


Measured memory_bytes: 42120
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <cstdlib>
#include <random>
#include <chrono>
#include<iterator>
#include <locale>

#define debug(a) cerr << #a << " = " << a << endl;
/*,---.   ,--.                         ,--.
'   .-'  |  ,---.  ,--.,--. ,--.  ,--. `--'
`.  `-.  |  .-.  | |  ||  |  \  `'  /  ,--.
.-'    | |  | |  | '  ''  '   \    /   |  |
`-----'  `--' `--'  `----'     `--'    `--'*/
using namespace std;
vector<pair<int, int>> edj[100047];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    for(int i = 0;i<m;i++){
        int l, r, c;
        cin >> l >> r >> c;
        edj[l].push_back({r, c});
    }
    vector<long long> dp(n + 1, 0);
    dp[0] = 0;
    set<pair<long long, int>> better;
    for(int i = 1;i<=n;i++){
        if(better.empty() && i != 1){
            cout<<-1;
            return 0;
        }
        if(!better.empty()) {
            auto current_top = *better.begin();
            if (current_top.second >= i) {
                dp[i] = current_top.first;
            }
            if (current_top.second == i) {
                better.erase(better.begin());
            }
            if (current_top.second < i) {
                better.erase(better.begin());
                i--;
            }
        }
        for(auto x : edj[i]){
            better.insert({dp[i] + x.second, x.first});
        }
    }
    cout<<dp[n];
}

Measured memory_bytes: 13304
from itertools import groupby

s = input()
k = int(input())
r = len(s) * k // 2
a = [len(''.join(g)) & 1 for _, g in groupby(s)]
if len(a) > 1:
  r -= sum(a) * k // 2
  if s[0] == s[-1] and a[0] & a[-1]:
    r += k - 1
print(r)


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

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long s;
    cin>>s;
    vector<long long>a(6);
    a[3]=1000000000;
    a[5]=(a[3]-s%a[3])%a[3];
    a[4]=(s+a[5])/a[3];


    a[2]=1;


    for(int i=0;i<6;i++)cout<<a[i]<<' ';
   //cout<<(a[4]*a[3])-(a[5]*a[2])<<endl;
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<double> a(n);
  for (int i = 0;i < n;i++){
    cin >> a[i];
  }
  
  vector<double> b(n);
  for (int i = 0;i < n;i++){
    b[i] = 1/a[i];
  }
  double total;
  
  for (int i = 0;i < n;i++){
    total += b[i];
  }
  
  cout << fixed << setprecision(10);
  cout << 1/total << endl;
}

Measured memory_bytes: 3812
#include<stdio.h>
#include<string>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>

using namespace std;

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

ll a[105000];

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
	}
	sort(a, a + n, greater<ll>());

	int ope = 0;
	ll c = 0, d = 0;
	int i = 0;
	while (i < n - 1) {
		if (a[i] == a[i + 1]) {
			if (ope == 0)c = a[i];
			else d = a[i];
			ope++;
			i += 2;
		}
		else i++;
		if (ope == 2)break;
	}
	printf("%lld\n", c*d);

	return 0;
}

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

ll n,a[200001],ans;
map<ll,ll> mp;

int main() {

    cin>>n;
    for(ll i=1;i<=n;i++)
    {
        cin>>a[i];
        mp[i+a[i]]++;
        
        ans += mp[i-a[i]];
    }
    cout<<ans;
}


Measured memory_bytes: 27948
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    x, a, b = map(int, input().split())
    late = a - b
    if late >= 0:
        print("delicious")
    else:
        if x + late >= 0:
            print("safe")
        else:
            print("dangerous")


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 2940
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 参考書数
		int n = sc.nextInt();

		// 習得したいアルゴリズム数
		int m = sc.nextInt();

		// 習得目標理解度
		int x = sc.nextInt();

		// n番目の参考書の値段
		int[] costs = new int[n];

		// n番目の参考書のm番目のアルゴリズムの上昇理解度
		int[][] a = new int[n][m];

		// 入力の受け取り
		for (int i = 0; i < n; i++) {
			costs[i] = sc.nextInt();
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}

		// m番目のアルゴリズムの理解度、参考書コストのtmp変数と、loop毎の参考書コストを覚えておく変数、アルゴリズム習得達成したかの変数
		int[] aTmp = new int[m];
		int costTmp = 0;
		List<Integer> costsSave = new ArrayList<>();
		boolean mastered = true;

		/*
		 * ここからbit全探索
		 */
		for (int i = 0; i < 1 << n; i++) {
			// bit全探索の全通りのloop

			for (int j = 0; j < n; j++) {
				// 1loop毎にどの参考書を買うかの判定(j冊目を買うかどうか)

				if ((1 & i >> j) == 1) {
					// ここに引っかかった = 買う対象に追加(j冊目購入)

					for (int h = 0; h < m; h++) {
						// j冊目の参考書を買ったときのm番目のアルゴリズムの理解度上昇
						aTmp[h] += a[j][h];
					}

					// j冊目の値段
					costTmp += costs[j];

				}

			}

			// 参考書を買い終わったので、アルゴリズムを覚えられたかどうかの判定の上、値段を保持
			for (int h = 0; h < m; h++) {

				if (aTmp[h] < x) {
					// アルゴリズムを1つでも覚えられていない場合、NG
					mastered = false;
					break;
				}
			}

			if (mastered) {
				// 合計値段を一時格納
				costsSave.add(costTmp);
			}

			// 後始末
			for (int h = 0; h < m; h++) {
				aTmp[h] = 0;
			}
			costTmp = 0;
			mastered = true;

		}

		// listのうち最小の値を出力。リストがnullなら"-1"を出力
		int ans = Integer.MAX_VALUE;
		if (costsSave.isEmpty()) {
			ans = -1;
		} else {
			for (int cost : costsSave) {

				if (ans > cost) {
					ans = cost;
				}
			}
		}

		System.out.println(ans);

	}
}

Measured memory_bytes: 37908
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
	// freopen("input.txt", "r", stdin);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	cout << n / 2 - (n % 2 == 0) << endl;
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

/*-----------Main-----------*/

var ans []string

func main() {
	n, a, b, c := readI(), readI(), readI(), readI()
	s := readSs(n)
	s = append(s, "")

	for i := 0; i < n; i++ {
		switch s[i] {
		case "AB":
			a, b = witchcase(a, b, s[i], s[i+1])
		case "AC":
			a, c = witchcase(a, c, s[i], s[i+1])
		case "BC":
			b, c = witchcase(b, c, s[i], s[i+1])
		}
	}

	fmt.Println("Yes")
	for _, v := range ans {
		fmt.Println(v)
	}
}

func witchcase(x, y int, now, next string) (int, int) {
	switch {
	case x == 0 && y == 0:
		fmt.Println("No")
		os.Exit(0)
	case x == 0 && y != 0:
		ans = append(ans, string(now[0]))
		return x + 1, y - 1
	case x != 0 && y == 0:
		ans = append(ans, string(now[1]))
		return x - 1, y + 1
	}

	if nn(now, next) {
		ans = append(ans, string(now[0]))
		return x + 1, y - 1
	}
	ans = append(ans, string(now[1]))
	return x - 1, y + 1

}

func nn(now, next string) bool {
	switch now {
	case "AB":
		switch next {
		case "AC":
			return true
		case "BC":
			return false
		}
	case "AC":
		switch next {
		case "AB":
			return true
		case "BC":
			return false
		}
	case "BC":
		switch next {
		case "AB":
			return true
		case "AC":
			return false
		}
	}
	return true
}

/*-----------Utilities-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const maxBuf = 200100
	var buf []byte = make([]byte, maxBuf)
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBuf)
}

func debug() {
	testFile, err := os.Open("./test/sample-4.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error : There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readSs(a int) []string {
	b := make([]string, a)
	for i := 0; i < a; i++ {
		b[i] = readS()
	}
	return b
}

func readI() int {
	sc.Scan()
	r, _ := strconv.Atoi(sc.Text())
	return r
}

func readIs(a int) []int {
	b := make([]int, a)
	for i := 0; i < a; i++ {
		b[i] = readI()
	}
	return b
}

func readF() float64 {
	sc.Scan()
	r, _ := strconv.ParseFloat(sc.Text(), 64)
	return r
}

func readFs(a int) []float64 {
	b := make([]float64, a)
	for i := 0; i < a; i++ {
		b[i] = readF()
	}
	return b
}

func max(a []int) int {
	l := len(a)
	m := a[0]
	for i := 1; i < l; i++ {
		if a[i] > m {
			m = a[i]
		}
	}
	return m
}

func min(a []int) int {
	l := len(a)
	m := a[0]
	for i := 1; i < l; i++ {
		if a[i] < m {
			m = a[i]
		}
	}
	return m
}

func sortI(a []int) []int {
	sort.Ints(a)
	return a
}

func reverse(a []int) []int {
	l := len(a)
	r := make([]int, l)
	for i := 0; i < l; i++ {
		r[i] = a[l-i-1]
	}
	return r
}

func countI(a []int, b int) int {
	l := len(a)
	var c int
	for i := 0; i < l; i++ {
		if a[i] == b {
			c++
		}
	}
	return c
}


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

int main() {
    int x, y;
    cin >> x >> y;

    bool flag = false;
    for (int i = 0; i <= x; ++i) {
        int j = x - i;
        if (i * 2 + j * 4 == y)
            flag = true;
    }

    flag ? cout << "Yes" : cout << "No";
    cout << endl;

    return 0;
}

Measured memory_bytes: 3636
n,m = map(int,input().split())
a = list(map(int,input().split()))
l = [list(map(int,input().split())) for i in range(m)]
l = list(sorted(l,reverse=True,key=lambda x: x[1]))
b,c = [list(i) for i in zip(*l)]
d = [0] * n
x = min(n,sum(b))
y = 0
while x > 0:
    x -= 1
    d[x] = c[y]
    b[y] -= 1
    if b[y] == 0:
        y += 1
x = a + d
x.sort(reverse=True)
print(sum(x[:n]))

Measured memory_bytes: 40156
#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
int main()
{
    int a[50][50],b[50],c[50][50]={0},d[50]={0};
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        cin>>a[i][j];
    }
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    cin>>b[i];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            for(int k=0;k<3;k++)
            {
                if(b[i]==a[j][k])
                {
                    c[j][k]=1;
                }
            }
        }
    }
    int sum1=0,sum2=0,sum3=0,sum4=0;
    for(int i=0;i<3;i++)
    {
        sum1=0;
        for(int j=0;j<3;j++)
        {
            if(c[i][j]==1)
            {
                sum1++;
            }
            if(sum1==3)
            break;
        }
        if(sum1==3)
        break;
    }
    for(int i=0;i<3;i++)
    {
        sum2=0;
        for(int j=0;j<3;j++)
        {
            if(c[j][i]==1)
            {
                sum2++;
            }
            if(sum2==3)
            break;
        }
        if(sum2==3)
        break;
    }
    for(int i=0;i<3;i++)
    {
        if(c[i][i]==1)
        {
            sum3++;
        }
    }
    for(int i=0;i<3;i++)
    {
        if(c[i][2-i]==1)
        {
            sum4++;
        }
    }
    if(sum1==3||sum2==3||sum3==3||sum4==3)
    cout<<"Yes";
    else 
    cout<<"No";
    return 0;
}

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

int main() {
  const unsigned long long mod = 1000000007;
  unsigned n;
  std::cin >> n;
  std::vector<unsigned long long> inv(n + 2);
  inv[1] = 1;
  for (unsigned i = 2; i < n + 2; ++i) {
    inv[i] = mod - (mod / i) * inv[mod % i] % mod;
  }
  std::vector<unsigned long long> fact(n + 2);
  fact[0] = 1;
  for (unsigned i = 1; i < n + 2; ++i) {
    fact[i] = fact[i - 1] * i % mod;
  }
  std::vector<unsigned long long> inv_fact(n + 2);
  inv_fact[0] = 1;
  for (unsigned i = 1; i < n + 2; ++i) {
    inv_fact[i] = inv_fact[i - 1] * inv[i] % mod;
  }
  std::vector<unsigned long long> a(n + 1);
  for (unsigned i = 0; i < n + 1; ++i) {
    std::cin >> a[i];
  }
  std::vector<unsigned> place(n + 1, 0);
  unsigned s = 0, t = 0;
  for (unsigned i = 0; i < n + 1; ++i) {
    if (place[a[i]] == 0) {
      place[a[i]] = i + 1;
    } else {
      s = place[a[i]];
      t = i + 1;
      break;
    }
  }
  unsigned x = n + 1 - (t - s);
  for (unsigned k = 1; k <= n + 1; ++k) {
    unsigned long long hoge = fact[n + 1] * inv_fact[k] % mod;
    hoge *= inv_fact[n + 1 - k];
    hoge %= mod;
    if (x >= k) {
      unsigned long long fuga = fact[x - 1] * inv_fact[x - k] % mod;
      fuga *= inv_fact[k - 1];
      fuga %= mod;
      std::cout << (hoge > fuga ? hoge - fuga : hoge + mod - fuga) << std::endl;
    } else {
      std::cout << hoge << std::endl;
    }
  }
  return 0;
}

Measured memory_bytes: 5368
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;


public class Main {
  public static void main(String[] args) {
    FastScanner sc = new FastScanner();
    long x = sc.nextLong();
    
    long a = x / 11;
    long b = x % 11;
    
    if (b == 0) {
      System.out.println(a * 2);
    } else if (b <= 6) {
      System.out.println(a * 2 + 1);
    } else {
      System.out.println(a * 2 + 2);
    }
    
  }

}


class FastScanner {
	public static String debug = null;

	private final InputStream in = System.in;
	private int ptr = 0;
	private int buflen = 0;
	private byte[] buffer = new byte[1024];
	private boolean eos = false;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				if (debug != null) {
					buflen = debug.length();
					buffer = debug.getBytes();
					debug = "";
					eos = true;
				} else {
					buflen = in.read(buffer);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen < 0) {
				eos = true;
				return false;
			} else if (buflen == 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean isEOS() {
		return this.eos;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		return (int) nextLong();
	}

	public long[] nextLongList(int n) {
		return nextLongTable(1, n)[0];
	}

	public int[] nextIntList(int n) {
		return nextIntTable(1, n)[0];
	}

	public long[][] nextLongTable(int n, int m) {
		long[][] ret = new long[n][m];
		for (int i = 0; i < n; i ++) {
			for (int j = 0; j < m; j ++) {
				ret[i][j] = nextLong();
			}
		}
		return ret;
	}

	public int[][] nextIntTable(int n, int m) {
		int[][] ret = new int[n][m];
		for (int i = 0; i < n; i ++) {
			for (int j = 0; j < m; j ++) {
				ret[i][j] = nextInt();
			}
		}
		return ret;
	}
}

Measured memory_bytes: 8276
import bisect
N=int(input())
ue=list(map(int,input().split()))
naka=list(map(int,input().split()))
sita=list(map(int,input().split()))
sita.sort(),naka.sort(),ue.sort()
count2=[0]*N
count1=[0]*N
for i in range(N):
    m = naka[i]
    k=naka[i]
    small=bisect.bisect_left(ue,k)
    count1[i]=small
    big = bisect.bisect_right(sita, m)
    count2[i]=N-big
ans=0
for i in range(N):
    ans+=count1[i]*count2[i]
print(ans)


Measured memory_bytes: 24180
#!/usr/bin/python3
# coding: utf-8

# 整数 > 整数型
def I(): return int(input())

# 整数列 '1 2 3 4' > 整数型リスト
def IsIl(): return list(map(lambda x: int(x), input().split()))

# 改行挟む整数列　'1/n 2/n 3/n' > 整数型りすと
def InIl(n): return [input() for i in range(n)]

# 整数列 '1 2' > 整数型タプル
def IsIt(): return map(lambda x: int(x), input().split())

# 改行挟む整数列　'1\n 2\n 3\n' > 整数型たぷる
def InIl(n): return map(input() for i in range(n))

# 文字列 'abcd' > 文字型リスト
def SsSl(): return list(map(lambda x: x, input()))

# 整数 '1234' > 整数型リスト

# 文字列 'aba' > 辞書（文字型:個数）{'a':2,'b':1}
def SSd():
    from collections import defaultdict
    A = input() # [int(i) for i in input().split()]
    dd=defaultdict(int)
    for a in A:
        dd[a]+=1
    return dd

#リストにn個要素を読み込む

# その他アルゴリズムテンプレート
# https://qiita.com/chun1182/items/ddf2b6cba932b2bb0d4e


def alpha2num(c):
    return ord(c) - ord('A') + 1

def num2alpha(num):
    return chr(num + ord("A") - 1)

n = I()
s = input()

ans = ''
for item in s:
    num = alpha2num(item) + n
    if num > 26:
        num -= 26
    ans += num2alpha(num)

print(ans)



Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define p 1000000007
using namespace std;
unsigned long long power(unsigned long long x,
                         int y)
{
    unsigned long long res = 1; // Initialize result

    x = x % p; // Update x if it is more than or
    // equal to p

    while (y > 0) {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res * x) % p;

        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}
unsigned long long modInverse(unsigned long long n)
{
    return power(n, p - 2);
}
unsigned long long nCrModPFermat(unsigned long long n,
                                 int r)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    unsigned long long fac[n + 1];
    fac[0] = 1;
    for (int i = 1; i <= n; i++)
        fac[i] = (fac[i - 1] * i) % p;

    return (fac[n] * modInverse(fac[r]) % p * modInverse(fac[n - r]) % p) % p;
}


long long f(long long  n, long long  s) {
    long long  temp = (s-1) - 2*n;
    long long  below = (n-1);
    long long ans = nCrModPFermat(temp,below);
    return ans;
}

int main() {

    jaldi

    long long s;
    cin>>s;
    if(s<=2) {
        cout<<0<<'\n';
        return 0;
    }
    long long lim = (s/3);
    long long ans =0;
    for(int i=1;i<=lim;i++) {
        ans+=f(i,s);
    }
    cout<<ans%p<<'\n';
}


Measured memory_bytes: 3640
#pragma region head
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define test(s) \
  if (!(s))     \
    cout << "Line " << __LINE__ << ": [" << #s << "] is false" << endl;
#define int long long
typedef long long ll;
#define double long double
typedef double ld;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;
const double PI = acos(-1.0);

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
#pragma endregion

signed main() {
  int N, D;
  cin >> N >> D;
  vector<int> X(N), Y(N);

  int ans = 0;
  rep(i, N) {
    cin >> X[i] >> Y[i];
    ans += (X[i] * X[i] + Y[i] * Y[i] <= D * D);
  }
  cout << ans << endl;
}

Measured memory_bytes: 6376
import java.util.Scanner;

class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		
		if(A*B %2 ==0){
			System.out.println("No");
			
		}else{
			System.out.println("Yes");

		}
	}
}


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

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl

using namespace std;

typedef long long int lli;

lli stoll(string &s) {
    lli res = 0LL;
    REP (i, 0, s.size()) {
        res = res * 10 + s[i] - '0';
    }
    return res;
}

string lltos(lli n, int d) {
    string res = "";
    lli bs = 1;
    REP (i, 1, d) bs *= 10;
    REP (i, 0, d) {
        res += (n / bs) + '0';
        n %= bs;
        bs /= 10;
    }
    return res;
}

int main() {
    string s;
    cin >> s;
    int N = s.size();
    lli num = stoll(s);
    vector<bool> used(10, false);
    lli ans = 1LL << 60;
    lli dis = -1;
    lli bs = 1;
    REP (i, 0, N) bs *= 10;
    function<void(int, lli)> rec = [&](int idx, lli n) {
        if (idx == N) {
            lli d = min(abs(n - num), bs - abs(n - num));
            if (d > dis || (d == dis && n < ans)) {
                dis = d;
                ans = n;
            }
        } else {
            REP (i, 0, 10) {
                if (used[i]) continue;
                used[i] = true;
                rec(idx + 1, n * 10 + i);
                used[i] = false;
            }
        }
    };
    rec(0, 0LL);
    cout << lltos(ans, N) << endl;
    return 0;
}


Measured memory_bytes: 3224
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

// 解説放送より
// https://youtu.be/ENSOy8u9K9I?t=3667

const (
	D     int = 60
	MAX_N     = 200005
)

func main() {
	N, K := nextInt(), nextInt()
	// An := make([]int, N)
	to := make([][]int, D)
	for i := range to {
		to[i] = make([]int, MAX_N)
	}
	// to は jから2^i個先
	for i := 0; i < N; i++ {
		// ここで-1したので最後に+1する
		to[0][i] = nextInt() - 1
	}
	for i := 0; i < D-1; i++ {
		for j := 0; j < N; j++ {
			// ここの計算は表を見るとわかりやすい
			// 前の行(i行目）の、左からj番目の数字を見て、i行目の左から数えてその数字の位置にある数字を次の行に入れる
			to[i+1][j] = to[i][to[i][j]]
		}
	}
	cur := 0
	for i := D - 1; i >= 0; i-- {
		// 2^iをシフト演算で。
		l := 1 << uint(i)
		if l <= K {
			cur = to[i][cur]
			K -= l
		}
	}
	fmt.Println(cur + 1)
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}


Measured memory_bytes: 101280
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn main() {
    let n: usize = read();
    let mut h: Vec<u32> = read_vec();
    let mut ans = 0;
    for i in 0..n {
        while h[i] > 0 {
            ans += 1;
            for j in i..n {
                if h[j] == 0 {
                    break;
                }
                h[j] -= 1;
            }
        }
    }
    println!("{0}", ans);
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main() {
	int a, b, c;
	scanf("%d%d%d",&a,&b,&c);
	c=(a*100+b*10+c)%4;
	if (!c)printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 128