akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define prtd(var, i) cout << fixed << setprecision(i) << var << endl;
#define ll long long
using namespace std;
#define INF 1e18LL

const ll MAX = 1000000000000000000; //1e18

int main(){
    int a, b, k;
    cin >> a >> b >> k;
    if(((b-a+1)/2)+1 <= k){
        for(int i = a; i <= b; i++){
            cout << i << endl;
        }
        return 0;
    }else{
        for(int i = a; i < a+k; i++){
            cout << i << endl;
        }
        for(int i = b-k+1; i <= b ; i++){
            cout << i << endl;
        }
    }
}



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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  if (a + b > c + d) {
    cout << "Left" << endl;
  } else if (a + b < c + d) {
    cout << "Right" << endl;
  } else {
    cout << "Balanced" << endl;
  }
}

Measured memory_bytes: 3556
#include<stdio.h>
#include<stdlib.h>
#define MAX 100000
#define INF 1e9

typedef struct{
  char suit;
  int num;
  
}Card;

int partition(Card [], int, int);
void quicksort(Card [], int, int);
void mergesort(Card [], int, int);
void merge(Card [], int, int, int);
void Compare_and_Print(Card [], Card [], int);

Card Left[MAX/2+2];
Card Right[MAX/2+2];

int main()
{
  int i;
  int n;
  char str[15];
  Card A[MAX]={};
  Card B[MAX]={};
  
  scanf("%d",&n);
  
  for(i = 0;i < n;i++){
    scanf("%s%d", str, &A[i].num);
    A[i].suit = str[0];
    //A[i].suit = s;
    //A[i].num = atoi(str);
    //printf("A(suit, num) = (%c,%d)\n",A[i].suit, A[i].num);
    B[i] = A[i];
    //printf("B(suit, num) = (%c,%d)\n",B[i].suit, B[i].num);
  }
  
  quicksort(A, 0, n-1);
  mergesort(B, 0, n);

  Compare_and_Print(A, B, n);
  
  return 0;
}

void merge(Card A[], int l, int mid, int r)
{
  int i,k;
  
  int n1 = mid - l;
  int n2 = r - mid;

  for(i = 0;i < n1;i++) Left[i] = A[l+i];
  for(i = 0;i < n2;i++) Right[i] = A[mid+i];
  Left[n1].num = Right[n2].num = INF;

  int ii=0,jj=0;
  for(k = l;k < r;k++){
    if(Left[ii].num <= Right[jj].num) A[k] = Left[ii++];
    else A[k] = Right[jj++];
  }
}

void mergesort(Card A[], int left, int right)
{
  if( left+1 < right ){
    int mid = (right + left)/2;
    mergesort(A, left, mid);
    mergesort(A, mid, right);
    merge(A, left, mid, right);
  }
}

void quicksort(Card A[], int p, int r)
{
  int q;
  if( p < r ){
    q = partition(A, p, r);
    quicksort(A, p, q-1);
    quicksort(A, q+1, r);
  }
}

int partition(Card A[], int p, int r)
{
  int i,j;
  int x;
  Card temp;
  
  x = A[r].num;
  i = p-1;
  for(j = p; j < r;j++){
    if(A[j].num <= x){
      i++;
      temp = A[i];
      A[i] = A[j];
      A[j] = temp;
    }
  }
  temp = A[i+1];
  A[i+1] = A[r];
  A[r] = temp;
  
  return i+1;
}

void Compare_and_Print(Card A[], Card B[], int n)
{
  int i;
  int judge = 1;

  for(i=0;i < n;i++){
    if(A[i].suit != B[i].suit){
      judge = 0;
    }
  }
  if(judge == 1) printf("Stable\n");
  else printf("Not stable\n");
  
  for(i = 0;i < n;i++){
    printf("%c %d\n",A[i].suit, A[i].num);
  }
}



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

int main() {
    int n, m;
    while (cin >> n >> m, n|m) {
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        int min_t = (m / a[0]) * a[0];
        int idx = 0;
        bool b = false;
        for (int i = 1; i < n; i++) {
            int t = (m / a[i]) * a[i];
            if (min_t > t) {
                b = false;
                min_t = t;
                idx = i;
            } else if (min_t == t) {
                if (a[idx] > a[i]) {
                    b = false;
                    idx = i;
                } else if (a[idx] == a[i]) {
                    b = true;
                }
            }
        }
        if (b) {
            idx = n - 1;
        }
        cout << idx + 1 << endl;
    }
}

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin >> A.at(i);
  }
  sort(A.begin(),A.end());
  cout << A.at(0) << " " << A.at(N-1) << " ";
  long long sum=0;
  for(int i=0;i<N;i++){
    sum+=A.at(i);
  }
  cout << sum << endl;
}


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

