akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int  ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

int main() {
	sll(n);
	LL hs[n], maxPos[n];
	rep(i, 0, n) {
		hs[i] = scanLong();
		if(i == 0)	maxPos[i] = i;
		else if(hs[i] >= hs[maxPos[i-1]])	maxPos[i] = i;
		else	maxPos[i] = maxPos[i-1];
	}
	LL ans = 0;
	rep(i, 0, n)	if(maxPos[i] == i)	ans++;
	pll(ans); nl;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	LL X, A, B; cin >> X >> A >> B;
	string ans;
	if (B <= A)ans = "delicious";
	else if (B - A <= X)ans = "safe";
	else ans = "dangerous";


	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
N=int(input())
S=list(input())

r=0
g=0
b=0

for i in range(N):
  if S[i]=="R":
    r+=1
  elif S[i]=="G":
    g+=1
  else:
    b+=1
    
n=r*g*b

for i in range(N):
  for j in range(i+1,N):
    if S[i]==S[j]:
      continue
    k = 2*j-i
    if k >= N:
      break
    if S[i]==S[k] or S[j]==S[k]:
      continue
    n -= 1
      
print(n)

Measured memory_bytes: 9192
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long X = sc.nextLong();
    long[] x = new long[N];
    for (int i = 0; i < N; i++) {
      x[i] = sc.nextLong();
    }
    long ans = Math.abs(X - x[0]);
    for (int i = 1; i < N; i++) {
      ans = gcd(ans, Math.abs(X - x[i]));
    }
    System.out.println(ans);
  }

  public static long gcd(long a, long b) {
    if (b == 0) {
      return a;
    }
    return gcd(b, a % b);
  }
}

Measured memory_bytes: 62032
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
int H, W, M;
set<i_i> st;
 
void input() {
    cin >> H >> W >> M;
    for(int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        st.insert({a, b});
    }
}
 
void solve() {
    map<int, int> mph, mpw;
    int hmaxval = 0;
    int wmaxval = 0;
    vector<int> hmax, wmax;
    for(auto tmp : st) {
        chmax(hmaxval, ++mph[tmp.first]);
        chmax(wmaxval, ++mpw[tmp.second]);
    }
    for(auto tmp : mph) {
        if(hmaxval == tmp.second) hmax.push_back(tmp.first);
    }
    for(auto tmp : mpw) {
        if(wmaxval == tmp.second) wmax.push_back(tmp.first);
    }
    int ANS = hmaxval + wmaxval - 1;
    for(auto h : hmax) {
        for(auto w : wmax) {
            if(st.find({h, w}) == st.end()) {
                ANS++;
                cout << ANS << endl;
                return;
            }
        }
    }
    cout << ANS << endl;
}
 
int main() {
    input();
    solve();
    return 0;
}

Measured memory_bytes: 49572
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <complex>

using namespace std;
using Arrow = complex<long long>;

class Solution {
public:
	long double engines(vector<Arrow>& arrows) {
		const int n = arrows.size();
		sort(arrows.begin(), arrows.end(), [](const auto& a, const auto& b) { return atan2(a.imag(), a.real()) < atan2(b.imag(), b.real()); });
#if 0
		cout << "Input in sorted: " << endl;
		for (auto arrow : arrows)
			cout << arrow << endl;
		cout << endl;
#endif
		Arrow curr(0, 0);
		long long ans = 0;
		int R = 0;
		for (int L = 0; L < n; ++L) {
			if (L > R)
				R = L, curr = Arrow(0, 0);
			while (R < L + n && norm(curr + arrows[R % n]) >= norm(curr))
				curr += arrows[R++ % n];
			ans = max(ans, norm(curr)), curr -= arrows[L % n];
		}
		return sqrt(ans);
	}
};

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

	vector<Arrow> arrows(n);
	for (int i = 0; i < n; ++i) {
		int x, y;
		cin >> x >> y;
		arrows[i] = Arrow(x, y);
	}

	Solution sol;
	long double ans = sol.engines(arrows);
	cout << fixed << setprecision(50) << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

