akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define LL long long
#define db double
using namespace std;

const int MAXN = 200200;
const int INF = 0x3f3f3f3f;

template <typename T> inline void read(T &x) {
	char c = getchar();
	bool f = false;
	for (x = 0; !isdigit(c); c = getchar()) {
		if (c == '-') {
			f = true;
		}
	}
	for (; isdigit(c); c = getchar()) {
		x = x * 10 + c - '0';
	}
	if (f) {
		x = -x;
	}
}

template <typename T> inline bool CheckMax(T &a, const T &b) {
	return a < b ? a = b, true : false;
}

template <typename T> inline bool CheckMin(T &a, const T &b) {
	return a > b ? a = b, true : false;
}

int n, a[MAXN];
int cnt;
#define ls lower_bound
#define us upper_bound

signed main() {
	read(n);
	for(int i = 1, x; i <= n; i++) read(x), a[x] = i;
	int ans = 0;
	for(int i = 1, len = 0; i <= n; i++) {
		if(a[i] > a[i - 1]) {
			CheckMax(ans, ++len);
		}
		else len = 1;
	}
	printf("%d\n", n - ans);
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
int a[334334];
 signed main(){
	int n;
	cin>>n;
	rep(i,n)cin>>a[i];
	cout<<a[n-1];
	for(int i=n-3;i>=0;i-=2)cout<<' '<<a[i];
	for(int i=n%2;i<n;i+=2)cout<<' '<<a[i];
	cout<<endl;
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	ll n; cin>>n;
	vl a(n+1),b(n);
	ll m=0;
	rep(i,0,n+1){
		cin>>a[i];
		m+=a[i];
	}
	
	rep(i,0,n)cin>>b[i];
	ll ans=0;
	rep(i,0,n){
		ll k=b[i];
		ans+=min(k,a[i]+a[i+1]);
		k-=a[i];
		if(0<k){
			a[i+1]=max((ll)0,a[i+1]-k);
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 4840
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#include <cstdint>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define repi(i,a,b) for(int i=(ll)(a);i<(ll)(b);i++)
#define rrepi(i,a,b) for(int i=(ll)(b);i>=(ll)(a);i--)

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

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  vector<bitset<60>>a(n);
  rep(i,n){
    ll ta;cin>>ta;
    a[i]=(bitset<60>)ta;
  }
  ll res=0;
  ll mod=1e9+7;
  ll two=1;
  rep(k,60){
    ll one=0;
    rep(i,n){
      if(a[i][k])one++;
    }
    res+=one*(n-one)%mod*two%mod;
    two*=2;
    two%=mod;
  }
  cout<<res%mod<<endl;

  return 0;

}


Measured memory_bytes: 2560
N=int(input())
from collections import defaultdict
cnt=defaultdict(int)
for i in range(1,1+N):
    now=i
    for j in range(2,i+1):
        if now<j:
            break
        while now%j==0:
            cnt[j]+=1
            now//=j
ans=0
for i,vi in cnt.items():
    if vi>=74:
        ans+=1
    if vi>=24:
        for j,vj in cnt.items():
            if i==j:continue
            elif vj>=2:
                ans+=1
    if vi>=14:
        for j,vj in cnt.items():
            if i==j:continue
            elif vj>=4:
                ans+=1
    if vi>=2:
        for j,vj in cnt.items():
            if i==j:
                continue
            for k,vk in cnt.items():
                if i==k:
                    continue
                if j<k and vj>=4 and vk>=4:
                    ans+=1

print(ans)

Measured memory_bytes: 3316
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>

#define DT_MAX (200000)

int data[DT_MAX];
int out_data[DT_MAX];
int out_data_num;


int main()
{
	int n,i;
	char buff[8192];
	int min;
	int wk,delta;

	out_data_num = 0;
	gets(buff);
	sscanf(buff,"%d",&n);

	for (i=0 ; i<n ; i++) {
		gets(buff);
		sscanf(buff,"%d",&(data[i]));

	}

	min = data[0];
	delta= data[1] - data[0];
	for (i=1 ; i<n ; i++) {
		wk = data[i-1];
		if (min > wk) {
			min = wk;
		}
		wk = data[i]-min;
		if (delta < wk) {
			delta = wk;
		}
	}
			
	printf("%d\n",delta);
	return 0;
}

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


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

    int n; cin >> n;
    vector<ll> h(n);
    rep(i, n) cin >> h[i];

    int ans = 0;
    rep(i, n-1) {
        int cnt = 0;
        while(true) {
            if(i == n-1 || h[i] < h[i+1]) break;
            if(h[i] >= h[i+1]) cnt++, i++;
        }
        ans = max(ans, cnt);
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int m = sc.nextInt();
		int []a = new int [m];
		boolean []jdg = new boolean [n+1];
		long []Dp = new long [n+1];
		int p = 1000000007;
		
		for(int i = 0; i < m ; i++) {
			a[i] = sc.nextInt();
			jdg [a[i]] = true;
		}
		Dp[0] = 1;
		
		for(int i = 1 ; i <= n; i++) {
			if(jdg[i] == false) {
			 if(i == 1)
				Dp[i] = Dp[i -1];
			 if(i >= 2) {
				 Dp[i] = (Dp[i-1])%p+(Dp[i-2])%p;
			     Dp[i] = Dp[i]%p;
			}
		}
			if(jdg[i] == true) {
				Dp[i] = 0;
			}
		
		}
		System.out.println(Dp[n]);
	}
		
}




Measured memory_bytes: 48104
n = int(input())
A = list(map(int, input().split()))
A2 = []
for i in A :
    if i % 2 == 0:
        A2.append(i)
cnt = 0 
for j in A2:
    if j % 3 == 0 or j % 5 == 0:
        cnt += 1
if cnt == len(A2):
    print('APPROVED')
else:
    print('DENIED') 

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    if (a % 2 != b% 2) {
    	System.out.println("IMPOSSIBLE");
    } else {
    	System.out.println((a + b) / 2);
    }
  }
}


