akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            double[] TA = Console.ReadLine().Split(' ').Select(i => double.Parse(i)).ToArray();
            double[] H = Console.ReadLine().Split(' ').Select(i => double.Parse(i)).ToArray();
            int result = 0;
            for (int j = 0; j < N; j++)
            {
                //A -H[]*0.006の差が小さいのが答え
                if (Math.Abs(TA[1] - (TA[0]- H[j] * 0.006) )<= Math.Abs(TA[1] - (TA[0] - H[result] * 0.006)))
                {
                    result = j;
                }
            }
            Console.WriteLine(result + 1);

        }
    }
}
// 文字列の入力
//string s = Console.ReadLine();

// 整数の入力
//long n = long.Parse(Console.ReadLine());

// 文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');

// 整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();


Measured memory_bytes: 28636
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
using namespace std;
#define pi M_PI

int main(){
    int r, g, b, ans = 0;
    cin >> r >> g >> b;
    ans = 100*r + 10*g + b;

    if(ans%4 == 0){
        cout << "YES" << endl;
    }
    else cout << "NO" << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<utility>
#include<vector>
#include <algorithm>
int main(){
    int n,k;
    std::cin>>n>>k;
    std::vector<unsigned long long> h(n);
    for(int i = 0;i < n;i++){
        std::cin>>h[i];
    }
    std::sort(h.begin(),h.end());
    if(n <= k){
        std::cout<<0<<std::endl;
    }else{
        unsigned long long int ans = 0;
        int index = n - 1 - k;
        for(;index >= 0;index--)ans += h[index];
        std::cout<<ans<<std::endl;
    }
    return 0;
}

Measured memory_bytes: 1792
// IOI 2021
 
#include <bits/stdc++.h>

using namespace std;

#define int ll
#define endl "\n"
#define ends ' '
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x.size())
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll INF = 1e9;
const int MOD = 1e9 + 7;

////////////////////////////////////////////////////////////////////

const int N = 1e5 + 5, LG = 61;

int X[N], Y[N], PAR[LG][N];

int GetPar(int v, ll h) {
	for (int i = 0; i < LG; i++) if ((1LL << i) & h) v = PAR[i][v];
	return v;
}

int32_t main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	int n; cin >> n;
	for (int i = 0; i < n; i++) cin >> X[i];
	for (int i = 0; i < n - 1; i++) Y[i] = X[i + 1] - X[i], PAR[0][i] = i;
	int m; cin >> m;
	ll k; cin >> k;
	for (int i = 0; i < m; i++) {
		int a; cin >> a; a--;
		swap(Y[a - 1], Y[a]);
		swap(PAR[0][a - 1], PAR[0][a]);
	}
	for (int pw = 1; pw < LG; pw++) for (int i = 0; i < n - 1; i++) PAR[pw][i] = PAR[pw - 1][PAR[pw - 1][i]];
	int last = X[0];
	for (int i = 0; i < n - 1; i++) {
		cout << last << endl;
		int p = GetPar(i, k);
		last += X[p + 1] - X[p];
	}
	cout << last << endl;

	return 0;
}


Measured memory_bytes: 50560
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define test() int t;cin>>t;loop(test,1,t+1)
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define nl cout<<"\n"
#define sp cout<<" "
#define F first
#define S second
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<pii>
#define vll vector<pll>
#define MOD 1000000007
#define all(x) x.begin(),x.end()

template<class C> void min_self( C &a, C b ){ a = min(a,b); }
template<class C> void max_self( C &a, C b ){ a = max(a,b); }

ll mod( ll n, ll m=MOD ){ n%=m,n+=m,n%=m;return n; }

const int MAXN = 1e5+5;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

ll c2( ll n )
{
    ll ans = n*(n-1);
    ans /= 2;
    ans = mod(ans);
    return ans;
}

int main() 
{
    fastio();

    ll n,k,inv=0;
    cin>>n>>k;
    vector<int>a(n);
    map<int,int>mp;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        mp[a[i]]++;
    }

    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if( a[i] > a[j] )
                inv++;
        }
    }

    ll total = n;
    ll ans = 0;
    for( auto x : mp )
    {
        int now = x.first;
        int fr = x.second;
        total -= fr;
        ans = mod(ans + mod(c2(k)*mod(total*fr)) );
    }
    ans = mod( ans + k*inv);
    cout<<ans,nl;

    return 0;
}

Measured memory_bytes: 384
X, K, D = map(int, input().split())

X = abs(X)
t = X // D
now = X - t*D

if K <= t: 
    ans = X - D*K
else:
    if (K - t) % 2 == 0:
        ans = now
    else:
        ans = abs(now - D)

print(ans)


Measured memory_bytes: 9128
#include<iostream>

using namespace std;

