akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int r1,r2;
  cin>>r1>>r2;
  cout<<shosu(10)<<(r1*r2*1.0)/(r1+r2)<<endl;
}


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

using namespace std;
//vector<long long> factors;
#define ll long long

#define pii pair<int,int>
#define pll pair<ll,ll>
#define _ <<'\n'
#define __ << ' '
#define all(x) (x).begin(), (x).end()
#define gcd __gcd
int IT_MAX = 1 << 17;
int MOD = 998244353;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x0f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
#define szz(x) (int)(x).size()
#define IOS ios_base::sync_with_stdio(false); cout.tie(0);cin.tie(0);
#define flush fflush(stdout)

ll mod(ll a, ll m) { return (a + (abs(a) / m) * m + m) % m; }

//****************************don't use int!!!!!!!****************************//
//***************************code starts here!!!!!****************************//

ll foo(ll n) {
    if (n % 3 == 0) {
        return (n / 3) * 2;
    } else {
        return (n / 3) * 2 + 1;

    }
}

int main() {
    IOS

    string st;
    cin >> st;
    ll ans = 1;
    bool one = true;
    for(int i = 1;i < st.size(); ++i) {
        if(one && st[i] == st[i - 1] && i !=st.size() - 1){
            one = false;
            ++ans;
            i++;
        }else if(!(one && st[i] == st[i - 1] && i == st.size() - 1)){
            one = true;
            ++ans;
        }
    }
    cout << ans;
    return 0;
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;

int n, mx;
char s[305];
int d[305][305][305];

inline void upd(int &x, int y) {
    x = max(x, y);
}

int main() {
    scanf("%s%d", s, &mx);
    n = strlen(s);
    int ans = 1;
    for (int i = 0; i <= n; ++i) {
        for (int j = n; j >= i; --j) {
            for (int k = 0; k <= mx; ++k) {
                if (i == j) {
                    ans = max(ans, d[i][j][k]);
                } else if (i + 1 == j) {
                    ans = max(ans, d[i][j][k] + 1);
                } else {
                    upd(d[i + 1][j][k], d[i][j][k]);
                    upd(d[i][j - 1][k], d[i][j][k]);
                    if (s[i] == s[j - 1]) {
                        upd(d[i + 1][j - 1][k], d[i][j][k] + 2);
                    } else if (k < mx) {
                        upd(d[i + 1][j - 1][k + 1], d[i][j][k] + 2);
                    }
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 110976
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 100000000;
const int MOD = 1000000007;

int main(){
  int a;
  std::cin >> a;
  std::cout << 48-a << std::endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
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; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;

int main(){

    ll x;cin >> x;
    ll tem=100;
    ll count =0;
    while(x>tem){
        count++;
        tem=tem + tem/100;
        
    }

    cout << count << endl;
    return 0;
}





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

using namespace std;
using ll = long long;


int main() {
    int k, q; cin >> k >>q;
    vector<int> d(k), e(k); for (auto& x:d) cin >> x;
    vector<int> n(q), x(q), m(q);
    for (int i = 0; i < q; ++i) {
        cin >> n[i] >> x[i] >> m[i];
    }
    for (int i = 0; i < q; ++i) {
        ll zero = 0;
        ll sum = 0;
        for (int j = 0; j < k; ++j){
            e[j] = d[j] % m[i]; 
            if (e[j] == 0) zero++;
            sum += e[j];
        }

        sum *= (n[i]-1)/k;
        zero *= (n[i]-1)/k;

        for (int j = 0; j < (n[i] -1) % k; ++j) {
            e[j] = d[j] % m[i];
            sum += e[j];
            if (e[j] == 0) zero++;
        }
        ll Q = ((x[i] + sum) / m[i]) - (x[i] / m[i]);

        cout << n[i] - 1 - Q - zero << endl;
    }

    return 0;
}


Measured memory_bytes: 384
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
// #define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl
#define all(x) (x).begin(),(x).end()

int main(){
	int N; cin>>N;
	double T,A; cin>>T>>A;
	double mini = 1e9;
	int ans = 0;
	rp(i,N){
		double hi; cin>>hi;
		double fhi = T-hi*.006;
		if(mini>abs(fhi-A)){
			mini = abs(fhi-A);
			ans = i+1;
		}

	};

	ote(ans);
}


Measured memory_bytes: 256
X, Y, Z, K = map(int, input().split())
A = sorted([int(i) for i in input().split()], reverse = True)
B = sorted([int(i) for i in input().split()], reverse = True)
C = sorted([int(i) for i in input().split()], reverse = True)

D = []
for i in range(X):
    for j in range(Y):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(Z):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            D.append(A[i] + B[j] + C[k])
            #print(A[i] + B[j] + C[k], i, j, k)
            
D.sort(reverse = True)
for d in D[:K]:
    print(d)

Measured memory_bytes: 8756
def main():
    n = int(input())
    xs = list(map(int, input().split()))
    x_min = min(xs)
    x_max = max(xs)

    ans = float("inf")
    for i in range(x_min, x_max+1):
        ans_temp = 0
        for x in xs:
            ans_temp += (x - i)**2
        ans = min(ans, ans_temp)

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>>a;
	if(a>=400&&a<=599)
		cout<<"8";
	if(a>=600&&a<=799)
		cout<<"7";
	if(a>=800&&a<=999)
		cout<<"6";
	if(a>=1000&&a<=1199)
		cout<<"5";
	if(a>=1200&&a<=1399)
		cout<<"4";
	if(a>=1400&&a<=1599)
		cout<<"3";
	if(a>=1600&&a<=1799)
		cout<<"2";
	if(a>=1800&&a<=1999)
		cout<<"1"; 
	return 0;
}


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

using namespace std;

int main() {
    vector<int> U;

    int n, q;
    cin >> n >> q;

    for (int i = 0; i < n; i++) {
        U.push_back(i);
    }

    for (int i = 0; i < q; i++) {
        int c;
        int x, y;

        cin >> c >> x >> y;
        if (c == 0) {
            int a = U[x];
            int b = U[y];

            if (a == b) {
                continue;
            }
            for (int j = 0; j < n; j++) {
                if (U[j] == b)
                    U[j] = a;
            }
        } else {
            if (U[x] == U[y]) {
                cout << 1 << endl;
            } else {
                cout << 0 << endl;
            }
        }
    }

    return 0;
}

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

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];
#define vecout(v,n) for(int i=0; i<n; i++)cout<<v[i]<<" "; cout<<endl;

const int mod = 1000000007;
const int INF = 2000000015;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}
int krag(double xx) {
	return INF - (int)(INF - xx);
}


int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int com(int xx, int yy) {
	int zz = 1;
	for (int i = xx; i > xx - yy; i--) {
		zz *= i;
		zz %= mod;
	}
	for (int i = 1; i <= yy; i++) {
		zz *= modinv(i, mod);
		zz %= mod;
	}
	return zz;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}




signed main() {
	int n,t,c=0;
	cin >> n;
	vector<int>vec(n);
	vector<int>vec2(n);
	vector<int>ans;
	vecin(vec);
	for (int i = n - 1; i >= 0; i--) {
		t = 0;
		for (int j = (i+1) * 2-1; j < n; j += i+1) {
			t += vec2[j];
		}
		vec2[i] = abs(vec[i] - (t % 2));
		if (vec2[i]) {
			ans.push_back(i);
		}
	}
	reverse(all(ans));
	cout << ans.size() << endl;
	rep(i, ans.size()) {
		cout << ans[i]+1 << " ";
	}
	cout << endl;
}



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

using namespace std;
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  
template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

template<typename T> struct MaxFlow {
	const T INF =  1LL<<59; //1 <<29;
	const int V;
	struct Edge { int to, rev; T cap; };
	vector<vector<Edge>> g;
	vector<int>  iter, level;
	/// 初期化
	void init() { for(int i = 0; i < V; i++) g[i].clear(); }
	MaxFlow(int su) : V(su), g(V) { };
	/// 有向辺の追加
	void add(int from, int to, T cap) {
		g[from].push_back(Edge{to, (int)g[to].size(), cap});
		g[to].push_back(Edge{from, (int)g[from].size()-1, 0});
	}
	/// 無向辺の追加
	void add_multi(int from, int to, T cap) {
		g[from].push_back(Edge{to, (int)g[to].size(), cap});
		g[to].push_back(Edge{from, (int)g[from].size()-1, cap});
	}
	void bfs(int s) {
		fill(level.begin(), level.end(), -1);
		queue<int> que;
		level[s] = 0;
		que.push(s);
		for(;!que.empty();) {
			int v = que.front(); que.pop();
			for(const Edge& e: g[v]) if(e.cap > 0){
				if (level[e.to] < 0) {
					level[e.to] = level[v] + 1;
					que.push(e.to);
				}
			}
		}
	}
	T dfs(int v, int t, T f) {
		if (v == t) return f;
		for(int &i = iter[v]; i < (int)g[v].size(); i++) {
			Edge &e = g[v][i];
			if (e.cap <= 0) continue;
			if (level[v] < level[e.to]) {
				T d = dfs(e.to, t, min(f, e.cap));
				if (d <= 0) continue;
				e.cap -= d;
				g[e.to][e.rev].cap += d;
				return d;
			}
		}
		return 0;
	}
	// sからtへの最大流を返す
	T exec(int s, int t) {
		level.assign(V, -1);
		iter.assign(V, 0);
		T flow = 0;
		for(;;) {
			bfs(s);
			if (level[t] < 0) return flow;
			fill(iter.begin(), iter.end(), 0);
			T f;
			for(;(f = dfs(s, t, INF)) > 0;) flow += f;
		}
	}
};

int main()
{
	
	cin.tie(0); ios_base::sync_with_stdio(false);
	
	int n; cin >>n;
	MaxFlow<ll> mkf(2*n+4);
	VI a(n), b(n), c(n), d(n);
	rep(i,n) cin >>a[i] >>b[i];
	rep(i,n) cin >>c[i] >>d[i];
	
	rep(i,n) rep(j,n){
		if(a[i] < c[j] && b[i] < d[j]){
			mkf.add(i,n+j, 1);
		}
	}
	
	int vs=2*n+2, vt=2*n+3;
	rep(i,n){
		mkf.add(vs,i, 1 );
		mkf.add(n+i, vt,1 );
	}
	auto ans = mkf.exec(vs, vt);
	cout << ans <<"\n";
	return 0;
	
}


Measured memory_bytes: 384
#include"bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
	int n, T,c,t,cost=10000;
	cin >> n >> T;
	rep(i, n) {
		cin >> c >> t;
		if (T >= t)cost = min(cost, c);
	}
	if (cost == 10000)cout << "TLE" << endl;
	else cout << cost << endl;
	return 0;
}



Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
 
//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//infinity
#define INTINF 2000000000
#define LONGINF 20000000000
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
int main(){
	int k; cin >> k;
	cout << (k/2) * ((k+1)/2) << endl;
	return 0;
}


Measured memory_bytes: 256
N,K=map(int,input().split(" "))
X=sorted(list(map(int,input().split(" "))))

ans=0
for i in range(N-K+1):
    tans=abs(X[i]-X[i+K-1])+abs(X[i])

    if i==0 or ans>tans:
        ans=tans

for i in range(N-K+1):
    tans=abs(X[i]-X[i+K-1])+abs(X[i+K-1])

    if ans>tans:
        ans=tans

print(ans)

Measured memory_bytes: 14252
import bisect

N,K=map(int,input().split())
x=list(map(int,input().split()))

x0=bisect.bisect_right(x,0)

ans=10**9
for i in range(K):
    if x0+i>=N:
        break
    r=x[x0+i]
    if x0-K+i+1>=0 and x0-K+i+1 <x0:
        l=-1*x[x0-K+i+1]
        ans=min(ans,r*2+l,l*2+r)
    
if x0+K-1<N:
    ans=min(ans,x[x0+K-1])

if x0-K>=0:
    ans=min(ans,-1*x[x0-K])
    
print(ans)









Measured memory_bytes: 62576
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
#include <cstring>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

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

    int N;
    cin >> N;
    vector<int> prime(105);
    for(int i = 2; i <= N; ++i){
        int x = i;
        for(int j = 2; j * j <= x; ++j){
            while(x % j == 0){
                ++prime[j];
                x /= j;
            }
        }
        if(x != 1)  ++prime[x];
    }
    vector<int> cnt(105);
    for(int i = 2; i <= 100; ++i)   ++cnt[prime[i]];
    for(int i = 100; i > 0; --i)    cnt[i - 1] += cnt[i];
    int ans = cnt[74];
    ans += cnt[24] * max(0, cnt[2] - 1);
    ans += cnt[14] * max(0, cnt[4] - 1);
    ans += cnt[4] * (cnt[4] - 1) / 2 * max(0, cnt[2] - 2);
    cout << ans << endl;
}

Measured memory_bytes: 3508
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vvvvll = vector<vector<vector<vector<ll>>>>;
using pl4 = pair<ll,ll>;
using str = string;
using vpl4 = vector<pair<ll,ll>>;

#define sz size()
#define be begin()
#define en end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define llin(x) ll (x);cin >>(x);
#define stin(x) str (x);cin >>(x);
#define vllin(x,n) vll (x)(n);FOR(i,0,n-1){cin >>(x)[i];}
#define vllin2(a,b,n) vll (a)(n);vll (b)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
#define vllin3(a,b,c,n) vll (a)(n);vll (b)(n);vll (c)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
#define vlling(x,n) (x).assign(n,0);FOR(i,0,n-1){cin >>(x)[i];}
#define vlling2(a,b,n) (a).assign(n,0);(b).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
#define vlling3(a,b,c,n) (a).assign(n,0);(b).assign(n,0);(c).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
#define vpl4in(x,n) vpl4 (x)((n),mp(0,0));FOR(i,0,n-1){cin >>x[i].fi>>x[i].se;}
#define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
#define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
#define SORT(x) sort(x.be, x.en)
#define rSORT(x) sort(x.rbegin(), x.rend())
#define say(x) cout<<(x);
#define sal(x) cout<<(x)<<endl;
#define says(x) cout<<(x)<<(' ');
#define sas cout<<(' ');
#define sayR(x) cout<<fixed<<setprecision(10)<<(x);
#define salR(x) cout<<fixed<<setprecision(10)<<(x)<<endl;
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
#define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
#define pow(a,b) ll(pow(a,b))

ll MOD=1000000007;

signed main(){
        llin(p);
        llin(q);
        llin(r);
        sal(p+q+r-max(p,max(q,r)))
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define FOR(i) for(cin>>i;i>0;i--)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(),x.end()
#define re(x) {cout<<x<<endl;return 0;}
//#define x first
//#define y second

using namespace std;
string s,t;
int a=0;
int main()
{
	cin>>s>>t;
	rep(i,s.size())
	{
		if(s[i]!=t[i]) a++;
	}
	re(a)
	return 0;}

Measured memory_bytes: 3808
#include <iostream>
using namespace std;
int main(void){
    // Here your code !
    int A,B,C,D;
    cin >>A>>B>>C>>D;
    if(A*B==C*D) cout<<A*B<< endl;
   else if(A*B>C*D)  cout<<A*B<< endl;
    else  cout<<C*D<< endl;
    return 0;
    
}


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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

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

    string s = "";
    s += to_string(a);
    s += to_string(b);
    int tp = 0;
    for (int i = 0; i < s.size(); i++)
    {
        tp += (s[s.size() - 1 - i] - '0') * pow(10, i);
    }

    // cout << tp << endl;

    bool f = false;
    for (int i = 1; i * i <= tp; i++)
    {
        if (i * i == tp)
            f = true;
    }
    if (f)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

class Circle{
public:
	double x,y,r;
	bool leftflag;
	bool rightflag;
};

double square(double x)
{
	return x*x;
}

bool collision(Circle c1,Circle c2)
{
	if(square(c2.x-c1.x)+square(c2.y-c1.y)>=square(c1.r+c2.r)){
		return false;
	}else{
		return true;
	}
}

int main()
{
	int n;

	cin>>n;

	vector<Circle> circle(n);

	rep(i,n){
		cin>>circle[i].r;
		circle[i].x=circle[i].r;
		circle[i].y=circle[i].r;
	}

	rep(i,n){
		rep(j,i){
			if(collision(circle[j],circle[i])==true){
				circle[i].x=circle[j].x+2*sqrt(circle[i].r*circle[j].r);
			}
		}
		
		for(int j=i+1;j<n;j++){
			circle[j].x=max(circle[j].x,circle[i].x);
		}
	}

	double ans=0;

	rep(i,n){
		ans=max(ans,circle[i].x+circle[i].r);
	}

	printf("%.8f\n",ans);

	return 0;
}

Measured memory_bytes: 3296
#include <iostream>
#include <cstdio>
#include <cstring>
#include<algorithm>
char s[205];
char t[205];
using namespace std;
int main() {
  	long long k;
    int cnt = 0;
    scanf("%s", s);
    scanf("%lld", &k);
    int len = strlen(s);
    if (len == 1) {
        printf("%lld", k >> 1);
        return 0;
    }
    for(int i = 0;i<len;i++){
    	t[i] = s[i];
	}
	int num = 0;
	int num2 = 0;
	int sum = 0;
	int i;
	for(i = 0;i<len;i++){
		if(s[i]==s[0]) num++;
		else break;
	}
	int st = min(i,len-1);
	for(i = len-1;i>st;i--){
		if(s[i]==s[0])num2++;
		else break;
	}
	int end = max(i,0);
	if(num+num2<len) {
		sum = num+num2;
		//cout<<st<<" "<<end<<" "<<sum<<endl;
	    for (int i = st; i <= end; i++) {
	        if (s[i] == s[i - 1]) {
	            s[i] = '#';
	            cnt++;
	        }
	   }
	long long ans1 = k*cnt+(k-1)*(sum/2)+(num)/2+num2/2;
    printf("%lld\n",ans1);
	}
	else{
		printf("%lld\n",len*k/2);
	}
//    cout<<num<<" "<<num2<<endl; 
//    cout<<cnt<<endl;
//    cout<<sum/2<<endl;
	
    
    return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
use  std::collections::BTreeMap;
use std::cmp::min;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("faild to read char") as char)
        .take_while(|c| !c.is_whitespace())
        .collect();
    token
        .parse()
        .ok()
        .expect("faild to parse token")
}

fn main(){
    let a: usize = read();
    let b: usize = read();
    for i in 1..10001 {
        if i * 8 / 100 == a && i / 10 == b {
            println!("{}", i);
            return;
        }
    }
    println!("-1");
}


Measured memory_bytes: 4352
#include <stdio.h>

int main(void) {

	int a, b, c, d;
	int e, f, g, h;

	scanf("%d %d %d %d", &a, &b, &c, &d);

	scanf("%d %d %d %d", &e, &f, &g, &h);

	if ((a + b + c + d) > (e + f + g + h)) {
		printf("%d\n", a + b + c + d);
	}
	else if ((a + b + c + d) < (e + f + g + h)) {
		printf("%d\n", e + f + g + h);
	}
	else if ((a + b + c + d) == (e + f + g + h)) {
		printf("%d\n", a + b + c + d);
	}
	return 0;
}


Measured memory_bytes: 2716
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dbl;
typedef long double ldbl;
typedef pair<int,int> P;

#define FOR(i, init, n) for(int i = init; i < (n); i++)
#define pb push_back

// from codeforces
#define what_is(x) cerr << #x << " is " << x << endl;
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))

