akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	read(n);
	pi a[n + 1];
	FOR (i, 1, n) {read(x); a[i] = {x, i};}
    sort (a + 1, a + n + 1, greater<pi>());
    
    int dp[n + 1][n + 1] = {}, ans = 0;
    FOR (i, 1, n)
        FOR (j, 0, i)
        {
            if (j && a[i].se >= j) dp[i][j] = dp[i - 1][j - 1] + a[i].fi*(a[i].se - j);
            if (j < i && a[i].se <= n+1-i+j) dp[i][j] = max(dp[i][j], dp[i - 1][j] + a[i].fi*((n+1-i+j) - a[i].se));
            if (i == n) ans = max(ans, dp[i][j]);
        }
        
    cout << ans;
}









Measured memory_bytes: 34980
use std::io;
use std::collections::HashMap;

fn read_line() -> String {
    let mut line = String::new();

    io::stdin().read_line(&mut line)
        .expect("Failed to read line");
    return line;
}
fn to_i(s: &str) -> i64 {
    return s.trim().parse()
        .expect("Please type a number!");
}
fn read_nums() -> Vec<i64>
{
    let line = read_line();
    let items: Vec<&str> = line.split(' ').collect();

    let mut nums: Vec<i64> = Vec::new();

    for item in items {
        nums.push(to_i(item));
    }
    return nums;
}


fn main() {
    //println!("start");
    let l = read_line();
    let s = l.trim();

    // println!("{}:{}",l,s);

    
    let mut i = 0;
    let mut good = true;
    for c in s.chars() {
        // println!("{}:{}",i,c);
        if i%2==0 {
            good = c=='R' || c == 'U' || c=='D';
        }else {
            good = c=='L' || c == 'U' || c=='D';
        }
        if good == false {
            break;
        }
        i+=1;
    }
    // println!("{}", s);
    if good {
        print!("Yes");
    } else {
        print!("No");
    }
    
    
    
    
}   

Measured memory_bytes: 4352
/*
ID: tohoast1
TASK: gymnastics
LANG: C++
*/
#include <bits/stdc++.h>
#define speedup ios_base::sync_with_stdio(NULL)
#define fin freopen("gymnastics.in", "r", stdin)
#define fout freopen("gymnastics.out", "w", stdout)
#define FILENAME
#define PUBG push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define cls clear
#define INF const int ci = 1e6 + 100
#define K_INF 1e9 + 7
#define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define MIN_INT -999999999
#define MOD 1000000007
#define d109 1000000000

using namespace std;
typedef long long LL;
typedef long L;
typedef unsigned long long ULL;
typedef unsigned long UL;
typedef string STR;
double n, k, abd;

int main() {
    #ifdef FILENAMEs
        fin;
        fout;
    #endif // FILENAME
    cin >> n >> k;
    if (round(n / 2) >= k) cout << "YES";
    else cout << "NO";
    ///time;
    return 0;
}


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

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

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

  ll ans = 1;

  set<ll> res;
  for (ll i = 1; i * i <= m; ++i) {
    if (m % i == 0) {
      res.insert(i);
      res.insert(m / i);
    }
  }

  for (auto a : res)
    if (a * n <= m) ans = max(ans, a);

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


Measured memory_bytes: 256
X,Y,A,B,C=map(int,input().split())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))
R=list(map(int,input().split()))

P.sort(reverse=1)
Q.sort(reverse=1)
R.sort(reverse=1)

R0=P[:X]
R0.extend(Q[:Y])
R0.sort()
for i in range(C):
    if R0[i]<R[i]:
        R0[i]=R[i]
    else:
        break
print(sum(R0))

Measured memory_bytes: 22720
S = input()
lead = int(S[:2])
back = int(S[2:])
answer = ""
if(lead > 12 and back <= 12 and back != 0 or lead == 0 and back <= 12 and back != 0):
    answer = "YYMM"
elif(back > 12 and lead <= 12 and lead != 0 or back == 0 and lead <= 12 and lead != 0):
    answer = "MMYY"
elif(back >= 1 and back <= 12 and lead >= 1 and lead <= 12):
    answer = "AMBIGUOUS"
else:
    answer = "NA"
print(answer)

Measured memory_bytes: 3064
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
using namespace std;
typedef pair<int,int> p;
typedef pair<int,p> P;
typedef pair<p,p> p2;
#define pu push
#define pb push_back
#define mp make_pair
#define INF 100000000
int value[2001];
int jan[2001];
vector<int>vec[11];
vector<int>rui[11];
int dp[2005]={};
int main(){
	int n;
	int k;
	scanf("%d %d",&n,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&value[i]);
		scanf("%d",&jan[i]);
	}
	for(int i=0;i<n;i++){
		vec[jan[i]-1].pb(value[i]);
	}
	for(int i=0;i<10;i++){
		sort(vec[i].begin(),vec[i].end(),greater<int>());
	}
	for(int i=0;i<10;i++){
		rui[i]=vector<int>(vec[i].size());
		if(vec[i].size()>0){
			int rp=vec[i].size();
			rui[i][0]=vec[i][0];
			for(int w=1;w<rp;w++){
				rui[i][w]=rui[i][w-1]+vec[i][w]+2*w;
			}
			for(int w=k;w>=0;w--){
				for(int l=0;l<min(w,rp);l++){
					dp[w]=max(dp[w],dp[w-l-1]+rui[i][l]);
				}
			}
		}
	}
	printf("%d\n",dp[k]);
	return  0;
}

