akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>

#define MAX_INT 2147483647
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::string;
using std::pair;
using std::cin;
using std::cout;

int X, K;

struct fun {
    int x1, y1, x2, y2;
};

int calc(fun f, int x) {
    if (x <= f.x1) {
        return f.y1;
    } else if (x >= f.x2) {
        return f.y2;
    } else {
        if (f.y2 > f.y1) {
            return f.y1 + (x - f.x1);
        } else {
            return f.y1 - (x - f.x1);
        }
    }
}
fun decrease(fun f, int t) {
    if (f.y1 <= t && f.y2 <= t) {
        return {0, 0, 0, 0};
    } if (f.y1 >= t && f.y2 >= t) {
        return {f.x1, f.y1 - t, f.x2, f.y2 - t};
    } else if (f.y1 < t) {
        return {f.x1 + (t - f.y1), 0, f.x2, f.y2 - t};
    } else {
        return {f.x1, f.y1 - t, f.x2 - (t - f.y2), 0};
    }
}

fun rotate(fun f) {
    return {f.x1, X - f.y1, f.x2, X - f.y2};
}


// @author: pashka

int main() {
    std::ios::sync_with_stdio(false);

    cin >> X;
    cin >> K;

    vector<int> time(K);
    for (int i = 0; i < K; i++) {
        cin >> time[i];
    }

    int q;
    cin >> q;


    fun cur = {0, 0, X, X};
    int j = 0;

    int state = 0;
    for (int i = 0; i < q; i++) {
        int t, x;
        cin >> t >> x;
        while (j < K && time[j] < t) {
            int tt = j == 0 ? time[j] : time[j] - time[j - 1];
            cur = decrease(cur, tt);
            cur = rotate(cur);
//            cout << cur.x1 << " " << cur.y1 << "   " << cur.x2 << " " << cur.y2 << "\n";
            j++;
            state = 1 - state;
        }
        int tt = j == 0 ? t : t - time[j - 1];
        fun res = decrease(cur, tt);
//        cout << res.x1 << " " << res.y1 << "   " << res.x2 << " " << res.y2 << "\n";
        cout << (state == 0 ? calc(res, x) : (X - calc(res, x))) << "\n";
    }

    return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
 
const int N = 1e7 + 7;
const int mod = 1e9 + 7;


int main(){
	fast;
	int x;
	cin>>x;
	cout<<360/__gcd(360,x);
}


Measured memory_bytes: 3576
n, a = map(int, input().split())
x = list(map(int, input().split()))
max_ = sum(x)

# dp[i枚目のカード][すでに何枚選んでいるか][値]
dp = [[[0] * (max_ + 1) for i in range(n + 1)] for i in range(n + 1)]
dp[0][0][0] = 1
for i in range(n):
    for j in range(n):
        for num in range(max_ + 1):
            # i枚目を選ぶ
            if num - x[i] >= 0:
                dp[i + 1][j + 1][num] += dp[i][j][num - x[i]]
            # i枚目を選ばない
            dp[i + 1][j][num] += dp[i][j][num]

ans = 0
for i in range(1, n + 1):
    for val in range(1, max_ + 1):
        if val == a * i:
            ans += dp[-1][i][val]
print(ans)


Measured memory_bytes: 93404
package main

import "fmt"

func main() {
	grid := make([][3]int, 3)
	for i := 0; i < 3; i++ {
		grid[i] = [3]int{}
		for j := 0; j < 3; j++ {
			fmt.Scan(&grid[i][j])
		}
	}
	// fmt.Println(grid)

	var a1, a2, a3, b1, b2, b3 int
	b1 = grid[0][0] - a1
	b2 = grid[1][0] - a1
	b3 = grid[2][0] - a1
	a2 = grid[0][1] - b1
	a3 = grid[0][2] - b1

	flag := true
	if grid[1][1] != a2 + b2 {
		flag = false
	}
	if grid[1][2] != a3 + b2 {
		flag = false
	}
	if grid[2][1] != a2 + b3 {
		flag = false
	}
	if grid[2][2] != a3 + b3 {
		flag = false
	}

	if flag == true {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}

}


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

int main(){
  long int x = 0,Min,Max,Sum = 0;
  cin >> x;
  int y[x];
  for(int i = 0;i < x;i++){
    cin >> y[i];
  }
  Min = y[0];
  for(int i = 0;i < x;i++){
    if(Min > y[i]){
      Min = y[i];
    }
  }
  Max = y[0];
  for(int i = 0;i < x;i++){
    if(Max < y[i]){
      Max = y[i];
    }
  }
  for(int i = 0;i < x;i++){
      Sum += y[i];
  }
  cout<<Min<<' '<<Max<<' '<<Sum<<endl;
  return 0;
}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  string s;
  cin>>s;
  vector<int>d(26);
  rep(i,s.size()){
    d[s[i]-'a']++;
  }
  rep(i,26){
    if(d[i]%2){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
}
    

Measured memory_bytes: 3608
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <queue>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;

#define MP make_pair
#define PB push_back
#define FF first
#define SS second

#define FORN(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define PR0(A,n) { cout << #A << " = "; FORN(_,n) cout << A[_] << ' '; cout << endl; }

// #define FL fflush(stdout)

#define MOD 1000000007
#define INF 2000000000
#define MAXN 100010

int GLL(LL& x) {
  return scanf("%lld", &x);
}

int GI(int& x) {
  return scanf("%d", &x);
}

string s;
LL counts[30];

LL choose(LL n) {
  return (n-1) * n / 2;
}

int main() {
  cin >> s;
  memset(counts, 0, sizeof counts);

  for (auto c : s) {
    counts[c - 'a']++;
  }

  LL ans = 1 + choose(s.size());
  FORN(i, 26) {
    ans -= choose(counts[i]);
  }

  printf("%lld\n", ans);
    
  return 0;
}

Measured memory_bytes: 640
# C - Remainder Minimization 2019

L, R = map(int, input().split())

mn = float('inf')
for i in range(L, L + 2019):
    for j in range(i + 1, L + 2019 + 1):
        if L <= i < j and i < j <= R:
            mn = min(mn, i * j % 2019)

print(mn)


Measured memory_bytes: 2940
// In the name of God

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;	
	cin >> n;
	vector<int> v(n);
	for(int i=0;i<n;i++) cin >> v[i];
	for(int i=0;i<n;i++) {
		if(v[i] % 2 != 0) continue;
		if(v[i] % 3 != 0 && v[i] % 5 != 0) {
			cout << "DENIED";
			exit(0);
		}
	}
	cout << "APPROVED";
	return 0;
}


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;

int main(){
    ll n,m,mod=1e9+7; cin>>n>>m;
    vector<ll> s(n),t(m);
    ll dp[2005][2005];
    rep(i,n) cin>>s[i];
    rep(i,m) cin>>t[i];

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            (dp[i][j]=dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1]+mod)%=mod;
            if(s[i-1]==t[j-1]) (dp[i][j] += dp[i-1][j-1] + 1)%=mod;
        }
    }

    cout << (dp[n][m] + 1) % mod << endl;
}

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