int main(){
    int N,M;

    cin >> N >> M;

    int s[M],c[M];

    for(int i=0;i<M;i++){
        cin >> s[i] >> c[i];
    }

    int a[N];
    for(int i=0;i<N;i++) a[i]=-1;

    int ans=-1;
    for(int i=0;i<M;i++){
        if(a[s[i]-1]==-1){
            a[s[i]-1] = c[i];
        }else{
            if(a[s[i]-1]!=c[i]){
                cout << ans << endl;
                return 0;
            }
        }
    }

    if(N==1){
        if(a[0]==-1){
            cout << 0 << endl;
            return 0;
        }else{
            cout << a[0] << endl;
            return 0;
        }
    } 
    if(a[0]==0){
        cout << ans << endl;
        return 0;
    }else{
        if(a[0]==-1) a[0]=1;
        for(int i=1;i<N;i++){
            if(a[i]==-1) a[i]=0;
        }
    }

    ans=0;
    for(int i=0;i<N;i++){
        ans += a[i];
        if(i==N-1) break;
        ans *= 10;
    }

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

Measured memory_bytes: 256
n,m = gets.chomp.split(" ").map(&:to_i)
arr = Array.new(n+1).map{Array.new}
#p arr
 m.times do |i|
    s, t = gets.chomp.split(" ").map(&:to_i)
    arr[t] << s
    arr[s] << t 
 end
yuusen = [0]*(n+1)
queue = [1]
count = 0
while !queue.empty?
    q = queue.shift
    trans = arr[q]
    trans.each do |j|
        if yuusen[j] == 0 
            yuusen[j]=q
            count += 1
            queue.push(j)
        end
    end
end

if count < n 
    puts "No"
else
    puts "Yes"
    puts yuusen[2..-1]
end

Measured memory_bytes: 33848
while(n,m=gets.split.map &:to_i)[0]>0
r=0..n-1
t=r.map{gets.split.map &:to_f}
d=r.map{[1]*n}
(m-1).times{d.map!{|i|r.map{|j|x=0;r.map{|k|y=i[k]*t[k][j];x<y&&x=y};x}}}
puts"%.2f"%[d.flatten.max.round(2)]
end

Measured memory_bytes: 9444
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
    int n;
    vector<int> a, b, c;
    long long ans = 0;
    cin >> n;
    a.assign(n, 0);
    b.assign(n, 0);
    c.assign(n, 0);
    
    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;i++) cin >> c[i];
    
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());
    
    for(int i=0;i<n;i++){
        long long res;
        int ok = -1, ng = n;
        while(ok + 1 < ng){
            int mid = (ok + ng) / 2;
            if(a[mid] < b[i]) ok = mid;
            else ng = mid;
        }
        res = ng;
        ng = -1, ok = n;
        while(ng + 1 < ok){
            int mid = (ng + ok) / 2;
            if(c[mid] > b[i]) ok = mid;
            else ng = mid;
        }
        ans += res * (n - ok);
    }
    cout << ans << endl;
}


Measured memory_bytes: 1536
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<ctime>
#include<cmath>
#include<string.h>
#include<algorithm>
#include<vector>
#define il inline
#define ll long long
#define INF 0x7fffffff
#define rint register int
using namespace std;
int const N=16001;
vector<int> xoy[2];
int fxy[2];
bool dp[N][N];
il char gc(){
	static char BB[1000000],*S=BB,*T=BB;
	return S==T&&(T=(S=BB)+fread(BB,1,1000000,stdin),S==T)?EOF:*S++;
}
il ll re(){
	ll x=0,w=1;
	char ch=gc();
	while(ch<'0'||ch>'9'){if(ch=='-') w=-1;ch=gc();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=gc();}
	return x*w;
}
int main(){
	char s[8005];
	scanf("%s",s);
	int xy=0,lon=0;
	for(int i=0;i<strlen(s);i++){
		if(s[i]=='F') lon+=1;
		else{if(lon) xoy[xy].push_back(lon);lon=0,xy^=1;}
	}
	xoy[xy].push_back(lon);
	/*for(int i=0;i<xoy[0].size();i++){
		cout<<xoy[0][i]<<endl;
	}*/
	scanf("%d%d",&fxy[0],&fxy[1]);
	int fl[2]={0};
	for(int k=0;k<=1;k++){
		memset(dp,0,sizeof(dp));
		dp[0][8000]=1;
		int MAX=xoy[k].size();
		for(int i=1;i<=MAX;i++){
			if(s[0]!='T'&&k==0&&i==1&&xoy[k].size()>=1) {dp[1][xoy[k][0]+8000]=1;continue;}
			for(int j=0;j<N;j++){
				 
				if(j-xoy[k][i-1]>=0)dp[i][j]|=dp[i-1][j-xoy[k][i-1]];
				dp[i][j]|=dp[i-1][j+xoy[k][i-1]];
			}
		}
		if(dp[MAX][fxy[k]+8000]) fl[k]=1;
	}
	if(fl[0]&&fl[1]) printf("Yes\n");
	else printf("No\n");
	return 0;
	
	
} 


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

using namespace std ;

#define rg register
#define dbg(v) cerr << #v << " " << v ;
typedef long long ll ;