Measured memory_bytes: 1264
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pr(a) cout << (a) << endl
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> P;
const int MAX=2000000001;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main() {
  int n,m;
  while(cin >> n >> m && (n||m)) {
    int dp[n+1][m+m];
    memset(dp,0,sizeof(dp));
    int k;
    cin >> k;
    rep(i,k) {
      int x,y;
      cin >> x >> y;
      dp[x][y]=-1;
    }
    dp[1][1]=1;
    for(int i=1; i<=n; i++) {
      for(int j=1; j<=m; j++) {
	if(dp[i][j]==-1) continue;
	if(dp[i-1][j]!=-1) dp[i][j]+=dp[i-1][j];
	if(dp[i][j-1]!=-1) dp[i][j]+=dp[i][j-1];
      }
    }
    pr(dp[n][m]);
  }
  return 0;
}


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

int main() {

  int a, b;
  cin >> a >> b;
  
  if(a > 12)
    cout << b << endl;
  else if(a > 5)
    cout << b / 2 << endl;
  else
    cout << 0 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
const ll mod =1000000007;
#define rep(i,n) for(ll i=0; i<n; i++)
int main(){
    ll x;
    cin>>x;
    ll y=0;
    ll tmp=100;
    while(tmp<x){
        tmp *= 1.01;
        y++;
    }
    cout<<y<<endl;
}

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

using namespace std;

int n;

void edge(int x, int y)
{
    cout << x << ' ' << y << '\n';
}

int main()
{
 //   freopen("input", "r", stdin);
    cin.sync_with_stdio(false); cin.tie(0);

    int i;
    cin >> n;

    if((n & (-n)) == n)
    {
        cout << "No\n";
        return 0;
    }

    cout << "Yes\n";

    int x = -1, y = -1;

    if(n % 2 == 0)
    {
        x = (n & (-n));
        y = n ^ x; /// trebuie neaparat sa fie alaturate

        edge(n + y, n + (y^1));
        edge(n + (y^1), n + (x ^ 1));
        edge(n + (x ^ 1), n + x);
        edge(n + x, 1);
        edge(1, x^1);
        edge(x^1, x);
        edge(x, y);
        edge(y, y^1);
        edge(n, x);
        edge(2*n, y);
        edge(x, n+1);

        for(i=2; i<n; i += 2)
            if(i != x && i != y && i != (x ^ 1) && i != (y^1))
            {
                edge(n+(i^1), n+i);
                edge(n+i, 1);
                edge(1, i^1);
                edge(i^1, i);
            }
    }
    else
    {
        for(i=2; i<n; i += 2)
        {
                edge(n+(i^1), n+i);
                edge(n+i, 1);
                edge(1, i^1);
                edge(i^1, i);
        }
        edge(n+1, 2);
    }

    return 0;
}


Measured memory_bytes: 2304
#include <iostream>
using namespace std;
int a[30], b[220];
int n, q;
int dp[30][2000];
// 选择第i个元素之后的一个可以组成和为m 
//bool solve(int i, int m)
//{
//	if(m == 0)	return true;
//	if(i >= n)	return false;
//	
//	return solve(i + 1, m) || solve(i + 1, m - a[i]);
//}
bool solve(int i, int m)
{
	if(m == 0)	
		dp[i][m] = true;
	else if(i >= n)	
		dp[i][m] = false;
	else if(solve(i + 1, m))
		dp[i][m] = true;
	else if(solve(i + 1, m - a[i]))
		dp[i][m] = true;
	else
		dp[i][m] = false;
	
	return dp[i][m];	
}
int main()
{
	cin >> n;
	for(int i = 0; i < n; ++ i)
		cin >> a[i];
	cin >> q;
	for(int i = 0; i < q; ++ i)
	{
		cin >> b[i];
		if(solve(0, b[i]))	cout << "yes" << endl;
		else	cout << "no" << endl;
	}
	
	return 0;
}


Measured memory_bytes: 3208
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
  char board;
  int H, W;
  int count = 0;
  cin >> H >> W;

  while (cin >> board) {
    if (board == '#') count++;
  }
  if (count == H + W - 1) printf("Possible");
  else printf("Impossible");
}

Measured memory_bytes: 256
from heapq import heappop, heappush

k = int(input())
ten = [[0,1]] + [[i-1, i, i+1] for i in range(1,9)] + [[8,9]]

cnt = 0
heap = []
for i in range(1, 10):
    heappush(heap, [i, i])

memo = set()
while heap or cnt < 20:
    num,pre = heappop(heap)
    if num in memo or num < 1:
        continue
    else:
        memo.add(num)
    cnt += 1
    # print(num,pre)
    if cnt >= k:
        print(num)
        break
    for i in ten[pre]:
        heappush(heap, [num*10+i, i])


Measured memory_bytes: 37608
use proconio::input;

