akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;

int main(){
    int A,B,C;
    cin >> A >> B >> C;

    if(A==B && B!=C){
        cout << "Yes" << endl; 
        return 0;
    } 
    if(B==C && C!=A){
        cout << "Yes" << endl; 
        return 0;
    }
    if(C==A && A!=B){
        cout << "Yes" << endl; 
        return 0;
    }

    cout << "No" << endl;

}

Measured memory_bytes: 256
#include <stdio.h>

/*
??§?°???¢???

2????????´??° a, b ?????????????????§???a ??¨ b ?????§?°???¢??????????????????????????°?????????????????????????????????

Input
??\??????????????§???????????????2????????´??° a, b ???????§?????????????????????????

Output
a ?????? b ???????????§???????????°
*/

int main( void )
{
    int a, b;

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

	if ( a < b ) {
		printf( "a < b\n" );
	}
	else if ( a > b ) {
		printf( "a > b\n" );
	}
	else {
		printf( "a == b\n" );
	}


    return 0;
}

Measured memory_bytes: 580
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	int kaeruDx[] = { 2, 2, 2, -2, -2, -2, 0, 1, -1, 0, 1, -1 };
	int kaeruDy[] = { 0, 1, -1, 0, 1, -1, 2, 2, 2, -2, -2, -2 };

	void run() {
		for (;;) {
			int w = sc.nextInt();
			int h = sc.nextInt();
			if ((w | h) == 0) {
				return;
			}
			int n = sc.nextInt();
			Pos[] sprin = new Pos[n];
			for (int i = 0; i < n; i++) {
				sprin[i] = new Pos(sc.nextInt(), sc.nextInt());
			}
			LinkedList<Pos> que = new LinkedList<Pos>();
			que.add(new Pos(w, h));
			int sIndex = 0;
			boolean goal = false;
			while (!que.isEmpty()) {
				int size = que.size();
				for (int i = 0; i < size; i++) {
					Pos now = que.poll();
					for (int j = 0; j < 12; j++) {
						int nextW = now.x + kaeruDx[j];
						int nextH = now.y + kaeruDy[j];
						if (inner(nextW, nextH)) {
							Pos sp = sprin[sIndex % n];
							for (int dx = -1; dx <= 1; dx++) {
								for (int dy = -1; dy <= 1; dy++) {
									if (nextW == sp.x + dx && nextH == sp.y + dy) {
										que.add(new Pos(nextW, nextH));
									}
								}
							}
						}
					}
				}
				if (sIndex == n) {
					goal = true;
					break;
				}
				sIndex++;
			}
			System.out.println(goal ? "OK" : "NA");
		}
	}

	class Pos {
		int x;
		int y;

		public Pos(int x, int y) {
			super();
			this.x = x;
			this.y = y;
		}
	}

	boolean inner(int x, int y) {
		return 0 <= x && x < 10 && 0 <= y && y < 10;
	}

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

Measured memory_bytes: 20320
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



// dp[i][j][k]: i番目までを焼き終わり、直前ではk回ひっくり返したようなときの裏返し回数の最小値
int n, p[5050], dp[5050][4];

signed main() {
	cin >> n;
	rep(i,n) cin >> p[i];
	n++;
	rep(i,5050) rep(j,4) dp[i][j] = 1<<30;
	dp[0][0] = 0;
	rep(i,n) rep(j,4) {
		int mn = max(0, (i==0 ? 0 : p[i-1]-j));
		reps(k,mn,4) chmin(dp[i+1][k], dp[i][j] + k*(i==0 || i==n-1 ? 1 : 2));
	}
	cout << *min_element(dp[n],dp[n]+4) << endl;
}


Measured memory_bytes: 3264
#include <cstdio>
#include <utility>
#include <unordered_map>
using namespace std;

#define gcu getchar_unlocked
#define ii inline int in
ii(int c) {
	int n = 0;
	bool minus = false; if (c == '-') minus = true, c = gcu();
	do {n = 10 * n + (c - '0'), c = gcu();} while (c >= '0');
	//return n; }
	return minus ? -n : n; }
ii() {return in(gcu());}
inline bool scan(int &n) {int c=gcu();return c==EOF?false:(n=in(c),true);}
void scan(string &s) {int c;do{c=gcu();s+=c;}while(!(c=='\n'||c==' '));}
#undef ii
#define pcu putchar_unlocked
template <typename T>
void out(T n) {
	static char buf[20];
	char *p = buf;
	if(n < 0) pcu('-'), n *= -1;
	if (!n) *p++ = '0';
	else while (n) *p++ = n % 10 + '0', n /= 10;
	while (p != buf) pcu(*--p); }