ll mod = 1e9+7;

int a, b, c;

int main(){
  // fast I/O
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> a >> b;
  c = b-a;
  cout << ((c*(c+1))/2)-b << endl;

  return 0;
}
// notes
//


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int N = Integer.parseInt(sc.next());
        int M = Integer.parseInt(sc.next());
        int C = Integer.parseInt(sc.next());
        int b[] = new int[M];
        for (int i = 0; i < M; i++) {
            b[i] = Integer.parseInt(sc.next());
        }
        for (int i = 0; i < N; i++) {
            int sum = 0;
            for (int j = 0; j < M; j++) {
                int a = Integer.parseInt(sc.next());
                sum += a * b[j];
            }
            sum += C;
            if (sum > 0) {
                ++ans;
            }
        }
        sc.close();
        System.out.println(ans);
    }
}

Measured memory_bytes: 25300
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int64_t gcd(int64_t a, int64_t b)
{
    if (a == 0)
    {
        return b;
    }

    return gcd(b % a, a);
}

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

    cout << a / gcd(a, b) * b << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int max(int a, int b){
    return a > b ? a : b;
}

int n, a[100][101];
int dp[101][101][101];

int main(void){
    int x, y, z;
    scanf("%d", &n);
    for(x = 0; x < n; x++){
        a[x][0] = 0;
        for(y = 1; y <= n; y++){
            scanf("%d", &a[x][y]);
            a[x][y] += a[x][y-1];
        }
    }
    int max_val = a[0][1];
    for(x = 0; x < n; x++){
        for(y = x+1; y <= n; y++){
            dp[0][x][y] = a[0][y] - a[0][x];
            max_val = max(max_val, dp[0][x][y]);
        }
    }
    for(x = 1; x < n; x++){
        for(y = 0; y < n; y++){
            for(z = y+1; z <= n; z++){
                int s = a[x][z] - a[x][y];
                dp[x][y][z] = max(s, s+dp[x-1][y][z]);
                max_val = max(max_val, dp[x][y][z]);
            }
        }
    }
    printf("%d\n", max_val);
    return 0;
}