int main() {

  int n, k ;
  cin >> n >> k ;
  vector<int> a(n) ;
  for(int i = 0 ; i < n ; i++) cin >> a[i] ;
  sort(a.begin(), a.end()) ;
  while(k-- && a.size()){
    a.pop_back() ;
  }

  n = a.size() ;
  ll sum = 0 ;
  for(int i = 0 ; i < n ; i++) sum += a[i] ;
  cout << sum << "\n" ;

}

/*
 Empty set of troubles.
*/


Measured memory_bytes: 1024
import sys
sys.setrecursionlimit(10**6)

n = int(input())

d = {}

for i in range(n):
    t = input()
    t = ''.join(sorted(t))
    d[t] = d.get(t,0) + 1
        
ans = 0

for v in d.values():
    ans += v*(v-1)//2
    
print(ans)

Measured memory_bytes: 17804
#!/usr/bin/env python3
import sys, math
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans=count=0

S=input()
for i in range(3):
    if S[i]==S[i+1]:
        print("Bad")
        exit()
print("Good")


Measured memory_bytes: 38384
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <numeric>


using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)

using namespace std;

int n, x, y;

void dfs(int sv, vector<vector<int> >& v, vector<int>& d) {
	queue<int> que;
	que.push(sv);
	d[sv] = 0;
	while(!que.empty()) {
		int cur = que.front();
		que.pop();
		for (auto nv : v[cur]) {
			if (d[nv] > d[cur] + 1) {
				d[nv] = d[cur] + 1;
				que.push(nv);
			}
		}
	}
}

int main() {
	cin >> n >> x >> y;

	vector<vector<int> > v(n);

	x--; y--;

	for (int i = 0; i < n - 1; i++) {
		v[i].push_back(i + 1);
		v[i + 1].push_back(i);
	}

	v[x].push_back(y);
	v[y].push_back(x);

	vector<int> ans(n, 0);

	for (int sv = 0; sv < n; sv++) {
		vector<int> d(n,1000000);
		dfs(sv, v, d);
		for (int i = sv + 1; i < n; i++) {
			ans[d[i]]++;
		}
	}
	for (int i = 1; i < n; i++) {
		cout << ans[i] << endl;
	}


	return 0;

}

Measured memory_bytes: 632
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 1e5 + 5; 
int n; char S[maxn];
int main() {
//	freopen("testdata.in", "r", stdin);
	scanf("%s", S), n = strlen(S);
	int cnt[2] = {0, 0}, an = 0;
	for(int i = 0; i < n; ++i) {
		int c = S[i] - '0';
		if(cnt[c ^ 1]) cnt[c ^ 1]--, an += 2;
		else cnt[c]++;
	}
	printf("%d\n", an);
	return 0;
}

Measured memory_bytes: 384
import java.util.*;
public class Main{
	public static void main(String [] args){
    	Scanner scan = new Scanner(System.in);
      	long a = scan.nextLong();
      	long b = scan.nextLong();
      	long k = scan.nextLong();
      	if(a>=k){
        a=a-k;
        }
      else{
      b=b-(k-a);
        a=0;
        if(b<0)b=0;
        
      }
      System.out.println(a+" "+b);
    }
}


Measured memory_bytes: 20948
// Original macro is in https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = || -> String {
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

// for adhoc read (ex. https://atcoder.jp/contests/abc112/tasks/abc112_a)
#[allow(dead_code)]
fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main() {
    input!{k: usize}
    println!("{}", if k%2==0 { (k/2)*(k/2) } else { (k/2)*(k/2+1) });
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define Max(a,b) (a>b?a:b)
#define Min(a,b) (a<b?a:b)
#define ll long long
inline int read(){
	int f=1,x=0;char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')
			f=-1;
		c=getchar();
	}
	while(c<='9'&&c>='0'){
		x=x*10+c-'0';
		c=getchar();
	}
	return x*f;
}
 
inline void file(){
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
}
 
using namespace std;
const ll maxn=1e6+10;
ll a[maxn],b[maxn];
 
int main(){
	ll k,n,h;
	scanf("%lld%lld",&n,&h);
	for(register ll i=1;i<=n;++i)
		cin>>a[i]>>b[i];
	sort(b+1,b+n+1);
	sort(a+1,a+n+1);
	for(register ll i=1;i<=n;++i)
		b[i]=max(b[i],a[n]);
	ll ovo=0;
	for(register ll i=n;i>=1;--i){
		ovo+=b[i];
		if(ovo>=h){
			printf("%lld",n-i+1);
			return 0;
		}
	}
	if(ovo<h){
		h-=ovo;
		printf("%lld",n+(h/a[n])+(h%a[n]==0?0:1));
	}
	return 0;
}
 



Measured memory_bytes: 5120
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        // 主処理
        int countRed = s.length() - s.replace("0", "").length();
        int countBlue = s.length() - s.replace("1", "").length();
        int result = Math.min(countRed, countBlue) * 2;

        // 出力
        System.out.println(result);
        sc.close();
    }
}


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

using namespace std;

const int MAXN = 105;

int n, len;
string s[MAXN];

