akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const int maxn=100100;
void chkmin(int &x,int y){
	x=x<y?x:y;
}
int beg[maxn],tto[maxn<<1],nex[maxn<<1],w[maxn<<1],e;
void putin(int s,int t,int v){
	tto[++e]=t;
	nex[e]=beg[s];
	beg[s]=e;
	w[e]=v;
}
int cnt[20],ans;
void dfs(int u,int fa,int fv){
	int sum=fv;
	for(int i=beg[u];i;i=nex[i]){
		if(tto[i]==fa) continue;
		dfs(tto[i],u,w[i]);
		sum^=w[i];
	}
	if(sum==0) return;
	ans+=cnt[sum];
	cnt[sum]^=1;
}
int dp[1<<15];
int popcnt[1<<15];
int main(){
//	freopen("F.in","r",stdin);
	int n;
	scanf("%d",&n);
	int s,t,v;
	for(int i=1;i<n;i++){
		scanf("%d%d%d",&s,&t,&v);
		s++,t++;
		putin(s,t,v);
		putin(t,s,v);
	}
	dfs(1,0,0);
	for(int i=1;i<(1<<15);i++)
		popcnt[i]=popcnt[i>>1]+(i&1);

	int val;
	for(int i=1;i<(1<<15);i++){
		dp[i]=popcnt[i];
		val=0;
		for(int j=0;j<15;j++)
			if(i&(1<<j))
				val^=j+1;
		if(val==0)
			dp[i]--;
	}
	for(int i=1;i<(1<<15);i++)
		for(int j=i;j;j=i&(j-1))
			chkmin(dp[i],dp[j]+dp[i^j]);
	val=0;
	for(int i=1;i<=15;i++)
		if(cnt[i])
			val|=1<<(i-1);
	ans=ans+dp[val];
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 7680
#include<iostream>
#include<vector>
#include<cmath>
#include<complex>
#include<algorithm>

using namespace std;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}


namespace geom{
#define X real()
#define Y imag()
#define at(i) ((*this)[i])
#define SELF (*this)
	enum {TRUE = 1, FALSE = 0, BORDER = -1};
	typedef int BOOL;
	typedef long double R;
	const R INF = 1e8;
	R EPS = 1e-12;
	inline int sig(const R &x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
	inline BOOL less(const R &x, const R &y) {return sig(x-y) ? x < y : BORDER;}
	typedef complex<R> P;
#undef SELF
#undef at
}

using namespace geom;

int f = 0;
namespace std{
	bool operator<(const P &a, const P &b){return sig(a.X-b.X) ? a.X < b.X : a.Y+EPS < b.Y;}
	bool operator==(const P &a, const P &b){return abs(a-b) < EPS;}
	istream& operator>>(istream &is, P &p){R x,y;is>>x>>y;p=P(x, y);return is;}
}

int n;

int check(P p, const vector<P> &a, const vector<P> &b){
	const R PI = 2*atan2(1, 0);
	vector<pair<R, int>> args(1, make_pair(INF, 0));
	for(auto &q : a){
		R a = arg(q - p);
		args.eb(a, 0);
		args.eb(a+2*PI, 0);
	}
	for(auto &q : b){
		R a = arg(q - p);
		args.eb(a, 1);
		args.eb(a+2*PI, 1);
	}
	sort(ALL(args));
	int j=0;
	int ans = n-1;
	int c[2] = {0, 0};
	REP(i, n-1){
		while(args[j].first < args[i].first+PI- EPS) c[args[j++].second]++;
		if(c[0] == 0 && c[1] == b.size()) return 1;
		if(c[1] == 0 && c[0] == a.size()) return 1;
		c[args[i].second]--;
	}
	return 0;
}

int main(){
	cin >> n;
	vector<P> p, q;
	REP(i, n){
		double x, y;
		cin >> x >> y;
		p.eb(x, y);
	}
	REP(i, n){
		P t = p.back();
		p.pop_back();
		if(!check(t, p, q)){
			cout << "Impossible" << endl;
			return 0;
		}
		q.pb(t);
	}
	cout << "Possible" << endl;
	return 0;
}

Measured memory_bytes: 1376
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
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; }


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

    int n,m;
    cin>>n>>m;

    vec a(m);
    rep(i,m) cin>>a[i];

    for(int i=n; ; i++){
        bool ok = true;
        int x = i;
        while(x){
            rep(j,m) if(x%10==a[j]) ok=false;
            x/=10;
        }

        if(ok){
            cout<<i<<endl;
            break;
        }
    }
    return 0;
    
}

Measured memory_bytes: 3596
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<vector>

using namespace std;

const int MX = 100005;

int N;

int main()
{
	string A;
	int cnt[3] = {};
	cin >> A;
	for(char c : A){
		cnt[c-'a']++;
	}
	int tot = cnt[0] + cnt[1] + cnt[2];
	if( max({cnt[0], cnt[1], cnt[2]}) > (tot+2) / 3) printf("NO\n");
	else printf("YES\n");
}


Measured memory_bytes: 764
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

def solve(A,B,C):
    ans = sum(B)
    for i in range(N-1):
        if A[i+1]==A[i]+1:
            ans += C[A[i]-1]
    return ans
print(solve(A,B,C))

Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>

struct Playlist{
   	char s[101];
    int t;
  };