void out(const char *s){while(*s)pcu(*s++);}
void out(char c){pcu(c);}
void out(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail>
void out(head&& h, tail&&... t){out(h);out(move(t)...);}
#undef svo

void skip() {
	int c;
	while (isspace(c = gcu()))
		;
	ungetc(c, stdin);
}

int main() {
	int n;
	while ((n = in())) {
		unordered_map<char, char> m = {};
		while (n--) {
			char c = gcu(); gcu();
			char d = gcu();
			skip();
			m[c] = d;
		}
		int l = in();
		while (l--) {
			char c = gcu();
			skip();
			out(m.count(c) ? m[c] : c);
		}
		out("\n");
	}
}


Measured memory_bytes: 2644
#include <bits/stdc++.h>
#define PI acos(-1)
#define eq(x,y) (fabs((x)-(y)) < eps)
#define debug(x) cerr<<x<<endl;
#define endl "\n"
#define pb push_back
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9+7;
const int nmax=1e5+10;
const int eps=1e-8;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout.precision(10);
    //cout<<fixed;
    //cout.tie(NULL);
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
        cin>>v[i];
    int c=0,maxx=-inf;

    for(int i=0;i<n-1;i++)
    {
        if(v[i]>=v[i+1])
            c++;
        else
            c=0;
        maxx=max(c,maxx);
    }

    maxx=max(c,maxx);
    cout<<maxx<<endl;



    return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<queue>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int> >;
using pii = pair<int, int>;
using ppi = pair<pii, int>;

int solve(int t){
  if(t == 0) return 0;
  int p = t;
  int cnt = 0;
  while(p){
    if(p % 2)cnt++;
    p /= 2;
  }
  return 1 + solve(t % cnt);
}

int main(){
  int n; cin >> n;
  string s;
  cin >> s;
  vector<int> x(n);
  int cnt = 0;
  int sm, bi;
  for(int i = 0; i < n; i++){
    x[n-i-1] = (int)s[i] - 48;
    if(x[n-i-1]) cnt++;
  }
  sm = cnt-1;
  bi = cnt+1;

  vi ans(n, 0);

  if(sm){
    vvi mod(n, vi(2, 0));
    vvi acc(n, vi(2, 0));
    mod[0][0] = 1%sm;
    mod[0][1] = 1%bi;
    acc[0][0] = (x[0]) ? mod[0][0] : 0;
    acc[0][1] = (x[0]) ? mod[0][1] : 0;
    for(int i = 1; i < n; i++){
      mod[i][0] = mod[i-1][0] * 2 % sm, mod[i][1] = mod[i-1][1] * 2 % bi;
      if(x[i]) acc[i][0] = (acc[i-1][0] + mod[i][0]) % sm, acc[i][1] = (acc[i-1][1] + mod[i][1]) % bi;
      else acc[i][0] = acc[i-1][0], acc[i][1] = acc[i-1][1];
    }
    int t;
    for(int i = 0; i < n; i++){
      if(x[i]) t = (sm + acc[n-1][0] - mod[i][0]) % sm;
      else t = (acc[n-1][1] + mod[i][1]) % bi;
      ans[i] = 1 + solve(t);
    }
  }
  else{
    vvi mod(n, vi(2, 0));
    vvi acc(n, vi(2, 0));
    mod[0][1] = 1%bi;
    acc[0][1] = (x[0]) ? mod[0][1] : 0;
    for(int i = 1; i < n; i++){
      mod[i][1] = mod[i-1][1] * 2 % bi;
      if(x[i]) acc[i][1] = (acc[i-1][1] + mod[i][1]) % bi;
      else acc[i][1] = acc[i-1][1];
    }
    int t;
    for(int i = 0; i < n; i++){
      if(x[i]) t = 0;
      else t = (acc[n-1][1] + mod[i][1]) % bi;
      if(x[i]) ans[i] = 0;
      else ans[i] = 1 + solve(t);
    }
  }

  for(int i = 0 ;i < n; i++){
    cout << ans[n-1-i] << endl;
  }

}


Measured memory_bytes: 26884
#include <iostream>
using namespace std;
int main()
{
	int a,b;
	cin >>a >> b;
	if (a == b) {
		cout << a * 2 << endl;
	}
	else if (a > b) {
		cout << a * 2 - 1 << endl;
	}
	else {
		cout << b * 2 - 1 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
n = int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))

sum = 0
ans = 0

for i in range(n):
    for k in range(0,i+1):
        sum += a1[k]
    for k in range(i,n):
        sum += a2[k]
    ans=max(ans,sum)
    sum = 0

print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
#define REP(i, n) for(ll i=0; i<(ll)(n); i++)
#define REPD(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=a; (ll)(b)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
vector<ll> fac, finv, inv;


int main(){
    ll n;   cin >> n;
    string res="";
    while(n!=0){
        int r = n%2;
        if(r<0) r += 2;
        n = (n-r)/(-2);
        res += '0'+r;
    }
    reverse(ALL(res));
    if(res=="") res="0";
    cout << res << endl;
}


Measured memory_bytes: 256
using System;

    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var divisor = new int[N + 1];
            for(var i = 2;i<=N;i++)
            {
                var x = i;
                for(var j = 2;j<=N;j++)
                {
                    var k = 0;
                    if(x%j==0)
                    {
                        for (k = 0; x % j == 0; x /= j) k++;
                    }
                    divisor[j] += k;
                }
            }
            long count = 1;
            for(var i =2;i<=N;i++)
            {
                count *= divisor[i] + 1;
                count %= 1000000007;
            }
            Console.WriteLine(count);
        }
    }

Measured memory_bytes: 11220
import Control.Monad (replicateM)

main :: IO ()
main = do
  [n,m] <- map (read :: String -> Int) . words <$> getLine
  lrs <- map (map (read :: String -> Int) . words) <$> getNLine_ m
  print $ ans lrs

ans :: [[Int]] -> Int
ans lrs = (\[a,b] -> if a > b then 0 else b-a+1) $ foldl1 func lrs where
  func [l1,r1] [l2,r2] = [max l1 l2, min r1 r2]

