akhauriyash/Code-Regression huggingface dataset:
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cctype>


using namespace std;
#define modd 1000000007


typedef pair<long long, long long> pl;


typedef string::const_iterator State;
class ParseError {};




#define ll long long




/*
class UnionFind {
public:
	vector <ll> par;
	vector <ll> siz;
	vector <ll> gr;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) ,gr(sz_){
		for (ll i = 0; i < sz_; ++i) par[i] = i;
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}



	bool issame(ll x, ll y) { // 連結判定
		return root(x) == root(y);
	}

	ll size(ll x) { // 素集合のサイズ
		return siz[root(x)];
	}


};*/


long long N, M, K, a, b, c, d, e, H, W, L;
ll A[2][100005] = {};
ll B[2][100005] = {};
ll C[200005] = {};
bool f, ff;
string S;
set <long long>sll;
pl bufpl;
vector <long long>vl[3];
vector <pl>vpl;
vector <string> vs;
set<ll> llset;

/*struct ST
{
	long long Kati;
	int bangou;

	bool operator<(const ST& another) const
	{
		return Kati < another.Kati;//比較
	};

};



vector <ST> vst;
ST st[200005];
ST bufst;
bitset<5000> bits;*/


long long modinv(long long aa, long long mm) {
	long long bb = mm, uu = 1, vv = 0;
	while (bb) {
		long long tt = aa / bb;
		aa -= tt * bb; swap(aa, bb);
		uu -= tt * vv; swap(uu, vv);
	}
	uu %= mm;
	if (uu < 0) uu += mm;
	return uu;
}



ll minn, maxx;
double ansa;
bool fl[30] = {};

string ss, sss;

int main() {


	cin >> a;

	cout << (a - 30) / 2 << endl;

	return 0;

}



Measured memory_bytes: 3156
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> a(N), b(N);
    for(int i=0; i<N; i++) cin >> a[i];
    for(int i=0; i<N; i++) cin >> b[i];
    vector<int> c(N), d(N);
    for(int i=0; i<N; i++){
        if(a[i] >= b[i]){
            c[i] = 0;
            d[i] = a[i] - b[i];
        }else{
            if(a[i] % 2 == b[i] % 2){
                c[i] = (b[i] - a[i]) / 2;
                d[i] = 0;
            }else{
                c[i] = (b[i] + 1 - a[i]) / 2;
                d[i] = 1;
            }
        }
    }
    long long sma = 0, smb = 0;
    for(int i=0; i<N; i++) sma += c[i];
    for(int i=0; i<N; i++) smb += d[i];
    cout << ((sma >= smb) ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
  public static void main(String[] args){
    Scanner in = new Scanner(System.in);

    int N = in.nextInt();
    int i = 1000;
    
	while(i<N){
      i += 1000;
    }
    
    System.out.println(i - N);
  }
}

Measured memory_bytes: 35452
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <unistd.h>
#include <bits/stdc++.h>

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

using Graph = vector<vector<int>>;

typedef long long ll;
static const ll INF = 1000000000000000000LL;
static const ll MOD = 1000000007;