fn main() {
    input!(n: usize, a: [i64; n]);
    let mut b = vec![0; n + 1];
    a.iter().enumerate().for_each(|(i, &x)| b[i + 1] = b[i] + x);
    let fold = |l: usize, r: usize| -> i64 { b[r] - b[l] };
    let cal = |i: usize, j: usize, k: usize| -> Option<i64> {
        assert!(i <= j && j <= k && k <= n);
        if 0 == i || i == j || j == k || k == n {
            None
        } else {
            let c = vec![fold(0, i), fold(i, j), fold(j, k), fold(k, n)];
            Some(c.iter().max().unwrap() - c.iter().min().unwrap())
        }
    };
    let mut ans = std::i64::MAX;
    let mut i = 1;
    let mut k = 3;
    for j in 2..=n - 2 {
        while i < j && fold(0, i) < fold(i, j) {
            i += 1;
        }
        while j == k || fold(j, k) < fold(k, n) {
            k += 1;
        }
        for di in 0..2 {
            for dk in 0..2 {
                if let Some(x) = cal(i - di, j, k - dk) {
                    if x < ans {
                        ans = x;
                    }
                }
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 6500
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int A = sc.nextInt();
       if(H%A ==0){
       int x = H/A;
       System.out.println(x);
       }else{
       int x = H/A+1;
       System.out.println(x);
       }
	}
}

Measured memory_bytes: 22228
import java.util.Scanner;

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

  public void run() {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int[] dm = new int[3]; // 1, 10, 100の位を格納
    for (int i = 0; i < 3; i++) {
      dm[i] = -1;
    }
    for (int i = 0; i < m; i++) {
      int s = sc.nextInt();
      int c = sc.nextInt();
      if (dm[n - s] == -1) {
        dm[n - s] = c;
      } else if (dm[n - s] == c) {
        //
      } else {
        System.out.println(-1);
        return;
      }
    }
    for (int i = 0; i < 3; i++) {
      if (i == n - 1 && dm[i] == -1) {
        if (n == 1 && i == 0) {
          dm[i] = 0;
        } else {
          dm[i] = 1;
        }
      } else if (dm[i] == -1) {
        dm[i] = 0;
      }
    }
    int result = dm[2] * 100 + dm[1] * 10 + dm[0];
    if (result == 0 && n != 1) {
      System.out.println(-1);
    } else {
      System.out.println(result);
    }
  }
}

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

using namespace std;

int main() {
    long long n;
    long long x,l;
    cin>>n;
    pair<long long,long long> v[n];
    for (long long i=0;i<n;i++) {
        cin >> x >> l;
        v[i].first=x+l;
        v[i].second=x-l+1;
    }
    sort(v,v+n);
    long long count=0;
    long long cur_min=-1000000000000;
    for (long long i=0;i<n;i++){
        if (v[i].second>cur_min) {
            count++;
            cur_min=v[i].first;
        }
    }
    cout<<count;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
    ll n;
    cin>>n;
    vector<ll> a(n),b(n),c(n);
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++)cin>>b[i];
    for(int i=0;i<n-1;i++)cin>>c[i];
    ll res = b[n-1];
    for(int i=0;i<n-1;i++){
	if(a[i]+1 == a[i+1]){
	   // cout<<i<<endl;
	    res += c[a[i]-1];
	}
	res += b[i];
    }
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define fio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;

//range ADD update, point VAL query
template <class T>
struct segt {
	int N;
	vector<T> t;
	segt(){}
	segt(int N):N(N),t(2*N){}

	constexpr static T NONE = 0;

	//add val to [l,r]
	inline void update(int l, int r, T val) {
		for(l+=N,r+=N+1;l<r;l>>=1,r>>=1) {
			if(l&1) t[l++] += val;
			if(r&1) t[--r] += val;
		}
	}

	//query point i
	inline T query(int i) const {
		T ans = NONE;
		for(i+=N;i;i>>=1) ans += t[i];
		return ans;
	}
};

const int N = 1e5+5;
int a[N]={},mx[N]={},n;
ll add[N]={}, ans[N];
vector<int> ind;
segt<ll> S;

int main() {	
	scanf("%d",&n);
	for(int i = 1; i <= n; ++i)
		scanf("%d",a+i);
	for(int i = 1; i <= n; ++i)
		mx[i] = (a[mx[i-1]]>=a[i])?mx[i-1]:i;
	int c = n+1;
	while(c) {
		c = mx[c-1];
		ind.push_back(c);
	}
	reverse(ind.begin(),ind.end());
	S = segt<ll>(ind.size());
	for(int i = n; i; --i) {
		int lo = 0, hi = ind.size();
		while(hi-lo > 1) {
			int md = (lo+hi)/2;
			if(ind[md] < i && a[i] > a[ind[md]]) lo = md;
			else hi = md;
		}
		add[lo+1] += a[i] - a[ind[lo]];
		S.update(0,lo,1);
	}
	ind.pb(ind.back());
	for(int i = 1; i < ind.size()-1; ++i)
		ans[ind[i]] = S.query(i) * (a[ind[i]] - a[ind[i-1]]) + add[i];
	for(int i = 1; i <= n; ++i)
		printf("%lld\n",ans[i]);
}

Measured memory_bytes: 5496
package main

import (
	"fmt"
	"math"
)

func main() {
	var a1, a2, a3 float64
	var sl []int
	fmt.Scan(&a1, &a2, &a3)

	sl = append(sl, int(math.Abs(a1-a2) + math.Abs(a2-a3)))
	sl = append(sl, int(math.Abs(a2-a3) + math.Abs(a3-a1)))
	sl = append(sl, int(math.Abs(a3-a1) + math.Abs(a1-a2)))

	min := 300
	for _, v := range sl{
		if v < min {
			min = v
		}
	}
	fmt.Println(min)
}


Measured memory_bytes: 512
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int b = scan.nextInt();
      	int n = a + b;
      	int m = a + a - 1;
      	int o = b + b - 1;
      	int ans = n;
      	if(n < m){
        	ans = m;
			if(m < o){
            	ans = o;
            }
        }
      	else {
        	if(n < o){
            	ans = o;
            }
        }
      	System.out.print(ans);
    
    }
 
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back
#define M 1000000007
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const int N = 1e6 + 1;
int n;
ll fp(ll a , ll b){
	ll ret = 1;
	while(b){
		if(b&1) ret = (a * ret)%M;
		a = (a*a)%M;
		b >>= 1;
	}
	return ret;
}
int main(){	
	cin >> n;
	cout << (fp(10 , n) - 2*fp(9 , n) + fp(8 , n) + 2*M)%M<< endl;
	
		
}	

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