const int N = 100001;

vector<int> g[N];

int n,d[N],c[N],f[N][2];
const int mod=1000000007;

void dfs(int u, int anc)
{
    f[u][0] = f[u][1] = 1;
    for (int v : g[u])
    {
        if (v == anc) continue;
        dfs(v,u);
        f[u][1] = (f[u][1] * f[v][0])%mod;
        f[u][0] = (f[u][0] * (f[v][0] + f[v][1])) % mod;
    }
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin >> n;
    for (int i=1,u,v; i<n; i++)
    {
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1,0);
    cout << (f[1][0] + f[1][1]) % mod;
    return 0;
}


Measured memory_bytes: 15360
// Package main provides
//
// File:  d.go
// Author: ymiyamoto
//
// Created on Wed Dec 26 21:40:31 2018
//
package main

import (
	"fmt"
	"sort"
)

type node struct {
	index  int
	parent int
}

type unionFind struct {
	nodes []node
	rank  []int
}

func new(n int) unionFind {
	u := unionFind{}
	u.nodes = make([]node, n)
	u.rank = make([]int, n)
	for i := range u.nodes {
		u.nodes[i].index = i
		u.nodes[i].parent = i
	}
	return u
}

func (u unionFind) top(a int) int {
	p := u.nodes[a].parent
	for p != u.nodes[p].parent {
		p = u.nodes[p].parent
	}

	return p
}

func (u unionFind) union(a, b int) {
	ap := u.top(a)
	bp := u.top(b)
	if u.rank[ap] == u.rank[bp] {
		u.nodes[ap].parent = bp
		u.rank[bp]++
	} else if u.rank[ap] < u.rank[bp] {
		u.nodes[ap].parent = bp
	} else {
		u.nodes[bp].parent = ap
	}
}

func (u unionFind) find(a int) int {
	return u.top(a)
}

func (u unionFind) sets() map[int][]int {
	m := map[int][]int{}
	for i := range u.nodes {
		if _, ok := m[u.top(i)]; ok {
			m[u.top(i)] = append(m[u.top(i)], i)
		} else {
			m[u.top(i)] = []int{i}
		}
	}

	return m
}

func main() {
	var N, M int
	fmt.Scan(&N, &M)

	ps := make([]int, N)
	for i := range ps {
		fmt.Scan(&ps[i])
	}

	u := new(N)
	for i := 0; i < M; i++ {
		var x, y int
		fmt.Scan(&x, &y)
		x--
		y--
		u.union(x, y)
	}

	ans := 0
	for _, set := range u.sets() {
		var vals, indexs []int
		for _, i := range set {
			vals = append(vals, ps[i]-1)
			indexs = append(indexs, i)
		}
		sort.Ints(vals)
		sort.Ints(indexs)
		i := 0
		j := 0
		for i < len(vals) && j < len(indexs) {
			if vals[i] == indexs[j] {
				ans++
				i++
				j++
			} else if vals[i] < indexs[j] {
				i++
			} else {
				j++
			}
		}
	}

	fmt.Println(ans)
}


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

