akhauriyash/Code-Regression huggingface dataset:
line = gets
data = line.split(" ")
n = data[0].to_i
k = data[1].to_i
bi = Hash.new
n.times do |i|
  line = gets
  data = line.split(" ")
  a = data[0].to_i
  if bi[a] == nil
    bi[a] = data[1].to_i
  else
    bi[a] += data[1].to_i
  end
end
ai = bi.keys
ai.sort!
ai.each do |a|
  k -= bi[a]
  if k <= 0
    puts a
    break
  end
end

Measured memory_bytes: 6792
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);
	static boolean debug = false;

	static int[][][] undirectedGraph(int n, int[] v1, int[] v2, int[] cost) {
		int[] cnt = new int[n];
		for (int i : v1) cnt[i]++;
		for (int i : v2) cnt[i]++;

		int[][][] g = new int[n][][];
		for (int i=0; i<n; i++) g[i] = new int[cnt[i]][2];
		for (int i=0; i<v1.length; i++) {
			int s = v1[i];
			int t = v2[i];

			g[s][--cnt[s]][0] = t;
			g[s][cnt[s]][1] = cost[i];

			g[t][--cnt[t]][0] = s;
			g[t][cnt[t]][1] = cost[i];
		}

		return g;
	}

	static int[] dijkstra(int[][][] g, int source) {
		int n = g.length;

		final int[] d = new int[n];
		Arrays.fill(d, 1<<30);
		d[source] = 0;

		TreeSet<Integer> pQ = new TreeSet<Integer>(new Comparator<Integer>(){
			public int compare(Integer a, Integer b) {
				if (d[a] != d[b]) return d[a] - d[b];
				return a - b;
			}
		});
		pQ.add(source);

		while (!pQ.isEmpty()) {
			int cur = pQ.pollFirst();

			for (int i=0; i<g[cur].length; i++) {
				int next = g[cur][i][0];
				int dist = d[cur] + g[cur][i][1];
				if (dist < d[next]) {
					pQ.remove(next);
					d[next] = dist;
					pQ.add(next);
				}
			}
		}

		return d;
	}

	static boolean solve() {
		int m = in.nextInt();
		int n = in.nextInt();
		if (n + m == 0) return false;

		int[] s = new int[m];
		int[] t = new int[m];
		int[] time = new int[m];
		int[] cost = new int[m];
		for (int i=0; i<m; i++) {
			s[i] = in.nextInt() - 1;
			t[i] = in.nextInt() - 1;
			cost[i] = in.nextInt();
			time[i] = in.nextInt();
		}

		int[][][] gc = undirectedGraph(n, s, t, cost);
		int[][][] gt = undirectedGraph(n, s, t, time);

		int k = in.nextInt();
		while (k-- > 0) {
			int p = in.nextInt() - 1;
			int q = in.nextInt() - 1;
			int r = in.nextInt();
			if (r == 0) {
				int[] d = dijkstra(gc, p);
				out.println(d[q]);
			} else {
				int[] d = dijkstra(gt, p);
				out.println(d[q]);
			}
		}

		return true;
	}

	public static void main(String[] args) {
		debug = args.length > 0;
		long start = System.nanoTime();

		while(solve());
		out.flush();

		long end = System.nanoTime();
		dump((end - start) / 1000000 + " ms");
		in.close();
		out.close();
	}

	static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); }
}

Measured memory_bytes: 98576
<?php
    $line = trim(fgets(STDIN));
	$num = explode(' ', $line);
	if($num[0] < 10 && $num[0] > 0  && $num[1] < 10 && $num[1] > 0 ){
	    echo $num[0] * $num[1];
	} else {
	    echo -1;
	}

Measured memory_bytes: 4728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    string s;
    cin >> s;
    if(s[0] == '9' || s[1] == '9') cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

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

using namespace std;

int main(){
	string s;
	int k; cin>>s>>k;
	int n=s.length();

	rep(i,n){
		if(s[i]!='a' && k>=26-(s[i]-'a')){
			k-=26-(s[i]-'a');
			s[i]='a';
		}
	}
	s[n-1]='a'+(s[n-1]-'a'+k)%26;

	cout<<s<<'\n';

	return 0;
}


Measured memory_bytes: 512
import java.io.*;
import java.util.*;
class Main {
	
	BufferedReader in;
	PrintWriter ob;
	StringTokenizer st;
	
	public static void main(String args[]) throws IOException {
		new Main().run();
	}
	void run() throws IOException {
		in = new BufferedReader( new InputStreamReader( System.in ) );
		ob = new PrintWriter( System.out );
		solve();
		ob.flush();
	}
	
	void solve() throws IOException {
		int n = ni();
		int a[][] = new int[n+1][4]; 
		for(int i=1 ; i<=n ; i++) {
			a[i][1] = ni();
			a[i][2] = ni();
			a[i][3] = ni();
		}
		
		if( n<=0 ) {
			ob.println("0");
			return;
		}
		
		long dp[][] = new long[n+1][4];
		dp[1][1] = a[1][1];
		dp[1][2] = a[1][2];
		dp[1][3] = a[1][3]; 
		for(int i=2 ; i<=n ; i++) {
			dp[i][1] =  a[i][1] + Math.max( dp[i-1][2] , dp[i-1][3] );
			dp[i][2] =  a[i][2] + Math.max( dp[i-1][1] , dp[i-1][3] );
			dp[i][3] =  a[i][3] + Math.max( dp[i-1][1] , dp[i-1][2] );
		}
			
		ob.println( Math.max( dp[n][1] , Math.max( dp[n][2] , dp[n][3] )  ) );
	}
	