int main() {
	ll n,a,b,c,d;
	cin>>n>>a>>b>>c>>d;
	n--;
	bool ans=false;
	for(ll i=0;i<n;i++){
		ll l=a+i*c-(n-i)*d;
		ll r=a+i*d-(n-i)*c;
		if(l<=b&&b<=r){
			ans=true;
		}
	}
	cout << (ans?"YES":"NO");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <queue>
#include<iomanip>
#include <cmath>
#include <set>
#include <unordered_set>

#define ABS(x) ((x)>0?(x):-(x))
#define MIN(x,y) ((x)>(y)?(y):(x))
#define MAX(x,y) ((x)<(y)?(y):(x))

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

#define INF 1000000000

using namespace std;
typedef long long ll;

ll newton(long long int a, long long int  b)
{
	if(a==b)
		return a;
	while(a != 0 && b != 0)
	{
		if(a > b)
		{
			b += a;
			a = b-a;
			b -= a;
		}
		b %= a;
	}
	return a;
}

struct UnionFind {
	vector<int> p;
	UnionFind(int N):p(N)
	{
		for(int i=0; i< N; i++)
		{
			p[i] = i;
		}
	}
	int root(int x)
	{
		if(p[x] == x)
			return x;
		return p[x] = root(p[x]);
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if(rx == ry) return;
		p[rx] = ry;
	}
	bool issame(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

//大きな数に対する割り算をするとき、MODを指定することで掛け算の値に変換できる

ll div2mul_calc(ll a, ll b, ll m)
{
	if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll d = div2mul_calc(a, b / 2, m);
        return (d * d) % m;
    } else {
        return (a * div2mul_calc(a, b - 1, m)) % m;
    }
}
ll div2mul(ll n, ll mod)
{
	return div2mul_calc(n, mod-2, mod);
}

ll twoRow(ll a, ll b, ll mod)
{
	ll ret = 1;
	for(ll i = 1 ;i <= a+b;++i)
	{
		ret *= i;
		ret %= mod;
	}
	for(ll i = 1 ;i <= a;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	for(ll i = 1 ;i <= b;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	return ret;
}

struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};

vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return (ret);
}
/*
小数の桁数を指定する
	cout << setprecision(8)<< mp[0]-mx << endl;
*/

int main()
{
	ll i,j,k,a,b,ans=0;
	char c;
	ll N,M,T;
	// vector<ll> mp;
	ll border[512] = {0};
	cin >> N;
	a =0;
	for(i=0;i<N;++i)
	{
		cin >> j >> k;
		ans += k;
		ans += (a+j*k)/9;
		a = (a+j*k)%9;
	}
	if(a==0)
		ans --;
	cout << ans-1 << endl;
	return 0;
}




















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

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(a<c&&c<b)
    cout<<"Yes"<<endl;
  else if(b<c&&c<a)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Measured memory_bytes: 256
N = int(input())
e = [0] * (N+1)

for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m): # eの要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m-1, e)))

answer = num(75) + num(25) * (num(3)-1) + num(15) * (num(5) - 1)\
    + num(5) * (num(5) - 1) * (num(3) - 2) // 2
print(answer)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<vector<int> > happy(n,vector<int>(3));
  for(int i=0;i<n;i++){
      cin>>happy[i][0]>>happy[i][1]>>happy[i][2];
  }
  for(int i=1;i<n;i++){
      happy[i][0] = max(happy[i-1][1],happy[i-1][2])+ happy[i][0];
      happy[i][1] = max(happy[i-1][0],happy[i-1][2])+ happy[i][1];
      happy[i][2] = max(happy[i-1][1],happy[i-1][0])+ happy[i][2];
  }
  int maxi = INT_MIN;
  cout<<max(happy[n-1][0],max(happy[n-1][1],happy[n-1][2]));
  return 0;
}

Measured memory_bytes: 8780
#include <iostream>

using namespace std;

int main() {
    
    string a,b,c;
    cin>>a>>b>>c;
    int al=a.length();
    int bl=b.length();
    
    if (a[al-1] == b[0] && b[bl-1] == c[0])
        cout<<"YES\n";
    else
        cout<<"NO\n";
    
    return 0;
}

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

