akhauriyash/Code-Regression huggingface dataset:
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var K = one[1];
  var list = nextIntArray();
  list.sort(function(a,b){
    return b - a;
  });
  var output = 0;
  for(var i = K; i < N; i++){
    output += list[i];
  }
  myout(output);

}


Measured memory_bytes: 53488
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;


int main(void){
  int n,m,i,j,k,a,b;
  vector<int> g[200005];
  
  cin >> n >> m;
  for (i=0;i<m;i++){
    cin >> a >> b;
    g[a-1].push_back(b-1);
    g[b-1].push_back(a-1);
  }
  
  int p,qs,u[200005]={};
  queue<int> q;
  q.push(0);
  for (i=1;i<=2;i++){
    qs=q.size();
    for (j=0;j<qs;j++){
      p=q.front();
      q.pop();
      for (k=0;k<g[p].size();k++){
        if (u[g[p][k]]==0){
          u[g[p][k]]=i;
          q.push(g[p][k]);
        }
      }
    }
  }
  
  if (u[n-1]==2) cout << "POSSIBLE" << endl;
  else cout << "IMPOSSIBLE" << endl;
  
  return 0;
}

Measured memory_bytes: 13168
import java.io.*;
import java.util.*;
public class Main{
	final public static long MOD = 998244353;
	public static int a, b, c, d;
	public static long powa[], powb[];
	public static long memo[][];
	public static void main(String[] args) throws IOException{
		PrintWriter out = new PrintWriter(System.out);
		FastIO sc = new FastIO(System.in);
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		d = sc.nextInt();
		memo = new long[c+1][d+1];
		powa = new long[d+1];
		powb = new long[c+1];
		powa[0] = 1;
		powb[0] = 1;
		for(int i=1; i<=d; ++i) {
			powa[i] = (powa[i-1]*a)%MOD;
		}
		for(int i=1; i<=c; ++i) {
			powb[i] = (powb[i-1]*b)%MOD;
		}
		out.println(go(c, d));
		out.close();
	}
	public static long go(int x, int y) {
		if(memo[x][y]!=0) return memo[x][y];
		if(x==a&&y==b) {
			return memo[x][y]=1;
		}
		if(x==a) {
			return memo[x][y] = (powa[y-b])%MOD;
		}
		if(y==b) {
			return memo[x][y] = (powb[x-a])%MOD;
		}
		memo[x][y] = (memo[x][y] + go(x-1, y)*y)%MOD;
		memo[x][y] = (memo[x][y] + go(x, y-1)*x)%MOD;
		memo[x][y] = ((memo[x][y]-go(x-1, y-1)*(x-1)*(y-1))%MOD + MOD)%MOD;
		return memo[x][y];
	}
	static class FastIO {
		InputStream dis;
		byte[] buffer = new byte[1 << 17];
		int pointer = 0;
		public FastIO(String fileName) throws IOException {
			dis = new FileInputStream(fileName);
		}
		public FastIO(InputStream is) throws IOException {
			dis = is;
		}
		int nextInt() throws IOException {
			int ret = 0;
 
			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			boolean negative = false;
			if (b == '-') {
				negative = true;
				b = nextByte();
			}
			while (b >= '0' && b <= '9') {
				ret = 10 * ret + b - '0';
				b = nextByte();
			}
 
			return (negative) ? -ret : ret;
		}
		long nextLong() throws IOException {
			long ret = 0;
 
			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			boolean negative = false;
			if (b == '-') {
				negative = true;
				b = nextByte();
			}
			while (b >= '0' && b <= '9') {
				ret = 10 * ret + b - '0';
				b = nextByte();
			}
			return (negative) ? -ret : ret;
		}
		byte nextByte() throws IOException {
			if (pointer == buffer.length) {
				dis.read(buffer, 0, buffer.length);
				pointer = 0;
			}
			return buffer[pointer++];
		}
		String next() throws IOException {
			StringBuffer ret = new StringBuffer();
 
			byte b;
			do {
				b = nextByte();
			} while (b <= ' ');
			while (b > ' ') {
				ret.appendCodePoint(b);
				b = nextByte();
			}
 
			return ret.toString();
		}
	}
}

Measured memory_bytes: 107944
#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
    string s;
    int n,m,k,i,j,count=0,sum=0,maxi=0,mini=1e18,flag=0;
    cin>>n;
    
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        if((i+1)%2 && a[i]%2) count++;
    }
    
    cout<<count;
    
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}

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

int main() {
	int n,k,a[1000];
	cin >> n>>k;
	for(int i=0; i<n; i++) cin>>a[i];
	sort(a, a+n);
	int sum=0;
	for(int i=0; i<k; i++) sum+=a[i];
	cout<<sum;
	return 0;
}

Measured memory_bytes: 3636
import java.util.*;

public class Main {
	private static Scanner sc;
	public static void main(String[] args) {
		int[] height = new int[10];
		
		sc = new Scanner(System.in);
		for(int i = 0; i < 10; i++){
			height[i] = sc.nextInt();
		}
		Arrays.sort(height);
		
		for(int i = 9 ; i > 6; i--){
			System.out.println(height[i]);
		}
	}
}