	int ni() throws IOException {
		return Integer.parseInt( nextToken() );
	}
	
	String nextToken() throws IOException {
		if( st == null || !st.hasMoreTokens() )
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
}

Measured memory_bytes: 49396
N, K = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

dp = Array.new(K + 1, false)
(0..K).each do |k|
  A.each do |a|
    if k - a >= 0
      dp[k] ||= !dp[k - a]
    end
  end
end
puts(dp[K] ? 'First' : 'Second')

Measured memory_bytes: 2556
import numpy as np

N, K = map(int, input().split())
H = np.array([int(i) for i in input().split()])

dp = np.full(N, np.inf, int)
dp[0] = 0
for i in range(1, N):
    dp[i] = min(dp[max(i-K, 0):i]+np.abs(H[max(i-K, 0):i]-H[i]))
    
print(dp[N-1])

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

int main()
{
    ll n, m;
    cin >> n >> m;
    vector<P> a(n);
    rep(i, n) cin >> a[i].first >> a[i].second;
    sort(a.begin(), a.end());
    ll ans = 0;
    ll cnt = 0;
    ll i = 0;
    do {
        cnt += a[i].second;
        ans += a[i].first * a[i].second;
        i++;
    } while(cnt < m);
    ans -= (cnt - m) * a[i - 1].first;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define RFOR(i,a,b) for(long long i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<P> Graph;

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

  int n;
  cin >> n;
  
  int a[n]; ll sum = 0;
  REP(i,n){
    cin >> a[i];
    a[i] -= (i+1);
    sum += a[i];
  }
 
  sort(a,a+n);
  
  int l = -a[n/2];
  
  ll ans = 0;
  REP(i,n){
    a[i] += l;
    ans += abs(a[i]);
  }
  
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
n=int(input())
L=list(map(int,input().split()))
s=0
t=0
p=10**9+7
x=5*10**8+4
for i in range(0,n):
	s=(s+L[i])%p
	t=(t+L[i]*L[i])%p

ans=x*(pow(s,2,p)-t)

print(ans%p)

Measured memory_bytes: 94288
import math
triangle_list = [0 for i in range(4)]
while(True):
    point = list(map(int,input().split()))
    point=sorted(point)
    z = math.sqrt(point[0]**2 + point[1]**2)

    if point[2] >= (point[1]+ point[0]):
        break
    elif point[2] < z:
        triangle_list[0] += 1
        triangle_list[2] += 1
    elif point[2] == z:
        triangle_list[0]+= 1
        triangle_list[1]+= 1
    elif point[2] > z:
        triangle_list[0] += 1
        triangle_list[3] += 1

print("{0[0]} {0[1]} {0[2]} {0[3]}".format(triangle_list))



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

int main(void)
{
    int n;
    string s;
    cin >> n >> s;

    rep(i, s.size())
    {
        char a = static_cast<char>(s.at(i)) + n;
        if (a > 'Z') a -= 26;
        cout << a;
    }
    cout << endl;
}



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

int main(){
  vector<pair<int, pair<int, int> > > v;
  int x, y, z;
  
  for(int i=1;i<=150;i++)
    for(int j=1+i;j<=150;j++)
      v.push_back(make_pair(i*i+j*j, make_pair(i, j)));
 
  sort(v.begin(), v.end());
  /* for ( int i = 0; i < v.size(); i++ ){
    cout << v[i].first << " " << v[i].second.first << " " << v[i].second.second << endl;
    }*/
  
  while(1){
    int h,w,mem;
    scanf("%d%d",&h,&w);
    if(h==0 & w==0) break;
    for(int i=0;;i++){
      if((h*h+w*w)==v[i].first && v[i].second.first==h && v[i].second.second==w){
	mem=i;
	break;
      }
    }
    printf("%d %d\n",v[mem+1].second.first,v[mem+1].second.second);
  }
  return 0;
}

Measured memory_bytes: 1320
s_list = list(input())
l = len(s_list)

t = False
if l%4 == 1:
    c_num = int((l-1)/4)
    c_l = s_list[:c_num]
    t_1 = s_list[c_num:2*c_num][::-1]
    t_2 = s_list[2*c_num+1:3*c_num+1]
    t_3 = s_list[3*c_num+1:][::-1]

    if c_l == t_1 == t_2 == t_3:
        t = True

if l % 4 == 3:
    c_num = int((l - 3) / 4)
    c_l = s_list[:c_num]
    t_1 = s_list[c_num+1 :2 * c_num + 1][::-1]
    t_2 = s_list[2 * c_num + 2:3 * c_num + 2]
    t_3 = s_list[3 * c_num + 3:][::-1]

    if (c_l == t_1 == t_2 == t_3) and (s_list[c_num] == s_list[3*c_num+2]):
        t = True

if t:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 38384
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>

using namespace std;

int n;
int l[100];

int main()
{
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> l[i];
    }

    sort(l, l + n);
    int sum = 0;
    for (int i = 0; i < n - 1; ++i)
    {
        sum += l[i];
    }
    if (sum > l[n - 1])
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define print(a) cout << (a) << endl; 
typedef long long ll;

int main() {
    int l; 
    cin >> l; 
    double l1 = (double)(l) / 3.0;
    double ret = l1 * l1 * l1;
    cout << setprecision(16) << ret << endl;
    return 0;
}

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

int main()
{
	char s[3];
    cin>>s;
    if(s[0]=='A' && s[1]=='A' && s[2]=='A'){ cout<<"No";}
    else if(s[0]=='B' && s[1]=='B' && s[2]=='B'){ cout<<"No";}
    else {cout<<"Yes";}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll n;
	cin>>n;
	ll sum=0;
	for(ll i=1;i<n;i++)
	sum+=i;

	if(n==1)cout<<0;
	else
	cout<<sum<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
using namespace std;
#define LL long long 
#define LD long double
string s,t;
int main()
{
	cin>>s>>t;
	cout<<t<<s<<endl;	
}

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

int h, w;
string s;
int main() {
	cin >> h >> w;
	for(int i=1; i<=h; i++) for(int j=0; j<w; j++) {
		cin >> s;
		if(s=="snuke") {
			printf("%c%d", j+'A', i);
		}
	}
	return 0;
}


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


def solve(N: int, a: "List[int]"):
    currentIndex = 1
    discarded = 0
    for i in range(N):
        if a[i] != currentIndex:
            discarded += 1
        else:
            currentIndex += 1
    if discarded == N:
        print(-1)
        exit()
    print(discarded)
    return


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


if __name__ == '__main__':
    main()


Measured memory_bytes: 26356
#include<bits/stdc++.h>
using namespace std;
string s;
string k = "keyence";
int main(void){
	cin >> s;
	int l = s.size();
	for(int i=0;i<l;i++){
		for(int j=i;j<l;j++){
			string tmp = s.substr(0,i)+s.substr(j,l-j);
			if(k.compare(tmp)==0){
				cout << "YES";
				return 0;
			}
		}
	}
	cout << "NO";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  int maxl=0;
  int minr=100001;
  vector<int> l(m);
  vector<int> r(m);
  vector<int> cardcount(n);
  for(int i=0;i<m;i++){
    cin>>l[i]>>r[i];
    maxl=max(l[i],maxl);
    minr=min(minr,r[i]);
    }
  cout<<max(0,minr-maxl+1)<<endl;
}


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


def solve(N: int, K: int):
    t = N % K
    ans = min(t, K - t)
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)


if __name__ == "__main__":
    main()


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

int sum;
int main() {
  int N;
  cin >> N;
  
  for (int i = 0; i < N; i++) { 
    int l, r;
    cin >> l >> r;
    sum += r - l + 1;
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
/*input
9
*/
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define mod 1000000007
#define inf 1000000000000000001
#define all(c) c.begin(),c.end()
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define sz(a) int((a).size())
#define pb push_back
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())     
#define rep(i,j,n) for(ll i=j;i<n;i++)
#define mp make_pair
#define N 998244353
#define PI acos(-1.0)
//if (s.find('R') != std::string::npos)
//s.replace(s.find("10"), sizeof("10") - 1, "");
using namespace std;

int main()
{
  // added the two lines below 
  ios_base::sync_with_stdio (false); 
  cin.tie(NULL);
  cout.tie(0);

  ll x,a;
  cin>>x>>a;
  (x<a)?cout<<0:cout<<10;
  
  }

Measured memory_bytes: 256
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)*}
    };