int main(){
    int a, b, c, rect=0, loz=0;
    
    while(scanf("%d,%d,%d", &a, &b, &c)!=EOF){
        if(a+b>c){
            if(a*a+b*b==c*c){
                rect++;
            }
            if(a==b){
                loz++;
            }
        }
    }
    
    cout<< rect<< endl;
    cout<< loz<< endl;
    
    return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bitset>
#include <cassert>
#include <queue>
#include <random>
#include <stack>
#include <iomanip>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define repf(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define repr(i, a, b) for (ll i = (ll)a; i > (ll)b; i--)
#define repv(x, arr) for (auto &x : arr)
#define all(v) (v).begin(), (v).end()
#define vec(name, num) vector<ll> name((num), 0);
#define mp(a, b) make_pair(a, b)
#define op(i) cout << (i) << endl;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int infi = 2147483600;
const ll infl = 1e17;

int n, m;
set<int> edges[100005];

int main()
{
    cin >> n >> m;
    set<pii> hajime;
    rep(i, m)
    {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        edges[a].insert(b);
        edges[b].insert(a);
        hajime.insert(mp(min(a,b), max(a,b)));
    }
    if (m % 2 == 1)
    {
        cout << -1 << endl;
        return 0;
    }
    set<int> check;
    check.insert(0);
    bool renketu[100005] = {};
    vector<int> root(n, -1);
    vector<int> childcnt(n, 0);
    renketu[0] = true;
    while (!(check.empty())){
        int now = *check.begin();
        check.erase(now);
        for (auto nex:edges[now]){
            if (renketu[nex])
                continue;
            hajime.erase(mp(min(now,nex), max(now,nex)));
            renketu[nex] = true;
            root[nex] = now;
            childcnt[now]++;
            check.insert(nex);
        }
    }
    vii cnt(n, 0);
    for (auto p:hajime){
        cout << p.F+1 << " " << p.S+1 << endl;
        cnt[p.F] = (cnt[p.F] + 1) % 2;
    }
    queue<int> start;
    rep(i,n){
        if(childcnt[i]==0){
            start.push(i);
        }
    }
    while (!(start.empty())){
        int now = start.front();
        start.pop();
        if (cnt[now]%2==0){
            int nex = root[now];
            if (nex == -1)
                break;
            cout << nex + 1 << " " << now + 1 << endl;
            cnt[nex] = (cnt[nex] + 1) % 2;
            childcnt[nex]--;
            if (childcnt[nex]==0){
                start.push(nex);
            }
        }
        else
        {
            int nex = root[now];
            if (nex == -1)
                break;
            cout << now+1 << " " << nex+1 << endl;
            childcnt[nex]--;
            if (childcnt[nex] == 0)
            {
                start.push(nex);
            }
        }
    }
}


Measured memory_bytes: 21632
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <climits>
#define bogo_sort   std::sort
#define bozo_sort   std::stable_sort
#define alles(obj)  obj.begin(), obj.end()
#define elif        else if
#define unless(flg) if(!(flg))
#define elless(flg) else if(!(flg))
#define echo        std::cout <<
#define read        std::cin >>
#define endl        std::endl
#define fin         << '\n'
#define bash        push_back
#define fish        push_front
#define makePair    std::make_pair
#define _           << ' ' <<
// type-define
#define Stack       std::stack
#define Queue       std::queue
#define Deque       std::deque
#define PQueue      std::priority_queue
#define Set         std::set
#define Vector      std::vector
#define Pair        std::pair
#define Map         std::map
#define HashMap     std::unordered_map
#define Greater     std::greater
using String  =     std::string;
using llong   =     long long;
using boolean =     bool;
using Pii     =     Pair<int, int>;
using Vi      =     Vector<int>;
using Vii     =     Vector<Pii>;
// utils
constexpr int   dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int   dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int   INF  = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;

namespace {
    template<class A, class B> A power ( llong x, llong n, llong mod ) {
        llong ans = 1;
        while ( n > 0 ) {
            if ( n & 1 ) ans = ( ans * x ) % mod;
            x = ( x * x ) % mod;
            n >>= 1;
        }
        return ans;
    }
    template<class A, class B> A power ( A x, B n ) { return power( x, n, 1000000007 ); }
    template<class A> A gcd ( A x, A y ) { return x % y ? gcd( y, x % y ) : y; }
    template<class A, class B> A lcm   ( A x,  B y ) { return ( x / gcd(x, y) * y ); }
    template<class A> inline A abs ( A n ) { return ( n < 0 ) ? -n : n; }
    template<class A, class B> inline bool chmax ( A &a, const B &b ) { return b > a ? a = b, true : false; }
    template<class A, class B> inline bool chmin ( A &a, const B &b ) { return b < a ? a = b, true : false; }
    inline boolean isMovable ( int x, int y, int w, int h ) {
        return ( x >= 0 && y >= 0 && x < w && y < h );
    }
}

namespace Rlyeh {

    signed call_of_Cthulhu( signed datum ) {

        int w, a, b;
        read w >> a >> b;
        if ( a+w < b ) {
            echo b-a-w fin;
        }
        elif ( b+w < a ) {
            echo a-b-w fin;
        }
        else echo 0 fin;

        return 0;
    }
}

signed main(){std::cin.tie(0); std::ios::sync_with_stdio(false); int main_result = Rlyeh::call_of_Cthulhu(114514); return 0;}


Measured memory_bytes: 256
n, k = map(int, input().split())
s = list(input())

s_c = []

left = 0
right = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        right = i + 1
    else:
        s_c.append(''.join(s[left:right + 1]))
        i += 1
        left = i
        right = i
s_c.append(''.join(s[left:right + 1]))

s_c_len = len(s_c)
cc = 'R'
if s_c_len > 1 and s_c[1][0] == 'R':
    cc = 'L'

for i in range(k):
    if (2 * i + 1) > s_c_len - 1:
        break
    s_c[2 * i + 1] = cc * len(s_c[2 * i + 1])

ans_s = ''.join(s_c)
ans = 0
for i in range(n):
    if ans_s[i] == 'R' and i != n - 1 and ans_s[i + 1] == 'R':
        ans += 1
    elif ans_s[i] == 'L' and i != 0 and ans_s[i - 1] == 'L':
        ans += 1
print(ans)


Measured memory_bytes: 49804
import java.util.Scanner;


public class Main {


	public static void main(String[] args) {

		long ans = 0;
//		int ans = 0;
//		String ans = "";

		Scanner sc = new Scanner(System.in);


		long n = sc.nextLong();
//		int n = sc.nextInt();
		long a = sc.nextLong();
		long b = sc.nextLong();
//		int m = sc.nextInt();
//		String s = sc.next();


//		String string = sc.next();
//		StringBuilder s = new StringBuilder(string);

		boolean f = false;

//		String[] s = new String[n];
//		int[] ans = new int[n];
//		int[] a = new int[n];

//		for (int i = 0; i < h; i++) {
//			for(int j = 0; j < w; j++) {
//				a[i][j] = sc.nextInt();
//			}
//		}

//		for (int i = 0; i < n; i++) {
//			a[i] = sc.nextInt();
//		}


		ans = Math.abs(a-b);
		long tmp = ans;
		long senter = (a+b)/2;

		if(ans == 0) {
			System.out.println(ans);
			f = true;
		}

		if(!f) {
			if(ans%2 == 0) {
				ans = ans/2;
			} else {
				if(n/2 >= senter) {
					if(a < b) {
						ans = a-1 + ((tmp+1)/2);
					} else {
						ans = b-1 + ((tmp+1)/2);
					}
				} else {
					if(a < b) {
						ans = n-b + ((tmp+1)/2);
					} else {
						ans = n-a + ((tmp+1)/2);
					}
				}
			}
			System.out.println(ans);
		}

		sc.close();
	}

}

Measured memory_bytes: 23508
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

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

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

ll M=mod;

vector<ll> fac(2010); //n!(mod M)
vector<ll> ifac(2010); //k!^{M-2} (mod M)
//a,bの範囲的にこれだけ配列を用意していけば十分

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}

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

    //大した量ではないので，先にfax[i]とifax[i]を全て計算しておく
    fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<2010; i++){
        fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }

    rep1(i,k){
    ll ans=0;
    ans = (comb(n-k+1,i)%M)*(comb(k-1,i-1)%M);
    ans%=M;
    cout << ans << endl;
    }
}

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }

struct coord { int X; int Y; };

int main() {
  int H, W, N; cin >> H >> W >> N;
  coord c[N]; rep(i,N) { int X, Y; cin >> X >> Y; X--; Y--; c[i] = {X,Y}; }
  sort(c,c+N,[](const coord &x, const coord &y){return x.Y<y.Y||(x.Y==y.Y&&x.X<y.X);});
  map<int, int> pos; pos[0] = 0;
  rep(i,N) {
    if (pos.count(c[i].Y)==0) {
      int tf = pos.rbegin()->first, ts = pos.rbegin()->second;
      pos[c[i].Y] = ts + (c[i].Y-tf);
    }
    if (pos[c[i].Y]==c[i].X) pos[c[i].Y]++;
  }
  // for (auto x: pos) cout << x.first << "->" << x.second << " "; cout << endl;  // cout << result << endl;
  int result = H;
  rep(i,N) if (pos[c[i].Y]<c[i].X) result = min(result,c[i].X);
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 7552
N=int(input())
Y=0
s=0
X=list(map(int,input().split()))
P=0
for i in range(N):
  P+=X[i]

P/=N
D=int(P)
if (P-D)*10>=5:
  Y=int(P)+1
else:
  Y=int(P)
  


for i in range(N):
  s+=(X[i]-Y)**2
  
print(s)

Measured memory_bytes: 3060
#E:=初めて全ての問題がACした時までの試行回数の期待値
#E=(1/2)^m+(1-(1/2)^m)(E+1)<=>E(1/2)^m=1<=>E=2^m
n,m=map(int,input().split())
e=2**m
print((1900*m+100*(n-m))*e)

Measured memory_bytes: 9136
//Program.cpp
//Author : Aaryan Srivastava 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#define pb push_back
#define popb pop_back
#define ull unsigned long long  
#define beg begin
#define mp make_pair
#define pii pair<int, int>
#define piii pair<pii,int>
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define ff first
#define ss second 
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using ll = long long;
#define int ll
const int N = 2*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace std;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr 
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#define AaryanS 0 
#endif


void solve()
{
    long double p1=0,p2=0,tmp=0.0 ;
    int n,k ;
    cin >> n >> k ;
    if(k <= n) p2 = 1.0 * (n-k+1)/ n ;
    repA(i,1,k-1){
        if(i > n) break ;
        int res = 0 , l = i;
        while(l < k){
            res++, l *= 2 ;
        }
        tmp = tmp + pow(0.5,res) ;
        // cout << i << " " << k << " " << pow(0.5,res) << " " << res << endl ;
    }
    p1 = 1.0 * tmp / n ;
    cout << std::fixed << setprecision(20) << (p1+p2) ; 

}   

     
int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        //cout << endl ;
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 998244353;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;
void yesno(bool ok, string yes = "Yes", string no = "No") {
    if (ok) {
        cout << yes << endl;
    } else {
        cout << no << endl;
    }
}

ll modadd(ll x, ll y) {
    return ((x + y) % mod + mod) % mod;
}

ll modminus(ll x, ll y) {
    return (x - y + mod) % mod;
}

ll multiply(ll x, ll y) {
    return (x % mod) * (y % mod) % mod;
}

ll modpower(ll x, ll y) {
    if (y == 0) {
        return 1;
    } else if (y == 1) {
        return x % mod;
    } else if (y % 2 == 0) {
        ll p = modpower(x, y / 2);
        return p * p % mod;
    } else {
        ll p = modpower (x, y / 2);
        return (p * p) % mod * (x % mod) % mod;
    }
}

ll dpl[3010][3010], dpr[3010][3010];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, S;
    cin >> N >> S;
    ll A[N];
    REP(i, 0, N) {
        cin >> A[i];
    }
    dpl[0][0] = 1;
    REP(i, 0, N) {
        dpl[i + 1][0] = 1;
        REP(j, 0, S + 1) {
            dpl[i + 1][j] = modadd(dpl[i + 1][j], dpl[i][j]);
            if (j + A[i] <= S) {
                dpl[i + 1][j + A[i]] = modadd(dpl[i + 1][j + A[i]], dpl[i][j]);
            }
        }
    }
    dpr[N][0] = 1;
    PER(i, N - 1, - 1) {
        REP(j, 0, S + 1) {
            dpr[i][j] = modadd(dpr[i][j], dpr[i + 1][j]);
            if (j + A[i] <= S) {
                dpr[i][j + A[i]] = modadd(dpr[i][j + A[i]], dpr[i + 1][j]);
            }
        }
    }
    // REP(i, 0, N + 1) {
    //     REP(j, 0, S + 1) {
    //         cout << dpl[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    // REP(i, 0, N + 1) {
    //     REP(j, 0, S + 1) {
    //         cout << dpr[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    ll ans = 0;
    REP(l, 0, N + 1) {
        ans = modadd(ans, dpl[l][S]);
    }
    cout << ans << endl;
}


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

