akhauriyash/Code-Regression huggingface dataset:
using System.Linq;
using System.Text;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {

        const int BiggestMod = 1000000007;


        public static void Main()
        {

            var num = int.Parse(Console.ReadLine());
            var ac = 0;
            var wa = 0;
            var tle = 0;
            var re = 0;


            for (int i = 0; i < num; i++)
            {

                switch (Console.ReadLine())
                {

                    case "AC":

                        ac++;
                        break;

                    case "WA":

                        wa++;
                        break;

                    case "TLE":

                        tle++;
                        break;

                    case "RE":

                        re++;
                        break;

                }

            }

            Console.WriteLine("AC x " + ac);
            Console.WriteLine("WA x " + wa);
            Console.WriteLine("TLE x " + tle);
            Console.WriteLine("RE x " + re);

        }
    }

}

Measured memory_bytes: 30692
#include <bits/stdc++.h>
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
#define e_b emplace_back
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
using namespace std;
using ll = long long;
using ld = long double;
template<class T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}

int main(){
  ios_base::sync_with_stdio(false);cin.tie(0);
  int N;
  cin >> N;
  vector<ll> A(N);
  for(int i=0;i<N;i++)  cin >> A.at(i);

  if(N%2==0){
    ll tmp=0;
    for(int i=0;i<N;i++)  tmp^=A.at(i);
    for(int i=0;i<N;i++)  cout << (A.at(i)^tmp) << " ";
    cout << endl;
  }
  else{
    vector<ll> ans(N,0);
    for(int i=0;i<N-1;i++)  ans.at(i)=A.at(i)^A.at(i+1);
    ll tmp=0;
    cout << 0 << " ";
    for(int i=0;i<N-1;i++){
      tmp^=ans.at(i);
      cout << tmp << " ";
    }
    cout << endl;
  }

  return 0;
}

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