ll l1[10];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,b,c,d,x=0,y=0,x2=0,y2=0;
    string s;
    cin>>s;
    a=s[0]-'0';
    b=s[1]-'0';
    c=s[2]-'0';
    d=s[3]-'0';
    if(a+b+c+d==7){
        cout<<a;cout<<"+";
        cout<<b;cout<<"+";
        cout<<c;cout<<"+";
        cout<<d;cout<<"=7";
    }
    else if(a+b+c-d==7){
        cout<<a;cout<<"+";
        cout<<b;cout<<"+";
        cout<<c;cout<<"-";
        cout<<d;cout<<"=7";
    }
    else if(a+b-c+d==7){
        cout<<a;cout<<"+";
        cout<<b;cout<<"-";
        cout<<c;cout<<"+";
        cout<<d;cout<<"=7";
    }
    else if(a-b+c+d==7){
        cout<<a;cout<<"-";
        cout<<b;cout<<"+";
        cout<<c;cout<<"+";
        cout<<d;cout<<"=7";
    }
    else if(a+b-c-d==7){
        cout<<a;cout<<"+";
        cout<<b;cout<<"-";
        cout<<c;cout<<"-";
        cout<<d;cout<<"=7";
    }
    else if(a-b+c-d==7){
        cout<<a;cout<<"-";
        cout<<b;cout<<"+";
        cout<<c;cout<<"-";
        cout<<d;cout<<"=7";
    }
    else if(a-b-c+d==7){
        cout<<a;cout<<"-";
        cout<<b;cout<<"-";
        cout<<c;cout<<"+";
        cout<<d;cout<<"=7";
    }
    else if(a-b-c-d==7){
        cout<<a;cout<<"-";
        cout<<b;cout<<"-";
        cout<<c;cout<<"-";
        cout<<d;cout<<"=7";
    }
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;

#define PI acos(-1)
typedef long long ll;
#define INF 0x3f3f3f3f
int mod = 1000000007;
char num[5];
int main()
{
	//freopen("in.txt", "r", stdin);
	 int n;
	 while (~scanf("%s", num))
	 {
	 	for (int i = 0; i < 8; i++)
	 	{
	 		int tmp[4];
	 		for (int j = 0; j < 4; j++)
	 			tmp[j] = num[j] - '0';
	 		int pre = tmp[0];
	 		for (int j = 0; j < 3; j++)
	 		{
	 			if ((1<<j)&i)
	 			{
	 				pre += tmp[j+1];
	 			}else
	 			{
	 				pre -= tmp[j+1];
	 			}
	 		}
	 		if (pre == 7)
	 		{
	 			printf("%d", tmp[0]);
	 			for (int j = 0; j < 3; j++)
	 			{
	 				if ((1<<j)&i)
	 					putchar('+');
	 				else
	 					putchar('-');
	 				printf("%d", tmp[j+1]);
	 			}
	 			puts("=7");
	 			break;
	 		}

	 	}
	 }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <utility>
#include <queue>
using namespace std;
//#define local
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
#endif
    long long a,b,x;
    cin>>a>>b>>x;
    if(a) cout<<b/x-(a-1)/x<<endl;
    else cout<<b/x+1<<endl;
    return 0;
}


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

int main() {
	int A, B, C, X;
	cin >> A >> B >> C >> X;
	int S = 0;
	int ans = 0;

	for (int i = 0; i < A+1; i++) {
		for (int j = 0; j < B+1; j++) {
			for (int k = 0; k < C+1; k++) {
				S = 500 * i + 100 * j + 50 * k;
				if (S == X) ans += 1;
			}
		}
	}

	cout << ans << endl;

}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
/////////////////// TYPES & MACROS ///////////////////////////////
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define vv vector
#define exist(s,e) (s.find(e)!=s.end())
#define sz(x) ((int)(x).size())
#define int ll
typedef long long ll; typedef long double ld; typedef double dd;typedef vector<int> vi; typedef pair<int, int> pii;typedef pair<ll,ll> pll;
ll INFLL=(ll)4e18, MOD=1e9+7; const int INF=0x3f6f6f6f;
//////////////////// DEBUG /////////////////////////////////////////
#define D(x) cerr<<#x<<" is:\t"<<x<<'\n';
#define DD(x,y) cerr<<'('<<#x<<','<<#y<<") are:\t"<<x<<' '<<y<<'\n';
#define DDD(x,y,z) cerr<<'('<<#x<<','<<#y<<','<<#z<<") are:\t"<<x<<' '<<y<<' '<<z<<'\n';
/////////////////// VARIABLES & FUNCTIONS//////////////////////////
vv<vv<int>> adj; vi vis, color, level; int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1},dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};
inline ll mexp(ll x,ll n,ll m=MOD){ll res=1;x%=m;while(n){if(n&1)res=(res*x)%m;n>>=1;x=(x*x)%m;}return res;}
inline ll gcd(ll a, ll b){while (a>0 && b>0){if(a>b)a%=b;else b%=a;}return a+b;}



///////////////////// MAIN STARTS //////////////////////////////////
int32_t main(void){
ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
cout<<fixed;cerr<<fixed; cout<<setprecision(1); cerr<<setprecision(3);
mt19937 genr(chrono::high_resolution_clock::now().time_since_epoch().count());


ll n,w; cin>>n>>w;
const int N=1e5;
vv<ll> dp(N+1, INFLL);
dp[0]=0;
for(int i=0;i<n;++i){
    ll wt,val; cin>>wt>>val;
    for(int j = N-val;j >= 0;j--){
        dp[j+val]=min(dp[j+val], dp[j]+wt);
    }
}
ll ans=0;
for(int i=0;i<=N;++i){
    if(dp[i]<=w) ans=i;
}
cout<< ans <<'\n'; 

return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <utility>
#include <fstream>

using namespace std;
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); } return a; }
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353;
constexpr int MAX = 5000000;