int main() {
	// your code goes here
	string s;
	cin>>s;
	int x = 0;
	for(int i=0;i<s.length();++i) {
		x += (s[i]-'0');
	}
	string ans = (x%9 == 0 ? "Yes" : "No");
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3688
d = dict()
d['a'] = 1
d['b'] = 2
d['c'] = 3
d['d'] = 4
d['e'] = 5
d['f'] = 6
d['g'] = 7
d['h'] = 8
d['i'] = 9
d['j'] = 10
d['k'] = 11
d['l'] = 12
d['m'] = 13
d['n'] = 14
d['o'] = 15
d['p'] = 16
d['q'] = 17
d['r'] = 18
d['s'] = 19
d['t'] = 20
d['u'] = 21
d['v'] = 22
d['w'] = 23
d['x'] = 24
d['y'] = 25
d['z'] = 26

e = dict()
e[1] = 'a'
e[2] = 'b'
e[3] = 'c'
e[4] = 'd'
e[5] = 'e'
e[6] = 'f'
e[7] = 'g'
e[8] = 'h'
e[9] = 'i'
e[10] = 'j'
e[11] = 'k'
e[12] = 'l'
e[13] = 'm'
e[14] = 'n'
e[15] = 'o'
e[16] = 'p'
e[17] = 'q'
e[18] = 'r'
e[19] = 's'
e[20] = 't'
e[21] = 'u'
e[22] = 'v'
e[23] = 'w'
e[24] = 'x'
e[25] = 'y'
e[26] = 'z'

s =input()
lists = []
for i in range(len(s)):
    lists.append(d[s[i]])
lists.sort()
for i in range(1,28):
    if i != 27:
        if i not in lists:
            print(e[i])
            break
    else:
        print('None')
    

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

using namespace std;

const int M = 2e5 + 10;
int n;
long long arr[M];

int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
#endif
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%lld", arr + i);
    }
    sort(arr, arr + n);
    reverse(arr, arr + n);
    // for (int i = 0; i < n; i++) {
    //     printf("%lld ", arr[i]);
    // }
    // puts("");
    long long ans = arr[0], last = arr[1], t = 2;
    for (int i = 2, j = 2; i < n; i++) {
        if (t > 0) {
            ans += last;
            t--;
            if (t == 0) {
                last = arr[j++];
                t = 2;
            }
        }
    }
    printf("%lld", ans);
    return 0;
}

Measured memory_bytes: 5376
#include<stdio.h>

#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2




int n,M[N][N];
int color[N], d[N], f[N],tt;



void dfs_visit(int u){
  int v;
  color[u]=GRAY;
  d[u]=++tt;//最初の訪問
  for(v=0; v<n; v++)
    {
      if(M[u][v]==0) continue;
      if(color[v]==WHITE){
	dfs_visit(v);
      }
    }
  color[u]=BLACK;
  f[u]=++tt;
}


void dfs(){
  int u;
  for(u=0; u<n; u++) color[u]=WHITE;
  tt=0;

  for(u=0; u<n; u++){
    //未訪問の頂点を支点として深さ優先探索
    if(color[u]==WHITE) dfs_visit(u);
  }
  for(u=0; u<n; u++){
    printf("%d %d %d\n",u+1,d[u],f[u]);
  }
}








int main() {
  int u,v,k,i,j;

  scanf("%d",&n);
  for(i=0; i<n; i++){
    for(j=0; j<n; j++) M[i][j]=0;
  }//hairetu syokika

  for(i=0; i<n; i++){
    scanf("%d %d",&u,&k);
    u--;
    for(j=0; j<k; j++){
      scanf("%d",&v);
      v--;
      M[u][v]=1;
    }
  }//rinsetu gyouretu

  dfs();

  return 0;
  
}



Measured memory_bytes: 2036
#include<iostream>
#include<sstream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cfloat>
#include<functional>
#include<map>
#include<string>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<bitset>
#include<list>
#include<numeric>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)

bool mycom(i_i a, i_i b){
  if(a.X == b.X)return a.Y < b.Y;
  return a.X > b.X;
}

signed main(void){
  int i, j, k;
  int a[25] = {1};
  rep1(i, 25)a[i] = a[i - 1] * 2;
  for(int testcase = 0;testcase < 1234567;testcase++){
    int2(n, q);
    rep(i, 25)if(n <= a[i])break;

    vector<i_i> sgt;
    sgt.resize(a[i + 1]);
    rep(j, a[i + 1])sgt[j] = mp(-123, n + 1);
    sgt[0] = mp(i, a[i]);

    rep(i, n)sgt[sgt[0].Y + i] = mp(0, i + 1);

    for(;q--;){
      int2(x, v);
      x = sgt[0].Y + x - 1;
      if(v > 0){
        sgt[x].X += v;
        for(;x != 1;x/=2){
          if(mycom(sgt[x], sgt[x / 2]))sgt[x / 2] = sgt[x];
          else break;
        }
      }else{
        sgt[x].X += v;
        for(;x != 1;x/=2){
          if(mycom(sgt[(x / 2) * 2], sgt[(x / 2) * 2 + 1]))sgt[x / 2] = sgt[(x / 2) * 2];
          else sgt[x / 2] = sgt[(x / 2) * 2 + 1];
        }
      }
      pri2(sgt[1].Y, sgt[1].X);
    }


/*/

//*/ break;
  }
  return 0;
}

Measured memory_bytes: 17424
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
    int k, n;
    cin >> k >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    
    vector<int> d(n);
    for (int i = 0; i < n - 1; i++)
        d[i] = a[i+1] - a[i];
    
    d[n-1] = k - a[n-1] + a[0];
    
    int ans = accumulate(d.begin(), d.end(), 0) - *max_element(d.begin(), d.end());
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstdlib>
#define LL long long
#define LD long double
using namespace std;
const int NN=200000 +117;
const int MM=1 +117;
int read(){
	int fl=1,x;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if(c=='-'){fl=-1;c=getchar();}
	for(x=0;c>='0'&&c<='9';c=getchar())
		x=(x<<3)+(x<<1)+c-'0';
	return x*fl;
}
void open(){
	freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
}
void close(){
	fclose(stdin);
	fclose(stdout);
}