int main(void){
  int n, tmp, cnt = 0;
  char str[101];
  
  scanf("%d", &n);
  
  struct Playlist p[n];
  char x[101];
  
  for(int i = 0;i < n;i++){
    scanf("%s", str);
    strcpy(p[i].s, str);
    scanf("%d", &tmp);
    p[i].t = tmp;
  }
  
  scanf("%s", x);
  
  int i = 0;
  while(strcmp(p[i].s, x) != 0){
  	i++;
  }
  for(int j = i + 1;j < n;j++){
    cnt += p[j].t;
  }
  
  printf("%d\n", cnt);
  
  return 0;  
}
  

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#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>
#include<complex>

using namespace std;

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

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

const double PI=acos(-1);
const double EPS=1e-9; //うまくいかなかったらゆるめる

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

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


signed main(void) {
    double a,b,h,m;
    cin >> a >> b >> h >> m;
    double d = abs(6*m - (h*60+m)/2.0);
    d = min(d, 360-d);//中心角
    //cout << d << endl;
    d = d*(PI/180);
    cout << shosu(12) << sqrt(a*a+b*b-2*a*b*cos(d)) << endl;

}


Measured memory_bytes: 3616
fun main (args : Array<String>) {
	val (a, b) = readLine()!!.split(" ")
	var A : Int = a.toInt()
	var B : Int = b.toInt()
	var calc : Int = 1
	var count : Int = 0
	while (calc < B) {
		calc += (A - 1)
		count++
	}
	println("${count}")
}

Measured memory_bytes: 37876
#include <iostream>
using namespace std;
int main(){
  int d;
  cin >> d;
  if(d == 22)  cout << "Christmas Eve Eve Eve" << endl;
  else if(d == 23) cout << "Christmas Eve Eve" << endl;
  else if(d == 24) cout << "Christmas Eve" << endl;
  else cout << "Christmas" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){
	int a=0,b=0,c=0,d;
	int n;
	cin >> n;
	rep(i,n){
		cin >> d;
		if (d%2){
			a++;
		}
		else if (d%4==0){
			c++;
		}
		else {
			b++;
		}
	}
	bool flag = 0;
	if (a==0){
		flag = 1;
	}
	else if (b==0){
		if (a-1<=c) {
			flag = 1;
		}
		else flag = 0;
	}
	else {
		if (a<=c) {
			flag = 1;
		}
		else flag = 0;
	}
	
	cout << ((flag) ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

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

    int n; cin>>n;

    cout << (n % 2 ? (n + 1) / 2 : n / 2) << endl;

    return 0;
}

Measured memory_bytes: 256
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 read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn main() {
    let input:String = read();
    let v: Vec<i32> = input.chars().map(|x| x.to_digit(10).unwrap() as i32).collect();
    let ans = match (v[0],v[1],v[2],v[3]) {
        (a,b,c,d) if a + b + c + d  == 7 => format!("{}+{}+{}+{}",a,b,c,d),
        (a,b,c,d) if a + b - c + d  == 7 => format!("{}+{}-{}+{}",a,b,c,d),
        (a,b,c,d) if a + b + c - d  == 7 => format!("{}+{}+{}-{}",a,b,c,d),
        (a,b,c,d) if a + b - c - d  == 7 => format!("{}+{}-{}-{}",a,b,c,d),
        (a,b,c,d) if a - b + c + d  == 7 => format!("{}-{}+{}+{}",a,b,c,d),
        (a,b,c,d) if a - b - c + d  == 7 => format!("{}-{}-{}+{}",a,b,c,d),
        (a,b,c,d) if a - b + c - d  == 7 => format!("{}-{}+{}-{}",a,b,c,d),
        (a,b,c,d) if a - b - c - d  == 7 => format!("{}-{}+{}+{}",a,b,c,d),
        _ =>  unreachable!(), 
    };
    println!("{}=7",ans);
}

Measured memory_bytes: 4352
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
using namespace std;
//#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=100;
//ここまでテンプレ
int main(){
	string S;
	cin>>S;
	int alpha[26]={};
	for(int i=0;i<S.length();i++)
		alpha[S[i]-'a']++;
	if(S=="zyxwvutsrqponmlkjihgfedcba"){
		cout<<-1<<endl;
		return 0;
	}
	if(S.length()<26){
		for(int i=0;i<26;i++){
			if(alpha[i]==0){
				cout<<S<<(char)('a'+i)<<endl;
				return 0;
			}
		}
	}
	vint vec;
	for(int i=0;i<S.length();i++)
		vec.pb(S[i]-'a');
	next_permutation(vec.begin(),vec.end());
	for(int i=0;i<S.length();i++){
		cout<<(char)('a'+vec[i]);
		if(S[i]!='a'+vec[i]){
			cout<<endl;
			return 0;
		}
	}
	cout<<endl;
	return 0;
}

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

using namespace std;
typedef long long ll;

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; }

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

  
  for(int i=0; i<S.size()-1; i++)
    if(S[i]==S[i+1])
      {
	cout << "Bad" << endl;
	return 0;
      }
  cout << "Good" << endl;
  
  
  return 0;
}


//cout << setprecision(13);
//next_permutation();
//__gcd();
//reverse();
//set ,tuple ,pair;
//bitset
//vector.find
//vector.count



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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    string s;
    map<string,int> mp;
    int i;
    for(i=0;i<n;i++)
    {
        cin >> s;
        mp[s]++;
    }
    map<int,vector<string>> cnt;
    for(auto it = mp.begin();it!=mp.end();it++)
    {
        cnt[it->second].push_back(it->first);
    }
    auto it = cnt.rbegin();
    vector<string> v = it->second;
    for(auto j : v)
        cout << j << '\n';
}