Measured memory_bytes: 21716
#include<stdio.h>
int main()
{
    int h,w,n,i,j,k=0,m;
    scanf("%d%d",&h,&w);
    scanf("%d",&n);
    m=h*w;
    int a[n],s[m],t[h][w];
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
     m=0;
    for(i=0;i<n;i++)
    {
        for(j=0;j<a[i];j++)
          s[m++]=i+1;
    }
    m--;
    for(j=0;j<w;j++)t[0][j]=s[m--];
    if(h>1)
    {
        i=1;
       j--;
    while(j>=0)
    {
        t[i++][j]=s[m--];
        if(i==h)
        {
             if(j==0)break;
            i--;
            j--;
            while(i!=0)
                t[i--][j]=s[m--];
        }
        if(i==0)
        {
            if(j==0)break;
            i++;
            j--;
            t[i++][j]=s[m--];
        }
    }

    }

    for(i=0;i<h;i++)
    {
        for(j=0;j<w;j++)
            printf("%d ",t[i][j]);
        printf("\n");
    }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main()
{
    int n,x,a;
    while(1){
        cin >> n >> x;
        if( n == 0 && x == 0)break;
        a = 0;
        int i,j,k;
        for( i = 1; i <= n; i++){
            for( j = i+1; j <= n; j++){
                for( k = j+1; k <= n ; k++){
                    if( i + j + k == x){
                        a++;
                    }
                }
            }
        }
        cout << a << endl;
    }
    return 0;
}

Measured memory_bytes: 3076
/*	
*  Sachin Mittal
*/
#include<bits/stdc++.h>
#define int long long
#define M 998244353
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define mem0(dp) memset(dp,0,sizeof(dp))
#define mem1(dp) memset(dp,-1,sizeof(dp))
#define pb push_back
#define fr(i,j,n) for(int i=j;i<n;i++)
#define sz(s) (int)(s.size())
using namespace std;
int32_t main(){
ios
int t=1;
//cin>>t;
while(t--)
{
	string s;cin>>s;
	if(sz(s)==6 and s[2]==s[3] and s[4]==s[5])cout<<"Yes";
	else cout<<"No";
}
}

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

#define debug(...) fprintf(stderr, __VA_ARGS__)

#ifndef AT_HOME
#define getchar() IO::myGetchar()
#define putchar(x) IO::myPutchar(x)
#endif

namespace IO {
	static const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;

	inline char myGetchar() {
		static char buf[IN_BUF], *ps = buf, *pt = buf;
		if (ps == pt) {
			ps = buf, pt = buf + fread(buf, 1, IN_BUF, stdin);
		}
		return ps == pt ? EOF : *ps++;
	}

	template<typename T>
	inline bool read(T &x) {
		bool op = 0;
		char ch = getchar();
		x = 0;
		for (; !isdigit(ch) && ch != EOF; ch = getchar()) {
			op ^= (ch == '-');
		}
		if (ch == EOF) {
			return false;
		}
		for (; isdigit(ch); ch = getchar()) {
			x = x * 10 + (ch ^ '0');
		}
		if (op) {
			x = -x;
		}
		return true;
	}

	inline int readStr(char *s) {
		int n = 0;
		char ch = getchar();
		for (; isspace(ch) && ch != EOF; ch = getchar())
			;
		for (; !isspace(ch) && ch != EOF; ch = getchar()) {
			s[n++] = ch;
		}
		s[n] = '\0';
		return n;
	}

	inline void myPutchar(char x) {
		static char pbuf[OUT_BUF], *pp = pbuf;
		struct _flusher {
			~_flusher() {
				fwrite(pbuf, 1, pp - pbuf, stdout);
			}
		};
		static _flusher outputFlusher;
		if (pp == pbuf + OUT_BUF) {
			fwrite(pbuf, 1, OUT_BUF, stdout);
			pp = pbuf;
		}
		*pp++ = x;
	}

	template<typename T>
	inline void print_(T x) {
		if (x == 0) {
			putchar('0');
			return;
		}
		static int num[40];
		if (x < 0) {
			putchar('-');
			x = -x;
		}
		for (*num = 0; x; x /= 10) {
			num[++*num] = x % 10;
		}
		while (*num){
			putchar(num[*num] ^ '0');
			--*num;
		}
	}

	template<typename T>
	inline void print(T x, char ch = '\n') {
		print_(x);
		putchar(ch);
	}

	inline void printStr_(const char *s, int n = -1) {
		if (n == -1) {
			n = strlen(s);
		}
		for (int i = 0; i < n; ++i) {
			putchar(s[i]);
		}
	}

	inline void printStr(const char *s, int n = -1, char ch = '\n') {
		printStr_(s, n);
		putchar(ch);
	}
}
using namespace IO;

const int N = 10000005, M = 5005, P = 1000000007;

int n, m;
int fac[N], inv[N], C[M][M];

int main() {
	read(n), read(m);
	fac[0] = 1;
	for (int i = 1; i <= n; ++i) {
		fac[i] = 1ll * fac[i - 1] * i % P;
	}
	inv[1] = 1;
	for (int i = 2; i <= n; ++i) {
		inv[i] = 1ll * (P - P / i) * inv[P % i] % P;
	}
	for (int i = 0; i <= m; ++i) {
		C[i][0] = C[i][i] = 1;
		for (int j = 1; j < i; ++j) {
			C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % P;
		}
	}
	int ans = 0;
	for (int i = 1; i <= m + 1; ++i) {
		for (int j = 0; j < i; ++j) {
			int a = i - 1 - j, c = std::max(m - i, 0), b = n - m;
			int t = 1ll * C[i - 1][j] * fac[a + b + c] % P * a % P * inv[a + b] % P;
			if (j & 1) {
				ans = (ans + P - t) % P;
			} else {
				ans = (ans + t) % P;
			}
		}
	}
	print(ans);
}


Measured memory_bytes: 148568
#include <iostream>
using namespace std;
int main(){

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

if (a>=b){
  for(int i=0;i<a; i++){
    cout << b;
  }
}
else{
    for(int i=0;i<b; i++){
      cout << a;

}}
return 0;
}

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

using namespace std;
#define ll long long
#define ld long double
#define rep(i,h) for(int i = 0; i < h; ++i)
#define rep1(i,h) for(int i = 0; i <= h; ++i)
#define rep2(i,k,h) for(int i = k; i < h; ++i)
#define rep3(i,k,h) for(int i = k; i <= h; ++i)
#define INF LLong_MAX // long long INF
#define inf INT_MAX // int inf

typedef pair<int,int> int_pair;
typedef pair<string,string> string_pair;


int main() {
    int n;
    cin >> n;
    int Min = INT_MAX;
    int count =0;
    for(int i = 0; i < n; i++) {
        int p;
        cin >> p;
        if(p < Min) {
           Min = min(p,Min);
           count++;
        }
    }
    cout << count << endl;
}

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

int gcd(int x,int y) {
  if (x == 0 || y == 0) return 0;
  if (x == y) return x;
  
  int mx = max(x,y);
  int mn = min(x,y);
  int r;
  while(r){
    r = mx % mn;
    if (r == 0) {return mn;}
    else{mx = mn; mn = r;} 
  }
}


int main(){
  
  int n, x, ans, temp;
  cin >> n >> x >> ans;
  ans = abs(ans-x);
  
  if (n != 1){
  rep(i,n){
    cin >> temp;
    int diff = abs(temp-x);
    if (ans == 0) {ans = diff;}
    if (diff == 0) {diff = ans;}
    if (ans == 0 && diff == 0) {continue;}
    ans = gcd(ans, diff);
  }
  }
  
  cout << ans << endl;

  
}

Measured memory_bytes: 256
#include<stdio.h>

int bubbleSort(int*,int);

int main(){
  int A[100],N,sw;
  int i;
  scanf("%d",&N);
  for(i=0;i<N;i++)
    scanf("%d",&A[i]);
    sw=bubbleSort(A,N); 
    for(i=0;i<N;i++){
      if(i>0) printf(" ");
      printf("%d",A[i]);
    }
    printf("\n%d\n",sw);
  return 0;
}

int bubbleSort(int A[],int N){
  int sw=0,i,j;
  int flag=1;
  int swap;
  while(flag){
    flag=0;
    for(j=N-1;j>=1;j--){
      if(A[j]<A[j-1]){
	swap=A[j];
        A[j]=A[j-1];
	A[j-1]=swap;
	flag=1;
	sw++;
      }
    }
  }
  return sw;
}

Measured memory_bytes: 604
#include <iostream>
#include <cstdlib>

using namespace std;
 
int main(){

    int k, n, n0, max = 0;
    int h[2];
    cin >> k >> n;

    cin >> n0;
    h[1] = n0;
    for (int i = 0; i < n - 1; i++) {
        cin >> h[i%2];
        if (max < abs(h[0]-h[1])) {
            max = abs(h[0]-h[1]);
        }
    }
    
    if (h[0] > h[1]) {
        n0 = n0 + k - h[0];
    } else {
        n0 = n0 + k - h[1];
    }
    if (max < n0) {
        max = n0;
    }

    cout << k - max << endl;

    return 0;
}


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

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> P(N+1);
    for(int i=0; i<N; i++) {
        int p;
        cin >> p;
        P[i] = (1+p); // 期待値の2倍
    }

    vector<int> t(N, 0);
    for(int i=0; i<K; i++) t[0] += P[i];
    for(int i=0; i<N-K; i++)
        t[i+1] = t[i] - P[i] + P[i+K];
    int m = 0;
    for(int i=0; i<N-K+1; i++)
        if(m < t[i]) m = t[i];
    double ans = 0.5 * m;
    cout << fixed << setprecision(10) << ans << endl; // 小数部を10桁にする
}