int main (){
    int x,y,z;
    cin >> x >> y>> z;
    cout << z <<" "<< x <<" "<< y << 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 w = sc.nextInt();
		int h = sc.nextInt();
		int n = sc.nextInt();
		int x[] = new int[n];
		int y[] = new int[n];
		int a[] = new int[n];
		for(int i=0; i<n; i++){
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			a[i] = sc.nextInt();
		}

		int rect[][] = new int[w][h];
		for(int k=0; k<n; k++){
			switch (a[k]){
				case 1:
					for(int i=0; i<x[k]; i++){
						for(int j=0; j<h; j++){
							rect[i][j] = 1;
						}
					}
					break;
				case 2:
					for(int i=x[k]; i<w; i++){
						for(int j=0; j<h; j++){
							rect[i][j] = 1;
						}
					}
					break;
				case 3:
					for(int i=0; i<w; i++){
						for(int j=0; j<y[k]; j++){
							rect[i][j] = 1;
						}
					}
					break;
				case 4:
					for(int i=0; i<w; i++){
						for(int j=y[k]; j<h; j++){
							rect[i][j] = 1;
						}
					}
					break;
			}
		}

		int black = 0;
		for(int j=0; j<h; j++){
			for(int i=0; i<w; i++){
				black += rect[i][j];
			}
		}

		System.out.println(w*h - black);
	}
}

Measured memory_bytes: 10704
N = int(input())

if N * 100 % 108 == 0:
    print(int(N / 1.08))