#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007 // 10^9+7
#define INF 99999999999 //10^12-1
#define dev 998244353 //tenka1
#define P pair<int,int>
#define F first
#define S second
int gcd(int a,int b){
    if(a%b==0)return b;
    return gcd(b,a%b);
}
int a,b,ans=1;
signed main(){
    cin>>a>>b;
    int n=gcd(a,b);
    int x=n;
    if(n%2==0){
        while(n%2==0)n/=2;
        ans++;
    }
    if(n==1){
        cout<<ans<<endl;
        return 0;
    }
    for(int i=3;i<=n&&i<=sqrt(x);i+=2){
        if(n%i==0){
            while(n%i==0)n/=i;
            ans++;
        }
        if(n==1)break;
    }
    if(n>1)ans++;
    cout<<ans<<endl;
    return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll N, A, B;
    cin >> N >> A >> B;
    cout << min(B, N * A) << endl;
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 2147483647;
const ll LINF = 9223372036854775807;
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
	int n; cin >> n;
	VI a(n); REP(i,n) cin >> a[i];
	if(n%2==0){
		ll dp[n][2];
		REP(i,n)REP(j,2)dp[i][j]=-(LINF/2);
		REP(i,n){
			if(i<2){
				if(i==0) dp[i][0]=a[i];
				else dp[i][1]=a[i];
			}
			if(i>=2)
				dp[i][0]=dp[i-2][0]+a[i];
			if(i>=3)
				dp[i][1]=max(dp[i-3][0]+a[i],dp[i-2][1]+a[i]);
		}
		ll ans=-LINF;
		REP(i,2)ans=max(ans,dp[n-1-i][1-i]);
		cout << ans << endl;
	}
	else{
		ll dp[n][3];
		REP(i,n)REP(j,3)dp[i][j]=-(LINF/2);
		REP(i,n){
			if(i<3){
				if(i==0) dp[i][0]=a[i];
				else if(i==1) dp[i][1]=a[i];
				else if(i==2) dp[i][2]=a[i];
			}
			if(i>=2)
				dp[i][0]=dp[i-2][0]+a[i];
			if(i>=3){
				dp[i][1]=max(dp[i-3][0]+a[i],dp[i-2][1]+a[i]);
				dp[i][2]=max(dp[i-3][1]+a[i],dp[i-2][2]+a[i]);
			}
			if(i>=4)
				dp[i][2]=max(dp[i-4][0]+a[i],dp[i][2]);
		}
		ll ans=-LINF;
		REP(i,3)ans=max(ans,dp[n-1-i][2-i]);
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 9604
#include <algorithm>
#include   <cstring>
#include    <cstdio>
#include    <vector>
using namespace std;

const int MAXN = 200000+9;
vector<int> vec[2];
int x[MAXN],y[MAXN];
int bit[100];
int n;

int solve(){
	int ans=0;
	for(int i=0;i<=28;i++){
		int tot=0;
		vec[0].clear();vec[1].clear();
		for(int j=1;j<=n;j++)
			vec[(x[j]>>i)&1].push_back(x[j]);
		for(int j=0;j<vec[0].size();j++)
			x[++tot]=vec[0][j];
		for(int j=0;j<vec[1].size();j++)
			x[++tot]=vec[1][j];
		tot=0;
		vec[0].clear();vec[1].clear();
		for(int j=1;j<=n;j++)
			vec[(y[j]>>i)&1].push_back(y[j]);
		for(int j=0;j<vec[0].size();j++)
			y[++tot]=vec[0][j];
		for(int j=0;j<vec[1].size();j++)
			y[++tot]=vec[1][j];
		int len1=1,len2=1,len3=1;
		int limit1=1LL<<i;
		int limit2=1LL<<(i+1);
		int all=(1LL<<(i+1))-1;
		int sum=0; 
		for(int i=n;i>=1;i--){
			while((((x[i]&all)+(y[len1]&all))<limit1) && (len1<=n)) len1++;
			while((((x[i]&all)+(y[len2]&all))<limit2) && (len2<=n)) len2++;
			while(((x[i]&all)+(y[len3]&all)<limit1+limit2) && (len3<=n)) len3++;
			sum+=n-(len1-1-len2+1+len3-1);
		}
		if(sum&1) ans+=bit[i];
	}
	return ans;
}

int main(){
	bit[0]=1;
	for(int i=1;i<=28;i++)
		bit[i]=bit[i-1]*2;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&x[i]);
	for(int i=1;i<=n;i++)
		scanf("%d",&y[i]);
	printf("%d\n",solve());
	return 0;
}

Measured memory_bytes: 3444
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <limits>
#include <climits>
#include <utility>
#include <algorithm>
#include <numeric>

using namespace std;

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

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

    if (S[0] != S[1] || S[1] != S[2]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 760
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll a[1005],b[1005],c[1005];
    int x,y,z,k;
    cin>>x>>y>>z>>k;
    for(int i=0;i<x;i++) cin>>a[i];
    for(int i=0;i<y;i++) cin>>b[i];
    for(int i=0;i<z;i++) cin>>c[i];

    sort(a,a+x);
    reverse(a,a+x);
    sort(b,b+y);
    reverse(b,b+y);
    sort(c,c+z);
    reverse(c,c+z);
    
    vector<ll> abc;
    
    for(int i=0;i<x;i++){
        for(int j=0;j<y;j++){
            if((i+1)*(j+1)>k) break;
            for(int l=0;l<z;l++){
                if((i+1)*(j+1)*(l+1)>k) break;
                abc.push_back(a[i]+b[j]+c[l]);
            }
        }
    }
    
    sort(abc.begin(),abc.end());
    reverse(abc.begin(),abc.end());
    
    for(int i=0;i<k;i++) cout<<abc[i]<<endl;
    
    return 0;
}


Measured memory_bytes: 1400
def dist(X, Y, p):
    return sum(abs(x - y) ** p for x, y in zip(X,Y)) ** (1.0 / p)
    
n = input()
X = map(int, raw_input().split())
Y = map(int, raw_input().split())
for i in [1, 2, 3]:
    print dist(X, Y, i)
print max(map(lambda xy: abs(xy[0] - xy[1]), zip(X, Y)))

Measured memory_bytes: 4304
#include <iostream>

int main(){
  int input;
  int count = 0;
  std::cin >> input;
  if (input%2!=0){
    count++;
  }
  if (input/10%2!=0){
    count++;
  }
  if (input/100!= 0){
    count++;
  }
  std::cout << count << std::endl;
  return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#include <stdio.h>
 
using namespace std;
 
#define int long long
 
void solve();

signed main () {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	int t = 1; 
	// cin >> t;
	int tt = t;
	while (t--) { 
		solve();
	}
	return 0;
}
const int N = 1005;
int n, m;
const int inf = 1e18;
vector<int> adj[N];
bool vis[N];
int dist[N];
int prv[N];
int indeg[N] = {0}, outdeg[N] = {0};
void solve() {
	cin >> n >> m;
	for (int i = 1; i <= m; i += 1) {
		int a, b;
		cin >> a >> b;
		adj[a].push_back(b);
	}
	int source = -1, sink = -1, min_path = inf;
	for (int i = 1; i <= n; i += 1) {
		memset(vis, false, sizeof vis);
		int sink_here = -1;
		queue<pair<int, int>> q;
		q.push({i, 0});
		dist[i] = 0; 
		while (!q.empty()) {
			int v = q.front().first;
			q.pop();
			vis[v] = true;
			for (auto j : adj[v]) {
				if (!vis[j]) {
					vis[j] = true;
					q.push({j, dist[v] + 1});
					dist[j] = dist[v] + 1;
					prv[j] = v;
				} 
				if (j == i) {
					sink_here = v;
					break;
				}
			}
		}
		if (sink_here != -1) {
			int cycle_length = dist[sink_here] + 1;
			if (cycle_length < min_path) {
				min_path = cycle_length;
				source = i;
				sink = sink_here;
			}
		}
	}
	if (min_path == inf) {
		cout << -1;
		return;
	}
	memset(vis, false, sizeof vis);
	queue<pair<int, int>> q;
	q.push({source, 0});
	dist[source] = 0; 
	while (!q.empty()) {
		int v = q.front().first;
		q.pop();
		for (auto j : adj[v]) {
			if (!vis[j]) {
				vis[j] = true;
				q.push({j, dist[v] + 1});
				prv[j] = v;
			} 
		}
	}
	set<int> ans;
	while (sink != source) {
		ans.insert(sink);
		sink = prv[sink];
	} 
	ans.insert(source);
	for (int i = 1; i <= n; i += 1) {
		if (!ans.count(i))
			continue;
		for (auto j : adj[i]) {
			if (ans.count(j)) {
				indeg[j]++;
				outdeg[i]++;
			}
		}
	}
	for (auto j : ans) {
		if (indeg[j] == 1 and outdeg[j] == 1) {
			continue;
		}
		else {
			cout << -1;
			return;
		}
	}
	cout << ans.size() << '\n';
	for (auto i : ans)
		cout << i << '\n';
}		


Measured memory_bytes: 384
N = gets.chomp.to_i
ab = {}

(1..(N-1)).each do |i|
  a, b = gets.chomp.split(' ').map(&:to_i)
  ab[a] ||= []
  ab[a] << b
  ab[b] ||= []
  ab[b] << a
end

queue = []
queue << 1
stepF = []
stepF[1] = 0
while !queue.empty?
  cur = queue.shift

  ab[cur].each do |to|
    if stepF[to] == nil
      stepF[to] = stepF[cur] + 1
      queue << to
    end
  end
end

queue = []
queue << N
stepS = []
stepS[N] = 0
while !queue.empty?
  cur = queue.shift

  ab[cur].each do |to|
    if stepS[to] == nil
      stepS[to] = stepS[cur] + 1
      queue << to
    end
  end
end

pF = 0
pS = 0
(1..N).each do |i|
  if stepF[i] <= stepS[i]
    pF += 1
  else
    pS += 1
  end
end

if pF > pS
  print 'Fennec'
else
  print 'Snuke'
end

Measured memory_bytes: 19068
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;

int main(){
  std::string w;
  std::cin >> w;

  std::map<char, int> map;
  rep(i,w.size()) {
    map[w[i]]++;
  }

  for(auto it = map.begin(); it != map.end(); ++it) {
    if(it->second %2 != 0) {
      std::cout << "No" << '\n';
      return 0;
    }
  }

  std::cout << "Yes" << '\n';
  return 0;
}


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

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RREP(i, a, b) for (int i = (int)(a)-1; i >= (int)(b); --i)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, n, 0)
#define ALL(r) (r).begin(), (r).end()

void Main() {
    // todo
    long long h, w; cin >> h >> w;
    if (h == 1 || w == 1)
        cout << 1 << endl;
    else
        cout << h / 2 * w + (h % 2 == 0 ? 0 : w / 2 + w % 2) << endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    h1, m1, h2, m2, k = map(int, input().split())
    start = h1 * 60 + m1
    end = h2 * 60 + m2
    print(end - start - k)
resolve()

Measured memory_bytes: 61652
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <unordered_map>
#include <queue>
#include <bitset>
#include <limits>
#include <numeric>

using ld = long double;
using ll = long long int;
using ul = unsigned long long int;

namespace lamlib
{
	/* constant */
	constexpr double epsilon = std::numeric_limits<double>::epsilon();

	/* math */
	template<class T> inline T abs(const T &a){ return (a>0) ? a : -a; }
	ul inline digit(const ul &num){ return static_cast<ul>(std::log10(num+epsilon))+1; }

	/* algorithm */
	ul gcd(const ul &a,const ul &b) { return (!b) ? a : gcd(b,a%b); }
	ul lcm(const ul &a,const ul &b) { return (a/gcd(a,b))*b; } // a/gcd(a,b)*b <=> (a*b)/gcd(a,b)
	std::vector<bool> eratosthenes(const ul &n)
	{
		std::vector<bool> prime_candidate(n,true);
		prime_candidate[0] = prime_candidate[1] = false;
		for(ul i = 2;i*i < n;++i)
		{
			if(!prime_candidate[i]) continue;
			for(ul j = 2;i*j < n;++j) prime_candidate[i*j] = false;
		}
		return prime_candidate;
	}
	ll rho_method(const ll &n)
	{
		auto f = [&](const ll &xi){ return (xi*xi+1)%n; };
		ll x = 2, y = 2, d = 1;
		while(d == 1)
		{
			x = f(x);
			y = f(f(y));
			d = lamlib::gcd(lamlib::abs(x-y),n);
		}
		return d;
	}
	// 素因数分解(試し割)
	std::vector<ll> prime_factorization_trial(const ll &n)
	{
		ll num = n;
		std::vector<ll> prime;
		for(ll i = 2;i*i <= n;++i)
		{
			while((num%i) == 0)
			{
				prime.emplace_back(i);
				num /= i;
			}
		}
		if(num > 1) prime.emplace_back(num);
		return prime;
	}

	/* string */
	inline ul same_char_count(const std::string s,const char &ch){ return std::count(std::cbegin(s),std::cend(s),ch); }
}

// std::cout << std::fixed << std::setprecision(15) << std::endl;

int main(int argc,char *argv[])
{
	ll a,b,c,d;
	std::cin >> a >> b >> c >> d;
	
	const ll lcm = lamlib::lcm(c,d);
	
	const ll n1 = b/c;
	const ll n2 = b/d;
	const ll n3 = b/lcm;
	const ll tmp1 = n1 + n2 - n3;
	std::cerr << n1 << " " << n2 << " " << n3 << std::endl;

	const ll m1 = (a-1)/c;
	const ll m2 = (a-1)/d;
	const ll m3 = (a-1)/lcm;
	const ll tmp2 = m1 + m2 - m3;
	std::cerr << m1 << " " << m2 << " " << m3 << std::endl;

	std::cerr << tmp1 << " " << tmp2 << std::endl;

	const ll ans = (b-a+1) - (tmp1 - tmp2);
	std::cout << ans << std::endl;
	
	return 0;
}

Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		sc.close();
		System.out.println((H-h)*(W-w));

	}

}


