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

using namespace std;

#define MOD (int)(1e9 + 7)

int A[200'001];

int main()
{
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N;
    cin >> N;
    for (int i = 0; i < N; ++i)
        cin >> A[i];

    long long sum1 = 0ll;
    for (int i = 0; i < N; ++i)
        sum1 = (A[i] + sum1) % MOD;
    long long sum2 = 0ll;
    for (int i = 0; i < N; ++i)
        sum2 = (((long long)A[i] * A[i]) % MOD + sum2) % MOD;

    long long val = ((sum1 * sum1 % MOD - sum2) % MOD);
    if (val < 0)
        val += MOD;
    cout << (val * ((MOD >> 1) + 1)) % MOD;

    return 0;
}

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

typedef long long ll;
const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const double eps = 1e-9;

typedef pair<ll, ll> P;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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

    vector <string> a(n), b(n);

    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < m; i++) cin >> b[i];

    bool ok;

    for (int i = 0; i < (n-m)+1; i++) {
        for (int j = 0; j < (n-m)+1; j++) {
            bool ok = true;
            for (int k = 0; k < m; k++) {
                for (int l = 0; l < m; l++) {
                    if (a[i+k][j+l] != b[k][l]) {
                        ok = false;
                    }
                }
            }
            if (ok) {
                cout << "Yes" << endl;
                return 0;
            } 
        }
    }
    cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define ZERO (1e-10)
#define INF (1<<29)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define DEB printf("DEB!\n");
#define D(X) cout<<"  "<<#X": "<<X<<endl;
#define EQ(A,B) (A+ZERO>B&&A-ZERO<B)
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define IN(n) int n;scanf("%d",&n);
#define FOR(i, m, n) for (int i(m); i < n; i++)
#define REP(i, n) FOR(i, 0, n)
#define F(n) REP(i, n)
#define FF(n) REP(j, n)
#define FT(m, n) FOR(k, m, n)
#define aa first
#define bb second
void ga(int N,int *A){F(N)scanf("%d",A+i);}
#define MX (222222)
struct UF{
    int C[MX],R[MX],W;
    int geco(int a){return C[a]=(a==C[a]?a:geco(C[a]));}
    bool con(int a,int b){
        if(geco(a)==geco(b))return 0;
        if(R[C[a]]>R[C[b]])C[C[b]]=C[a];
        else R[C[b]]+=R[C[a]]==R[C[b]],C[C[a]]=C[b];
        return --W,1;
    }
    void CLR(int N){(iota(C,C+N,0),CL(R,0),W=N);};
}A,B;
int N,M,Q,a,b,O[MX];
vi G[MX],H[MX],c;
void pro(vi&a){
    for(auto&h:a)H[B.geco(h)].PB(h);
    for(auto&h:a)O[h]=H[B.geco(h)].size();
    for(auto&h:a)H[B.geco(h)].clear();
}
int main(void){
    scanf("%d%d%d",&N,&M,&Q);
    A.CLR(N),B.CLR(N);
    F(M)scanf("%d%d",&a,&b),A.con(--a,--b);
    F(Q)scanf("%d%d",&a,&b),B.con(--a,--b);
    F(N)G[A.geco(i)].PB(i);
    for(auto&h:G)if(!h.empty())pro(h);
    F(N)printf("%d%c",O[i],i+1==N?10:32);
    return 0;
}


Measured memory_bytes: 26496
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int h,w,n;
    cin >> h >> w >> n;
    if (h<w) swap(h,w);
    int ans;
    if (n%h==0) ans=n/h;
    else ans=n/h+1;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MAX 2000005
#define MOD 1000000007
#define MOD2 998244353
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define vi vector<ll>
#define vp vector<pii>
#define all(v) v.begin(),v.end()
#define sz(x) (ll)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(ll i=a;i<b;++i)
#define ROF(i,a,b) for(ll i=a;i>=b;--i)
#define trace(x) cerr<<#x<<": "<<x<<'\n';
typedef long long ll;
using namespace std;
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

ll mexp(ll a, ll b){
    ll ans=1;
    a%=MOD;
    while(b){
        if(b&1) ans=ans*a%MOD;
        b>>=1;
        a=a*a%MOD;
    }
    return ans;
}

const int N = 100005;

bool cmp1(pair<int,pair<int,int>>a, pair<int,pair<int,int>>b){
    return a.S.F<b.S.F;
}

bool cmp2(pair<int,pair<int,int>>a, pair<int,pair<int,int>>b){
    return a.S.S<b.S.S;
}

pair<int,pair<int,int>>c[N];
int par[N],siz[N];

int find(int x){
    while(par[x]!=x){
        x=par[x];
    }
    return x;
}

void un(int a,int b){
    a=find(a);
    b=find(b);
    if(siz[a]<siz[b]){
        par[a]=par[b];
        siz[b]+=siz[a];
    }
    else{
        par[b]=par[a];
        siz[a]+=siz[b];
    }
}