int main()
{

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	ll n, m; cin >> n >> m;
	vector<ll> a(n); for (int i = 0; i < n; i++) cin >> a[i];

	for (int i = 0; i < n; i++) a[i] /= 2;
	while (1) {
		int e = 0, o = 0;
		for (int i = 0; i < n; i++) {
			if (a[i] % 2 == 0) e++;
			else o++;
		}
		if (e > 0 and o > 0) {
			cout << 0 << endl;
			return 0;
		}
		if (e == 0) break;
		m /= 2;
		for (int i = 0; i < n; i++) {
			a[i] /= 2;
		}
	}
	ll lc = 1;
	for (int i = 0; i < n; i++) {
		lc = lcm(lc, a[i]);
		if (lc > m) {
			cout << 0 << endl;
			return 0;
		}
	}
	ll cnt = m / lc;
	cout << (cnt + 1) / 2 << endl;
	return 0;
}

Measured memory_bytes: 3968
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var n2 = int.Parse(line[1]);
        var q = new int[n, n2];
        var p = new int[n];
        var p2 = new int[n];
        for (int i = 0; i < n2; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var c = int.Parse(line[0]);
            var c2 = int.Parse(line[1]);
            if (c == 0) q[c2, p2[c2]++] = int.Parse(line[2]);
            else if (p[c2] < p2[c2] && c == 1) Console.WriteLine(q[c2, p[c2]]);
            else if (p[c2] < p2[c2]) p[c2]++;
        }
    }
}



Measured memory_bytes: 845148
def count_diff(q,a):
    lst_q = list(q)
    lst_a = list(a)
    len_q = len(lst_q)
    ng = 0
    for i in range(len_q):
        if lst_q[i] != lst_a[i]:
            ng += 1
    print(ng)

q = input()
a = input()


count_diff(q,a)


Measured memory_bytes: 12576
import sys
input = sys.stdin.readline

H,W = list(map(int,input().split()))
cell = []
for i in range(H):
    s = list(input().rstrip())
    cell.append(s)
for ih in range(H):
    for iw in range(W):
        if cell[ih][iw] == '.':
            ans =0
            for iih in range(max(0,ih-1),min(ih+2,H)):
                for iiw in range(max(0,iw-1),min(iw+2,W)):
                    if cell[iih][iiw]=='#':
                        ans+=1
            cell[ih][iw] = ans
for i in range(H):
    for j in range(W):
        print(cell[i][j],end='')
    print('')

Measured memory_bytes: 9264
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

int main()
{
  ll n, m, ans;
  cin >> n >> m;
  if (n == 1 && m == 1) ans = 1;
  else if (n == 1) ans = m - 2;
  else if (m == 1) ans = n - 2;
  else ans = (n - 2) * (m - 2);
  cout << ans << endl;
}


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