getNLine_ :: Int -> IO [String]
getNLine_ n = replicateM n getLine

Measured memory_bytes: 100732
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
    int h,w;
    while(1){
    cin >> h >> w;
    if(h==0&&w==0) break;
    for (int j=0; j<h; j++) {
        for (int i=0; i<w; i++) {
            cout << "#";
        }
        cout << endl;
    }
    cout << endl;
    }
}



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

using namespace std;

template<typename T>
class Dijkstra {
 public:
  int n;
  T INF = numeric_limits<T>::max();
  vector< vector< pair<int,T> > > g;
  vector<T> dis;
  vector<int> prev;
  
  Dijkstra(int _n) : n(_n) {
    g.resize(n);
  }

  void add_edge(int u, int v, T w) {
    assert(0 <= u && u < n && 0 <= v && v < n);
    assert(w >= 0);
    g[u].emplace_back(v, w);
  }

  vector<T> short_path(int s) {
    dis = vector<T>(n, INF);
    prev = vector<int>(n, -1);

    set< tuple<T,int,int> > bag; // cost, vertex, prev
    bag.insert(make_tuple(0, s, -1));
    while (bag.size()) {
      int u, v, p;
      T w, cost;
      tie(cost, u, p) = *bag.begin();
      bag.erase(bag.begin());
      if (dis[u] > cost) {
        dis[u] = cost;
        prev[u] = p;
        for (auto i : g[u]) {
          tie(v, w) = i;
          bag.insert(make_tuple(w + cost, v, u));
        }
      }
    }
    return dis;
  }
};

int main() {
  ios_base::sync_with_stdio(false);

  int n;
  cin >> n;
  vector<string> a(n);
  vector<int> w(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> w[i];
  }

  map<pair<string,string>, int> mp;
  mp[make_pair("","")] = 0;
  for (auto s : a) {
    int L = s.length();
    for (int i = 0; i < L; i++) {
      auto p = make_pair(s.substr(i, L - i), "");
      auto q = make_pair("", s.substr(0, L - i));
      if (mp.count(p) == 0) {
        int sz = mp.size();
        mp[p] = sz;
      }
      if (mp.count(q) == 0) {
        int sz = mp.size();
        mp[q] = sz;
      }
    }
  }

  auto next = [&](pair<string,string> state, pair<string,string> edge) {
    string s, t;
    s = state.first + edge.first;
    t = edge.second + state.second;
    int match = min(s.length(), t.length());
    for (int i = 0; i < match; i++) {
      if (s[i] != t[t.length() - 1 - i]) return -1;
    }
    s = s.substr(match, s.length() - match);
    t = t.substr(0, t.length() - match);
    int ok = mp.count(make_pair(s, t));
    if (ok == 0) return -1;
    return mp[make_pair(s, t)];
  };

  int node = mp.size() + 2;
  Dijkstra<long long> g(node);
  
  for (auto state : mp) {
    for (int i = 0; i < n; i++) {
      int to;
      if (state.first.first == "") {
        to = next(state.first, make_pair(a[i], ""));
      } else {
        to = next(state.first, make_pair("", a[i]));
      }

      if (to >= 0) {
        g.add_edge(state.second, to, w[i]); 
      }
    }
  }
  
  for (int i = 0; i < n; i++) {
    g.add_edge(node - 2, mp[make_pair(a[i], "")], w[i]);
  }

  auto is_pali = [](string s) {
    int L = s.length();
    for (int i = 0; i < L; i++) {
      if (s[i] != s[L - 1 - i]) return false;
    }
    return true;
  };

  for (auto state : mp) {
    if (is_pali(state.first.first) && is_pali(state.first.second)) {
      g.add_edge(state.second, node - 1, 0);
    }
  }

  auto dis = g.short_path(node - 2);
  long long ans = dis[node - 1];
  if (ans == g.INF) {
    ans = -1;
  }
  cout << ans << '\n';

  return 0;
}
 


Measured memory_bytes: 4024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));

ll diff = 0;
vector<long long> A(2-1+1);
vector<long long> T(2-1+1);
vector<long long> B(2-1+1);

bool C1(long long c) {
	ll now = 0;
	ll n1 = diff*c, n2 = 0;
	n1 += A[0]*T[0];
	n2 += B[0]*T[0];
	now = n1-n2;
	n1 += A[1]*T[1];
	n2 += B[1]*T[1];
	if (now <= 0 && (n1-n2) >= 0) {
		return true;
	}
	if (now >= 0 && (n1-n2) <= 0) {
		return true;
	}
	return false;
}

int main(){	
	for(int i = 0 ; i <= 2-1 ; i++){
		scanf("%lld",&T[i]);
	}
	for(int i = 0 ; i <= 2-1 ; i++){
		scanf("%lld",&A[i]);
	}
	for(int i = 0 ; i <= 2-1 ; i++){
		scanf("%lld",&B[i]);
	}
	

	ll n1 = 0, n2 = 0;
	n1 += A[0]*T[0];
	n2 += B[0]*T[0];
	diff = n1-n2;
	n1 += A[1]*T[1];
	n2 += B[1]*T[1];
	if (diff < 0 && (n1-n2) < 0) {
		cout << "0" << endl;
		return 0;
	}
	if (diff > 0 && (n1-n2) > 0) {
		cout << "0" << endl;
		return 0;
	}
	if ((n1-n2) == 0) {
		cout << "infinity" << endl;
		return 0;
	}
	diff = n1-n2;

	long long lb = -1, ub = 922337203685477580;
	while (ub - lb > 1) {
		long long mid = (lb + ub) / 2;
		if (C1(mid)) lb = mid;
		else ub = mid;
	}


	n1 = diff*lb; n2 = 0;
	n1 += A[0]*T[0];
	n2 += B[0]*T[0];

	if (n1-n2 == 0) cout << 2*lb << endl; else cout << 2*lb+1 << endl;

	return 0;
}