using namespace std;
typedef long long LL;
typedef pair<int,int> pii;

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

#ifdef OJ
#define debug(x)  do{cerr<<#x<<": "<<x<<"\n";}while(0)
#define debugv(x) do{cerr<<#x<<": ";for(auto&e: (x))cerr<<e<<" ";cerr<<"\n";}while(0)
#else
#define debug(x)
#define debugv(x)
#endif

#define all(x) (x).begin(), (x).end()
#define rsort(x) sort((x).rbegin(), (x).rend())
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define ford(i, n, e) for (int i = (int)(n); i >= (int)(e); --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
#define RETURN(x) do{cout << (x) << '\n'; return 0;}while(0)

const int MOD = 1e9+7;
const int MAXN = 2e5+3;
const int INF = 1e9;

int main(int argc, char **argv) {
#ifdef OJ
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    int x, y; cin >> x >> y;
    if (y < 2*x || (y-2*x)%2) RETURN("No");
    int b = (y-2*x)/2;
    if(b > x || b*4 > y) RETURN("No");
    RETURN("Yes");
    //int ntest; cin >> ntest; while(ntest--) 
    //{
    //}
    cout << '\n';
    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
//const int MOD = 1000000007;
 const int MOD = 998244353;

// Lib
ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
//

ll a, b, c, d;

bool solve() {
    if (a < b) return false;
    if (d < b) return false;
    if (c >= b-1) return true;

    ll g = GCD(b, d);

    // g で割って a%g あまる数で、b 未満の最大の数
    ll max_ = (b - a%g + g-1)/g*g + a%g - g;

    // g で割って a%g あまる数で、c より大きく b 未満な整数があるかどうか
    if (max_ > c) return false;
    else return true;
}


int main(){
#ifdef MYLOCAL
    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());
#endif
    int T; cin >> T;
    for (int CASE = 0; CASE < T; ++CASE) {
        cin >> a >> b >> c >> d;
        if (solve()) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	double a,b,f;
	int i,j,d,r;
	
	scanf("%lf %lf",&a,&b);
	i=a;
	j=b;
	
	r=i/j;
	d=i%j;
	f=a/b;

	printf("%d %d %.8lf\n",r,d,f);
	
	return 0;
}

Measured memory_bytes: 652
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;



ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }

vll divisor(ll n) {
    vll ans;
    for (ll i = 1; i*i <= n; ++i) {
        if (n%i == 0) {
            ans.push_back(i);
            if (i*i != n) ans.push_back(n/i);
        }
    }
    sort(all(ans));
    return ans;
}

int main() {
    ll a, b;
    cin >> a >> b;
    //show(gcd(a, b));
    ll g = gcd(a, b);
    vll gc;
    int sgc;
    int ans = 0;
    gc = divisor(g);
    sgc = gc.size();
    //show(sgc);
    vll ls;
    rep(i, sgc) {
        bool flag = true;
        rep(j, ls.size()) {
            if (ls[j] != 1 && gc[i] % ls[j] == 0) {
                flag = false;
            }
        }
        if (flag) ls.push_back(gc[i]);
    } 

    cout << ls.size() << endl;
    return 0;
}

Measured memory_bytes: 384
import sys
input = sys.stdin.readline
I=lambda:int(input())
MI=lambda:map(int,input().split())
LI=lambda:list(map(int,input().split()))

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rnk = [0]*(n+1)

    def find_root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]
        
    def unite(self, x, y):
        x = self.find_root(x)
        y = self.find_root(y)
        if(x == y):
            return 
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
                
    def is_same_group(self, x, y):
        return self.find_root(x) == self.find_root(y)

    def count(self, x):
        return -self.root[self.find_root(x)]
    