Measured memory_bytes: 27120
import std.stdio;
import std.algorithm;
import std.string;
import std.conv;
import std.math;

void main(){

    int[101] team;
    int count = 0;
    while(true){
	auto s = split(chomp(readln()),',');
	int n1 = to!int(s[0])-1;
	int n2 = to!int(s[1]);
	if(n1==-1&&n2==0) break;
	team[n1] = n2;
	count++;
    }
    int[101] rank;
    int r = 1;
    bool flg = false;
    for(int i=30;i>=0;i--){
	flg = false;
	for(int j=0;j<count;j++){
	    if(team[j] == i){
	       	rank[j] = r;
		flg = true;
	    }
	}
	if(flg) r++;
    }
    
    while(true){
	auto s1 = readln();
	if(stdin.eof()) break;
	int n = to!int(chomp(s1));
	writeln(rank[n-1]);
    }
}

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

typedef long long ll;

const ll MOD = 1000000007;
const int MAX_N = 2005;

ll sil[MAX_N * MAX_N], odw[MAX_N * MAX_N], DP[MAX_N][MAX_N];

ll pot(ll a, ll b) {
    ll result = 1;

    while(b > 0) {
        if(b % 2 == 1) {
            result = (result * a) % MOD;
        }
        a = (a * a) % MOD;
        b /= 2;
    }

    return result;
}

ll binom(int n, int k) {
    ll result = sil[n];
    result = (result * odw[k]) % MOD;
    result = (result * odw[n - k]) % MOD;
    return result;
}

int main() {
    sil[0] = 1;
    for(int i = 1; i < MAX_N * MAX_N; i++) {
        sil[i] = (sil[i - 1] * i) % MOD;
    }
    odw[MAX_N * MAX_N - 1] = pot(sil[MAX_N * MAX_N - 1], MOD - 2);
    for(int i = MAX_N * MAX_N - 2; i >= 1; i--) {
        odw[i] = (odw[i + 1] * ll(i + 1)) % MOD;
    }
    odw[0] = odw[1];

    int n, k;
    
    cin >> n >> k;
    
    if(k == 1) {
        cout << 1;
        return 0;
    }
    
    for(int i = 0; i <= n; i++) {
        for(int j = i; j <= n; j++) {
            if(i == 0) {
                if(j == 0) {
                    DP[i][j] = 1;
                } else {
                    DP[i][j] = (DP[i][j - 1] * binom(j * (k - 1) - 1, k - 2)) % MOD;
                }
                continue;
            }
            DP[i][j] = DP[i - 1][j];
            if(j > i) {
                DP[i][j] += DP[i][j - 1] * binom(j * (k - 1) + i - 1, k - 2);
                DP[i][j] %= MOD;
            }
        }
    }

    for(int i = 1; i <= n; i++) {
        DP[n][n] = (DP[n][n] * i) % MOD;
    }
    
    cout << DP[n][n];
    
    return 0;
}


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

int main() {
    int n, x, fx = 0;
    cin >> n;
    x = n;
    rep(i, 8) {
        fx += x % 10;
        x /= 10;
    }
    if(n % fx == 0) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3604
<?php
  declare(strict_types=1);

  fscanf(STDIN, "%i %i", $a, $b);

  $eval = function ($x)
  {
      return ($x + 11) % 13;
  };

  $a = $eval($a);
  $b = $eval($b);

  if ($a > $b)
  {
      echo "Alice".PHP_EOL;
  }
  else if ($a < $b)
  {
      echo "Bob".PHP_EOL;
  }
  else
  {
      echo "Draw".PHP_EOL;
  }


Measured memory_bytes: 4856
def calc(a,b,c,d,e,f):
	A1=2*(c-a)
	B1=2*(d-b)
	C1=a**2-c**2+b**2-d**2
	A2=2*(e-a)
	B2=2*(f-b)
	C2=a*a-e*e+b*b-f*f
	X=(B1*C2-B2*C1)/(A1*B2-A2*B1)
	Y=(C1*A2-C2*A1)/(A1*B2-A2*B1)
	R=((X-a)**2+(Y-b)**2)**0.5
	return tuple(map(round, [X,Y,R], [3]*3))
l=[map(float,raw_input().split()) for i in range(input())]
for ll in l:
	print "%.3f %.3f %.3f"%(calc(*ll))

Measured memory_bytes: 4336
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class node
{
	public node parent;
	public node[] children;
	public int id;
	public int depth;
	
	public override string ToString()
	{
		string result = "node ";
		
		result += id.ToString() + ": parent = ";
		result += (depth == 0)?  "-1" : parent.id.ToString();
		result += ", depth = " + depth.ToString() + ", ";
		
		if(depth == 0){
			result += "root, [";
		} else if(children.Length == 0) {
			result += "leaf, [";
		} else {
			result += "internal node, [";
		}
		
		if(children != null) {
			result += 
				string.Join(
					", ", Array.ConvertAll(children, c => c.id.ToString()));
		}
		
		result += "]";
		
		return result;
	}
	
}

public class Test
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		
		node[] tree = new node[n];
		
		for(int i = 0; i < n; i++ ){
			int[] A = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
			
			if(tree[A[0]] == null) tree[A[0]]= new node();
			tree[A[0]].id = A[0];
			tree[A[0]].children = new node[A[1]];
			
			// OYAKO KANKEI
			for(int j = 0; j < A[1]; j++){
				if(tree[A[2 + j]] == null) tree[A[2 + j]] = new node();
				tree[A[0]].children[j] = tree[A[2 + j]];
				tree[A[2 + j]].parent = tree[A[0]];
			}
		}
		
		// HUKASA SOKUTEI
		node u = tree[0];
		while(u.parent != null) {
			u = u.parent;
		}
		List<node> v = new List<node>();
		foreach(node x in u.children) v.Add(x);
		while(v.Count != 0) {
			var y = v.ToArray();
			v = new List<node>();
			foreach(node w in y){
				w.depth = w.parent.depth + 1;
				foreach(node x in w.children) v.Add(x);
			}
		}
		
        
        foreach(node t in tree) {
        	Console.WriteLine(t.ToString());
        }
	}
}