    ($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")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize
    }
    println!("{}", n * n);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define pii pair<double,double>
#define x first
#define y second
int n,s[4];
pii f[310][310][310];
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;i++)
	{
		int x;
		scanf("%d",&x);
		s[x]++;
	}
	f[s[1]][s[2]][s[3]].x=1;
	for (int l=n;l;l--)
	{
		for (int k=min(l,s[3]);k>=0;k--)
		{
			for (int j=min(s[2]+s[3]-k,l-k);j>=0;j--)
			{
				int i=l-k-j;
				double tmp=1.0*n/l;
				double x=f[i][j][k].x,y=f[i][j][k].y;
				//cerr<<i<<" "<<j<<" "<<k<<endl;
				//cerr<<x<<" "<<f[i][j][k].y<<endl;
				if (k)
				{
					f[i][j+1][k-1].x+=x*k/l;
					f[i][j+1][k-1].y+=y*k/l+x*k/l*tmp;
					//f[i][j+1][k-1]+=tmp*k+f[i][j][k];
				}
				if (j)
				{
					f[i+1][j-1][k].x+=x*j/l;
					f[i+1][j-1][k].y+=y*j/l+x*j/l*tmp;
					//f[i+1][j-1][k]+=tmp*j+f[i][j][k];
				}
				if (i)
				{
					f[i-1][j][k].x+=x*i/l;
					f[i-1][j][k].y+=y*i/l+x*i/l*tmp;
					//f[i-1][j][k]+=tmp*i+f[i][j][k];
				}
			}
		}
	}
	printf("%.11lf\n",f[0][0][0].y);
	return 0;
}


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