Measured memory_bytes: 4624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e18)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))




int main(){
	string s;
	cin >> s;
	bool ok = true;
	FOR(i,0,s.size()){
		if(i&1){//偶数
			if(s[i]=='R')ok=false;
		}else{
			if(s[i]=='L')ok=false;
		}
	}
	if(ok){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}


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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

#define MAX 100000 //最大ノード数

struct node {
  ll v, d;
  node(ll _a, ll _b):v(_a),d(_b){}
  bool operator<(const node &n) const { return d > n.d; }
};
struct edge {
  ll to, d;
  edge(ll _to, ll _d):to(_to),d(_d){}
};
ll V;
vector<edge> yenG[MAX],snukeG[MAX];
ll yendist[MAX],snukedist[MAX]; // dijkstraの結果の最短経路

void yendijkstra(int s) { // sからの最短経路
  rep(i,MAX) yendist[i] = 1ll << 59;
  
  priority_queue<node> que;
  que.push(node(s, 0));
  yendist[s] = 0;

  while(!que.empty()){
    ll v = que.top().v, d = que.top().d;
    que.pop();

    rep(i, yenG[v].size()){
      ll tmp = d + yenG[v][i].d;
      if(yendist[yenG[v][i].to] > tmp){
	yendist[yenG[v][i].to] = tmp;
	que.push(node(yenG[v][i].to, tmp));
      }
    }
  }
}

void snukedijkstra(int s) { // sからの最短経路
  rep(i,MAX) snukedist[i] = 1ll << 59;
  
  priority_queue<node> que;
  que.push(node(s, 0));
  snukedist[s] = 0;

  while(!que.empty()){
    ll v = que.top().v, d = que.top().d;
    que.pop();

    rep(i, snukeG[v].size()){
      ll tmp = d + snukeG[v][i].d;
      if(snukedist[snukeG[v][i].to] > tmp){
	snukedist[snukeG[v][i].to] = tmp;
	que.push(node(snukeG[v][i].to, tmp));
      }
    }
  }
}

int main(){
#define int ll
  int n,m,s,t; cin >> n >> m >> s >> t; s--; t--;
  rep(i,m){
    int u,v,a,b;
    cin >> u >> v >> a >> b; u--; v--;
    yenG[u].pb(edge(v,a));
    yenG[v].pb(edge(u,a));
    snukeG[u].pb(edge(v,b));
    snukeG[v].pb(edge(u,b));
  }
  yendijkstra(s);
  snukedijkstra(t);

  vector<pii> can(n);
  rep(i,n){
    can[i].fst += yendist[i] + snukedist[i];
    can[i].snd = i;
  }
  sort(all(can));

  int j = 0;
  rep(i,n){ // i未満はだめ
    while(1){
      if(can[j].snd >= i){
	cout << 1000000000000000ll - can[j].fst << endl;
	break;
      }else if(j < n-1) j++;
      else if(j == n-1){
	cout << 1000000000000000ll - can[j].fst << endl;
	break;
      }
    }
  }
}

Measured memory_bytes: 19908
#include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <stdio.h>

using namespace std;

class Node{
public:
	int pos, ticket; double cost;
	Node(int pos, int ticket, double cost) : pos(pos), ticket(ticket), cost(cost) {}
	bool operator < (const Node &nd) const { return cost > nd.cost; }
};

int main(){
	int n, m, p, a, b;
	int t[8];
	bool visit[256][31];
	double dist[256][31];
	while(cin >> n >> m >> p >> a >> b, n){
		for(int i=0;i<n;i++) cin >> t[i];
		vector< vector< pair<int, double> > > g(m+1);
		for(int i=0;i<p;i++){
			int x, y, z; cin >> x >> y >> z;
			g[x].push_back(make_pair(y,z));
			g[y].push_back(make_pair(x,z));
		}
		for(int i=0;i<(1<<n);i++)
			for(int j=1;j<=m;j++) dist[i][j] = 1e12;
		dist[(1<<n)-1][a] = 0;
		memset(visit, false, sizeof(visit));
		priority_queue<Node> qu; qu.push(Node(a, (1<<n)-1, 0));
		double res = -1;
		while(!qu.empty()){
			Node nd = qu.top(); qu.pop();
			int pos = nd.pos, tic = nd.ticket; double ct = nd.cost;
			if(visit[tic][pos]) continue;
			visit[tic][pos] = true;
			if(pos == b){ res = ct; break; }
			for(int i=0;i<g[pos].size();i++){
				int next = g[pos][i].first;
				for(int j=0;j<n;j++){
					if(!(tic&(1<<j))) continue;
					if(dist[tic^(1<<j)][next] > dist[tic][pos] + g[pos][i].second/t[j]){
						dist[tic^(1<<j)][next] = dist[tic][pos] + g[pos][i].second/t[j];
						qu.push(Node(next, tic^(1<<j), dist[tic^(1<<j)][next]));
					}
				}
			}
		}
		if(res < 0) puts("Impossible");
		else        printf("%.6lf\n", res);
	}
}

Measured memory_bytes: 1460
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <random>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;

typedef
tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> orderedSet;

#define pb push_back
#define F first
#define S second
#define all(a) (a).begin(), (a).end()

#define for1(i0, l0, r0) for (int i0 = l0; i0 < r0; ++i0)
#define for2(i0, l0, r0) for (int i0 = l0; i0 <= r0; ++i0)
#define forn(i0, n0) for (int i0 = 0; i0 < n0; ++i0)
#define forn1(i0, n0) for (int i0 = 1; i0 < n0; ++i0)
#define forr(i0, n0) for (int i0 = n0; i0 >= 0; --i0)
#define forr1(i0, r0, l0) for (int i0 = r0; i0 > l0; --i0)
#define forr2(i0, r0, l0) for (int i0 = r0; i0 >= l0; --i0)

#define Sort(a) sort(all(a))
#define Reverse(a) reverse(all(a))

typedef long double ld;
#define ui unsigned int
#define ull unsigned long long

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef pair<string, string> pss;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<string> vs;

typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdd;

typedef vector<vi> vvi;
typedef vector<vd> vvd;
typedef vector<vll> vvll;
typedef vector<vb> vvb;

#define vpss vector<pss>
#define vvs vector<vs>
#define vvpii vector<vpii>
#define vvpll vector<vpll>
#define vpt vector<pt>
#define vvvi vector<vvi>
#define vsi vector<set<int>>
#define ss second
#define ff first

#define printvi(arr) for (int x0 : arr) cout << x0 << ' '; cout << '\n';
#define printvll(arr) for (ll x0 : arr) cout << x0 << ' '; cout << '\n';
#define printpair(pair0) cout << pair0.F << ' ' << pair0.S << '\n';
#define printvp(arr) for (auto pair0 : arr) printpair(pair0);
#define initArray(arr, N0, X0) memset(arr, X0, N0 * sizeof(int))
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(16);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
}

