akhauriyash/Code-Regression huggingface dataset:
// Lets go to the next level
// AIM EXP at CF *__* asap
// Hit A,B,C faster and reach Expert
// Remember you were also a novice when you started,
// hence never be rude to anyone who wants to learn something!Be calm and help everyone.
// Never open the rank list until and unless you are done with solving problems!
/*HACK ME IF YOU CAN!
░░███▒▒░░░░░░░░░░░░░░░░████
░░████▒░░░░░░░░░░░░░░░███▒█
░░██████░░░░░░░░░░░░░███▒▒▒█
░░██▒▒▒▒█▒▒▒▒▒▒▒▒▒▒▒█████▒██
░▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▓▓▓▓▓▓▒▒▒░██
▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒█
▒▒▓▓███████▓░▓▓███████▓▒▒▒▒▒▒
▒▒▓▓▓█▓▄▓█▓░░░▓▓█▓▄▓█▓▓▒▒▒▒▒▒
▒▒▓▓▓▓███▓░░░░░▓▓███▓▓▓▒▒▒▒▒▒
▒▒▒▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒
▒▒▒▒▓▓▓▓▓▒██▒▒▒▓▓▓▓▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░▒▒▒▒▒▒▒▒█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
░░▒▒▒▒▒▒█▒▒▒▒▒█▒▒▒▒▒▒▒▒▒▒▒▒▒
░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
*/

//Author: kaiyu
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(x) ((long long)(x).size())
#define all(x)  x.begin(),x.end()
#define endl "\n"
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define leastsigbit(x)     __builtin_ffs(x)
#define mod             1000000007
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define pii pair<int,int>
#define vpii vector<pii>
#define tt ll tt;cin >> tt;while(tt--)
#define  fio ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define D1(x) { cerr << " [" << #x << ": " << x << "]\n"; }
#define D2(x) { cerr << " [" << #x << ": "; for(auto it:x) cerr << it << " "; cerr << "]\n";}
const double PI = acos(-1);
ll power(ll a,ll b,ll m=mod){ ll ans=1; a=a%m;  while(b>0) {  if(b&1)  ans=(1ll*a*ans)%m; b>>=1;a=(1ll*a*a)%m;}return ans;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm( ll x, ll y) { return (x*y)/gcd(x,y);}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
bool isPowerOfTwo(int x)
{
  /* First x in the below expression is for the case when x is 0 */
  return x && (!(x&(x-1)));
}
struct cmp {
    bool operator() (const pair<int,int>& lhs, const pair<int,int>& rhs) const {
        return lhs.ff * rhs.ss < lhs.ss * rhs.ff;
    }
//for map<pii,int>
};

bool cmps(pair<int,int>p1,pair<int,int>p2) {
    return p1.ss > p2.ss;
}

const int MAXN = 2e5+ 10;

#define int long long
int32_t main() {
//#ifndef ONLINE_JUDGE
    //freopen("inp1.txt","r",stdin);
    //freopen("out1.txt","w",stdout);
//#endif
    fio
    string s,t;
    cin >> s>>t;
    int cnt = 0;
    for (int i = 0; i < sz(s); ++i) {
                      if(s[i]!=t[i]){
                          cnt++;
                      }
    }
    cout << cnt << endl;





    cerr << "[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;


}






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

int check(long* T, long* S, int n, int q) {
    int count = 0;
    long a[100000];
    for(int i = 0; i < q; ++i) {
        for(int j = 0; j < n; ++j) {
            if(S[i] == T[j]) {
                bool flag = true;
                for(int k = 0; k < count; ++k) {
                    if(a[k] == S[i]) {
                        flag = false;
                    }
                }
                if(flag) {
                    a[count] = S[i];
                    ++count;
                }
            }
        }
    }
    return count;
}

int main(void) {
    int n, q;
    long T[100000];
    long S[100000];
    
    cin >> n;
    for(int i = 0; i < n; ++i) {
        cin >> T[i];
    }
    
    cin >> q;
    for(int i = 0; i < q; ++i) {
        cin >> S[i];
    }
    
    cout << check(T, S, n, q) << endl;
    
    return 0;
}



Measured memory_bytes: 3180
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int,int>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i]};
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
#define OUT(x) cout << x << endl
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}

int main() {
  IN(ll,N);
  IN(ll,Y);
  int count = 0;
  REP(i,min(Y/10000, N)+1){
    REP(j,min((Y-i*10000)/5000,N-i)+1){
      if (i*10000+j*5000+(N-i-j)*1000 == Y){
        cout << i << " " << j << " " << N-i-j << endl;
        return 0;
      }
    }
  }
  OUT("-1 -1 -1");
}
  

Measured memory_bytes: 256
s = gets.strip
 
t = s.delete(?x)
 
if t != t.reverse
  puts "-1"
  exit
end
 
r = s.reverse
 
if s == r
  puts 0
  exit
end
 
i = j = k = 0
ans = 0
while k < (t.size+1)/2 do
  
  while s[i] == ?x and r[j] == ?x do
    i += 1
    j += 1
  end
  
  if s[i] != r[j]
    
    while s[i] == ?x do
      i += 1
      ans += 1
    end
    
    while r[j] == ?x do
      j += 1
      ans += 1 
    end
  end
  
  i += 1
  j += 1
  k += 1