N,M=MI()
uf=UnionFind(N)
for _ in [0]*M:
    a,b=MI()
    uf.unite(a,b)
    
print(sum([uf.find_root(i+1)==i+1 for i in range(N)])-1)

Measured memory_bytes: 81568
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int N; cin>>N;
    vector<int> T(N);
    rep(n,0,N) cin>>T.at(n);

    int sumT=accumulate(ToEnd(T),0);

    int M; cin>>M;
    rep(m,0,M){
        int p,x; cin>>p>>x;
        int new_sumT=sumT-(T.at(p-1)-x);
        cout<<new_sumT<<endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1010, M = 64;
ll a[N];int n;char s[N];ll b[N];
 
ll insert(ll x){
	for(int i=60;~i;i--)if(1&(x>>i)){
		if(!b[i]){b[i]=x;break;}
		else x^=b[i];
	}
	return x;
}
 
void Main()
{
	for(int i=0;i<M;i++)b[i]=0;
	cin >> n;for(int i=1;i<=n;i++)scanf("%lld",&a[i]);
	scanf("%s",s+1);
	bool Ans=0;
	for(int i=n;i;i--){
		if(s[i]=='0'){
			insert(a[i]);
		}else{
			ll d=insert(a[i]);
			// cerr << d << "??" << endl;
			Ans|=d!=0;
		}
	}
	printf("%d\n",(int)Ans);
}

int main(){int T;cin >>  T;while(T--)Main();}

Measured memory_bytes: 3724
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;

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


Measured memory_bytes: 3080
import java.util.*
import java.math.*
import java.lang.Math.*


private val readString: ()->String = {readLine()!!}
private val readInt: ()->Int = { readLine()!!.toInt() }
private val readLong: ()->Long = { readLine()!!.toLong() }
private val readListInt: ()->List<Int> = { readLine()!!.split(' ').map(String::toInt) }
private val readListLong: ()->List<Long> = { readLine()!!.split(' ').map(String::toLong) }
private val errPrintln: (String)->Unit = { msg -> System.err.println(msg) }
//private val MOD = 1e9.toLong()+7
//private val INF = Int.MAX_VALUE/2
//private val LINF = Long.MAX_VALUE/2


class GridBfs(val G: List<String>, val Start:Char = '#',
              val ToPaint:Char = '.') {
    var H:Int = 0
    var W:Int = 0
    data class Pos(val x: Int, val y: Int)
    private val starts = ArrayList<Pos>()
    init {
        H = G.size
        W = G[0].length
        G.forEachIndexed{i, row ->
            row.forEachIndexed{j, cell ->
                if (cell == Start) starts.add(Pos(i,j))
            }
        }
    }
    private val dx = intArrayOf(0,1,0,-1)
    private val dy = intArrayOf(1,0,-1,-0)
    private val INF = Int.MAX_VALUE/2
    fun fill(): Int {
        val que = ArrayDeque<Pos>()
        val step = Array(H){IntArray(W){INF} }
        for (ps in starts) {
            que.addLast(ps)
            step[ps.x][ps.y] = 0
        }
        while (que.isNotEmpty()) {
            val (x, y) = que.removeFirst()
            for (i in dx.indices) {
                val nx = x + dx[i]; val ny = y + dy[i]
                if (nx<0 || H<=nx || ny<0 || W<=ny) {
                    continue
                }
                if (step[nx][ny] > step[x][y] + 1) {
                    step[nx][ny] = step[x][y] + 1
                    que.addLast(Pos(nx, ny))
                }
            }
        }

        var res = -INF
        step.forEach { it.forEach { res = max(res, it) } }
        return res
    }
}


fun solveA(A: Array<String>): Int {
    val bfs = GridBfs(A.toList())
    return bfs.fill()
}


fun main(args: Array<String>) {
    val (H, W) = readListInt()
    val A = Array<String>(H){""}
    for (i in 0 until H) {
        A[i] = readString()
    }

    val ans = solveA(A)

    println(ans)
}


Measured memory_bytes: 103024
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define MOD 1000000007
#define itn int
#define enld endl
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
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<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    string s; cin >> s;
    bool flag1 = false, flag2 = false;
    rep(i,0,SZ(s)){
        if(s[i] == 'C') flag1 = true;
        else if(flag1 && s[i] == 'F') flag2 = true;
    }

    if(flag2){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3648
#include <stdio.h>
#define A 100

int main(){
  int i,num,in[A],j,temp;
  int cnt = 0;

  scanf("%d",&num);

  for(i=0;i<num;i++){
    scanf("%d",&in[i]);
  }

  for(i=0;i<num-1;i++){
    for(j=num-1;j>i;j--){
      if(in[j-1] > in[j]){
	temp = in[j];
	in[j] = in[j-1];
	in[j-1] = temp;
	cnt++;
      }
    }
     printf("%d ",in[i]);
  }
  printf("%d\n%d\n",in[num-1],cnt);
  return 0;
}



Measured memory_bytes: 2128
import sys,math,copy,queue,itertools,bisect,collections
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))