int main () {
    cin >> n >> len;
    for (int i=0; i<n; i++) {
        cin >> s[i];
    }
    sort(s, s + n);
    for (int i=0; i<n; i++) {
        cout << s[i];
    }
    return 0;
}


Measured memory_bytes: 256
/*
* Author:sam51305
*/
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define mp make_pair
#define ll long long
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pb push_back
#define ary array

#define Yes cout << "Yes" <<endl;
#define No cout << "No" << endl;
int main() {
    fastio
    int X, N;
    cin >> X >> N;
    if(N <= 0){
        cout << X;
        return 0;
    }
    vector<int> arr(103);
    int minN = 100000;
    int pos = -1;
    for(int i=0;i<=102;i++){
        arr[i] = abs(i-X);
    }
    for(int i=0;i<N;i++){
        int temp;
        cin >> temp;
        if(temp >= 0){
            arr[temp] = 100000;
        }
    }
    for(int i=0;i<=102;i++){
        if(arr[i] < minN){
            minN = arr[i];
            pos = i;
        }
    }
    cout << pos;
    return 0;
}


Measured memory_bytes: 3640
import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.solve();
        m.show();
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int[] a;
    int max;
    int min;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        a = new int[N];
        for (int i=0; i<N; i++) {
        	a[i] = sc.nextInt();
        }
    }
    
    //解答処理
    private void solve() {
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		String tmp = color(a[i]);
    		if (map.containsKey(tmp)) {
    			count += map.get(tmp);
    		}
    		map.put(tmp, count);
    	}
    	
    	if (!map.containsKey("colorless")) {
    		min = map.size();
    		max = map.size();
    	} else {
    		min = map.size()-1;
    		max = min + map.get("colorless");
    		if (map.size() == 1) { //全員が3200以上の場合
    			min = map.size();
    		}
    		
    	}
    }
    
    //a[i]のレートの色を判別するメソッド
    private String color(int a) {
    	String color = "colorless";
    	if (1<=a && a<400) {
    		color = "gray";
    	} else if (400<=a && a<800) {
    		color = "brown";
    	} else if (800<= a && a<1200) {
    		color ="green";
    	} else if (1200<=a && a<1600) {
    		color = "ligthBlue";
    	} else if (1600<=a && a<2000) {
    		color = "blue";
    	} else if (2000<=a && a<2400) {
    		color = "yellow";
    	} else if (2400<=a && a<2800) {
    		color = "orange";
    	} else if (2800<=a && a<3200) {
    		color = "red";
    	}
    	
    	return color;
    }
    
    //出力
    public void show() {
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
    }

}


Measured memory_bytes: 35776
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>


#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#ifdef LOCAL
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)
#else
#define show(...)
#define showlr(n,l,r)
#endif

#define YN(condition) puts((condition)?"YES":"NO")
#define Yn(condition) puts((condition)?"Yes":"No")
#define yn(condition) puts((condition)?"yes":"no")
#define YES puts("YES")
#define Yes puts("Yes")
#define yes puts("yes")
#define NO  puts("NO")
#define No  puts("No")
#define no  puts("no")

#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

struct io{io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}}io;

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