Measured memory_bytes: 17368
#-*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B
"""
def input_array():
    n = int(input())
    S = list(map(int, input().split()))
    return S

def input_from_txt():
    import requests
    url = "https://judgedat.u-aizu.ac.jp/testcases/ALDS1_4_A/8/in"
    res = requests.get(url)
    input = res.text.split("\n")
    n = input[0]
    S = list(map(int, input[1].split()))
    q = input[2]
    T = list(map(int, input[3].split()))
    return (n, S, q, T)

# O(n^2)
def get_set(S, T):
    C = []
    for s in S:
        for t in T:
            if s == t: C.append(t)
    return C

# O(n^2) ??
def get_set2(S, T):
    return list(set(S).intersection(set(T)))

# O(log(n)) + O(n+q) = O(n)
def get_set3(S:list, T:list):
    D:dict = {}
    C = []
    for s in S:
        D[s] = 1
    for t in T:
        if t in D.keys() and D[t] == 1:
            D[t] = 2
            C.append(t)
    return C


if __name__ == '__main__':
    S = input_array()
    T = input_array()
    #(n, S, q, T) = input_from_txt()
    #print(n, S, q, T)
    ret = get_set3(S, T)
    print(len(set(ret)))



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

using namespace std;

int main(){
    int n,k;
    cin>>n>>k;
    long int arr[n],dp[n]={0};
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }

    for(int i=1;i<n;i++){
        int p=i-k;
        if(p<0)
            p=0;
        dp[i]=INT_MAX;
        for(int j=p;j<i;j++){
            dp[i]=min(dp[i],dp[j]+abs(arr[i]-arr[j]));
        }
    }
    cout<<dp[n-1]<<endl;
    return 0;
}

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

#ifdef _LOCAL
    #include <utils/debug.hpp>
    #include <utils/random_generate.hpp>
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 42
    #define generate_string(...) 42
    #define generate_array(...) 42
    #define generate_unique_array(...) 42
#endif

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vl2;
const bool multiple_queries = false;
#define rep(i, n) for(ll i = 0; i < (n) ; ++i)
#define For(i, a, b) for(ll i = (a); i < (b) ; ++i)
#define revrep(i, n) for(ll i = (n) - 1; i >= 0 ; --i)
#define revFor(i, b, a) for(ll i = (b) - 1; i >= (a) ; --i)
#define all(v) v.begin(), v.end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(i) __builtin_popcountl((i))
#define substring(s, start, end) s.substr((start), (end) - (start) + 1)

void scan(){}
template <class Head, class... Tail>
void scan(Head&& head, Tail&&... tail) {
    cin >> head;
    scan(forward<Tail>(tail)...);
}

void print(){}
void println(){cout << endl;}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    print(forward<Tail>(tail)...);
}

template <class T>
void print(vector<T>& vs){
    for (auto v: vs){
        cout << v;
        if (&v != &vs.back()) cout << " ";
    }
    cout << endl;
}

template <class Head, class... Tail>
void println(Head&& head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail) != 0) cout << " ";
    println(forward<Tail>(tail)...);
}

template <class T>
void println(vector<T>& vs){for (auto v: vs) cout << v << endl;}

void solve(){
    ll n, x, m, cur;
    scan(n, x, m);

    vector<bool> visited(m, false);
    cur = x;
    vl bs;
    while (!visited[cur]){
        visited[cur] = true;
        bs.push_back(cur);
        (cur *= cur) %= m;
    }

    ll loc = 0, ans = 0;
    while (bs[loc] != cur) ++loc;
    ll n_loop = bs.size() - loc;
    rep(i, loc) ans += bs[i];
    n -= loc;
    ll res = n / n_loop, v = 0, resres = n % n_loop;
    For(i, loc, ll(bs.size())) v += bs[i];
    For(i, loc, loc + resres) ans += bs[i];
    ans += v * res;
    println(ans);
}

void test(ll num = 0, bool verbose = false){
    rep(i, max(1LL, num)){
        ll t = clock();
        if (verbose) cout << "\n#####" << " " << i + 1 << " " << "#####" << " " << "\n## Answer ##\n";
        solve();
        if (verbose) {cout << "\nElapsed Time:" << " " << 1000.0 * (clock() - t) / CLOCKS_PER_SEC << " " << "[ms]" << endl;}
    }
}

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    #ifdef _LOCAL
        test(6, true);
    #else
        ll t = 0;
        if (multiple_queries) cin >> t;
        test(t, false);
    #endif
    return 0;
}

Measured memory_bytes: 3960
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
	vector<int> a(3);
	for(int i = 0;i<3;i++)cin >> a[i];
	sort(a.begin(),a.end());
	ll ans = 0;
	ans += a[2]-a[1];
	//for(int i =0;i<3;i++)cout<<a[i]<<endl;
	//cout<<a[2]-a[0]<<endl;
	a[1]+=ans;
	a[0]+=ans;
	ans+= (a[2]-a[0])/2;
	a[0]+=(a[2]-a[0])/2*2;
	if(a[0]!=a[2])ans+=2;
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;

typedef long long ll;

signed main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    for(auto& x : a)
        cin >> x;
    for(auto& x : b)
        cin >> x;

    vector<pair<ll,ll>> p_a;
    vector<pair<ll,ll>> p_b;
    for(ll i = 0; i < n; ++i){
        p_a.emplace_back(a[i], i);
        p_b.emplace_back(b[i], i);
    }
    sort(p_a.begin(), p_a.end());;
    sort(p_b.begin(), p_b.end());;

    vector<vector<pair<ll,ll>>> edges(n);
    for(ll i = 0; i < n - 1; ++i){
        edges[p_a[i].second].emplace_back(p_a[i + 1].second, p_a[i + 1].first - p_a[i].first);
        edges[p_a[i + 1].second].emplace_back(p_a[i].second, p_a[i + 1].first - p_a[i].first);
        edges[p_b[i].second].emplace_back(p_b[i + 1].second, p_b[i + 1].first - p_b[i].first);
        edges[p_b[i + 1].second].emplace_back(p_b[i].second, p_b[i + 1].first - p_b[i].first);
    }

    vector<ll> range(n, 1e9 + 15);
    range[0] = 0;
    priority_queue<pair<ll,ll>, vector<pair<ll,ll>>, greater<pair<ll,ll>>> que;
    que.emplace(0, 0);
    while(!que.empty()){
        ll pos = que.top().second;
        que.pop();
        for(auto& x : edges[pos]){
            if(range[x.first] > range[pos] + x.second){
                range[x.first] = range[pos] + x.second;
                que.emplace(range[x.first], x.first);
            }
        }
    }
    for(auto& x : range){
        cout << x << endl;
    }
}



Measured memory_bytes: 21056
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int solve()
{	
	int n;
	cin>>n;
	int a[n];
	forci(0,n)	cin>>a[i];
	sort(a,a+n,greater<int>());
	int sum=a[0];
	int k=2;
	int j=1;
	int add=a[1];
	for(int i=2;i<n;i++){
		if(k>0){
			sum+=add;
			k--;
		}
		else{
			j++;
			add=a[j];
			sum+=add;
			k=1;
		}
	}
	cout<<sum<<endl;	

	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}






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

#define ST_ARR_LEN(array) (sizeof(array)/sizeof(*array))
#define MOD 1000000007

using namespace std;

using ll = long long;
const ll MAX = LLONG_MAX;
const ll MIN = LLONG_MIN;

typedef stack<ll> llStack;
typedef queue<ll> llQueue;
typedef vector<ll> llVector;
typedef list<ll> llList;

typedef struct S{
  int a;
  int b;
} Object;

int par[100000];
void init(int n){
  for(int i=0;i<n;i++){
    par[i] = i;
  }
}
int root(int x){
  if(par[x] == x){
    return x;
  }else{
    return par[x] = root(par[x]);
  }
}
bool same(int x, int y){
  return root(x) == root(y);
}
void unite(int x, int y){
  x = root(x);
  y = root(y);
  if(x == y) return;
  par[x] = y;
}

int main(){
  ll N, M;
  cin >> N >> M;
  ll c[N];
  for(int i=0;i<N;i++){
    cin >> c[i];
  }
  ll x[M], y[M];
  for(int i=0;i<M;i++){
    cin >> x[i] >> y[i];
  }
  
  init(N);
  for(int i=0;i<M;i++){
    unite(c[x[i]-1]-1, c[y[i]-1]-1);
  }
  ll ans = 0;
  for(int i=0;i<N;i++){
    if(same(i, c[i]-1)){
      ans++;
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 2944
#!/usr/bin/env python3
import sys
from math import sqrt

rl = sys.stdin.buffer.readline
INF = sys.maxsize

N, D = map(int, rl().split())
PS = [tuple(map(int, rl().split())) for i in range(N)]


print(len(tuple(filter(lambda p: sqrt(p[0] ** 2 + p[1] ** 2) <= D, PS))))

Measured memory_bytes: 106688
#include <iostream>
#include <algorithm>
 
#define INF (1 << 25)
 
using namespace std;
 
int pcost[100][100]; // begin, end
int mcost[100][100];
 
void Dijkstra( int n, int s, int cost[][100], int *minCost )
{
    bool *end = new bool[n];
    fill(end, end+n, false);
    minCost[s] = 0;
    end[s] = true;
    while(true) {
        int ii = -1, nn = (INF);
        for(int i=0; i < n; ++i) {
            if(end[i] && nn > minCost[i]) {
                nn = minCost[i];
                ii = i;
            }
        }
        if(ii == -1) break;
        end[ii] = false;
        for(int i=0; i < n; ++i) {
            if(minCost[i] > minCost[ii] + cost[ii][i]) {
                minCost[i] = minCost[ii] + cost[ii][i];
                end[i] = true;
            }
        }
    }
}
 
int main( void )
{
    int minCost1[100], minCost2[100], minCost3[100];
 
    int n, m, s, g1, g2;
    while(cin >> n >> m >> s >> g1 >> g2, n | m | s | g1 | g2) {
        --s; --g1; --g2;
        for(int i=0; i < n; ++i) {
            fill(pcost[i], pcost[i]+n, INF);
            fill(mcost[i], mcost[i]+n, INF);
            minCost1[i] = minCost2[i] = minCost3[i] = INF;
        }
        for(int i=0; i < m; ++i) {
            int bb, ee, cc;
            cin >> bb >> ee >> cc;
            --bb; --ee;
            pcost[bb][ee] = mcost[ee][bb] = cc;
        }
        Dijkstra(n, s, pcost, minCost1);
        Dijkstra(n, g1, mcost, minCost2);
        Dijkstra(n, g2, mcost, minCost3);
 
        int ans = INF;
        for(int i=0; i < n; ++i) {
            ans = min(ans, minCost1[i] + minCost2[i] + minCost3[i]);
        }
        cout << ans << endl;
    }
 
    return 0;
}

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

using namespace std;

int main(void)
{
    string s, t;
    cin >> s >> t;

    int ss = s.size(), ts = t.size();

    int dp[ss + 1][ts + 1] = {};

    for(int i = 1; i <= ss; i++)
    {
        for(int j = 1; j <= ts; j++)
        {
            if(s[i - 1] == t[j - 1])
                dp[i][j] += 1 + dp[i - 1][j - 1];
            else
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
        }
    }

    string x = "";

    int is = ss;
    int js = ts;

    while(js != 0 && ts != 0)
    {
        if(dp[is][js] == dp[is][js - 1])
            js--;
        else if(dp[is][js] == dp[is - 1][js])
            is--;
        else if(dp[is][js] > dp[is - 1][js] && dp[is][js] > dp[is][js - 1])
        {
            x += (s[is - 1]);
            is--;
            js--;
        }
    }

    reverse(x.begin(), x.end());

    cout << x << endl;

    /*for(int i = 0; i <= ss; i++)
    {
        for(int j = 0; j <= ts; j++)
        {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }
    cout << dp[ss][ts];*/

    return 0;
}


Measured memory_bytes: 35456
package main
import (
  "fmt"
  "strings"
)
func main() {
  var s string
  var x,y int
  fmt.Scan(&s)
  fmt.Scan(&x,&y)
  var t []string = strings.Split(s,"T")
  x -= len(t[0])
  var mx []int = []int{}
  var my []int = []int{}
  for i:=1;i<len(t);i++ {
    if len(t[i]) == 0 { continue }
    if i%2 == 0 {
      mx = append(mx,len(t[i]))
    } else {
      my = append(my,len(t[i]))
    }
  }
  dpx := make(map[int]struct{})
  dpx[0] = struct{}{}
  for i:=0;i<len(mx);i++ {
    dp := make(map[int]struct{})
    for k,_ := range dpx {
      dp[k+mx[i]] = struct{}{}
      dp[k-mx[i]] = struct{}{}
    }
    dpx = dp
  }
  dpy := make(map[int]struct{})
  dpy[0] = struct{}{}
  for i:=0;i<len(my);i++ {
    dp := make(map[int]struct{})
    for k,_ := range dpy {
      dp[k+my[i]] = struct{}{}
      dp[k-my[i]] = struct{}{}
    }
    dpy = dp
  }
  _,xok := dpx[x]
  _,yok := dpy[y]
  if xok && yok {
    fmt.Println("Yes")
  } else {
    fmt.Println("No")
  }
}

Measured memory_bytes: 7696
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int i,j;
	int h,w;
	while(1){
		cin>>h>>w;
		if(h==0&&w==0)	break;
		for(i=1;i<=h;i++){
			if(i%2==0){
				for(j=1;j<=w;j++){
					if(j%2==0){
						cout<<"#";
					}
					else{
						cout<<".";
					}
				}
				cout<<endl;
			}
			else{
				for(j=1;j<=w;j++){
					if(j%2!=0){
						cout<<"#";
					}
					else{
						cout<<".";
					}
				}
				cout<<endl;
			}
		}
		cout<<endl;
	}
	return 0;
}


Measured memory_bytes: 3096
n = int(input())
s, t = [], []
for i in range(n):
    si, ti = input().split()
    ti = int(ti)
    s.append(si)
    t.append(ti)
x = input()

bit = 0
ans = 0
for i in range(n):
    if s[i] == x:
        bit = 1
    else:
        if bit == 1:
            ans += t[i]

print(ans)

Measured memory_bytes: 3064
/*
    Vora Mahammadasim
*/

#include<bits/stdc++.h>
#include<stdio.h>
#define int long long
#define pb emplace_back
#define Mod 1000000007
#define all(a) a.begin(),a.end()
using namespace std;
signed main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,k;
    cin>>n>>m>>k;
    vector<int>a(n+1),b(m+1);
    a[0] = 0,b[0]=0;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=m;i++) cin>>b[i];
    partial_sum(all(a),a.begin());
    partial_sum(all(b),b.begin());
    int ans = 0;
    for(int i=0,j=m;i<=n;i++){
        if(a[i] > k) break;
        while(a[i] + b[j] > k) j--;
        ans = max(i+j,ans);
    }
    cout<<ans;
}


Measured memory_bytes: 6344
n,k=map(int,input().split())
A=list(map(int,input().split()))
B=[0]*40
for i in A:
  s=format(i,"40b")
  for j in range(40):
    if s[-1-j]=="1":
      B[j]+=1
C=[0]*40
for i in range(40):
  if B[-1-i]<n/2:
    C[i]=1
  else:
    C[i]=0
AA=[]
a=0
for i in range(40):
  if C[i]==1:
    if a+2**(39-i)>k:
      continue
    b=a
    for j in range(i+1,40):
      if C[j]==1:
        b=b+2**(39-j)
    AA.append(b)
    a=a+2**(39-i)
AA.append(a)
ans=0
for i in AA:
  a=0
  for j in A:
    a=a+(i^j)
  if a>ans:
    ans=a
print(ans)

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

using namespace std;

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

int main(){
    long int mod = 1000000007;
    string l;
    cin >> l;
    long int dp[l.size()][2];
    // 0:l以下が確定, 1:l以下が未確定
    dp[0][0] = 1;
    dp[0][1] = 2;
    for(int i = 1; i < l.size(); i++){
        if (l[i] == '0') {
            dp[i][0] = dp[i-1][0] * 3;
            dp[i][1] = dp[i-1][1];
        }else{
            dp[i][0] = dp[i-1][0] * 3 + dp[i-1][1];
            dp[i][1] = dp[i-1][1] * 2;
        }
        dp[i][0] %= mod;
        dp[i][1] %= mod;
        // cout << dp[i][0] + dp[i][1] << endl;
    }
    long int ans = dp[l.size()-1][0] + dp[l.size()-1][1];
    ans %= mod;
    cout << ans << endl;
}

Measured memory_bytes: 2048
#include <iostream>

using namespace std;

int main(){
	int a, temp;
	bool yeet;

	yeet = true;


	cin >> a;

	while (a--){
		cin >> temp;
		if (temp%2 == 0){
			if (temp%3 != 0 && temp%5 !=0){
				yeet = false;
			}
		}
	}

	if (yeet){
		cout << "APPROVED" << endl;
	}
	else{
		cout << "DENIED" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>
#include<iomanip>
#define rep(i,n)  for(int i = 0; i < n;i++);
using namespace std;
vector<int> v;
int main() {
	double a, b, c, d;
	cin >> a >> b >> c >> d;
	double ac = pow(a - c, 2);
	double bd = pow(b - d, 2);
	cout << fixed << setprecision(10) << pow(ac + bd, 0.5) << endl;
}


Measured memory_bytes: 3472
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  int a,b;
  cin>>a>>b;
  int ans=0;
  while(ans<(a+b)*1000)
  {
    if(floor(ans*0.08)==a&&floor(ans*0.1)==b)
    {
      cout<<ans<<endl;
      return 0;
    }
    ans++;
  }
  cout<<-1<<endl;
}

Measured memory_bytes: 256
//all possible//
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	int i,j,cnt=0;
	cin>>s;
	vector<char > v,z;
	v.push_back('a');
	v.push_back('b');
	v.push_back('c');
	v.push_back('d');
	v.push_back('e');
	v.push_back('f');
	v.push_back('g');
	v.push_back('h');
	v.push_back('i');
	v.push_back('j');
	v.push_back('k');
	v.push_back('l');
	v.push_back('m');
	v.push_back('n');
	v.push_back('o');
	v.push_back('p');
	v.push_back('q');
	v.push_back('r');
	v.push_back('s');
	v.push_back('t');
	v.push_back('u');
	v.push_back('v');
	v.push_back('w');
	v.push_back('x');v.push_back('y');v.push_back('z');
	
	
	for(i=0;i<v.size();i++)
	{
		for(j=0;j<s.size();j++)
		{
			if(v[i]!=s[j])
			cnt++;
		}
		if(cnt==s.size())
		z.push_back(v[i]);
		cnt=0;
		
		
	}
	if(z.size()==0)
	cout<<"None";
	else
	cout<<z[0];
	

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using VI = vector<int>;
using VVI = vector<VI>;

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  string s, t; cin >> s >> t;
  reverse(t.begin(), t.end());
  cout << (s == t ? "YES" : "NO") << '\n';
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int maps[17][17];
int cnt(int x,int y);
int main(){
  while(1){
    int a,b,n,x,y;
    cin >> a >> b;
    if(a == 0 && b== 0)break;
    for(int i=0;i<17;i++){
      for(int j=0;j<17;j++){
	maps[i][j] = 0;
      }
    }
    cin >> n;
    for(int i=0;i<n;i++){
      cin >> x >> y;
      maps[x][y] = -1;
    }
    for(int i=0;i<a+1;i++){
      maps[i][0]= -1;
    }
    for(int i=0;i<b+1;i++){
      maps[0][i]=-1;
    }
    int ans = cnt(a,b);
    cout << ans << endl;
  }
}
int cnt(int x,int y){
  if(maps[x][y]== -1)return 0;
  else if(x == 1 && y == 1) return 1;
  
  return (cnt(x-1,y) + cnt(x,y-1));
}

Measured memory_bytes: 1160
import collections
N = int(input())
A = list((map(int,input().split())))

index = list(range(1,N+1))

R = [index[i] - A[i] for i in range(N)]
L = [index[j] + A[j] for j in range(N)]

R_dict = collections.Counter(R)
L_dict = collections.Counter(L)

ans=0
for i in R_dict.keys()&L_dict.keys():
    ans+=R_dict[i]*L_dict[i]

print(ans)

Measured memory_bytes: 79688
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define M 2000
#define MM 4010
int c[2][MM+10];
vector<int> v[M], v2[M];

ll inv[MM*2+1], fact[MM*2+1], ifact[MM*2+1];
 
void init_fact(ll n){
    inv[1] = 1;
    for(int i = 2; i < n; i++) inv[i] = inv[mod%i] * (mod - mod/i) % mod;
	fact[0] = ifact[0] = 1;
	for(int i = 1; i < n; i++){
		fact[i] = (fact[i-1]*i)%mod;
		ifact[i]=(ifact[i-1]*inv[i])%mod;
	}
}

ll comb(ll a, ll b){
	return fact[a+b]*ifact[a]%mod*ifact[b]%mod;
}

ll pow_mod(ll a, ll r, ll m){
	ll x = 1;
	while(r){
		if(r&1) (x*=a)%=m;
		(a*=a)%=m;
		r>>=1;
	}
	return x;
}
int main(){
	int n;
	cin>>n;
	init_fact(MM*2);
	ll res = 0;
	rep(i, n){
		int a, b;
		cin>>a>>b;
		v[M-a].push_back(M-b);
		v2[a-1].push_back(M+b);
		(res-=comb(2*a, 2*b))%=mod;
	}
	rep(i, M*2+1){
		int t = i%2;
		if(i<M){
			for(auto b: v[i]){
				c[t][b]++;
			}
		}
		mset(c[!t], 0);
		rep(j, MM){
			(c[t][j+1]+=c[t][j])%=mod;
			(c[!t][j]+=c[t][j])%=mod;
		}
		if(i>M){
			for(auto b: v2[i-M-1]){
				(res+=c[t][b])%=mod;
			}
		}
	}
	cerr<<res<<endl;
	(res*=inv[2])%=mod;
	cout<<(res+mod)%mod<<endl;
	return 0;
}


Measured memory_bytes: 3328
#include <iostream>

bool inputNjudge(int&, int&, char&);
int culculate(int, int, char);

int main(){
	int inputedNumber1;
	int inputedNumber2;
	char inputedOp;

	while (inputNjudge(inputedNumber1, inputedNumber2, inputedOp))
	{
		std::cout << culculate(inputedNumber1, inputedNumber2, inputedOp) << '\n';
	}

}


bool inputNjudge(int& a, int& b, char& op)
{
	std::cin >> a >> op >> b;
	
	if (op == '?')
		return false;
	else
		return true;
}


int culculate(int a, int b, char op)
{
	switch (op)
	{
	case '+':
		return a + b;
	case '-':
		return a - b;
	case '*':
		return a * b;
	case '/':
		return a / b;
	default:
		return 0;
	}
}


Measured memory_bytes: 3092
#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>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int n;
    cin >> n;
    multiset<int> s;
    rep(i,n) {
        int a;
        cin >> a;
        auto iter = s.lower_bound(a);
        if (iter != s.begin()) s.erase(--iter);
        s.insert(a);
    }
    int ans = s.size();
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 8236
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1000000000000
#define fr first
#define sc second
using vl =vector<ll>;
using vvl =vector<vl>;
const ll md = 1000000007;

ll ad(ll a, ll b, ll mod = md) {
    return (a%mod + b%mod + mod) % mod;
}

ll ml(ll a, ll b, ll mod = md) {
    return ( (a%mod) * (b%mod) ) % mod;
}

ll pw(ll x, ll n, ll mod = md) {
    ll res = 1;
    x %= mod;
    while (n) {
        if (n & 1)  res = (res*x)%mod;
        n = (n >> 1);
        x = (x*x)%mod;
    }
    return res;
}

ll dp[1000001][4];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll N;
    cin >> N;
    dp[1][0] = 8;
    dp[1][1] = 1;
    dp[1][2] = 1;
    dp[1][3] = 0;
    for(int i = 2; i <= N; ++i) {
    	dp[i][0] = dp[i-1][0] * 8;
    	dp[i][1] = (dp[i-1][0] + dp[i-1][1]) + 8*dp[i-1][1];
    	dp[i][2] = dp[i-1][0] + dp[i-1][2] + 8*dp[i-1][2];
    	dp[i][3] = dp[i-1][2] + dp[i-1][3] + 8*dp[i-1][3] + dp[i-1][1] + dp[i-1][3];
    	dp[i][0] %= md;
    	dp[i][1] %= md;
    	dp[i][2] %= md;
    	dp[i][3] %= md;
    }
    cout << dp[N][3] << "\n";
    return 0;
}

Measured memory_bytes: 34756
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	while (b) {
		ll r = a % b; a = b; b = r;
	}
	return a;
}
ll lcm(ll x, ll y) {
	ll g = gcd(x, y);
	return x / g * y;
}
 
int main() {
  ll a,b,c,d;
  cin >> a >> b >> c >> d;
  ll e,f,g;
  e = b/c - (a-1)/c;
  f = b/d - (a-1)/d;
  ll l = lcm(c,d);
  g = b/l - (a-1)/l;
  cout << b-a+1-e-f+g;
  
 return 0;
}


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

int main(){
  ll n;cin>>n;
  ll ans=0;
  vector<ll> v(n);
  rep(i,n){
    cin>>v.at(i);
  }
  rep(i,n){
    ll c=0;
    while(true){
      if(v.at(i)%2==1){
        break;
      }
      c++;
      v.at(i)/=2;
    }
    ans+=c;
  }
  cout<<ans;
}

Measured memory_bytes: 384
void main() {
	auto S = rs;
	string s;
	foreach(i; 1..6) {
		s ~= "hi";
		if(S == s) {
			writeln("Yes");
			return;
		}
	}
	writeln("No");
}

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

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
fn main() {
    let s: Vec<char> = "AKIHABARA".chars().collect();
    let t: Vec<char> = readln();
    let mut dp = [[false; 51]; 51];
    dp[0][0] = true;
    for i in 0..s.len() {
        for j in 0..(t.len() + 1) {
            if dp[i][j] && j < t.len() && s[i] == t[j] {
                dp[i + 1][j + 1] = true;
            }
            if dp[i][j] && s[i] == 'A' {
                dp[i + 1][j] = true;
            }
        }
    }
    let ans = if dp[s.len()][t.len()] { "YES" } else { "NO" };
    println!("{}", ans);
}

// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};

pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);


Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
int ans;
int x, y;
int main() {
	std::cin >> x >> y;
	if (y < x)y = -y,ans++;
	ans += std::min(std::abs(y - x), std::abs(x + y) + 1);
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 256
n=int(input())
s=list(map(int,input().split()))
q=int(input())
t=list(map(int,input().split()))

c=0



for i in range(q):
	left=0
	right=n
	while left < right:
		mid =(left +right)//2
		if s[mid]==t[i]:
			c+=1
			break
		elif t[i] < s[mid]:
			right=mid
		else:
			left=mid+1
	

print(c)

	


Measured memory_bytes: 16708
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include<stack>
#include <queue>
#include<map>
#include <set>
using namespace std;
#define int long long
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define INF 1000000007
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2)*pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int jo(int n) {
	int ans = 1;
	rep(i, n) {
		ans *= 2;
	}
	return ans;
}

signed main() {
	int n;
	cin >> n;
	cout << n / 3 << endl;
}


Measured memory_bytes: 256
k, x = gets.split.map(&:to_i)

if k == 1
  puts x
  exit
end

ans = []
diff = k - 1
diff.times do |i|
  ans << x - (diff - i)
end

ans << x

diff.times do |i|
  i += 1
  ans << x + i
end

puts ans.join(' ')


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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n;
  std::cin >> n;
  std::vector<int64_t> c(n), a(n);
  std::cin >> c;

  std::sort(c.begin(), c.end());
  std::reverse(c.begin(), c.end());

  constexpr int64_t mod = 1000000007;
  for (auto &i : c) {
    i %= mod;
  }

  a[0] = 1;
  a[1] = 3;

  for (int64_t i = 2; i < n; i++) {
    auto tmp = a[i - 1] - a[i - 2];
    if (tmp < 0) {
      tmp += mod;
    }

    a[i] = (4 * tmp) % mod;
  }

  std::vector<int64_t> pow2(n + 1);
  pow2[0] = 1;

  for (int64_t i = 1; i < n + 1; i++) {
    pow2[i] = (pow2[i - 1] * 2) % mod;
  }

  int64_t ans = 0;

  for (int64_t i = 0; i < n; i++) {
    const auto j = i + 1;
    auto tmp = ((pow2[n - j] * pow2[n - j]) % mod) * pow2[j];
    tmp %= mod;

    tmp *= (a[i] * c[i]) % mod;
    tmp %= mod;
    ans += tmp;
    ans %= mod;
  }

  std::cout << ans << std::endl;

  return 0;
}

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

#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define inf (long long int) 1e18
#define eps 0.000001
#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define mod 1000000007
#define MAXN 100001
ll spf[MAXN]; 
ll gcd(ll a,ll b);
ll palindrome(string s);
ll modexp(ll a,ll b,ll m);
void sieve();
ll ceil(ll a, ll b);
vl getFactorization(ll x);
void getZarr(string str, ll Z[]);


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    /*#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif*/

    ll n,t;
    cin>>n>>t;
    pair<ll,ll> p[n];
    loop(i,0,n){
        cin>>p[i].se>>p[i].fi;
    }
    sort(p,p+n);
    ll ans=10000;
    for(ll i=0;p[i].fi<=t;i++){
        ans=min(ans,p[i].se);
    }
    if(ans>=10000) cout<<"TLE"<<endl;
    else cout<<ans<<endl;
}

ll gcd(ll a, ll b){
    if (a == 0)   return b;
    if(b==0)      return a;
    if (a == b)   return a;
    if (a > b)    return gcd(a%b, b);
    return gcd(a, b%a);
}

ll palindrome(string s){
    ll l = 0;
    ll h = s.length() - 1;
    while (h > l){
        if (s[l++] != s[h--]){
            return 0;
        }
    }
    return 1;
}

ll modexp(ll a, ll b, ll m){
    if (b==0)
        return 1;
    ll temp = modexp(a,b/2,m);
    temp = (temp*temp)%m;
    if (b&1)
        return (temp*(a%m))%m; // if b is odd a^b = a^(b/2)*a^(b/2)*a
    return temp;
}

void sieve() { 
    spf[1] = 1; 
    for (ll i=2; i<MAXN; i++) 
        spf[i] = i; 
    for (ll i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (ll i=3; i*i<MAXN; i++) { 
        if (spf[i] == i) { 
            for (ll j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 

vl getFactorization(ll x) 
{ 
    vl ret; 
    while (x != 1) 
    { 
        ret.push_back(spf[x]); 
        x = x / spf[x]; 
    } 
    return ret; 
} 

ll ceil(ll a,ll b){
    return a/b+(a%b!=0);
}

void getZarr(string str, ll Z[]){
    ll n = str.length();
    ll L, R, k;
    L = R = 0;
    for (ll i = 1; i < n; ++i){
        if (i > R){
            L = R = i;
            while (R<n && str[R-L] == str[R])
                R++;
            Z[i] = R-L;
            R--;
        } else {
            k = i-L;
            if (Z[k] < R-i+1)
                Z[i] = Z[k];
            else {
                L = i;
                while (R<n && str[R-L] == str[R])
                    R++;
                Z[i] = R-L;
                R--;
            }
        }
    }
}


Measured memory_bytes: 256
/*
 * cpp_filepath
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
void solve();
int main() { solve(); return 0; }

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a > b) swap(a, b);
  if (a <= c and c <= b) cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

using namespace std;
typedef long long ll;

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


Measured memory_bytes: 888
#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int aaa(int x,int y)
{int z=x*y;
 return z;}
int main()
{int a,b,c;
 cin>>a>>b>>c;
 int sss=aaa(a,b);
 int ans=min(sss,c);
 cout<<ans;
 return 0;
}
 


Measured memory_bytes: 256
/*
  In the name of ALLAH
  Author : Raashid Anwar
*/
 
#include <bits/stdc++.h>
using namespace std;
 
#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

int n, k;
vector <int> a;

bool get(int x) {
  int cnt = 0;
  for(int i = 0; i < n; i++)
    cnt += (a[i] / x) + (a[i] % x? 0: -1);
  return cnt <= k;
}

void solve() {
  cin >> n >> k;
  a.resize(n);
  for(int &i : a)
    cin >> i;
  int lo = 1, hi = M2;
  while(lo <= hi) {
    int mi = (lo + hi) >> 1;
    if(get(mi))
      hi = mi - 1;
    else
      lo = mi + 1;
  }
  cout << lo << "\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  #endif*/
  //int t, i = 1;
  //cin >> t;
  //while(t--) {
    //cout << "Case #" << i++ << ": ";
    solve();
  //}
}

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

#define ll long long
#define mp make_pair
#define pb push_back

#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)

#define P 0
#define D 1
const char *ch = "PD";

int n;
char s[2 << 17];
int dp[2 << 17][2];
int pre[2 << 17][2];

int occ(int c0, int c1) {
	int ans = 0;
	if (c1 == D) ++ ans;
	if (c0 == P && c1 == D) ++ ans;
	return ans;
}

void prt(int i, int f) {
	if (!i) return ;
	prt(i - 1, pre[i][f]);
	putchar(ch[f]);
}

int	main() {
	scanf("%s", s);
	n = strlen(s);
	memset(dp, -0x3f, sizeof(dp));
	dp[0][D] = 0;
	rep(i, n) rep(f, 2) if (dp[i][f] >= 0) {
		rep(nf, 2) if (s[i] == '?' || s[i] == ch[nf]) {
			if (dp[i + 1][nf] < dp[i][f] + occ(f, nf)) {
				dp[i + 1][nf] = dp[i][f] + occ(f, nf);
				pre[i + 1][nf] = f;
			}
		}
	}
	int f = 0;
	if (dp[n][1] > dp[n][0]) f = 1;
	prt(n, f); puts("");
	return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> l(n);
    vector<int> r(n);
    for(int i = 0; i < n; i++){
        cin >> l.at(i) >> r.at(i);
    }
    int sum = 0;
    for(int i = 0; i < n; i++){
        sum = sum + (r.at(i) - l.at(i) + 1);
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                if (String.valueOf(i).length() % 2 == 1) {
                    ans++;
                }
            }

            System.out.println(ans);
        }
    }

}


Measured memory_bytes: 27092
N,M = map(int,input().split())
A = [[0 for _ in range(M+1)]]
for _ in range(N):
    a = list(map(int,input().split()))
    a.insert(0,0)
    A.append(a)
C = {j:[] for j in range(1,M+1)}
hist = [0 for _ in range(N+1)]
sports = [j for j in range(1,M+1)]
cmin = N
while len(sports)>1:
    for i in range(1,N+1):
        if hist[i]==0:
            for j in range(1,M+1):
                if A[i][j] in sports:
                    C[A[i][j]].append(i)
                    hist[i]=1
                    break
    cmax = 0
    smax = 0
    for a in sports:
        if len(C[a])>cmax:
            cmax = len(C[a])
            smax = a
    cmin = min(cmin,cmax)
    for i in C[smax]:
        hist[i]=0
    del C[smax]
    sports.remove(smax)
print(cmin)

Measured memory_bytes: 44636
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

fn main() {
    let (a, b, c) = get!(usize, usize, usize);
    println!("{}", if a == b && b == c { 1 } else if a == b || b == c || a == c { 2 } else { 3 });
}

Measured memory_bytes: 4352