int main()
{
    int n;cin>>n;
    vector<int> x(n);
    vector<int> x2(n);
    int i;
    for(i=0;i<n;i++)cin>>x.at(i);
    for(i=0;i<n;i++)x2.at(i)=x.at(i);
    sort(x2.begin(),x2.end());
    int med1,med2;
    med1=x2.at(n/2-1);
    med2=x2.at(n/2);
    for(i=0;i<n;i++)
    {
        if(x.at(i)<=med1)cout<<med2<<endl;
        else cout<<med1<<endl;
    }
}


Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <regex>

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using pl4 = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
using vpl4 = vector<pl4>;
using vvpl4 = vector<vpl4>;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define rFOR(i,a,b) for(int i=(b);i>=(a);i--)
#define SORT(a) sort((a).begin(),(a).end());
#define rSORT(a) sort((a).rbegin(),(a).rend());
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end());
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Say(a) cout <<(a);
#define Sal(a) cout <<(a)<<endl;

const ll MOD = 1e9+7;
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}

int isP(int n) {
    if(n<=1) return 0;
    FOR(i,2,(int)sqrt(n)) {
        if(n%i==0) return 0;
    }
    return 1;
}

//sankou
//vvi = vector<vector<int>>(20, vector<int>(10, 0));

//seiki
//#include <regex>
/*bubun*/
//regex_search("u32", regex("[0-9]"));      // true
/*kanzen*/
//regex_match("u32", regex("(i|u)\\d+"));   // true

int main() {

    ll N,cnt=0,tmp=0,now=0;
    cin >>N;
    vll A(N);
    vpl4 B;
    FOR(i,0,N-1){
        cin >>A[i];
    }
    SORT(A);
    
    FOR(i,0,N-1){
        if(now!=A[i]){
            now=A[i];
            cnt+=(tmp%2);
            tmp=0;
        }
        if(now==A[i]){
            tmp++;
        }
    }
    cnt+=(tmp%2);
    Sal(cnt);
    
    return 0;
}

Measured memory_bytes: 1024
//By Don4ick 
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;

#define forn(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define y1 qewr1234

const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};

const int M = 2000;
const int N = (int)5e5 + 228;
const int MOD = (int)1e9 + 7;

using namespace std;

ll binpow(ll a, ll b)
{
	ll res = 1;
	while(b)
	{
		if (b & 1)
			res = res * a % MOD;
		b >>= 1;	
		a = a * a % MOD;
	}
	return res;
}

int n, a[N], b[N], cnt[M + M + 5][M + M + 5], dp[M + M + 5][M + M + 5];
ll f[M + M + M + M + 5];

ll C(int x, int y)
{
	return f[x] * binpow(f[y], MOD - 2) % MOD * binpow(f[x - y], MOD - 2) % MOD;
}

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

	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);

	//~read
	scanf("%d", &n);
	forn(i, n)
		scanf("%d%d", &a[i], &b[i]);
	//~precalc_cnt
	forn(i, n)
	{
		cnt[M - a[i]][M - b[i]]++;
		cnt[a[i] + M][b[i] + M]++; 
	}
	//~calc_dp
	for (int i = M + M; i >= 0; i--)
	{
		for (int j = M + M; j >= 0; j--)
		{
			dp[i][j] = dp[i + 1][j] + dp[i][j + 1];
			if (dp[i][j] >= MOD)
				dp[i][j] -= MOD;
			if (i > M && j > M)
			{
				dp[i][j] += cnt[i][j];
				if (dp[i][j] >= MOD)	
					dp[i][j] -= MOD;
			}
		}
	}
	//~precalc
	f[0] = 1;
	for (int i = 1; i < M + M + M + M + 1; i++)
		f[i] = f[i - 1] * i % MOD;
	//~calc_ans
	ll ans = 0;
	for (int i = 0; i < M; i++)
		for (int j = 0; j < M; j++)
			ans = (ans + 1ll * dp[i][j] * cnt[i][j]) % MOD;
	forn(i, n)
	{	
		ans = (ans - C(a[i] + a[i] + b[i] + b[i], a[i] + a[i]) + MOD);
		if (ans >= MOD)
			ans -= MOD;
	}
	ans = ans * binpow(2, MOD - 2) % MOD;
	cout << ans << endl; 
		

	return 0;
}



Measured memory_bytes: 129280
#Write a program which reads an integer S [second] and converts it to h:m:s where h, m, s denote hours, minutes (less than 60) and seconds (less than 60) respectively.
s=int(input())
h=s//3600
m=(s-h*3600)//60
s=s%60
print(str(h)+":"+str(m)+":"+str(s))


Measured memory_bytes: 5588
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int K = Integer.parseInt(sc.next());
        int X = Integer.parseInt(sc.next());

        int start = X - K + 1;
        int end = X + K;
        for (int i = start; i < end; i++) {
            System.out.print(i + " ");
        }
    }
}


Measured memory_bytes: 23508
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define vcout(v) rep(i,v.size()) cout << v[i] << " "; cout << endl
#define mcout(m) rep(j,m.size()){vcout(m[j]);}