Measured memory_bytes: 1920
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class Main {
	
	public static class Problem implements Comparable<Problem> {
		int cost;
		int benefit;
		
		public Problem(int cost, int benefit) {
			super();
			this.cost = cost;
			this.benefit = benefit;
		}

		@Override
		public int compareTo(Problem arg0) {
			return -(this.benefit * arg0.cost - this.cost * arg0.benefit);
		}
	}
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		final int D = sc.nextInt();
		
		ArrayList<Problem> list = new ArrayList<Problem>();
		
		final int x = sc.nextInt();
		for(int i = 0; i < x; i++){
			final String a = sc.next();
			final int p = sc.nextInt();
			
			list.add(new Problem(1, a.equals("D") ? p : 0));
		}
		
		final int y = sc.nextInt();
		for(int i = 0; i < y; i++){
			String bc = sc.next();
			final int q = sc.nextInt();
			
			list.add(new Problem(2, bc.equals("DD") ? q : 0));
		}
		
		int max = 0;
		final int all_problems = x + y;
		final int bit_max = 1 << all_problems;
		for(int bit = 0; bit < bit_max; bit++){
			if(Integer.bitCount(bit) > D){
				continue;
			}
			
			int cost = 0, benefit = 0;
			for(int i = 0; i < all_problems; i++){
				final Problem p = list.get(i);
				
				if((bit & (1 << i)) != 0){
					cost += p.cost;
					benefit += p.benefit;
				}
			}
			
			if(cost <= D){
				max = Math.max(max, benefit);
			}
		}
		
		System.out.println(max);
		
		sc.close();
	}

	public static class Scanner {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			if (tok == null) {
				return false;
			} else {
				return tok.hasMoreTokens();
			}
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public void close() throws IOException {
			br.close();
		}
	}

}