template<typename V,typename H> void resize(vector<V>& v,const H a){v.resize(a);}
template<typename V,typename H,typename... T> void resize(vector<V>& v,const H& a,const T... b){v.resize(a);for(auto &v:v) resize(v,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;
/*------------end of definitions------------*/

int A,B;
int C,D;

signed main(){

    in(A,B,C,D);
    out(max(A*B,C*D));

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>

#define REP(i,a,n) for(int i=a;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define REV(i,a,n) for(int i=n;i>=a;--i)
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define show(n) cerr<<#n<<" = "<<n<<endl
#define shows(n) for(auto z:n){cerr<<z<<", ";}cerr<<endl

//ここからAtCoder向けdefine
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

using namespace std;

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using pint = pair<int,int>;

const int INF = ~(1 << 31);

string src, tgt;

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

    bool t = false;
    bool f = false;
    vi ansptn;

    rep(i, src.size() - tgt.size() + 1){
        if(src[i] == '?' || src[i] == tgt[0]){
            f = true;
            REP(j, 1, tgt.size()){
                if(src[i + j] != '?' && src[i + j] != tgt[j]){ 
                    //cerr << j << ", break" << endl;
                    f = false;
                    break; 
                }
            }
            if(f){
                t = true; 
                ansptn.pb(i);
            }
        }
    }

    if(t){
        sort(rall(ansptn));
        src.replace(ansptn[0], tgt.size(), tgt);
        rep(i, src.size()){
            if(src[i] == '?'){
                src.replace(i, 1, "a");
            }
        }
        cout << src << endl;
    }else{ cout << "UNRESTORABLE" << endl; }

    return 0;
}

Measured memory_bytes: 256
/*
 *created by Kraken on 12-05-2020 at 15:31
 */
import java.util.*;
import java.io.*;

public class Main {

  public static void main(String[] args) {
    FastReader sc = new FastReader();
    long a = sc.nextLong(), b = sc.nextLong(), c = sc.nextLong(), k = sc.nextLong();
    if (k <= a + b)
      System.out.println(Math.min(k, a));
    else if (k <= a + b + c)
      System.out.println(a - (k - a - b));
  }

  static class FastReader {

    BufferedReader br;

    StringTokenizer st;

    public FastReader() {
      br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        }
        catch (IOException e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

    double nextDouble() {
      return Double.parseDouble(next());
    }

    String nextLine() {
      String str = "";
      try {
        str = br.readLine();
      }
      catch (IOException e) {
        e.printStackTrace();
      }
      return str;
    }
  }
}


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

typedef pair<int,int> ii;
#define fi first
#define se second

const int N = 2e5 + 5;
const int MOD = 1e9 + 7;

int h, w, a, b;
int fac[N], ifac[N];

int fpow(int x,int y) {
	int ret = 1;
	while (y) {
		if (y & 1) ret = 1LL * ret * x % MOD;
		x = 1LL * x * x % MOD;
		y >>= 1;
	}
	return ret;
}

int C(int n,int k) {
	if (n < k || k < 0) return 0;
	int ret = 1LL * ifac[k] * ifac[n - k] % MOD;
	ret = 1LL * ret * fac[n] % MOD;
	return ret; 
}

int main() {
	ios_base::sync_with_stdio(false);
	fac[0] = 1; for (int i = 1; i < N; ++i) fac[i] = 1LL * fac[i - 1] * i % MOD;
	ifac[N - 1] = fpow(fac[N - 1], MOD - 2);
	for (int i = N - 2; i >= 0; --i) ifac[i] = 1LL * ifac[i + 1] * (i + 1) % MOD;
	cin >> h >> w >> a >> b;
	int res = 0;
	for (int i = 1; i <= h - a; ++i) {
		int j = b + 1;
		int add;
		if (i == h - a) add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j, h - i) % MOD;
		else add = 1LL * C(i + j - 2, i - 1) * C(h - i + w - j - 1, w - j - 1) % MOD; 
		res += add; if (res >= MOD) res -= MOD;
	}
	cout << res;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define ll long long
#define inf 1000000007 //10^9+7
#define sort(vec) sort((vec).begin(),(vec).end());
#define rever(vec) reverse((vec).begin(),(vec).end());
#define unsort(vec) sort((vec)); rever((vec));
using namespace std;

ll kai(ll n) {
  ll ans=0;
  for(ll i=1;i<=n;i++) {
    ans+=i;
  }
  return ans;
}

int main() {
  ll x;
  cin>>x;
  ll ans=0;
  for(ll i=1;i<inf;i++) {
    if(x<=kai(i)) {
      cout<<i<<endl;
      break;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
string s;
  cin>>s;
  char prev = '#';
   int i=0,c=0;
  while(i!=s.size())
  {
    if(s[i]!=prev)
    {
      c++;
      prev=s[i];
      i++;
    }
    else
    {
      i++;
    }
  }
  cout<<c;

  return 0;
}

Measured memory_bytes: 512
#include <iostream>
  #include <complex>
  #include <vector>
  #include <string>
  #include <algorithm>
  #include <cstdio>
  #include <numeric>
  #include <cstring>
  #include <ctime>
  #include <cstdlib>
  #include <set>
  #include <map>
  #include <unordered_map>
  #include <unordered_set>
  #include <list>
  #include <cmath>
  #include <bitset>
  #include <cassert>
  #include <queue>
  #include <stack>
  #include <deque>
 #include <iomanip>
 
  using namespace std;
   

//abcdefghijklmnopqrstuvwxyz
//ABCDEFGHIJKLMNOPQRSTUVWXYZ
  typedef long long ll;
  typedef long double lld;
//   typedef string str;
//   typedef unsigned long long ull;
  ll INF = INT_MAX;
  ll mod = 1000000007;
  // lld PI = 3.141592653;

// const int N = 2e5 + 5;

// int a[N];
// int n,k;
  


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


      int n;
      cin>>n;
      int m;
      cin>>m;
      vector<int> a(n);
      lld s=0;
      for (int i = 0;i<n;i++){cin>>a[i]; s +=a[i];}
        sort(a.rbegin(), a.rend());
      // cout<<s<<endl;
      s = s/(4*m);
      // cout<<s<<endl;
      bool ok = true;
      for (int i = 0;i<m;i++) if (a[i]<s) ok =false;
      if (ok)
        cout<<"Yes\n";
      else
        cout<<"No\n";
}
  

Measured memory_bytes: 3128
#include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;
struct Edge{ int to, cost; };
vector<Edge> G[101];
int dist[11][101];
const int INF = (1<<28);
int dijkstra( int s, int a ){
  priority_queue< P, vector<P>, greater<P> > q;
  for( int j=0; j<=100; j++ )
    dist[a][j] = INF;
  dist[a][s] = 0;
  q.push({ 0, s });
  while( !q.empty() ){
    int cost = q.top().first;
    int v = q.top().second;
    q.pop();
    if( dist[a][v] < cost ) continue;
    for( auto it=G[v].begin(); it!=G[v].end(); ++it ){
      int d = dist[a][v] + it->cost;
      if( a > 0 )
        d = min( d, dist[a-1][v] + it->cost/2 );
      if( dist[a][it->to] > d ){
        dist[a][it->to] = d;
        q.push({ d, it->to });
      }
    }
  }
  //for( int i=1; i<=3; i++ )
  //  cout << dist[a][i] << ' '; cout << endl;
}
int main( void ){
  while( 1 ){
    int c,n,m,s,d,a,b,f;
    cin >> c >> n >> m >> s >> d;
    if( c == 0 ) break;
    for( int i=1; i<=n; i++ ) G[i].clear();
    for( int i=0; i<m; i++ ){
      cin >> a >> b >> f;
      G[a].push_back({ b, f });
      G[b].push_back({ a, f });
    }
    for( int i=0; i<=c; i++ )
      dijkstra( s, i );
    cout << dist[c][d] << endl;
  }
}

Measured memory_bytes: 1236
N, K = map(int,input().split())

D = list(map(int,input().split()))
OK = []
for i in range(10):
  if i not in D:
    OK.append(str(i))
#print(OK)
sn = str(N)
l = len(sn)

ans = N*1
Flag = 0
while Flag == 0:
  sans = str(ans)
  if all(sans[i] in OK for i in range(len(sans))):
    Flag = 1
  else:
    ans += 1
print(ans)
      
    

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#define INF 10000000
using namespace std;
int cost[101][101];
int n,m,s,g1,g2;
void warshall_floyd(){
  for(int i = 0 ; i < n ; i++ ){
    for(int j = 0 ; j < n ; j++ ){
      for(int k = 0 ; k < n ; k++ ){
	cost[j][k] = min(cost[j][k],cost[j][i] + cost[i][k]);
      }
    }
  }
}

int main(){

  while( cin >> n >> m >> s >> g1 >> g2 , n+m+s+g1+g2 ){
    n++;
    for(int i = 0 ; i < n ; i++ )
      for(int j = 0 ; j < n ; j++ ){
	if(i == j)cost[i][j] = 0;
	else cost[i][j] = INF;
      }

    for(int i = 0 ; i < m ; i++ ){
      int a,b,c;
      cin >> a >> b >> c;
      cost[a][b] = c;
    }
    warshall_floyd();

    int mn = INF;
    for(int i = 0 ; i < n ; i++ )
      mn = min(cost[s][i] + cost[i][g1] + cost[i][g2],mn);
    cout << mn << endl;
  }
  return 0;
}

Measured memory_bytes: 1200
#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_macros)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        S: chars,
    }
    let mut len = 0;
    let mut p = 0;
    let mut m = 0;
    for s in S {
        len += 1;
        if s == '0' {
            m += 1;
        } else {
            p += 1;
        }
    }

    println!("{}", 2 * std::cmp::min(p, m));
}



Measured memory_bytes: 4352
N = int(input())
strList=[input() for i in range(N)]
#print(strList)
strList.sort()
#print(strList)

maxNum = 0
Num = 1
maxStr = [strList[0]]
temp = strList[0]

for i in range(1,N):
  if(strList[i] != temp):
    #print(strList[i])
    if(Num > maxNum):
      maxNum = Num
      Num = 1
      del maxStr[:]
      maxStr.append(strList[i-1])
      temp = strList[i]
    elif(Num == maxNum):
      Num = 1
      maxStr.append(strList[i-1])
      temp = strList[i]
    else:
      Num = 1
      temp = strList[i]
  else:
    Num += 1

if(Num > maxNum):
  maxNum = Num
  Num = 1
  del maxStr[:]
  maxStr.append(strList[i])
  temp = strList[i]
elif(Num == maxNum):
  Num = 1
  maxStr.append(strList[i])
  temp = strList[i]

length = len(maxStr)
for i in range(length):
  print(maxStr[i])

Measured memory_bytes: 82648
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        v: [usize; n]
    }
    let d = 1000000007;
    let hs: Vec<usize> = (1..n+1).map(|x| inv_m(x, d)).scan(0, |ac, x| {*ac = (*ac + x) % d; Some(*ac)}).collect();
    let mut ans = 0;
    for i in 0..n {
        ans = (ans + v[i] * (hs[i] + hs[n-i-1] - 1)) % d;
    }
    ans = ans * stair_m(n, d) % d;
    println!("{}",ans);
}