int main()
{
    int N,K;
    cin >> N >> K;
    vector <int> h(N);
    REP(i,N)cin >> h[i];
    sort(h.rbegin(),h.rend());

    ll res = 0;
    for(int i = K; i < N; ++i)
    {
        res += h[i];
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
#include<vector>
#include<cmath>
#define int long long int
const int maxn=21;
int32_t main()
{
    int x;
    cin>>x;
    if(x%11==0)
    {
		int answer=2*(x/11);
		cout<<answer<<endl;
	}
	else
	{
		int y=2*(x/11);
		x%=11;
        if(x>6)
          y+=2;
        else
           y++;
        cout<<y<<endl;
        
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n = 0;
  int a = 0;
    int b = 0;
    int count = 0;
    int prevcount = 0;
    int maxcount = 0;
    int shuturyoku = 0;

  cin >> n;
  
  for (int i = 0; i < n; i++){
    cin >> a;
    for (int j =0; j < 1000000000; j++){
      b = a / 2 * 2;
      if (b == a){
        count++;
        a /= 2;
        continue;
      }else{
        maxcount = count;
        prevcount = count;
        count = 0;
        break;
      }
    }
    if (i == 0){
     shuturyoku = maxcount;
    }else if(maxcount < shuturyoku){
      shuturyoku = maxcount;
    }
  }
       
  cout << shuturyoku << endl;
}


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

int main() {
  int x, a, b;
  cin >> x >> a >> b;

  if (-a + b <= 0) cout << "delicious" << endl;
  else if (-a + b <= x) cout << "safe" << endl;
  else cout << "dangerous" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int ans = 0;
	for (int i = 0; i < N; i++) {
		int l, r;
		scanf("%d %d", &l, &r);
		ans += (r - l) + 1;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"rprint.hpp"
#else
template <ostream& out = cout, class... T> void prints(T&&...){ }
template <ostream& out = cout, class... T> void printd(T&&...){ }
template <ostream& out = cout, class... T> void printde(T&&...){ }
template <ostream& out = cout, class... T> void printb(T&&...){ }
template <ostream& out = cout, class... T> void printArr(T&&...){ }
#endif

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll q, h, s, d;
    cin >> q >> h >> s >> d;
    ll n; cin >> n;
    n *= 100;
    struct p3{
        ll first, second, third;
        bool operator < (const p3& p) const{
            return first < p.first;
        }
    };
    vector<p3> v = {{q * 8, 25, q}, {h * 4, 50, h}, {s * 2, 100, s}, {d, 200, d}};
    sort(v.begin(), v.end());
    ll ans = 0;
    for(int i = 0; i < 4; i++){
        ll q = n / v[i].second;
        n -= q * v[i].second;
        ans += q * v[i].third;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
use proconio::input;

fn helper(v: usize) -> bool {
  if v <= 1 {
    return false
  }

  if v == 2 {
    return true
  }

  if v % 2 == 0 {
    return false
  }
  
  let mut index = 3;
  while index < v {
    if v % index == 0 {
      return false
    }
    index += 2;
  }

  true
}

fn main() {
  input! {
    x: usize
  }
  let max = 10usize.pow(5) + 10;
  
  for i in x..=max {
    if helper(i) {
      println!("{}", i);
      return
    }
  }
}

Measured memory_bytes: 2120
#include <iostream>

using namespace std;

int main(int argc, const char *argv[]) {
  int a, b;
  cin >> a >> b;
  if (a > b) {
    swap(a, b);
  }

  if (b <= 8) {
    cout << "Yay!" << '\n';
  } else {
    cout << ":(" << '\n';
  }
  return 0;
}

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

LL N;

int main(){
  scanf("%lld",&N);
  LL ans = 0;
  for ( LL i = 2 ; i * 1LL * i <= N; i++ ){
    if ( N % i == 0 ){
      int cnt = 0;
      while ( N % i == 0 ){
        N /= i;
        cnt++;
      }
      
      int j;
      for ( j = 1; j * (j+1) / 2 <= cnt ; j++ ){
        
      }
      ans += j-1;
    }
  }
  if ( N > 1 ) ans++;
  
  printf("%lld\n",ans);
  return 0;
}







Measured memory_bytes: 3740
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, lint> pll;
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;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
    int m, K;
    scanf("%d%d", &m, &K);
    if(m==0) puts(K==0 ? "0 0" : "-1");
    else if(m==1) puts(K==0 ? "0 0 1 1" : "-1");
    else if(K >= 1<<m) puts("-1");
    else{
        rep(i, 1<<m)if(i!=K) printf("%d ", i);
        printf("%d ", K);
        rrep(i, 1<<m)if(i!=K) printf("%d ", i);
        printf("%d\n", K);
    }
}

Measured memory_bytes: 1792
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-9;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

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

	cin >> N >> M;
	long long int ans = power(2, power(2, N, M - 1), M);
	vector<long long int>by(N + 1, 1);
	vector<long long int>rev(N + 1, 1);
	for (int i = 1; i <= N; i++) {
		by[i] = by[i - 1] * i%M;
		rev[i] = power(by[i], M - 2, M);
	}
	vector<long long int>two(N + 1, 1);
	vector<long long int>twoM1(N + 1, 1);
	for (int i = 1; i <= N; i++) {
		two[i] = two[i - 1] * 2 % M;
		twoM1[i] = twoM1[i - 1] * 2 % (M - 1);
	}
	vector<long long int>num(N + 1);
	num[0] = 1;
	for (int i = 1; i <= N; i++) {
		for (int j = i; j >= 0; j--) {
			if(j)num[j] = num[j] * (j+1)%M + num[j - 1];
			num[j] %= M;
		}
	//	for (int j = 0; j <= i; j++) {
	//		cout << i << " " << j << " " << num[j] << endl;
	//	}
		long long int ncr = by[N] * rev[i] % M*rev[N - i] % M;
		long long int add = 0;
		long long int numb = two[N - i];
	//	vector<long long int>dp(i + 1);
	//	dp[i] = power(2, twoM1[N - i], M);
	//	for (int j = 1; j <= i; j++) {
	//		for (int k = 0; k <= i; k++) {
	//			for (int l = k + j; l <= i; l += j) {
	//				long long int a = by[l - k] * power(rev[j], (l - k) / j, M) % M*rev[(l - k) / j] % M*by[l] % M*rev[k] % M*rev[l - k] % M;
	//				dp[k] += dp[l] * a%M*power(num, (l - k) / j, M) % M;
	//				dp[k] %= M;
	//			}
	//		}
	//	}

		//add = accumulate(dp.begin(), dp.end(), 0LL) % M*ncr%M;
		for (int j = 0; j <= i; j++) {
			add += num[j] * power(numb, j, M) % M*ncr%M;
			add %= M;
		}
		add *= power(2, twoM1[N - i], M);
		add %= M;
		if (i & 1) {
			ans += M - add;
			ans %= M;
		}
		else {
			ans += add;
			ans %= M;
		}
//		cout << ans << endl;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3724
#include <stdio.h>
int main(void){
    int n,i;
    scanf("%d",&n);
    char s[n+1];
    scanf("%s",s);
    int k=n/2;
    if(n%2==1){
        printf("No");
        return 0;
    }
    for(i=0;i<n/2;i++,k++){
        if(s[i]!=s[k]){
            printf("No");
            return 0;
        }
    }
    printf("Yes");
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define i64 long long
#define vi32 vector<int>
#define vi64 vector< long long>
#define  ii pair<int,int>
const  long long mod = 1e9 + 7, inf = 1e9, linf = 1 << 30; //linf = 9223372036854775807;
const long long hashmod[4] = { (int)1e9 + 2277, (int)1e9 + 5277, (int)1e9 + 8277, (int)1e9 + 9277 };
const long double EPS = 0.000000001L, pi = acos(-1);
using namespace std;
#define pb push_back
#define mp make_pair
#define N 200005
//int base = 311;
using namespace std;
int main()
{
    int n;
   cin>>n;
   vector<double> f(n);
   for(auto&z:f)cin>>z;
   sort(f.begin(),f.end());
   double cur=f[0]+f[1];
    cur/=2;
    for(int i=2;i<n;i++)
    {
        cur=(cur+f[i])/2;
    }
    cout<<cur;

   return 0;


}




/* Written by a random fan of Mr.Siro 

Association of people who died from abandonment

Gb_H

*/


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int>h(n);
    rep(i,n){
        cin>>h[i];
    }
    int maxv=0;
    rep(i,n){
        int memo=i;
        int cnt=0;
        while(i+1<n&&h[i]>=h[i+1]){
            ++cnt;
            i++;
        }
        maxv=max(maxv,cnt);
    }
    cout<<maxv<<endl;
    return 0;
    }


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

#define int long long 
typedef long long LL;
typedef pair<int, int> pii;

#define fst first
#define snd second
#define pb push_back
#define REP(i, a, b)  for(int i = (a), i##end = (b); i < i##end; ++i)
#define DREP(i, a, b) for(int i=(a-1), i##end = (b); i >=i##end; --i)

template <typename T> bool chkmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> bool chkmin(T& a, T b) { return a > b ? a = b, 1 : 0; }

const int maxn = 2e5 + 10;
const int oo = 0x7fffffff;

template<typename T> T read() {
	T n(0), f(1);
	char ch = getchar();
	for( ;!isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
	for( ; isdigit(ch); ch = getchar()) n = n * 10 + ch - 48; 
    return n * f;
}

vector<pii> Range;
long long R, C, N;

int idx(int x, int y) { 
    if(x == 0) return y;
    if(y == C) return x + C;
    if(x == R) return C + R + C - y;
    return C + R + C + R - x;
}
bool onedge(int x, int y) { return x == 0 || x == R || y == 0 || y == C; }

struct node {
    int x1, y1, x2, y2;
    void read(int i) {
        cin >> x1 >> y1 >> x2 >> y2;

        if(onedge(x1, y1) && onedge(x2, y2)) { 

            int l = idx(x1, y1);
            int r = idx(x2, y2);
            if(l > r) swap(l, r);
            Range.pb(pii(l, i));
            Range.pb(pii(r, i));
        }
    }
}P[maxn];

signed main() {
#ifdef Wearry
    freopen("data.txt", "r", stdin);
    freopen("ans.txt", "w", stdout);
#endif

    cin >> R >> C >> N;
    REP(i, 0, N) { P[i].read(i); }

    static int stk[maxn], top;
    static bool vis[maxn];

    sort(Range.begin(), Range.end());
    REP(i, 0, Range.size()) {
        if(!vis[Range[i].snd]) vis[Range[i].snd] = 1, stk[top++] = Range[i].snd;
        else {
            if(stk[top-1] != Range[i].snd) { return puts("NO"), 0; }
            else -- top;
        }
    }
    puts("YES");

    return 0;
}


Measured memory_bytes: 10608
using System;

class program
{

    public static void Main()
    {
        var faces = new int[6];
        var nums = Console.ReadLine().Split(' ');

        for (var i = 0; i < 6; i++)
        {
            faces[i] = int.Parse(nums[i]);
        }

        var dice = new Dice(faces);

        foreach (char command in Console.ReadLine())
        {
            dice.next(command.ToString());
        }

        Console.WriteLine(dice.FrontNum());
    }
}

public class Dice
{
    private int front;
    private int back; // rear
    private int up;
    private int down;
    private int left;
    private int right;

    public int FrontNum() { return this.front; }

    public Dice(int[] faces)
    {
        this.front = faces[0];
        this.down = faces[1];
        this.right = faces[2];
        this.left = faces[3];
        this.up = faces[4];
        this.back = faces[5];
    }

    public void next(string command){
        switch (command)
        {
            case "N":
                doN();
                break;
            case "E":
                doE();
                break;
            case "S":
                doS();
                break;
            case "W":
                doW();
                break;
        }
    }

    private void doN()
    {
        var buf = this.down;
        this.down = this.back;
        this.back = this.up;
        this.up = this.front;
        this.front = buf;
    }

    private void doE()
    {
        var buf = this.left;
        this.left = this.back;
        this.back = this.right;
        this.right = this.front;
        this.front = buf;
    }

    private void doS()
    {
        var buf = this.up;
        this.up = this.back;
        this.back = this.down;
        this.down = this.front;
        this.front = buf;
    }

    private void doW()
    {
        var buf = this.right;
        this.right = this.back;
        this.back = this.left;
        this.left = this.front;
        this.front = buf;
    }
}

Measured memory_bytes: 5716
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<string>
#include<bitset>
#include<cfloat>
#include<iomanip>
#include<numeric>

//#define int long long
#define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x,v) for(auto& (x) : (v))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fsort(v,lambda) sort(all((v)),(lambda))
#define vin(v) rep(i,(v).size())cin >> (v)[i];
#define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second

using namespace std;
using ll =  long long;
using pint =  pair<int,int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vpint = vector<pint>;

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; }
template<class T>void put_double(T a){if(cout.precision()!=12)cout<<setprecision(12);cout<<a<<endl;}
template<class T>void print(T a){cout << a << endl;}
//lambda: [](int x, int y){return x<y;}

signed main(void) {
    int n; cin >> n;
    set<char> s;
    rep(i, n) {
        char c; cin >> c;
        s.insert(c);
    }
    if(s.size() == 3) {
        print("Three");
    } else {
        print("Four");
    }

    return 0;
}


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

void solve(std::istream &ist, std::ostream &ost)
{
    /* ------- 宣言と入力 ------- */

    long long N, K;

    ist >> N >> K;

    /* ------- 計算 ------- */

    long long ans;

    if (N < K)
    {
        ans = min(abs(N - K), N);
        ost << ans << endl;
        return;
    }
    else if (N == K)
    {
        ost << "0" << endl;
        return;
    }
    else
    {
        int tmp = N % K;
        ans = min(N % K, abs(K - N % K));
        ost << ans << endl;
        return;
    }

    return;
}

#ifndef WOMAIN
int main()
{
    solve(std::cin, std::cout);
    return 0;
}
#endif


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
const int N = 2e5;
using namespace std;
int n,a[N + 5],y,tmp;
long long ans,f[10][10];
int main()
{
	scanf("%d",&n);
    for (int i = 1;i <= n;i++)
    {
        int l,c = 0,r;
        int x = i;
        r = x % 10;
        x = i;
        while (x)
        {
            l = x % 10;
            x /= 10;
            c++;
        }
        f[l][r]++;
        //cout<<ans<<endl;
    }
    for (int i = 1;i <= n;i++)
    {
        int l,c = 0,r;
        int x = i;
        r = x % 10;
        x = i;
        while (x)
        {
            l = x % 10;
            x /= 10;
            c++;
        }
        ans += f[r][l];
    }
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
// B - Cakes and Donuts
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)

int main(){
	int N; cin>>N;
	bool ok = false;
	rep(x, N/4+1) rep(y, N/7+1)
		if(N == 4*x + 7*y) ok = true;
	puts(ok? "Yes": "No");
}


Measured memory_bytes: 256
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).ok();
    let mut it = buf.split_whitespace();
    let n = it.next().unwrap().parse::<usize>().unwrap();
    let a : Vec<i64> = (0..n).map(|_| it.next().unwrap().parse::<i64>().unwrap()).collect();
    let mut sum = a.iter().fold(0, |sum, t| sum + t.abs());
    if a.iter().filter(|&&x| x < 0).collect::<Vec<_>>().len() % 2 == 1 {
        sum -= 2 * a.iter().map(|x| x.abs()).min().unwrap();
    }
    println!("{}", sum);
}


Measured memory_bytes: 8444
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=1000000007;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };


int main() {
	char b;
	cin>>b;
	if(b=='A') b='T';
	else if(b=='C') b='G';
	else if(b=='T') b='A';
	else b='C';

	cout<<b<<endl;
}

Measured memory_bytes: 256
//
//  main.cpp
//  NOMURA2020_A
//
//  Created by Joe Mori on 2020/05/30.
//  Copyright © 2020 Joe Mori. All rights reserved.
//

#include <iostream>

int main(int argc, const char * argv[]) {
    // insert code here...
    int s_min,s_hour,e_min,e_hour,duration;
    std::cin>>s_hour>>s_min>>e_hour>>e_min>>duration;
    std::cout<<(e_hour-s_hour)*60+e_min-s_min-duration<<std::endl;
    return 0;
}


Measured memory_bytes: 3596
using System;
using System.Linq;

namespace ABC075_A
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.WriteLine(n[0] == n[1] ? n[2] : n[0] == n[2] ? n[1] : n[0]);
        }
    }
}


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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define endl        "\n"
#define repp(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a,b) 	for(int i=a;i<=b;i++)
#define IOS         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int N=1e2 + 5;