void mainsolve(){
	// S - digit sum

	const ll MOD = 1e9 + 7;
	string s;
	cin >> s;
	vector<ll> ss(s.size());
	rep(i,s.size()) ss[i] = s[i] - '0';
	ll d;
	cin >> d;

	ll dp[ss.size()][2][d];
	memset(dp,0,sizeof(dp));

	rep(i,10){
		if(i<ss[0]) dp[0][1][i%d]++;
		else if(i==ss[0]) dp[0][0][i%d]++;
	}

	rep(i,ss.size()-1) rep(j,2) rep(k,d) {
		ll nn; j == 1 ? nn=10 : nn=ss[i+1]+1; 
		rep(next,nn){ 
			(dp[i+1][j || (next<ss[i+1])][(k+next)%d] += dp[i][j][k]) %= MOD;
		}
	}

	ll res = (dp[ss.size()-1][0][0] + dp[ss.size()-1][1][0]) % MOD;
	cout << (res - 1 + MOD) % MOD << endl;
	return;
}

int main(){
	
	// TC;cin>>TC;rep(I,TC){cout<<"case:"<<I+1<<"---"<<endl; // comment out!
	mainsolve();
	//// comment out!
	return 0;
}

Measured memory_bytes: 16000
#include <stdio.h>

int BC(int b, int c, int x){
    int pat=0;
    if(x == 0)return 1;
    while(b>=0 && x>=0){
        if(x <= 50*c)pat++;
        x-=100;
        b--;
    }
    return pat;
}

int main(void){
    int i, coin[3], x, pat=0;
    for(i=0; i<3; i++)scanf("%d", &coin[i]);
    scanf("%d", &x);
    for(; coin[0]>=0 && x>=0; coin[0]--, x-=500){
        pat+=BC(coin[1], coin[2], x);
    }
    printf("%d",pat);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define vec(type) vector<type>

int main() {
    string s;
    cin >> s;

    string a = "AKIHABARA";
    for (int i = 0; i < 9; i++) {
        if (s[i] != a[i]) {
            s.insert(i,"A");
            if (s[i] != a[i]) {
                cout << "NO" << endl;
                return 0;
            }
        }
    }
    if (s.size() != 9) cout << "NO" << endl;
    else cout << "YES" << endl;
}

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

int main(){
    while(1){
        int n,x;
        cin >> n >> x;
        int count=0;
        if(n+x==0){
            return 0;
        }else{
            for(int i = 1; i <= n-2; i++){
                for(int j=i+1; j<=n-1; j++){
                    for(int k=j+1; k<=n; k++){
                        if(i+j+k == x){
                            count++;
                        }
                    }
                }
            }
            
            cout << count << endl;
        }
    }
}


Measured memory_bytes: 3096
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using static MyIO;


public class C
{
	public static void Main()	
	{
		int n = GetInt();
		string[] S = new string[n];
		for(int i = 0; i < n; i++)
			S[i] = GetString();
		
		int[] minNum = new int[26];
		for(int i = 0; i < 26; i++)
			minNum[i] = int.MaxValue;
		for(int i = 0; i < n; i++)
		{
			string str = S[i];
			int[] num = new int[26];
			for(int j = 0; j < str.Length; j++)
				num[(int)(str[j] - 'a')]++;
			for(int j = 0; j < 26; j++)
				minNum[j] = Math.Min(minNum[j], num[j]);
		}

		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < 26; i++)
			for(int j = 0; j < minNum[i]; j++)
				sb.Append((char)(i + 'a'));
		Console.WriteLine(sb);
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}


Measured memory_bytes: 13140
class Game
  def initialize
    @card_num = 0
    @a_cards = []
    @b_cards = []
    @a_total = 0
    @b_total = 0
  end

  def input card_num
    @card_num = card_num
    card_num.times do
      a,b = gets.chomp.split(' ').map{|x|x.to_i}
      @a_cards << a
      @b_cards << b
    end
  end

  def exec
    @card_num.times do |idx|
      if @a_cards[idx] > @b_cards[idx]
        @a_total = @a_total + @a_cards[idx] + @b_cards[idx]
      elsif @a_cards[idx] < @b_cards[idx]
        @b_total = @b_total + @a_cards[idx] + @b_cards[idx]
      else
        @a_total += @a_cards[idx]
        @b_total += @b_cards[idx]
      end
    end
  end

  def print
    puts "#{@a_total} #{@b_total}"
  end
end

class AllGame
  def initialize
    @games = []
  end

  def input
    loop do
      card_num = gets.chomp.to_i
      break if card_num == 0
      game = Game.new
      game.input card_num
      @games << game
    end
  end

  def exec
    @games.each do |game|
      game.exec
    end
  end

  def print
    @games.each do |game|
      game.print
    end
  end
end

all_game = AllGame.new
all_game.input
all_game.exec
all_game.print

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

int main() {
    int h, w;
    cin >> h >> w;

    vector<string> c(h);
    for (int i = 0; i < h; i++) cin >> c.at(i);

    for (int i = 0; i < h; i++) {
        cout << c.at(i) << endl;
        cout << c.at(i) << endl;
    }

    return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
int abs(int x,int y){
  if (x-y>=0){
    return x-y;
  }
  else{
    return y-x;
  }
}

int main(){
  int K,N;
  cin >> K >> N;
  vector<int> A(N);
  for(int i=0; i<N; i++){  
    cin >> A.at(i);
  }
  
  int max = (A.at(0)+(K-A.at(N-1)));
  for (int i=0; i<N-1; i++){
    if (max < abs(A.at(i),A.at(i+1))){
      max = abs(A.at(i),A.at(i+1));
    }
  }
  
  cout << K - max << endl;
}
  
  



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;
    int A = (a * b) % 2; 
  if (A == 0) {
    cout << "Even"<< endl;
  }
  if (A == 1) {
    cout << "Odd" << endl;
  }
}


Measured memory_bytes: 256
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

// ここまで

fn run() {
    input! {
        s: chars,
        d: usize,
    }
    const MOD: u64 = 1000000007;
    let mut dp = vec![0; d];
    let mut sup = 0;
    for c in s {
        let mut next = vec![0; d];
        for i in 0..d {
            for j in 0..10 {
                next[(i + j) % d] += dp[i];
            }
        }
        let k = c.to_digit(10).unwrap()as usize;
        for i in 0..k {
            next[(sup + i) % d] += 1;
        }
        sup = (sup + k) % d;
        for i in 0..d {
            dp[i] = next[i] % MOD;
        }
    }
    let ans = (dp[0] + if sup == 0 {1} else {0} + MOD - 1) % MOD;
    println!("{}", ans);
}

fn main() {
    run();
}


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

int main() {
	string S;
	cin >> S;
	int i = (S.length() - 1) / 2, j = S.length() / 2;
	if (S[i] == S[j]) {
		i --;
		j ++;
		for (;i >= 0 && S[i] == S[i + 1] && S[j] == S[j - 1];i --, j ++);
	} else {
	}
	cout << j;
	return 0;
}
/*

まず、次の点に注目する
長さKの時、文字列Sにおいて長さK+1以上の場所は長さKをひっくり返し長さK+1をひっくり返せば揃う
よって長さK+1以上は無視できる
逆側も同様
よってその内側を考えれば良い
例えば長さ8の時
AAAAABBBAAAAA
を考える
Aは先ほどの議論から任意の値にできる
逆にBは常にひっくり返る対象になる
よって、Bは全て0か全て1である必要がある
ところで、次のことを考える
→全て0の要素を持つ上の条件の文字列をBのみ1、他は0の要素を持つ文字列にできるか？
これは、長さ6、K=4の下の例を見れば分かる
000000
111111
000011
001100
よって可能であると言える
よって、後はBの長さのみ考えよ
ちなみに長さ8、K=4みたいなのはAAABBAAA
*/

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10; //1e-9?
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int n, x; cin >> n >> x;
    int now = 0, ans = 1;
    FOR(i, 0, n) {
        int l; cin >> l;
        now += l;
        if (x < now)break;
        ++ans;
    }
    cout << ans << "\n";
}

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

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a > b) {
        swap(a, b);
    }
    if (a > c) {
        swap(a, c);
    }
    if (b > c) {
        swap(b, c);
    }
    cout << c*10 + b + a << endl;
}

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