int main(){
    IOS

    int n;
    cin>>n;
    FOR(i,1,n+1){
        par[i]=i;
        siz[i]=1;
        c[i].F=i;
        cin>>c[i].S.F>>c[i].S.S;
    }

    vector<pair<int,pair<int,int>>>v;

    sort(c+1,c+n+1,cmp1);

    FOR(i,1,n){
        v.pb(mp(c[i+1].S.F-c[i].S.F,mp(c[i].F,c[i+1].F)));
    }
    sort(c+1,c+n+1,cmp2);
    FOR(i,1,n){
        v.pb(mp(c[i+1].S.S-c[i].S.S,mp(c[i].F,c[i+1].F)));
    }
    sort(all(v));

    int cnt=0;
    int i=0;
    ll ans=0;
    while(cnt<n-1){
        int x=find(v[i].S.F),y=find(v[i].S.S);
        if(x==y){
            i++;
            continue;
        }
        un(x,y);
        ans+=v[i].F;
        i++;
        cnt++;
    }
    cout<<ans;

    cerr<<"Time: "<<1.0/CLOCKS_PER_SEC<<" ms"<<endl;
    return 0;
}

Measured memory_bytes: 6900
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;

const int N = 1e5;
vector<vector<int>> g(N);
using Value = int;
// 戻るかどうか
map<int, Value> dp[N][2];
using P = pair<int, int>;
vector<P> mi0(N, P(0, -1)), mi1(N, P(0, -1));
int calced[N];
int n;
Value dfs(int i, int x, int p, int f = 0) {
  if(dp[i][x].count(p)) return dp[i][x][p];
  int cnt = 0;
  Value res = 0;
  if(f || p == -1) {
    // O(deg(i))
    // go only child
    int mi = 0;
    for(int j : g[i]) if(j != p) {
      cnt++;
      int d = 2 + dfs(j, 1, i, f);
      res += d;
      int m = - d + (1 + dfs(j, 0, i, f));
      mi = min(mi, m);
      if(p == -1 && !calced[i]) {
        P r(m, j);
        if(mi0[i] > r) {
          mi1[i] = mi0[i];
          mi0[i] = r;
        } else if(mi1[i] > r) {
          mi1[i] = r;
        }
      }
    }
    if(p == -1) calced[i] = 1;
    if(!x) {
      res += mi;
    }
  } else {
    // O(1)
    cnt = g[i].size() - 1;
    if(x) {
      res = dfs(i, 1, -1, f);
    } else {
      res = dfs(i, 0, -1, f);
      if(mi0[i].second == p) {
        res -= mi0[i].first;
        res += mi1[i].first;
      }
    }
    res -= 2 + dfs(p, 1, i, f);
  }
  return dp[i][x][p] = res;
}
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  cin >> n;
  for(int i = 0; i < n - 1; i++) {
    int a, b; cin >> a >> b; a--; b--;
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  dfs(0, 0, -1, 1);
  dfs(0, 1, -1, 1);
  cout << fixed << setprecision(8);
  for(int i = 0; i < n; i++) cout << dfs(i, 0, -1) << endl;
  return 0;
}



Measured memory_bytes: 63364
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define INF 999999999999999997;
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORL(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
//for gcc (未test)
// #define FOREACH_IT(it,c) for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
// for Debug.
#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}
// 入力をpush_back(d)やarray[d]に使う時に1行で書ける
// int INPUT_INT() {int d;cin>>d;return d;}
template<class T>T IN() { T d; cin >> d; return d; }
// 最大公約数（Greatest Common Divisor）
LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; }
// 最小公倍数（Least Common Multiple）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
// Y年はうるう年か否か
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); }

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

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------


int main() {
	FAST_IO;
	// for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;
	bool dbgF = true;

	//コードはここから書く.
	LL X, Y, Z;
	cin >> X >> Y >> Z;
	LL now_get_cm = Z;
	LL ans = 0;
	while (1) {
		now_get_cm += Z + Y;
		if (now_get_cm > X) {
			break;
		}
		ans++;
	}
	cout << ans << endl;

	return 0;
}


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

int main() {
   int N;
   float v, tot = 0;
   char S[10];
   scanf("%d", &N);
   while (N--) {
      scanf("%f %s", &v, S);
      if (S[0] == 'J')
         tot += v;
      else
         tot += v * 380000.0;
   }//while
   printf("%f\n", tot);
   return 0;
}//main


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

const int maxn=2e5+9;
int n,m;
int a[maxn],b[maxn],k;

void _solve(){
    scanf("%d%d%d",&n,&m,&k);
    int i,j;
    for(i=1;i<=n;++i) scanf("%d",a+i);
    for(i=1;i<=m;++i) scanf("%d",b+i);
    int t=0;
    for(i=1;i<=n;++i){
        if(t+a[i]>k) break;
        t+=a[i];
    }
    i-=1;
    for(j=1;j<=m;++j){
        if(t+b[j]>k) break;
        t+=b[j];
    }
    j-=1;
    int ans=i+j;
    for(;i>=1;--i){
        t-=a[i];
        while(j+1<=m && t+b[j+1]<=k){
            j+=1;
            t+=b[j];
        }
        ans=max(ans,i-1+j);
    }
    printf("%d\n",ans);
}

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