else:
    if int(N // 1.08 * 1.08) == N:
        print(int(N / 1.08))
    elif int((N // 1.08 + 1) * 1.08) == N:
        print(int(N / 1.08) + 1)
    else:
        print(":(")

Measured memory_bytes: 3060
code="""
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
using namespace std;

#define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

int dfs(const vvi& g,int u)
{
	int res=1<<u;
	for(int v:g[u]) res|=dfs(g,v);
	return res;
}

int main()
{
	for(int n,m;cin>>n>>m && n|m;){
		array<int,20> cs;
		vvi g(n);
		rep(i,n){
			cin>>cs[i];
			int k; cin>>k;
			rep(j,k){
				int r; cin>>r;
				g[i].push_back(r);
			}
		}

		array<int,20> bs;
		rep(i,n) bs[i]=dfs(g,i);

		static array<int,1<<20> sums; sums.fill(0);

		rep(i,n) sums[1<<i]=cs[i];
		rep(i,1<<n) sums[i]=sums[i&-i]+sums[i-(i&-i)];

		int res=INF;
		rep(i,1<<n) if(__builtin_popcount(i)<res){
			int b=0;
			rep(j,n) b|=(i>>j&1)*bs[j];
			if(sums[b]>=m) res=min(res,__builtin_popcount(b));
		}
		cout<<res<<endl;
	}
}
"""

import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")

f=open(filename,"w")
f.write(code)
f.close()

os.system("g++ -std=c++0x {} -o ./a.out".format(filename))
os.system("./a.out")

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

typedef long long ll;
template <class T> ll size(const T& x) { return x.size(); }
#define rep(i,a,b) for(ll i = (a); i < (b); ++i)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define pb push_back
#define fs first
#define sc second
#define MOD 1000000007
#define MOD2 998244353
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
template <class T> T smod(T a, T b) {
  return (a % b + b) % b; }

ll h, w;
bool mp[105][105];
ll mem[105][105][2];
ll dp(int y, int x, bool on)
{
	if(y == h || x == w) return 1e10;
	if(y == h-1 && x == w-1)
	{
		if(mp[y][x])
		{
			return 0;
		}else
		{
			return (on ? 0 : 1);
		}
	}
	if(mem[y][x][on] != -1) return mem[y][x][on];
	ll mn = 1e10;
	if(mp[y+1][x])
	{
		if(on) mn = min(mn, dp(y+1,x, false));
		else mn = min(mn, dp(y+1,x,false));
	}else
	{
		if(on) mn = min(mn, dp(y+1,x,true));
		else mn = min(mn, 1+dp(y+1,x,true));
	}
	if(mp[y][x+1])
	{
		if(on) mn = min(mn, dp(y,x+1,false));
		else mn = min(mn, dp(y,x+1,false));
	}else
	{
		if(on) mn = min(mn, dp(y,x+1,true));
		else mn = min(mn, 1+dp(y,x+1,true));
	}
	return mem[y][x][on] = mn;
}

void solve()
{
	cin >> h >> w;
	memset(mp,1,sizeof(mp));
	memset(mem,-1,sizeof(mem));	
	rep(i,0,h)
	{
		string in;
		cin >> in;
		rep(j,0,w)
		{
			mp[i][j] = (in[j] == '.');
		}
	}
	//rep(i,0,h)
		//rep(j,0,w)
		//cout << mp[i][j]
	if(mp[0][0]) cout << dp(0,0,false) << endl;
	else cout << 1 + dp(0,0,true) << endl;
}

int main()
{
	cin.sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); 
	/*ll t;
	cin >> t;
	while(t--)*/
		solve();
	return 0;	
}


Measured memory_bytes: 512
fun main(args: Array<String>) {
    caddi2018b_b()
}

fun caddi2018b_b() {
    val (n, h, w) = readLine()!!.split(' ').map { it.toInt() }
    val abList = (1..n).map { readLine()!!.split(' ').map { it.toLong() } }

    val answer = abList.count { it[0] >= h && it[1] >= w }

    println(answer)
}


Measured memory_bytes: 36540
#include<iostream>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define int64 long long
#define yokuwaruprime (10*10*10*10*10*10*10*10*10+7)
using namespace std;

int main(){
  int64 n,m;
  cin>>n>>m;
  cout<<abs((n-2)*(m-2))<<endl;
}


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

int main() {
  int m,n;
  int value=0;
  cin >> m;
  vector<string> blue(m);
  for(int i=0;i<m;i++){
    cin >> blue.at(i);
  }
  
  cin >>n;
  vector<string> red(n);
  for(int i=0;i<n;i++){
    cin >> red.at(i);
  }
  
  for(int i=0;i<m;i++){
    int cnt=0;
    for(int j=0;j<m;j++){
      if(blue.at(i)==blue.at(j))
        cnt++;
    }
    for(int j=0;j<n;j++){
      if(blue.at(i)==red.at(j))
        cnt--;
    }
    value=max(value,cnt);
  }
  cout << value <<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int a,b,c,d,e,f;
int main() {
	scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
	double max0=0;
	int ans1=0,ans2=0;
	for (int i=0;;i++) {
		if (i*a*100>f) break;
		for (int j=0;;j++) {
			if (i==0&&j==0) continue;
			if (i*a*100+j*b*100>f) break;
			int now=100*(i*a+j*b);
			int rest=min((i*a+j*b)*e,f-now);
			for (int k=0;;k++) {
				if (k*c>rest) break;
				int nowx=(rest-k*c)/d*d+k*c;
				double nx=nowx*1.0/now;
				if (nx>=max0) {
					max0=nx;
					ans1=now+nowx;
					ans2=nowx;
				}
			}
		}
	}
	printf("%d %d\n",ans1,ans2);
	return 0;
}

Measured memory_bytes: 256
s = input().split();
n = int(s[0])
m = int(s[1])
h =  list(map(int, input().split()))
A = []
B= []
record = [1 for i in range(n)]
ans = 0
for i in range(m):
	s = input().split();
	a = int(s[0])
	b = int(s[1])
	if h[a-1] ==h[b-1]:
		record[a-1]=0
		record[b-1]=0
	elif h[a-1] > h[b-1]:
		record[b-1]=0
	else:
		record[a-1]=0

for j in range(n):
	if record[j] != 0:
		ans += 1

print(ans)
		

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

void maxHeapify(int *,int,int);
void buildMaxHeap(int *,int);

int main()
{
  int i,a;
  int *A;

  scanf("%d", &a);
  
  A = (int*)malloc(sizeof(int)*(a+1));
  
  for (i=0;i<a;i++) {
    scanf("%d",&A[i+1]);
  }

  buildMaxHeap(A,a);

  for (i=1;i<=a;i++) {
    printf(" %d",A[i]);
  }

  printf("\n");

  return 0;
}


void maxHeapify(int *A, int s, int t)
{
  int l,r,large, tmp;
  
  l = t * 2;
  r = l + 1;

  if (l<=s&&A[l]>A[t]) large=l;
  else large = t;

  if (r<=s&&A[r]>A[large]) large=r;

  if (large != t) {
    tmp = A[t];
    A[t] = A[large];
    A[large] = tmp;

    maxHeapify(A, s, large);
  }
}

void buildMaxHeap(int *A, int s)
{
  int i;
  
  for (i = s / 2; i > 0; i--)
    maxHeapify(A, s, i);
}



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

#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384


int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}    //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}     //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);}       // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}  //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}   //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}  // b進数の各位の和？
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和

//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}

//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}


typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) ; for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

 
/*CODE START HERE*/
int main() {
  vector <int64_t> a(90);
  a.at(0)=2;
  a.at(1)=1;
  int n;
  cin >> n;
  forr(i,2,n+1){
    a.at(i)=a.at(i-1)+a.at(i-2);
  }
  cout << a.at(n) << endl;
}

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

int main()
{
	int w;
	while (cin >> w)
	{
		int weight[] = {512,256,128,64,32,16,8,4,2,1};
		bool used[] = {false,false,false,false,false,false,false,false,false,false};
		int i = 0;
		while (w > 0 && i < 10)
		{
			if (w < weight[i])
			{
				i++;
			}
			else
			{
				w -= weight[i];
				used[i] = true;
				i++;
			}
		}
		bool f = false;
		for (i = 9; i >= 0; i--)
		{
			if (used[i])
			{
				if (!f)cout << weight[i];
				else cout << " " <<weight[i];
				f = true;
			}
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,n,m) for (int i = (n); i <= (m); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;


int main() {
    ll a, b;
    cin >> a >> b;
    cout << a * b << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <numeric>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using ll = long long int;
using ul = unsigned long long int;
const ll LL_MAX (1LL<<60);
const ll MOD (1000000007);

#define rep(i,s,e) for(ll i=(s); i<(e); i++) 

using namespace std;

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

    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i,0,n)
        cin >> a[i];

    unordered_map<ll, ll> h;
    rep(i,0,n)
    {
        h[a[i]]++;
    }

    ll ans(0);
    for (auto i: h)
    {
        ll t = -i.first + i.second;
        if (t<0)
            ans += i.second; 
        else
            ans += t;
    }

    cout << ans << endl;
        
    return 0;
}


Measured memory_bytes: 5028
n = gets.to_i
a = gets.split.map &:to_i
check = 0
n.times do |cnt|
    if (a[cnt] % 2) == 0
        if !((a[cnt] % 3) == 0 || (a[cnt] % 5) == 0)
            check = 1
        end
    end
end
if check == 0
    print "APPROVED"
else
    print "DENIED"
end

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

#define type long long int

type solve(std::vector<int> nums){
  type ans = 0;

  int N = 1;

  for(int i = 0; i < (int)nums.size() - 1; i++){
    N = N * 2;
  }
  
  for(int i = 0; i < N; i++){
    long long int tmp = 0;
    int plus = i;
    for(int j = 0; j < (int)nums.size(); j++, plus = plus >> 1){
      if((plus & 0x1) == 0x1){
        tmp = tmp * 10 + nums[j];
        ans += tmp;
        tmp = 0;
      } else {
        tmp = tmp * 10 + nums[j];
      }
    }
    ans += tmp;
  }

  return ans;
}

int main(){

  std::string seq;
  std::cin >> seq;

  std::vector<int> nums(seq.size());

  for(int i = 0; i < (int)seq.size(); i++){
    nums[i] = seq[i] - '0';
  }

  type result = solve(nums);

  std::cout << result << std::endl;
  
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long

int dp[100010][4];

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    dp[0][0] = 1;
    rep(i, S.length()) {
        if (S[i] == '?') {
            rep(j, 4) dp[i + 1][j] = dp[i][j] * 3;
            rep(j, 3) dp[i + 1][j + 1] += dp[i][j];
        }
        else rep(j, 4) dp[i + 1][j] = dp[i][j];
        if (S[i] == 'A') {
            dp[i + 1][1] += dp[i][0];
        }
        if (S[i] == 'B') {
            dp[i + 1][2] += dp[i][1];
        }
        if (S[i] == 'C') {
            dp[i + 1][3] += dp[i][2];
        }
        rep(j, 4) dp[i + 1][j] %= mod;
    }
    cout << dp[S.length()][3] << endl;

    return 0;
}


Measured memory_bytes: 3664
#include <iostream>

#include <string>

#include <algorithm>

using std::cin;
using std::cout;
using std::endl;

using std::string;

using std::sort;

int
main()
{
  string s, t;
  cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end(), std::greater<char>());
  cout << (s < t ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256
n = input().split()
W = int(n[0])
H = int(n[1])
x = int(n[2])
y = int(n[3])
r = int(n[4])

if x+r > W:
    print('No')
else:
    if y+r > H:
        print('No')
    elif x < 0 or y < 0:
        print('No')
    else:
        print('Yes')

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

typedef long long ll;

void printArray(vector<int> arr) {
	for (int a: arr) cout << a << " ";
	cout << '\n';
}

int h[100001];
int dp[100001];

int main() {
	std::ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	for (int i =0; i<n; i++) cin >> h[i];
	dp[0] = 0;
	for (int i = 1; i<n; i++) {
		if (i == 1) dp[i] = dp[i-1] + abs(h[i] - h[i-1]);
		else dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]));
	} 
	cout << dp[n-1] << '\n';
}



Measured memory_bytes: 4384
/*
 * じょえチャンネル
 * 高評価・チャンネル登録よろしくおねがいします！
 * https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
 */
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define all(v) v.begin(),v.end()
#define inf (int)(3e18)
#define P pair<int,int>
#define mod (int)(1e9+7)
template<class T> inline void chmin(T &a, T b) {
	a = min(a, b);
}
template<class T> inline void chmax(T &a, T b) {
	a = max(a, b);
}

int mod_pow(int x, int y, int m = mod) {
	int res = 1;
	x %= m;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int perm[1000005];
void init_perm(){
	perm[0]=1;
	REP(i,1000005)perm[i]=perm[i-1]*i%mod;
}
int nCk(int x,int y){
	if(x<y)return 0;
	return perm[x]*mod_pow(perm[x-y],mod-2)%mod*mod_pow(perm[y],mod-2)%mod;
}
signed main(){
	init_perm();
	int N,A,B,C;
	cin>>N>>A>>B>>C;
	int ans=0;
	int a=A*mod_pow(A+B,mod-2)%mod;
	int b=B*mod_pow(A+B,mod-2)%mod;
	for(int i=N;i<=2*N-1;i++){
		int ans1=mod_pow(a,N)*mod_pow(b,i-N)%mod*nCk(i-1,N-1)%mod;
		int ans2=mod_pow(b,N)*mod_pow(a,i-N)%mod*nCk(i-1,N-1)%mod;
		ans+=(ans1+ans2)*i%mod;
		ans%=mod;
	}
	cout<<ans*100%mod*mod_pow(100-C,mod-2)%mod<<endl;
}


Measured memory_bytes: 8064
class abc_157:
    
    def __init__(self):
        pass
    
    def A(self):
       N=int(input())
       print(int(N/2)+(N%2))
    
    def B(self):
        A=[list(map(int,input().split())) for i in range(3)]
        N=int(input())
        
        B=[]
        for i in range(N):B.append(int(input()))
        
        
            
    def C(self):
        NM=list(map(int,input().split()))
        sc=[list(map(int,input().split())) for i in range(NM[1])]
        farst,second,third,full=[],[],[],[]
        division_list=[10**i for i in range(3)]
        ans=0
        
        for i in sc:
            if i[0]==1:farst.append(i)
            elif i[0]==2:second.append(i)
            else :third.append(i)
        
        sort_func=lambda val:val[1]
        farst.sort(key=sort_func)
        second.sort(key=sort_func)
        third.sort(key=sort_func)
        
        if farst:ans+=(10**(3-farst[0][0]))*farst[0][1]
        if second:ans+=(10**(3-second[0][0]))*second[0][1]
        if third:ans+=(10**(3-third[0][0]))*third[0][1]
        
        if int(ans/division_list[NM[0]-1])!=0:print(ans)
        else:print("-1")
            
    def D(self):
        S=input()
        Q=int(input())
        Q_list=[list(input().split()) for i in range(Q)]
        
        d=deque()
        top=True
        end=False
        count_revers=0
        
        d.append(S)
        for i in Q_list:
            #Ti==1
            if int(i[0])==1:
                count_revers+=1
                if top==True:
                    top=False
                    end=True
                else:
                    top=True
                    end=False
            #Ti==2
            else:
                #Fi==1
                if int(i[1])==1 :
                    if top==True:d.appendleft(i[2])
                    else:d.append(i[2])
                #Fi==2
                else :
                    if top==True:d.append(i[2])
                    else:d.appendleft(i[2])
                
                
        ans = "".join(list(d)) if count_revers%2==0 else  "".join(list(d))[::-1]
        print(ans)
        
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_157()
    obj.A()

Measured memory_bytes: 38256
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

template <typename T>
T pow(T a, ll n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= a; 
        a *= a;
        n >>= 1;
    }
    return ret;
}

int main() {
    ll n, k;
    cin >> n >> k;

    ll ans = pow(n/k, 3);
    if (k % 2 == 0) ans += pow(n/(k/2) - n/k, 3);

    cout << ans << endl;

    return 0;
}


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

int main(int argc, const char * argv[]) {
    string str;
    int i;
    
    getline(cin,str);
    
    for(i=0;i<(int)str.size();i++){
        if('a'<=str[i] && str[i]<='z'){
            str[i]=str[i]-'a'+'A';
        }else if('A'<=str[i] && str[i]<='Z'){
            str[i]=str[i]-'A'+'a';
        }else{}
    }
    
    cout << str << endl;
    
    return 0;
}



Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin >> S;
    int small = 0, countc = 0;
    bool capitalc = false;
    for(int i = 0; i < S.size(); i++){
        if(S.at(i)>='a' && S.at(i)<='z')
        small++;
    }
    for(int i = 2; i < S.size()-1; i++){
     if(S.at(i) =='C')
     countc++;
    }
    if(countc == 1)
    capitalc = true;
    if(S.at(0) == 'A' && capitalc == true && small == S.size()-2)
    cout << "AC" << endl;
    else
    {
        cout << "WA" << 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;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    switch (n % 10) {
    case 2:
    case 4:
    case 5:
    case 7:
    case 9: {
        cout << "hon" << endl;
        break;
    }
    case 0:
    case 1:
    case 6:
    case 8: {
        cout << "pon" << endl;
        break;
    }
    default:
        cout << "bon" << endl;
        break;
    }    
    return 0;
}


Measured memory_bytes: 3636
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <math.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

int main()
{
    stack<int> list;
    string c;
    while (cin >> c)
    {
        if (c == "+")
        {
            int num1, num2;
            num1 = list.top();
            list.pop();
            num2 = list.top();
            list.pop();
            list.push(num1 + num2);
        }
        else if (c == "-")
        {
            int num1, num2;
            num1 = list.top();
            list.pop();
            num2 = list.top();
            list.pop();
            list.push(num2 - num1);
        }
        else if (c == "*")
        {
            int num1, num2;
            num1 = list.top();
            list.pop();
            num2 = list.top();
            list.pop();
            list.push(num1 * num2);
        }
        else
        {
            list.push(stoi(c));
        }
    }
    cout << list.top() << endl;
}



Measured memory_bytes: 3176
#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
using namespace std;
#define INF 1LL << 61
#define MAX 1LL << 30
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={1,-1,0,0},dy[]={0,0,-1,1};


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

    int N;
    cin>>N;
    int now=N+1,ans=0;
    for(int i=0;i<N;i++){
        int x;
        cin>>x;
        if(x<now) ans++,now=x;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define AC 0
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n,gcd=0;
	cin>>n;
	vector<int> a(n),prime(1e6+1);
	bool p=1;
	for(int i=0;i<n;i++) {
		cin>>a[i];
		int tmp=a[i];
		for(int j=2;1ll*j*j<=tmp;j++)
			if(!(tmp%j)) {
				if(prime[j]) p=0;
				prime[j]=1;
				while(!(tmp%j)) tmp/=j;
			}
		if(tmp!=1) {
			if(prime[tmp]) p=0;
			prime[tmp]=1;
		}
		gcd=__gcd(gcd,a[i]);
	}
	if(p) cout<<"pairwise coprime\n";
	else if(gcd==1) cout<<"setwise coprime\n";
	else cout<<"not coprime\n";
	return AC;
}


Measured memory_bytes: 11116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    double a,b,c,d,e,f;
        while(cin>>a>>b>>c>>d>>e>>f){
        double x = (c*e-b*f)*(1/(a*e-b*d));
        double y = (-c*d+a*f)*(1/(a*e-b*d));
        char buf[24], buff[24];
        snprintf(buf, 24, "%.3f", x);
        snprintf(buff, 24, "%.3f", y);
        if(!strcmp(buf ,"-0.000"))strcpy(buf, "0.000");
        if(!strcmp(buff ,"-0.000"))strcpy(buff, "0.000");
        if(x==0)x=0;
        printf("%s %s\n",buf,buff);
    }
}