a,b,c,d = LI()
while True:
    c -= b
    if c <= 0:
        print ('Yes')
        break
    a -= d
    if a <= 0:
        print ('No')
        break


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

int main(void) {
    ll a,b,c,d; cin >> a >> b >> c >> d;
    ll ans1,ans2,ans3,ans4;
    ans1=a*c;
    ans2=a*d;
    ans3=b*c;
    ans4=b*d;
    ll ans = max({ans1,ans2,ans3,ans4});
    cout << ans << endl;
}

Measured memory_bytes: 3540
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		sc.close();

		int numE = (N+1)/2;

		float p = (float)numE/N;

		System.out.printf("%.7f", p);


	}
}

Measured memory_bytes: 23636
a,b,c = map(int, input().split())
l = 4 * a * b
r = (c - a - b) * (c - a - b)

if c - a - b <= 0:
    print("No")
elif c < a or c < b:
    print("No")
elif l < r:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
max=[]
a,b,c=raw_input().split()

max.append(a)
max.append(b)
max.append(c)

if(max[0]>max[1]):
    max[0]=b
    max[1]=a
if(max[1]>max[2]):
    d=max[1]
    max[1] = max[2]
    max[2] = d
if(max[0]>max[1]):
    e=max[0]
    max[0] = max[1]
    max[1] = e

print(max[0]+' '+max[1]+' '+max[2])


Measured memory_bytes: 4660
#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;