map<char,int> f;

void foo(){
	for(int i=0 ; i<16 ; ++i ){
		if( i < 10 )
			f[(char)(i+'0')] = i;
		else
			f[(char)(i-10+'a')] = i;
	}
}

int to_i(char c1,char c2){
	return f[c1]*16+f[c2];
}

vector<int> solve(string s){
	int R = to_i( s[1] , s[2] );
	int G = to_i( s[3] , s[4] );
	int B = to_i( s[5] , s[6] );
	vector<int> color;
	color.push_back( R );
	color.push_back( G );
	color.push_back( B );
	return color;
}

int main(){
	const int t[8][3] = {
		{ 0 , 0 , 0 },
		{ 0 , 0 ,255},
		{ 0 ,255, 0 },
		{ 0 ,255,255},
		{255, 0 , 0 },
		{255, 0 ,255},
		{255,255, 0 },
		{255,255,255}
	};
	const string colorName[8] = {"black","blue","lime","aqua","red","fuchsia","yellow","white"};
	foo();

	string s;
	while( cin >> s , s != "0" ){
		vector<int> color = solve( s );
		int Rk = color[0];
		int Gk = color[1];
		int Bk = color[2];
		int ans = 0;
		int dk = 255*3+1;
		//cout << "R:" << Rk << " G:" << Gk << " B:" << Bk << endl;
		
		for(int i=0 ; i<8 ; ++i ){
			int R = t[i][0];
			int G = t[i][1];
			int B = t[i][2];
			dk = min( abs(Rk-R)+abs(Gk-G)+abs(Bk-B) , dk );
		}

		for(int i=0 ; i<8 ; ++i ){
			int R = t[i][0];
			int G = t[i][1];
			int B = t[i][2];
			if( abs(Rk-R)+abs(Gk-G)+abs(Bk-B) == dk ){
				ans = i;
				break;
			}
		}
		cout << colorName[ ans ] << endl;
	}
}