Measured memory_bytes: 3128
package main

import "fmt"

func main() {
	slice := make([]int, 3)
	fmt.Scanf("%d %d %d", &slice[0], &slice[1], &slice[2])

	count5 := 0
	count7 := 0

	for i := 0; i < 3; i++ {
		if slice[i] == 5 {
			count5++
		} else if slice[i] == 7 {
			count7++
		}
	}

	if count5 == 2 && count7 == 1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 n;
vector<i64> h;
int main() {
  cin >> n;
  read_n(h, n);
  i64 ans = 0;
  for (i64 i = 0, j = 0; i < n; ++i) {
    if (i > 0 && h[i] <= h[i - 1]) {
      ++j;
    } else {
      j = 0;
    }
    ans = max(ans, j);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=100111;
const int inf=1000000007;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


/*
vvl comb(int n, int r) {
	vvl v(n + 1,vl(n + 1, 0));
	for (int i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int j = 1; j < v.size(); j++) {
		for (int k = 1; k < j; k++) {
			v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
		}
	}
	return v;
}
*/

void sosu(ll x,bool f[]){
	ll y=x;
	for(ll i=2;i<=sqrt(y);i++){
		if(x%i==0){
			x/=i;
			f[i]=true;
			i--;
		}
	}
}

ll __gcd(ll x,ll y){
	if(x<y)swap(x,y);
	while(1){
		ll tmp=x%y;
		x=y;
		y=tmp;
		if(y==0)break;
	}
	return x;
}

	

int main(){
	ll a,b;
	cin>>a>>b;
	ll gcd=__gcd(a,b);
	ll G=gcd;
	int cnt=1;
	for(ll i=2;i*i<=G;i++){
		bool f=false;
		while(gcd%i==0){
			gcd/=i;
			f=true;
		}
		if(f)cnt++;
	}
	if(gcd!=1)cnt++;
	cout<<cnt;
}

Measured memory_bytes: 256
N,M = map(int, input().split())
X = [ [int(j) for j in input().split()] for _ in range(N)]
ans = 0
for i in range(1<<3):
    if M==0:
        break
    ss = [None]*N

    for n in range(0,N):
        x,y,z = X[n]
        s = (x if (i & (1<<2)) else -x) \
            + (y if (i & (1<<1)) else -y) \
            + (z if (i & (1<<0)) else -z)
        ss[n] = s
    ss.sort()
    ans = max(ans, sum(ss[N-M:]))
print(ans)

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

using namespace std;

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

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    unsigned long long A;
    string B;
    
    cin >> A >> B;
    
    istringstream iss(B);
    
    char dec1, dec2, b;
    unsigned long long intb = 0;
    
    while (iss >> b, b !='.') {
        intb = intb*10 + b - '0';
    }

    iss >> dec1 >> dec2;
    unsigned long long dec1b = dec1 - '0';
    unsigned long long dec2b = dec2 - '0';
    
    //cout << dec2 - '0' << endl;
    
    unsigned long long C;
    
    C = A * dec2b;
    C += A * dec1b*10;
    C /= 100;
    C += A*intb;
    
    cout << C << endl;
    
}


Measured memory_bytes: 3660
#include<iostream>
using namespace std;
int main(){
  int n;
  int i;
  int card[4][13]={{}};
  cin >> n;
  char a;
  int b;
  for(i=0;i<n;i++) {
    cin >> a >> b;
    switch(a){
    case 'S':
      card[0][b-1]=1;
      break;
    case 'H':
      card[1][b-1]=1;
      break;
    case 'C':
      card[2][b-1]=1;
      break;
    case 'D':
      card[3][b-1]=1;
      break;
    }
  }
  for(i=0;i<52;i++) {
    switch(i/13){
    case 0:
      if(card[0][i%13]==0) cout << "S " << i+1 << endl;
      break;
    case 1:
      if(card[1][i%13]==0) cout << "H " << i%13+1 << endl;
      break;
    case 2:
      if(card[2][i%13]==0) cout << "C " << i%13+1 << endl;
      break;
    case 3:
      if(card[3][i%13]==0) cout << "D " << i%13+1 << endl;
      break;
    }
  }
  
  return 0;
}


Measured memory_bytes: 3096
#include<stdio.h>
int main(){
    int N,Y;
    scanf("%d %d",&N,&Y);
    for(int i=0;i<=N && 10000*i<=Y;i++){
            for(int j=0;i+j<=N && 10000*i+5000*j<=Y;j++){
                if(i*10000+j*5000+(N-i-j)*1000 == Y){
                    printf("%d %d %d",i,j,N-i-j);
                    return 0;
                }
          }
    }
printf("-1 -1 -1");
return 0;        
}


Measured memory_bytes: 128
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = 0
dis = []
count = 0
for i,j in zip(a,b):
    if j > i:
        ans += 1
        count += j-i
    else:
        dis.append(i-j)
dis.sort(reverse=True)
if count > 0 and dis == []:
    print(-1)
else:
    now = 0
    while now < len(dis) and count > 0:
        ans += 1
        count -= dis[now]
        now += 1
    if count > 0:
        print(-1)
    else:
        print(ans)

Measured memory_bytes: 24148
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int ans = 0;
		for(int i=0; i<15; i++){
			if(n<0){
				break;
			}
			else if(n%4==0){
				ans = 1;
				break;
			}
			n = n-7;
		}

		if(ans==0){
			System.out.println("No");
		}
		else{
			System.out.println("Yes");
		}
	}
}