Measured memory_bytes: 19272
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include <math.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
static const ll maxLL = (ll) 1 << 62;
const ll MOD = 1000000007, INF = 1e18;

int main(void) {
    int n, p;
    cin >> n >> p;
    vi biscuits(n, 0);
    for (int i = 0; i < n; ++i) {
        cin >> biscuits[i];
    }
    bool is_exist_odd = false;
    for (auto biscuit : biscuits) {
        if (biscuit % 2 == 1) is_exist_odd = true;
    }
    if (is_exist_odd) {
        cout << (ll) pow(2, n - 1);
    } else {
        if (p % 2 == 0) {
            cout << (ll) pow(2, n);
        } else {
            cout << 0 << endl;
        }
    }
}

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

int main(){
    int n;
    cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d.at(i);
    sort(d.begin(),d.end());
    int ne = n/2;
    int ns = n/2 - 1;
    int ans = d.at(ne) - d.at(ns);
    cout << ans << endl;
}

Measured memory_bytes: 3788
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
debug dbg;

class BOddString {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    string s, t="";
	    in >> s;
	    for(int i=0; i<s.length(); i++){
	        if(i%2 == 0) t += s[i];
	    }
	    out << t << endl;
	}
};


int main() {
	BOddString solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int count = 0;

		for (int i = 0; i < N; i++) {

			int a = sc.nextInt();

			while (a % 2 == 0) {
				count++;
				a = a / 2;
			}
		}

		System.out.println(count);
	}
}


Measured memory_bytes: 34316
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 1000001
#define MOD 1000000007

typedef long long int lli;

typedef struct {
  int front;
  int rear;
  int data[MAX][3];
} queue;

queue que;

void initQueue(queue *p) {
  p->front = p->rear = 0;
}

bool emptyQueue(queue *p) {
  return p->front == p->rear;
}

bool fullQueue(queue *p) {
  return (p->front - 1 == p->rear) || (p->front == 0 && p->rear == MAX - 1);
}

void queuePop(queue *p) {
  if ( emptyQueue(p) ) {
    printf("UnderFlow\n");
    exit(1);
  } else {
    p->front++;
    if (p->front == MAX)
      p->front = 0;
  }
}

void queuePush(queue *p, int x, int y, int d) {
  if ( fullQueue(p) ) {
    printf("OverFlow\n");
    exit(1);
  } else {
    p->data[p->rear][0] = x;
    p->data[p->rear][1] = y;
    p->data[p->rear][2] = d;
    p->rear++;
    if ( p->rear == MAX )
      p->rear = 0;
  }
}


int main(void) {
  int H, W;
  scanf("%d %d", &H, &W);

  char s[55][55];
  rep(hi, 0, H) scanf("%s", s[hi]);

  int ans = 1;
  rep(hi, 0, H) {
    rep(wi, 0, W) {
      if ( s[hi][wi] == '#' ) ans++;
    }
  }
  ans = H * W - ans;

  int mx[4] = {0 ,1, 0, -1};
  int my[4] = {1, 0, -1, 0};
  int visited[55][55];
  rep(hi, 0, H) rep(wi, 0, W) visited[hi][wi] = 0;

  initQueue(&que);
  queuePush(&que, 0, 0, 0);
  int dist = -1;
  visited[0][0] = 1;
  while ( !emptyQueue(&que) ) {
    int x = que.data[que.front][0];
    int y = que.data[que.front][1];
    int d = que.data[que.front][2];
    queuePop(&que);
    if ( x ==  W-1 && y == H-1 ) dist = d;
    for ( int mi = 0; mi < 4; mi++ ) {
      int nx = x + mx[mi];
      int ny = y + my[mi];
      if ( nx < 0 || W <= nx ) continue;
      if ( ny < 0 || H <= ny ) continue;
      if ( s[ny][nx] == '#' )  continue;
      if ( visited[ny][nx] )   continue;
      queuePush(&que, nx, ny, d + 1);
      visited[ny][nx] = 1;
    }
  }

  if ( dist == -1 ) printf("-1\n");
  else printf("%d\n", ans - dist);
  return 0;
}