int m,n;
LL dp[17][NN]={};
LL fact[NN]={};
LL rev[NN]={};
const int mod=1e9+7;
LL ksm(LL a ,LL b){
	LL ret=1;
	for(;b;b>>=1,a=a*a%mod){
		if(b&1)ret=ret*a%mod;
	}
	return ret;
}
void prefact(int n){
	fact[0]=1;
	for(int i=1;i<=n;++i)fact[i]=fact[i-1]*i%mod;
	rev[n]=ksm(fact[n],mod-2);
	for(int i=n;i>=1;--i)rev[i-1]=rev[i]*i%mod;
}
LL comp(int n,int m){
	return fact[n]*rev[m]%mod*rev[n-m]%mod;
}
int a[NN]={};
inline void upd(LL &x,LL y){
	x=(x+y)%mod;
}
int main(){
	//open();
	n=read();
	m=read();
	int all=1<<n;
	prefact(all);
	for(int i=m;i>=1;--i){
		a[i]=read();
	}
	dp[0][0]=1;
	for(int i=0;i<m;++i){
		for(int s=0;s<all;++s){
			int rem=all-a[i+1]-s;
			upd(dp[i+1][s],dp[i][s]);
			for(int k=1;k<=rem+1;k<<=1){
				if(k&s)continue;
				upd(dp[i+1][s|k],-dp[i][s]*comp(rem,k-1)%mod*fact[k]);
			}
		}
	}
	LL ans=0;
	for(int s=0;s<all;++s){
		upd(ans,dp[m][s]*fact[all-s-1]);
	}
	ans*=all;
	ans%=mod;
	ans=(ans+mod)%mod;
	printf("%lld\n",ans);
	close();
	return 0;
}

Measured memory_bytes: 27904
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define ld long double
using namespace std;