Measured memory_bytes: 256
use proconio::*;

fn transpose(a: &mut [Vec<usize>]) {
    let n = a.len();
    for i in 1..n {
        for j in 0..i {
            let x = a[i][j];
            a[i][j] = a[j][i];
            a[j][i] = x;
        }
    }
}

fn fill(s: &[usize], u: &[usize], tmp: &mut [Vec<usize>]) -> Vec<(usize, usize)> {
    let mut res = vec![];
    for (i, (tmp, (&s, &u))) in tmp.iter_mut().zip(s.iter().zip(u.iter())).enumerate() {
        if u ^ s == 0 {
            res.push((i, u));
        } else {
            for t in tmp.iter_mut() {
                if *t != 2 && *t != u {
                    println!("-1");
                    std::process::exit(0);
                }
                *t = u;
            }
        }
    }
    res
}

#[fastout]
fn run() {
    input! {
        n: usize,
        s: [usize; n],
        t: [usize; n],
        u: [usize; n],
        v: [usize; n],
    }
    let mut ans = vec![vec![0; n]; n];
    for k in 0..64 {
        let u: Vec<_> = u.iter().map(|u| *u >> k & 1).collect();
        let v: Vec<_> = v.iter().map(|v| *v >> k & 1).collect();
        let mut tmp = vec![vec![2; n]; n];
        let mut least = vec![];
        for (s, u) in [(&s, &u), (&t, &v)].iter() {
            least.push(fill(s, u, &mut tmp));
            transpose(&mut tmp);
        }
        if least.iter().any(|l| l.len() == 0) {
        } else if least.iter().any(|l| l.len() == 1) {
            let cond = least[0].len() > least[1].len();
            if cond {
                least.swap(0, 1);
                transpose(&mut tmp);
            }
            let (r, x) = least[0][0];
            for &(c, b) in least[1].iter() {
                tmp[r][c] = b;
            }
            if tmp[r].iter().any(|p| *p == x) {
            } else if let Some(&(c, _)) = least[1].iter().find(|&&(c, b)| (0..n).any(|x| x != r && tmp[x][c] == b)) {
                tmp[r][c] = x;
            } else {
                println!("-1");
                return;
            }
            if cond {
                transpose(&mut tmp);
            }
        } else {
            for (i, &(r, _)) in least[0].iter().enumerate() {
                for (j, &(c, _)) in least[1].iter().enumerate() {
                    tmp[r][c] = (i ^ j) & 1;
                }
            }
        }
        for (a, t) in ans.iter_mut().zip(tmp.iter()) {
            for (a, t) in a.iter_mut().zip(t.iter()) {
                *a |= *t << k;
            }
        }
    }
    for (s, u) in [(s, u), (t, v)].iter() {
        for (ans, (&s, &u)) in ans.iter().zip(s.iter().zip(u.iter())) {
            if ans.iter().fold([std::usize::MAX, 0], |s, a| [s[0] & *a, s[1] | *a])[s] != u {
                println!("-1");
                return;
            }
        }
        transpose(&mut ans);
    }
    for a in ans {
        for a in a {
            print!("{} ", a);
        }
        println!();
    }
}

fn main() {
    run();
}


Measured memory_bytes: 9488
import java.util.*;
public class Main{
	public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num = 1;
    int ans = 1;
    while(true){
        if(n<num){
        	break;
        }else{
            ans = num;
        	num*=2;
        }
    }
    System.out.println(ans);
    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
long long f[200005];
long long D=1e9+7;
long long n;

long long pow2(long long x,int y){
    if(y==0)return 1;
    long long k=pow2(x,y/2);
    return k*k%D*(y%2==1 ? x:1)%D;
}

long long C(long long x,long long y){
    return f[x]*pow2(f[y],D-2)%D*pow2(f[x-y],D-2)%D;
}
long long H(long long x,long long y){
    return C(x+y-1,y);
}
int main()
{
    long long k;
    cin>>n>>k;
    f[0]=1;
    int i,j;
    for(i=1 ; i<=n ; i++)f[i]=f[i-1]*i%D;
    k=min(n,k);

    long long ans=0;
    for(i=0 ; i<=k ; i++)ans=(ans+C(n,i)*H(n-i,i)%D)%D;
    cout<<ans;
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <unordered_set>

using namespace std;

int main() {
  int N, L;
  cin >> N >> L;
  vector<string> S(N);
  for (int i = 0; i < N; i++) { cin >> S[i]; }
  sort(S.begin(), S.end());

  for (string s : S)  { cout << s;}
  cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 1000000007 // //100000000 998244353 //
#define inf 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

ll lx[4] = {0, 0, 1, -1};
ll ly[4] = {1, -1, 0, 0};
ll dx[8] = {0, 0, 1, -1, 1, -1, 1, -1};
ll dy[8] = {1, -1, 0, 0, 1, 1, -1, -1};
void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}
ll lcm(ll a, ll b) {return (a*b)/__gcd(a, b); }



void solve()
{
    ll l, r; cin >> l >> r;
    if(r-l >= 2019) ANS(0);
    ll mn = inf;
    for(ll i = l; i <= r; i++){
        for(ll j = i+1; j <= r; j++){
            mn = min(mn, (i*j)%2019);
        }
    }
    cout << mn;
}

int main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  
  int five_hun,one_hun,fifty,goal;
  int count = 0;
  int i,j,k;
  
  scanf("%d",&five_hun);
  scanf("%d",&one_hun);
  scanf("%d",&fifty);
  scanf("%d",&goal);
  
  for(i=0; i<=five_hun; i++){
  	for(j=0; j<=one_hun; j++){
  	   for(k=0; k<=fifty; k++){
  		if(500*i+100*j+50*k == goal)
  			count++;
  		}
  	}
  }
  
  printf("%d", count);
  
  return 0;
}

Measured memory_bytes: 128
import java.util.*;

class Main {
	Scanner sc = new Scanner(System.in);