fn stair_m(n: usize, d: usize) -> usize {
    (1..n+1).fold(1, |ac, x| ac * x % d)
}

fn inv_m(n: usize, d: usize) -> usize {
    pow_m(n, d - 2, d)
}

fn pow_m(n: usize, mut p: usize, d: usize) -> usize {
    let mut ret = 1;
    let mut r = n;
    while p > 0 {
        if p % 2 == 0 {
            r = r * r % d;
            p /= 2;
        } else {
            ret  = ret * r % d;
            p -= 1;
        }
    }
    ret
}


Measured memory_bytes: 6396
#include<iostream>
#include<vector>

using namespace std;
class UnionFind {
  vector<int> table;
  int root(int x) {
    return table[x] < 0 ? x : table[x] = root(table[x]);
  }
public:
  UnionFind(size_t size) : table(size, -1) { }
  void unite(int x, int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (table[y] < table[x]) swap(x, y);
      if (table[x] == table[y]) table[x]--;
      table[y] = x;
    }
  }
  bool same(int x, int y) {
    return root(x) == root(y);
  }

  bool isRoot(int x) const {
    return table[x] < 0;
  }
};

int main() {
  int n, q;
  int c, x, y;
  cin >> n >> q;
  UnionFind uf(n);
  for(int i=0; i<q; ++i) {
    cin >> c >> x >> y;
    if(c == 0) {
      uf.unite(x, y);
    } else {
      cout << (uf.same(x, y) ? 1 : 0) << endl;
    }
  }
}