Measured memory_bytes: 5376
// #Sazaの1日1AC
#include<bits/stdc++.h>
using namespace std;
const long long mod=1000000000+7;
const long long INF=9e18;
const double PI=3.14159265358979323846;

//マクロ
//型エイリアス
using ll = long long;
using P=pair<long long,long long>;
using vl=vector<long long>;
using vvl=vector<vector<long long>>;
using vP=vector<pair<long long, long long>>;
//ショートカット
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,k,n) for(int i=k;i<n;i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
//入力
#define vin(v,N) for(long long i=0;i<N;i++) cin>>v.at(i)
#define lin(n) long long n;cin>>n
#define chin(x) char x;cin>>x;
#define sin(s) string s;cin>>s;
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)

#define max(a,b) max((ll)a,(ll)b)
#define min(a,b) min((ll)a,(ll)b)

//関数
//最大公約数
long long gcd(long long m, long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m, long long n){
  return m*n/gcd(m,n);
}
//xのn乗
long long power(long long x, long long N){
  long long ret=1;
  for(long long i=0;i<N;i++)   
    ret*=x;
  return ret;
}
//繰り返し二乗法
long long repeat_squaring(long long x, long long n){
  if(n==0) return 1;
  else if(n%2==0){
    long long t=repeat_squaring(x,n/2);
    return t*t%mod;
  }
  else
    return x*repeat_squaring(x,n-1);
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//構造体
//Union-Find木
struct UnionFind{
  //メンバ変数 
  vector<long long>par; //par[i]:=頂点iの親
  vector<long long>s; //s[i]:=頂点iが属する集合の個数(iが根のとき)
  
  //コンストラクタ
  UnionFind(long long N):par(N),s(N){
    for(long long i=0;i<N;i++){
      par[i]=i; //最初はすべてが根として初期化
      s[i]=1;
    }
  }
  //メンバ関数
  //root(i):=頂点iの根
  long long root(long long i){
    if(par[i]==i) return i;
    par[i]=root(par[i]); //経路圧縮
    return root(par[i]); //再帰
  }
  //size[i]:=iが属する集合の個数
  long long size(long long i){
    return s[root(i)];
  }
  //same(x,y) xとyが同じ根を持つか(同じ集合に含まれるか)
  bool same(long long x, long long y){
    return root(x)==root(y);
  }
  //unite(x,y) xの根をyの根に繋げる(集合を合併)
  void unite(long long x, long long y){
    if(!same(x,y)){
      long long rx=root(x);
      long long ry=root(y);
      par[rx]=par[ry];
      s[ry]=s[rx]+s[ry];
    }
  }
};
//////////////////ここまでライブラリ///////////////////////

//メイン関数
int main(){
  //doubleの桁数
  cout<<fixed<<setprecision(10);
  
  
  sin(s);
  if( s[2] == s[3] && s[4] == s[5])
    cout << "Yes";
  else
    cout << "No";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <map>
#include <algorithm> 
#include <vector> 
#include <string.h> 
#include <math.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <chrono> 
#include <thread> 
#include <iomanip>
#include <typeinfo>
 
//define
#define trav(i,v)   for(auto i: v)
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define all(v)  v.begin(), v.end()
#define itn int 

//typedef
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, int > > vpp;
 
const long long MOD = 1000000007;
// const long long MOD = 998244353;
const long long inf = 1e18;
 
using namespace std;

ll modpow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1) res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}
 
ll power(ll x, ll n)
{
    ll res=1;
    while(n>0){
        if(n&1) res=res*x;
        x=x*x;
        n>>=1;
    }
    return res;
}