	public void run() {
		while (sc.hasNext()) {
			int d = sc.nextInt();
			int sum=0;
			for (int x = 0; x < 600; x += d) {
				sum+=x*x*d;
			}
			ln(sum);
		}
	}

	public static String join(double[] array, String separator) {
		StringBuilder str = new StringBuilder(array[0] + "");
		for (int i = 1; i < array.length; i++) {
			str.append(separator).append(array[i] + "");
		}
		return str.toString();
	}

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

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

	public static void ln(Object o) {
		System.out.println(o);
	}

	public static void ln() {
		System.out.println();
	}
}

Measured memory_bytes: 11000
main :: IO ()
main = do
  [n, k] <- map read . words <$> getLine :: IO [Int]
  ds <- getLine :: IO String
  let
    s = length . filter id . (zipWith (==) <$> id <*> tail) $ ds :: Int
  print $ (s + 2 * k) `min` (n - 1)


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

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;


int main(){
  int n;
  string s;
  int ans = 0;
  cin >> n >> s;
  rep(i,n){
    if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C')ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
N = int(input())
dp = [0] * 10 ** 6
for i in range(1, N + 1):
    power = 6
    dp[i] = i
    while power <= i:
        dp[i] = min(dp[i], dp[i - power] + 1)
        power *= 6
    power = 9
    while power <= i:
        dp[i] = min(dp[i], dp[i - power] + 1)
        power *= 9
print(dp[N])

Measured memory_bytes: 16728
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fi first
#define se second
#define fastio ios_base::sync_with_stdio(false); cin.tie(0)
#define loop(i, a, b) for(lli i=a; i<b; i++)
#define loopb(i, a, b) for(lli i=a; i>=b; i--)
#define pb push_back
typedef long long int lli;
typedef pair<lli, lli> pii;
typedef vector<lli> vll;
// use to avoid collision
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
// for pair in unordered_map
struct hash_pair {
    template <class T1, class T2>
    size_t operator()(const pair<T1, T2>& p) const
    {
        auto hash1 = hash<T1>{}(p.first);
        auto hash2 = hash<T2>{}(p.second);
        return hash1 ^ hash2;
    }
};
lli power(lli x, lli y){
    lli res = 1;
    x = x ;
    while (y > 0) {
        if (y & 1)
            res = (res*x) ;
        y = y>>1;
        x = (x*x);
    }
    return res;
}
lli solve(){
	lli n, k;
	cin>>n>>k;
	vll psum(n+1, 0);
	lli a;
	loop(i, 0, n){
		cin>>a;
		a = a%k;
		psum[i+1] = ((psum[i] + a)%k + k)%k;
	}
	loop(i, 0, n+1)
		psum[i] = ((psum[i]-i)%k+k)%k;
	unordered_map<lli, lli, custom_hash> mp;
	lli res = 0;
	loop(i, 0, n+1){
		if(i < k){
			res += mp[psum[i]];
			mp[psum[i]]++;	
		}
		else{
			mp[psum[i-k]]--;
			res += mp[psum[i]];
			mp[psum[i]]++;
		}
	}
	cout<<res<<"\n";
}
int main(){
	fastio;
	lli t;
//	cin>>t;
	t = 1;
	while(t>0){
		t--;
		solve();
	}
}

Measured memory_bytes: 13256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define sz(v) (int)(v).size()

using namespace std;

typedef long long ll;
typedef long double ld;

using P = pair<int, int>;
template<typename T>
struct Edge {
    int u, v;
    T cost;
    Edge(int u, int v, T c) : u(u), v(v), cost(c) {}
    bool operator< (const Edge &e) const {return cost < e.cost;}
};

static const long long MOD = 1000000007;
static const long long LINF = (ll)(1e18+99);
static const int INF = 1e9+99;

ll ans;

int main(void) {
  int n;
  cin >> n;
  vector<int> v(n, 0);
  rep(i, 0, n) cin >> v[i];

  sort(all(v));

  rep(i, 0, n) {
    rep(j, i+1 , n) if (v[i]!=v[j]){
      rep(k, j+1, n) if (v[i]!=v[k]&&v[j]!=v[k]){

        if (v[i]+v[j]>v[k]) {
          ans++;
        }
        
      }
      
    }
  }
  
    
  cout << ans << endl;
  return 0;
}





Measured memory_bytes: 3628
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
class position{
public:
    int x;
    int y;
    position(int a,int b):x(a),y(b){}
    position(){}
};

position operator+(const position a,const position b){
    position res;
    res.x = a.x+b.x;
    res.y = a.y+b.y;
    return res;
}

position operator-(const position a,const position b){
    position d;
    d.x = -b.x;
    d.y = -b.y;
    return a+d;
}

bool operator<(const position a,const position b){
    return a.x<b.x||(a.x==b.x&&a.y<b.y);
}

bool operator>(const position a,const position b){
    return a.x>b.x||(a.x==b.x&&a.y>b.y);
}

bool operator==(const position a,const position b){
    return a.x==b.x&&a.y==b.y;
}
int main(){
    int m;
    while(cin>>m&&m){
        vector<position> line(m);
        for(int i=0;i<m;++i){
            cin>>line[i].x>>line[i].y;
        }
        
        int n;
        cin>>n;
        set<position> data;
        for(int i=0;i<n;++i){
            position d;
            cin>>d.x>>d.y;
            data.insert(d);
        }
        position ans;
        bool flag = true;
        for(int i=0;i<m;++i){
            for(set<position>::iterator fp = data.begin();fp!=data.end();++fp){
                flag = true;
                position distance = *fp-line[i];
                for(int j=0;j<m;++j){
                    set<position>::iterator itr = data.find(distance+line[j]);
                    if(itr==data.end()){
                        flag=false;
                        break;
                    }
                }
                if(flag==true){
                    ans = distance;
                    break;
                }
                
            }
            if(flag==true){
                break;
            }
        }
        cout<<ans.x<<" "<<ans.y<<endl;
    }
    return 0;
}


Measured memory_bytes: 3124
// Problem : A - ABC Swap
// Contest : AtCoder Beginner Contest 161
// URL : https://atcoder.jp/contests/abc161/tasks/abc161_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cp-editor)

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#define fio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ull unsigned long long
#define ll long long
#define inf INT_MAX
#define mninf INT_MIN
#define infl 1e18+5
#define mninfl -1e18-5
#define Mod 1000000007
#define newmod  998244353
int ah=911382323;
int bh=972663749;
#define endl "\n"
#define cp(x) cout<<(x)<<" "
#define cl(x) cout<<(x)<<endl
#define ct(x,y) cout<<(x)<<" "<<(y)<<endl;
#define nl   cout<<endl
//const long double pi=acos(-1);
//looping
#define int long long
#define For(i,a,b) for(int i=a;i<b;i++)
#define test(t)  int (t); cin>>(t); while((t)--)
#define array(a,n) int (n); cin>>(n); int a[n]; for(int i=0;i<(n);i++) cin>>a[i];
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define pa(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' ';  cout<<endl
#define pv(v)  for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";  cout<<endl
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}
template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "{";
    typename vector< T > :: const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "}";
}
template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
    os << "[";
    typename set< T > :: const_iterator it;
    for ( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}
template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
    os << "[";
    typename map< F , S >::const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " = " << it -> second ;
    }
    return os << "]";
}
#define deb(x) cerr << #x << " = " << x << endl;
#define deb2(x,y)  cerr << #x << " = " << x <<"   "<< #y << " = " << y << endl;
//containers
#define F first
#define S second
#define pb emplace_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mkp make_pair
#define all(v) (v).begin(),(v).end()
int dx[8]={1,-1,0,0,1,1,-1,-1};
int dy[8]={0,0,1,-1,1,-1,1,-1};
typedef vector<int> vi;
typedef vector< vector< int > > vvi;
typedef vector < pair <int, int> > vpii;
/*/----------------------------Code begins----------------------------------/*/
int32_t main(){
fio;
int a,b,c;
cin>>a>>b>>c;
cout<<c<<" "<<a<<" "<<b;


}




























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