Measured memory_bytes: 3136
using namespace std;
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

int main(){
    int N;
    cin >> N;
    int V[N];
    int C[N];
    rep(i,N) cin >> V[i];
    rep(i,N) cin >> C[i];
    
    int ans=0;
    for(int i=0;i<N;i++){
        int tmp = V[i]-C[i];
        if(tmp>0){
            ans += tmp;
        }
    }

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <limits>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const ll INF = numeric_limits<ll>::max();

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

  vector<vector<pii>> edge(N, vector<pii>());

  REP(i, M) {
    int a, b, c;
    cin >> a >> b >> c;
    edge[a-1].push_back(make_pair(b-1, -c));
  }
  ll dist[N];
  REP(i, N) dist[i] = INF;
  dist[0] = 0;
  REP(i, N-1) REP(from, N) {
    for (const auto& e : edge[from])
      if (dist[from] != INF && dist[e.first] > dist[from] + e.second)
        dist[e.first] = dist[from] + e.second;
  }
  ll ans = dist[N-1];
  bool negative[N];
  REP(i, N) negative[i] = false;
  REP(from, N) {
    for (const auto& e : edge[from]) {
      if (dist[from] != INF && dist[e.first] > dist[from] + e.second) {
        dist[e.first] = dist[from] + e.second;
        negative[e.first] = true;
      }
      if (negative[from])
        negative[e.first] = true;
    }
  }
  if (negative[N-1])
    printf("inf\n");
  else
    printf("%lld\n", -ans);
  return 0;
}


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

int main(){
    int num;
    int i = 0;
    while (true){
        i++;
        cin >> num;
        if (num == 0){
            break;
        }
        cout << "Case " << i << ": " << num << endl;
    }
    return 0;
}


Measured memory_bytes: 3012
N = int(input())
S = input()
if N>3 :
  total = S.count("R")*S.count("G")*S.count("B")
  for i in range(0,N-2):
    for j in range(i+1,N-1):
      if 2*j-i<N:
        if S[i]!=S[j] and S[j]!=S[2*j-i] and S[2*j-i]!=S[i]:
          total-=1
  print(total)
else:
  print(0)

Measured memory_bytes: 9144
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<", ";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}
template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

const ll MAXn=2e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f;

ll n;
ll h[MAXn],d[MAXn];
ll bit[MAXn];
ll lowbit(ll x){return x&(-x);}
void ins(ll x,ll val){
  for (;x<=n;x+=lowbit(x)) bit[x] = max(bit[x],val);
}
ll qr(ll x){
  ll ret = 0;
  for (;x>0;x-=lowbit(x)) ret = max(ret,bit[x]);
  return ret;
}
int main(){
  IOS();
  cin >> n;
  REP (i,n) cin >> h[i];
  REP (i,n) cin >> d[i];

  ll ans = 0;
  REP (i,n) {
    ll tmp = qr(h[i]);
    ans = max(ans,tmp+d[i]);
    ins(h[i],tmp+d[i]);
  }

  cout << ans << endl;
}


Measured memory_bytes: 4992
/*
  Fuad Ashraful Mehmet
  University of Asia Pacific,Bangladesh
  Date:28 th March 2020
  TODO:
  https://codeforces.com/problemset/problem/482/B
  uva: 11695 Flight Planning
  https://onlinejudge.org/external/116/11621.pdf
*/
#include<bits/stdc++.h>
#define all(o) (o).begin(),(o).end()
using namespace std;
void scan(int &x)
{
  scanf("%d",&x);
}
const int N=1e5+5;
typedef long long ll;
void Dbug();


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

    string s;
    cin>>s;

    if(s[2]==s[3]&&s[4]==s[5])
    cout<<"Yes"<<endl;
    else
    {
      cout<<"No"<<endl;
    }
    
 // Dbug();
  return 0;
}

void Dbug()
{
 
}

Measured memory_bytes: 256
function main(input) {
  input=input.trim();
  const N = parseInt(input.split(" ")[0], 10);
  var arrd=[]
  for(var i=0; i<N; i++){
    arrd.push(parseInt(input.split("\n")[1+i], 10))
  }

  var ans=0;
  for(var i=0; i<N; i++){
    var judge=0
    for(var j=0; j<i; j++){
      if(arrd[i]==arrd[j]){
        judge++
      }
    }
    if(judge==0){
      ans++
    }
  }
  console.log(ans);

}