void solve()
{
    int n;
    cin>>n;
    vll v(n+1);
    repu(i,1,n)
    {
        cin>>v[i];
    }
    ll m=1000;
    ll f=0;
    repu(i,1,n)
    {
        if(i<n && v[i+1]>=v[i])
        {
            if(f==0)
            {
                f=m/v[i];
                m-=f*v[i];
            }
        }
        else if(i==n || v[i+1]<v[i])
        {
            if(f)
            {
                m+=f*v[i];
                f=0;
            }
        }
    }
    cout<<m<<endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int t = 1, tt=1;
    // cin>>t;
    while(tt<=t)
    {
        // cout<<"Case #"<<tt<<": ";
        solve();
        tt++;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}   

Measured memory_bytes: 3840
N,M=(map(int, input().split()))
A=[1]*(N+1)
for i in range(M):
  K=int(input())
  A[K]=0
  
#print(N,M,A)

for j in range(2,N+1):
  if A[j]!=0:
    A[j]=A[j-1]+A[j-2]
    
#print(A)
print(A[N]%(10**9+7))

Measured memory_bytes: 460020
N,K = map(int,input().split())

AB = [list(map(int,input().split())) for i in range(N)]
AB = sorted(AB,key=lambda a:a[0])
tmp = 0
for i in range(N):
    if K <= tmp:
        break
    tmp += AB[i][1]
    ans = AB[i][0]
print(ans)

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

int main() {
  int a,b,c;
  //string s;
  cin>>a>>b;
  //cin>>s;
if(a-b ==0|| b-a==0)
{
  cout<<0<<endl;
}
else if((a+b)%2==0)
{
  cout<<(a+b)/2<<endl;
}

else
{
  cout<<"IMPOSSIBLE"<<endl;
}
  
}

Measured memory_bytes: 256
N = gets.to_i
A = N.times.map { |_| gets.to_i }
first = A.max
first_count = A.sort_by { |v| -v }[0,2].uniq.length == 2 ? 1 : 2

tmp = A.dup.tap { |v| v.delete(first) }
second = tmp.max

A.each do |v|
  puts (v != first) || (v == first && first_count == 2) ? first : second
end


Measured memory_bytes: 10032
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


# l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
# c = collections.Counter(l)

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

# リストの要素を改行を挟んで表示する
p2D = lambda x: print(*x, sep="\n")
# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))


s,w =MI()
if s>w:
	print('safe')
else:
	print('unsafe')













Measured memory_bytes: 67952
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

string s;
int ans=0;

int main()
{
	cin>>s;
	rep(i,s.size())
	{
		for(int j=i;j<s.size();j++)
		{
			bool ok=true;
			for(int k=i;k<=j;k++) if(s[k]!='A'&&s[k]!='C'&&s[k]!='G'&&s[k]!='T') ok=false;
			if(ok) ans=max(ans,j-i+1);
		}
	}
	cout<<ans<<endl;
	rt0;
}

Measured memory_bytes: 256
/*
  _    _ _      _ _      _ _      
 | |__| | | _ _| | | _ _| | | ___
 | '_ \_  _| ' \_  _| ' \_  _(_-< 
 |_.__/ |_||_||_||_||_||_||_|/__/

*/

#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 db(x) cout << #x << "=" << x << '\n'
#define rep(i, k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(x) scanf("%s", x)
#define pi(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define ps(x) printf("%s\n", x)
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define F first
#define S second
#define pb push_back
#define ll long long

#define X real()
#define Y imag()
#define angle(a)                (atan2((a).imag(), (a).real()))
#define vec(a,b)                ((b)-(a))
#define same(p1,p2)             (dp(vec(p1,p2),vec(p1,p2)) < EPS)
#define dp(a,b)                 ( (conj(a)*(b)).real() )	// a*b cos(T), if zero -> prep
#define cp(a,b)                 ( (conj(a)*(b)).imag() )	// a*b sin(T), if zero -> parllel
#define length(a)               (hypot((a).imag(), (a).real()))
#define normalize(a)            (a)/length(a)
//#define polar(r,ang)            ((r)*exp(point(0,ang)))  ==> Already added in c++11
#define rotateO(p,ang)          ((p)*exp(point(0,ang)))
#define rotateA(p,ang,about)  (rotateO(vec(about,p),ang)+about)
#define reflectO(v,m)  (conj((v)/(m))*(m))


typedef pair<int, int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef complex<double> point;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const double PI  = acos(-1.0);
const double EPS = 1e-9;
const int mod = 1000000007;
const int N = 3e5 + 7, M = N, OO = 1e9 + 7;
const ll LLOO = 1e18 + 7;

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

vi g[N];
int n,a[N],d1[N],d2[N];

void solve()
{
	si(n);
	rep(i,0,n)
	{
		si(d1[i]);
		si(d2[i]);
	}
	
	rep(i,0,n-2)
	{
		if (d1[i] == d2[i] && d1[i+1] == d2[i+1] && d1[i+2] == d2[i+2])
		{
			puts("Yes");
			return;
		}
	}
	puts("No");
}

int main()
{
    // uncomment if file :
    // freopen("in","r",stdin);
    // freopen("out","w",stdout);
    int t = 1;
    // si(t); // uncomment if testcases
    while (t--)
        solve();
    return 0;
}


// btw i use arch


Measured memory_bytes: 10724
// Implementation practice (Have seen the editorial)
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef set<int> si;
typedef priority_queue<int> pqi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define loop(i, a) for (int i = 0; i < (a); i++)
#define loop1(i, a) for (int i = 1; i <= (a); i++)
#define loopr(i, a, b) for (int i = (a); i <= (b); i++)
#define dloop(i, a) for (int i = (a) - 1; i >= 0; i--)
#define dloopr(i, b, a) for (int i = (b); i >= (a); i--)
#define show(a) cout << a << "\n"
#define showloop(a, len) for (int i = 0; i < len; i++) cout << a[i] << "\n"
#define itloop(a, len) for (int i = 0; i < len; i++) cout << a[i] << "\n"
#define debug(a) cout << #a << ": " << (a) << "\n"
#define mem(x, val) memset((x), (val), sizeof(x));
#define sz(x) ((int)x.size())
#define ran(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))
const int MOD = 1000000007;
const double PI = acos(-1);

int main() {
	//freopen("in", "r", stdin);
	//freopen("out", "w", stdout);
	ios::sync_with_stdio(false);cin.tie(NULL);

	string num;
	cin >> num;
	if ((num[0] == '9') || (num[1] == '9')) show("Yes");
	else show("No");

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <stack>
#include <unordered_set>
#include <numeric>
#include <iterator>
#include <unordered_map>
#include <array>
#include <map>
#include <cstring>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cmath>
#include <ctgmath>
#include <set>

using namespace std;

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

	string s, t;
	cin >> s >> t;

	map<char, int> a;
	map<char, int> b;

	for (auto i : s)
	{
		a[i]++;
	}
	for (auto i : t)
	{
		b[i]++;
	}

	vector<int> arr1, arr2;

	for (auto i : a)
	{
		arr1.push_back(i.second);
	}
	for (auto i : b)
	{
		arr2.push_back(i.second);
	}

	sort(arr1.begin(), arr1.end());
	sort(arr2.begin(), arr2.end());

	for (int i = 0; i < arr1.size(); i++)
	{
		if (arr1[i] != arr2[i])
		{
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";

}

Measured memory_bytes: 916
#include <iostream>
#include <string>

using namespace std;

string s, t;

int rotation() {

    char x = s[s.length() - 1];

    for (int i = s.length() - 1; i >= 0; i--) {
        if (i == 0) {
            s[i] = x;
        } else {
        s[i] = s[i - 1];
        }
    }
    return 0;
}

int main()
{
    cin >> s >> t;
    string ret = "No";

    for (int i = 0; i < s.length(); i++) {
        rotation();
        if (s == t) {
            ret = "Yes";
            break;
        }
    }

    cout << ret << endl;

    return 0;
}

Measured memory_bytes: 888
/*
 * DATE : 2017-06-18
 * Algo :
*/
#include<bits/stdc++.h>
using namespace std;
/*------- Constants---- */

#define Long                    long long
#define Ulong                   unsigned long long
#define FOR(I,A,B)              for(long long i=0; i < n ; i++ )
#define REP(i,n)                for(long long i=0; i < n ; i++ )
#define mp                      make_pair
#define pb                      push_back
#define all(x)                  (x).begin(),(x).end()
#define PI                      acos(-1.0)
#define EPS                     1e-9
#define F                       first
#define S                       second
#define di(x)                   int x; input(x)
#define in(x)                   input(x)
#define in2(x,y)                in(x),in(y)
#define in3(x,y,z)              in(x),in2(y,z)
#define lc                      ((n)<<1)
#define rc                      ((n)<<1|1)
#define db(x)                   cout << #x << " -> " << x << endl;
#define ms(ara_name,value)      memset(ara_name,value,sizeof(ara_name))
#define IO                      ios_base::sync_with_stdio(0);cin.tie(0)
#define READ                    freopen("in.txt","r",stdin)
#define WRITE                   freopen("out.txt","w",stdout)
template<class T> inline void input(T &x) {
    register char c = getchar();x = 0;
    int neg = 0;
    for(; ((c<48 || c>57) && c != '-'); c = getchar());
    if(c=='-'){neg = 1;c = getchar();}
    for(; c>47 && c<58 ; c = getchar()){x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x = -x;
}
inline long long bigmod(long long p,long long e,long long M){
    long long ret = 1;
    for(; e > 0; e >>= 1){
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}

/***************************** END OF TEMPLATE *******************************/
const int N = 1e5+5;
int a[N];
set<int> s;

int main()
{

    int n;
    cin >> n;
    for(int i = 0; i < n; i ++ ) {
        cin >> a[i];
    }
    sort(a,a+n);
    for(int i = 0; i < n; i ++ ) s.insert(a[i]);
    if(s.size() == 1 ) {
        int k = a[0];
        if(k <= n/2) printf("Yes\n");
        else if(k == n-1) printf("Yes\n");
        else printf("No\n");
    }
    else {
        if(s.size() == 2 ) {
            int iMin = *s.begin(), iMax = *s.rbegin();
            if(iMax - iMin > 1) printf("No\n");
            else {
                int ptr = 0;
                for(int i = 0; i < n; i ++ ) if(a[i] == iMin ) ptr ++;
                int high = iMin;
                int low = high;
                if(n >= 2*iMin + 1) low = 1;
                else low = 2*iMin + 1 - n + 1;
                if(ptr >= low && ptr <= high ) printf("Yes\n");
                else printf("No\n");

            }
        }
        else printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 5376
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public static void Main(){
        var a = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var A = a[0];
        var B = a[1];
        var C = a[2];
        var X = a[3];
        var Y = a[4];
        
        var list = new List<long>();
        var ab = 0;
        while(X >= 0 || Y >= 0){
            var temp = A * Math.Max(0,X) + B * Math.Max(0,Y) + C * ab;
            list.Add(temp);
            ab += 2;
            X--;
            Y--;
        }
        Console.WriteLine(list.Min());
    }
}


Measured memory_bytes: 12896
import queue

n,m,q = map(int, input().split())
g = []
for i in range(q):
    a,b,c,d = map(int, input().split())
    g.append([a,b,c,d])

q = queue.Queue()
q.put([1])
while not q.empty():
    p = q.get()
    if len(p)==n+1:
        q.put(p)
        break
    for i in range(p[-1],m+1):
        q.put(p+[i])

ans = 0
while not q.empty():
    p = q.get()
    score = 0
    for a,b,c,d in g:
        if p[b]-p[a] == c:
            score += d
    ans = max(score,ans)

print(ans)





Measured memory_bytes: 110564
def main():
    N = int(input())
    r = ''
    while N > 0:
        if N%26 == 0:
            r = 'z' + r
        else:
            r = chr(ord('a') + (N%26) - 1) + r
        N = (N-1)//26
    return r
print(main())


Measured memory_bytes: 9164
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
const int MOD = 1e9+7;
#define PI 3.14159265359
typedef long long ll;
using namespace std;

ll num[5];

int main(){
	ll n;
	cin >> n;
	for (int i = 0; i < n; i++){
		string s;
		cin >> s;
		if (s[0] == 'M') num[0]++;
		if (s[0] == 'A') num[1]++;
		if (s[0] == 'R') num[2]++;
		if (s[0] == 'C') num[3]++;
		if (s[0] == 'H') num[4]++;
	}

	ll ans = 0; 
	for (int i = 0; i < 3; i++){
		for (int j = i+1; j < 4; j++){
			for (int k = j+1; k < 5; k++){
				ans += num[i]*num[j]*num[k];
			}
		}
	}
	cout << ans << endl;
	return  0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
#define ll long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;
const int d[]={2,3,5,7};
int n,a[1000005];
int gcd(int a,int b){
	if(!b) re a;
	else re gcd(b,a%b);
}
bool set_coprime=0,pair_coprime=1; 
int cnt[1000005];
signed main(){
	ios_base::sync_with_stdio(0);
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	int res=a[0];
	for(int i=1;i<n;i++) res=gcd(res,a[i]);
	if(res==1) set_coprime=1;
	bool should_break=0;
	for(int i=0;i<n;i++){
		vector<int> v;
		v.pb(a[i]);
		for(int j=0;j<4;j++){
			if(a[i]%d[j]==0){
				v.pb(d[j]);
				v.pb(a[i]/d[j]);
			}
		}
		sort(all(v));
		v.erase(unique(all(v)),v.end());
		for(int i=0;i<sz(v);i++){
			//cout<<v[i]<<"\n";
			if(v[i]==1) continue;
			cnt[v[i]]++;
			if(cnt[v[i]]>1){
				pair_coprime=0;
				should_break=1;
				break;
			}
		}
		if(should_break) break;
	}
	if(pair_coprime) cout<<"pairwise coprime";
	else cout<<(set_coprime?"setwise coprime":"not coprime");
	re 0;
}

Measured memory_bytes: 7784
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_v(size_t a, Ts... ts) {return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); }

template<typename T,typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v){ t = v; }

template<typename T,typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v){ for(auto &e : t) fill_v(e, v); }

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = 1e9 + 7;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    cout << 180 * (n-2) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const ll INF=1e18;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  ll n,m,q;
  cin >> n >> m >> q;
  vector<vector<ll>>s(n+1,vector<ll>(n+1,0));
  
  rep(i,m){
    ll l,r;
    cin >> l >> r;
    s[l][r]++;
  }
  rep(i,n)rep(j,n)s[i+1][j+1]+=s[i][j+1];
  rep(i,n)rep(j,n)s[i+1][j+1]+=s[i+1][j];
  rep(i,q){
    ll a,b;
    cin >> a >> b;
    cout << s[b][b]-s[a-1][b]-s[b][a-1]+s[a-1][a-1] << endl;
  }
}

Measured memory_bytes: 2944
# n = int(input())
# s = input()
n, k = map(int,input().split())
da = list(map(int,input().split()))
# a = [int(input()) for i in range(n)]

ans = da[0] + n-da[-1]
for i in range(k-1):
    ans = max(ans, da[i+1]-da[i])
print(n-ans)

Measured memory_bytes: 26420
/**/
#include <bits/stdc++.h>
using namespace std;
/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compile and get accepted.
 *      ____________
 *     /            \
 *    /  /\      /\  \
 *   /  /  \    /  \  \
 *   \                /
 *    \     \___/    /
 *     \____________/
 */
const long long mod = 1000000007;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	int N,L;
	cin>>N>>L;
	vector<int> a(N);
	int ind = -1;
	for(int i = 0;i < N;i++)
		cin>>a[i];
	for(int i = 0;i + 1 < N;i++){
		if(a[i] + a[i+1] >= L)
			ind = i;
	}
	if(ind == -1){
		cout<<"Impossible\n";
		return 0;
	}
	cout<<"Possible\n";
	for(int i = 0;i < ind;i++){
		cout<<i+1<<'\n';
	}
	for(int i = N-1;i-1 > ind;i--){
		cout<<i<<'\n';
	}
	cout<<ind+1<<'\n';
	return 0;
}
/**/


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    vector<int> a(0);
    while (true){
        int ai;
        cin >> ai;
        if (ai == -1) break;
        a.push_back(ai);
    }
    for (int i=0;i<a.size();i++){
        if (a.at(i)<10) cout << 4280-1150 << endl;
        else if (a.at(i)<20) cout << 4280-(1150+(a.at(i)-10)*125) << endl;
        else if (a.at(i)<30) cout << 4280-(2400+(a.at(i)-20)*140) << endl;
        else cout << 4280-(3800+(a.at(i)-30)*160) << endl;
    }
}



Measured memory_bytes: 3000
import sys
input = sys.stdin.readline
import math

N, X = map(int,input().split())
x = list(map(int,input().split()))

d = [abs(X-x[i]) for i in range(N)]
oppai = d[0]

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a


for i in range(N-1):
    oppai = gcd(oppai,d[i+1])

print(oppai)

Measured memory_bytes: 14252
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

typedef long long ll;

int main() {
  ll H, N;
  cin >> H >> N;
  vector<ll> A(N);
  vector<ll> B(N);

  for (ll i = 0; i < N; i++) {
    cin >> A[i];
    cin >> B[i];
  }

  ll HMAX = 200000 + 1;
  ll MAX = 100000000 + 1;
  vector<ll> dp(HMAX, MAX);
  dp[0] = 0;

  for (ll i = 0; i < H; i++) {
    for (ll j = 0; j < N; j++) {
      if (i + A[j] < HMAX) {
        dp[i + A[j]] = min(dp[i + A[j]], dp[i] + B[j]);
      }
    }
  }

  ll ans = MAX;
  for (ll i = H; i < (ll)dp.size(); i++) {
    ans = min(ans, dp[i]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		final int N = s.nextInt();
		final int M = s.nextInt();

		boolean[] hasRouteFrom1 = new boolean[N];
		boolean[] hasRouteToN = new boolean[N];
		for(int i = 0 ; i < M; i++) {
			int from = s.nextInt();
			int to = s.nextInt();

			if(from == 1) {
				hasRouteFrom1[to] = true;
			}
			if(to == N) {
				hasRouteToN[from] = true;
			}
		}

		boolean possible = false;
		for(int i = 0; i < N; i++) {
			if(hasRouteFrom1[i] && hasRouteToN[i]) {
				possible = true;
			}
		}

		if(possible) {
			System.out.println("POSSIBLE");
		} else {
			System.out.println("IMPOSSIBLE");
		}

	}

}


Measured memory_bytes: 93732
//Author: Fuadul Hasan(fuadul202@gmail.com)
#include<bits/stdc++.h>
using namespace std;

#define ll long long
const int N   = 2e5 + 5;

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

	if(s[0] == 'R' and s[1] == 'R' and s[2] == 'R'){
		cout<<3<<endl;
	}else if(s[1] != 'R' and (s[0] == 'R' or s[2] == 'R')){
		cout<<1<<endl;
	}else if(s[0] == 'R' and s[1] == 'R'){
		cout<<2<<endl;
	}else if(s[1] == 'R' and s[2] == 'R'){
		cout<<2<<endl;
	}else if(s[0] == 'R' or s[1] == 'R' or s[2] == 'R'){
		cout<<1<<endl;
	}
	else{
		cout<<0<<endl;
	}

	

	return 0;
}

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

using ll = long long int;
using bigint = int64_t;

#define pll pair<ll, ll>
#define vll vector<ll>
#define vpll vector<pll>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) cin >> t;while(t--)
#define bitcount __builtin_popcount
#define endl "\n"
#define sz(s) (int)s.size()
#define mem(n,m) memset(n,m,sizeof(n))
#define deb(x) cout << #x << " = " << x << endl;
#define rep(i,n) for(ll i = 0; i < n; i++)
#define ren(i,n) for(ll i = n-1; i >= 0; i--)
#define all(x) x.begin(),x.end()
#define fo(i, a, b) for(ll i = a; i <= b; i++)
#define ffo(i, a, b) for(ll i = a; i >= b; i--)
#define ffi(i,a,b,c) for(ll i = a ; i <= b ; i += c)
#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const int MOD = 1000000007;

void io_set(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

void solve(){
    long double l, ans;
    cin >> l;
    ans = ((l*l*l) / 27);
    cout << fixed << setprecision(10) << ans << endl;
}

int main(){
    IOS;
    //io_set();
    ll tt = 1;
    //cin >> tt;
    while(tt--){
        solve();
    }
    return 0;
} 

Measured memory_bytes: 256
N, L = map(int, input().split())
if L > 0:
    a = range(L, L + N)
    print(sum(a) - L)
else:
    if L + N - 1 >= 0:
        a = range(L, L + N)
        print(sum(a))
    else:
        a = range(L, L + N)
        print(sum(a) - (L + N - 1))


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

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

	int min = 1e9;
	int max = -1e9;

	for (int i = 0; i < n; i++) {
		int t;
		std::cin >> t;
		min = std::min(min, t);
		max = std::max(max, t);
	}
	std::cout << (max - min) << std::endl;
}


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

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

using namespace std;

int main() {

	SINT32 M;
	cin >> M;

	SINT8 N[100];
	cin >> N;

	SINT32 K;
	cin >> K;

	SINT8 A;
	
	A = N[K-1];

	for (SINT32 i = 0; i < M; i++) {
		if (N[i] != A) {
			N[i] = '*';
		}
		cout << N[i];
	}
	


	
	return 0;
}

//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);

//	// DATA.emplace_back(BUF);	//後ろに追加

//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());

//	vector<vector<SINT32>> DP(N,vector<SINT32>(3));　//2次元配列

/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/

// 	vector<pair<int,pair<int,int>>> DATA(M);
//	cin >> DATA[i].first;
//	cin >> DATA[i].second.first;
//	cin >> DATA[i].second.second;


//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();


/* 文字列回転
	string N;
	cin >> N;
	N = N[N.length()-1] + N.substr(0,N.length()-1);
*/

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] penk = new int[3];
            var imp = Console.ReadLine().Split(' ');
            penk[0] = int.Parse(imp[0]);
            penk[1] = int.Parse(imp[1]);
            penk[2] = int.Parse(imp[2]);

            Array.Sort(penk);
            if((penk[0]==penk[1])&&(penk[0]==penk[2]))
            {
                Console.Write('1');
                
            }
            else if((penk[0]==penk[1])&&(penk[1]<penk[2])||((penk[1] == penk[2]) && (penk[0] < penk[1])))
            {
                Console.Write('2');
            }
            else if(penk[0]<penk[1])
            {
                Console.Write('3');
            }
            else
            {

            }
           //System.Threading.Thread.Sleep(1000);
        }
    }
}


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


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