int n;
int a[N];

int32_t main()
{
	IOS;
	cin >> n;
	rep(i,1,n)
	{
		cin >> a[i];
	}
	int best = INT_MAX;
	rep(i,-100,100)
	{
		int ans=0;
		rep(j,1,n)
		{
			ans += (a[j]-i)*(a[j]-i);
		}
		best = min(best,ans);
	}
	cout << best << endl;
}


Measured memory_bytes: 256
parseInt(x::String) = parse(Int, x)
parseInt(x::SubString{String}) = parse(Int, x)
parseInt(x::Char) = parse(Int, x)
parseInt(x::Float64) = trunc(Int, x)
parseFloat(x::String) = parse(Float64, x)
parseFloat(x::Int) = trunc(Float64, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    a,b=parseMap(split(readline()))
    ans=-1
    for i in 1:10000
        if parseInt(floor(i*1.08))==i+a && parseInt(floor(i*1.1))==i+b
            ans=i
            break
        end
    end
    println(ans)
end
main()

Measured memory_bytes: 112684
<?php
$abcd = fgets(STDIN);
//a,b,c,dに分ける
for($i=0;$i<4;$i++){
	$array[$i] = substr($abcd, $i,1);
}
//op1,op2,op3の全パターンを探索
for ($i=0;$i<8;$i++) {
	$sum = 0;
	$temp;
	//op1からop3までのループ
	for ($j=0;$j<3;$j++){
		//op1から判定
		if (($i&1<<$j)==(1<<$j)){
			if ($j==0){
				$sum += $array[$j] + $array[$j+1];
				$temp= $array[$j] . "+" . $array[$j+1];
			}else {
				$sum += $array[$j+1];
				$temp= $temp. "+" . $array[$j+1];
			}
		}else {
			if ($j==0){
				$sum += $array[$j] - $array[$j+1];
				$temp= $array[$j] . "-" . $array[$j+1];
			}else {
				$sum -= $array[$j+1];
				$temp= $temp. "-" . $array[$j+1];
			}
		}
		//op3までいって7だったら$ansにする
		if ($j==2 && $sum == 7){
			$ans = $temp . "=7";
		}
	}
}
echo $ans . "\n";

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

using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

int main (void) {
    int N,M;
    cin >> N >> M;
    vector<bool> A(N+3,false);
    REP(i,M) {
        int t;
        cin >> t;
        A[t] = true;
    }
    vector<ll> nn(N+3,0);
    nn[0] = 1;
    REP(i,N) {
        if (!A[i+1]) nn[i+1] += nn[i];
        nn[i+1] %= MOD;
        if (!A[i+2]) nn[i+2] += nn[i];
        nn[i+2] %= MOD;
    }
    cout << nn[N] << endl;
    //REP(i,N+1) cout << nn[i] << " \n"[i==N+1];
    return 0;
}

Measured memory_bytes: 1024
def main():
    s = input()
    t = input()

    len_s = len(s)
    len_t = len(t)

    DP = [[0] * (len_t + 1) for _ in range(len_s + 1)]

    for i in range(len_s):
        for j in range(len_t):
            if s[i] == t[j]:
                DP[i + 1][j + 1] = DP[i][j] + 1
            else:
                DP[i + 1][j + 1] = max(DP[i + 1][j], DP[i][j + 1])

    ans = ""
    i = len_s
    j = len_t
    while DP[i][j]:
        if s[i - 1] == t[j - 1]:
            ans += s[i - 1]
            i -= 1
            j -= 1
        else:
            if DP[i - 1][j] > DP[i][j -1]:
                i -= 1
            else:
                j -= 1

    print(ans[::-1])


if __name__ == '__main__':
    main()

exit()

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

using namespace std;

typedef long long int ll;

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

  ll n, l;
  cin >> n >> l;
  vector < ll > a(n + 1);
  for(int i = 1; i <= n; i++) cin >> a[i];
  int j = 0;
  for(int i = 1; i < n; i++){
    if(a[i] + a[i + 1] >= l) j = i;
  }

  if(j == 0) cout << "Impossible\n";
  else{
    cout << "Possible\n";
    for(int i = 1; i < j; i++) cout << i << '\n';
    for(int i = n - 1; i > j; i--) cout << i << '\n';
    cout << j << '\n';
  }
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  ll N,sum=0;
  cin>>N;
  ll a[100001];
  for(int i=0;i<=100000;i++){
    a[i]=0;
  }
  //cout<<a[99999];
  rep(i,N){
    ll n;
    cin>>n;
    a[n]++;
    sum+=n;
  }
  ll Q;
  cin>>Q;
  rep(i,Q){
    ll b,c;
    cin>>b>>c;
    ll B=a[b];
    a[b]=0;a[c]+=B;
    sum+=B*(c-b);
    cout<<sum/*<<" "<<a[100000]:*/<<endl;
  }
  
}


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