Measured memory_bytes: 22612
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		
		int n=in.nextInt(),m=(int)Math.pow(2, n)-1;
		int k=in.nextInt();
		List<Integer> T=new ArrayList<>();
		for(int i=0;i<k;i++)T.add(Integer.parseInt(in.next()));
		
		PrintWriter out=new PrintWriter(System.out);
		for(int i=0;i<=m;i++){
			String str=Integer.toBinaryString(i);
//			System.out.println(str);
			
			List<Integer> ls=new ArrayList<>();
			for(int j=0;j<str.length();j++){
				if(str.charAt(str.length()-1-j)=='1')ls.add(j);
			}
			
			if(ls.size()>=T.size() && ls.containsAll(T)){
				out.print(i+":");
				for(int j=0;j<ls.size();j++)out.print(" "+ls.get(j));
				out.println();
			}
			
		}
		out.flush();
	}

}



Measured memory_bytes: 135000
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define REP(i,n) for(long long i=0;i<n;i++)
#define REPP(i,m,n) for(long long i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())
#define de cout << "debug" << endl;
#define pb push_back
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    cin.tie(0);    
	ios::sync_with_stdio(false);
    int N,M;
    cin >> N >> M;
    int ans = 0;
    if((N+M) % 2 == 0){
    cout << (N+M)/2 << endl;
    }
    else cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main () {
    int x , n;
    do{
        scanf("%d %d", &x, &n);
        if(n !=0 || x != 0) {
            int total = 0;
            for (int a = 1; a <= x; a++)
            {
                for (int b = 1; b <= x; b++)
                {
                    for (int c = 1; c <= x ; c++)
                    {
                        if(a < b && b < c  && a + b + c == n ){
                            total = total + 1;
                        }
                    }
                    
                }   
            }printf("%d\n", total);
        }
    } while (n != 0 || x != 0);

    return 0;
}