main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
///   ***   ---   |||         In the name of ALLAH        |||   ---   ***   ///



#include<bits/stdc++.h>
using namespace std;


typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define endl '\n'
#define PB push_back
#define F first
#define S second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(x) (int)x.size()

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}

ll gcd ( ll a, ll b ) { return __gcd ( a, b ); }
ll lcm ( ll a, ll b ) { return a * ( b / gcd ( a, b ) ); }

int main()
{
    optimize();

    string s, t;
    cin >> s >> t;

    int cnt = 0;
    for ( int i = 0; i < sz ( s ); i++ ) {
        if ( s[i] != t[i] ) cnt++;
    }

    cout << cnt << endl;

    return 0;
}


















Measured memory_bytes: 3824
package main
import(
  "fmt"
)
func main(){
  var n, i int
  fmt.Scan(&n)
  a:=make([]int, n)
  for i=0;i<n;i++{
    fmt.Scan(&a[i])
  }
  ans:=0
  for{
    for i=0;i<n;i++{
      if a[i]%2==0{
        a[i]/=2
      }else{
        fmt.Println(ans)
        return
      }
    }
    ans++
  }
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload4(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload4(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)
#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))
#define d(a) cerr<<#a<<":"<<a<<endl
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl


int main(){
    int n;
    cin>>n;
    map<int,int> e,o;
    REP(i,n){
        int a;
        cin>>a;
        if(i%2){
            e[a]++;
        }else{
            o[a]++;
        }
    }

    int ans1,ans2,ma,mi;
    ans1=n;
    ma=0;
    for(P a:e){
        if(chmax(ma,a.second))mi=a.first;
    }
    ans1-=ma;
    ma=0;
    for(P a:o){
        if(a.first==mi)continue;
        chmax(ma,a.second);
    }
    ans1-=ma;

    ans2=n;
    ma=0;
    for(P a:o){
        if(chmax(ma,a.second))mi=a.first;
    }
    ans2-=ma;
    ma=0;
    for(P a:e){
        if(a.first==mi)continue;
        chmax(ma,a.second);
    }
    ans2-=ma;
    cout<<min(ans1,ans2)<<endl;


    return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  int *A, *count;
  
  cin >> N;
  
  A = new int[N];
  count = new int[N];
  
  
  for(int i = 0; i < N - 1; i++){
    cin >> A[i];
  }
  
  for(int i = 0; i < N; i++) count[i] = 0;
  
  for(int i = 0; i < N - 1; i++){
    count[A[i] - 1]++;
  }
  
  for(int i = 0; i < N; i++){
    cout << count[i] << endl;
  }
  
  delete[] A;
  delete[] count;
  return 0;
}

Measured memory_bytes: 4816
y=gets.chomp
x=gets.chomp.split.map { |e|e.to_i  }
a=x.map { |e|e.div(400)  }
b=a.reject{|e|e>7}.uniq.count
c=a.reject{|e|e<8}.count
if b==0 &&c>0
  puts ("1 #{c}")
else
  puts ("#{b} #{b+c}")
end


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
//動画解答写し
int main() {
  int n,k;
  cin >>n>>k;
  vector<int>a(n);
  for(int i=0;i<n;i++)cin>>a[i];
  rep(ki,k){
    vector<int>b(n+1);
    rep(i,n){
      int l=max(0,i-a[i]);
      int r=min(i+a[i]+1,n);
      b[l]++;b[r]--;
    }
    rep(i,n)b[i+1]+=b[i];
    b.pop_back();//最後の1要素を取る
    if(a==b)break;
    a=b;
  }
  rep(i,n)cout<<a[i]<<endl;//AtCoderではジャッジで空白と改行を区別していない
  return 0;
}

Measured memory_bytes: 4848
#define _USE_MA_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n;
    cin>>n;
    vi a(n+1);
    rep(i,n){
        cin>>a[i+1];
        a[i+1]+=a[i];
    }
    int ans=inf;
    REP(i,2,n-2){
        int l=upper_bound(all(a),a[i]/2)-a.begin();
        int r=upper_bound(all(a),(a[n]-a[i])/2+a[i])-a.begin();
        REP(j,-1,1){
            REP(k,-1,1){
                int P=a[l+j],Q=a[i]-P,R=a[r+k]-a[i],S=a[n]-a[i]-R;
                ans=min(ans,max({P,Q,R,S})-min({P,Q,R,S}));
            }
        }
    }
    cout<<ans<<endl;
}
        

Measured memory_bytes: 1792
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int a,b,c,x;
    scanf("%d %d %d",&a,&b,&c);
    
    if (a > b) {
        x = a;
        a = b;
        b = x;
    }
    if (b > c) {
        x = b;
        b = c;
        c = x;
        if (a > b) {
            x = a;
            a = b;
            b = x;
        }
    }
    printf("%d %d %d\n",a,b,c);
    return 0;
}


Measured memory_bytes: 2108