inline ll read()
{
	ll x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

ll n,l,t[maxn];
const ld pi=acos(-1.0);

int main()
{
	n=read(); l=read(); rep(i,1,n) t[i]=read();
	ld ax=0,ay=0;
	rep(i,1,n-1) rep(j,i+1,n)
	{
		ax+=(n-1-j+i)*cos(pi*(ld)(t[i]+t[j])/l);
		ax-=(j-i-1)*cos(pi*(ld)(t[i]+t[j])/l);
		
		ay+=(n-1-j+i)*sin(pi*(ld)(t[i]+t[j])/l);
		ay-=(j-i-1)*sin(pi*(ld)(t[i]+t[j])/l);
	}
	ld t=n*(n-1)*(n-2)/6; ax/=t; ay/=t;
	printf("%.15Lf %.15Lf\n",ax,ay);
	return 0;
}

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

using namespace std;

int main(){
  int e[4];
  for(int i=0;i<4;++i) cin >> e[i];
  sort(e,e+4);
  if(e[0]==e[1]&&e[2]==e[3]) cout << "yes" << endl;
  else  cout << "no" << endl;
  
  return 0;
}



Measured memory_bytes: 3132
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

	static BufferedReader reader;
	final static boolean MODE_DEBUG = false;
	//static field here
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		//code here
		int[] NM = readLineInt();
		int A = NM[0];
		int B = NM[1];
		int C = NM[2];
		int K = NM[3];
		
		int ans = 0;
		int got = 0;
		for(;got<A&&got<K;got++) {
			ans++;
		}
		for(;got<A+B&&got<K;got++) {
		}
		for(;got<A+B+C&&got<K;got++) {
			ans--;
		}
		print(ans);
	}
	
	//functions here
	//note that all methods should be STATIC


	private static <T> int arraySearch(T needle, T[] heystack) {
		for(int i=0;i<heystack.length;i++) {
			if(needle.equals(heystack[i])) {
				return i;
			}
		}
		return -1;
	}
	private static int[] sort(int[] base) {
		int[] copy = array_copy(base);
		Arrays.sort(copy);
		return copy;
	}
	private static int[] array_copy(int[] base) {
		int[] copy = new int[base.length];
		for(int i=0;i<base.length;i++) {
			copy[i] = base[i];
		}
		return copy;
	}
	private static int[] asArray(ArrayList<Integer> ints) {
		int[] intlist = new int[ints.size()];
		for(int i=0;i<intlist.length;i++) {
			intlist[i] = ints.get(i);
		}
		return intlist;
	}
	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static int[] readLineInt(){
		try{
			String[] s = readLine();
			int[] ints = new int[s.length];
			for(int i=0;i<ints.length;i++) {
				ints[i] = Integer.parseInt(s[i]);
			}
			return ints;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static byte[] readLineByte(){
		try{
			String[] s = readLine();
			byte[] bytes = new byte[s.length];
			for(int i=0;i<bytes.length;i++) {
				bytes[i] = Byte.parseByte(s[i]);
			}
			return bytes;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static char[] readLineChar(){
		try{
			String[] s = readLine();
			char[] chars = new char[s.length];
			for(int i=0;i<chars.length;i++) {
				chars[i] = (char)Integer.parseInt(s[i]);
			}
			return chars;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
	private static void printd(Object o){
		if(MODE_DEBUG)System.err.println(o);
	}
	private static void printd(){
		if(MODE_DEBUG)System.err.println();
	}
}


Measured memory_bytes: 32840
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;
const int N = 100010;
int n, m, l = 0, r = N;

int main() {
	scanf("%d%d", &n, &m);
	for(int i = 1, x, y; i <= m; i++) {
		scanf("%d%d", &x, &y);
		l = max(l, x), r = min(r, y);
	}
	if(l > r) cout << 0 << endl;
	else cout << r - l + 1 << endl;
	return 0;
}

Measured memory_bytes: 256
N = 6
S = ')))())'


# N = 8
# S = '))))(((('

# N = 3
# S = '())'

# N = 9
# S = '(())()()('

N = int(input())
S = input()

def calculate(n, str):

    finalStr = ''
    while True:
        point = 0
        remainStr = ''
        for i in range(len(str)):
            if i > 0:
                if (str[i-1] == '(') and (str[i] == ')'):
                    point += 1
                    continue

            if i < (n - 1):
                if (str[i] == '(') and (str[i+1] == ')'):
                    point += 1
                    continue

            remainStr += str[i]

        str = remainStr
        n = len(str)
        if point == 0:
            finalStr = remainStr
            return finalStr
            break







res = calculate(N, S)

for i in range(len(res)):
    if res[i] == '(':
        S = S + ')'

    if res[i] == ')':
        S = '(' + S

print(S)
# print(result)


Measured memory_bytes: 9164
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define ALL(x) (x).begin(), (x).end()
const long long INF = 1e15;
using namespace std;
typedef long long ll;

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(begin(ret), end(ret));
  return (ret);
}

bool is_prime(ll x) {
  for (ll i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}

int main() {
  ll n;
  cin >> n;
  if (is_prime(n)) {
    cout << n - 1 << endl;
    return 0;
  }
  auto div = divisor(n);
  ll ans = INF;
  for (auto x : div) {
    ll y = n / x;
    ans = min(ans, x - 1 + y - 1);
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}




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

  ll N , P; cin >> N >> P;

  ll odd = 0;
  ll even = 0;
  
  rep(i,N){
    ll inp; cin >> inp;
    if(inp%2 == 1) odd ++;
    else even ++;
  }


  ll ans = 0;
  map<ll,ll> o;
  for(ll i = P; i<= odd; i+=2){
    if(i == 0) o[i] = 1;
    else if(i==1) o[i] = odd;
    else o[i] = o[i-2]*(odd-i+1)*(odd-i+2)/(i*(i-1));
    ans += o[i];
  }
  ans *= pow(2,even);
  cout << ans  << endl;

  

  
  
  //cout << fixed << setprecision(16) << ans << endl;
  
  return 0;
}


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

int main() {
  int N , M ;
  cin >> N >> M ;
  vector<int>city(N);
  for ( int i = 0 ; i < M ; i++ ){
    int a , b;
    cin >> a >> b ;
    city.at(a-1)++;
    city.at(b-1)++;
  }
  for ( int i = 0 ; i < N ; i ++ ){
    cout << city.at(i) << endl;
  }
}


Measured memory_bytes: 764
from collections import deque
n,m=map(int,input().split())
lst=[[] for i in range(n)]
ans=[0 for i in range(n)]
for i in range(m):
    a,b=list(map(int,input().split()))
    lst[a-1].append(b-1)
    lst[b-1].append(a-1)
que=deque([])
que.append(1)
while que:
    p=que.popleft()
    for i in lst[p-1]:
        if ans[i]==0:
            ans[i]=p
            que.append(i+1)
print("Yes")
for i in range(1,n):
    print(ans[i])

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

int main() {
    int S;
    string r = "Good";
  	cin >> S;

    int th = S / 1000;
    int h = (S - th * 1000) / 100;
    int te = (S - th * 1000 - h * 100) / 10;
    int o = S - th * 1000 - h * 100 - te * 10;

    vector<int> vec = {th,h,te,o};

    for (int i = 0; i < 3; i++) {
        if (vec.at(i) == vec.at(i + 1)) {
            r = "Bad";
            break;
        }
    }

    cout << r << endl;


}

Measured memory_bytes: 256
N = int(input())
All = N*(N+1)/2
fizzbuzz = int(N/15)
FizzBuzz = fizzbuzz*(fizzbuzz+1)/2*15
fizz = int(N/3)
Fizz = fizz*(fizz+1)/2*3
buzz = int(N/5)
Buzz = buzz*(buzz+1)/2*5

print(int(All-Fizz-Buzz+FizzBuzz))

Measured memory_bytes: 9188
// Ivan Zanov
// Template
#include <iostream>
#include <utility>
#include <bitset>
#include <vector>
#include <set>
#include <unordered_map>
#include <map>
#include <assert.h>
#include <cmath>
#include <algorithm>
#include <complex>
#include <deque>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <memory>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <sstream>
#include <exception>
#include <functional>
#include <cstring>
#include <cstdlib>
using namespace std;
#define lowbit(x) ((x)&((x)^((x)-1)))
#define max(a,b) (a<b?b:a)
#define IOS ios_base::sync_with_stdio(0);
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define INF (int)1e9
#define EPS (int)1e-9
#define bit_count __builtin_popcount
#define gcd __gcd
#define size(r) r.size()
#define max3(a, b, c) max(a, max(b,c))
#define min3(a, b, c) min(a, min(b,c))
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
inline void set_bit(int & n, int b) { n |= (1 << (int) b); }
inline void unset_bit(int & n, int b) { n &= ~(1 << (int) b); }
inline bool check_bit(int n, int pos) { return ( n & (1 << (pos))); }
inline ll lcm(ll a, ll b){ return (a * b / gcd(a,b));}
int main() {
    int n;
    cin>>n;
    string a, b;
    cin>>a>>b;
    string nov;
    for(int i =0;i<n;i++)
    {
        nov += a[i];
        nov += b[i];
    }
    cout<<nov<<endl;
    return 0;
}


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

int main(){
	int h, w;
	char s[101][101];
	int row[100] = {0}, col[100] = {0};
	scanf("%d%d", &h, &w);
	for(int i=0; i < h; i++)
		scanf("%s", s[i]);
	for(int i=0; i < h; i++) {
		for(int j=0; j < w; j++) {
			if(s[i][j] == '#') {
				row[i] = 1;
				col[j] = 1;
			}
		}
	}

	for(int i=0; i < h; i++) {
		if(row[i]) {
			for(int j=0; j < w; j++) {
				if(col[j])
					printf("%c", s[i][j]);
			}
			printf("\n");
		}
	}
}


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

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

	vector<int> A(N);
	for(int i=0; i<N; ++i) cin>>A[i];
	sort(A.begin(), A.end());

	int ans = N;
	int sum = 0;
	for(int i=N-1; i>=0; --i){
		if(sum+A[i]<K) sum += A[i];
		else ans = i;
	}
	cout<< ans <<endl;
}

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

int main(){
  double w,h,x,y;scanf("%lf%lf%lf%lf",&w,&h,&x,&y);
  printf("%.9f\n",(double)w*h/2);
  x==w/2&&y==h/2 ? printf("1"):printf("0");
  
}

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



int main() {
  string s;
  cin >> s;
  int64_t k;
  cin >> k;
  
  if (s.at(0) != '1') {
    cout << s.at(0) << endl;
  }
  else {
    for (int i = 0; i < k; i++) {
      if (s.at(i) != '1') {
        char ans = s.at(i);
        cout << ans << endl;
        break;
      }
      else if (i == k-1) {
        cout << '1' << endl;
      }
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
typedef long long ll;
using namespace std;

int main() {
	ll n,t;
	cin>>n>>t;
	ll c,t1,ans=10000;
	for(int i=0;i<n;i++){
		cin>>c>>t1;
		if(t1<=t){
			ans=min(ans,c);
		}
	}
	if(ans==10000){
		cout << "TLE"<<endl;
	}
	else{
		cout <<ans<<endl;
	}
	return 0;
}




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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

// テーブルを作る前処理
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
	ll N,A,B,C,D;
	cin >> N >> A >> B >> C >> D;

    bool ans = false;
    REP(i,N) if(C*i-D*(N-1-i)<= B-A && B-A <= D*i-C*(N-1-i)) ans = true;
    
    YES(ans)

	return 0;
}


Measured memory_bytes: 256
/*

by.YXH_XianYu
   2018.6.15
 */
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>

long long d,n,i,cnt;

int main(){
	//freopen("mothergoose.in","r",stdin);
	//freopen("mothergoose.out","w",stdout);

	scanf("%lld%lld",&d,&n);
	for(i=1;1;i++){
		int times=0,j=i;
		while(j%100==0)
			times++,j/=100;
		if(times==d){
			cnt++;
			if(cnt==n)
				break;
		}
	}
	printf("%lld\n",i);


	return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())

edges = [[] for i in range(N + 1)]
bridges = []

for i in range(M):
  a, b = map(int, input().split())
  bridges.append((a,b))
  edges[a].append(b)
  edges[b].append(a)


ans = 0

for i in range(M):
  colors = ["white"] * (N + 1)
  u = bridges[0][0]
  stack = [u]
  a, b = map(int, bridges[i])

  while stack:
    u = stack.pop()
    colors[u] = "black"

    for v in edges[u]:
      if a == u and b == v:
        continue
      if b == u and a == v:
        continue
      if colors[v] != "black":
        stack.append(v)
  
  if len(list(filter(lambda x: x == "white" ,colors))) >= 2:
    ans += 1

print(ans)

Measured memory_bytes: 3064
import java.util.*;

public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        double d = scan.nextInt();
        double t = scan.nextInt();
        double s = scan.nextInt();
        if(t >= (double)(d / s)) System.out.println("Yes");
        else System.out.println("No");
    }

    public static void main(String[] args){
        new Main().solve();
    }
}


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

#define int long long

signed main() {
    int n, k;
    cin >> n >> k;
    vector<int> x(n);
    vector<int> y(n);
    vector<int> xary, yary;

    for(int i=0; i<n; ++i) {
        cin >> x[i] >> y[i];
        xary.push_back(x[i]);
        yary.push_back(y[i]);
    }
    sort(xary.begin(), xary.end());
    sort(yary.begin(), yary.end());

    int ans = (int)((xary[n-1]-xary[0])*(yary[n-1]-yary[0]));
    for(int xi=0; xi<n; ++xi) {
        for(int xj=xi+1; xj<n; ++xj) {
            for(int yi=0; yi<n; ++yi) {
                for(int yj=yi+1; yj<n; ++yj) {
                    int num = 0;
                    int lx = xary[xi], rx = xary[xj];
                    int by = yary[yi], uy = yary[yj];
                    for(int i=0; i<n; ++i) {
                        if(lx<=x[i] && x[i] <= rx && by <= y[i] && y[i] <= uy) num++;
                    }
                    if(num >= k) ans = min(ans, (int)((rx-lx)*(uy-by)));
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int a[3];
	int i=0;
	int b=0;
	
	for(i=0;i<3;i++){
		cin>>a[i];
	}
	if(a[2]<a[0]){
		b=1;
	}else{
		if(a[2]>a[1]){
			b=1;
		}
	
	}
	
	if(b==0){
		cout<<"Yes";
	}
	if(b==1){
		cout<<"No";
	}
}
	

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>

using namespace std;

int main(){
  int i,n;
  int pm,pe,pj;
 while(1){
   cin>>n;
   if(n==0)break;

   for(i=0;i<n;i++){  
     cin>>pm>>pe>>pj;
     if(pm==100||pe==100||pj==100) cout<<'A'<<endl;
     else if((pm+pe)/2>=90) cout<<'A'<<endl;
     else if(((pm+pe+pj)/3)>=80) cout<<'A'<<endl;
     else if(((pm+pe+pj)/3)>=70) cout<<'B'<<endl;
     else if(((pm+pe+pj)/3)>=50){
       if(pm>=80||pe>=80) cout<<'B'<<endl;
       else cout<<'C'<<endl;
     }
     else  cout<<'C'<<endl;

   }
 }   
 return 0;
}

Measured memory_bytes: 0
#include <iostream>
using namespace std;
int main(){
	string s;
	int a,b,ls;
	cin>>a>>b>>s;
	ls=s.length();
	if(s[a]!='-'){
		cout<<"No"<<endl;
		return 0;
	}
	s[a]='1';
	for(int i=0;i<ls;i++)
	{
		if(s[i]>'9'||s[i]<'0')
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
} 

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

using namespace std;

typedef long long ll;

const int MX = 505;

template <typename T> void cmin(T &x, const T &y)
{
	if(y < x) x = y;
}

template <typename T> void cmax(T &x, const T &y)
{
	if(y > x) x = y;
}

template <typename T> void read(T &x)
{
	x = 0; char c = getchar(); bool f = 0;
	while(!isdigit(c) && c!='-') c = getchar();
	if(c == '-') f = 1, c = getchar();
	while(isdigit(c)) x = x*10+c-'0', c = getchar();
	if(f) x = -x;
}

int n;
int val[MX][MX];
ll neg[MX][MX], pos[MX][MX], f[MX][MX];

void input()
{
	read(n);
	for(int i=1; i<=n; i++)
	{
		for(int j=1; j<i; j++)
		{
			read(val[i][j]);
			pos[i][j] += val[i][j];
		}
		for(int j=i+1; j<=n; j++)
		{
			read(val[i][j]);
			neg[i][j] += val[i][j];
		}
	}
	for(int i=0; i<=n; i++)
		for(int j=1; j<=n; j++)
		{
			pos[i][j] += pos[i][j-1];
			neg[i][j] += neg[i][j-1];
		}
	for(int j=0; j<=n; j++)
		for(int i=1; i<=n; i++)
		{
			pos[i][j] += pos[i-1][j];
			neg[i][j] += neg[i-1][j];
		}
}

void work()
{
	memset(f, 0x3f, sizeof(f));
	for(int i=0; i<=n; i++) f[0][i] = neg[i][i];
	for(int i=0; i<=n; i++)
	{
		for(int j=i+1; j<=n; j++)
		{
			for(int k=j+1; k<=n; k++)
			{
				ll new_pos = pos[k][i] - pos[j][i];
				ll new_neg = neg[k][k] - neg[j][k] - neg[k][j] + neg[j][j];
				cmin(f[j][k], f[i][j] + new_pos + new_neg);
			}
		}
	}
	ll ans = 1e18;
	for(int i=0; i<=n; i++) cmin(ans, f[i][n]);
	printf("%lld\n", ans);
}

int main()
{
	input();
	work();
	return 0;
}


Measured memory_bytes: 7296
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;


fn main() {
    proconio::input! {
        a: usize,
        p: usize,
        }
    println!("{}",(a*3+p)/2)
}

Measured memory_bytes: 2152
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
template<typename T> auto compare = [](T x, T y) -> bool{return (x < y);};
const int MOD = 1000000007;

signed main(){
    int S, W;
    cin >> S >> W;
    if(S <= W) PRINT("unsafe");
    else PRINT("safe");
    return 0;
}

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

const double PI=acos(-1.0);

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    cout << max(0, (min(b, d) - max(a, c)));

    return 0;
}

Measured memory_bytes: 256
w, h, n = map(int, input().split())

maxx = w
minx = 0
maxy = h
miny = 0

for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        minx = max(minx, x)
    elif a == 2:
        maxx = min(maxx, x)
    elif a == 3:
        miny = max(miny, y)
    else:
        maxy = min(maxy, y)

ans = (maxx-minx)*(maxy-miny)
if minx > maxx or miny > maxy:
    print(0)
else:
    print(ans)


Measured memory_bytes: 62652
#include<stdio.h>

int main(){
  double max,min,h;
  max = 0;
  min = 1000000;
  while(scanf("%lf",&h)!=EOF){
    if(max < h)
      max = h;
    else if(min > h)
      min = h;
  }

  printf("%lf\n",max-min);
  return 0;

}



Measured memory_bytes: 2088
N = int(input())
a = list(map(int, input().split()))
max_a = max(a)
min_a = min(a)
print(2 * N - 1)
if abs(max_a) >= abs(min_a):
    for i in range(1, N + 1):
        print(a.index(max_a) + 1, i)
    for i in range(1, N):
        print(i, i + 1)
else:
    for i in range(1, N + 1):
        print(a.index(min_a) + 1, i)
    for i in range(N, 1, -1):
        print(i, i - 1)

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

using namespace std;

#define prec(n) fixed << setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int>>
#define PI 3.14159265
#define pb push_back
#define bits(n) __builtin_popcount(n)
#define ll long long int

void solve()
{
    int n,k;
    cin>>n>>k;
    vector<int> s;
    for(int i=0;i<n;i++)
    {
        int temp;
        cin>>temp;
        s.push_back(temp);
    }
    if(k>=n)
    cout<<"0";
    else{
    sort(s.begin(),s.end());
    while(k--)
    {
        s.pop_back();
    }
    ll sum=0;
    for(auto i:s)
    {
        sum+=i;
    }
    cout<<sum;
    }  

}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input1.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output1.txt", "w", stdout);
#endif

    int t=1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 4120
N=int(input())
Alist=list(map(int,input().split()))
multi=Alist[0]
ibreak=0
if(Alist.count(0)>0):
    print(0)
else:
    for i in range (N-1):
        multi*=Alist[i+1]
        if(multi>1e18):
            print(-1)
            ibreak=1
            break;
    if(ibreak==0):
        print(multi)

Measured memory_bytes: 21476
#include <stdio.h>
#include <stdlib.h>
int main(){
  int *alice = malloc(sizeof(int)), *bob = malloc(sizeof(int));
  scanf("%d%d", alice, bob);
  if (*alice == *bob) printf("Draw\n");
  else if(*alice == 1 || *alice > *bob && *bob != 1) printf("Alice\n");
  else if(*bob == 1 || *bob > *alice) printf("Bob\n");
  free(alice);
  free(bob);
}


Measured memory_bytes: 128
using System;

class program
{
    public static void Main()
    {
        // row column
        var strs = Console.ReadLine().Split(' ');
        var row = int.Parse(strs[0]);
        var column = int.Parse(strs[1]);

        int[,] A = new int[row, column];
        int[] b = new int[column];

        for (int i = 0; i < row; i++)
        {
            strs = Console.ReadLine().Split(' ');
            for (int j = 0; j < column; j++)
            {
                A[i, j] = int.Parse(strs[j]);
            }
        }

        for (int k = 0; k < column; k++)
        {
            b[k] = int.Parse(Console.ReadLine());
        }

        for (int l = 0; l < row; l++)
        {
            int x = 0;
            for (int m = 0; m < column; m++)
            {
                x += (A[l, m] * b[m]);
            }
            Console.WriteLine(x);
        }
    }
}

Measured memory_bytes: 7656
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = Console.ReadLine().Trim().Split(' ');
            int iN = int.Parse(sS[0]);
            int iX = int.Parse(sS[1]);
            List<int> lstM = new List<int>();
            for (int i = 0; i < iN; i++) { lstM.Add(int.Parse(Console.ReadLine().Trim())); }

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            lstM.Sort();
            int iOut = lstM.Count + (iX - lstM.Sum()) / lstM[0];

            // 出力
            Console.WriteLine("{0}", iOut.ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

}


Measured memory_bytes: 13396
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define pb(a) push_back(a)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

typedef long long unsigned int ll;
typedef pair<ll, ll> P;

int main(){
  int a,b;
  cin >> a >> b;
  if(b%a==0){
    cout << a+b <<endl;
  } else{
    cout <<b-a <<endl;
  }

}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>

using namespace std;

long long MOD = 1000000007;

vector<long long> fact(100000,1);
void factorial(int N){
    for(int i=1; i<N; i++){
        fact[i+1]=(i+1)*fact[i]%MOD;
    }
}

map<long long, long long> inv_fact;
long long inv_factorial(long long x){
    if (inv_fact.count(x)){
        return inv_fact[x];
    }
    long long p=MOD-2;
    long long ret=1;
    long long tmp=x;
    while(p>0){
        if(p%2==1)ret=ret*tmp%MOD;
        tmp=tmp*tmp%MOD;
        p/=2;
    }
    inv_fact[x]=ret;
    return ret;
}

long long comb(int a, int b){
    if(a<b)return 0;
    long long ret=fact[a]*inv_factorial(fact[a-b])%MOD;
    return ret*inv_factorial(fact[b])%MOD;
}

int main(){
    int N, K;
    cin >> N >> K;
    vector<long long> A(N,0);
    for(auto& a:A){
        cin >> a;
    }
    sort(A.begin(), A.end());

    vector<long long> p2(N,1);
    for(int i=0; i<N-1; i++){
        p2[i+1]=p2[i]*2%MOD;
    }

    factorial(100000);

    long long ans=0;
    for(int i=0; i<N; i++){
        ans=(ans+A[i]*(comb(i,K-1)-comb(N-1-i,K-1))%MOD)%MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5760
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>
//<editor-fold desc="definitions">
#include <bits/stdc++.h>
#define se cout << "test ok" << endl;
#define sp << " " <<
#define enl "\n"
using namespace std;
using ll=long long;
using ld=long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using viii = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using vlll = vector<vector<vector<ll>>>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
ll mod = ll(1e9)+7;
ll inf = ll(1e18);
void bl(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void bl2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){a=b; return true;} return false; }
template<typename T> inline bool chmin(T &a, T b){ if(a>b){a=b; return true;} return false; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

#include <iostream>
#include <vector>
#include <map>
using namespace std;

namespace dbg {
    using ll = long long;

    class Debug {
    public:
        Debug(){}
        template<typename T>
        void vd(vector<T> vec);
        template<typename T>
        void vd2(vector<vector<T>> vec);
        template<typename T>
        void ad(T *arr, ll n);
        template<typename T, size_t N>
        void ad2(T (&arr)[N], ll n);
        template<typename T>
        void md(T mp);
    };

    template<typename T>
    void Debug::vd(vector<T> vec) {
        for (auto vv : vec) cout << vv << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::vd2(vector<vector<T>> vec) {
        for (auto vv : vec) {
            for (auto vvv : vv) cout << vvv << " ";
            cout << endl;
        }
    }

    template<typename T>
    void Debug::ad(T *arr, ll n) {
        for (int i = 0; i <= n; i++) cout << arr[i] << " ";
        cout << endl;
    }

    template<typename T, size_t N>
    void Debug::ad2(T (&arr)[N], ll n) {
        for (int i = 0; i <= N; i++) for (int j = 0; j <= n; j++) cout << arr[i][j] << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::md(T mp) {
        cout << "key : value" << endl;
        for (auto const &m : mp) cout << m.first << " : " << m.second << endl;
        cout << endl;
    }

}

#endif //INCLUDE_DEBUG_HPP

dbg::Debug debug;
//</editor-fold>

class B1 {
public:
	void solve(std::istream& in, std::ostream& out) {
	    double x;
	    in >> x;

	    ll sum = 100;
	    for(int i=0; i<100000; i++){
	        sum += sum * 0.01;
	        if(sum >= x){
	            out << i+1 << enl;
	            return;
	        }
	    }
	}
};


int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	B1 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3728