void fail(){
    cout << "No" << endl;
    exit(0);
}

int main(){
    int N, M, Q;
    cin >> N >> M >> Q;
    vector<int> A(Q);
    for(int i=0; i<Q; i++){
        cin >> A[i];
        A[i]--;
    }
    reverse(A.begin(), A.end());
    vector<int> order, rev(M, -1);
    for(int a : A) if(rev[a] == -1){
        rev[a] = order.size();
        order.push_back(a);
    }

    int sz = order.size();
    int pt = sz-1;
    while(pt > 0 && order[pt-1] < order[pt]) pt--;
    int lack = 0;
    while(lack < M && rev[lack] >= 0) lack++;
    if(lack > order.back()) sz = pt;

    for(int a=0; a<M; a++) if(rev[a] == -1){
        rev[a] = order.size();
        order.push_back(a);
    }

    vector<int> num(M+1);
    bitset<100001> visited;
    visited[0] = 1;
    num[0] = N;
    for(int a : A){
        if(num[rev[a]]){
            num[rev[a]]--;
            num[rev[a]+1]++;
            visited[rev[a]+1] = 1;
        }else if(!visited[rev[a]]){
            fail();
        }
    }
    for(int i=0; i<sz; i++) if(num[i]){
        fail();
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 1912
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define REP(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;

int main() {
    int d,n; cin >> d >> n;
    ll ans=0;
    ans = pow(100,d);
    if(n==100){
        cout << ans*(n+1) << endl;
    }else{
        cout << ans*n << endl;
        }

    return 0;
}

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

#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define setbits(x) __builtin_popcount(x)
#define zerobits(x) __builtin_ctz(x)
#define setbitsll(x) __builtin_popcountll(x)
#define zerobitsll(x) __builtin_ctzll(x)
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)<<x

typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef unsigned long long ull;
typedef map<int,int> mii;

const int MOD = 1e9+7;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string a,b,c;
	cin >> a >> b;
	int cnt1,cnt2;
	cin >> cnt1 >> cnt2;
	cin >> c;
	if (c == a) {
		--cnt1;
	} else {
		--cnt2;
	}
	cout << cnt1 << " " << cnt2 << '\n';
	return 0;
}



Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forin(in, n) for(int i=0; i<n; i++) cin>>in[i]
#define forout(out, n) for(int i=0; i<n; i++) cout<<out[i]<<endl

int main(){
    int A[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K; cin>>K;
    cout<<A[K-1]<<endl;
}


Measured memory_bytes: 3636
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


X, Y, Z = MI()
print(Z, X, Y)

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int N,Q;
string s;
int l,r;
int cnt[100010] = {0};
int main(){
    cin >> N >> Q;
    cin >> s;
    cnt[0] = 0;
    for(int i = 0; i < N; i++){
        if(s[i] == 'A' && s[i+1] == 'C'){
            cnt[i+1] = cnt[i]+1;
        } else {
            cnt[i+1] = cnt[i];
        }
    }
    for(int i = 0; i < Q; i++){
        cin >> l >> r;
        l--; r--;
        int ans;
        ans = cnt[r]-cnt[l];
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxN = 2e5+7;
const int maxM = 1e5+7;
const int maxV = 90010;
//const int INF = 1e9+9;
//const ll INF = (1ll)<<60;
const int INF = 2e9+9;
const int MOD = 1e9+7;

int n,k;
 
int a[maxN];
int main()
{
	scanf("%d",&n);
	int cnt = 0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);	
	} 
	sort(a+1,a+1+n);
	int pos = n/2;
	int ans = 0;
	if(a[pos] == a[pos+1])
		ans = 0;
	else
		ans = a[pos+1] - a[pos];
	cout<<ans<<endl;
	return 0;
}


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

int main() {
	int W, H, x, y, r;

	cin >> W >> H >> x >> y >> r;

	if (
		x <= W - r &&
		x >= r &&
		y <= H - r &&
		y >= r
		)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;

}

Measured memory_bytes: 1160
N=int(input())
for line in range(N):
    a,b,c = (int(i) for i in input().split())
    if (a**2+b**2==c**2) or (b**2+c**2==a**2) or (c**2+a**2==b**2):
        print('YES')
    else:
        print('NO')

Measured memory_bytes: 7524
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
using namespace std;
#define MAX 300000
typedef long long ll;
typedef pair<ll,int> P;

int main(){
  int w,h,x,y,hantei;
  cin>>w>>h>>x>>y;
  if(2*x==w && 2*y==h) hantei=1;
  else hantei=0;
  printf("%.9lf",double(w)*h/2);
  cout<<" "<<hantei<<endl;
}


Measured memory_bytes: 256
s = input()
l = len(s)
n = [0] * (l+1)

for i in range(l):
    if s[i] == '<':
        n[i+1] = n[i] + 1

for i in reversed(range(l)):
    if s[i] == '>':
        n[i] = max(n[i+1] + 1, n[i])

print(sum(n))

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

int main()
{
  int K, X;
  cin >> K >> X;
  string ans = "No";
  if (500 * K >= X)
    ans = "Yes";
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define SQ(a) (a)*(a)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define int long long
#define REP(i,m,n) for(int i = m; i < (int)(n); i++)


int32_t main()
{
IOS


int a,b;
cin>>a>>b;
cout<<max(a+b,max(a*b,a-b));



return 0;

}














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

int main() {
  int a, b;
  string s;
  cin >> a >> b >> s;
  for (int i = 0; i < a + b + 1; i++) {
    if (i == a) continue;
    if (s.at(i) == '-') {
      cout << "No" << endl;
      return 0;
    }
  }
  if (s.at(a) == '-') cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
from bisect import bisect_left
n = int(input())
a = sorted(list(map(int, input().split())))
if n == 2:
    print(a[1], a[0])
    exit()
m = a.pop()
idx = bisect_left(a, m//2)
if idx == 0:
    print(m, a[0])
    exit()
else: 
    r1 = a[idx-1]
    r2 = a[idx]

    if r1 > m-r2:
        r = r1
    else:
        r = r2

print(m, r)


Measured memory_bytes: 14052
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
 
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 (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()

int main(){
    int n;cin>>n;
    int a[n];rep(i,n)cin>>a[i];
    ll sum=0;
    rep(i,n){
        sum+=a[i];
    }
    ll x=0;
    rep(i,n){
        if(i%2)continue;
        x+=a[i];
    }
    int m0=-sum/2+x;
    cout<<m0*2;
    int prev=m0*2;
    rep(i,n-1){
        cout<<" "<<2*a[i]-prev;
        prev=2*a[i]-prev;
    }
    cout<<endl;
}


Measured memory_bytes: 1664
n,w=map(int,input().split())
wv=[list(map(int,input().split())) for i in range(n)]
wv.sort(key=lambda x:-x[1])#reverse
wv.sort(key=lambda x:x[0])
#print(wv)
w0=wv[0][0]
x=[[0],[0],[0],[0]]
for i in range(n):
    z=wv[i][0]-w0
    k=wv[i][1]+x[z][-1]
    l=len(x[z])
    if l*wv[i][0]<=w:
        x[z].append(k)
ma=0
l3=len(x[3])
l2=len(x[2])
l1=len(x[1])
for i in range(l3):
    for j in range(l2):
        for k in range(l1):
            d=w-(i*(w0+3)+j*(w0+2)+k*(w0+1))
            if d>=0:
                ma_sub=x[3][i]+x[2][j]+x[1][k]+x[0][min(d//w0,len(x[0])-1)]
                ma=max(ma,ma_sub)

print(ma)


Measured memory_bytes: 3064
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Set<Integer> set = new HashSet<Integer>();
        while(n-- > 0) {
            int num = sc.nextInt();
            if (set.contains(num)) {
                set.remove(num);
            } else {
                set.add(num);
            }
        }
        
        System.out.println(set.size());
    }
}


Measured memory_bytes: 60684
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<pair<pair<string, int>, int> > A(N);
	int res = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i].first.first >> A[i].first.second;
		A[i].first.second = -A[i].first.second;
		A[i].second = i + 1;
	}
	sort(A.begin(), A.end());
	for (int i = 0; i < N; i++) {
		cout << A[i].second << endl;
	}
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
import itertools
import collections
import functools
import math
from queue import Queue
# import numpy as np
INF = float("inf")


def solve(S: int, K: int):
    n = -1
    nc = 1
    for i, c in enumerate(str(S)):
        if c != "1":
            n = i+1
            nc = c
            break
    # print(n, nc, K)
    if n == -1:
        print(1)
        return

    if K < n:
        print(1)
    else:
        print(nc)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(S, K)


if __name__ == '__main__':
    main()


Measured memory_bytes: 4184
#include <bits/stdc++.h>
using namespace std;
int main(void){
  unsigned long n,i,j,c=0;
  vector<string> v;
  map<string,unsigned long> m;
  cin>>n;
  v.resize(n);
  for(i=0;i<n;i++){
    cin>>v[i];
    sort(v[i].begin(),v[i].end());
    if(m.count(v[i])==0)m[v[i]]=1;
    else m[v[i]]++;
  }
  for(auto x:m){
    c+=x.second*(x.second-1)/2;
  }
  cout<<c<<endl;
  return 0;
}

Measured memory_bytes: 20224
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)

int count(int N)
{
        int ans = 0;
        while (N)
        {
                ans++;
                N /= 10;
        }
        return ans;
}

int main()
{
        int A, B, C, X, Y;
        cin >> A>>B>>C>>X>>Y;
        int ans = min(A * X + B * Y, 2*C * max(X, Y));
        if(X>Y){
                ans = min(ans, 2 * C * Y + A * (X - Y));

        } else{
                ans = min(ans, 2 * C * X + B * (X - Y)*(-1));
        }
        cout << ans << endl;

        return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void)
{
  string str;
  while(cin >> str){
    string ret;
    for(int i = 0; i < (int)str.size(); i++){
      if(str[i] == '@'){
	i++;
	for(int j = 0; j < str[i] - '0'; j++){
	  ret += str[i+1];
	}
	i++;
      }else{
	ret += str[i];
      }
    }
    cout << ret << endl;
  }
}

Measured memory_bytes: 1184
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace AtCoder
{
	public class ABC
	{
		static public void Main(string[] args)
		{
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
			Solve(args);
			Console.Out.Flush();
		}

		private const int mod = 1000000007;  // 10^9+7

		static public void Solve(string[] args)
		{
			//string s = Console.ReadLine();
			//int n = int.Parse(Console.ReadLine());
			//long x = long.Parse(Console.ReadLine());
			int[] vs = Console.ReadLine().Split().Select(int.Parse).ToArray();
			//long[] vs = Console.ReadLine().Split().Select(long.Parse).ToArray();
			int a = vs[0];
			int b = vs[1];
			int c = vs[2];
			int d = vs[3];
			while (true) {
				c -= b;
				if (c <= 0) {
					Console.WriteLine("Yes");
					return;
				}
				a -= d;
				if (a <= 0) {
					Console.WriteLine("No");
					return;
				}
			}
		}
	}
}


Measured memory_bytes: 28308
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

const int MOD = 1000000007;

const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

typedef tuple<string, int, int> mytuple;
bool mycompare(const mytuple& lhs, const mytuple& rhs)
{
    if (std::get<0>(lhs) != std::get<0>(rhs))
        return std::get<0>(lhs) < std::get<0>(rhs);
    if (std::get<1>(lhs) != std::get<1>(rhs))
        return std::get<1>(lhs) > std::get<1>(rhs);
    return std::get<2>(lhs) < std::get<2>(rhs);
}

int main()
{
    int N;
    cin >> N;
    vector<tuple<string, int, int>> res(N);
    rep(i, N)
    {
        string s;
        int p;
        cin >> s >> p;

        res.at(i) = make_tuple(s, p, i);
    }

    sort(res.begin(), res.end(), mycompare);

    rep(i, N)
    {
        cout << get<2>(res.at(i)) + 1 << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define fi first
#define se second
using namespace std;
int n,k,q;
int main()
{
    scanf("%d%d%d",&n,&k,&q);
    vector<int> a(n+1,k);
    for(int _;_<q;_++)
    {
        int x;
        scanf("%d",&x);
        a[x]++;
    }
    char ans[2][10]={"No","Yes"};
    //for(int i=1;i<=n;i++) printf("%d ",a[i]);
    //puts("");
    for(int i=1;i<=n;i++)
        printf("%s\n",ans[a[i]>q]);
    return 0;
}



Measured memory_bytes: 1024
#include "stdio.h"

int main()
{

  int i,j,a,b;



while (1)
{


  scanf("%d %d\n",&a,&b);
  if (a==0) {
    break;
  }

  for (j = 0; j < a; j++)
  {

    for (i = 0; i < b; i++)
    {


      if (i==0 || i==b-1 || j==0 || j==a-1)
      {
        printf("#");
      }
      
      else
      {
        printf(".");
      }


    }
    printf("\n");

  }
  printf("\n" );

}









  return 0;
}



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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int m, n;
    cin >> n >> m;
    ll ans = 0;
    map<int, int> mp;
    priority_queue<pair<int, int> > q;
    rep (i, n) {
      int a;
      cin >> a;
      mp[a]++;
    }
    rep (i, m) {
      int b, c;
      cin >> b >> c;
      q.push(make_pair(c, b));
    }
    for (auto const& entry: mp) {
      q.push(make_pair(entry.first, entry.second));
    }
    rep (i, n) {
      pair<int, int> p;
      p = q.top();
      q.pop();
      p.second--;
      ans += p.first;
      if (p.second > 0) q.push(p);
    }

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 7160
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long int ll;

int N;
vector<int> x(10);
vector<int> y(10);

// 点iと点jの距離を返す関数
double dist(int i,int j){
  double dx=x[i]-x[j];
  double dy=y[i]-y[j];
  double d=sqrt(dx*dx+dy*dy);
  return d;
}

int main() {
  
  cin>>N;
  for(int i=1;i<=N;++i){
    cin>>x[i]>>y[i];
  }

  // Nの階乗
  int kaijou=1;
  for(int i=1;i<=N;++i){
    kaijou*=i;
  }
  
  // 各地点のインデックスを格納する配列
  // 最初はv={1,...,N}
  vector<int> v(N);
  rep(i,N){
    v[i]=i+1;
  }
  
  double total=0.0;
  do{
    for(int i=0;i<N-1;++i){
        total+=dist(v[i],v[i+1]);
    }
  }while(next_permutation(v.begin(),v.end()));
  
  // 有効桁数は10桁
  cout<<setprecision(10)<<total/kaijou<<endl;
  
}


Measured memory_bytes: 256
def canDiv(a,b,c):
    s = (a+b+c) 
    if a * 2 == s:
        return True
    if b * 2 == s:
        return True
    if c * 2 == s:
        return True
    return False

def main():
    a,b,c = map(int,raw_input().split())
    res = canDiv(a,b,c)
    if res == True:
        print "Yes"
    else:
        print "No"

if __name__ == '__main__':
    main()

Measured memory_bytes: 2568
#include <bits/stdc++.h>
#define ll long long

using namespace std;

const int N = 110;
const int K = 100100;
const int Mod = 1e9 + 7;

int n, k;
int a[N];
int Dp[N][K];
int Pref[N][K];

void ComputePrefix(int i)
{
    Pref[i][0] = Dp[i][0];
    for(int j = 1; j <= k; j++) Pref[i][j] = (Dp[i][j] + Pref[i][j-1]) % Mod;
}

int GetSum(int i,int L,int R)
{
    return (Pref[i][R] - (L ? Pref[i][L-1] : 0) + Mod) % Mod;
}

int main()
{
    cin >> n >> k;

    for(int i = 1; i <= n; i++) scanf("%d",a+i);

    Dp[0][0] = 1;

    for(int i = 1; i <= n; i++)
    {
        ComputePrefix(i-1);

        for(int j = 0; j <= k; j++)
        {
            int L = max(0,j-a[i]), R = j;
            
            /// for(int r = L; r <= R; r++) Dp[i][j] += Dp[i-1][r], Dp[i][j] %= Mod;

            Dp[i][j] = GetSum(i-1,L,R);
        }
    }

    cout << Dp[n][k];
}


Measured memory_bytes: 82176
#include <iostream>
using namespace std;
int main()
{
	int n,l,r;
	long long ssum=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>l>>r;
		ssum+=r-l+1;
	}
	cout<<ssum<<endl;
	return 0;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
a = gets.chomp.split(' ').map(&:to_i)

na = []
flag = 0

a.each do |i|
	if i.even?
		na << i
	end
end

na.each  do |ia|
	unless (ia % 3) == 0
			unless (ia % 5) == 0
				flag = 1
				break
			end
		end
end

if flag == 0
	puts 'APPROVED'
else
	puts 'DENIED'
end

Measured memory_bytes: 3836