akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  double n, k;
  cin >> n >> k;
  vd p(n);
  rep(i, n) cin >> p[i];
  vd e(n + 1);
  e[0] = 0;
  rep(i, n) e[i + 1] = e[i] + (p[i] + 1) / 2;
  double ans = 0;
  rep(i, n - k + 1) ans = max(ans, e[i + k] - e[i]);
  printf("%.12f\n", ans);
}

Measured memory_bytes: 3328
import sys


def countPair(n):
    count = 0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if (i + j + k + l) == n:
                        count += 1
    return count


for line in sys.stdin:
    n = int(line)
    print countPair(n)

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

int main(){
	int n;
	cin >> n;
	
	int q=n, fx=0;
	while(q!=0){
		fx += q%10;
		q /= 10;
	}
	if(n%fx==0){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int ar[5];
    for ( int i=0;i<5;i++) cin >> ar[i];
    for ( int i=0;i<5;i++) {
        if(!ar[i])
        {
            cout << i +1 <<endl;
            return 0;
        }
    }
}


Measured memory_bytes: 3588
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;



int main(){
	int N;
	long long A[200000];
	scanf("%d", &N);
	for(int i=0;i<N;i++){
		scanf("%lld", &A[i]);
	}

	long long ans = 0;
	long long sum = 0;
	long long xsum = 0;
	int r = 0;
	for(int l=0;l<N;l++){
		while(r < N && sum+A[r] == (xsum^A[r])){
			sum += A[r];
			xsum ^= A[r];
			r++;
		}
		ans += r-l;
		sum -= A[l];
		xsum ^= A[l];
	}

	printf("%lld\n", ans);

	return 0;
}


Measured memory_bytes: 1792
n = int(input())
s = input()
#a = list(map(int,input().split()))

if n % 2 != 0 :
    print("No")
else:
    mae = s[0:int(n/2)]
    usi = s[int(n/2):]
    if mae == usi :
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 2940
#include<iostream>
#include<cstdio>
#define db double
using namespace std;

int n;
db x,d,ans,tmp;

int main()
{
	int i,j;
	cin>>n>>d>>x;
	for(;n;n--)
	{
		ans+=(d*2.0+(db)(2*n-1)*x)/2.0;
		tmp=d;
		d+=d/(db)n+5.0*x/(db)(2*n);
		x+=2.0*x/(db)n;
//		cout<<ans<<" "<<d<<" "<<x<<endl;
	}
	printf("%.10f",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define IOS ios_base::sync_with_stdio(false)

using namespace std;

int get(int n){
	int k = 0;
	while(n/(1ll<<k) != 1){
		k++;
	}
	return k;
}

int32_t main(){IOS;
	int h ; cin >> h;
	vector<int>arr(64,1);
	for(int i=1;i<64;i++) arr[i] = 2*arr[i-1];
	int k = get(h);
	int ans = 0;
	for(int i=0;i<=k;i++){
		ans += arr[i];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <time.h>
using namespace std;
#include <math.h>
// to increase precision
// std::cout<<std::fixed;
// 	std::cout<<std::setprecision(6)<<z;
//clock_t tStart = clock();
//printf("Time taken: %.9fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
#define maxn 100000

#define ll long long int



int main(){
	int x;cin>>x;
	int ans=0;
	if(x<=599){
		ans=8;
	}
	else if(x<=799){
		ans=7;
	}
	else if(x<=999){
		ans=6;
	}
	else if(x<=1199){
		ans=5;
	}
	else if(x<=1399){
		ans=4;
	}
	else if(x<=1599){
		ans=3;
	}
	else if(x<=1799){
		ans=2;
	}
	else{
		ans=1;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 3632
/*
Created by Rishu Sahu @ covid 20-20
*/
/*
*****************************************************************
*/

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

#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define pai pair<int,int>
#define pal pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,a,b) for(int i=a;i<=b;i++)
#define ff first 
#define ss second
#define sz(x) (int)x.size()
#define vi vector<int>
#define vl vector<ll>
#define mpl map<ll,ll>
#define mpi map<int,int>
#define pb push_back
#define all(x) x.begin(),x.end()

const int mod = 1e9+7;
const int INF = INT_MAX;

void prime(int &temp,int fa,vi &vec){
    while(temp%fa==0){
        vec.pb(fa);
        temp=temp/fa;
        break;
    }
}

ll  getSum(string str){
    ll sum=0;
    for(int i=0;i<str.length();i++){
        sum+=str[i]-'0';
        sum=(sum%9);
    }
    return sum;
}
void solve(){
     ll sum;
     string str;
     cin>>str;
     sum=getSum(str);
     if(sum%9==0)
     cout<<"Yes";
     else cout<<"No";
     //cout<<sum;
}


int main(){
    /*int t;
    cin>>t;
    while(t--){*/
        solve();
    //}
}

Measured memory_bytes: 3924
#include <stdio.h>

int main(){
  int h,n,i;
  int a[100000];
  scanf("%d %d",&h,&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    h -= a[i];
  }
  if(h<=0){
    printf("Yes");
  } else {
    printf("No");
  }
}

Measured memory_bytes: 512
#define _GLIBCXX_DEBUG
#include"bits/stdc++.h"

using namespace std;

//loops
#define REP(i,n) for(int i=0;i<(ll)(n);i++)
#define REPD(i,n) for(int i=(ll)(n)-1;i>=0;i--)
#define OneToN(i,n) for(int i=1;i<(ll)(n+1);i++)
#define ZeroToN(i,n) for(int i=0;i<(ll)(n+1);i++)
#define AToB(i,a,b) for(int i=a;i<(ll)(b+1);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)

//bitsearch
#define BITSEARCH(bit, n) for (int bit = 0; bit < (1<<n); ++bit)
#define isOne(bit, i) bit & (1<<i)


//arrays
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define add push_back


#define remove_unique(v) v.erase(unique(ALL(v)), v.end())

//pair
#define fir first
#define sec second

//types
#define ll long long
#define vec vector
#define cord2d pair<int,int>
//UNCOMMENT WHEN NEEDED
#define int ll

//input
template <class T> T get(){ T s; cin >> s; return(s);}
#define gi get<int>()
#define gs get<string>()

template <class T> vector<T> getv(int n) { vec<T> v(n); REP(i, n) cin >> v[i]; return v; }
#define gim(n) getv<int>(n)
#define gsm(n) getv<string>(n)

//output
void print(int a){ cout << a << endl; }
void print(string a){ cout << a << endl; }
void print(char a){ cout << a << endl; }
void print(double a){ cout << a << endl; }
void print(double a, int dig){ cout << std::setprecision(dig) << a << endl; }

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

template <class T = int>
void print(vec<T> v){ cout << v << endl; }

template <class T = int>
void print2dVec(vec<vec<T>> v2d){for(vec<T> v: v2d) {print(v);}}

void YesNo1(bool i = true){ return print(i?"Yes":"No"); }
void YESNO2(bool i = true){ return print(i?"YES":"NO"); }

//debug output
#define var_name(var) #var
template <class T> void debug(T &var, int nest = 0, string before = "") { cout << string("          ", nest) << before; print(var); }

//name replacement
#define y0 y0__
#define y1 y1__
#define j0 j0__
#define j1 j1__

//bool lambdas
#define lamb(exp) [](auto i){return exp;}
#define isEven [](int i){return i % 2 == 0;}
#define isOdd [](int i){return i % 2 != 0;}

//constants
const ll INF = 1e18;
const int MOD = 10000007;

//maths
int factorial(int k){ int sum = 1; for (int i = 1; i <= k; ++i) { sum *= i; } return sum; }

void Main() {
    //code here
    int n = gi;
    int sum = 0;
    OneToN(i, n) {
        if(!(i%3 == 0 || i%5 == 0)) {
            sum += i;
        }
    }
    cout << sum << endl;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    Main();
}


Measured memory_bytes: 3656
#include <cstdio>
#include <algorithm>

const int N = 500 + 10;

int n, a[N], x[N], ans[N * N];

inline bool comp(int u, int v) { return x[u] < x[v]; }

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &x[i]), a[i] = i;
  std::sort(a + 1, a + n + 1, comp);
  static bool flag[N * N];
  for (int i = 1; i <= n; ++i) ans[x[i]] = i, flag[x[i]] = true;
  static int p[2 * N], q[2 * N];
  int tot = 0;
  for (int i = 1; i <= n; ++i) p[++tot] = a[i] - 1, q[tot] = a[i];
  for (int i = 1; i <= n; ++i) p[++tot] = n - a[i], q[tot] = a[i];
  for (int i = 1, j = 1; i <= n * n; ++i) {
    if (!ans[i]) {
      while (!p[j]) ++j;
      --p[j];
      ans[i] = q[j];
    }
  }
  static int cnt[N];
  for (int i = 1; i <= n * n; ++i) {
    ++cnt[ans[i]];
    if (flag[i] && cnt[ans[i]] != ans[i]) return puts("No"), 0;
  }
  puts("Yes");
  for (int i = 1; i <= n * n; ++i) printf("%d ", ans[i]);
  return 0;
}


Measured memory_bytes: 2304
#include <stdio.h>
#include <string.h>
 
int main(void)
{
    char s[201],p[101],t[101];
    scanf("%s%s",s,p);
    strcpy(t,s);
    strcat(s,t);
    if(strstr(s,p)==NULL)puts("No");
    else puts("Yes");
    return 0;
}


Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, X, Y;
  int Ap, Bp, Cp;
  cin >> A >> B >> C >> X >> Y;
  Ap = 0; Bp = 0; Cp = 0;

       if(A + B > 2 * C){
       if(X < Y){
       Cp = 2 * X;
          if(B >= 2 * C){
          Cp = Cp + (Y - X) * 2;
          }
          else{
          Bp = Y - X;
          }
       } 
       else{
       Cp = 2 * Y;
          if(A >= 2 * C){
          Cp = Cp + (X - Y) * 2;
          }
          else{
          Ap = X - Y;
          }
       }
    }
    else{
    Ap = X;
    Bp = Y;
    }
    
    cout << Ap * A + Bp * B + Cp * C << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;

typedef long long ll;
typedef short int sh;

const ll inf=0x3f3f3f3f3f3f3f3f;
const int MAX=1<<6|1;
const int mod=1e9+7;

char a[8][8];

int n,m,k;

bool Check(int x,int y)
{
    int ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if(!(x&(1<<i))&&!(y&(1<<j))&&a[i][j]=='#')
                ans++;
        }
    }
    return ans==k;
}

int main()
{
    int ans;
    while(scanf("%d%d%d",&n,&m,&k)!=EOF)
    {
        for(int i=0;i<n;i++)
            scanf("%s",a[i]);
        ans=0;
        for(int i=0;i<(1<<n);i++)
        {
            for(int j=0;j<(1<<m);j++)
            {
                if(Check(i,j))
                {
                    ans++;
                }
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}


Measured memory_bytes: 3228
import java.util.*;
import java.math.*;
import java.math.BigDecimal;

public class Main {

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    BigInteger[] T = new BigInteger[N];
    for (int i=0; i<N; i++){
      T[i] = new BigInteger(sc.nextLine());
    }
    BigInteger tmp = getTest(T);
    System.out.println(tmp);
  }

  public static BigInteger getTest(BigInteger[] T){
    int length = (int) T.length;
    BigInteger tmp = BigInteger.valueOf(1);

    for (int i=0; i < length - 1; i++){
      tmp = lcm(tmp, T[i]);
    }
    tmp = lcm(tmp, T[length - 1]);
    return tmp;
  }

  private static BigInteger gcd(BigInteger m, BigInteger n) {
      if (m.compareTo(n) == -1) return gcd(n, m);
      if (n.compareTo(BigInteger.ZERO) == 0) return m;
      return gcd(n, m.remainder(n));
  }

  private static BigInteger lcm(BigInteger m, BigInteger n) {
      BigInteger out;
      out = n.divide(gcd(m, n));
      out = m.multiply(out);
      return out;
      // return m.multiply(n / gcd(m, n);
  }

}


Measured memory_bytes: 21844
#13
import sys

h,w = map(int,input().split())
s = []
s.append(list("."*(w+2)))
for i in range(h):
    a = "."+input()+"."
    s.append(list(a))
s.append(list("."*(w+2)))


for i in range(1,h+1):
    for j in range(1,w+1):
        check = 0
        if s[i][j] == "#":
            for m in range(i-1,i+2,2):
                if s[m][j] == "#":
                    check +=1
                    break
            if check == 0:
                for n in range(j-1,j+2,2):
                    if s[i][n] == "#":
                        check += 1
                        break
            if check == 0:
                print("No")
                sys.exit()
            
            
            
print("Yes")

Measured memory_bytes: 9000
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>


using namespace std;
string yn(bool a)
{
  if (a){return "Yes";}
  else{return "No";}
}

int main()
{
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  int a;
  int res=10*9;
  for(int i=0;i<n;i++)
  {
    cin>>a;
    int tmp=0;
    while(a%2==0)
    {
      a=a/2;
      tmp++;

    }
    if(tmp<res){res=tmp;}
  }
  cout<<res;

  return 0;
}

Measured memory_bytes: 764
#include <stdio.h>
#define LL long long
int main(){
	LL x,y;
	int i;
	scanf("%lld",&x);
	y=100;
	for(i=1;i<=4000;i++){
		y=y+y*0.01;
		if(y>=x)break;
	}
	printf("%d\n",i);
	return 0;
}

Measured memory_bytes: 3236
import sys
import itertools
import numpy as np
from collections import Counter

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = input()

if N[-1] in list(map(str, [2, 4, 5, 7, 9])):
    print('hon')
    exit()
elif N[-1] in list(map(str, [0, 1, 6, 8])):
    print('pon')
    exit()
else:
    print('bon')


Measured memory_bytes: 27136
#include <stdio.h>
i,j,t,N,f=1,A[100];
int main(void){
    for(scanf("%d",&N);i<N;scanf("%d",&A[i++]));
    for(i=0;f==1;i++){
        f=0;
        for(j=N-1;j>i;j--){
            if(A[j]<A[j-1])A[j]^=A[j-1]^=A[j]^=A[j-1],t++;
            f=1;
        }
    }
    for(i=0;i<N;printf("%d%s",A[i],i==N-1?"\n":" "),i++);
    printf("%d\n",t);
}

Measured memory_bytes: 1844
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)
const int MOD  = int(1e9)+7;


struct mint {
  ll x;
  mint(ll x=0) : x((x%MOD+MOD)%MOD) {}
  mint& operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; }
  mint operator+(const mint a) const { return mint(*this) += a; }
};
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }


const int M = 60;
mint dp[M+1][2][2][2];


int main() {
  ll L, R; cin >> L >> R;
  dp[0][0][0][0] = 1;

  rep(i, M) {
    int Li = L>>(M-1-i)&1; // L の上から i 桁目
    int Ri = R>>(M-1-i)&1; // R の上から i 桁目
    rep(j, 2) rep(l, 2) rep(r, 2) rep(xi, 2) rep(yi, 2) {
      int j2 = j, l2 = l, r2 = r; // 遷移前の状態で初期化

      if (xi > yi) continue; // (xi, yi) = (1, 0) なら無視

      if (!j && (xi < yi)) continue; // (1, 1) が現れる前に (0, 1) が現れたら無視
      if (xi&yi) j2 = 1;             // (1, 1) が現れたら j2 を更新

      // 条件 x ≧ L  の処理
      if (!l && (xi < Li)) continue;
      if (xi > Li) l2 = 1;

      // 条件 y ≦ R の処理
      if (!r && (yi > Ri)) continue;
      if (yi < Ri) r2 = 1;

      dp[i+1][j2][l2][r2] += dp[i][j][l][r]; // 遷移式
    }
  }

  mint ans = 0;
  rep(l, 2) rep(r, 2) ans += dp[M][1][l][r];
  cout << ans << '\n';
}


Measured memory_bytes: 3620
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    h=sum(list(map(int,list(str(N)))))
    YesNo(N%h==0)

if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <numeric>
#include <iomanip>


int main(void) {
	int a, b, c;

	std::cin >> a >> b >> c;

	std::cout << std::min(c, b / a) << std::endl;

	return 0;
}

Measured memory_bytes: 764
#include<iostream>
#include<cmath>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(C)     (C).begin(),(C).end()

typedef long long ll;

//for odd n <= 45?
ll odddp[100][9][2];//odddp[n][rem][put table number 0 or not]
ll solveOdd(int n,int now,int rem,bool isfirst){
  if (rem == 0 && now == n+1 && isfirst)return 0;//special case
  if (rem == 0)return 1;
  if (now >= n)return 0;
  if (odddp[now][rem][isfirst] != -1)return odddp[now][rem][isfirst];
  ll ret = 0;
  REP(i,now,n){
    ret+=solveOdd(n,i+2,rem-1,isfirst|(i==0));
  }
  return odddp[now][rem][isfirst] = ret;
}


ll evendp[100][9][4][4];//evendp[n][rem][(putn/2)|(put0)][(put n/2+i+1|(put i+1)]
bool test[100]={false};

ll solveEven(int n,int now,int rem,int isfirst,int lastput){
  if (now == n/2 && rem == 0 && isfirst == 2 && lastput == 1)return 0;
  if (now == n/2 && rem == 0 && isfirst == 1 && lastput == 2)return 0;
  
  if (rem == 0){
    return 1;
  }

  if (now == n/2)return 0;

  if (evendp[now][rem][isfirst][lastput] != -1)
    return evendp[now][rem][isfirst][lastput];
  
  ll ret = 0;
  
  if (now == 0){
    ret+=solveEven(n,now+1,rem-1,1,1);
    ret+=solveEven(n,now+1,rem-1,2,2);
  }else {
    if (lastput == 2){
      ret+=solveEven(n,now+1,rem-1,isfirst,1);
    }else if (lastput == 1){
      ret+=solveEven(n,now+1,rem-1,isfirst,2);
    }
  }

  REP(i,now+1,n/2){
    ret+=solveEven(n,i+1,rem-1,isfirst,1);
    ret+=solveEven(n,i+1,rem-1,isfirst,2);
  }
  
  return evendp[now][rem][isfirst][lastput] = ret;
}


main(){
  ll mult = 40320;
  int n;
  while(cin>>n && n){
    if( n <= 16){
      cout << 0 << endl;
      continue;
    }
    if (n%2 == 0){
      rep(i,100)rep(j,9)rep(k,4)rep(l,4)evendp[i][j][k][l]=-1;
      cout << mult*solveEven(n,0,8,0,0) << endl;
    }else {
      rep(i,100)rep(j,9)rep(k,2)odddp[i][j][k]=-1;
      cout << mult*solveOdd(n,0,8,false) << endl;
    }
  }

}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

int main()
{
    string s, ans = "CODEFESTIVAL2016";
    cin >> s;
    int cnt = 0;
    rep(i, s.length())
    {
        if (s[i] != ans[i])
            cnt++;
    }
    cout << cnt << endl;
    return 0;
}


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

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

int main() {
  int n;
  cin>>n;
  
  set <string> st;
 rep(i,n){
   string s;
   cin>>s;
   st.insert(s);
 }
  cout <<st.size()<<endl;

}

Measured memory_bytes: 19256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int n;
vector<int> g[200020];
int s[200020];
bool used[200020];
void dfs(int x){
	used[x]=1;
	for(auto y:g[x]){
		if(used[y]) continue;
		s[y]+=s[x];
		dfs(y);
	}
}
int main()
{
	int q;
	cin>>n>>q;
	for(int i=0; i<n-1; i++){
		int a, b; cin>>a>>b; a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	for(int i=0; i<q; i++){
		int p, x; cin>>p>>x;
		p--;
		s[p]+=x;
	}
	dfs(0);
	for(int i=0; i<n; i++){
		cout<<s[i]<<" ";
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 20608
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//　ceil(a/b)   (a + (b - 1))/ b
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1000000007;
const int mod=1000000007;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

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

int a[1000010];
int b[1000010];


int main(){
  int n;
  cin >> n;
  rep(i,n){
    int num;
    cin >> num;
    if(i%2 == 0) a[num]++;
    else b[num]++;
  }
  int ans = 0;
  int aM = 0; int bM = 0;
  int aidx;
  int bidx;
  rep(i,1000010){
    if(aM <= a[i]){
      aM = a[i];
      aidx = i;
    }
  }
  rep(i,1000010){
    if(bM < b[i]){
      bM = b[i];
      bidx = i;
    }
  }
  sort(a,a+1000010,greater<int>());
  sort(b,b+1000010,greater<int>());
  int sum = 0;
  rep(i,1000010) sum += (a[i] + b[i]);
  if(aidx != bidx) ans = sum - a[0] - b[0];
  else{
    ans = min(sum-a[0]-b[1],sum-a[1]-b[0]);
  }
  
  cout << ans << endl;
}



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

int n, a[100];

int main() {
    cin >> n;
    double ave = 0;
    rep(i, n) {
        cin >> a[i];
        ave += a[i];
    }
    ave /= n;

    int mini = -1;
    double Min = 1000000;
    rep(i, n) {
        double num = abs(a[i] - ave);
        if (num < Min) {
            Min = num;
            mini = i;
        }
    }
    cout << mini << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int A = sc.nextInt();
	    int B = sc.nextInt();
	    
	    if (A < 10 && B < 10) {
	    	System.out.println(A * B);
	    } else {
	    	System.out.println(-1);
	    }
	}	
}	

Measured memory_bytes: 22740
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

res = 0
for i in range(N):
    b = B[i]
    if A[i] > b:
        res += b
        A[i] -= b
    elif A[i] + A[i+1] > b:
        res += b
        A[i+1] -= (b - A[i])
        A[i] = 0
    else:
        res += A[i] + A[i+1]
        A[i] = 0
        A[i+1] = 0
print(res)


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

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    bool ans = false;
    rep(i, n + 1) {
        repl(j, i, n + 1) {
            string t = s.substr(0, i) + s.substr(j);
            if(t == "keyence") ans = true;
        }
    }
    if(ans) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
x,n = map(int, input().split())
v = list(map(int, input().split()))

if x not in v:
    print(x)
    exit()

for i in range(1,101):
    if (x - i) not in v:
        print(x-i)
        exit()
    elif (x + i) not in v:
        print(x+i)
        exit()


Measured memory_bytes: 9180
S=input()
A=[0]*26
N=len(S)
a=ord('a')
ans=0
for i in range(N):
    t=ord(S[i])-a
    A[t]+=1
for t in range(26):
    ans+=(A[t]*(A[t]+1))//2
print((N*(N+1))//2 - ans +1)

Measured memory_bytes: 40176
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  string s;
  int p;
  map<string,vector<int> > m;
  while(cin>>s>>p,!cin.eof())m[s].push_back(p);
  map<string,vector<int> >::iterator m_it = m.begin();
  while(m_it!=m.end()){
    cout<<(*m_it).first<<endl;
    vector<int> v = (*m_it).second;
    sort(v.begin(),v.end());
    vector<int>::iterator v_it = v.begin();
    while(v_it!=v.end())cout<<*v_it,v_it++,v_it==v.end()?cout<<endl:cout<<" ";
    m_it++;
  }
  return 0;
}

Measured memory_bytes: 0
_,_=gets.split.map(&:to_i)
a=gets.split.map(&:to_i).sort
b=$<.map{|s|s.split.map(&:to_i)}.sort {|aa, bb| bb[1] <=> aa[1] }
i = 0
z = false
b.each do |e|
    e[0].times do
        break if a[i] == nil
        if a[i] < e[1]
            a[i] = e[1] 
        else
            z=true
        end
        break if z
        i += 1
    end
    break if z
end
p a.inject(:+)

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

const int N = 4e3 + 7, M = 2e5 + 7;
int mod = 1e9 + 7;
int n;
int a[M], b[M];
long long dp[N][N];
long long fac[M];

long long power(long long a, long long b) {
	if (b == 0)
		return 1;
	long long t = power(a, b / 2);
	t = (t * t) % mod;
	if (b % 2)
		t = (t * a) % mod;
	return t;
}

long long chs(long long a, long long b) {
	long long t = fac[b];
	t = (t * power(fac[a], mod - 2)) % mod;
	t = (t * power(fac[b - a], mod - 2)) % mod;
	return t;
}

int main() {
	fac[0] = 1;
	for (long long i = 1; i < M; i++)
		fac[i] = (i * fac[i - 1]) % mod;
	int m = 2002;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i] >> b[i];
		dp[m - a[i]][m - b[i]]++;
		dp[m + a[i]][m + b[i]]--;
	}
	long long res = 0;
	for (int i = 1; i < N; i++) {
		for (int j = 1; j < N; j++) {
			if (dp[i][j] < 0) {
				res = (res + (-1 * dp[i][j]) * (dp[i - 1][j] + dp[i][j - 1])) % mod;
				dp[i][j] = 0;
			}
			dp[i][j] = (dp[i][j] + dp[i - 1][j] + dp[i][j - 1]) % mod;
		}
	}
	for (int i = 1; i <= n; i++) {
		res = (res - chs(2 * a[i], 2 * (a[i] + b[i]))) % mod;
		res += mod;
		res %= mod;
	}
	res = (res * power(2, mod - 2)) % mod;
	cout << res;
	return 0;
}



Measured memory_bytes: 128768
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repb(i, n) for (int i = (n-1); i >= 0; i--)
#define rea(i, a, b) for (int i = (a); i < (b); i++)
#define reab(i, a, b) for (int i = (a)-1; i >= (b); i--)
#define ALL(a) (a).begin(),(a).end()
#define SZ(x) ((int)(x).size())
#define PRINT(V) for (auto v:(V)) {cerr << v << " ";} cerr << endl
#define dump(x) cerr << #x << " : " << (x) << endl
#define dump2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
inline ll GCD(ll a, ll b){return b ? GCD(b, a % b) : a;}
const int MOD = 1000000007;
/* END OF TEMPLATE */

int main(){
    int n;
    cin >> n;
    vector<tuple<string, int, int>> sh;
    rep(i, n){
        string a;
        int b;
        cin >> a >> b;
        b = 100 - b;
        sh.emplace_back(a, b, i+1);
    }
    sort(ALL(sh));
    rep(i, n){
        cout << get<2>(sh[i]) << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int* height;
int* calc_parent;
int* relative_weight;

struct Info{
	void set(int arg_parent_id,int arg_weight_sum){
		parent_id = arg_parent_id;
		weight_sum = arg_weight_sum;
	}
	int parent_id,weight_sum;
};

Info find_parent_and_calc_weight(int id){
	if(calc_parent[id] == id){
		Info ret;
		ret.set(id,0);
		return ret;
	}
	else{
		Info ret = find_parent_and_calc_weight(calc_parent[id]);
		calc_parent[id] = ret.parent_id;
		relative_weight[id] += ret.weight_sum;
		ret.weight_sum = relative_weight[id];

		return ret;
	}
}


void unite(int a,int b,int w){

	Info a_info = find_parent_and_calc_weight(a);
	Info b_info = find_parent_and_calc_weight(b);

	if(a_info.parent_id == b_info.parent_id)return;

	if(height[a_info.parent_id] == height[b_info.parent_id]){

		relative_weight[b_info.parent_id] = w-(relative_weight[b]-relative_weight[a]);
		calc_parent[b_info.parent_id] = a_info.parent_id;

	}else if(height[a_info.parent_id] == height[b_info.parent_id]){
		relative_weight[b_info.parent_id] = w-(relative_weight[b]-relative_weight[a]);
		calc_parent[b_info.parent_id] = a_info.parent_id;
		height[a_info.parent_id]++;
	}else{

		relative_weight[a_info.parent_id] = (relative_weight[b]-relative_weight[a])-w;
		calc_parent[a_info.parent_id] = b_info.parent_id;
	}
}

bool isSame(int a,int b){
	Info left = find_parent_and_calc_weight(a);
	Info right = find_parent_and_calc_weight(b);

	return left.parent_id == right.parent_id;
}

int main(){

	int N,M,a,b,w;
	height = new int[100001];
	calc_parent = new int[100001];
	relative_weight = new int[100001];
	char command[2];

	while(true){
		scanf("%d %d",&N,&M);
		if(N == 0 && M == 0)break;

		for(int i = 0; i <= N; i++){
			height[i] = 0;
			calc_parent[i] = i;
			relative_weight[i] = 0;
		}

		for(int loop = 0; loop < M; loop++){
			scanf("%s %d %d",command,&a,&b);
			if(command[0] == '!'){
				scanf("%d",&w);
				unite(a,b,w);
			}else{
				if(!isSame(a,b)){
					printf("UNKNOWN\n");
				}else{
					printf("%d\n",relative_weight[b]-relative_weight[a]);
				}
			}
		}
	}

	return 0;
}

Measured memory_bytes: 5860
alice=0
bob=0
n=int(input())
a=list(map(int,input().split()))
def delete():
    del a[a.index(Max)]
while n>=1:
    Max=max(a)
    alice=alice+Max
    n=n-1
    delete()
    if n>=1:
        Max=max(a)
        bob=bob+Max
        n=n-1
        delete()
else:
    print(alice-bob)



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

public class Main {
	static int n;
	static ArrayList<ArrayList<Integer>> edge;
	static boolean used[];

	static boolean flag = false;
	static int ans;

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		n = Integer.parseInt(br.readLine());
		String str[] = br.readLine().split(" ");

		int a[] = new int[n];
		int min = Integer.MAX_VALUE;

		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(str[i]);

		}

		int ans = 0;

		for (int i = 0; i < n; i++) {
			min = Math.min(a[i], min);

			if (min < a[i]) {

			} else {
				ans++;
			}
		}

		System.out.println(ans);
	}
}

Measured memory_bytes: 49620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload4(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)
#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl


int main(){
    int n,x;
    cin>>n>>x;
    vi a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(all(a));
    int ans=0;
    for(int i=0;i<sz(a);i++){
        if(a[i]<=x){
            x-=a[i];
            ans++;
        }else{
            if(x){
                ans++;
            }
            break;
        }
    }
    if(x)ans--;
    cout<<ans<<endl;
    
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
import java.io.*;
 
public class Main {
    static class Fast {
        BufferedReader br;
        StringTokenizer st;
 
        public Fast() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
static int arr[];
    public static void main(String args[]) throws Exception {
        Fast in = new Fast();
        int n = in.nextInt();
        int a = in.nextInt(), b = in.nextInt();
        for (int i = 0; i < (int)1e6; i++) {
            if(a+1==b){
                if(a-1==0){
                    System.out.println("Borys");
                    return;
                }else {
                    a--;
                }
            }else {
                a++;
            }
            if(b-1==a){
                if(b+1==n+1){
                    System.out.println("Alice");
                    return;
                }else {
                    b++;
                }
            }else{
                b--;
            }
        }
        System.out.println("Draw");
    }
}
 
 
 
 

Measured memory_bytes: 22484
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define pi (acos(-1))


int main()
{
    int a;
    std::cin >> a;
    std::cout << a + std::pow(a, 2) + std::pow(a, 3) << std::endl;

    return 0;
}

Measured memory_bytes: 4224
package main
import (
  "fmt"
  "math"
)
func main() {
  var n,r,s int64
  fmt.Scan(&n)
  r = lim(n)
  if n == r*(r+1) { r-- }
  for v:=r;v>0;v-- {
    if n%v != 0 { continue }
    s += n/v-1
  }
  fmt.Println(s)
}
func lim(n int64) int64 {
  return int64(0.5*(math.Sqrt(float64(4*n+1))-1))
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include <algorithm>
using namespace std;
int main()
{
	int N;
	cin >> N;
	vector<int> V(N), C(N);
		
	for(int i=0; i<N; i++){
		cin >> V.at(i);
	}

	for(int i=0; i<N; i++){
		cin >> C.at(i);
	}
	
	int sum=0;

	for(int i=0; i<N; i++){
		if(V.at(i)>C.at(i)){
			sum = sum + V.at(i) - C.at(i);	
		}
	}
	
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) (a).begin(),(a).end()
#define print(A,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i];}cout<<endl;
#define pprint(A,m,n) rep(j,0,m){print(A[j],n);}
const long mod=1e9+7;
const int size=1e6;
const int inf=1e9;
int main(){
	int N,K;cin>>N>>K;
	int R,S,P;cin>>R>>S>>P;
	string t;cin>>t;
	map<char,char> ch;
	ch['r']='p';ch['s']='r';ch['p']='s';
	char hand[N];int sum=0;
	rep(i,0,K){
		hand[i]=ch[t[i]];
        if(hand[i]=='r') sum+=R;
        if(hand[i]=='s') sum+=S;
        if(hand[i]=='p') sum+=P;
	}rep(i,K,N){
		if(hand[i-K]==ch[t[i]]) hand[i]='a';
		else{
            hand[i]=ch[t[i]];
            if(hand[i]=='r') sum+=R;
            if(hand[i]=='s') sum+=S;
            if(hand[i]=='p') sum+=P;
        }
	}cout<<sum<<endl;
}

Measured memory_bytes: 512
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
//using ll=long long;
#define int long long
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279; //円周率
/*---------------------便利な関数--------------------------------------*/
int fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
 
int gcd(int a, int b) {        //最大公約数
    if (b == 0) return a;
    return gcd(b, a % b);
}
 
int lcm(int a, int b) {      //最小公倍数
    return a * b / gcd(a, b);
}
 
int keta(int n) {        //桁数を求める
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
 
int ketasum(int n) {    //各桁の和
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
//最小化問題(DP)
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
//最大化問題(DP)
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//dp注意点
//問題の種類	 初期化する値	 備考
//最小化問題 	INF	
//最大化問題	    -INF	 テーブル全体で 00 以上の値しかとらないことがわかっていれば −1−1 でもいいですし、00 でもいい場合もあります
//数え上げ問題	00	
//確率問題	      00	
//Yes/No 判定問題	False
/*-------------ここまで---------------------------------------------*/
 
signed main(){
  string s,t;
  int a,b;
  string u;
  cin>>s>>t>>a>>b>>u;
  if(s==u) cout<<a-1<<" "<<b<<endl;
  else cout<<a<<" "<<b-1<<endl;
  return 0;
}

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



int main(){
    ll K,S;
    cin >> K >> S;
    ll ans = 0;

    for(int i = 0; i <= K; i++){
        for(int j = 0; j <= K; j++){
            int k = S - i - j;
            if(0 <= k && k <= K){
                ans++ ;
            }
        }
    }
    
    cout << ans << endl;
}


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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int N = Integer.parseInt(br.readLine());
    String[] tmp = br.readLine().split(" ");
    int[] height = new int[N];
    
    for (int i = 0; i < N; i++) {
      height[i] = Integer.parseInt(tmp[i]);
    }
    
    int count = 1;
    boolean f = true;
    for (int i = 1; i < N; i++) {
      for (int j = 0; j < i; j++) {
        if (height[j] > height[i]) {
          f = false;
        }
      }
      if (f) {
        count++;
      }
      f = true;
    }
    System.out.println(count);
  }
}

Measured memory_bytes: 21204
N = int(input())
A = list(map(int, input().split()))

left = -10**10
right = 10**10

def get_score(b):
    score = 0
    for i in range(N):
        score += abs(A[i]-b-i)
    return score

while(right > left + 1):
    mid = (left+right) // 2
    if get_score(mid+1) - get_score(mid) < 0:
        left = mid
    else:
        right = mid

print(get_score(right))
        

Measured memory_bytes: 86612
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define dd double
#define fi first
#define se second
#define reverse(x) reverse(x.begin(),x.end())
#define sortsi(x) sort(x.begin(),x.end())
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<string> vs;
int MAX = 1e9 + 7; 

template <class T>
void print(vector<T>&v){
    for(int i=0;i<v.size();i++){
        cout<<v[i]<<" ";
    }
    cout<<endl;
}
 
template <class T>
void print(vector<vector<T>>&v){
    for(int i=0;i<v.size();i++){
       for(int j=0;j<v[i].size();j++)cout<<v[i][j]<<" ";
       cout<<endl;
    }
    cout<<endl;
}
 
template <class T>
void read(vector<T>&v,int total){
    for(int i=0;i<total;i++){
        T x;
        cin>>x;
        v.push_back(x);
    }
}
 
template <class T>
void read(vector<vector<T>>&v,int row,int col){
    for(int i=0;i<row;i++){
        vector<T> m;
        for(int j=0;j<col;j++){
            T x;
            cin>>x;
            m.push_back(x);
        }
        v.push_back(m);
    }
}
 


 

void solve(){
    dd d,t,s;
    cin>>d>>t>>s;
    if(t>=d/s){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

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


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#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++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const ll inf=1e9+7;
const ll INF=1e18;

int main(){
    int n,q;cin>>n>>q;
    int S,T,X;
    vector<tuple<int,int,int>> ban(n);
    rep(i,n){
        cin>>S>>T>>X;
        ban[i]=make_tuple(X,S-X,T-X);
    }
    sort(all(ban));
    vin d(q);
    map<int,int> num;
    set<int> time;
    rep(i,q){
        cin>>d[i];
        num[d[i]]=i;
        time.insert(d[i]);
    }
    time.insert(inf);
    vin ans(q,-1);
    //s<=d<tなるdをxが小さい順に見つけていく
    queue<int> que;
    int x,s,t,m,M,start,end;
    rep(i,n){
        if(time.size()==1)break;
        x=get<0>(ban[i]);
        s=get<1>(ban[i]);
        t=get<2>(ban[i]);
        //m=*(time.lower_bound(0));
        //M=*(--time.lower_bound(inf));
        //if(M<s||t<=m)continue;
        auto l=time.lower_bound(s);
        auto r=time.lower_bound(t);
        for(auto itr=l;itr!=r;itr++){
            ans[num[*itr]]=x;
            que.push(*itr);
        }
        while(que.size()){
            time.erase(que.front());
            que.pop();
        }
    }
    rep(i,q)cout<<ans[i]<<endl;
}

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

int main(){
    int n;
    cin >> n;
    int ans=0;
    map<char,int> mp;
    rep(i,n){
        char s;
        cin >> s;
        mp[s]++;
    }
    for(auto &p:mp){
        if(p.second!=0) ans++;
    }
    if(ans==3) cout << "Three" <<endl;
    else cout << "Four" <<endl;
    return 0;
}

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

int main() {
  int N;
  int A;
  cin >> N >> A;
  int B;
  B = N%500;
  if (B <= A){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n+1];
	for(int i=1;i<=n;i++)
	cin>>a[i];
	int dp[n+1];
	 dp[1]=0;
	 dp[2]=abs(a[1]-a[2]);
    for(int i = 3; i <= n; i++){
        
            dp[i] = min(dp[i-1] + abs (a[i] - a[i-1]), dp[i-2] + abs(a[i] - a[i-2]));
    }
	cout<<dp[n]<<endl;
}

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

using namespace std;
using ll = long long int;

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

    ll q, h, s, d;
    cin >> q >> h >> s >> d;
    ll n;
    cin >> n;
    h = min(2*q, h);
    s = min(2*h, s);
    d = min(2*s, d);
    cout << (n/2*d + (n&1)*s) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<climits>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<functional>
#include <numeric>
#define FORi(N) for(int i=0;i<N;++i)
using namespace std;
using ll = long long;
ll gcd(ll m,ll n){
  if(n==0)return abs(m);
  return(gcd(n,m%n));
}
int main(){
  ll N,K;
  cin>>N>>K;
  ll num=0;
  if(K%2==0){
    ll tmp=0;
    for(ll i=K/2;i<=N;i+=K)tmp++;
    if(tmp!=0)num+=pow(tmp,3);
  }
  {
    ll tmp=0;
    for(ll i=K;i<=N;i+=K)tmp++;
  	if(tmp!=0)num+=pow(tmp,3);
  }
  cout<<num<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

ll solve(ll n, ll digit, ll now, bool bthree, bool bfive, bool bseven) {
    if (n >= now) {
        ll three = solve(n, digit * 10LL, 3LL * digit + now, true, bfive, bseven);
        ll five = solve(n, digit * 10LL, 5LL * digit + now, bthree, true, bseven);
        ll seven = solve(n, digit * 10LL, 7LL * digit + now, bthree, bfive, true);

        // cout << now << " " << three + five + seven << endl;

        if (bthree && bfive && bseven) {
            return (1 + three + five + seven);
        } else {
            return (0 + three + five + seven);
        }
    } else {
        return 0;
    }
}

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

    ll n;
    cin >> n;

    cout << solve(n, 1LL, 0LL, false, false, false) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)

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

int main(){
	long long A,B,C,D;
	cin>>A>>B>>C>>D;
	A--;
	long long x = A-(A/C+A/D-A/lcm(C,D));
	long long y = B-(B/C+B/D-B/lcm(C,D));
	cout<<y-x<<endl;
	
	return 0;
}


Measured memory_bytes: 256
/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/

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

const int mx=1e5+5;
int ara[mx];
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int i,n,ans=0;
    cin>>n;
    for (i=1;i<=n;i++) cin>>ara[i];
    for (i=1;i<=n;i++) if (i==ara[i]) {
        if (i!=n) {swap(ara[i],ara[i+1]); ans++;}
        else {swap(ara[i],ara[i-1]); ans++;}
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Linq;

public class AtCoderB
{
    static void Main()
    {
        int[,] card = new int[3, 3];
        {
            for (int i = 0; i < 3; i++)
            {
                var line = Console.ReadLine();
                var words = line.Split(' ');
                for (int j = 0; j < 3; j++)
                {
                    card[i, j] = int.Parse(words[j]);
                }
            }
        }

        int n = int.Parse(Console.ReadLine());

        bool[,] check = new bool[3, 3];

        for (int i = 0; i < n; i++)
        {
            int num = int.Parse(Console.ReadLine());
            for (int j = 0; j < 3; j++)
            {
                for (int k = 0; k < 3; k++)
                {
                    if (num == card[j, k])
                    {
                        check[j, k] = true;
                    }
                }
            }
        }

        bool answer = false;

        for (int i = 0; i < 3; i++)
        {
            if (check[i, 0] && check[i, 1] && check[i, 2])
            {
                answer = true;
            }
            if (check[0, i] && check[1, i] && check[2, i])
            {
                answer = true;
            }
        }
        if (check[0, 0] && check[1, 1] && check[2, 2])
        {
            answer = true;
        }
        if (check[2, 0] && check[1, 1] && check[0, 2])
        {
            answer = true;
        }

        Console.WriteLine(answer ? "Yes" : "No");
    }
}

Measured memory_bytes: 13140