Measured memory_bytes: 256
lines = readlines.map{|line| line.split(' ').map(&:to_i)}
lines[1]=lines[1].sort.reverse
a=0
for i in 0..lines[1].length-1
  a=a+lines[1][i]*(i+2)
end
b=4**(lines[0][0]-1)
puts (a*b)%(10**9+7)

Measured memory_bytes: 23536
#include <iostream>
#include <iomanip>
#include <fstream>
#include <utility>
#include <queue>
#include <vector>
#include <array>
#include <stack>
#include <list>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define bs(n) (1ull<<(n))

ull cmb(int n, int k) {
	return k == 0 ? 1 : (cmb(n - 1, k - 1) * n) / k;
}

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	ull* v = new ull[n];
	rep(i, n)cin >> v[i];
	sort(v, v + n, greater<>());
	ull m = v[a - 1], s = 0,c = 0, d = 0, r = 0;
	for (int i = 0; i < n; i++)if (v[i] == m)c++;
	for (int i = 0; i < a; i++)if (v[i] == m)d++;
	for (int i = 0; i < a; i++) s += v[i];
	if (s == m * a) {
		for (int i = a; i <= b; i++) {
			r += cmb(c, i);
		}
	}
	else {
		r += cmb(c, d);
	}
	cout << setprecision(20) << ((double)s) / a << endl << r << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
    int arr[200];
    int n;
    scanf("%d",&n);

    for(int i=0; i<n; i++){
        scanf("%d",&arr[i]);
    }
    int acum=10000;
    for(int i=0; i<n; i++){
        int s=0,s1=0;
        for(int j=0; j<n; j++){
            if(i>=j){
                s+=arr[j];
            }
            else{
                s1+=arr[j];
            }
        }
        if(s1-s<acum && s1-s>=0){
            acum=s1-s;
        }
        if(s-s1<acum && s-s1>=0){
            acum=s-s1;
        }

    }

    printf("%d\n",acum);
    return 0;
}


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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

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

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) {is >> x;} return is;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {1, 1, -1, -1}, dy[] = {1, -1, -1, 1}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    ll a, b, x;
    cin >> a >> b >> x;
    // x %= MOD;

    if(x < a) {
        cout << x%MOD << endl;
        return 0;
    }

    ll swap_num = (x-a)/(a-b) + 1;
    // cout << a-b << " " << x/(a-b) << " " << a/(a-b) << endl;
    // cout << swap_num << endl;
    b %= MOD;
    swap_num %= MOD;
    x %= MOD;
    // cout << swap_num << " " << b << " " << x << endl;
    ll ret = swap_num * b % MOD;
    (ret += x) %= MOD;
    cout << ret << endl;

    return 0;
}



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

int main() {
	int A, B;
	cin >> A >> B;
	int sum = 0;

	sum += max(A, B);
	if (A > B) {
		sum += max(A - 1, B);
	}
	else {
		sum += max(A, B - 1);
	}
	cout << sum << endl;
}


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