using namespace std;

int main() {
	int A, B;
	cin >> A >> B;

	if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0) {
		cout << "Possible" << endl;
	}
	else {
		cout << "Impossible" << endl;
	}

	return 0;
}

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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    string o,e;
    cin >> o >> e;
    if(SIZE(o) == SIZE(e))rep(i,SIZE(o))cout << o[i] << e[i];
    else{
        rep(i,SIZE(o)-1)cout << o[i] << e[i];
        cout << o[SIZE(o)-1];
    } 

    cout << endl;
    //cout << e[SIZE(o)-1] << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            char[][] S = new char[3][3];
            for (int i = 0; i < 3; i++) {
                S[i] = in.next().toCharArray();
            }

            out.println(String.valueOf(S[0][0]) + String.valueOf(S[1][1]) + String.valueOf(S[2][2]));

        }

    }
}



Measured memory_bytes: 21844
#include<map>
#include<set>
#include<bitset>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<chrono>
#include<stack>
#include<fstream>
#include<list>
#include<complex>
#define REP(i,x,y) for(ll i=x;i<=y;i++)
#define SIZE(a) ll(a.size())
#define vll vector<ll> 
#define MEMSET(a, n, m) for(ll i=0;i<=n;i++) a[i] = m
#define BIT(n) (ll(1)<<n)
#define UNIQUE(v) v.erase(unique(v.begin(),v.end()),v.end()) 
#define UNIQUE_ARRAY(a,x) unique(a + 1, a + x + 1) - a - 1
#define SORT(a,n) sort(a+1,a+n+1)
#define SORT_O(a,n,order) sort(a+1,a+n+1,order)
#define PER(i,y,x) for(ll i=y;i>=x;i--)
typedef long long ll;
using namespace std;