struct Edge {
	int to, cost, dis;
};

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

	cin >> N >> M >> K;
	if (K > 2500)K = 2500;
	vector<vector<long long int>>dp(N, vector<long long int>(2501, MOD*MOD));
	dp[0][K] = 0;
	vector<vector<Edge>>edge(N);
	for (int i = 0; i < M; i++) {
		cin >> L >> R >> H >> W;
		L--, R--;
		Edge e;
		e.to = R, e.cost = H, e.dis = W;
		edge[L].push_back(e);
		e.to = L;
		edge[R].push_back(e);
	}
	vector<int>v(N);
	vector<int>w(N);
	for (int i = 0; i < N; i++) {
		cin >> v[i] >> w[i];
	}
	priority_queue<pair<long long int, pair<int, int>>, vector<pair<long long int, pair<int, int>>>, greater<pair<long long int, pair<int, int>>>>PQ;
	PQ.push({ 0,{0,K} });
	while (!PQ.empty()) {
		long long int c;
		int p, coin;
		c = PQ.top().first;
		tie(p, coin) = PQ.top().second;
		PQ.pop();
		if (dp[p][min(2500, coin + v[p])] > c + w[p]) {
			dp[p][min(2500, coin + v[p])] = c + w[p];
			PQ.push({ dp[p][min(2500, coin + v[p])] ,{p,min(2500,coin + v[p])} });
		}
		for (auto i : edge[p]) {
			if (coin < i.cost)continue;
			if (dp[i.to][coin - i.cost] > c + i.dis) {
				dp[i.to][coin - i.cost] = c + i.dis;
				PQ.push({ dp[i.to][coin - i.cost],{i.to,coin - i.cost} });
			}
		}
	}
	for (int i = 1; i < N; i++) {
		long long int ret = MOD * MOD;
		for (int j = 0; j <= 2500; j++) {
			ret = min(ret, dp[i][j]);
		}
		cout << ret << endl;
	}
}

Measured memory_bytes: 6272
#include<iostream>

using namespace std;

int x, y;

int gcd(int x, int y)
{
	if (y == 0) { return x; }
	return gcd(y, x%y);
}

int main()
{
	cin >> x >> y;
	cout << gcd(x, y) << endl;
    return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
 
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------
 
int N;
vector<int> E[101010];
int dist[101010][2];
 
void dfs(int cur,int pre,int id,int d) {
	dist[cur][id]=d;
	FORR(r,E[cur]) if(r!=pre) dfs(r,cur,id,d+1);
}
 
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N-1) {
		cin>>x>>y;
		E[x-1].push_back(y-1);
		E[y-1].push_back(x-1);
	}
	dfs(0,0,0,0);
	dfs(N-1,N-1,1,0);
	
	int A=0,B=0;
	FOR(i,N) {
		if(dist[i][0]<=dist[i][1]) A++;
		else B++;
	}
	
	if(A>B) return _P("Fennec\n");
	else _P("Snuke\n");
	
	
}
 
 
int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}

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

namespace AtCoder.Abc
{
    class QuestionC
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            
            // 整数の入力
            long n = long.Parse(Console.ReadLine());

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

            HashSet<long> set = new HashSet<long>();

            for(int i = 0; i < n; i++)
            {
                long a = aArray[i];
                if (set.Contains(a))
                {
                    Console.WriteLine("NO");
                    Console.Out.Flush();
                    return;
                }
                set.Add(a);
            }

            Console.WriteLine("YES");

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 47568
/*
1118 のような、3 つ以上の同じ数字が連続して並んだ 
4 桁の整数を 良い整数 とします。
4 桁の整数 N が与えられるので、
N が 良い整数 かどうかを答えてください。
*/
#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    int counter = 0;
    int flag = 0;
    if (s[0] == s[1]) ++counter;
    else counter = 0;
    if (s[1] == s[2]) ++counter;
    else counter = 0;
    if (counter==2) ++flag;
    if (s[2] == s[3]) ++counter;
    else counter = 0;
    if (counter==2) ++flag;
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
bingo = []
checker = 0
for i in range(3):
    bingo.append([int(j) for j in input().split()])
n = int(input())
for i in range(n):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if bingo[j][k] == b:
                bingo[j][k] = 0
for i in range(3):
    if checker == 1:
        break
    if bingo[i][0] ==0 and  bingo[i][1] == 0 and bingo[i][2] == 0:
        checker = 1
    if bingo[0][i] == 0 and bingo[1][i] == 0 and bingo[2][i] == 0:
        checker = 1
    if bingo[0][0] == 0 and  bingo[1][1] == 0 and bingo[2][2] == 0:
        checker = 1
    if bingo[0][2] == 0 and bingo[1][1] == 0 and bingo[2][0] == 0:
        checker = 1

if checker:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3192
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        int[] ryou = new int[130];
        for (int i = 0; i < 130; i++) {
            ryou[i] = 0;
        }
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
            int b = scanner.nextInt();
            int f = scanner.nextInt();
            int r = scanner.nextInt();
            int v = scanner.nextInt();
            ryou[(b - 1) * 30 + (f - 1) * 10 + (r - 1)] += v;
        }

        for (int b = 0; b < 4; b++) {
            for (int f = 0; f < 3; f++) {
                for (int r = 0; r < 10; r++) {
                    System.out.print(" " + ryou[b * 30 + f * 10 + r]);
                }
                System.out.println("");
            }
            if (b != 3) {
                System.out.println("####################");
            }
        }


    }

}


Measured memory_bytes: 30232