Measured memory_bytes: 512
#include<stdio.h>
#include<stdlib.h>

int main()
{
  int n,a,b;

  scanf("%d %d %d",&n,&a,&b);

  if(n*a>b)
  {
    printf("%d",b);
  }
  else
  {
    printf("%d",a*n);
  }

  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int m,a,b,p[205],c,d;

int main(){
  while(1){
    cin>>m>>a>>b;
    if(!m&&!a&&!b)break;
    c=d=0;
    for(int i=0;i<m;i++)cin>>p[i];
    for(int i=b-1;i>=a-1;i--)
      if(p[i]-p[i+1]>c)c=p[i]-p[i+1],d=i+1;
    cout<<d<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;
constexpr long long int INF = std::numeric_limits<long long int>::max();
constexpr long long int NINF = std::numeric_limits<long long int>::min();
constexpr long long int MOD = 1000000007;
#define int long long int

void solve() {
  int N;
  cin >> N;
  vector<int> V(N);

  for (int &v : V) {
    cin >> v;
    v--;
  }

  int ans = 0;
  for (int i = 0; i < V.size() - 1; i++) {
    if (i == V[i]) {
      ans++;
      swap(V[i], V[i + 1]);
    }
  }

  if (V.back() == V.size() - 1) {
    ans++;
  }
  cout << ans << endl;
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
    int H, W;
    while(true) {
        cin >> H >> W;
        if (H == 0 && W == 0) break;
        for(int i = 0; i < H; i++) {
            for(int v = 0; v < W; v++) {
                if(i == 0 || (i + 1 ) == H || v == 0 || (v + 1) == W) {
                    printf("#");
                } else {
                    printf(".");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
const int N=300010,mod=1e9+7;
#define    ll  long long
ll ans=0;
ll a[N];
int main(){
    ll n;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=0;i<60;i++)
    {
    	ll x=0;
    	for(int j=1;j<=n;j++)if(a[j]>>i &1)x++;
    	//cout<<x<<endl;
    	ll now=x*(n-x)%mod;
    	now= (1ll<<i)%mod*now%mod;
    	//cout<<now<<endl;
    	ans+=now;
    	ans%=mod;
    }
    printf("%lld",ans);
	return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

const ll mod = 1000000007;

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

    int n;
    const int nmax = 10;
    ll ans, sum;
    string smemo;

    n = (int)S.length();

    ans = 0;
    rep(i, 1 << (n - 1)){
        sum = 0;
        smemo = "";
        bitset<nmax> bit(i);
        rep(j, n){
            smemo += S[j];
            if(bit.test(j)){
                sum += stol(smemo);
                smemo = "";
            }
            if(j == n - 1){
                sum += stol(smemo);
            }

        }
        ans += sum;
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

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

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; }
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n),b(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i] >> b[i];
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    cout << a[0]-1+b[0]+a[n-1]-a[0]+1 << endl;
    return 0;
}

Measured memory_bytes: 4032
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define ll long long
#define P pair<int, int>
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define GI(name) \
  int(name);     \
  scanf("%d", &(name))
#define GI2(name1, name2) \
  int(name1), (name2);    \
  scanf("%d %d", &(name1), &(name2))
#define GI3(name1, name2, name3) \
  int(name1), (name2), (name3);  \
  scanf("%d %d %d", &(name1), &(name2), &(name3))
#define GVI(name, size)    \
  vector<int>(name)(size); \
  FOR(i, (size)) scanf("%d", &(name)[i])
#define GS(name) \
  string(name);  \
  cin >> (name);
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

string to_string(string s) {
  return s;
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  FOR(i, v.size() - 1) { ret += to_string(v[i]) + ","; }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() {
  cerr << endl;
}

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() {
  cout << endl;
}

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}

int main() {
  GI2(K, T);
  GVI(a, T);
  print(max(0, 2 * (*max_element(ALL(a))) - K - 1));
  return 0;
}

Measured memory_bytes: 256