struct point
{
	long long i; long long j;
};

ll const MOD = 1e9 + 7;
ll const MAX = 1e6 + 6;

ll mod_p(ll x, ll y) {
	return (x + y + MOD) % MOD;
}

ll mod_m(ll x, ll y) {
	return (x*y) % MOD;
}

ll dp[MAX] = {}, dp_sum[MAX] = {};

int main() {
	ll n;
	cin >> n;
	dp[1] = dp_sum[1] = n;
	dp[2] = n * n%MOD;
	dp_sum[2] = mod_p(dp[1], dp[2]);
	REP(i, 3, n) {
		ll j = n;
		ll t = n - i + 2;
		dp[i] = (mod_m(j, t) +mod_m((j - 1),(j - t - 1)) + dp_sum[i - 1] - dp[i - 2] + MOD) % MOD;
		//cout << dp[i] << endl;
		dp_sum[i] = mod_p(dp_sum[i - 1], dp[i]);
	}
	cout << dp[n] << endl;
}

Measured memory_bytes: 15872
import java.util.Scanner;

public class Main {
	void run() {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] a = new int[n + 1];
		for (int k = 2; k <= n; k++) {
			int t = k;
			while (1 < t) {
				for (int i = 2; i <= t; i++) {
					if (t % i == 0) {
						a[i]++;
						t /= i;
						break;
					}
				}
			}
		}
		long count = 1;
		long MOD = 1_000_000_000 + 7;
		for (int i = 0; i < n + 1; i++) {
			if (a[i] != 0) {
				count *= (a[i] + 1);
				count %= MOD;
			}
		}
		System.out.println(count);
	}

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


Measured memory_bytes: 9428
#include<stdio.h>

int main(){
  int a[100000],n;
  int box[100000]={};
  int cnt=0;
  int sum=0;
  int i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    if(a[i]<=100000)
      box[a[i]]++;
    else  cnt++;
  }
  sum=cnt;
  for(i=0;i<100000;i++){
    if(box[i]<i) sum+=box[i];
    else if(box[i]>i)  sum+=(box[i]-i);
  }
  printf("%d\n",sum);
}

Measured memory_bytes: 896
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {

	var N int

	fmt.Scan(&N)

	var S string

	fmt.Scan(&S)


	icnt:= -1 
	jcnt :=-1
	xcnt := -1

	cnt := 0

	for i := 0; i < 10; i++ {
		for j := 0; j < 10; j++ {
			for x := 0; x < 10; x++ {

				icnt = strings.Index(S,strconv.Itoa(i))

				if icnt <0{
					continue
				}

				jcnt  = strings.Index(S[icnt+1:], strconv.Itoa(j))

				if jcnt <0{

					continue
				}

				xcnt =  strings.Index(S[icnt+jcnt+2:],strconv.Itoa(x))

				if xcnt < 0{
					continue

				}else{
					cnt++
				}

			}
		}

		}

		fmt.Println(cnt)
	}

Measured memory_bytes: 896
left = 0 
down = 0
right , up , n =map(int,input().split())
for _ in range(n):
	x,y,a = map(int,input().split())
	if a==1:
		if x>left:
			left = x
	elif a==2:
		if right>x:
			right = x
	elif a==3:
		if y>down:
			down = y
	elif a==4:
		if up>y:
			up = y
if abs(right)>=abs(left) and abs(up)>=abs(down):
	h = abs(up)-abs(down)
	w = abs(right)-abs(left)
	print(h*w)
else:
	print(0)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm> 
#include <cmath>
//#include <bitset>
//#include <deque>
#include <iterator>
#include <map> 
//#include <queue>
//#include <stack>
#include <string>
#include <vector>
#include <array>
//#include <tuple>
//#include <unordered_map>
//#include <unordered_set>

using namespace std;

typedef long long ll;
struct __{__(){ios_base::Init i;ios_base::sync_with_stdio(0);cin.tie(0);}}__; 



int main() {
	ll n, k;
	cin >> n >> k;
	//vector<pair<int,int>> v(n);
	map<ll,ll> m;
	for (int i = 0; i < n; ++i) {
		ll x, y;
		cin >> x >> y;
		m[x] += 1LL * y;
		//cin >> v[i].first >> v[i].second; 
	}
	//sort(v.begin(),v.end());
	ll val = 0;
	for (auto it = m.begin(); it != m.end(); ++it) {
		k -= it->second;
		if (k <= 0) {
			val = it->first;
			break;
		}
	}
	cout << val;
}







Measured memory_bytes: 7536
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
#define double long double
#define EPS 1e-9
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1LL << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;
signed main() {
	cin >> N;
	cout << N * 2 * PI << endl;
	return 0;
}

Measured memory_bytes: 3788
function Main(input){
    input = input.split("\n");
    
    var n = input.length;
    for(var i = 0;i < n - 1;i++){
        input[i] = input[i].split(" ");
        var a = parseInt(input[i][0],10);var b = parseInt(input[i][1],10);
        var ans = 0;
        a += b;
        while(a > 0){
            ans++;a = Math.floor(a / 10);
        }
        console.log(ans);
    }
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));

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