int main(){
    string S,T;
    cin >> S >> T;
    int cnt = 0;
    for(int i=0;i<S.size();i++){
        if(S[i] != T[i])cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3800
#include <iostream>
int main(void)
{
    int array[3] = {};
    int min = 0;
    int input;
    for(int i=0;i < 10;++i){
        std::cin >> input;
        if(i >= 3){
            if(array[min] < input){
                array[min] = input;
            }
            else{
                continue;
            }
        }
        else{
            array[i] = input;
        }
        min = array[0] < array[1] ? (array[0] < array[2] ? 0 : 2) : (array[1] < array[2] ? 1 : 2);
    }
    int max = array[0] > array[1] ? (array[0] > array[2] ? 0 : 2) : (array[1] > array[2] ? 1 : 2);
    std::cout << array[max] << std::endl;
    std::cout << array[3 - max - min] << std::endl;
    std::cout << array[min] << std::endl;
    return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
int main()
{
	int A,B;
	scanf("%d%d",&A,&B);
	if(A!=1&&B!=1)
	{
		if(A>B)
			printf("Alice\n");
			else if(A==B)
				printf("Draw\n");
				else
					printf("Bob\n");
	}
	if(A==1&&B!=1)
	{
		printf("Alice\n");
	}
	if(A!=1&&B==1)
	{
		printf("Bob\n");
	}
	if(A==1&&B==1)
	{
		printf("Draw\n");
	}
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
#define double long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define ms(v,x) memset(v,x,sizeof(v))
#define pii pair<int,int>
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define rep(i,j,k) for(int i=j;i<k;i++)
#define td(v) v.begin(),v.end()
#define inf 1000000000 // 1e9
#define M   1000000007 // 1e9 + 7
using namespace std;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int exp(int a,int b,int m){
    if(b==0) return 1LL;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}

main(){
    fastio;
    int n,k;
    cin >> n >> k;
    vector<int> dp(n,(1LL<<62));
    vector<int> h(n);
    for(int &x : h) cin >> x;
    dp[0] = 0;
    for(int i=0;i<n;i++){
        for(int j=1;j<=k;j++){
            if(i+j >= n) break;
            dp[i+j] = min(dp[i] + abs(h[i]-h[i+j]), dp[i+j]);
        }
    }
    cout << dp[n-1] << endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  ll n;
  cin>>n;
  ll ans=0,a;
  for(ll i=1;i<=sqrt(n);i++){
    if(n%i==0) a=i;
  }
  ll c=10,cnt=1;
  while(1){
    if(c>a){ans=max(cnt,ans);break;}
    c*=10;
    cnt++;
  }
  c=10;cnt=1;
  while(1){
    if(c>(n/a)){ans=max(cnt,ans);break;}
    c*=10;
    cnt++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long int
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define mii map<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define MOD 998244353
#define all(v) v.begin(), v.end()

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    char a;
    cin>>a;
    if ('a'<=a && a<='z')
        cout<<'a';
    else
        cout<<'A';
}


Measured memory_bytes: 3608
N = int(input())
P = [int(x) for x in input().split()]

P_sorted = sorted(P)


if P == P_sorted:
    print("YES")
else:
    count = 0
    for a, b in zip(P, P_sorted):
        if a != b:
            count += 1

    if count == 2:
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 3060
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	n := stdin(sc)
	ary := make([]int, n)
	for i := 0; i < n; i++ {
		v := stdin(sc)
		ary[i] = v
	}
	maxv := -math.MaxInt32
	minv := ary[0]
	for i := 1; i < n; i++ {
		maxv = max(maxv, ary[i]-minv)
		minv = min(minv, ary[i])
	}

	fmt.Println(maxv)
}

func stdin(sc *bufio.Scanner) int {
	var n int
	if sc.Scan() {
		num, _ := strconv.Atoi(sc.Text())
		n = num
	}
	return n
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}



Measured memory_bytes: 5404
#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string.h>
#include <deque>
#define REP(i,j,n) for(int i=j;i<n;i++)
#define SORT(x) sort(x.begin(),x.end())

using namespace std;



int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (abs(a - b) > abs(a - c))cout << "B" << endl;
	else  cout << "A" << endl;

	return 0;
}




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

using namespace std;
#define rep(i,n) for (int i =0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
int main() {
    string S, T, U;
    int A, B;
    cin >> S >> T >> A >> B >> U;
    if (S == U) cout << A - 1 <<" "<< B << endl;
    else cout << A <<" "<< B - 1 << endl;
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        String S = scanner.next();

        long Rcnt = S.chars().filter(ch -> ch == 'R').count();
        long Gcnt = S.chars().filter(ch -> ch == 'G').count();
        long Bcnt = S.chars().filter(ch -> ch == 'B').count();

        long num = Rcnt * Gcnt * Bcnt;

        for (int i = 0; i < N; i++) {
            for (int d = 0; d < N; d++) {
                int j = i + d;
                int k = j + d;
                if (k >= N) {
                    break;
                }
                if (S.charAt(i) != S.charAt(j) && S.charAt(i) != S.charAt(k) && S.charAt(j) != S.charAt(k)) {
                    num -= 1;
                }
            }
        }
        System.out.println(num);
    }
}

Measured memory_bytes: 33060
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
 
 
int main(){
    int N;
    scanf("%d",&N);
    int S[N];
    for(int i = 0; i < N; i++)scanf("%d",&S[i]);
 
    int M;
    scanf("%d",&M);
 
    int Q[M];
    for(int i = 0; i < M; i++)scanf("%d",&Q[i]);
    sort(Q,Q+M);
 
    int left = 0,right,m,count = 0;
 
    for(int i = 0; i < M; i++){
        right = N-1;
        m = (left+right)/2;
 
        while(left <= right){
            if(S[m] == Q[i]){
                count++;
                left= m+1;
                break;
            }else if(S[m] > Q[i]){
                right = m-1;
            }else{ //S[m] < Q[i]
                left = m+1;
            }
            m = (left+right)/2;
        }
    }
    printf("%d\n",count);
}


Measured memory_bytes: 3788
n = int(input())
v = list(map(int, input().split()))

judge_2n_1 = {}
judge_2n = {}

for i in range(n):
    if i % 2 == 0:
        if v[i] not in judge_2n_1.keys():
            judge_2n_1[v[i]] = 1
        else:
            judge_2n_1[v[i]] += 1
    else:
        if v[i] not in judge_2n.keys():
            judge_2n[v[i]] = 1
        else:
            judge_2n[v[i]] += 1

judge_2n = sorted(judge_2n.items(), key=lambda x: x[1], reverse=True)
judge_2n_1 = sorted(judge_2n_1.items(), key=lambda x: x[1], reverse=True)
answer = n - 1

for i in judge_2n[:2]:
    for j in judge_2n_1[:2]:
        if i[0] != j[0]:
            answer = min(answer, n - i[1] - j[1])
        else:
            answer = min(answer, n - max(i[1], j[1]))

print(answer)


Measured memory_bytes: 17652
def main():
    n = int(input())
    A = [int(x) for x in input().split()]
    ans = 0
    mod = 10 ** 9 + 7
    for d in range(60):
        # d桁目ごとに考える
        x = 0
        for a in A:
            if (a >> d) & 1:
                x += 1
        ans += x * (n-x) * 2**d
        ans %= mod
    print(ans)
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 50984
#include<bits/stdc++.h>
using namespace std;
const int N =2e5,OO=0x3f3f3f3f;
string s,ans;
int main()
{
    cin>>s;
    for(int i=0;i<s.length();i++){
        if(s[i]=='B'){
            if(ans.length()>0)ans.pop_back();
        }
        else{
            ans+=s[i];
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <string>
#include <climits>
#include <algorithm>
    
typedef long long int ll;
    
using namespace std;
ll a,b,c,n,m,x,q,qn,aa[100000],bb[10000][10000];
bool ra,rb,rc[100000];
vector<ll> va,vb;
string st;
    
#define CE cout<<endl
#define C cout<<
#define E <<endl

int main(){
    cin>>a;
    C a+a*a+a*a*a E;
}

Measured memory_bytes: 3636
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(){
int n,q;
  cin>>n>>q;
  string s;
  cin>>s;
  vector<int> a(n,0);
  for(int i=0;i<n;i++){
    if(i+1<n&&s[i]=='A'&&s[i+1]=='C') a[i+1]=a[i]+1;
    else a[i+1]=a[i];
  }
  
  for(int w=0;w<q;w++){
    int l,r;
    cin>>l>>r;
    --l;
    --r;
    cout<<a[r]-a[l]<<endl;
  }
    return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <climits>
using namespace std;

int main() {
	int N, K, h[100000], ans = INT_MAX;
	cin >> N >> K;
	for (int i = 0; i < N; ++i) cin >> h[i];
	sort(h, h + N);
	for (int i = 0; i < N - K + 1; ++i) ans = min(ans, h[i + K - 1] - h[i]);
	cout << ans;
}

Measured memory_bytes: 640
N, M = map(int, input().split())
H = list(map(int, input().split()))

l = [[] for _ in range(N)]

for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    l[a].append(b)
    l[b].append(a)

ng = 0

for i in range(N):
    for other in l[i]:
        if H[i] <= H[other]:
            ng += 1
            break
ans = N - ng
print(ans)

Measured memory_bytes: 29532
/*-- ILSH  --*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back 
#define pop pop_back
#define mp make_pair
#define vii vector < int >
#define vll vector < ll > 
#define dt cout<<"HERE\n";
#define pii pair < int , int >
#define pll pair < ll , ll >
#define vpi vector < pll >
#define vpl vector < pll >
#define fi first
#define se second 
#define sz size 
#define len length 

const ll inf=1e18+1e17;
const ll mod =1e9+7;
//const ll mod = 998244353;

ll modInverse(ll a,ll m){ll m0=m;ll y=0,x=1;if(m == 1)return 0;while(a> 1){ll q=a/m;ll t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0)x+=m0;return x;}  
ll powm(ll a,ll b){a=a%mod;ll res=1;while(b){if(b&1)res=(res*a)%mod;a=(a*a)%mod;b>>=1;}return (res%mod);}


const ll N =5e5+5;



void solve(){
	ll a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	a=a*60+b;
	c=c*60+d;
	cout<<c-a-e<<'\n';
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie( NULL);
	cout.tie(NULL);
	// #ifndef
	// 	freopen( "INPUT.txt", "r" , stdin);
	// 	freopen( "OUTPUT.txt","w", stdout);
	// #endif

	int t=1;

	//cin>>t;

	for ( int i=1;i<=t;i++){
   // 	cout<<"Case #"<<i<<": ";
    	solve();
 	}
}

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

int main() {
  int a, b;
  cin >> a >> b;
  
  int a12 = a/1000;
  int a21 = a12/10 + a12%10*10;
  int b12 = b/1000;
  int b21 = b12/10 + b12%10*10;
  
  // 上２ケタがa12でaより小さいのを弾く
  int count_less_than_a = 0;
  for (int i = 0; i <= 9; i++) {
    if (a12*1000 + i*100 + a21 < a){
      count_less_than_a++;
    }
    else {
      break;
    }
  }
  
  // 上２ケタがb12でbより大きいのを弾く
  int count_more_than_b = 0;
  for (int i = 9; i >= 0; i--) {
    if (b12*1000 + i*100 + b21 > b){
      count_more_than_b++;
    }
    else {
      break;
    }
  }
  
  int result = (b12 - a12 +1) * 10
    - count_less_than_a - count_more_than_b;
  
  cout << result << endl;
  
}


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

int main(){
    string s;
    cin >> s;
    bool flag1=false;
    bool flag2=false;
    bool flag3=false;
    if(s[0]=='A') flag1=true;
    int cnt=0;
    for(int i=0;i<s.size();i++){
        if(i>=2&&i<=s.size()-2){
            if(s[i]=='C'){
                cnt++;
            }
        }
    }
    if(cnt==1) flag2=true;
    for(int i=0;i<s.size();i++){
        if(s[i]!='A'&&s[i]!='C'){
            if(s[i]>='a'){
                flag3=true;
            }else{
                flag3=false;
                break;
            }
        }
    }
    if(flag1&&flag2&&flag3) cout << "AC" << endl;
    else cout << "WA" << endl;
}

Measured memory_bytes: 256
function Main (s) {
  s = s.split("\n")[0].split("");
  var ans = "";
  s.forEach(function (element, index) {
    if (index%2 == 0) {
      ans += element;
    }
  });
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11340
import java.util.Scanner;

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


Measured memory_bytes: 35676
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>   
using namespace std;
using namespace __gnu_pbds;
typedef long long ll; 
#define int long long
typedef unsigned long long lu;
typedef vector<ll> v;
typedef vector<vector<ll> > vv;
typedef vector<string>  vs;
typedef vector<pair<ll,ll>> vpr;
typedef long double ld;
#define f(i,n) for(ll i = 0; i < n; i++)
#define ff(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define endl "\n"
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define amax(x,y) if(y>x) x=y;
#define amin(x,y) if(y<x)x=y;
#define bg(x) x.begin()
#define sz(x) (ll)x.size()
#define in(x,n) for(ll i=0;i<n;i++)cin>>x[i]
#define out(x,n) for(ll i=0;i<n;i++)cout<<x[i]<<" " 
#define mxt(a) *(max_element(a.begin(),a.end()))
#define mnt(a) *(min_element(a.begin(),a.end())
#define tc ll t;cin>>t;while(t--)
typedef pair<ll,ll> pi;
#define yes cout<<"YES\n";
#define no cout<<"NO\n";
#define yesno(f) if(f) yes else no
const v dx = {1, -1, 0, 0};
const v dy = {0, 0, 1, -1};
const ll mod=1e9+7;
const ld PI = 2 * acos(0.0);
ll m(ll a){ return (a+mod)%mod;}
ll cel(ll x1,ll y1){if((x1%y1)==0)return x1/y1;else return x1/y1+1;}
ll power(ll a,ll b,ll m)
{
	if(b==0)
		return 1;
	ll d=power(a,b/2,m);
	d=(d*d)%m;
	if(b&1)
		d=(d*a)%m;
	return d;
}
// set_name.find_by_order(k) It returns to an iterator to the kth element (counting from zero) in the set in O(logn) time
// set_name.order_of_key(k) It returns to the number of items that are strictly smaller than our item k in O(logn) time.
/*string operations :
str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
str.substr (x) : returns a substring str[x],... end of string
str.find(qtr) : returns the first occurenece of qtr in str */

int32_t main()
{
	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	int n;cin>>n;
	string str;cin>>str;
	v arr(n);
	f(i,n)
	{
		if(str[i]=='R')
			arr[i]=0;
		else if(str[i]=='G')
			arr[i]=1;
		else
			arr[i]=2;
	}
	v dp(3,0),freq(3,0);
	int ans=0;
	for(int i=n-1;i>=0;i--)
	{
		ans+=dp[arr[i]];
		for(int k=0;k<3;k++)
		{
			if(k!=arr[i]){
				int k2=3-arr[i]-k;
				dp[k2]+=freq[k];
			}
		}
		freq[arr[i]]++;
	}
	for(int i=0;i<n;i++)
	{
		for(int k=i+2;k<n;k++)
		{
			if((i+k)&1 || arr[i]==arr[k])continue;
			int j=(i+k)/2;
			if(arr[i]!=arr[j] && arr[k]!=arr[j])
				ans--;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<P,int>
#define T tuple<int,int,int> 
using namespace std;

ll ni(ll a,ll b){
    if(b==0) return 1;
    else if(b%2==0) return ni(a,b/2)*ni(a,b/2);
    else return ni(a,b-1)*a;
}

int main(){
    int n; cin >> n;
    vector<int> p(101,0);
    for(int i=2; i<=n; i++){
        int now=i;
        for(int j=2; j<=n; j++){
            while(now%j==0){
                p[j]++;
                now/=j;
            }
        }
    }
    int num4=0;
    int num2=0;
    int num24=0;
    int num14=0;
    int num74=0;
    rep(i,101){
        if(p[i]>=4) num4++;
        if(p[i]>=2) num2++;
        if(p[i]>=14) num14++;
        if(p[i]>=24) num24++;
        if(p[i]>=74) num74++;
    }
    int ans=(num4*(num4-1)/2)*(num2-2);
    ans+=num14*(num4-1);
    ans+=num24*(num2-1);
    ans+=num74;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3608
#=============================================================================
# DSL1_A
#=============================================================================
n,q=map(int,input().split())
parents=[i for i in range(n)]
deepth=[0 for _ in range(n)]

def find(x):
    if parents[x]==x:
        return x
    return find(parents[x])

def unite(x,y):
    px=find(x)
    py=find(y)
    if deepth[px]>deepth[py]:
        parents[py]=px
        deepth[px]=max(deepth[px],deepth[py]+1)
    else:
        parents[px]=py
        deepth[py]=max(deepth[py],deepth[px]+1)

def same(x,y):
    if find(x)==find(y):
        return True
    else:
        return False

for _ in range(q):
    com,x,y=map(int,input().split())
    if com==0:
        unite(x,y)
    if com==1:
        if same(x,y):
            print(1)
        else:
            print(0)




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

using namespace std;

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

typedef pair<int, int> i_i;
typedef long long int llint;

int main()
{
    int n;
    cin >> n;
    vector<int> data(n, 0);
    rep(i, n) {
        int tmp;
        cin >> tmp;
        data[tmp]++;
    }
    llint ans = 1;
    if (n % 2) {
        if (data[0] != 1) {
            cout << "0" << endl;
            return 0;
        }
        for (int i = 2; i < n; i+=2) {
            if (data[i] != 2) {
                cout << "0" << endl;
                return 0;
            }
        }
        rep(i, n/2) {
            ans *= 2;
            ans %= MOD;
        }
    } else {
        for (int i = 1; i < n; i+=2) {
            if (data[i] != 2) {
                cout << "0" << endl;
                return 0;
            }
        }
        rep(i, n/2) {
            ans *= 2;
            ans %= MOD;
        }
    }

    cout << ans << endl;

    return 0;
}


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

int main(){
  int N,M,X,R=0,L=0;
  cin >> N >> M >> X;
  int A[N+1];
  for(int i=0;i<N+1;i++){
    A[i] = 0;
  }
  for(int i=0;i<M;i++){
    int x;
    cin >> x;
    A[x] = 1;
  }
  for(int i=0;i<X;i++){
    R += A[i];
  }
  for(int i=X;i<N+1;i++){
    L += A[i];
  }
  cout << min(R,L) << endl;
  return 0;
}

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

int main() {
    int N, T, A, H;
    cin >> N >> T >> A;

    double diff = 1e9;
    int pos = 0;
    for (int i = 1; i <= N; i++) {
        cin >> H;
        int d = abs((T * 1000 - H * 6) - A * 1000);
        if (diff > d) {
            pos = i;
            diff = d;
        }
    }
    cout << pos << endl;
}

Measured memory_bytes: 256