Measured memory_bytes: 2044
n = int(input())

l = {}
for i in range(1, n+1):
    l[i] = 0

for x in range(1, min(101, n)):
    for y in range(1, min(101, n)):
        for z in range(1, min(101, n)):
            m = (x + y + z) ** 2 - (x*y + y*z + z*x)
            if m <= n:
                l[m] += 1
for i in range(1, n+1):
    print(l[i])

Measured memory_bytes: 9748
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n= scan.nextInt();
		int m= scan.nextInt();
		int a[][]= new int[n][m];
		int b[]= new int[m];
		int c= scan.nextInt();
		for(int i=0;i<m;i++) {
			b[i]=scan.nextInt();
		}
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j]=scan.nextInt();
			}
		}
		scan.close();
		int cnt=0;
		for(int i=0;i<n;i++) {
			int sum=0;
			for(int j=0;j<m;j++) {
				sum+=a[i][j]*b[j];
			}
			if(sum+c>0)cnt++;
		}
		System.out.println(cnt);
	}
}

Measured memory_bytes: 23380
#include <iostream>
#include <vector>
#include <string>

int main(void) {
	// input
	std::string ss, t;
	std::cin >> ss;
	std::cin >> t;

	int len_ss = ss.size();
	int len_t = t.size();
	int pos_sub = -1;
	for(int i = len_ss - len_t; i >= 0; --i) {
		bool is_match = true;
		for(int j = 0; j < len_t; ++j) {
			if(ss[i+j] != t[j] && ss[i+j] != '?') {
				is_match = false;
				break;
			}
		}
		if(is_match) {
			pos_sub = i;
			break;
		}
	}
	
	std::string s = "";
	if(pos_sub < 0) s = "UNRESTORABLE";
	else {
		for(int i = 0; i < len_ss; ++i) {
			if(i >= pos_sub && i < pos_sub + len_t) s += t[i - pos_sub];
			else if(ss[i] == '?') s += 'a';
			else s += ss[i];
		}
	}

	std::cout << s << std::endl;

	return 0;
}


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;