#define INIT std::cin.tie(0);std::ios::sync_with_stdio(false);
#define ALL(c) (c).begin(), (c).end()
#define CALL(c) (c).cbegin(), (c).cend()
#define RALL(c) (c).rbegin(), (c).rend()
#define CRALL(c) (c).crbegin(), (c).crend()
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); i++)
#define FOR(i, s, n) for (int i = s; i < static_cast<int>(n); i++)
#define ASC(t) [](t& x, t& y){ return x < y; }
#define DESC(t) [](t& x, t& y){ return x > y; }
#define PSORT(s,p,e) partial_sort((s), next((s), (p)), (e))
#define VIEW(v,t) for_each((v).begin(), (v).end(), [](t& a) { cout << a << " "; }); cout << endl;

#define IN(a, x, b) (a<=x && x<b)
template<class T> inline T CHMAX(T& x, const T y){return x=(x<y)?y:x;}
template<class T> inline T CHMIN(T& x, const T y){return x=(x>y)?y:x;}
#define OUT(dist) std::cout<<(dist);
#define WS std::cout<<" ";
#define NL std::cout<<"\n"

using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using LL = long long;
using ULL = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using V2 = vector<vector<T>>;
template<class T, int W=255> using A = array<T, W>;
template<class T, int W=255, int H=255> using A2 = array<array<T, W>, W>;

inline int lc(int x, int y) {
    return (x)*3+(y);
}

V<int> m;

int main(){
    INIT;
    REP(i,9) {
        int x; cin >> x;
        m.push_back(x);
    }
    bool yes = true;
    FOR(i,1,3) {
        int d = m[lc(i,0)] - m[lc(i-1,0)];
        FOR(j,1,3) {
            if((m[lc(i-1,j)]+d) != m[lc(i,j)]) yes =false;
        }
    }
    if(yes) cout << "Yes" << "\n";
    else cout << "No" << "\n";
}

Measured memory_bytes: 256
//Code is like humor. When you have to explain it, it’s bad.
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#include <bits/stdc++.h>
#define MOD 1000000007
#define int long long
using namespace std;
#define ss second
#define ff first
int32_t main()
{
    fastio;
    int T,n,m,i,j,k,a,b,c;
    T=1;
    while(T --> 0)
    {
        double L;
        cin>>L;
        long double ans=pow(L/3,3);
        cout<<setprecision(12);
        cout<<fixed;
        cout<<ans;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ls(x) (x)<<1
#define rs(x) (x)<<1|1 
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define mm make_pair
#define pi 2*acos(0.0)
#define lcm(a,b) (a*b)/__gcd(a,b)
#define Case(i,ans) cout<<"Case "<<i<<": "<<ans<<endl;
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout.precision(i);cout<<fixed<<ans<<endl;
#define pb(x) push_back(x)
#define lowbit(x) (x)&(-x)
#define out(x) {cout<<x<<endl;return 0;} 
#define all(v) v.begin(),v.end() 
#define eps 1e-8 
#define ull unsigned long long
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
ll gcd(ll x,ll y){if(y==0) return x;else return gcd(y,x%y);} 
ll ksm(ll a,ll b){ll r=1;while(b){if(b&1) r=(r*a)%mod;a=a*a%mod;b>>=1;}return r;} 
const int maxn=1e5+100;
ll n;
int main()
{
	cin>>n;
	ll sum=0;
	FOR(i,1,n)
	{
		ll x;cin>>x;
		sum^=x;
	}
	if(!sum) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

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

#define ll long long



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

	int t;
	string s;
	cin >> t >> s;
	for (int i = 0; i < s.size(); ++i){
		if (i < t) cout << s[i];
		else {cout << "..."; break;}
	}
	return 0;
}



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

int main() {
  int A,B,C,K;
  cin>>A>>B>>C>>K;
  if (K<=A)
    cout << K << endl;
  else if (A<K && K<=A+B)
    cout << A << endl;
  else if (A+B<K)
    cout << 2*A+B-K << endl;
    
}


Measured memory_bytes: 3556
#include <stdio.h>

int main(){
    double a,b,c,d,e,f;
    double x,y;
    
    while (scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f) != EOF) {
        x=(double)((c*e-b*f)/(a*e-b*d));
        y=(double)((c*d-a*f)/(b*d-a*e));
        if(a*e-b*d==0||b*d-a*e==0){
            return 1;
        }
        if(x==-0){
            x=0;
        }
        if(y==-0){
            y=0;
        }
        printf("%.3f %.3f\n",x,y);
    }
    
    return 0;
}

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

int main(){
    long N;
    cin >> N;
    vector<long> A(N);
    long m(numeric_limits<long>::min()), maxdex(-1), c(0);
    for(auto& i : A){
        cin >> i;
        if(m < i){
            m = i;
            maxdex = c;
        }
        ++c;
    }
    swap(A[N - 1], A[maxdex]);
    nth_element(A.begin(), A.begin(), A.end() - 1, [&m](auto a, auto b){return a * (a - m) < b * (b - m);});
    cout << A[N - 1] << " " << A[0] << endl;
}

Measured memory_bytes: 1024