void solve() {
    string s;
    cin >> s;
    bool flag = false;
    for (char c : s){
        if (c == 'C') flag = true;
        if (c == 'F' && flag){
            cout << "Yes\n";
            return;
        }
    }
    cout << "No\n";
}

bool multitest = false;

int main() {
    init();
    int t = 1;
    if (multitest) cin >> t;
    forn(i, t) solve();
}

Measured memory_bytes: 3604
import java.util.*;
public class Main {
	public static void main(String[] args){
      	
		Scanner sc = new Scanner(System.in);
		long H = sc.nextLong();
		long W = sc.nextLong();
		if (H==1||W==1) {
			System.out.println(1);
		} else {
			if(H%2==1&&W%2==1){
				System.out.println(H*W/2+1);
			}else{
				System.out.println(H*W/2);
			}
						
		}


      	sc.close();
    }
		
		
}

Measured memory_bytes: 23892
import sys
from heapq import heapify, heappop, heappush
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))

heapify(a)

while len(a) != 1:
    f = heappop(a)
    s = heappop(a)
    s %= f
    if s != 0:
        heappush(a, s)
    heappush(a, f)

print(heappop(a))


Measured memory_bytes: 19932
#include <iostream>
#include <string>
using namespace std;
int main() {
    string s;
    getline(cin, s);
    string res = "";
    for (int i=0; i<s.size(); ++i) {
        if (isalpha(s[i])) {
            if (islower(s[i])) {
                res += toupper(s[i]);
            } else if (isupper(s[i])) {
                res += tolower(s[i]);
            }
        } else {
            res += s[i];
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1188
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
  let cs: Vec<char> = read::<String>().chars().collect();
  let a: i64 = cs[0].to_digit(10).unwrap() as i64;
  let b: i64 = cs[1].to_digit(10).unwrap() as i64;
  let c: i64 = cs[2].to_digit(10).unwrap() as i64;
  let d: i64 = cs[3].to_digit(10).unwrap() as i64;

  for i in 0..2 {
    for j in 0..2 {
      for k in 0..2 {
        let (first_op, op1) = select_operator(i);
        let (second_op, op2) = select_operator(j);
        let (third_op, op3) = select_operator(k);
        let val: i64 = third_op(second_op(first_op(a, b), c), d);
        if val == 7 {
          println!("{}{}{}{}{}{}{}=7", a, op1, b, op2, c, op3, d);
          return;
        }
      }
    }
  }
}

fn select_operator(num: usize) -> (Box<Fn(i64, i64) -> i64>, char) {
    match num {
      0 => (Box::new(|x, y| { x + y }), '+'),
      1 => (Box::new(|x, y| { x - y }), '-'),
      _ => panic!(),
    }
}


Measured memory_bytes: 4352
import scala.io.StdIn.readLine
import Math.sqrt

object Main {

  def main(args: Array[String]) = {
      val Array(a,b,c) = readLine.split(" ").map(_.toInt)
      var cnt = 0
      for(i <- a to b)
          if(c % i == 0)
              cnt += 1
      println(cnt)
  }
}

Measured memory_bytes: 43944
#include<bits/stdc++.h>
#define PI 3.141592653589
#define ll long long
using namespace std;

int main(){
  ll k, n;
  cin >> k >> n;
  
  ll a[n];
  ll sum = 0;

  for(int i=0; i<n; ++i){
    cin >> a[i];
  }
  ll e[n];
  for(int i=0; i<n-1; ++i){
    e[i] = a[i+1] - a[i];
  }
  e[n-1] = k - a[n-1] + a[0];

  ll res = a[0];
  for(int i=0; i<n; ++i){
    res = max(res, e[i]);
  }
  
  cout << k - res;
}

Measured memory_bytes: 3328
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;
import std.container;

alias sread = () => readln.chomp();
ulong bignum = 1_000_000_007;
alias Cake = Tuple!(long, "beauty", long, "tasty", long, "popular");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void main()
{
    long n = lread();
    auto a = new long[](n);
    foreach (ref e; a)
    {
        e = lread();
    }
    auto sorted_a = a.dup.sort!"a > b"();
    // sorted_a.writeln();
    auto max1 = sorted_a[0];
    auto max2 = sorted_a.dropOne[0];
    // sorted_a.dropOne.writeln();
    foreach (e; a)
    {
        if(e != max1)
            max1.writeln();
        else
            max2.writeln();  
    }
}

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

int g[15][15];

int main() {
  int n;
  cin >> n;
  rep(i,n)rep(j,n) g[i][j] = -1;
  rep(i,n) {
    int m;
    cin>>m;
    rep(j,m) {
      int a, x;
      cin >> a >> x;
      --a;
      g[i][a] = x;
    }
  }
  int ans = 0;
  rep(i,1<<n) {
    vector<int> d(n);
    rep(j,n) if (i>>j&1) {
      d[j] = 1;
    }
    bool ok = true;
    rep(j,n) {
      if (d[j]) {
        rep(k,n) {
          if (g[j][k] == -1) continue;
          if (g[j][k] != d[k]) ok = false;
        }
      }
    }
    if (ok) ans = max(ans, __builtin_popcount(i));
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
// inputに入力データ全体が入る
function Main(input) {
  if(input >=30) {
    console.log('Yes');
  } else {
    console.log('No');
  }
}


// let input = `25`;
// Main(input);


// *この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29572
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repp(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)
#define p(s) cout << s << endl;
typedef long long LL;
template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}

int main()
{
    int a,b; cin>>a>>b;
    if(a==1)a=14;
    if(b==1)b=14;
    if(a==b)
        cout<<"Draw" <<endl;
    else if(a>b)
        cout << "Alice"<< endl;
    else
        cout<<"Bob"<<endl;
}

Measured memory_bytes: 256
import math

N,H = [int(i) for i in input().split()]

A = [0]*N
B = [0]*N
for i in range(N):
    a,b = [int(zz) for zz in input().split()]
    A[i] = a
    B[i] = b

p = max(A)
B.sort(reverse=True)

dmg = 0
for i in range(N):
    if B[i] <= p:
        index = i
        break
    else:
        dmg += B[i]
        if dmg >= H:
            print(i+1)
            exit()
    index = N

dmg = sum(B[:index])
ans = index+math.ceil((H-dmg)/p)
print(ans)


Measured memory_bytes: 51800
pos = int(input())
xs = [int(x) for x in input().split()]

#minimize sum of squares

# N people living on a number line
# ith person lives at coordinate x
#  hold a meeting that all N people are going to atend
#  meeting can be at any integer coordinate
#  if at P, ith person will spend (x-P)^2 stamina
# find the minimum points of stamina  N people will have to spend

# (x-P)(X-P)
# x^2-2PX-P^2
#2x-2P
min = min(xs)
max = max(xs)
smallestS = 99999999999999999999

for _ in range(min,max+1):
    stamina = 0
    for x in xs:
        stamina +=(x-_)*(x-_)
    if stamina<smallestS:
        smallestS = stamina

print(smallestS)

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

using namespace std;


void solve() {
    int N; cin >> N;
    vector<double> p(N+1);
    for (int i = 1; i <= N; i++) cin >> p[i];

    vector<vector<double>> dp(N+1, vector<double>(N+1));

    dp[0][0] = 1;
    for (int i = 1; i < N+1; i++) {
        dp[i][0] = dp[i-1][0] * (1 - p[i]);
        for (int j = 1; j <= i; j++) {
            dp[i][j] += dp[i-1][j-1] * p[i];
            dp[i][j] += dp[i-1][j] * (1 - p[i]);
        }
    }

    double ans = 0;
    for (int i = N/2+1; i < N+1; i++) {
        ans += dp[N][i];
    }

    cout << setprecision(15) << ans << endl;
}


int main() {
    solve();
    return 0;
}

Measured memory_bytes: 73780
#include <iostream>
using namespace std;
int main(void){
    int k, a, b, clearFrag=0;
    cin >> k >> a >> b;
    for(int i=a; i<=b; i++){
        for(int j=1; j<1000; j++){
            if(k*j==i){
                clearFrag=1;
                break;
            }
        }
    }
    if(clearFrag==1){
        cout << "OK";
    }else{
        cout << "NG";
    }
}

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    ll n,k;
    cin >> n >> k;
    k--;
    vector<int> a(n);
    int left;
    REP(i,n){
        cin >> a[i];
        if(a[i]==1)left=i;
    }
    int right=n-left-1;

//    cout << "r:l " << right << ":"<<left << endl;

    int m=0;
    int sum=left/k;
    m+=left%(k);
    if(m)sum++;

    sum+=right/k;
    m+=right%k;
    if(right%k)sum++;

    if(m<=(k)&&m!=0&&right%k&&left%k)sum--;
    cout << sum << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
bool vis[maxn];
char s[maxn];

int main()
{
    //freopen("D:\\code\\text\\input.txt","r",stdin);
    //freopen("D:\\code\\text\\output.txt","w",stdout);
    cin >> s + 1;
    int len = strlen(s + 1);
    int isok = 1;
    repd(i, 1, len)
    {
        if (vis[s[i]])
        {
            isok = 0;
            break;
        } else
        {
            vis[s[i]] = 1;
        }
    }
    if (isok)
    {
        printf("yes\n");
    } else
    {
        printf("no\n");
    }

    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define MIN(a,b) ((a) <= (b) ? (a) : (b))
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort( ALL(v) )

using namespace std;
using ll = long long;
using P = pair<int,int>;

double PI = 3.141592653589 ;

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

    cout << setprecision(10);
    cout << fixed;
    cout << (double)(2.0)*PI*(double)R<<endl;
    return 0;
}


Measured memory_bytes: 3784
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n)]

ab.sort(key=lambda x:x[0])
cnt = 0
cost = 0

for i in range(n):
    if cnt + ab[i][1] > m:
        cost += ab[i][0]*(m-cnt)
        break
    else:
        cnt += ab[i][1]
        cost += ab[i][0]*ab[i][1]

ans = cost
print(ans)

Measured memory_bytes: 29028
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 100000000000000 //10^14
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main()
{
    int N, C;
    cin >> N >> C;
    vector<int> s(N), t(N), c(N);
    rep(i, N){
        cin >> s.at(i) >> t.at(i) >> c.at(i);
        c.at(i)--;
    }
    vector<vector<int>> imos(200001, vector<int>(C, 0));
    rep(i, N){
        imos.at(2*s.at(i)-1).at(c.at(i))++;
        imos.at(2*t.at(i)).at(c.at(i))--;
    }
    int ans = 0;
    int tmp = 0;
    rep(i, C){
        tmp += imos.at(0).at(i);
    }
    chmax(ans, tmp);
    rep(i, 200000){
        rep(j, C){
            imos.at(i+1).at(j) += imos.at(i).at(j);
        }
    }
    rep(i, 200000){
        tmp = 0;
        rep(j, C){
            if(imos.at(i+1).at(j) == 2){
                imos.at(i+1).at(j) = 1;
            }
            tmp += imos.at(i+1).at(j);
        }
        chmax(ans, tmp);
    }
    cout << ans << endl;
}


Measured memory_bytes: 34076
#include <bits/stdc++.h>
using namespace std; 
    
int main(){
  int N,M;
  cin >> N >> M;
  vector<vector<int>> G(N);
  for(int i=0;i<M;i++){
    int A,B;
    cin >> A >> B;
    G.at(A-1).push_back(B-1);
    G.at(B-1).push_back(A-1);
  }
  vector<int> seen(N,-1);
  queue<int> q;
  q.push(0);
  while(!q.empty()){
    int A=q.front();
    q.pop();
    for(int i=0;i<G.at(A).size();i++){
      int B=G.at(A).at(i);
      if(seen.at(B)==-1){
        seen.at(B)=A;
        q.push(B);
      }
    }
  }
  cout << "Yes" << endl;
  for(int i=1;i<N;i++){
    cout << seen.at(i)+1 << endl;
  }
}

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

int main(){
    int n, m;
    cin >> n >> m;
    int a[m], b[m], c[n+1] = {0};

    rep(i, m){
        cin >> a[i] >> b[i];
    }

    rep(i, m){
        c[a[i] - 1] ++;
        c[b[i] - 1] ++;
    }

    rep(i, n){
        cout << c[i] << endl;
    }
}

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

int main(){
  int a,b;
  int x[5],y[5];
  
  cin>>x[1]>>y[1]>>x[2]>>y[2];
  a=x[2]-x[1];b=y[2]-y[1];
  
    x[4]=x[1]-b;
    y[4]=y[1]+a;
  
  x[3]=x[4]+a;
  y[3]=y[4]+b;
  
  cout<<x[3]<<" "<<y[3]<<" "<<x[4]<<" "<<y[4]<<endl;
               
  return 0;
}


Measured memory_bytes: 256