end
 
puts ans

Measured memory_bytes: 2300
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
    using namespace std;
 
ll gcd( ll m, ll n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd


    int main(){
      ll n,m;
      cin >> n >> m;
      string s,t;
      cin >> s >> t;
      bool flag=true;
      ll g=gcd(m,n);
      ll a=n/g;
      ll b=m/g;
      REP(k,0,g){
       if(s[k*a]!=t[k*b]){
         flag=false;
       }
      }
      if(flag)cout << m*(n/g) << endl;
      else cout << -1 << endl;
      return 0;}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static String Y = "Yes";
	public static String N = "No";
	public static long MOD = (long) (Math.pow(10, 9) + 7);
	public static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		out((ni() - 1) * (ni() - 1));
	}

	/*
	 * 以下メソッド集
	 */

	static int ketasuu(int n) {
		String str = "" + n;
		return str.length();
	}

	static int abcount(String str) {
		int count = 0;
		int len = str.length();
		for (int i = 0; i < len - 1; i++) {
			if ("AB".equals(str.substring(i, i + 2))) {
				count++;
			}
		}
		return count;
	}

	static int ni() {
		return sc.nextInt();
	}

	static long nl() {
		return sc.nextLong();
	}

	static double nd() {
		return sc.nextDouble();
	}

	static String n() {
		return sc.next();
	}

	static char[] nc() {
		return sc.next().toCharArray();
	}

	static int kaijo(int n) {
		if (n == 0 || n == 1) {
			return 1;
		} else {
			return n * kaijo(n - 1);
		}
	}

	static int fib(int n) {
		return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);
	}

	static long lcm(long m, long n) {

		return m * n / gcd(m, n);
	}

	static int lcm(int m, int n) {

		return m * n / gcd(m, n);
	}

	static long gcd(long a, long b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	static int gcd(int a, int b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	static void out(String info) {
		System.out.println(info);
	}

	static void out(int info) {
		System.out.println(info);
	}

	static void out(double info) {
		System.out.println(info);
	}

	static void out(long info) {
		System.out.println(info);
	}

	static void out(char info) {
		System.out.println(info);
	}

	static void out(Object obj) {
		System.out.println(obj.toString());
	}

	static void outn(String info) {
		System.out.print(info);
	}

	static void outn(int info) {
		System.out.print(info);
	}

	static void outn(double info) {
		System.out.print(info);
	}

	static void outn(long info) {
		System.out.print(info);
	}

	static void outn(char info) {
		System.out.print(info);
	}

	static double max(double d, double e) {
		return Math.max(d, e);
	}

	static long max(long a, long b) {
		return Math.max(a, b);
	}

	static double min(double d, double e) {
		return Math.min(d, e);
	}

	static long min(long a, long b) {
		return Math.min(a, b);
	}
}

class XY {
	int h;
	int c;

	XY(int h, int c) {
		this.h = h;
		this.c = c;
	}
}


Measured memory_bytes: 22608
#include<stdio.h>
#define N 200000
int S[N],Left[N/2+1],Right[N/2+1];
double count=0;
void margesort(int left,int right){
  int mid;
  if(left+1 < right){ 
    mid = (left + right)/2;
    margesort(left,mid);
    margesort(mid,right);
    marge(left,mid,right);
  }
}
 
void marge(int left,int mid,int right){
  int n1,n2,i,j=0,k;
   
  n1 = mid - left;
  n2 = right - mid;
   
  for(i=0;i<n1;i++) Left[i] = S[left+i];
  Left[n1]=-1;
  for(i=0;i<n2;i++) Right[i] = S[mid+i];
  Right[n2]=-1;
   
  i=0;
  for(k=left;k<right;k++){
    if(Left[i] > Right[j]){  
      S[k] = Left[i];
      i++;
      count += n2 - j;
    }
    else{
      S[k] = Right[j];
      j++;
    }
  }
}
 
int main(){
  int n,i;
   
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&S[i]);
   
  margesort(0,n);
  printf("%0.f\n",count); 
   
  return 0;
}
 

Measured memory_bytes: 2192
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int n = scanner.nextInt();

        final int[] indices = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            final int p = scanner.nextInt();
            indices[p] = i;
        }

        int count = 0;
        int max = 0;
        int previous = 0;
        for (int i = 1; i <= n; i++) {
            if (indices[i] > previous) {
                count++;
                max = Math.max(max, count);
            } else {
                count = 1;
            }
            previous = indices[i];
        }
        System.out.println(n - max);
    }
}


Measured memory_bytes: 86912
#include <iostream>

int main()
{

	char s[4];
	int cnt;
	scanf("%s", s,3);
	cnt = 0;

	if (s[0] == '1') {
		cnt++;
	}
	if (s[1] == '1') {
		cnt++;
	}
	if (s[2] == '1') {
		cnt++;
	}

	printf("%d", cnt);

}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<utility>
#include<iomanip>
#include<tuple>