int main(){
  int n,i,cur1=0,cur2=0,ans;
  cin >> n;
  vector<int> w(n);
  for(i=0; i<n; i++){
    cin >> w[i];
    cur1+=w[i];
  }
  ans=cur1;
  for(i=0; i<n; i++){
    cur2+=w[i];
    cur1-=w[i];
    ans=min(ans,abs(cur1-cur2));
  }
  cout << ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  vector<int> b(n-1);
  rep(i,n-1) cin >> b.at(i);
  int ans = 0;
  ans += b.at(0)+b.at(n-2);
  for(int i=0; i+1<n-1; i++){
    ans+=min(b.at(i),b.at(i+1));
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<string, null_type,less<string>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define pb push_back
#define pf push_front
#define ppf pop_front
#define ppb pop_back
#define fi first 
#define sec second
#define pii pair<ll,ll>
#define endl "\n"
#define ook order_of_key
#define fbo find_by_order
#define md 1000000007
#define MD 998244353
#define MAXN 1000002
#define inf 10000000000
#define PI 3.1415926535897
ll input;

bool comp(const char &a,const char &b)
{
    return a>b;
}
struct cmp {
	bool operator() (const char &a, const char &b) const {
// 		if (a.fi == b.fi) return a.sec < b.sec;
// 		else
// 		return a.fi >b.fi ;
return a>b;
	}
};


int main() {
    int t=1;
    // cin>>t;
    while(t--)
    {
        string s,t;
        cin>>s>>t;
        ll ans=0;
        for(int i=0;i<s.length();i++)
        if(s[i]!=t[i])
        ans++;
        cout<<ans<<endl;
    }
}


Measured memory_bytes: 3924
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial
from heapq import heappop, heappush, heappushpop
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    C = [ST() for _ in range(2)]
    for i in range(3):
        if C[0][i] != C[1][2 - i]:
            print("NO")
            exit()
    print("YES")
if __name__ == '__main__':
    main()

Measured memory_bytes: 38384
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <fstream>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>

using namespace std;
using ll  = int64_t;
using ull = uint64_t;
constexpr ull bit(int n){ return 1ull << n;}

// for(auto && i : Range(l,r))
// -> i = [l..r)
class Range {
private: struct It{ int x; int operator*(){return x;} bool operator!=(It& lhs){ return x<lhs.x;} void operator++(){++x;} }; It l,r;
public: Range(int n):l({0}),r({n}){} Range(int i,int n):l({i}),r({n}) {}It& begin(){return l;} It& end(){return r;} };

void solve(istream &cin) {
    ll N, Y;
    while (cin >> N >> Y){
        Y /= 1000;
        ll x, y, z;
        x = y = z= -1;
        ll Z = Y - N;
        ll endz = Z/9 + 1;
        for (int zc = 0; zc < endz; ++zc) {
            ll rem = Z - 9*zc;
            if (rem % 4 == 0) {
                z = zc;
                y = rem / 4;
                x = N - z - y;
                if (x < 0) {
                    x = y = z = -1;
                }
                else break;
            }
        }
        cout << z << ' ' << y << ' '<< x << '\n';
    }
}

int main(int argc, char *argv[]) {
    string FileName("ABC085C"), Modifier("MEPH_");
    string ExecutionName = Modifier + FileName;
    string sub(argv[0]);
    if(sub.size() > ExecutionName.size())
        sub = sub.substr(sub.size()-ExecutionName.size(), ExecutionName.size());
    cerr << sub << endl;
    if (sub != ExecutionName) {
        cin.tie(0);
        ios::sync_with_stdio(false);
        solve(cin);
    }
    else {
        string inFile = "sample.txt";
        auto fs = fstream(inFile, fstream::in);
        solve(fs);
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
  char s[256];
  char *t;
  int n;
  double stac[256];
  while(fgets(s,1024,stdin)!=0){
    s[strlen(s)-1]=0;
    stac[0]=0.0;
    n=0;
    t=strtok(s," ");
    while(t!=NULL){
      if(strcmp(t,"+")==0){
	stac[n-2]+=stac[n-1];
	n--;
      }else if(strcmp(t,"-")==0){
	stac[n-2]-=stac[n-1];
	n--;
      }else if(strcmp(t,"*")==0){
	stac[n-2]*=stac[n-1];
	n--;
      }else if(strcmp(t,"/")==0){
	stac[n-2]/=stac[n-1];
	n--;
      }else{
	stac[n]=atof(t);
	n++;
      }
      t=strtok(NULL," ");
    }
    printf("%lf\n",stac[0]);
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
using namespace std;
bool cmp(const string m,const string n)
{
    return m>n;
}
int n,t;string str[1000000];
int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(;t<n;t++)
    {
        cin>>str[t];
    }
    if(!is_sorted(str,str+n,cmp))   sort(str,str+n,cmp);
    cout<<unique(str,str+n)-str<<'\n';
    return 0;
}

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

int main() {
	int q;
	cin >> q;
	set<int> S;
	for (int i = 0; i < q; ++i) {
		int query, x;
		cin >> query >> x;
		if (query == 0) {
			S.insert(x);
			cout << S.size() << endl;
		}
		else if (query == 1) cout << S.count(x) << endl;
		else S.erase(x);
	}
}


Measured memory_bytes: 12460
#include<stdio.h>

int max(int a,int b){
  if(a>=b){
    return a;
  }else{
    return b;
  }
}

int amax(int a,int b,int c){
  int q=max(a,b);
  int f=max(q,c);
  return f;
}

int main(void){
  int a,b;
  scanf("%d %d",&a,&b);
  printf("%d\n",amax(a+b,a-b,a*b));
  return 0;
}
  

Measured memory_bytes: 1704
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef  pair<int,int>P;
int main(){
  int n;
  vector<P>ve;
  while(cin >> n,n){
    ve.clear();
    int t,s;
    for(int i = 0 ; i < n ; i++ ){
      int a,b,c;
      char ch;
      cin >> a >> ch >> b >> ch >> c;
      s = a*3600 + b*60 + c;
      ve.push_back(P(s,1));
      cin >> a >> ch >> b >> ch >> c;
      t = a*3600 + b*60 + c;
      ve.push_back(P(t,-1));
    }

    sort(ve.begin(),ve.end());

    int ans = 0,sum = 0;
    for(int i = 0 ; i < ve.size() ; i++ ){
      sum += ve[i].second;
      ans = max(ans,sum);
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1532
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int n, k;
  int x[SIZE];

  scanf("%d%d", &n, &k);

  for(int i=0;i<n;i++){
    scanf("%d", x+i);
  }

  int ans = INF;

  for(int i=0;i+k<=n;i++){
    int p = min(0, x[i]);
    int q = max(0, x[i+k-1]);

    if ((p > 0) == (q > 0)) {
      ans = min(ans, max(abs(p), abs(q)));
    } else {
      ans = min(ans, abs(p) + abs(q) + min(abs(p), abs(q)));
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 640
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c1 = s.toCharArray();
    String t = sc.next();
    char[] c2 = t.toCharArray();

    if(c1.length+1 == c2.length){
      for(int i=0; i<c1.length; i++){
        if(c1[i]!=c2[i]){
          System.out.println("No");
          return ;
        }  
      }
      System.out.println("Yes");
      return;
    }

    System.out.println("No");

  }
}


Measured memory_bytes: 35628
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

constexpr int mod = 1e9 + 7;
long long GCD(long long x, long long y) {
    if (x % y == 0) return y;
    else return GCD(y, x % y);
}

int main() {
    int N;
    cin >> N;
    map<pair<long long, long long>, int> cnt;
    int zero_cnt = 0;
    rep(i, N) {
        long long A, B;
        cin >> A >> B;
        if (A == 0 && B == 0) {
            ++zero_cnt;
        } else if (A == 0) {
            ++cnt[{0, 1}];
        } else if (B == 0) {
            ++cnt[{1, 0}];
        } else {
            if (A < 0) {
                A *= -1;
                B *= -1;
            }
            long long G = GCD(A, abs(B));
            A /= G;
            B /= G;
            ++cnt[{A, B}];
        }
    }
    
    long long ans = 1;
    vector<int> two_pow(N + 1, 1);
    rep(i, N) two_pow[i + 1] = two_pow[i] * 2 % mod;
    for (auto p : cnt) {
        auto q = p.first;
        long long res = 1;
        if (q.first == 1 && q.second == 0) {
            res += two_pow[cnt[{0LL, 1LL}]] - 1 + two_pow[cnt[q]] - 1;
            cnt.erase({0LL, 1LL});
        } else if (q.first == 0 && q.second == 1) {
            res += two_pow[cnt[q]] - 1 + two_pow[cnt[{1LL, 0LL}]] - 1;
            cnt.erase({1LL, 0LL});
        } else if (q.second < 0) {
            res += two_pow[cnt[q]] - 1 + two_pow[cnt[{-q.second, q.first}]] - 1;
            cnt.erase({-q.second, q.first});
        } else {
            res += two_pow[cnt[q]] - 1 + two_pow[cnt[{q.second, -q.first}]] - 1;
            cnt.erase({q.second, -q.first});
        }
        ans = ans * (res % mod) % mod;
    }
    ans += zero_cnt;
    --ans;
    ans %= mod;
    if (ans < 0) ans += mod;
    cout << ans << endl;
    return 0;
}


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

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

    long t = 1;
    long a = 1;
    long tNext, aNext, tBuf, aBuf;
    long i;
    for(int j = 0; j < n; ++j){
        std::cin >> tNext >> aNext;

        if(0 == t % tNext){
            tBuf = t / tNext;
        }else{
            tBuf = t / tNext + 1;
        }

        if(0 == a % aNext){
            aBuf = a / aNext;
        }else{
            aBuf = a / aNext + 1;
        }

        i = std::max(tBuf, aBuf);

        t = i * tNext;
        a = i * aNext;
    }

    std::cout << t + a << std::endl;

    return 0;
}



Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// スペース区切りの整数の入力
		int b = sc.nextInt();
		int x = sc.nextInt();

		
		if(x<a){
			System.out.println("NO");
		}else{
			if(x>(a+b)){
				System.out.println("NO");
			}else{
				System.out.println("YES");
			}
		}
	}
}


Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define PII pair<int,int>
#define VS vector<string>
#define VI vector<int>
#define ll long long
#define ull unsigned long long
#define FST first
#define SEC second
int main(){
  int m,na,nb;
  while(1){
    cin>>m>>na>>nb;
    if(m+na+nb==0)break;
    VI V(m);
    REP(i,m)cin>>V[i];
    sort(ALL(V));
    reverse(ALL(V));
    int ma=-1,ans=-1;
    for(int i=na;i<=nb;i++){
      int d=V[i-1]-V[i];
      if(d>=ma){
        ma=d;ans=i;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 3136
/* template.cpp [[[ */
#include <bits/stdc++.h>
using namespace std;
#define get_macro(a, b, c, d, name, ...) name
#define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define rep4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)s)
#define rrep1(n) rrep2(i_, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep3(i, a, b) rrep4(i, a, b, 1)
#define rrep4(i, a, b, s) for (ll i = (ll)(b) - 1; i >= (ll)(a); i -= (ll)s)
#define each(x, c) for (auto &&x : c)
#define fs first
#define sc second
#define all(c) begin(c), end(c)
using ui = unsigned;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
const int inf = 1e9 + 10;
const ll inf_ll = 1e18 + 10;
const ll mod = 1e9 + 7;
const ll mod9 = 1e9 + 9;
const int dx[]{-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[]{0, -1, 0, 1, -1, -1, 1, 1};
template<class T, class U> void chmin(T &x, const U &y){ x = min<T>(x, y); }
template<class T, class U> void chmax(T &x, const U &y){ x = max<T>(x, y); }
struct prepare_ { prepare_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } prepare__;
/* ]]] */

int main(){
  vector<int> a(3);
  rep(i, 3) cin >> a[i];
  sort(all(a));
  cout << (a == vector<int>{5, 5, 7} ? "YES\n" : "NO\n");
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        String S = scan.next();
        char[] d = S.toCharArray();
        long red = 0;
        long green = 0;
        long blue = 0;
        for (int i = 0; i < d.length; i++) {
            if (d[i] == 'R') {
                red += 1;
            }
            if (d[i] == 'G') {
                green += 1;
            }
            if (d[i] == 'B') {
                blue += 1;
            }
        }
        long ans = red * green * blue;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                if (d[i] == d[j]) {
                    continue;
                }
                int k = j + j - i;
                if (N <= k) {
                    continue;
                }
                if (d[i] == d[k] || d[j] == d[k]) {
                    continue;
                }
                ans -= 1;
            }
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 27328
#include<stdio.h>
#include<string.h>
int main()
{
    char s[100005];
    int sum=0;
    scanf("%s", s);
    int len=strlen(s);
    for(int i=0;i<len-1;i++)
        if(s[i]!=s[i+1])
            sum++;
    printf("%d\n", sum);
    return 0;
}


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

#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) std::sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define ALL(obj) (obj).begin(),(obj).end()

using namespace std;

const int INF = 99999999;
const ll LINF = 9999999999999;

typedef pair<ll, ll> LP;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


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

	ll tmp;
	if (N % 1000 == 0) {
		tmp = 1000;
	}
	else {
		tmp = N % 1000;
	}

	cout << 1000 -tmp << endl;
	return 0;

}

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

#define fast ios::sync_with_stdio(false);cin.tie(0); cout.tie(0)

typedef long long ll;
typedef long double ld;
const ll inf = (ll)1e14;
const ll N = (ll)1e6;



int main() {
    fast;
    string s;
    cin >> s;
    if (s.substr(0, 4) == "YAKI") cout << "Yes\n";
    else cout << "No\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
bool isSorted(int arr[], int temp[], int n){
    for(int i = 0; i < n; i++)
        if(arr[i] != temp[i])
            return false;
    cout << "YES";
    exit(0);
}
int main()
{
    Hello
    int n;
    cin >> n;
    int arr[n + 5], temp[n + 5];
    for(int i = 0; i < n; i++){
        cin >> arr[i];
        temp[i] = arr[i];
    }
    sort(temp, temp + n);
    isSorted(arr, temp, n);
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            swap(arr[i], arr[j]);
            isSorted(arr, temp, n);
            swap(arr[i], arr[j]);
        }
    }
    cout << "NO";
    return 0;
}


Measured memory_bytes: 3672
#include<iostream>
using namespace std;
int main(){
    int n, k;
    cin >> n >> k;
    int a[n];
    for(int i=0; i<n; i++) cin >> a[i];

    int m=0;
    int ans=n-k+1;

    for(int i=0; i<n-1;){
        if(a[i]<a[i+1]){
            int len=0;
            while(i<n-1 && a[i]<a[i+1]){
                len++;
                i++;
            }
            if(len>=k-1) m++;
        }else i++;
    }
    if(m>0) m--;

    int dmin[n], dmax[n];
    int smin=0, tmin=0, smax=0, tmax=0;
    for(int i=0; i<n; i++){
        while(smin<tmin && a[dmin[tmin-1]]>=a[i]) tmin--;
        dmin[tmin] = i;
        tmin++;
        while(smax<tmax && a[dmax[tmax-1]]<=a[i]) tmax--;
        dmax[tmax] = i;
        tmax++;
        //cout << i<< " " <<a[i]<<" " <<tmin << tmax<<endl;
        
        if(i-k>=0){
            //cout<<i<<" min " <<dmin[0]<<endl;
            //cout <<i<< "max " << dmax[0]<<endl; 
            if((dmin[smin]==i-k)&&(dmax[smax]==i)) ans --;
            if(dmin[smin]==i-k) smin++;
            if(dmax[smax]==i-k) smax++;
        }
    }

    cout <<ans-m<<endl;

    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {
	string s;
	string str;
	cin >> s;
	for (int i = 0; i != s.size(); i++) {
		if (i % 2 == 0){
			if (s[i] == '2')str += 'k';
			else if (s[i] == '3')str += 's';
			else if (s[i] == '4')str += 't';
			else if (s[i] == '5')str += 'n';
			else if (s[i] == '6')str += 'h';
			else if (s[i] == '7')str += 'm';
			else if (s[i] == '8')str += 'y';
			else if (s[i] == '9')str += 'r';
			else if (s[i] == '0') {
				if (s[i + 1] == 'U'){
					str += 'n';
				}
				else str += 'w';
			}
		}
		else{
			if (s[i]=='U'){
				if (s[i - 1] == '0')str += 'n';
				else str += 'u';
			}
			else if (s[i] == 'D')str += 'o';
			else if (s[i] == 'R')str += 'e';
			else if (s[i] == 'L')str += 'i';
			else if (s[i] == 'T')str += 'a';
		}
	}
	cout << str << endl;
	char cc;
	cin >> cc;
	return 0;
}

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

using namespace std;

int main()
{
    int A, B;

    cin >> A >> B;

    if (A > 12) {
        cout << B << endl;
    } else if (A > 5 && A <=12) {
        cout << B/2 << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256