Measured memory_bytes: 23508
#include <iostream>
using namespace std;
int main(void){
  int n;
  cin>>n;
  cin.ignore();
  string line;
  string s = "Hoshina";
  while(getline(cin, line)){
    while(line.find("Hoshino")!=string::npos){
      line.replace(line.find("Hoshino"), s.size(), s);
    }
    cout<<line<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
X = int(input())
if 400 <= X  <= 599:
    print("8")
elif 600<= X <=799:
    print("7")
elif 800<= X <=999:
    print("6")
elif 1000<= X <=1199:
    print("5")
elif 1200<= X <=1399:
    print("4")
elif 1400<= X <=1599:
    print("3")
elif 1600<= X <=1799:
    print("2")
elif 1800<= X <= 1999:
    print("1")

Measured memory_bytes: 9188
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

struct edge{
    ll to, cost;
};
vector<vector<edge> > G(100010,vector<edge>(0));
vec score(100010,INF);
vector<bool> pm(100010,false);
ll lb = 1, ub = INF;
bool ng = false;
void detS(int v, ll s, bool plus){
    //plus == true なら s + t, falseなら s - t を書き込む
    score[v] = s;
    pm[v] = plus;
    if(plus){
        lb = max(lb, - s + 1);
    }else{
        ub = min(ub, s);
    }
    for(edge e : G[v]){
        if(ng) break;
        if(score[e.to] == INF){
            detS(e.to, e.cost - s, !plus);
        }else{
            if(plus != pm[e.to] && e.cost - s != score[e.to]){
                ng = true;
            }else if(plus == pm[e.to]){
                if(plus) {
                    lb = max(lb, (e.cost - s - score[e.to] + 1) / 2);
                    ub = min(ub, (e.cost - s - score[e.to] + 2) / 2);
                }else{
                    lb = max(lb, (s + score[e.to] - e.cost + 1) / 2);
                    ub = min(ub, (s + score[e.to] - e.cost + 2) / 2);
                }
            }
        }
    }
    //cout<<v<<' '<<lb<<' '<<ub<<endl;
}

int main(){
    cin>>N>>M;
    rep(i,M){
        cin>>A>>B>>K;
        --A, --B;
        edge e;
        e.to = A;
        e.cost = K;
        G[B].push_back(e);
        e.to = B;
        G[A].push_back(e);
    }
    detS(0, 0, true);
    cout<<(ng ? 0 : max(0LL, ub - lb))<<endl;
    //cout<<ub<<' '<<lb<<endl;
    //rep(i,N) cout<<score[i]<<endl;
}

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

int n,m,k,x=0;
vector<int>to[100010],bl(100010),fr(100010,-1),cnt(100010);

void dfs(int v){
    fr[v]=x;
    for(int u:to[v]){
        if(fr[u]!=-1)continue;
        dfs(u);
    }
}

int main(){
    cin>>n>>m>>k;
    rep(i,m){
        int a,b;
        cin>>a>>b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    rep(i,n){
        if(fr[i]==-1)dfs(i),x++;
    }
    x=0;
    rep(i,k){
        int c,d;
        cin>>c>>d;
        c--; d--;
        if(fr[c]==fr[d])bl[c]++,bl[d]++;
    }
    rep(i,n){
        cnt[fr[i]]++;
    }
    rep(i,n){
        cout<<cnt[fr[i]]-to[i].size()-bl[i]-1<<" ";
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 10288
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<queue>
#include<functional>
#include<limits.h>
#include<string.h>
#include<algorithm> 
using namespace std;

int a[200000];
int w(int a, int b) {
	if (b == 0)return a;
	return w(b, a%b);
}
signed main(){
	int n; cin >> n; n++;
	for (int i = 0; i < n; i++)cin >> a[i];
	sort(a, a + n);
	int k = a[1] - a[0];
	for (int i = 2; i < n; i++) {
		k = w(k, a[i] - a[i - 1]);
	}
	cout << k << endl;
}

Measured memory_bytes: 640
n,a,b,c,d = map(int,input().split())
s = input()
if "##" in s[min(a,b)-1:max(c,d)]:
    print("No")
else:
    if d > c:
        print("Yes")
    else:
        for i in range(b-1,d):
            if s[i-1] == "." and s[i] == "." and s[i+1] == ".":
                print("Yes")
                break
        else:
            print("No")

Measured memory_bytes: 3572
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

template<typename flow_t>
struct Dinic {
    struct Edge {
        int to; flow_t cap; int rev; bool isrev;
        Edge(int t, flow_t c, int r, bool b) : to(t), cap(c), rev(r), isrev(b) { }
    };
    const flow_t INF;
    vector<vector<Edge>> g;
    vector<int> min_cost, iter;
    Dinic(int n) : INF(numeric_limits<flow_t>::max()), g(n) { }
    void add_edge(int from, int to, flow_t cap) {
        g[from].emplace_back(Edge(to, cap, g[to].size(), false));
        g[to].emplace_back(Edge(from, 0, g[from].size() - 1, true));
    }
    bool bfs(int s, int t) {
        min_cost.assign(g.size(), -1); min_cost[s] = 0;
        queue<int> que; que.emplace(s);
        while (!que.empty() && min_cost[t] == -1) {
            int v = que.front(); que.pop();
            for (auto &e: g[v]) if (e.cap > 0 && min_cost[e.to] == -1) {
                min_cost[e.to] = min_cost[v] + 1;
                que.emplace(e.to);
            }
        }
        return min_cost[t] != -1;
    }
    flow_t dfs(int v, int t, flow_t flow) {
        if (v == t) return flow;
        for (int &i = iter[v]; i < (int)g[v].size(); i++) {
            Edge &e = g[v][i];
            if (e.cap > 0 && min_cost[v] < min_cost[e.to]) {
                flow_t d = dfs(e.to, t, min(flow, e.cap));
                if (d > 0) {
                    e.cap -= d, g[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }
    flow_t max_flow(int s, int t) {
        flow_t flow = 0;
        while (bfs(s, t)) {
            iter.assign(g.size(), 0);
            flow_t f = 0;
            while ((f = dfs(s, t, INF)) > 0) flow += f;
        }
        return flow;
    }
    friend ostream& operator<<(ostream& os, Dinic& mf) {
        for (int i = 0; i < (int)mf.g.size(); i++) {
            for (auto &e: mf.g[i]) if (!e.isrev) {
                auto &rev_e = mf.g[e.to][e.rev];
                os << i << " -> " << e.to << " (flow: ";
                os << rev_e.cap << " / " << e.cap + rev_e.cap << ")" << endl;
            }
        }
        return os;
    }
};

int main() {
    int n; cin >> n;
    vector<string> ss(n);
    for (auto &si: ss) cin >> si;
    string ans;
    for (int c = 0; c < 26; c++) {
        Dinic<int> mf(26 + 2);
        int s = 26, t = s + 1;
        int deg_out = 0, deg_in = 0;
        for (auto &si: ss) {
            int u = si.front() - 'a', v = si.back() - 'a';
            if (u == c) u = s, deg_out++;
            if (v == c) v = t, deg_in++;
            mf.add_edge(u, v, 1);
        }
        if (deg_in && mf.max_flow(s, t) == deg_out) ans += 'a' + c;
    }
    for (char c: ans) cout << c << endl;
    return 0;
}



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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;


#define SZ(x) ((int)(x).size())
#define BIT(n) (1ll<<(n))
#define SORT(c) sort((c).begin(),(c).end())
#define RALL(a) (a).rbegin(), (a).rend()
#define ALL(x) (x).begin(),(x).end()
#define PB push_back
#define MP make_pair
#define CLR(a) memset((a), 0 ,sizeof(a))
#define retrun return
#define INF 1000000010ll
#define MOD 1000000007ll
#define REP(i,a,b) for(int i=(a);i<(b);++i)
#define RREP(i,n)  
#define rep(i,n) for(int i=n-1;i>=0;--i)
#define COUT(str) cout << str << endl


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; }
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }

int d;
//------------------------------------------------------------------------------------------------------

int main() {
	cin >> d;

	if (d == 25) printf("Christmas\n");

	else if (d == 24) printf("Christmas Eve\n");

	else if (d == 23) printf("Christmas Eve Eve\n");

	else  printf("Christmas Eve Eve Eve\n");

	return 0;
}


Measured memory_bytes: 256
# https://atcoder.jp/contests/abc139/tasks/abc139_c
# めちゃ簡単では

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

ans = 0
cnt = 0
pre = -1
for h in H:
    if h <= pre:
        cnt += 1
    else:
        cnt = 0
    pre = h
    ans = max(ans, cnt)

print(ans)


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

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

#define M (1000000007)

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

    int n;
    string s;
    cin >> n;
    set<string> ps;

    rep(i, n) {
        cin >> s;
        ps.insert(s);
    }

    cout << ps.size() << endl;

    return 0;
}


Measured memory_bytes: 19288
#include<iostream>
#include<map>
#include<cassert>
#include<cstdlib>
#include<algorithm>
#include<numeric>
#include<vector>
#include<queue>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

const int N = 5;
const int NODE=120;

struct PMA{
  PMA *next[N];
  int ac;
  PMA(){fill(next,next+N,(PMA*)0);ac=0;}
};

map<PMA*,int> M;
PMA *buildPMA(string *in,int size){
  PMA *root=new PMA;
  M[root]=0;
  rep(i,size){
    PMA *t = root;
    rep(j,in[i].size()){
      char c=in[i][j];
      if (t->next[c] == NULL){
	int ind=M.size();
	t->next[c]=new PMA;
	M[t->next[c]]=ind;
      }
      t=t->next[c];
    }
    t->ac++;
  }

  queue<PMA*> Q;
  REP(i,1,N){
    char c=i;
    if (root->next[c]){
      root->next[c]->next[0]=root;
      Q.push(root->next[c]);
    }else root->next[c]=root;
  }

  while(!Q.empty()){
    PMA *t=Q.front();Q.pop();
    REP(c,1,N){
      if (t->next[c]){
	Q.push(t->next[c]);
	PMA *r=t->next[0];
	while(!r->next[c])r=r->next[0];
	t->next[c]->next[0]=r->next[c];
	t->next[c]->ac+=r->next[c]->ac;
      }
    }
  }
  return root;
}

PMA* match(PMA *r,char in){
  while(!r->next[in])r=r->next[0];
  r=r->next[in];
  return r;
}

struct Edge{int dir,node;};
const string dir="DURL";
const int dx[]={0,0,1,-1};
const int dy[]={1,-1,0,0};


vector<Edge> edge[NODE];

void makegraph(PMA *now,PMA* root){
  //rep(i,4){
  REP(i,1,N){
    PMA* next=now;
    next=match(next,i);
    if (next->ac != 0)continue;
    edge[M[now]].push_back((Edge){i-1,M[next]});
  }
}

void travarse(PMA *t,PMA *root){
  makegraph(t,root);
  REP(i,1,N){
    if (t->next[i] != NULL && t->next[i] != root)travarse(t->next[i],root);
  }
}

char m[50][50];
struct st{
  int y,x,node,cost;
};

int cost[50][50][NODE];
int solve(int r,int c,int sy,int sx){
  rep(i,r)rep(j,c)rep(k,M.size())cost[i][j][k]=-1;
  queue<st> Q;
  Q.push((st){sy,sx,0,0});
  cost[sy][sx][0]=0;
  while(!Q.empty()){
    st now=Q.front();Q.pop();
    //cout << now.y <<" " << now.x <<" " << now.node <<" " << now.cost << endl;
    rep(i,edge[now.node].size()){
      int dir=edge[now.node][i].dir;
      int next=edge[now.node][i].node;
      int ney=now.y+dy[dir],nex=now.x+dx[dir];
      if (ney == -1 || nex == -1 || ney == r || nex == c||
	  m[ney][nex] == '#' || cost[ney][nex][next] != -1)continue;
      cost[ney][nex][next]=now.cost+1;
      if (m[ney][nex] == 'G')return now.cost+1;
      Q.push((st){ney,nex,next,now.cost+1});
    }
  }
  return -1;
}

main(){
  int r,c;
  int n;
  string in[10];
  while(cin>>r>>c && r){
    M.clear();
    rep(i,NODE)edge[i].clear();
    rep(i,r)cin>>m[i];
    cin>>n;
    rep(i,n){
      cin>>in[i];
      rep(j,in[i].size()){
	rep(k,dir.size())if (in[i][j] == dir[k])in[i][j]=k+1;
      }
    }
    PMA* root=buildPMA(in,n);
    travarse(root,root);
    int sy,sx;
    rep(i,r)rep(j,c)if (m[i][j] == 'S')sy=i,sx=j;
    cout << solve(r,c,sy,sx) << endl;
  }
  return false;
}

Measured memory_bytes: 2208
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<cstdio>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define P pair<int, int>

int main(){
    int n;
    cin >> n;
    int c[9][9];
    rep(i, 9)rep(j, 9) c[i][j] = 0;
    rep(i, n + 1){
        if(i % 10 == 0) continue; 
        int num = i;
        int s, t;
        t = num % 10;
        while(num >= 10){
            num /= 10;
        }
        s = num;
        s--; t--;
        c[s][t]++;
    }
    int ans = 0;
    rep(i, 9)rep(j, 9) ans += c[i][j] * c[j][i];
    cout << ans << endl;
}


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


int main(void){
    // Your code here
    int N;
    cin >> N;
    vector<int> B(N);
    vector<int> ans(N);
    for(int i = 0; i < N; i++)cin >> B.at(i);
    
    int cnt = 0;
    int l;
    for(int i = 0; i < N; i++){
        l = 0;
        for(int j = 100; j >= 0; j--){
            if(l == 1) continue;
            if(j < B.size() && B.at(j) == j + 1){
                ans.at(cnt) = j + 1;
                B.erase(B.begin() + j);
                cnt++;
                l = 1;
            }
        }
    }
    if(cnt != N){
        cout << -1 << endl;
    }
    else{
        for(int i = 0; i < N; i++){
            cout << ans.at(N-1-i) << endl;
        }
    }
    
    
    
}


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

static long long int ans[10000001];

int main(){
  long long n;
  cin >> n;
  
  for(int i=1;i<=n;i++){
    for(int j=i;j<=n;j+=i){
      ans[j]++;
    }
  }
  
  long long sum = 0;
  for(int i=1;i<=n;i++){
    sum += i * ans[i];
  }
  cout << sum << endl;
}

Measured memory_bytes: 81744
// garnab27
#include <bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define ll int64_t
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
ll modex(ll a,ll b,ll p){ll res=1;a%=p;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b>>=1;}return res;}
int dx[]={1,0,-1,0,1,-1,-1,1};
int dy[]={0,1,0,-1,1,1,-1,-1};
 
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(NULL);cout.tie(NULL);	
 
	int n;
	cin>>n;


	ll sum = 0;


	for(int i=1;i<=n;i++) {
		for(int j=1;j<=n;j++) {
			for(int k=1;k<=n;k++) {
				sum += __gcd(i, __gcd(j, k));
			}
		}
	}

 	cout<<sum;
 
	return 0;
}

Measured memory_bytes: 3648
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<bitset>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long int ll;
typedef pair<int,int> P;
struct edge{int to,cost;};
#define REP(i,n) for(int i=0;i<(n);i++)
const int INF=100000000;

int main(){
	string s;
	char anss;
	static ll k,ans=0,num[10]={},p=0;
	cin>>s>>k;
	REP(i,s.size()){
		if(s[i]!='1'){
			anss=s[i];
			break;
		}
		else{
			p=i+1;
		}
	}
	if(k<=p){
		cout<<1<<endl;
	}
	else{
		cout<<anss<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
from math import ceil

N, K = map(int, input().split())
A = [int(_) for _ in input().split()]
front = A.index(1)
back = N - front - 1

ret = 10000000
for i in range(K):
    ff = front - i
    bb = back - (K - 1 - i)
    if ff >= 0 and bb >= 0:
        ret = min(ret, 1 + ceil(ff/(K-1)) + ceil(bb/(K-1)))
print(ret)

Measured memory_bytes: 13812
#include <stdio.h>

int main(void) {
	int n,m,l;
	int i,j,k;
	int A[101][101];
	int B[101][101];
	long long int C[101][101];
	
	scanf("%d %d %d\n", &n, &m, &l);
	for(i=0;i<n;i++) {
		for(j=0;j<m;j++) {
			scanf("%d", &A[i][j]);
		}
		scanf("\n");
	}

	for(i=0;i<m;i++) {
		for(j=0;j<l;j++) {
			scanf("%d", &B[i][j]);
		}
		scanf("\n");
	}
	
	for(i=0;i<n;i++) {
		for(j=0;j<l;j++) {
			C[i][j] = 0;
			for(k=0;k<m;k++) {
				C[i][j] += (A[i][k]*B[k][j]);
			}
			
			printf("%lld", C[i][j]);
			if(j<l-1) {
				printf(" ");
			}
		}
		printf("\n");
	}
	
	return 0;
}

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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

typedef long long ll;

int main(){
  int A, B;
  cin >> A >> B;

  int ans = 0;
  if(A > B){
    ans += A + A-1;
  }
  else if(A < B){
    ans += B + B-1;
  }
  else{
    ans += A*2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
char t1[1000];
char t2[1000];
char t3[8];
int main(){
    int n;
    int a,b;
    int i,j;
    char t;
    scanf("%s",&t1);
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",&t3);
        if(strcmp(t3,"replace")==0){
            scanf("%d %d %s",&a,&b,&t2);
            for(j=0;j<b-a+1;j++){
                t1[a+j]=t2[j];
            }
        }
        else if(strcmp(t3,"reverse")==0){
            scanf("%d %d",&a,&b);
            for(;a<b;){
                t=t1[a];
                t1[a]=t1[b];
                t1[b]=t;
                a++;
                b--;
            }
        }
        else if(strcmp(t3,"print")==0){
            scanf("%d %d",&a,&b);
            for(j=a;j<b+1;j++){
                printf("%c",t1[j]);
            }
             printf("\n");
        }
    }
    return 0;
}


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

typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	string s;
	cin>>s;

	if(s[0] == '7' ||s[1] == '7' ||s[2] == '7'){
		cout<<"Yes\n";
	}
	else cout<<"No\n";

}


Measured memory_bytes: 3640
class Point
  attr_accessor :x, :y
  def initialize(x = 0.0, y = 0.0)
    @x = x
    @y = y
  end
end

def koch(n, a, b)
  return if n == 0
  s = Point.new
  t = Point.new
  u = Point.new
  th = Math::PI * 60.0 / 180.0

  s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
  s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
  t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
  t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
  u.x = (t.x - s.x) * Math.cos(th) - (t.y - s.y) * Math.sin(th) + s.x
  u.y = (t.x - s.x) * Math.sin(th) + (t.y - s.y) * Math.cos(th) + s.y

  koch(n - 1, a, s)
  printf("%.8f %.8f\n", s.x, s.y)
  koch(n - 1, s, u)
  printf("%.8f %.8f\n", u.x, u.y)
  koch(n - 1, u, t)
  printf("%.8f %.8f\n", t.x, t.y)
  koch(n - 1, t, b)
end

n = gets(chomp:true).to_i
a = Point.new
b = Point.new(100)

printf("%.8f %.8f\n", a.x, a.y)
koch(n, a, b)
printf("%.8f %.8f\n", b.x, b.y)


Measured memory_bytes: 6972
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


print(sum(range(I())))

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

using namespace std;

int A;
int B;
int C;
int X;


int bfs(int n, int a, int b, int c) {
    if (a < 0 || b < 0 || c < 0) return 0;
    if (n == 0) return 1;
    return bfs(n - 500, a - 1, b, c) + bfs(n - 100, a, b - 1, c) + bfs(n - 50, a, b, c - 1);
}


void solve() {
    int num = 0;
    for (int i = 0; i <= A; ++i) {
        for (int j = 0; j <= B; ++j) {
            for (int k = 0; k <= C; ++k) {
                if (500 * i + 100 * j + 50 * k == X) {
                    num++;
                }
            }
        }
    }
    printf("%d\n", num);
}

int main() {
    cin >> A >> B >> C >> X;
    solve();
    return 0;
}

Measured memory_bytes: 3752
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		try {
			int x,y;
			while(scan.hasNext()){
				x=scan.nextInt();
				y=scan.nextInt();
				System.out.println(Integer.toString(x+y).length());
				
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
	}

}

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

#define REP(i, n) for(decltype(n) i = 0; i < n; i++)

#define ALL(c)   c.begin(), c.end()
#define SORT(c)  std::sort(ALL(c))
#define RSORT(c) std::sort(ALL(c), std::greater<decltype(c)::value_type>())

using namespace std;
using ll = long long;

const int MOD  = (int)1e9 + 7;
const int INF  = (int)1e9 + 1;
const ll  LINF = (ll)1e18 + 1;

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

    int N;
    std::cin >> N;

    std::vector<int> P(N);
    REP(i, N) {
        std::cin >> P[i];
    }

    int ans = 0;
    REP(i, N) {
        if(i + 1 == P[i]) {
            ans++;
            swap(P[i], P[i + 1]);
        }
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 640
#include <algorithm>
#include <iostream>
#include <cstring>
#include <iomanip>
#include <cstdlib>
#include <climits>
#include <cstdio>
#include <bitset>
#include <string>
#include <vector>
#include <cctype>
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#include <map>
#include <set>

#define I inline
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define PII pair<int , int>
#define PSL pair<string , long long>
#define PLL pair<long long , long long>
#define all(x) (x).begin() , (x).end()
#define copy(a , b) memcpy(a , b , sizeof(b))
#define clean(a , b) memset(a , b , sizeof(a))
#define rep(i , l , r) for (int i = (l); i <= (r); i ++)
#define per(i , r , l) for (int i = (r); i >= (l); i --)
#define PE(i , x) for(int i = head[x]; i; i = edge[i].last)
#define DEBUG(x) std :: cerr << #x << '=' << x << std :: endl

typedef long long ll;
typedef unsigned long long ull;

template <class T>
inline void read(T &x) {
    char c = getchar(), f = 0; x = 0;
    while (!isdigit(c)) f = (c == '-'), c = getchar();
    while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
    x = f ? -x : x;
}

using namespace std;

const int N = 10001;
const int M = 100001;
const int HA = 998244353;

int d , t , s;

int main() {
    #ifdef LOCAL
        freopen("try.in" , "r" , stdin);
        freopen("try1.out" , "w" , stdout);
    #endif
    read(d) , read(t) , read(s);
    double cnt = (double)d / (double)s;
    //DEBUG(cnt) , DEBUG(t);
    if(cnt > (double)t) puts("No");
    else puts("Yes");

    return 0;
}



Measured memory_bytes: 3516
#include <stdio.h>

int main()
{
	int a, b, c, i;
	int syou, amari, kosuu = 0;

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

	for (i = a; i <= b; i++)
	{
		syou = c / i;
		amari = c - i*syou;
		if (amari == 0)
			kosuu++;

	}
	printf("%d\n", kosuu);
	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <queue>

using namespace std;
static const int N = 100;
static const int INFTY = (1<<21);

int n,M[N][N];
int d[N];

void bfs(int s){
  queue<int> q;
  q.push(s);
  for(int i=0;i<n;i++) d[i] = INFTY;
  d[s] = 0;
  int u;
  while(!q.empty()){
    u = q.front(); q.pop();
    for(int v=0; v<n; v++){
      if(M[u][v] == 0) continue;
      if(d[v] != INFTY) continue;
      d[v] = d[u] + 1;
      q.push(v);
    }
  }
  for(int i=0; i<n; i++){
    cout << i+1 << " " << ((d[i] == INFTY) ? (-1) : d[i]) << endl;
  }
}

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

  cin >> n;
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++)M[i][j] = 0;
  }

  for(int i=0; i<n; i++){
    cin >> u >> k;
    u--;
    for(int j=0; j<k; j++){
      cin >> v;
      v--;
      M[u][v] = 1;
    }
  }

  bfs(0);

  return 0;
}



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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<ld> vld;
typedef vector<string> vstr;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); ++i)
#define TS to_string
#define ALL(v) (v).begin(), (v).end()
#define endl "\n"

ll INF = 1e9;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
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;}     //最小公倍数

void yes(){ cout << "Yes" << endl;}
void no(){ cout << "No" << endl;}

//-----------------------------------------

//-----------------------------------------
int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  ll n;
  cin >> n;
  vector<ll> vec(n);
  REP(i,n) vec[i] = i+1;
  vector<ll> mat(n);
  REP(i,n) cin >> mat[i];

  if(vec == mat){
    REP(i,n){
      if(i) cout << " ";
      cout << vec[i];
    }
    cout << endl;
    bool f = next_permutation(ALL(vec));
    if(!f) return 0;
    REP(i,n){
      if(i) cout << " ";
      cout << vec[i];
    }
    cout << endl;
    return 0;
  }


  while(1){
    vll tmp = vec;
    bool f = next_permutation(ALL(vec));
    if(!f) break;

    if(vec == mat){

       REP(i,n){
        if(i) cout << " ";
        cout << tmp[i];
      }
      cout << endl;

      REP(i,n){
        if(i) cout << " ";
        cout << vec[i];
      }
      cout << endl;

      bool g = next_permutation(ALL(vec));
      if(!g) break;

      REP(i,n){
        if(i) cout << " ";
        cout << vec[i];
      }
      cout << endl;

    }
  }

  return 0;
}




Measured memory_bytes: 3224
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  string A;
  cin >> A;
  
  int size = A.size();
  if(size < 4) {
    cout << "No" << endl;
  }
  else if((A.at(0) == 'Y' && A.at(1) == 'A') && (A.at(2) == 'K' && A.at(3) == 'I')) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (int i=0;i<N;i++)

//変数
int a, b, c, d, e, f;

//解法
void solve() {

	set<double> water, suger;

	double water_max = 0;
	rep(i, f / b + 1) {
		rep(j, f / a + 1) {
			int val = (i * 100 * b + j * 100 * a);
			if (val <= f) {
				water.insert(val);
				if (val > water_max) water_max = val;
			}
			else {
				break;
			}
		}
	}

	rep(i, f / d + 1) {
		rep(j, f / c + 1) {
			int val = (i *d + j * c);
			if (val <= f && water_max / 100 * e >= val) {
				suger.insert(val);
			}
			else {
				break;
			}
		}
	}

	int ans_water = a*100, ans_suger = 0;
	double ans_conc = 0;

	for (auto wat : water) {
		for (auto sug : suger) {

			if ((wat + sug) <= f && (wat / 100 * e) >= sug && wat + sug != 0) {

				double conc = ((double)100 * sug / (wat + sug));
				if (ans_conc <= conc) {
					ans_conc = conc;
					ans_water = wat;
					ans_suger = sug;
				}

			}

		}
	}

	cout << (ans_water + ans_suger) << " " << ans_suger;

	return;
}

int main() {
	//入力
	cin >> a >> b >> c >> d >> e >> f;
	solve();
	cout << endl;
	return 0;
}


Measured memory_bytes: 384
/* abc_165_a */

#include<stdio.h>

int main()
{
  int K,A,B,a,i;
  a=1;
  scanf("%d",&K);
  scanf("%d %d",&A, &B);
  for (i=A;i<=B;i++){
    if (i%K==0){
      a=0;
      break;
    }
  }
  if (a==0) printf("OK\n");
  else printf("NG\n");
  return 0;
}


Measured memory_bytes: 1664
// at_abc147a.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
using namespace std;
int main()
{
	int a, b, c;cin >> a >> b >> c;
	if (a + b + c >= 22)cout << "bust\n";
	else cout << "win\n";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[21][21],ans=0;
int n,d;
void dis(int x,int y) {
	int tot=0;
	for (int i=1;i<=d;i++)	
		tot+=(a[x][i]-a[y][i])*(a[x][i]-a[y][i]);
	double e=sqrt(tot);
	if ((e-floor(e))==0) ans++;
}
int main() {
	cin>>n>>d;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=d;j++)
			cin>>a[i][j];
	for (int i=1;i<=n-1;i++)
		for (int j=i+1;j<=n;j++)
			dis(i,j);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
    using namespace std;
    int main(){
    	int n,m,x;
    	cin>>n>>m>>x;
    	int a[m];
    	for(int i=0;i<m;i++){
    		cin>>a[i];
    	}
    	int tmp,cost=0,j=x;
    	/*if(n/2+1<=x){
    		cout<<"a"<<endl;
    		goal=n;
    		//tmp=abs(goal-x);
    		for(int i=0;i<m;i++){
    			for(int k=0;k<m;k++){
    				if(j==a[k])cost++;
    			}
    			j++;
    		}
    	}else{
    		goal=0;
    		//tmp=abs(goal-x);
    		for(int i=0;i<m;i++){
    			for(int k=0;k<m;k++){
    				if(j==a[k])cost++;
    			}
    			j--;
    		}
    	}*/
    	for(int i=0;i<m;i++){
    		if(x>a[i]){cost++;}else{tmp++;}
    	}
    	cost=min(tmp,cost);
    	if(x==1||x==n-1)cost=0;
    	cout<<cost<<endl;
    }


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>

#define STARTUP {(cin.tie(0));\
 (ios::sync_with_stdio(false));}

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define MAX(list) std::max(list)
#define MIN(list) std::min(list)
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define CINVEC(vec) REP(i,(vec).size()) cin>>(vec)[i];

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
std::istream& operator>>(std::istream& is, std::pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

using ll = long long;
using namespace std;
ll mod = 1'000'000'007;

const int INF = 1'050'000'000;

int main() {
    STARTUP;

    string S;
    cin >> S;
    int left = S.find('A');
    int right = S.rfind('Z');
    cout << right - left + 1 << endl;
    return 0;
}

Measured memory_bytes: 720