akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
#define getbit(n, i) (((n) & (1LL << (i))) != 0) 
#define setbit0(n, i) ((n) & (~(1LL << (i)))) 
#define setbit1(n, i) ((n) | (1LL << (i))) 
#define togglebit(n, i) ((n) ^ (1LL << (i))) 
#define lastone(n) ((n) & (-(n))) 
char gap = 32;
template<typename T> 
ostream& operator<<(ostream &os, const vector<T> &v) { 
    os << '{'; 
    for (const auto &x : v) os << gap << x;
        return os << '}'; 
}
template<typename A, typename B> 
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long 
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll hashPrime = 1610612741;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll i,j,k,l,n,m;
    cin >> n;
    map<string, ll> mp1;
    for (i = 1; i <= n;i++){
        string s;
        cin >> s;
        mp1[s]++;
    }
    cout << "AC x " << mp1["AC"] << "\n";
    cout << "WA x " << mp1["WA"] << "\n";
    cout << "TLE x " << mp1["TLE"] << "\n";
    cout << "RE x " << mp1["RE"] << "\n";
    return 0;
}

Measured memory_bytes: 3664
import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] arr = new int[n];
        int[] dp = new int[n];
        for(int i=0;i<n;++i){
            arr[i]=input.nextInt();
        }
        if(n==0 || n==1)
            System.out.println("0");
        else {
            dp[1]=Math.abs(arr[1]-arr[0]);
            for (int i = 2; i < n; ++i) {
                int val1 = dp[i-1]+Math.abs(arr[i]-arr[i-1]);
                int val2 = dp[i-2]+Math.abs(arr[i]-arr[i-2]);
                dp[i]=Math.min(val1,val2);
            }
        }
        System.out.println(dp[n-1]);

    }
}


Measured memory_bytes: 50996
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Math;

namespace CSharpSpiral {
	class Program {
		static void Main(string[] args) {
			var sw = new StreamWriter(Console.OpenStandardOutput()) {
				AutoFlush=
#if DEBUG
			true
#else
			false
#endif
			};
			Console.SetOut(sw);
			new Program().Solve(new ConsoleInput(
#if DEBUG
			new StreamReader("../../../inputData.txt")
#else
			Console.In
#endif
			, ' '));
			Console.Out.Flush();
		}
		public void Solve(ConsoleInput cin) {
			var N = cin.ReadInt;
			var P = new BigInteger(1);
			var thres = new BigInteger(1_000_000_000_000_000_000L);
			var A=cin.ReadLongArray(N);
			for(int i = 0; i<N; i++) {
				P*=A[i];
				if(P>thres) {
					P=A.Contains(0) ? 0 : -1;
					break;
				}
			}
			Console.WriteLine(P);
		}

	}
	static class ExtendClass {
		public static string Join<T>(this IEnumerable<T> X, string separator = " ") => string.Join(separator, X);
		
	}
	class ConsoleInput {
		private readonly TextReader _stream;
		private readonly char _separator = ' ';
		private readonly Queue<string> inputStream;
		public ConsoleInput(TextReader stream, char separator = ' ') {
			this._separator=separator;
			this._stream=stream;
			inputStream=new Queue<string>();
		}
		public string Read {
			get {
				if(inputStream.Count!=0) return inputStream.Dequeue();
				string[] tmp = _stream.ReadLine().Split(_separator);
				for(int i = 0; i<tmp.Length; ++i)
					inputStream.Enqueue(tmp[i]);
				return inputStream.Dequeue();
			}
		}
		public string ReadLine { get { return _stream.ReadLine(); } }
		public int ReadInt { get { return int.Parse(Read); } }
		public long ReadLong { get { return long.Parse(Read); } }
		public double ReadDouble { get { return double.Parse(Read); } }
		public string[] ReadStrArray(long N) {
			var ret = new string[N];
			for(long i = 0; i<N; ++i)
				ret[i]=Read;
			return ret;
		}
		public int[] ReadIntArray(long N) { var ret = new int[N]; for(long i = 0; i<N; ++i) ret[i]=ReadInt; return ret; }
		public long[] ReadLongArray(long N) { var ret = new long[N]; for(long i = 0; i<N; ++i) ret[i]=ReadLong; return ret; }
		public double[] ReadDoubleArray(long N) { var ret = new double[N]; for(long i = 0; i<N; ++i) ret[i]=ReadDouble; return ret; }
		public bool isEOF {
			get { return _stream.Peek()==-1; }
		}
	}
}

Measured memory_bytes: 43524
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
	int n,k,ans=1;
	scanf("%d%d",&n,&k);
	for (int i=0;i<n;i++)
	{
		ans+=min(ans,k);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        n: usize,
        mut aa: [isize; n],
    }

    for (i, a) in aa.iter_mut().enumerate() {
        *a -= i as isize + 1;
    }

    aa.sort();

    let index = aa.len() / 2;

    let mut ans = aa.iter().copied().map(|a| (a - aa[index]).abs()).sum::<isize>();

    if index > 0 {
        let ans1 = aa.iter().copied().map(|a| (a - aa[index-1]).abs()).sum::<isize>();
        ans = std::cmp::min(ans1, ans);
    }

    println!("{}", ans);
}