Measured memory_bytes: 29644
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define ll long long int
#define ld long double
#define pb push_back 
#define ff first 
#define ss second
#define all(c) c.begin(), c.end()
#define sz(z) (int)z.size()
#define rep(i,a,b) for(int i=a; i<b; ++i)
#define rev(i,a,b) for(int i=a; i>=b; i--)
//Debugging tools 
#define debug(v) cout<<#v<<endl;for(ll i=0; i<v.size(); i++) cout<<v[i]<<" "; cout<<endl;
#define debugn(v,n) cout<<#v<<endl;for(ll i=0; i<n; i++) cout<<v[i]<<" "; cout<<endl;
#define deb(sum) cout<<#sum<<" = "<<sum<<endl;
//Predefined values
#define INF (ll)1e18
#define endl "\n"
#define pi 3.142857142857143


int main() { 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    // #ifndef ONLINE_JUDGE
    //     freopen("input.in","r",stdin);
    //     freopen("output.in","w",stdout);
    // #endif
    int t=1;    
    //cin>>t;
    while(t--){
        float d,t,s;
        cin>>d>>t>>s;
        if(d/s<=t)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;


    }
  return 0;
 }

















Measured memory_bytes: 3732
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n);i++)
using namespace std;
using ll = long long;
int INF = 1000000009;
int main()
{
  int h, w;
  cin >> h >> w;
  map<char, int> mp;
  set<char> st;
  vector<vector<char>> v(h, vector<char>(w));
  rep(i,h){
    rep(j,w){
      cin >> v[i][j];
      mp[v[i][j]]++;
      st.insert(v[i][j]);
    }
  }
  vector<int> v1;
  if (h % 2 == 0 && w % 2 == 0)
  {
    rep(i,h/2){
      rep(j,w/2){
        v1.push_back(4);
      }
    }
  }
  else if (h % 2 == 1 && w % 2 == 1)
  {
    rep(i,h/2){
      rep(j,w/2){
        v1.push_back(4);
      }
    }
    rep(i,h/2){
      v1.push_back(2);
    }
    rep(i,w/2){
      v1.push_back(2);
    }
    v1.push_back(1);
  }
  else if(h % 2 == 1 && w %2 == 0)
  {
    rep(i,w/2){
      rep(j,h/2){
        v1.push_back(4);
      }
    }
    rep(i,w/2){
      v1.push_back(2);
    }
  }
  else if (w % 2 == 1 && h % 2 == 0)
  {
    rep(i, h / 2)
    {
      rep(j, w / 2)
      {
        v1.push_back(4);
      }
    }
    rep(i, h / 2)
    {
      v1.push_back(2);
    }
  }
  vector<int> v2;
  for(auto e:st){
    v2.push_back(mp[e]);
  }
  reverse(v2.begin(),v2.end());
  bool flag = true;
  rep(i,v1.size()){
    bool flag2 = false;
    rep(j, v2.size())
    {
      if (v2[j] >= v1[i])
      {
        v2[j]-=v1[i];
        flag2 = true;
        break;
      }
    }
    if(!flag2){
      flag = false;
      break;
    }
  }
  if(flag){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int x_max,y_max;
char map[102][102];
char visited[102][102];

void tadoru(int x,int y,char color) {
	if(map[y][x]!=color || visited[y][x])return;
	visited[y][x]=1;
	tadoru(x-1,y,color);
	tadoru(x+1,y,color);
	tadoru(x,y-1,color);
	tadoru(x,y+1,color);
}

int main(void) {
	int start_x,start_y;
	int goal_x,goal_y;
	int block_num;
	int block_color,block_muki;
	int block_x,block_y;
	int i;
	while(1) {
		scanf("%d%d",&x_max,&y_max);
		if(x_max==0 && y_max==0)break;
		scanf("%d%d",&start_x,&start_y);
		scanf("%d%d",&goal_x,&goal_y);
		scanf("%d",&block_num);
		memset(map,0,sizeof(map));
		memset(visited,0,sizeof(visited));
		for(i=0;i<block_num;i++) {
			scanf("%d%d%d%d",
				&block_color,&block_muki,&block_x,&block_y);
			map[block_y  ][block_x  ]=block_color;
			map[block_y+1][block_x  ]=block_color;
			map[block_y  ][block_x+1]=block_color;
			map[block_y+1][block_x+1]=block_color;
			if(block_muki) {
				map[block_y+2][block_x  ]=block_color;
				map[block_y+3][block_x  ]=block_color;
				map[block_y+2][block_x+1]=block_color;
				map[block_y+3][block_x+1]=block_color;
			} else {
				map[block_y  ][block_x+2]=block_color;
				map[block_y+1][block_x+2]=block_color;
				map[block_y  ][block_x+3]=block_color;
				map[block_y+1][block_x+3]=block_color;
			}
		}
		tadoru(start_x,start_y,map[start_y][start_x]);
		puts(visited[goal_y][goal_x]?"OK":"NG");
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
typedef long long int ll;
using namespace std;
int main()
{
  int a;
  cin >> a;
  if(a == 25){
    cout << "Christmas" << endl;
  }else if(a == 24){
    cout << "Christmas Eve" << endl;
  }else if(a == 23){
    cout << "Christmas Eve Eve" << endl;
  }else if(a == 22){
    cout << "Christmas Eve Eve Eve" << endl;
  }

}


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

#define FOR(i,a,b) for(int (i) = (a);(i) < (int) (b);(i)++)
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
typedef long long ll;

int N,M;
vector<int> odd,even;

void show(vector<int>& ans)
{
	FOR(i,0,ans.size()){
		printf("%d ",ans [i]);
	}
	printf("\n");
}

int main()
{
	scanf("%d%d",&N,&M);
	FOR(i,0,M){
		int p;
		scanf("%d",&p);
		if(p & 1)
			odd.PB(p);
		else
			even.PB(p);
	}
	if(odd.size() > 2){
		printf("Impossible\n");
		return 0;
	}
	else if(M == 1){
		printf("%d\n",N);
		printf("%d\n",1 + (bool) (N - 1));
		printf("%d ",1);
		if(N - 1){
			printf("%d",N - 1);
		}
		printf("\n");
		return 0;
	}

	vector<int> ans;
	if(odd.empty() == false){
		ans.PB(odd.back());
		odd.pop_back();
	}
	FOR(i,0,even.size()){
		ans.PB(even [i]);
	}
	if(odd.empty() == false){
		ans.PB(odd.back());
		odd.pop_back();
	}

	show(ans);
	ans.front()++;
	if(--ans.back() == 0)
		ans.pop_back();
	printf("%d\n",ans.size());
	show(ans);

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int N,M,T[100],Ts,H[100],Hs,k,r,rt,rh,i,j;
int main()
{
	for(;scanf("%d%d",&N,&M),N+M;)
	{
		for(i=Ts=0;i<N;Ts+=T[i],i++)
			scanf("%d",&T[i]);
		for(i=Hs=0;i<M;Hs+=H[i],i++)
			scanf("%d",&H[i]);
		for(i=0,r=1000;i<N;i++)
			for(j=0;j<M;j++)
				if(Ts-T[i]+H[j]==Hs-H[j]+T[i])
					if(r>T[i]+H[j])
					{
						r=T[i]+H[j];
						rt=i;
						rh=j;
					}
		if(r==1000)
			puts("-1");
		else
			printf("%d %d\n",T[rt],H[rh]);
	}
	return 0;
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#include <algorithm>

int main(){
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  sort(a.begin(), a.end());
  
  cout << a[2]*10 + a[1] + a[0] << endl;
  
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		String x = "";
		try {
			x = in.readLine();
			
			String tmp = "";
			for (int i = 0; i < x.length(); i++) {
				tmp = tmp + x.charAt(x.length() - i - 1);
			}
			System.out.println(tmp);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 24252
#include <iostream>

int insertionSort(int *a, int n, int g){
    int tmp;
    int out_cnt = 0;
    for(int i = g; i < n; i++){
        tmp = a[i];

        int j = i;
        
        while(j-g >= 0 && a[j-g] > tmp){
            a[j] = a[j-g];
            j -= g;
            out_cnt++;
        }
        a[j] = tmp;
    }
    return out_cnt;
}

int main(){

    int n, tmp;
    std::cin >> n;

    int a[n];

    for(int i = 0; i < n; i++){
        std::cin >> tmp;
        a[i] = tmp;
    }

    int g[100];
    int max_g = 1;
    int m = 0;
    int cnt = 0;

    g[m] = 1;

    while(n > 3 * g[m] + 1){
        g[m+1] = 3 * g[m] + 1;
        m++;
    }

    std::cout << m + 1 << std::endl;

    for(int c = m; c >= 0; c--){
        if(c == 0){
            std::cout << g[c] <<std::endl;
        }else{
            std::cout << g[c] << " ";
        }
    }

    for(int i = m; i >= 0; i--){
        cnt += insertionSort(a, n, g[i]);
    }

    std::cout << cnt << std::endl;


    for(int i = 0; i < n; i++){
        std::cout << a[i] << std::endl;;
    }    

}


Measured memory_bytes: 6988
#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 a, b;
  cin >> a >> b;
  if (b == 1)
    puts("0");
  else
    cout << (b - 1 + a - 2) / (a - 1) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000

typedef long long ll;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

const int MAXN = 1024;

int jungle[MAXN][MAXN];
int ocean[MAXN][MAXN];
int ice[MAXN][MAXN];
char board[MAXN][MAXN];
int N, M;

void init() {
    for (int i = 1; i <= M; i++) {
        for (int j = 1; j <= N; j++) {
            jungle[i][j] = jungle[i-1][j] + jungle[i][j-1] - jungle[i-1][j-1] + (board[i][j] == 'J');
            ocean[i][j] = ocean[i-1][j] + ocean[i][j-1] - ocean[i-1][j-1] + (board[i][j] == 'O');
            ice[i][j] = ice[i-1][j] + ice[i][j-1] - ice[i-1][j-1] + (board[i][j] == 'I');
        }
    }
}

void solve(int a, int b, int c, int d) {
    int j = jungle[c][d] -jungle[c][b-1] - jungle[a-1][d] + jungle[a-1][b-1];
    int o = ocean[c][d] -ocean[c][b-1] - ocean[a-1][d] + ocean[a-1][b-1];
    int i = ice[c][d] -ice[c][b-1] - ice[a-1][d] + ice[a-1][b-1];
    printf("%d %d %d\n", j, o, i);
}

int main(void) {
    int K;
    cin >> M >> N;
    cin >> K;
    for (int i = 1; i <= M; i++) {
        for (int j = 1; j <= N; j++) {
            cin >> board[i][j];
        }
    }
    init();
    while (K--) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        solve(a, b, c, d);
    }
    return 0;
}

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

int main(){
  ll n,p;
  p=1000000007;
  cin >> n;
  ll i,a,b,c;
  a=1;
  b=1;
  c=1;
  for(i=0;i<n;i++){
    a *= 10;
    a %= p;
    b *= 9;
    b %= p;
    c *= 8;
    c %= p;
  }
  
  ll s;
  s=(a-2*b+c)%p;
  if(s<0){
    s += p;
  }
  
  cout << s << endl;
}

Measured memory_bytes: 3632
/*
author: Apoorv Singh
*/

#include <bits/stdc++.h>
using namespace std;

typedef vector <long long> vi;
typedef pair <long long, long long> pii;
#define pb push_back   
#define aint(c) c.begin(), c.end()
#define watch(x) cout << (#x) << " " << (x) << endl;
#define FOR(i, a, b) for (long long i = a; i < b; ++i)
#define FORR(i, a, b) for (long long i = a; i > b; --i)
#define um unordered_map
#define F first
#define S second
#define int long long
#define inf LLONG_MAX

int modulo = 1e9 + 7;

template <class X>

void printarr(X arr[], int n)
{
    for (int i = 0; i < n; ++i)
        cout << arr[i] << " ";
    cout << endl;
}

int fpow(int a, int n)
{
    int ans = 1;
    while (n)
    {
        if (n&1)
            ans = (ans * a)%modulo;
        a = (a*a)%modulo;
        n = n >> 1;
    }
    return ans;
}

/*
const int M = 1e6 + 10;
int composite[M] = {0};

void sieve()
{
    FOR(i,2,M)
    {
        if (!composite[i])
        {
            for (int j = 2*i; j < M; j += i)
                composite[j] = max(composite[j], i);
        }
    }
}
*/

const int M = 1e5 + 10;
vector <pii> graph[M];
int visited[M] = {0}, color[M];

void dfs(int source, int c)
{
	visited[source] = 1;
	color[source] = c;
	for (pii a : graph[source])
	{
		int vertex, weight;
		tie(vertex, weight) = a;
		if (visited[vertex])
			continue;
		if (weight&1)
		{
			if (c == 1)
				dfs(vertex, 0);
			else
				dfs(vertex, 1);
		}
		else
			dfs(vertex, c);
	}
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n; cin >> n;
    FOR(i,0,n-1)
    {
    	int u,v,w; cin >> u >> v >> w;
    	graph[u].pb({v,w}); graph[v].pb({u,w});
    }
    dfs(1,0);
    FOR(i,1,n+1) cout << color[i] << endl;
    return 0;
}

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

namespace AtCoder_Beginner_Contest_125_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] stringValue = Console.ReadLine().Split(' ');
            double second = double.Parse(stringValue[0]);
            double biscuit = double.Parse(stringValue[1]);
            double times = double.Parse(stringValue[2]);
            double timeLimit = times + 0.5;
            double number = Math.Floor(timeLimit / second);

            Console.WriteLine(biscuit * number);
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(int i = (N) - 1; i >= 0; i--)
#define rep1(i,N) for(int i = 1; i <= (N) ; i++)
#define repr1(i,N) for(int i = (N) ; i > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
using namespace std; void solve();
using ll = long long; using vl = vector<ll>;
using vi = vector<int>; using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
  int main(){solve();}
#endif
using P = pair<int,int>; using vp = vector<P>;
constexpr int MOD = /**/ 1000000007; //*/ 998244353;
//////////

// 立っているビットの数
inline int popcnt(unsigned long long a){ return __builtin_popcountll(a); }
// 一番右側のbit(1の位を0番目とする)
inline int ctz(unsigned long long a){ return __builtin_ctzll(a); }
// 一番左側のbit
inline int msb(unsigned long long a){ return 63 - __builtin_clzll(a); }

void solve(){
  ini(N);
  vector<vp> a(N);
  rep(i , N){
    ini(x); a[i].resize(x);
    in(a[i]);
    each(x , a[i]) x.fi--;
  }
  int ans = 0;
  rep(b , 1 << N){
    int flg = true;
    rep(i , N){
      int bi = (b >> i) & 1;
      if(bi == 0) continue;
      each(x , a[i]){
        int bj = (b >> x.fi) & 1;
        if(bj != x.se) flg = false;
      }
    }
    if(flg) {trc(b); amax(ans , popcnt(b));}
  }
  out(ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll n, k, bit[45], ans, a;
vector<ll> vec;

ll pow(ll r, ll t){
    if (t == 0) return 1;
    if (t % 2) return r * pow(r, t - 1);
    else {
        ll yy = pow(r, t / 2);
        return yy * yy;
    }
}

int main(void){
    // Your code here!
    cin >> n >> k;
    for (ll i = 0; i < n; i++){
        cin >> a;
        ll j = 0;
        while(a){
            bit[j] += a % 2;
            a /= 2;
            j++;
        }
    }
    while(k){
        vec.push_back(k % 2);
        k /= 2;
    }
    bool u = false;
    for (ll i = vec.size() - 1; i >= 0; i--){
        if (!u){
            if (vec[i] == 0){
                ans += pow(2, i) * bit[i];
            } else {
                if (bit[i] >= n - bit[i]){
                    ans += bit[i] * pow(2, i);
                    u = true;
                } else {
                    ans += (n - bit[i]) * pow(2, i);
                }
            }
        } else {
            ans += max(bit[i], (n - bit[i])) * pow(2, i);
        }
    }
    for (ll i = vec.size(); i <= 44; i++) {
        ans += bit[i] * pow(2, i);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    d,n=map(int,input().split())
    print(n*(100**d) if n!=100 else 101*(100**d))
resolve()

Measured memory_bytes: 38256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        int[] abc=cin.ArrayInt(3,0);
        Array.Sort(abc);
        int ans=3;
        if(abc[0]==abc[2])ans=1;
        else if(abc[0]==abc[1]||abc[1]==abc[2])ans=2;
      Console.WriteLine(ans);
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
    public void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}


Measured memory_bytes: 11220
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

class UnionFind {
public:
    // 親の番号を格納する。親だった場合-size
    vector<int> parents;

    UnionFind(int n) {
        parents = vector<int>(n, -1);
    }

    // aがどのグループに属しているか
    int root(int a) {
        if (parents[a] < 0) {
            return a;
        }
        return parents[a] = root(parents[a]);
    }

    int size(int a) {
        return -parents[root(a)];
    }

    // aとbをくっつける
    bool connect(int a, int b) {
        int ra = root(a);
        int rb = root(b);
        if (ra == rb) {
            return false;
        }
        // 大きいほうにA
        if (size(ra) < size(rb)) {
            swap(ra, rb);
        }
        parents[ra] += parents[rb];
        parents[rb] = ra;
        return true;
    }

    bool is_union(int a, int b) {
        int ra = root(a);
        int rb = root(b);
        return ra == rb;
    }
};

const int ma = 1e6;

int main() {
    int n;
    cin >> n;
    vector<P> v(n);
    for (P &p:v)cin >> p.first >> p.second;

    UnionFind uf(2 * ma);
    auto connect = [&](int y, int x) {
        uf.connect(y, int(x + ma));
    };

    auto root_y = [&](int i) {
        return uf.root(i);
    };

    auto root_x = [&](int i) {
        return uf.root(i + int(ma));
    };

//    map<int, int> use_horizontal, use_vertical;
//    for (P p : v) use_vertical[p.first]++;
//    for (P p : v) use_horizontal[p.second]++;

    for (P p : v) {
//        if (use_vertical[p.first] > 1 && use_horizontal[p.second] > 1) {
        connect(p.first, p.second);
//        }
    }


    map<int, P> m;
    rep(i, ma) m[root_y(i)].first++;
    rep(i, ma) m[root_x(i)].second++;

    auto is_union = [&](ll y, ll x) -> bool {
        return uf.is_union(y, x + int(ma));
    };

    ll ans = 0;
    for (auto e : m) ans += e.second.first * e.second.second;

//    for (P p: v) if (is_union(p.first, p.second)) ans--;
    ans -= n;
    cout << ans << endl;

}


Measured memory_bytes: 137392
#include <bits/stdc++.h>
using namespace std;
typedef unsigned int uint;
typedef long long int lint;
typedef unsigned long long int ulint;

//#define DEBUG

#ifdef DEBUG
#	define dump(i) cout << "[*] " #i " : " << i << endl;
#	define debug(i) i
#else
#	define dump(i)
#	define debug(i)
#endif
#define rep(i, MAX) for (int i = 0; i < (MAX); ++i)

inline void solve() {
	int a, b, c;
	int x, y;
	cin >> a >> b >> c >> x >> y;
	c *= 2;
	int num_min = min(x, y);
	x -= num_min;
	y -= num_min;
	int ans;
	if (a + b > c) {
		ans = c * num_min;
	} else {
		ans = (a + b) * num_min;
	}
	ans += (a < c ? a : c) * x;
	ans += (b < c ? b : c) * y;
	cout << ans << endl;
}

int main() {
	//*
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	// */
#ifdef DEBUG
	const auto start = chrono::high_resolution_clock::now();
#endif
	solve();
#ifdef DEBUG
	const auto stop = chrono::high_resolution_clock::now();
	cerr << "[*] time: " << chrono::duration_cast<chrono::milliseconds>(stop-start).count()
		<< " [ms]" << endl;
#endif
	return 0;
}


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

int main() {
  string s, p;
  cin >> s >> p;
  rep(i, s.size()) {
    bool ans = true;
    rep(j, p.size()) {
      int index = i + j;
      if (index >= s.size()) {
        index -= s.size();
      }
      if (s.at(index) != p.at(j)) {
        ans = false;
      }
    }
    if (ans) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}



Measured memory_bytes: 3204
import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
ans = 0
N = int(input())
if N % 2 == 1:
    print(0)
else:
    N = N /2
    while N >= 5:
        ans += N // 5
        N = N // 5
    print(int(ans))




Measured memory_bytes: 2568
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;cin>>a>>b;
  vector<int> c(210,0);
  c[1]=300000,c[2]=200000,c[3]=100000;
  cout<<(a==1&&b==1?1000000:c[a]+c[b]);
}

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

#define MOD 998244353

int C[4004][4004], F[4004][4004], pre[2][4004], X[4004];

long long solve(int moves, int good, int bad)
{
    if(moves == 0)
        return 1;
    
    long long ans = 0;
    
    for(int i=0, j=moves; i<=moves; i++, j--)
        ans += (long long) ((good == 0 && i == 0 ) ? 1 : C[good+i-1][i]) * F[bad][j] % MOD;
    
    return ans % MOD;
}

int main() {

    ios::sync_with_stdio(0);
    cin.tie(NULL), cout.tie(NULL);

    int K, N;
    cin >> K >> N;
    
    for(int i=0; i<=4000; i++)
        C[i][0] = 1;
    
    for(int i=1; i<=4000; i++)
        for(int j=1; j<=i; j++)
            C[i][j] = (C[i-1][j-1] + C[i-1][j]) % MOD;
    
    F[0][0] = 1;
    
    for(int i=0; i<=4000; i++)
        pre[0][i] = 1;
    
    for(int i=1; i<=4000; i++)
        for(int j=0; j<=4000; j++)
        {
            F[i][j] = (2LL * (j >= 1 ? pre[(i-1)%2][j-1] : 0) + F[i-1][j]) % MOD;
            pre[i%2][j] = (pre[i%2][j-1] + F[i][j]) % MOD;
        }
    
    for(int sum = 2; sum <= 2*K; sum++)
    {
        if(2 * K - sum + 2 < sum)
        {
            cout << X[2 * K - sum + 2] << "\n";
            continue;
        }
        
        int bad = (sum-1)/2;
        int onlyOne = (sum % 2 == 0);
        int good = max(0, K - (bad * 2 + onlyOne));
        
        X[sum] = (solve(N, good, bad) + (onlyOne == 0 ? 0 : solve(N-1, good, bad))) % MOD;
        
        cout << X[sum] << "\n";
    }
    
    return 0;
}

Measured memory_bytes: 125568
INF = 10**18

N = int(input())
A = list(map(int, input().split()))

if N % 2 == 0:
    od = [0 for _ in range(N // 2 + 1)]
    ev = [0 for _ in range(N // 2 + 1)]

    for i in range(N):
        if i % 2 == 0:
            od[i // 2 + 1] = od[i // 2] + A[i]
        else:
            ev[~(i // 2 + 1)] = ev[~(i // 2)] + A[~i + 1]

    res = -INF

    for i in range(N // 2 + 1):
        res = max(res, od[i] + ev[i])

    print(res)

else:
    dp = [[[-INF for k in range(2)] for j in range(3)] for i in range(N + 1)]
    dp[0][0][0] = 0

    for i in range(N):
        dp[i + 1][0][0] = dp[i][0][1]
        dp[i + 1][1][0] = max(dp[i][0][0], dp[i][1][1])
        dp[i + 1][2][0] = max(dp[i][1][0], dp[i][2][1])
        dp[i + 1][0][1] = dp[i][0][0] + A[i]
        dp[i + 1][1][1] = dp[i][1][0] + A[i]
        dp[i + 1][2][1] = dp[i][2][0] + A[i]

    res = -INF

    for j in range(1, 3):
        for k in range(2):
            if k == 0 and j == 2:
                continue
            res = max(res, dp[N][j][k])

    print(res)

Measured memory_bytes: 177980
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;
using ll = long long;

int main()
{
  int N; cin >> N;
  vector<ll> S(N+1, 0);
  REP(i, N) {
    ll a; cin >> a;
    S[i+1] = a + S[i];
  }

  map<ll, ll> cnt;
  for (int i = 0; i < N+1; ++i) {
    cnt[S[i]]++;
  }

  ll ans = 0;
  for (auto v : cnt) {
    ll a = v.second;
    ans += a*(a-1)/2;
  }

  cout << ans << endl;
}

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

int main(){
    string s;cin>>s;
    int j['Z']={0};

    for(int i=0;i<s.length();i++){
        if(s[i]=='N') j['N']=1;
        else if(s[i]=='W') j['W']=1;
        else if(s[i]=='S') j['S']=1;
        else if(s[i]=='E') j['E']=1;
    }
    
    if(j['N'] ^ j['S'] || j['W'] ^ j['E']) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
 
int main(void) {
    double a, c, b, d;
    double dx, dy;
    scanf("%lf %lf %lf %lf", &a, &c, &b, &d);
     
    printf("%f\n", hypot(b - a, d - c));
     
    return 0;
}


Measured memory_bytes: 2052
N = int(input())
h = list(map(int, input().split()))
ans = True
MIN = h[0]-1

for i in range(N-1):
    MIN = max(MIN, h[i]-1)
    if h[i] > h[i+1]:
        if h[i]-h[i+1] > 1:
            ans = False
            break
        else:
            if MIN > h[i+1]:
                ans = False
                break

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

Measured memory_bytes: 20728