int main() {
  int n, k;
  cin >> n >> k;
  vector<int>l(n);
  for (int i = 0; i < (n); ++i){
    cin >> l[i];
  }
  sort(l.rbegin(), l.rend());
  int ans = 0;
  for (int i = 0; i < k; ++i){
    ans += l[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

int main() {
    int n;
    cin >> n;
    cout << n * 800 - 200 * (n / 15) << "\n";
    return 0;
}

Measured memory_bytes: 256
object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datN) = readLine.split(" ").map(_.toInt)
    val datA = for(i <- 1 to datN) yield (readLine.split(" ").map(_.toLong).head)
    val scoreA = datA.groupBy(identity).map{ case (k, v) => v.length % 2 }.sum
    println(scoreA)
  }
}


Measured memory_bytes: 114372
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=1)
from collections import Counter
c=Counter(a)
ans=0
for i in a:
  if c[i]==0:continue
  m=1<<i.bit_length()
  c[i]-=1
  if c[m-i]:
    ans+=1
    c[m-i]-=1
print(ans)

Measured memory_bytes: 33824
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll

const int md = 1000000007;
const int INF = 1<<30;



int main(){
    int a,p; cin >> a >> p;
    cout << (a*3 + p)/2 << endl;
}


Measured memory_bytes: 764
#!/usr/bin/env python3