Measured memory_bytes: 6140
#include<bits/stdc++.h>
using namespace std;
int main(void){
  int N, X;
  cin >> N >> X;
  int minimum = 1E5;
  int sum = 0;
  for(int i = 0; i < N; i++){
    int m;
    cin >> m;
    minimum = min(m, minimum);
    sum += m;
  }
  cout << N + (X - sum) / minimum << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
l = input().split()

#print(l)

max = int(l[0])
min = int(l[0])

#print(max)
#print(min)

for i in l:
    tmp = int(i)
    if min > tmp:
        min = tmp 
    if max < tmp:
        max = tmp

print(max - min)
#print(l[0])
#print(l[1])

Measured memory_bytes: 3060
fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let s = read1::<String>().chars().collect::<Vec<char>>();
    let mut a = -1;
    let mut ans = 0;
    for (i, &c) in s.iter().enumerate() {
        if a < 0 && c == 'A' {
            a = i as isize;
        }
        if a >= 0 && c == 'Z' {
            ans = i as isize - a + 1;
        }
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int x,y,z,k;
	cin >> x>> y>> z>>k;
    ll a[x];
    ll b[y];
    ll c[z];
    fr(i,x){
      cin >> a[i];
    }
    fr(i,y){
      cin >> b[i];
    }
    fr(i,z){
      cin >> c[i];
    }
    sort(a,a+x,greater<>());
    sort(b,b+y,greater<>());
    sort(c,c+z,greater<>());
    ll ab[min(x,k)*min(y,k)];
    fr(i,min(x,k)){
      fr(j,min(y,k)){
        ab[i*min(y,k)+j]=a[i]+b[j];
      }
    }
    sort(ab,ab+min(x,k)*min(y,k),greater<>());
    ll abc[min(z,k)*min(x*y,k)];
    fr(i,min(z,k)){
      fr(j,min(x*y,k)){
        abc[i*min(x*y,k)+j]=c[i]+ab[j];
      }
    }
    sort(abc,abc+min(z,k)*min(x*y,k),greater<>());
   fr(i,k){
     cout << abc[i] << endl;
   }
}

Measured memory_bytes: 31616
func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func mainC() {
    let N = readInt()
    let heights = readInts()

    var previous = heights[0]
    var baseHeights = 0
    for height in heights {
        if previous == height {
        } else if previous > height {
            baseHeights += previous - height
        } else if previous < height {
            previous = height
        }
    }

    print(baseHeights)
}
mainC()

Measured memory_bytes: 21488
#include <bits/stdc++.h>
using namespace std;
char f[1000000];
int a=0,b=0,c=0,d,e; 
int main()
{
	cin>>f;
	while(a<strlen(f))
	{
		if(b==0&&f[a]=='C')
		{
			b++;
		}
		if(b==1&&f[a]=='F')
		{
			b++;
		}
		a++;
	}
	if(b==2)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main() 
{
  int dice1, dice2 = 0;
  int cnt = 0;
  int flag = 0;
  int i_rc = 0;
  i_rc = scanf("%d", &cnt);
  
  for(int ii = 0; ii < cnt; ii++) {
   	i_rc = scanf("%d", &dice1); 
       	i_rc = scanf("%d", &dice2); 
    
    if (dice1 == dice2) {
      flag++;
    } else {
     flag = 0; 
    }
    
    if (flag == 3) {
      printf("Yes");
      break;
    } 
    
  }
  
  if (flag != 3) {
   printf("No"); 
  }
  
  return 0;
  
}

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

int main() {
  int a,b;
  cin >> a >> b;
  
  cout << (a+b+1)/2 << endl;
  
  return 0;
}


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

//awok

int A,B;
int main() {
	cin>> A >> B;
	if (A == B){
		cout<<"Draw"<<endl;
	} else if(A == 1 && B != 1){
		cout<< "Alice"<<endl;
	} else if (B == 1 && A != 1){
		cout<< "Bob"<<endl;
	} else if (A < B){
		cout<<"Bob"<<endl;
	} else{
		cout<<"Alice"<<endl;
	}
}

Measured memory_bytes: 256
/*siddharth goyal*/
#include<bits/stdc++.h>
using namespace std;
#define   pb              push_back
#define   REP(i,n)        for(int i=1;i<=n;i++)
#define   FOR(i,a,b)      for(int i=a;i<=b;i++)
#define   all(v)          v.begin(),v.end()
#define   F               first
#define   S               second
#define   vl              vector<LL>
#define   itr             ::iterator it
#define   lb              lower_bound
#define   ub              upper_bound
#define   LL              long long
#define   ULL             unsigned long long
#define   ret             return 
#define   sz(x)           (LL)x.size()
LL n,i,j,ans = 0;
LL a[1000000],dp[500][500],b[500][500] ;
LL f(LL start,LL end)
{  if(dp[start][end]!=-1)  ret dp[start][end] ; 
   dp[start][end] = (LL)1E18 ;
   if(end>n) ret 0 ; 
   if(start==end)
   {  b[start][end] = a[start] ;  
      ret dp[start][end] = 0 ; 
   } 
   for(int i=start;i<end;i++)
   {  if(dp[start][end]>f(start,i) + f(i+1,end) + b[start][i] + b[i+1][end])
      {  dp[start][end] = min(dp[start][end],dp[start][i] + dp[i+1][end] + b[start][i] + b[i+1][end]) ;
         b[start][end] = b[start][i] + b[i+1][end] ;     
      } 
          
   }
   ret dp[start][end] ; 
} 
int main()
{   // Read the constraints,highlights,Time Limit,Test Cases
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n ; 
    REP(i,n) cin>>a[i] ;
    memset(dp,-1,sizeof(dp)) ; 
    f(1,n) ; 
    cout<<dp[1][n]<<endl; 
}
//Check for 0,1 and other corner cases.

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

using namespace std;

int main(){

	string str;
	getline(cin,str);
	string cuts;
	vector<string> vs;
	for(int i = 0; i < str.size(); i++){
		if((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z')||str[i]==39){
			cuts+=str[i];
		}
		else{
			if(cuts.size()>=3&&cuts.size()<=6){
				vs.push_back(cuts);
			}
			cuts="";
		}
	}
	if(cuts!="")
		vs.push_back(cuts);
	for(int i = 0; i < vs.size(); i++){
		cout<<vs[i];
		if(i==vs.size()-1){
			cout<<endl;
		}
		else
			cout<<" ";
	}
	
	return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
			Scanner s= new Scanner(System.in);
		  char s1= s.next().charAt(0);
		  
		  if(s1 >='A' && s1 <= 'Z')
		    System.out.println("A");
		   else
		  	System.out.println("a");
	}

}


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    int N;
    cin >> N;
    vector<int> d(N);
    rep(i, N) cin >> d[i];
    sort(d.begin(), d.end());

    int ans = 0;
    cout << d[N/2] - d[N/2-1] << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(){
  int A,B;
  cin>>A>>B;
  int n,m,l;
  n=A+B;
  m=A-B;
  l=A*B;
  if(n>=max(m,l)){
    cout<<n<<endl;
  }
  else if(m>=max(n,l)){
    cout<<m<<endl;
  }
  else if(l>=max(m,n)){
    cout<<l<<endl;
  }
  return 0;
}
  

Measured memory_bytes: 256
#include<stdio.h>

#define S 256
char tar[S];
int n;

int input(){
	int i;
	char t, c;
	scanf("%d\n", &n);
	for( i = 0; i < S; i++ ){ tar[i] = -1; }
	for( i = 0; i < n; i++ ){
		scanf("%c %c\n", &t, &c);
		tar[t] = c;
	}
	return n;
}

int run(){
	int i, m;
	char t;
	scanf("%d\n", &m);
	for( i = 0; i < m; i++ ){
		scanf("%c\n", &t);
		if( tar[t] == -1 ){
			printf("%c", t);
		}else{
			printf("%c", tar[t]);
		}
	}
	printf("\n");
	return 0;
}

int main(){
	while( input() ){ run(); }
	return 0;
}

Measured memory_bytes: 576
S = input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)

Measured memory_bytes: 38384
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;
//ここから

void solve(){
  string s;
  cin>>s;
  int n=s.size();
  int cnt=0,cnt2=0;
  vector<pair<int,int>>v;
  int i=0;
  while(i<n){
    while(i<n&&s[i]=='R')++cnt,++i;
    while(i<n&&s[i]=='L')++cnt2,++i;
    v.eb(cnt,cnt2);
    cnt=0,cnt2=0;
  }
  int pos=0;
  vector<int>ans(n);
  rep(i,n-1){
    if(s[i]=='R'&&s[i+1]=='L'){
      int sum=v[pos].first+v[pos].second;
      ans[i]=sum/2,ans[i+1]=sum/2;
      if(sum%2==0){++pos;continue;}
      if(v[pos].first>v[pos].second){
        if(v[pos].first%2)ans[i]++;
        else ans[i+1]++;
      }
      else {
        if(v[pos].second%2)ans[i+1]++;
        else ans[i]++;
      }
      ++pos;
    }
  }
  rep(i,n){
    if(i)cout<<" ";
    cout<<ans[i];
  }
  cout<<endl;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 1480
#include <iostream>
#include <vector>
#include <stack>
#include <limits.h>
#include <utility>


using namespace std;

struct WeightedUnionFindTree {
    vector<int> parent;
    vector<int> rank;
    vector<int> diff_weight;

    void init(int n)
    {
        for (int i = 0; i < n; ++i)
        {
            parent.push_back(i);
            diff_weight.push_back(0);
            rank.push_back(0);
        }
    }

    int root(int x)
    {
        if (parent[x] == x) return x;
        int r = root(parent[x]);
        diff_weight[x] += diff_weight[parent[x]];
        return parent[x] = r;
    }

    int weight(int x)
    {
        root(x);
        return diff_weight[x];
    }

    int diff(int x, int y)
    {
        return weight(y) - weight(x);
    }

    bool merge(int x, int y, int w)
    {
        int root_x = root(x);
        int root_y = root(y);
        if (root_x == root_y) return false;

        int root_y_weight = w - diff_weight[y] + diff_weight[x];

        if (rank[root_x] < rank[root_y]) swap(root_x, root_y), root_y_weight = -root_y_weight;

        parent[root_y] = root_x;
        diff_weight[root_y] = root_y_weight;
        if (rank[root_x] == rank[root_y]) ++rank[root_x];

        return true;
    }

    bool issame(int x, int y)
    {
        return root(x) == root(y);
    }
};

int main()
{
    int N, M;
    cin >> N >> M;

    struct WeightedUnionFindTree wuf;
    wuf.init(N);

    for (int i = 0; i < M; ++i)
    {
        int L, R, D;
        cin >> L >> R >> D;

        --L, --R;
        if (wuf.issame(L, R))
        {
            if (wuf.diff(L, R) != D)
            {
                cout << "No" << endl;
                return 0;
            }
        }
        else
        {
            wuf.merge(L, R, D);
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 1644
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;

const int N = 1e5+9;
struct vertex { vector<int> edge; };
ll n, m;
vertex g[N];
map<int, ll> dp[N]; // node=黒 to以降の塗り方

// ALL to. dp[node][to]
// return 1 + PROD(dp[node][to])
ll out(int node, int from) {
    ll res = 1;
    for(auto to : g[node].edge) {
        if(to == from)  continue;
        if(!dp[node].count(to))  dp[node][to] = out(to, node);
        res = res * dp[node][to] % m;
    }
    return (1 + res) % m;
}

// ALL from. dp[from][node]
void in(int node) {
    vector<ll> vals;
    for(auto to : g[node].edge)  vals.push_back(dp[node][to]);

    vector<ll> left{1}, right{1};
    int sz = vals.size();
    for(int i = 0; i < sz; i++) {
        left.push_back( left.back() * vals[i] % m );
        right.push_back( right.back() * vals[sz-1-i] % m );
    }
    right.pop_back();  reverse(begin(right), end(right));

    for(int i = 0; i < sz; i++) {
        int from = g[node].edge[i];
        if(dp[from].count(node))  continue;
        dp[from][node] = (left[i] * right[i] + 1) % m;
        in(from);
    }
}

int main() {
    cin >> n >> m;
    for(int i = 0; i < n-1; i++) {
        int x, y;  cin >> x >> y;
        x--;  y--;
        g[x].edge.push_back(y);
        g[y].edge.push_back(x);
    }

    out(0, -1);
    in(0);

    for(int node = 0; node < n; node++) {
        ll ans = 1;
        for(auto to : g[node].edge)  ans = ans * dp[node][to] % m;
        cout << ans << endl;
    }
}

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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

int main(){
	
	int n,t;cin >> n >> t;
	ll ans = LLINF;
	
	REP(i,n){
		ll a,b;cin >> a >> b;
		if(b <= t){
			ans = min(ans, a);
		}
	}
	
	if(ans == LLINF){
		cout << "TLE" << endl;
	}
	else{
		cout << ans << endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
#define int long long
int32_t main() 
{ 
	int h,n;
	cin>>h>>n;
	int a[n],b[n];
	for(int i=0;i<n;++i)
		cin>>a[i]>>b[i];
	int cost[h+1];
	for(int i=0;i<=h;++i)
		cost[i]=INT_MAX;
	cost[0]=0;
	for(int i=0;i<n;++i){
		for(int j=1;j<=h;++j){
			if(j<a[i]){
				cost[j]=min(cost[j],b[i]);
			}else{
				cost[j]=min(cost[j-a[i]]+b[i],cost[j]);
			}
		}
	}
	cout<<cost[h];
	return 0; 
} 


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

const int N = 100009;
int T, n, m, a[N], ans, sum, res;
char s[N];

int main() {
	scanf("%s", s + 1);
	int len = strlen(s + 1);
	if (s[1] == '0' || s[len] == '1') return puts("-1"), 0;
	for (int i = 2; i < len; ++ i) if (s[i] + s[len - i] - 96 == 1) return puts("-1"), 0;
	int root = 1;
	for (int i = 2; i <= len; ++ i) {
		printf("%d %d\n", root, i);
		if (s[i - 1] == '1') root = i;
	}
	return 0;
}


Measured memory_bytes: 3856
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <utility>

using namespace std;

#define ll long long

void solve()
{
    string S;
    cin >> S;
    string ans;
    if ("Sunny" == S)
    {
        ans = "Cloudy";
    }
    else if ("Cloudy" == S)
    {
        ans = "Rainy";
    }
    else if ("Rainy" == S)
    {
        ans = "Sunny";
    }

    cout << ans << endl;
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

struct pointtype
{
	int v,x,num;
};

const int maxn = 200010;
const int mod = 1000000007;

pointtype point[maxn];
int vrank[maxn];
int sum[maxn], f[maxn];
int l[maxn], r[maxn];

bool cmpv(pointtype x, pointtype y)
{
	return x.v < y.v;
}

bool cmpx(pointtype x, pointtype y)
{
	return x.x < y.x;
}

int main()
{
	//freopen("E.in","r",stdin);
	int n;
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d%d",&point[i].x, &point[i].v);
	sort(point+1,point+n+1,cmpx); 
	for (int i=1;i<=n;i++) point[i].num = i;
		
	sort(point+1,point+n+1,cmpv);
	for (int i=1;i<=n;i++) vrank[point[i].num] = i;
	sort(point+1,point+n+1,cmpx);
	
	//calc Ri
	int maxrank = vrank[1];
	r[1] = vrank[1];
	for (int i=2;i<=n;i++)
	{
		r[i] = (maxrank > vrank[i]) ? maxrank : vrank[i];
		maxrank = max(maxrank, vrank[i]);
	}
	
	//calc Li
	int minrank = vrank[n];
	l[n] = vrank[n];
	for (int i=n-1;i>=1;i--)
	{
		l[i] = (minrank < vrank[i]) ? minrank : vrank[i];
		minrank = min(minrank, vrank[i]);
	}
	
	sum[0] = 0;
	int ans = 0;
	for (int i=1;i<=n;i++)
	{
		if (l[i] == 1) f[i] = 1;
		int t = lower_bound(r+1,r+n+1,l[i]-1) - r;
		f[i] += (sum[i-1] - sum[t-1]) % mod; if (f[i] < 0) f[i] += (f[i]/mod+1) * mod;
		sum[i] = (sum[i-1] + f[i]) % mod;
		if (r[i] == n) ans = (ans + f[i]) % mod;
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 6528
#include <iostream>
#define MAX 100000
using namespace std;

int main() {
    int N;
    int A[MAX];
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    int ans = 1;
    int state = 0;
    for (int i = 1; i < N; i++) {
        if (A[i] > A[i-1]) {
            if (state == 0) state = 1;
            else if (state == -1) {
                ans++;
                state = 0;
            }
        }
        else if (A[i] < A[i-1]) {
            if (state == 0) state = -1;
            else if (state == 1) {
                ans++;
                state = 0;
            }
        }
    }

    cout << ans << '\n';
}


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

int main() {
  long long N; cin >> N;
  vector<long long> A(N), B(N);
  for (int i = 0; i < N; i++) cin >> A.at(N-1-i) >> B.at(N-1-i);
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      if (A.at(i) % B.at(i) != 0) ans += B.at(i) - A.at(i) % B.at(i);
    }
    else {
      long long tmp = A.at(i) + ans;
      if (tmp % B.at(i) != 0) ans += B.at(i) - tmp % B.at(i);
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(1e9 + 7)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

//////////////////////
const int N = 1005;
vector<int> primes;
void pre() {
	vector<bool> pri(N,1);

	for(int i = 4; i < N; i += 2) pri[i] = 0;

	for(int i = 3; i * i < N; i += 2) {
		if(!pri[i])
			continue;
		for(int j = i * i; j < N; j += i)
			pri[j] = 0;
	}
	repA(i,2,N-1)
		if(pri[i])
			primes.pb(i);
}

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);
	
    pre();
    int n;
    cin >> n;

    map<int,int> M;
    // db(sz(primes));
    for(int i = 2; i <= n; i++) {
    	int j = 0;
    	int num = i;
    	while(num != 1 and j != sz(primes)) {
	    	while(num % primes[j] == 0) {
	    		M[primes[j]]++;
	    		num /= primes[j];
	    	}
	    	// db2(num,j);
	    	j++;
	    }
    }

    int ans = 1;
    for(auto el : M) {
    	// db2(el.X, el.Y);
    	ans = (ans * (el.Y + 1)) % MOD;
    }
    cout << ans << '\n';
}

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

vector<int> ans(1000000);
int n;
int checked= 1;
void dfs(int i,int pre,int color,vector<vector<vector<int>>> &rel){
    if(checked== n) return ;
    for (int j = 0; j < rel[i].size(); j++)
    {
        if(rel[i][j][0] != pre){
            checked ++ ;
            if(rel[i][j][1] == 1) color = 1-color;
            ans[rel[i][j][0]] = color;
            dfs(rel[i][j][0],i,color,rel);
            if(rel[i][j][1] == 1) color = 1-color;
        }
    }
    
}


int main(){
    cin >> n;
    vector<int> u(n-1) , v(n-1), w(n-1);
    for (int i = 0; i < n-1; i++)
    {
        cin >> u[i] >> v[i] >> w[i];
    }
    vector<vector<vector<int>>> rel(n);
    for (int i = 0; i < n-1; i++)
    {
            rel[u[i]-1].push_back({v[i]-1, w[i]%2});
            rel[v[i]-1].push_back({u[i]-1, w[i]%2});
    }
    dfs(0,-1,0,rel);
    for (int i = 0; i < n; i++)
    {
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 25916
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

signed main() {
	int a,b,k;
	std::cin >> a >> b >> k;
	if(a>=k) {
		std::cout << a-k << ' ' << b << ENDL;
	} else if(a+b<k) {
		std::cout << 0 << ' ' << 0 << ENDL;
	} else {
		std::cout << 0 << ' ' << b-k+a << ENDL;
	}

	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    minus = {}
    plus = {}
    i = 0
    for n in A:
        i += 1
        if -n - i in plus:
            plus[-n - i] += 1
        else:
            plus[-n - i] = 1
        if n - i in minus:
            minus[n - i] += 1
        else:
            minus[n - i] = 1

    count = 0
    for p in plus:
        if p in minus:
            count += plus[p] * minus[p]
    print(count)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 70128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProblemC
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            var A = read[0];
            var B = read[1];
            var C = read[2];
            var D = read[3];

            var allNumsCount = B - A + 1;
            var lcm = Lcm(C, D);
            var CCount = A % C == 0 ? B / C - A / C + 1 : B / C - A / C;
            var DCount = A % D == 0 ? B / D - A / D + 1 : B / D - A / D;
            var lcmCount = A % lcm == 0 ? B / lcm - A / lcm + 1 : B / lcm - A / lcm;
            Console.WriteLine(allNumsCount - (CCount + DCount - lcmCount));
        }

        public static long Lcm(long a, long b)
        {
            return a * b / Gcd(a, b);
        }

        // ユークリッドの互除法 
        public static long Gcd(long a, long b)
        {
            if (a < b)
                // 引数を入替えて自分を呼び出す
                return Gcd(b, a);
            while (b != 0)
            {
                var remainder = a % b;
                a = b;
                b = remainder;
            }
            return a;
        }
    }
}


Measured memory_bytes: 13268
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = sc.nextInt() - (i + 1);
        Arrays.sort(a);
        int b = a[n / 2];
        long ans = 0;
        for (int i = 0; i < n; i++) {
            ans += Math.abs(a[i] - b);
        }
        System.out.println(ans);
    }
}

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

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

  int dist[20];

  dist[0] = b - a;
  dist[1] = c - a;
  dist[2] = d - a;
  dist[3] = e - a;
  dist[4] = c - b;
  dist[5] = d - b;
  dist[6] = e - b;
  dist[7] = d - c;
  dist[8] = e - c;
  dist[9] = e - d;

  bool can = true;
  for (int i = 1; i <= 9; i++) {
    if (dist[i] > k) {
      can = false;
    }
  }

  if (can) {
    cout << "Yay!" << endl;
  } else {
    cout << ":(" << endl;
  }
}

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

//using namespace boost::multiprecision;
using namespace std;
typedef long long ll;
//typedef unsigned long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
typedef pair<int, int> P;
//typedef pair<ll, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = (1ll << 31) - 1;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
//typedef pair<int, int> P;
//typedef pair<double, double> P;
#define ret() return 0;

bool contain(set<char> &s, char a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
const int mod = 1000000007;
//const ll mod = 1e10;
typedef priority_queue<long long, vector<long long>, greater<long long> > PQ_ASK;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}

    mint &operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }

    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }

    mint &operator/=(const mint a) {
        return (*this) *= a.inv();
    }

    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }

    friend std::istream &operator>>(std::istream &in, mint &o) {
        ll a;
        in >> a;
        o = a;
        return in;
    }

    friend std::ostream &operator<<(std::ostream &out, const mint &o) {
        out << o.x;
        return out;
    }

};


int main() {

    int n, m;
    cin >> n >> m;

    vector<mint> stairs(n + 1, 0);
    vector<bool> broken(n + 1, false);


    rep(i, m) {
        int a;
        cin >> a;
        broken[a] = true;
    }
    stairs[0] = 1;

    rep(i, n) {
        if (broken[i]) {
            continue;
        }
        if (!broken[i + 1]) stairs[i + 1] += stairs[i];
        if (i != n - 1 && !broken[i + 2]) stairs[i + 2] += stairs[i];


    }

    cout << stairs.back() << endl;

}



Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
int k, n;
int h[200010];

int main()
{
	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++)
		scanf("%d", &h[i]);
	std::sort(h + 1, h + 1 + n);
	long long ans = 0;
	for (int i = 1; i <= n - k; i++)
	{
		ans += h[i];
	}
	printf("%lld\n", ans);
	return 0;
}

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

#define ll long long
#define vi vector<int>
#define vl vector<long long>
#define pr(a, b) pair<a, b>
#define si set<int>
#define sl set<long long>
#define pq prioirty_queue
#define all(v) v.begin(),v.end()
#define left (2*idx)+1
#define right (2*idx)+2
#define frt(i,a,b) for(ll i=a; i<b; i++)
#define rew(i,a,b) for(ll i=a; i>=b; i--)
#define fre(i,a,b) for(ll i=a; i<=b; i++)
#define pb push_back

#define test if(!true)
#define N 100007
#define MOD (ll)(1e9 + 7)


int main()
{

    int n, x;
    cin >> n >> x;

    int a[n];
    int cnt = 01;

    frt(i, 0, n)
    {
        cin >> a[i];
    }

    int cur = 0;
    frt(i, 0, n)
    {
        cur+=a[i];
        if(cur <= x)
        {
            cnt+=1;
        }
        else
        {
            break;
        }
    }
    cout << cnt << "\n";
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, const char * argv[]) {
    int a,b,c,k;
    cin >> a >> b >> c;
    cin >> k;
    if(a >= b && a >= c){
        a = a * pow(2, k);
    }else if(b >= a && b >= c){
        b = b * pow(2, k);
    }else if(c >= a && c >= b){
        c = c * pow(2, k);
    }
    int ans = a + b + c;
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <iterator>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <random>
#include <cassert>
#include <limits>

using namespace std;

#define mp make_pair
#define pb push_back
#define repi(i, p, q) for (long i = p; i < q; i++)
#define repd(i, p, q) for (long i = p; i >= q; i--)
#define sz(x) x.size()
#define INF 2000000000
#define MOD 1000000007

typedef map<int, int> MI;
typedef pair<int, int> PI;
typedef long long int LLI;
typedef long int LI;
typedef int I;

int main()
{
    int n;
    cin >> n;
    if(n == 1) {
        cout << "Hello World";
    } else{
        int a,b;
        cin >> a >> b;
        cout << a+b;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  unsigned long x;
  cin >> x;

  unsigned long rot = 0UL;
  rot = (x/11UL)*2UL;
  if(0UL < x%11UL){
    if(x%11UL <= 6UL) {
      rot += 1UL;
    } else {
      rot += 2UL;
    }
  }
  cout << rot << endl;
  return 0;
}



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

int main(void){
    int n, d, x;
    cin >> n >> d >> x;
    vector<int> A(n);
    int Day =0;
    for (int i = 0; i < n; i++){
        cin >> A.at(i);
        if(d%A.at(i) !=0){
             Day += (d / A.at(i))+1;
        }
        else  Day += d/A.at(i);
    }
    cout << Day + x  << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef struct point
{
	int x,y,color;
}POINT,*PPOINT;
POINT arr[200];
bool mycmpwithx(const POINT & a,const POINT & b)
{
	return a.x<b.x;
}
bool mycmpwithy(const POINT & a,const POINT & b)
{
	return a.y<b.y;
}
vector<POINT> vec;
int main()
{
	int n,i,ans=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %d",&arr[i].x,&arr[i].y);
		arr[i].color=0;
	}
	for(i=n;i<2*n;i++)
	{
		scanf("%d %d",&arr[i].x,&arr[i].y);
		arr[i].color=1;
	}
	sort(arr,arr+2*n,mycmpwithx);
	for(i=0;i<2*n;i++)
	{
		if(arr[i].color==0)
		{
			vec.insert(lower_bound(vec.begin(),vec.end(),arr[i],mycmpwithy),arr[i]);
		}
		else
		{
			if(vec.empty())
				continue;
			vector<POINT>::iterator it;
			it= lower_bound(vec.begin(),vec.end(),arr[i],mycmpwithy);
			if(it!=vec.begin())
			{
				ans++;
				vec.erase(--it);
			}
		}
	}
	printf("%d",ans);
	return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

template<typename T> vector<T> make_vector(size_t sz){
	return vector<T>(sz);
}

template<typename T,typename... Ts> 
auto make_vector(size_t sz, Ts... ts){
	return vector<decltype(make_vector<T>(ts...))>(sz, make_vector<T>(ts...));
}

template<typename T,typename U,typename... V> 
typename enable_if<is_same<T, U>::value!=0>::type 
fill_value(U &u, const V... v){
	u=U(v...);
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_value(U &u, const V... v){
	for(auto &e:u){
		fill_value<T>(e,v...);
	}
}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void){
	string s;
	cin >> s;
	cout << s.substr(0, 3) << endl;
	return 0;
}

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

int main(){

	int i,n;
	cin >> n;
	int m, M;
	long int S = 0;

	for (i = 0; i < n; i++){
		int a;
		cin >>a;
		if (a < m || i == 0)
			m = a;
		if (a > M || i == 0)
			M = a;

		S = S + a;
	}

	cout << m << " " << M << " " << S << endl;
	return 0;

}


Measured memory_bytes: 3120
#include <stdio.h>

int a,b,c,max ;

int main(void){

    scanf ("%d%d%d",&a,&b,&c) ;
    
    if ( max<a ){
        max = a ;
    }
    if ( max<b ){
        max = b ;
    }
    if ( max<c ){
        max = c ;
    }
    
    printf ("%d",a+b+c-max) ;
    
    return 0 ;
    
}

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

double kata(double x, double y, double xx, double yy)
{
	return (yy-y)/(xx-x);
}

int main()
{
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		double x1,y1,x2,y2,x3,y3,x4,y4;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		if(kata(x1,y1,x2,y2)==kata(x3,y3,x4,y4))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

using namespace std;

#define REP(i,m) for(int i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000001
#define INFL (1LL << 60)
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main() {
  cout << fixed << setprecision(16);
  int n;
  cin >> n;
  int r[n] = { }, l[n] = { };
  REP(i, n){
    int x;
    cin >> x;
    r[i] = l[i] + 2*x;
    if(i != n-1) l[i+1] = r[i];
  }
  int v[n];
  REP(i, n){
    cin >> v[i];
  }
  int vt[r[n-1]+1];
  REP(i, r[n-1]+1) vt[i] = min(i, r[n-1]-i);
  REP(i, n){
    REP(j, r[n-1]+1){
      if(j < l[i]) vt[j] = min(vt[j], 2*v[i]+l[i]-j);
      else if(j < r[i]) vt[j] = min(vt[j], 2*v[i]);
      else vt[j] = min(vt[j], 2*v[i]+j-r[i]);
    }
  }
  double ans = 0;
  REP(i, r[n-1]) ans += vt[i] + vt[i+1];
  cout << ans/8.0 << endl;
  return 0;
}


Measured memory_bytes: 384
#include <algorithm>
#include <iostream>
#include <cstdio>
#define N 200005
using namespace std;
const int Mod = 1e9 + 7;

inline int fsp(int x, int p = Mod - 2) {
    int res = 1;
    while (p) {
        if (p & 1) res = 1LL * res * x % Mod;
        x = 1LL * x * x % Mod;
        p >>= 1;
    }
    return res;
}

int fac[N], ifac[N];

inline int Calc(int n, int m) {
    return n < m || m < 0 ? 0 : 1LL * fac[n] * ifac[n - m] % Mod * ifac[m] % Mod;
}

int main() {
#ifdef whyqx
    freopen("work.in", "r", stdin);
    freopen("work.out", "w", stdout);
#endif
    int n, A, B, C;
    cin >> n >> A >> B >> C;
    int a = 1LL * A * fsp(100 - C) % Mod;
    int b = 1LL * B * fsp(100 - C) % Mod;
    int t = 100LL * fsp(100 - C) % Mod;
    fac[0] = ifac[0] = 1;
    for (int i = 1; i <= n << 1; ++i)
        fac[i] = 1LL * fac[i - 1] * i % Mod,
        ifac[i] = fsp(fac[i]);
    int ans = 0;
    for (int m = n; m < n << 1; ++m) {
        int tmp = 1LL * fsp(a, n) * fsp(b, m - n) % Mod;
        (tmp += 1LL * fsp(a, m - n) * fsp(b, n) % Mod) %= Mod;
        (ans += 1LL * Calc(m - 1, m - n) * tmp % Mod * m % Mod * t % Mod) %= Mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
import sys
import numpy as np

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

C = [rs() for _ in range(3)]
answer = C[0][0] + C[1][1] + C[2][2]
print(answer)


Measured memory_bytes: 18680
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <chrono>
 
using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T>inline bool chmax(T &a, T b){return (a < b ? a = b, true : false);}
template<typename T>inline bool chmin(T &a, T b){return (a > b ? a = b, true : false);}
 
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const long double EPS = 1e-9;
 
LL N;
 
int f(LL a, LL b) {
	int ca = 0, cb = 0;
	do {
		++ca;
	} while (a /= 10);
	do {
		++cb;
	} while (b /= 10);
	return max(ca, cb);
}
 
int main() {
	cin >> N;
	int ans = INF;
	for (LL i = 1; i * i <= N; ++i) {
		if (N % i == 0) {
			chmin<int>(ans, max(to_string(N / i).size(), to_string(i).size()));
		}
	}
	cout << ans << endl;
}

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

class Main{
    public static void main(String[] args){
	BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
	try {
	    String st;
	    while((st=sc.readLine())!=null){
		String[] sp = sc.readLine().split(" ");
		int[] ans = new int[sp.length];
		for(int i=0; i<sp.length; i++)
		    ans[i] = Integer.valueOf(sp[i]);
		Arrays.sort(ans);
		int sumnow = 0, sum = 0;
		for(int i : ans){
		    sumnow+=i;
		    sum+=sumnow;
		}
		System.out.println(sum);
	    }
	}catch(Exception e){
	    System.out.println("Error");
	}
    }
}

Measured memory_bytes: 22932