using namespace std;
typedef long long ll;
struct point{
  int x;
  int y;

};
int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}
int abs(int x){
  if(x>=0){
    return x;
  }else{
    return -x;
  }
}

int moji(char in)
{
    int ans = (int)in-(int)'a'+1;
    if((in < 1) || (in > 26)){
        ans = 100;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}
struct zahyou{
  int x;
  int y;
};





int main(){
  int N;
  cin>>N;
  string S;
  cin>>S;
  int W=0;
  int E=0;
  int WW[N];
  int EE[N];
  for(int i=0;i<N;i++){
    WW[i]=0;
    EE[i]=0;
  }
  for(int i=0;i<S.size();i++){
    if(i>0){
      WW[i]=WW[i-1];
      EE[i]=EE[i-1];
    }
    if(S.at(i)=='W'){
      W++;
      WW[i]++;
    }else{
      E++;
      EE[i]++;
    }
  }
  int min=1000000;
  for(int i=0;i<N;i++){
    int sum=100000;
    if(S.at(i)=='E'){
    sum=WW[i]+E-EE[i];
    }else{
      sum=WW[i]+E-EE[i]-1;

    }
    if(sum<min){
      min=sum;
    }
  }
  cout<<min<<endl;



  


  


  



}


  
  

  


Measured memory_bytes: 3076
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define rep(i,n)Rep(i,0,n)
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
typedef long long ll;
typedef long double ld;

int main() {
	int n, j, a[100001];
	scanf("%d", &n);
	rep(i,n) {
		scanf("%d", &j);
		a[j] = i+1;
	}
	Rep(i,1,n+1) {
		printf("%d ", a[i]);
	}	
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll MOD = 1e9+7;
int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for(int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    int ans = 0;
    for(int l = 0; l <= k; l++)
    {
        for(int r = 0; r <= k; r++)
        {
            if(l + r > k) continue;
            priority_queue<int> que;
            int sum = 0;
            for(int i = 0; i < l && i < n; i++)
            {
                sum += v[i];
                if(v[i] < 0)
                {
                    que.push(-v[i]);
                }
            }
            for(int j = 0; j < r && j < n && n-1-j > l; j++)
            {
                sum += v[n-1-j];
                if(v[n-1-j] < 0)
                {
                    que.push(-v[n-1-j]);
                }
            }
            int left = k - l - r;
            for(int i = 1; i <= left; i++)
            {
                if(!que.empty())
                {
                    int cand = que.top();
                    que.pop();
                    sum += cand;
                }
            }
            ans = max(ans, sum);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
//Author : Koushal Bhat

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n=0;
    ll d=0;
    cin>>n>>d;
    ll x[n]={0};
    ll y[n]={0};
    ll count=0;
    vector<double> check;
    for(ll i=0;i<n;i++)
    {
        cin>>x[i]>>y[i];
        double dist=sqrt((x[i]*x[i])+(y[i]*y[i]));
        
        if(dist<=d)
        {
            count++;
        }
        
    }
    cout<<count<<'\n';
    return 0;
}

Measured memory_bytes: 6792
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'

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

	int a, b;
	cin >> a >> b;
	cout << max(a*b, max(a+b, a-b)) << endl;
}


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

int main() {
	int k, s;
	cin >> k >> s;

	int l[3000];
	for (int i = 0; i <= k; i++) {
		l[i] = i;
	}

	int cnt = 0;
	for (int i = 0; i <= k; i++) {
		for (int j = 0; j <= k; j++) {
			if (binary_search(l, l + k + 1, s - i - j)) cnt++;
		}
	}

	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
def solve():
    n,m,k = list(map(int,input().split()))
    arr = list(map(int, input().split()))
    arr1 = list(map(int, input().split()))
    aTrack = 0
    bTrack = sum(arr1)
    Bn = len(arr1)
    ans = 0
    for An in range(len(arr)+1):
      if An>0:
        aTrack += arr[An-1]
      if aTrack>k:
        break
      while aTrack+bTrack>k:
        Bn -= 1
        bTrack -= arr1[Bn]
      ans = max(ans, An+Bn)
    print(ans)
    
            
solve()

Measured memory_bytes: 117996
n = int(input())
p = list(map(int, input().split()))
cnt = 0

for idx, pi in enumerate(p):
    if (idx+1) == pi:
        if idx+1 < n:
            p[idx], p[idx+1] = p[idx+1], p[idx]
        else:
            p[idx], p[idx-1] = p[idx-1], p[idx]
        cnt += 1
            
print(cnt)

Measured memory_bytes: 13880
def inpl():
    return list(map(int, input().split()))


def gcd(a, b):
    # greatest common divisor
    while b > 0:
        a, b = b, a % b

    return a


def lcm(a, b):
    # least common multiple
    return a * b // gcd(a, b)


N = int(input())
A = inpl()

c = A[0]
for a in A[1:]:
    c = lcm(c, a)

print(c / sum(c // a for a in A))


Measured memory_bytes: 3060
(let* ((n (read))
       (x (make-array `(,(1+ n))))
       (sum 0)
       (ans 0))
  (loop :for i :from 1 :to n
        :do (let ((y (read)))
              (setf (aref x i) y)
              (incf sum y)))
  (setf ans (min (loop :for i :from 1 :to n :sum (expt (- (aref x i) (floor (/ sum n))) 2))
                 (loop :for i :from 1 :to n :sum (expt (- (aref x i) (ceiling (/ sum n))) 2))))
  (format t "~A~%" ans))


Measured memory_bytes: 24684
import java.util.*;
import java.io.*;

public class Main{

	public static void main(String[] args) throws IOException {
		int N = readInt(); long sum = 0; for(int i= 1; i<=N; i++) sum += readInt()-1; println(sum); exit();
	}

	final private static int BUFFER_SIZE = 1 << 16;
	private static DataInputStream din = new DataInputStream(System.in);
	private static byte[] buffer = new byte[BUFFER_SIZE];
	private static int bufferPointer = 0, bytesRead = 0;
	static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

	public static String readLine() throws IOException {
		byte[] buf = new byte[64]; // line length
		int cnt = 0, c;
		while ((c = Read()) != -1) {
			if (c == '\n')
				break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	public static String read() throws IOException {
		byte[] ret = new byte[1024];
		int idx = 0;
		byte c = Read();
		while (c <= ' ') {
			c = Read();
		}
		do {
			ret[idx++] = c;
			c = Read();
		} while (c != -1 && c != ' ' && c != '\n' && c != '\r');
		return new String(ret, 0, idx);
	}

	public static int readInt() throws IOException {
		int ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (neg)
			return -ret;
		return ret;
	}

	public static long readLong() throws IOException {
		long ret = 0;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');
		if (neg)
			return -ret;
		return ret;
	}

	public static double readDouble() throws IOException {
		double ret = 0, div = 1;
		byte c = Read();
		while (c <= ' ')
			c = Read();
		boolean neg = (c == '-');
		if (neg)
			c = Read();

		do {
			ret = ret * 10 + c - '0';
		} while ((c = Read()) >= '0' && c <= '9');

		if (c == '.') {
			while ((c = Read()) >= '0' && c <= '9') {
				ret += (c - '0') / (div *= 10);
			}
		}

		if (neg)
			return -ret;
		return ret;
	}

	private static void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
		if (bytesRead == -1)
			buffer[0] = -1;
	}

	private static byte Read() throws IOException {
		if (bufferPointer == bytesRead)
			fillBuffer();
		return buffer[bufferPointer++];
	}

	static void print(Object o) {
		pr.print(o);
	}

	static void println(Object o) {
		pr.println(o);
	}

	static void flush() {
		pr.flush();
	}

	static void println() {
		pr.println();
	}

	static void exit() throws IOException {
		din.close();
		pr.close();
		System.exit(0);
	}
}


Measured memory_bytes: 23380
N = int(input())
listH = list(map(int,input().split()))

if N == 1:
  print("Yes")
  exit()

flag = ""

fst = listH[0]

for i in listH[1::]:
	snd = i
	if snd >= fst:
		flag = "Yes"
		fst = i
	elif snd + 1 >= fst:
		flag = "Yes"
		fst = i + 1
	else:
		print("No")
		exit()

print(flag)
      

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

typedef long long ll;

ll dp[101][21];
int n, num[101];

ll rec(int idx, int sum){
  if(idx == n-1) return (sum == num[idx]);
  if(sum < 0 || sum > 20) return 0;
  if(dp[idx][sum]) return dp[idx][sum];
  
  return dp[idx][sum] = (rec(idx+1, sum+num[idx]) + rec(idx+1, sum-num[idx]));
}

int main(){
  
  cin >> n;
  for(int i = 0; i < n; i++) cin >> num[i];
  
  cout << rec(1, num[0]) << endl;
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, C, K;
  cin >> N >> C >> K;
  vector<int> T(N);
  priority_queue<int, vector<int>, greater<int>> x;
  for(int i = 0; i < N; i++){
    cin >> T.at(i);
    x.push(T.at(i));
  }
  int result = 0;
  int counter;
  while(!x.empty()){
    int t = x.top() + K; //先頭の人をギリギリまで待たせて出発
    counter = 0;
    while(x.top() <= t && !x.empty()){
      x.pop();
      counter++;
      if(counter == C) break;
    }
    result++;
  }
  cout << result << endl;
}

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

int main(){
  int a, b;
  cin >> a >> b;
  if(a+b==15){
    cout << "+" << endl;
  }
  else if(a*b==15){
    cout << "*" << endl;
  }
  else{
    cout << "x" << endl;
  }
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
	double L,c,h;
	cin>>L;
	c = L/3;
	h = c*c*c;
	printf("%0.12f",h);
	return 0;
 } 

Measured memory_bytes: 256
N = int(input())
X = list(map(int,input().split()))
S = []
dp = [1]
mod = 10**9+7
for i in range(N):
    t = i+1
    dp.append(dp[i]*t%mod)
def power(a,b):
    if b == 0:
        return 1
    if b % 2 == 0:
        d = power(a,b//2)
        return d*d%mod
    elif b % 2 == 1:
        return a*power(a,b-1)%mod
W = []
for i in range(1,N):
    y = dp[N-1]*power(i,mod-2)%mod
    W.append(y)
ans = 0
for i in range(N-1):
    x = X[i]
    S.append(X[N-1]-x)
ans = 0
for i in range(N-1):
    x = S[i]
    t = i + 1
    ans += W[i]*x%mod
print(ans%mod)

Measured memory_bytes: 19356
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <map>
#define Z class
#define ln cout<<'\n'
#define ll long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
using namespace std;
template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;

int main(){
    int N,M; cin >> N >> M;
    int res[100]={0};
    
    rep(i,M*2){
        int A,B; cin >> A;
        res[A]++;
    }
    
    for(int i=1; i<=N; ++i){
        cout << res[i] << endl;
    }
    
    
}



Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
  int x,m,n;
	while(cin >> x){
	  n=0;
	  m = 600/x;
	  for(int i = 1;i<m;i++){
	    n += x*x*x*i*i;
	  }

	  cout << n << endl;
	}
	return 0;
}



Measured memory_bytes: 2992
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define ll long long
//#define double long double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

const int INF = 2e17;
const int MB = 20;
const int MOD = 1e9 + 7;
const int maxN = 1e3;

vector<int> suff;
vector<int> a;

void solve() {
    int n;
    cin >> n;
    
    a.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int m = n % 2 + 1;

    vector<vector<int>> dp(m + 1, vector<int>(n, -INF));
    for (int i = n - 1; i >= 0; i--) {
        for (int j = 0; j <= m; j++) {
            dp[j][i] = max(dp[j][i], (i + 2 < n ? dp[j][i + 2] : 0) + a[i]);
            if (j && i + 3 < n) dp[j][i] = max(dp[j][i], dp[j - 1][i + 3] + a[i]);
        }
    }

    int ans = -INF;
    for (int i = 0; i <= m; i++) {
        for (int j = 0; j <= m - i; j++) {
            ans = max(ans, dp[j][i]);
        }
    }
    cout << ans;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    //int t;
    //cin >> t;
    int t = 1;
    //srand(time(0));
    while (t--) solve();
}

Measured memory_bytes: 11068
/*     ####   ####  #               ####  #        ##   #    # #    # ###### #####
      #      #    # #              #      #       #  #  ##  ## ##  ## #      #    #
       ####  #    # #               ####  #      #    # # ## # # ## # #####  #    #
           # #  # # #                   # #      ###### #    # #    # #      #####
      #    # #   #  #              #    # #      #    # #    # #    # #      #   #
       ####   ### # ###### #######  ####  ###### #    # #    # #    # ###### #    #
*/
 
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
	long long a;
	cin>>a;
	cout<<a+(a*a)+(a*a*a)<<endl;
	return 0;
 
 
}


Measured memory_bytes: 3632
N = int(input())
string_list = [input() for i in range(N)]

def calcFreq(list):
    freq_dict = {}
    for i in list:
        if i in freq_dict:
            freq_dict[i] += 1
        else:
            freq_dict[i] = 1
    sorted_freq_list=sorted(freq_dict.items(), key=lambda x:x[1], reverse=True)
    return sorted_freq_list

freq_list=calcFreq(string_list)
max_freq_number=freq_list[0][1]
string_list_most_freq=[]
for i in freq_list:
    if i[1] != max_freq_number:
        break 
    string_list_most_freq.append(i[0])
string_list_most_freq.sort()    

print('\n'.join(string_list_most_freq))

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

using namespace std;



typedef long long int ll;


bool is_prime(int n) {
    if (n == 1) {
        return false;
    }

    int i = 2;
    while (i * i <= n) {
        if (n % i == 0) {
            return false;
        }
        i += 1;
    }

    return true;
}
int main() {
    /*ll test{};
    cin >> test;
    cin.ignore();
    while (test--) {



    }*/
    ll x{}, n{};
    cin >> x >> n;
    ll p{};
    if (n == 0) cout << x << endl;
    else{
        vector<int> diff(n);
        vector<int> C(101);

        for (int i = 0; i < n; i++) {
            cin >> diff[i];
            diff[i] = (x - diff[i]);
            C[abs(diff[i])]++;

        }
        for (int i = 0; i < 101; i++) {
            if (C[i] == 0) {
                cout << x - i << endl;
                break;
            }
            else if (C[i] == 1 && i!=0) {
                ll l1 = i;
                ll l2 = -i;
                if (count(diff.begin(), diff.end(), l1) == 1) cout << x + i << endl;
                else if (count(diff.begin(), diff.end(), l2) == 1) cout << x - i << endl;
                break;
            }
        }

    }
    
    



    return 0;
}

Measured memory_bytes: 3632
#pragma GCC optimize ("O2")
#include <bits/stdc++.h>

#define int long long
#define double long double 

using namespace std;

const int INF = 1e+18;
const int MAXN = 100000;
const int LOGN = 20;
const int mod = 1e9+7;

int dp[1001][1001];

signed main() {
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n, m;
    cin >> n >> m;
    int a[n][m];
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        for (int j = 0; j < m; j++) {
            a[i][j] = 0;
            if (s[j] == '.') a[i][j] = 1;
        }
    }

    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            dp[i][j] = 0;
        }
    }

    dp[1][0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (a[i-1][j-1]) {
                dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
            }
        }
    }

    cout << dp[n][m];
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007

vector <int> dx = {-1,1,0,0};
vector <int> dy = {0,0,-1,1};

int main(){

	string s,t;cin>>s>>t;
	int n= s.length();
	int m= t.length();
	int i,j;
	int mn = 10000;
	for(i=0;i+(m-1)<n;i++){
		int c = 0;
		for(j=0;j<m;j++){
			if(s[i+j]!=t[j]){
				c++;
			}
		}
		mn = min(mn,c);

	}
	cout << mn<<"\n";
}

Measured memory_bytes: 3592
import sys
from heapq import heapify, heappop, heappush

read = sys.stdin.read

N, *a = map(int, read().split())

a1 = a[:N]
a2 = a[N:-N]
a3 = a[-N:]

left = sum(a1)
right = sum(a3)

heapify(a1)
a3 = [-i for i in a3]
heapify(a3)

b = [0] * (N + 1)
b[0] = left
for n, i in enumerate(a2, 1):
    if a1[0] < i:
        j = heappop(a1)
        left = left - j + i
        heappush(a1, i)
    b[n] = left

c = [0] * (N + 1)
c[0] = right
for n, i in enumerate(a2[::-1], 1):
    if i < -a3[0]:
        j = -heappop(a3)
        right = right - j + i
        heappush(a3, -i)
    c[n] = right
c = c[::-1]

answer = max(i - j for i, j in zip(b, c))
print(answer)


Measured memory_bytes: 40148
// need
#include <iostream>
#include <algorithm>
// data structure
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
//#include <deque>
#include <valarray>
#include <unordered_map>
#include <array>
// stream
//#include <istream>
#include <sstream>
//#include <ostream>
#include <fstream>
// etc
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
//#include <chrono>
#include <random>
#include <numeric>
using namespace std;
 
int main()
{
  int T, X;
  cin >> T >> X;
  cout << ((double)T)/X << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#define REP(i,n) for(i=0;i<(int)(n);i++)

char s[400],p[400];
int slength = 0; int plength = 0;

int solve(int a,int b){
    //printf("%d %d\n",a,b );
    if(b==plength)  return 1;
    if(slength*2-plength<a) return 0;
    if(s[a+b]==p[b]) return solve(a,b+1);
    else return solve(a+1,0);
}

int main(){
    scanf("%s",s);
    scanf("%s",p);
    //get s,p length
    int i;
    plength = strlen(p);
    slength = strlen(s);
    //s kurikaesi
    REP(i,slength) s[i+slength] = s[i];
    //printf("%d\n",slength );
    if(solve(0,0)==1) printf("Yes\n");
    else printf("No\n");


}

Measured memory_bytes: 948
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

cat mod = 998244353;

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N, K;
	cin >> N >> K;
	vector<int> P(N);
	for(int i = 0; i < N; i++) cin >> P[i];
	stack<int> st;
	vector<int> prev_gt(N, -1);
	for(int i = 0; i < N; i++) {
		while(!st.empty() && P[st.top()] < P[i]) st.pop();
		if(!st.empty()) prev_gt[i] = st.top();
		st.push(i);
	}
	while(!st.empty()) st.pop();
	vector<int> next_lt(N, N);
	for(int i = N-1; i >= 0; i--) {
		while(!st.empty() && P[st.top()] > P[i]) st.pop();
		if(!st.empty()) next_lt[i] = st.top();
		st.push(i);
	}
	vector<int> num_dec(N, 1), num_inc(N, 1);
	for(int i = 1; i < N; i++)
		if(P[i-1] < P[i]) num_dec[i] = num_dec[i-1] + 1;
	for(int i = N-2; i >= 0; i--)
		if(P[i+1] > P[i]) num_inc[i] = num_inc[i+1] + 1;
	int ans = 0;
	for(int i = 0; i <= N-K; i++) if(num_inc[i] >= K) ans = 1; // original
	if(num_inc[N-K] < K) ans++;
	for(int i = 0; i < N-K; i++) if(num_inc[i] < K) {
		if(prev_gt[i+K] < i && next_lt[i] >= i+K) continue;
		ans++;
	}
	cout << ans << "\n";
	return 0;
}

// look at my code
// my code is amazing


Measured memory_bytes: 4224
using static System.Math;
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = long.Parse(line[0]);
        var a = long.Parse(line[1]);
        var b = long.Parse(line[2]);
        var w0 = a * (n / (a + b));
        var w1 = Min(n % (a + b), a);
        Console.WriteLine(w0 + w1);
    }
}


Measured memory_bytes: 13140
const MOD: usize = 998244353;
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let m: usize = sc.read();
    let mut a = vec![vec![0; m]; n];
    for i in 0..n {
        for j in 0..m {
            a[i][j] = sc.read::<i64>();
        }
    }

    let rank = f2_gauss_jordan(a);
    let mut pow2 = vec![1; n + m];
    for i in 1..(n + m) {
        pow2[i] = (pow2[i - 1] * 2) % MOD;
    }

    let ans = pow2[n + m - 1] + MOD - pow2[n + m - 1 - rank];
    println!("{}", ans % MOD);
    // X = N-R
    // Y = M-R
    // C(R, i) * 2^(i-1) *2^X *2^(M-i)
    // 2^(X-1) * C(R,i) *2^M i=1 to R
    // 2^(M+X-1) * (2^R-1)
    // 2^(N+M-1) - 2(M+N-1-R)
}

fn f2_gauss_jordan(mut a: Vec<Vec<i64>>) -> usize {
    let n = a.len();
    let m = a[0].len();
    let mut rank = 0;
    let mut row = 0;
    for col in 0..m {
        match (row..n).filter(|&i| a[i][col] == 1).next() {
            Some(pivot) => {
                a.swap(row, pivot);
                rank += 1;
                for k in (row + 1)..n {
                    if a[k][col] == 1 {
                        for i in 0..m {
                            a[k][i] ^= a[row][i];
                        }
                    }
                }

                row += 1;
            }
            None => {}
        }

        if row >= n {
            break;
        }
    }
    rank
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll mod=1e9+7;

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

Measured memory_bytes: 3636
//ほぼstandard answer
#include<iostream>
using namespace std;

class Cube{
public:
  int f[6];
  Cube(){} 
  void roll_z(){ roll(1, 2, 4, 3);} //横向き
  void roll_y(){ roll(0, 2, 5, 3);} //サイコロの番号は+1
  void roll_x(){ roll(0, 1, 5, 4);}
  void roll(int i, int j, int k, int l){
    int t = f[i]; f[i] = f[j]; f[j] = f[k]; f[k] = f[l]; f[l] = t;
  }
};

Cube c[100]; int n;

bool check();
bool eq( Cube c1, Cube c2 ); 
bool equal( Cube c1, Cube c2 );

int main(){
  cin >> n;
  for ( int j = 0; j < n; j++ ) 
    for ( int i = 0; i < 6; i++ ) cin >> c[j].f[i];
  
  if ( check() ) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

bool check(){
  for ( int i = 0; i < n - 1; i++) 
    for ( int j = i + 1; j < n; j++ ) if ( equal(c[i], c[j]) ) return false;
  return true;
}

bool equal( Cube c1, Cube c2 ){ //ほとんどDiceIIと同じ流れ
  for ( int i = 0; i < 6; i++ ){
    for ( int j = 0; j < 4; j++ ){
      if ( eq(c1, c2) ) return true;
      c1.roll_z();
    }
    if ( i % 2 == 0 ) c1.roll_x();
    else c1.roll_y();
  }
  return false;
}

bool eq( Cube c1, Cube c2 ){
  for ( int i = 0; i < 6; i++ ) {
    if ( c1.f[i] != c2.f[i] ) return false;
  }
  return true;
}




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

using namespace std;

using ll = long long;
using ull = unsigned long long;

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

template<class T>
T read() {
    T x{};
    cin >> x;
    return x;
}

template<class T>
vector<T> read(int N){
    vector<T> x(N);
    for(int i = 0; i < N; ++i){
        cin >> x[i];
    }
    return x;
}

template<class T>
void write(const T &x){ cout << x << endl; }

void write(double x) { printf("%.15f\n", x); }

int main(){
    auto a = read<double>();
    auto b = read<double>();
    auto x = read<double>();
    const auto pi = 3.14159265358979323846;
    const auto rad_to_degree = 180 / pi;
    
    auto area = x / a;
    auto thr_b = 2 * area / a;
    if(b < thr_b){
        //台形
        write(atan(2 * (a * b - area) / a / a) * rad_to_degree);
    }
    else
    {
        // 三角
        write(atan(b * b / (2 * area)) * rad_to_degree);
    }
}



Measured memory_bytes: 640
#include <stdio.h>

int main(int argc, char const *argv[]) {

  int N, M;
  scanf("%d", &N);
  scanf("%d", &M);

  int L[M + 1];
  int R[M + 1];
  int tmp[M];

  int cnt[N];
  for (int i = 0; i < N; i++) {
    cnt[i] = 0;
  }

  int min = 0;
  int max = N;

  for (int i = 0; i < M; i++) {
    scanf("%d", L + i);
    scanf("%d", R + i);

    if (L[i] > min) {
      min = L[i];
    }
    if (R[i] < max) {
      max = R[i];
    }

    if (min > max) {
      printf("0\n");
      return 0;
    }
  }

  int gate = max - min + 1;
  printf("%d\n", gate);

  return 0;
}


Measured memory_bytes: 1280
#include <iostream>
#include <algorithm>
#include <string> 
#include <vector>
#include <iomanip>
#include <math.h>
using namespace std;

int main()
{
	int Y, M, D;
	char ym, md;
	cin >> Y >> ym >> M >> md >> D;
	if (M * 30 + D >= 151) {
		cout << "TBD" << endl;
	}
	else {
		cout << "Heisei" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
const long long MOD=1e9+7;
const double PI=3.14159265359;


int main() {
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int k,n;
    cin>>k>>n;
    if(!(k%2)){
        cout<<k/2<<" ";
        for(int i=0; i<n-1; i++){
            cout<<k<<" ";
        }
    }
    else{
        vector<int> ans(n,k/2+1);
        for(int i=0; i<n/2; i++){
            if(ans.back()==1){
                ans.pop_back();
            }
            else{
                ans.back()--;
                while(ans.size()<n){
                    ans.push_back(k);
                }
            }
        }
        for(int i:ans){
            cout<<i<<" ";
        }
        
    }
    
    return 0;
    
}

Measured memory_bytes: 3456
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
#############################################
A,B,C=map(int,input().split())
if A+B>=C-1:
  print(C+B)
else:
  print(B+A+B+1)
  


Measured memory_bytes: 8036
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(int i=1,i##_len=(n); i<=i##_len; ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for(int i=(s);i<(t);++i)
#define rng(obj) (obj).begin(), (obj).end()
#define maxs(x,y) (x=max((x),(y)))
#define mins(x,y) (x=min((x),(y)))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x=max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T>>
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vp = vector<P>;
template <class T> inline istream& operator>>(istream&i,v(T)&v)
{ rep(j,sz(v))i>>v[j];return i;}
template <class T> string join(const v(T)&v)
{ stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template <class T> inline ostream& operator<<(ostream&o,const v(T)&v)
{ if(sz(v))o<<join(v); return o;}
template <class T1,class T2> inline istream& operator>>(istream&i ,pair<T1,T2>&v)
{ return i>>v.fi>>v.se;}
template <class T1,class T2> inline ostream& operator<<(ostream&o ,pair<T1,T2>&v)
{ return o<<v.fi<<","<<v.se;}
template <class T> inline ll suma(const v(T)& a) 
{ ll res(0); for(auto&& x:a) res += x; return res;}
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const double eps = 1e-10;
const int MX = 200005;
//----------------------------------------------------------------

#define fileio ifstream fio; if(argc>=2){fio.open(argv[1]); std::cin.rdbuf(fio.rdbuf());}
#define fastio ios_base::sync_with_stdio(false);
#define MOD 1000000007
//----------------------------------------------------------------
void Main(){
  int n,k;ll s;
  cin>>n>>k>>s;
  rep(i,k) cout<<s<<" ";
  if(s!=1e9) rep(i,n-k) cout<<s+1<<" ";
  else       rep(i,n-k) cout<<s-1<<" ";

} int main(int argc,char* argv[]){ 
    fastio; fileio; Main();}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define rep(i,j,k) for(int i=j;i<=k;i++)
using namespace std;
template<typename T> void read(T &num){
	char c=getchar();T f=1;num=0;
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){num=(num<<3)+(num<<1)+(c^48);c=getchar();}
	num*=f;
}
template<typename T> void qwq(T x){
	if(x>9)qwq(x/10);
	putchar(x%10+'0');
}
template<typename T> void write(T x){
	if(x<0){x=-x;putchar('-');}
	qwq(x);putchar('\n');
}
template<typename T> void chkmin(T &x,T y){x=x<y?x:y;}

int a,b,c,d;
map<long long,long long>v;
inline long long sol(long long x){
	if(v.find(x)!=v.end())return v[x];
	
	long long ret=((x<200000000000/d)?x*d:200000000000);
	
	chkmin(ret,(1ll*d*(x%2))+1ll*a+sol(x/2));
	if(x%2)chkmin(ret,(1ll*d)+1ll*a+sol((x+1)/2));
	chkmin(ret,(1ll*d*(x%3))+1ll*b+sol(x/3));
	if(x%3)chkmin(ret,(1ll*d*(3-(x%3)))+1ll*b+sol(x/3+1));
	chkmin(ret,(1ll*d*(x%5))+1ll*c+sol(x/5));
	if(x%5)chkmin(ret,(1ll*d*(5-(x%5)))+1ll*c+sol(x/5+1));
	v[x]=ret;return ret;
}

int main(){
	int T;read(T);
	while(T--){
		long long N;read(N);
		read(a);read(b);read(c);read(d);
		v.clear();v[0]=0;v[1]=d;
		write(sol(N));
	}
	return 0;
}

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

int gcd(long long a, long long b){
  long long M = max(a, b), m = min(a, b);
  while(m != 0){
  	long long r = M%m;
    M = m; m = r;
  }
  return M;
}

int digit_sum(long long n){
  long long ans;
  while(n != 0){
  	ans += n%10;
  	n /= 10;
  }
  return ans;
}

int main(){
  int n;
  string s;
  cin >> s;
  n = s.size();
  bool ans = true;
  
  for(int i = 0; i < n; i++){
  	if(i%2 == 0){
    if(s.at(i) == 'L'){
    	ans = false;
    }
    }
  
  	else{
    if(s.at(i) == 'R'){
    	ans = false;
    }
    }
  
  }
  if(ans){
  	cout << "Yes" << endl;
  }
  else{
  	cout << "No" << endl;
  }
}

Measured memory_bytes: 256