from collections import defaultdict
from heapq import heappush, heappop
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")


def debug(*x):
    print(*x, file=sys.stderr)


def solve(N, K, AS):
    for _i in range(K):
        d = [0] * (N + 1)
        for i in range(N):
            x = AS[i]
            d[max(i - x, 0)] += 1
            d[min(i + x + 1, N)] -= 1
        cur = 0
        ret = [0] * N
        for i in range(N):
            cur += d[i]
            ret[i] = cur
        AS = ret
        if all(x == N for x in ret):
            return ret

    return ret


def main():
    N, K = map(int, input().split())
    AS = list(map(int, input().split()))

    print(*solve(N, K, AS))


T1 = """
5 1
1 0 0 1 0
"""


def test_T1():
    """
    >>> as_input(T1)
    >>> main()
    1 2 2 1 2
    """


T2 = """
5 2
1 0 0 1 0
"""


def test_T2():
    """
    >>> as_input(T2)
    >>> main()
    3 3 4 4 3
    """


def _test():
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())

    def input():
        return bytes(f.readline(), "ascii")

    def read():
        return bytes(f.read(), "ascii")


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import solve  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        print("testing")
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()


Measured memory_bytes: 221632
#include<bits/stdc++.h>
const int N=3e5+5,mo=1e9+7,ch[2][7]={{5,3,2,4,3,6,5},{1,2,2,1,3,0,5}};
int i,j,f[N][7];
char c[N];
inline void add(int&x,const int&y){x+=y-mo;x+=x>>31&mo;}
int main(){
	scanf("%s",c+1);f[0][0]=1;
	for(i=1;c[i];++i)for(j=0;j<7;++j){
		if(c[i]!='0')add(f[i][ch[1][j]],f[i-1][j]);
		if(c[i]!='1')add(f[i][ch[0][j]],f[i-1][j]);
	}
	printf("%d\n",(f[i-1][1]+f[i-1][2])%mo);
	return 0;
}

Measured memory_bytes: 8704
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,s,f) for(i=s;i<f;i++)
#define hi cout<<'h'<<'i'<<'\n' 
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define B begin()
#define E end()
#define vi vector<int>
#define vii vector<pair<int,int>>
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mod 1000000007
#define mod2 998244353
#define space 305
//<<fixed << setprecision(9)
vii G[space];
int ans[space][space];
pii best[space];
int main()
{
	int n,i,j,t;
	boost;
	int m,fuel,w;
	cin>>n>>m>>fuel;
	rep(i,0,m)
	{
		cin>>j>>t>>w;
		if(w>fuel)continue;
		G[t].pb({j,w});
		G[j].pb({t,w});
	}
	rep(i,1,n+1)
	{
		priority_queue<pair<pii,int>> pq;
		pq.push({{0,fuel},i});
		best[i]={0,fuel};
		rep(j,1,n+1)if(i!=j)best[j]={2e9,0};
		while(!pq.empty())
		{
			pair<pii,int> p=pq.top();
			p.F.F=-p.F.F;
			pq.pop();
			if(p.F!=best[p.S])continue;
			for(auto z:G[p.S])
			{
				int temp=p.F.S;
				t=p.F.F;
				temp-=z.S;
				if(temp<0)
				{
					t++;
					temp=fuel-z.S;
				}
				if(best[z.F].F>t || ((best[z.F].F==t) && best[z.F].S<temp))
				{
					best[z.F]={t,temp};
					pq.push({{-t,temp},z.F});
				}		
			}
		}
		rep(j,1,n+1)
		{
			if(best[j].F==2e9)ans[i][j]=-1;
			else ans[i][j]=best[j].F;
		}
	}
	cin>>t;
	while(t--)
	{
		cin>>i>>j;
		cout<<ans[i][j]<<"\n";
	}
	return 0;
}



Measured memory_bytes: 2048
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>

using namespace std;

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

int main(){
	int a, b; cin >> a >> b;
	if(a+b < 10){
		cout << a + b << endl;
		return 0;
	}

	cout << "error" << endl;

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cctype>
#include<cstring>
#include<algorithm>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define reg register
typedef long long ll;
const ll p=998244353ll;
const int maxn=3e5+5;
ll fac[maxn],inv[maxn];
ll n,a,b,k,ans;
inline ll C(int n,int m){if(n<m)return 0;return fac[n]*inv[m]%p*inv[n-m]%p;}
int main(){
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	fac[0]=fac[1]=1;for(reg int i=2;i<maxn;i++)fac[i]=fac[i-1]*i%p;
	inv[0]=inv[1]=1;for(reg int i=2;i<maxn;i++)inv[i]=1ll*(p-p/i)*inv[p%i]%p;
	for(reg int i=1;i<maxn;i++)inv[i]=inv[i-1]*inv[i]%p;
	for(reg int i=0;i<=n;i++){
		reg ll rem=k-1ll*a*i;
		if(rem<0)continue;if(rem%b)continue;
		rem/=b;if(rem>n)continue;
		ans=(ans+C(n,i)*C(n,rem)%p)%p;
	}
	printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 4864