Measured memory_bytes: 0
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var sum int
	for i := 1; i <= n; i++ {
		if i%3 != 0 && i%5 != 0 {
			sum += i
		}
	}
	fmt.Println(sum)
}


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

using namespace std;

int main(int argc, char** argv){
    string S;
    cin >> S;
    string ans = "Yes\n";
    if (S.length()%2 == 1){
        cout << "No\n";
        return 0;
    }
    for (size_t i=0; i<S.length(); i++){
        if (i%2 == 0){
            if (S[i] != 'h'){
                ans = "No\n";
                break;
            }
        } else {
            if (S[i] != 'i'){
                ans = "No\n";
                break;
            }
        }
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 256
/* ex5_3
	kanon */

#include <stdio.h>
#include <stdlib.h>
#define LIMIT 100

int main(void)
{
    //与えられる値を入れる数を宣言
    int height, width, flag = 0;

    //変数に値を入力する
    scanf("%d %d", &height, &width);
    int row_bool[height], column_bool[width];
    char a[height][width];

    for (int i = 0; i < height; i++)
    {
        for (int j = 0; j < width; j++)
        {
            scanf(" %c", &a[i][j]);
        }
    }

    //行と列のbool配列を作る
    for (int i = 0; i < height; i++)
        row_bool[i] = 1;
    for (int i = 0; i < width; i++)
        column_bool[i] = 1;

    //完全に.のみの行と列を見つける
    for (int i = 0; i < height; i++)
    {
        flag = 1;
        for (int j = 0; j < width; j++)
        {
            if (a[i][j] != '.')
                flag = 0;
        }
        //完全に.のみの行はfalseに変える
        if (flag)
            row_bool[i] = 0;
    }

    for (int i = 0; i < width; i++)
    {
        flag = 1;
        for (int j = 0; j < height; j++)
        {
            if (a[j][i] != '.')
                flag = 0;
        }
        //完全に.のみの列はfalseに変える
        if (flag)
            column_bool[i] = 0;
    }

    //答えを出力
    for (int i = 0; i < height; i++)
    {
        if (row_bool[i])
        {
            for (int j = 0; j < width; j++)
            {
                if (column_bool[j])
                {
                    printf("%c", a[i][j]);
                }
            }
            printf("\n");
        }   
    }

    return 0;
}


Measured memory_bytes: 128
// import chie template :) {{{
import std.stdio,
       std.algorithm,
       std.array,
       std.string,
       std.math,
       std.conv,
       std.range,
       std.container,
       std.bigint,
       std.ascii,
       std.typecons;
// }}}
// tbh.scanner {{{
class Scanner {
  import std.stdio;
  import std.conv : to;
  import std.array : split;
  import std.string : chomp;

  private File file;
  private dchar[][] str;
  private uint idx;

  this(File file = stdin) {
    this.file = file;
    this.idx = 0;
  }

  private dchar[] next() {
    if (idx < str.length) {
      return str[idx++];
    }

    dchar[] s;
    while (s.length == 0) {
      s = file.readln.chomp.to!(dchar[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)() {
    return next.to!(T);
  }

  T[] nextArray(T)(uint len) {
    T[] ret = new T[len];

    foreach (ref c; ret) {
      c = next!(T);
    }

    return ret;
  }
}
// }}}

void main() {
  auto cin = new Scanner;
  int n = cin.next!int,
      a = cin.next!int;

  if (n % 500 <= a) {
    writeln("Yes");
  } else {
    writeln("No");
  }
}


Measured memory_bytes: 256
using System;
using System.Linq;
namespace ConsoleApp68
{
    class Program
    {
        static void Main(string[] args)
        {

            //var ret = 0;

            var l = Console.ReadLine().Split(' ').Select(double.Parse).ToArray();

            var ret = l[0] / l[2]  > l[1] ? "No" :   "Yes";


            Console.WriteLine(ret);
        }
    }
}


Measured memory_bytes: 28228
#include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; i < (long long)n; i++)
//#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Vl = vector<ll>;
using vi = vector<int>;
using Graph = vector<vi>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(15); //"for float-base
  // problem"
  int N;
  cin >> N;
  vi L(2 * N);
  REP(i, 2 * N) cin >> L.at(i);
  sort(L.begin(), L.end());
  int ans = 0;
  REP(j, 2 * N) {
    if (j % 2 == 0) ans += L.at(j);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define ff first
#define ss second
#define p pair<ll,ll>
#define pb push_back
#define endl '\n'
#define w(t) ll test;cin>>test;while(test--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
#define iof  freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define pi acos(-1)
int fx[]={0,0,1,-1,1,1,-1,-1};
int fy[]={1,-1,0,0,-1,1,-1,1};
const int mxn=1e5+7;

int main()
{
    fast;
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll mx=max({a*d,a*c,b*c,b*d});
    cout<<mx<<endl;
}



Measured memory_bytes: 3644
#include <iostream>
#include<iomanip>
using namespace std;
int main(){
    string s,t;
    int q,hanten=0;
    cin >> s;
    cin >>q;
    for(int i=0;i<q;i++){
        int a;
        cin >> a;
        if(a==1){
            if(hanten==0){
                hanten = 1;
            }else{
                hanten = 0;
            }
        }else{
            cin >> a;
            string b;
            if(a==1&&hanten==0){
                cin >> b;
                t = t + b;
            }else if(a==2&&hanten==0){
                cin >> b;
                s = s + b;
            }else if(a==2&&hanten==1){
                cin >> b;
                t = t + b;
            }else{
                cin >> b;
                s = s + b;
            }
        }
    }
    if(hanten==0){
        int size = t.size();
        for(int i=0;i<size;i++){
            cout << t[size-1-i];
        }
        cout << s << endl;
    }else{
        int size = s.size();
        for(int i=0;i<size;i++){
            cout << s[size-1-i];
        }
        cout << t << endl;
    }
}

Measured memory_bytes: 1596
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main {

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static class Node {
        int val;
        int to;

        public Node(int val, int to) {
            this.val = val;
            this.to = to;
        }
    }

    // int N = scanner.nextInt();
    // scanner.nextLine();
    // int[] n = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    static void solve(Scanner scanner) {
        int N = scanner.nextInt(), M = scanner.nextInt();
        scanner.nextLine();
        Map<Integer, Set<Integer>> edges = new HashMap<>();
        for (int i = 0; i < M; i++) {
            int[] q = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
            if (!edges.containsKey(q[0])) {
                edges.put(q[0], new HashSet<>());
            }
            edges.get(q[0]).add(q[1]);
            if (!edges.containsKey(q[1])) {
                edges.put(q[1], new HashSet<>());
            }
            edges.get(q[1]).add(q[0]);
        }
        TreeSet<Integer> rem = new TreeSet<>();
        for (int i = 1; i <= N; i++) {
            rem.add(i);
        }
        int ans = 0;
        while (!rem.isEmpty()) {
            ans++;
            int s = rem.first();
            dfs(edges, s, rem);
        }
        System.out.println(ans);
    }

    static void dfs(Map<Integer, Set<Integer>> edges, int s, Set<Integer> rem) {
        if (!rem.contains(s)) {
            return;
        }
        rem.remove(s);
        for (int n: edges.getOrDefault(s, Collections.emptySet())) {
            dfs(edges, n, rem);
        }
    }

}

Measured memory_bytes: 206756
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<cstring>

using namespace std;

#ifdef LDEBUG
#define debug(x) cout << #x << ":" << x << endl
#else
#define debug(...)
#endif

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

typedef unsigned long long u64;
typedef long long i64;

struct r{
        string s;
        int p;
        int idx;
} rs[150];

bool cmp(r &ll, r &rr) {
        if (ll.s != rr.s)
                return ll.s < rr.s;
        return ll.p > rr.p;
}

int n;

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

        cin >> n;

        REP(i,n) {
                cin >> rs[i].s >> rs[i].p;
                rs[i].idx = i + 1;
        }
        sort(rs,rs+n,cmp);

        REP(i,n)
                cout << rs[i].idx << endl;


        return 0;
}


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

vector<int> Homu ; 
int find(int homu){
    if(Homu[homu] < 0)return homu;
    return Homu[homu] = find(Homu[homu]);
}
bool unite(int homu, int pura){
    homu = find(homu);
    pura = find(pura);
    if(homu == pura)return false;
    if(Homu[homu] > Homu[pura])swap(homu, pura);
    Homu[homu] += Homu[pura];
    Homu[pura] = homu;
    return true;
}
bool same(int homu, int pura){
    return find(homu) == find(pura);
}
long long size(int homu){
    return -Homu[find(homu)];
}


int main(){
    long long homuhomuhomu, homuhomu;
    cin >> homuhomuhomu >> homuhomu;
    vector<pair<int,int>> HomuPura(homuhomu);
    for(auto& homupura : HomuPura){
        cin>> homupura.first >> homupura.second ;
    }
    vector<long long > HOMU(homuhomu);
    HOMU[homuhomu - 1] = homuhomuhomu * (homuhomuhomu - 1) / 2;
    Homu.resize(homuhomuhomu + 1, -1) ;
    for(int homura = homuhomu - 2 ; homura >= 0 ; --homura){
        int homu = HomuPura[homura+1].first, pura = HomuPura[homura+1].second ;
        HOMU[homura] = HOMU[homura + 1];
        if(!same(homu, pura)){
            HOMU[homura] -= size(homu) * size(pura) ;
        }
        unite(homu, pura);
    }

    for(auto homu : HOMU){
        cout<<homu<<endl;
    }

    return 0;
}

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

int main()
{
    int n;
    cin >> n;
    long long up = 0;
    long long down = 0;
    long long cu = 0;
    long long cd = 0;
    
    for(int i=0; i<n; i++){
        long long t;
        cin >> t;
        cu += t;
        cd += t;
        if(i%2 == 0 && cu <=0){
            up += abs(cu-1);
            cu = 1;
        }else if(i%2 ==1 && cu >=0){
            up += abs(cu+1);
            cu = -1;
        }
        
        if(i%2 == 1 && cd <=0){
            down += abs(cd-1);
            cd = 1;
        }else if(i%2 == 0 && cd >=0){
            down += abs(cd+1);
            cd = -1;
        }
    }
    
    cout << min(up, down) << endl;
    return 0;
}


Measured memory_bytes: 256