akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;

int main(){

    long long A,B,C;
    vector<long long> tes(3);

    for(auto &xc:tes){
        cin>>xc;
    }

    sort(tes.begin(),tes.end());


    if(tes[2]==tes[0]&&tes[0]==tes[1]){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }



}

Measured memory_bytes: 256
N = int(input())
H = list(map(int,input().split()))
ans = 0
now = H[0]
c=0
for i in range(1,N):
    if now>=H[i]:
        c += 1
    else:
        ans = max(ans,c)
        c=0
    now = H[i]
print(max(ans,c))

Measured memory_bytes: 14224
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

count = 0
for i in range(n):
    if A[i] < B[i]:
        count += A[i]
        B[i] -= A[i]
        A[i] = 0
    else:
        count += B[i]
        A[i] -= B[i]
        B[i] = 0
    if B[i]:
        if A[i+1] < B[i]:
            count += A[i+1]
            B[i] -= A[i+1]
            A[i+1] = 0
        else:
            count += B[i]
            A[i+1] -= B[i]
            B[i] = 0

print(count)


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

int main(){
  int n;
  cin >> n;
  vector<int> ans(4);
  rep(i, n) {
    string s;
    cin >> s;
    if (s == "AC") ans[0]++;
    if (s == "WA") ans[1]++;
    if (s == "TLE") ans[2]++;
    if (s == "RE") ans[3]++;
  }
  cout << "AC x " << ans[0] << endl;
  cout << "WA x " << ans[1] << endl;
  cout << "TLE x " << ans[2] << endl;
  cout << "RE x " << ans[3] << endl;  
}

Measured memory_bytes: 3632
#pragma GCC target("avx")
//#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define DB double
#define ST string
#define BS bitset
#define PA pair<LL,LL>
#define VE vector
#define VL vector<LL>
#define VP vector<pair<LL,LL>>
#define VVL vector<vector<LL>>
#define PQ priority_queue
#define PQS priority_queue<LL,vector<LL>,greater<LL>>
#define PB push_back
#define POB pop_back
#define PF push_front
#define POF pop_front
#define EB emplace_back
#define TS to_string
#define TU to_ullong
#define BPL __builtin_popcountll
#define FOR(i,a,n) for(i=a;i<n;i++)
#define FORR(i,a,n) for(i=n-1;i>=a;i--)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) FORR(i,0,n)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define UB(a,n) *upper_bound(ALL(a),n)
#define LB(a,n) *lower_bound(ALL(a),n)
#define INF 1145141919810364364
#define PI 3.14159265358979
#define MOD 1000000007
//#define MOD 998244353
#define ERR 0.00000001
#define NUM 200010
#define FAST cin.tie(0);ios::sync_with_stdio(false)

void Yn(LL a){if(a)printf("Yes\n");else printf("No\n");}
void YN(LL a){if(a)printf("YES\n");else printf("NO\n");}
LL pwmn(LL a,LL n){LL ans=1;while(ans<a)ans*=n;return ans;}
LL dig(LL n){LL ret=0;while(n)n/=10,ret++;return ret;}
LL LBn(VL &v,LL a){LL mx=v.size(),mn=-1,md;while(mx-mn>1){md=(mx+mn)/2;if(v[md]<a)mn=md;else mx=md;}return mx;}
LL GCD(LL a,LL b){LL c=1,tmp=max(a,b);b=min(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
LL LCM(LL a,LL b){return a*b/GCD(a,b);}
int lcmp(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return 1;if(*(LL*)a<*(LL*)b)return -1;return 0;}
int lcmpr(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return -1;if(*(LL*)a<*(LL*)b)return 1;return 0;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int ccmpr(const void* a,const void* b){return *(char*)b-*(char*)a;}
int scmp(const void* a,const void* b){return strcmp((char*)a,(char*)b);}
int scmpr(const void* a,const void* b){return strcmp((char*)b,(char*)a);}
LL mod(LL a,LL m){if(a%m<0)return a%m+abs(m);else return a%m;}
LL DIV(LL a,LL d){LL m=MOD,x=1,y=0,k;while(m){k=d/m;d-=k*m;swap(m,d);x-=k*y;swap(x,y);}return mod(a*mod(x,MOD),MOD);}
LL POW(LL a,LL n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return ans;}
LL fact[NUM],finv[NUM],inv[NUM];
void comi(){LL i;fact[0]=fact[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fact[i]=fact[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
LL com(LL n,LL k){if(n<k||n<0||k<0)return 0;return fact[n]*(finv[k]*finv[n-k]%MOD)%MOD;}
bool cmps(pair<LL,LL> a,pair<LL,LL> b){if(a.second!=b.second)return a.second<b.second;return a.first<b.first;}
template<typename T>bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}

int main(){
  FAST;
  LL i,ans=0,N;
  cin>>N;
	if(N%2==0)N--;

  cout<<N/2<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int mod;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    (x += a.x) %= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    (x += mod-a.x) %= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};

ll b, ten;

mint pow_(mint x, ll t) {
  if (t == 0) return 1;
  if (t%2 == 1) {
    return pow_(x,t-1)*x;

  } else {
    mint y = pow_(x,t/2);

    return y*y;
  }
}

mint f(ll l) {
  if (l == 0) return 0;
  if (l%2 == 1) {
    ll pl = l-1;
    mint x = f(pl);
    return x*ten + 1;
  } else {
    ll pl = l/2;
    mint x = f(pl);
    return x*pow_(ten, pl) + x;
  }
}
mint g(ll l) {
  if (l == 0) return 0;
  if (l%2 == 1) {
    ll pl = l-1;
    mint x = g(pl);
    return x*ten + mint(b)*pl;
  } else {
    ll pl = l/2;
    mint x = g(pl);
    return x*pow_(ten, pl) + x + mint(b)*pl*f(pl);
  }
}

int main() {
  ll L, a;
  cin >> L >> a >> b >> mod;
  ll last = a+b*(L-1);
  mint ans = 0;
  ten = 10;
  for (int i = 1; i <= 18; ++i, ten *= 10) {
    ll l = ten/10, r = ten-1;
    if (last < l) continue;
    if (a > r) continue;
    ll na = 0; // 初項
    ll nl = 0; // 長さ
    {
      if (a >= l) na = a;
      else {
        na = ((l-a)+(b-1))/b*b+a;
        na = min(na, last);
      }
    }
    {
      ll nlast = 0;
      if (last <= r) nlast = last;
      else {
        nlast = (r-a)/b*b+a;
      }
      nl = (nlast-na)/b+1;
    }
    // cerr << i << ' ' << na << " " << nl << endl;
    ans *= pow_(ten, nl);
    ans += f(nl)*na;
    ans += g(nl);
    // cerr << f(nl).x << endl;
    // cerr << g(nl).x << endl;
    // cerr << ans.x << endl;
  }
  cout << ans.x << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
 
using namespace std;
 
int main()
{
    string S; cin >> S;
    int Q; cin >> Q;
    bool rev = false;
 
    for (int i = 0; i < Q; i++) {
        int query; cin >> query;
        if (query == 1) {
            if (rev) rev = false;
            else rev = true;
        } else {
            int F; char C; cin >> F >> C;
            if (F == 1) {
                if (rev)
                    S += C;
                else
                    S.insert(S.begin(), C);
            } else {
                if (rev)
                    S.insert(S.begin(), C);
                else
                    S += C;
            }
        }
    }
 
    if (rev) {
        reverse(S.begin(), S.end());
    }
    cout << S << endl;
 
}

Measured memory_bytes: 900
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

use = [1]*n
for i in range(n-k):
    if not use[i]:
        continue
    if t[i] == t[i+k]:
        use[i+k] = 0

ans = 0
for i in range(n):
    if use[i]:
        x = t[i]
        if x == 'r':
            ans += p
        elif x == 's':
            ans += r
        else:
            ans += s
print(ans)


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


class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        Dictionary<char, string> dat = new Dictionary<char, string>();
        dat['a'] = Reader.ReadLine();
        dat['b'] = Reader.ReadLine();
        dat['c'] = Reader.ReadLine();


        int max = dat.Sum(a => a.Value.Length);
        char idx = 'a';
        char winner = 'a';
        for (int i = 0; i < max; i++)
        {
            if (dat[idx].Length == 0)
            {
                winner = idx;
                break;
            }
            char next = dat[idx][0];
            dat[idx] = dat[idx].Substring(1);
            idx = next;
        }

        Console.WriteLine(winner.ToString().ToUpper());


    }


    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"


abcb
aacb
bccc


";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}

Measured memory_bytes: 3288
import java.util.Scanner;

public class Main {

	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		float T = scan.nextFloat();
		float X = scan.nextFloat();



		scan.close();
		System.out.println(T/X);
		
	}

}


Measured memory_bytes: 24660
X = int(input())
V = [False]*110000
for n in range(2, 110000):
  if n*n > X+10000:
    break
  if not V[n]:
    for i in range(2, 110000):
      if i*n < len(V):
        V[i*n] = True
for n in range(X, 110000):
  if not V[n]:
    print(n)
    exit()


Measured memory_bytes: 3828
#include <stdio.h>
#include <string.h>
int main(void){
    char b[101],c[101];
    int a,i,tcnt=0,hcnt=0;
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%s %s",&b,&c);       
        if(strcmp(b,c)>0)
            tcnt+=3;
        if(strcmp(b,c)==0){
            tcnt++;
            hcnt++;}
        if(strcmp(b,c)<0)
            hcnt+=3;
    }
    printf("%d %d\n",tcnt,hcnt);
    return 0;
}

Measured memory_bytes: 2664
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define LL long long

LL n,x=1,base=1;  

inline double S(LL x)
{
	LL tmp=x,sum=0;
	while (tmp>0)
	{
		sum+=tmp%10;
		tmp/=10;
	}	
	return (double)x/double(sum);
} 

int main(){
	scanf("%lld",&n);
	for (LL i=1;i<=n;i++)
	{
		printf("%lld\n",x);
		double now,now_;
		now=S(x+base);
		now_=S(x+base*10);
		if (now_<now) base*=10;
		x+=base;
	}
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    A1 = LI()
    A2 = LI()
    A3 = LI()
    N = II()
    b = [int(input()) for i in range(N)]
    ans = 0
    #print(b)

    if b.count(A2[1])!=0:
        if (b.count(A1[0])!=0 and b.count(A3[2])!=0) or (b.count(A3[0])!=0 and b.count(A1[2])!=0) or (b.count(A1[1])!=0 and b.count(A3[1])!=0) or(b.count(A2[0])!=0 and b.count(A2[2])!=0) :
            ans += 1
    if b.count(A1[0])!=0:
        if (b.count(A2[0])!=0 and b.count(A3[0])!=0) or (b.count(A1[1])!=0 and b.count(A1[2])!=0) :
            ans += 1
    if b.count(A3[2])!=0:
        if (b.count(A1[2])!=0 and b.count(A2[2])!=0) or (b.count(A3[0])!=0 and b.count(A3[1])!=0) :
            ans += 1
    if ans != 0:
        print("Yes")
    else:
        print("No")




if __name__ == "__main__":
	main()

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
using namespace std;
int main() {
	int H, W;
	int A[501][501];
	int cnt = 0;
	vector<int> a, b, c, d;
	cin >> H >> W;

	for (int i = 1; i <= H; i++)
	{
		for (int j = 1; j <= W; j++)
		{
			cin >> A[i][j];
		}
	}

	for (int i = 1; i <= H; i++)
	{
		for (int j = 1; j < W; j++)
		{
			if (A[i][j] % 2 == 1) {
					A[i][j]--;
					A[i][j + 1]++;
					a.push_back(i);
					b.push_back(j);
					c.push_back(i);
					d.push_back(j + 1);
					cnt++;
			}
		}
	}

	for (int i = 1; i < H; i++)
	{
		if (A[i][W] % 2 == 1) {
			A[i][W]--;
			A[i + 1][W]++;
			a.push_back(i);
			b.push_back(W);
			c.push_back(i+1);
			d.push_back(W);
			cnt++;
		}
	}

	cout << cnt << endl;
	for (int i = 0; i < cnt; i++)
	{
		cout << a.at(i) << " " << b.at(i) << " " << c.at(i) << " " << d.at(i) << endl;
	}

	return 0;
}

Measured memory_bytes: 5224
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mp make_pair
typedef pair<int,int> pii;
typedef priority_queue<int,vector<int>,greater<int> > small_heap;
typedef priority_queue<int> big_heap;
int main()
{
    int n,a[10][10];
    cin>>n;
    memset(a,0,sizeof(a));
    for(int i=1;i<=n;i++){
        a[to_string(i)[0]-'0'][i%10]++;
    }
    int ans=0;
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            ans+=a[i][j]*a[j][i];
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int v[11];

int check(int n)
{
    while(n)
    {
        if(v[n%10]==1)
        {
            return 0;
        }
        n=n/10;
    }
    return 1;
}

int main()
{
    int n,k;
    cin>>n>>k;
    int x;
    for(int i=0;i<k;i++)
    {
        cin>>x;
        v[x]=1;
    }
    for(int i=n;i>0;i++)
    {
        if(check(i))
        {
            cout<<i<<endl;
            return 0;
        }
    }
}


Measured memory_bytes: 3600
def baisu(n, a):
  return n // a

def baisu2(n, m, a):
  return baisu(m, a)-baisu(n-1, a)

import fractions

def lcm(k):
    ans = k[0]
    for i in range(1, len(k)):
        ans = ans * k[i] // fractions.gcd(ans, k[i])
    return ans

a, b, c, d = list(map(int, input().split()))

cbaisu = baisu2(a, b, c)
dbaisu = baisu2(a, b, d)
cdbaisu = baisu2(a, b, lcm([c, d]))

print(b-a+1-cbaisu-dbaisu+cdbaisu)
  

    

Measured memory_bytes: 5332
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
// template<class T> T gabs(const T& x) { return max(x, -x); }
// #define abs gabs

#include <complex>

using Complex = complex<double>;
const double PI = acos(-1);

template<class A>
vector<Complex> fft_impl(const A& a, bool inv) {
    size_t n = 0;
    while ((1 << n) < a.size()) ++n;
    size_t m = 1 << n;
    vector<Complex> f(m);
    for (size_t i = 0; i < a.size(); ++i) {
        int rev = 0;
        for (size_t j = 0; j < n; ++j) {
            rev |= ((i >> j) & 1) << (n - j - 1);
        }
        f[rev] = a[i];
    }
    if (inv) {
        for (size_t i = 0; i < m; ++i) {
            f[i] = conj(f[i]);
        }
    }
    vector<Complex> w(m);
    for (size_t i = 0; i < m; ++i) {
        w[i] = exp(-2i * PI * double(i) / double(m));
    }
    for (size_t k = 1; k <= n; ++k) {
        size_t l = 1 << k;
        for (size_t ofs = 0; ofs < m; ofs += 1 << k) {
            for (size_t i = 0; i < (l >> 1); ++i) {
                size_t scale = 1 << (n - k);
                size_t j = (l >> 1) + i;
                auto x = f[ofs + i],
                     y = f[ofs + j];
                f[ofs + i] = x + w[i * scale] * y;
                f[ofs + j] = x + w[j * scale] * y;
            }
        }
    }
    if (inv) {
        for (size_t i = 0; i < m; ++i) {
            f[i] = conj(f[i]) / double(m);
        }
    }
    return f;
}

template<class A>
vector<Complex> fft(const A& a) {
    return fft_impl(a, false);
}

template<class A>
vector<Complex> ifft(const A& a) {
    return fft_impl(a, true);
}

int main() {
    i64 n, m;
    vector<i64> a;
    cin >> n >> m;
    read_n(a, n);

    vector<i64> c(200001);
    for (i64 x : a) c[x]++;

    auto f = fft(c);
    for (int i = 0; i < f.size(); ++i) {
        f[i] *= f[i];
    }
    auto g = ifft(f);

    i64 ans = 0;
    for (int x = 200000; x > 0; --x) {
        i64 cnt = min(m, i64(round(g[x].real())));
        m -= cnt;
        ans += x * cnt;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 14972
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
void setIO(string name = "a") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    double a, b, h; cin >> a >> b >> h;
    cout << (int) ((a + b) / 2 * h) << "\n";
}

Measured memory_bytes: 3728
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <numeric>

using namespace std;


int main() {
	int l, r,d,cnt=0;
	cin >> l >> r >> d;
	vector<int>x;
	for (int i = l; i <= r; i++) {
		x.push_back(i);
	}
	for (int i = 0; i < x.size(); i++) {
		if (x[i] % d == 0) {
			cnt++;
		}
	}
	cout << cnt;
}

Measured memory_bytes: 3624
//ITP1_7_C
#include <iostream>
using namespace std;

int array[105][105];
int sumall;

int main() {
	int sum, c, r;
	cin >> c >> r;
	for (int i = 0; i < c; i++)	{
		for (int j = 0; j < r; j++)	{
			cin >> array[i][j];
		}
	}
	for (int i = 0; i < c; i++)	{
		sum = 0;
		for (int j = 0; j < r; j++)	{
			sum += array[i][j];
		}
		array[i][r] = sum;
		sumall += sum;
	}
	array[c][r] = sumall;
	for (int i = 0; i < r; i++)	{
		sum = 0;
		for (int j = 0; j < c; j++)	{
			sum += array[j][i];
		}
		array[c][i] = sum;
	}
	for (int i = 0; i < c + 1; i++)	{
		for (int j = 0; j < r + 1; j++)	{
			cout << array[i][j];
			if (j == r) cout << endl;
			else cout << " ";
		}
	}
	return 0;
}

Measured memory_bytes: 1204
#include<iostream>
#include<vector>
#include<tuple>
#include<algorithm>

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

const int INF = 1001001001001;

vector<int> to[3000];
vector<int> rto[3000];
bool reachableFrom1[3000];
bool reachableToN[3000];
bool ok[3000];

void dfs(int v){
    if(reachableFrom1[v]) return;
    reachableFrom1[v] = true;
    for(int u : to[v]){
        dfs(u);
    }
}
void rdfs(int v){
    if(reachableToN[v]) return;
    reachableToN[v] = true;
    for(int u : rto[v]){
        rdfs(u);
    }
}
int main(){
    int n, m, p;
    cin >> n >> m >> p;
    vector<tuple<int,int,int>> edges;

    rep(i,m){
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        c -= p;
        c = -c;
        edges.emplace_back(a,b,c);
        to[a].push_back(b);
        rto[b].push_back(a);
    }
    dfs(0);
    rdfs(n-1);
    rep(i,n) ok[i] = reachableFrom1[i]&reachableToN[i];
    {
        vector<int> d(n, INF);
        d[0] = 0;
        bool upd = true;
        int step = 0;
        while(upd){
            upd = false;
            rep(i,m){
                int a, b, c;
                tie(a, b, c) = edges[i];
                if(!ok[a]) continue;
                if(!ok[b]) continue;
                int newD = d[a]+c;
                if(newD < d[b]){
                    upd = true;
                    d[b] = newD;
                }
            }
            step++;
            if(step > n){
                puts("-1");
                return 0;
            }
        }
        int ans = -d[n-1];
        ans = max(ans, 0);
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 768
#include <iostream>

int main() {
    int a, b;
    std::cin >> a >> b;
    
    if (a%3==0) {
        std::cout << "Possible" << std::endl;
    } else if (b%3==0) {
        std::cout << "Possible" << std::endl;
    } else if ((a+b)%3==0) {
        std::cout << "Possible" << std::endl;
    } else {
        std::cout << "Impossible" << std::endl;
    }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

typedef long long ll;

int main() {
    int n;
    ll y;
    cin >> n >> y;

    for(int i=0;i<=n;++i){
        for(int j=0;j<=n-i;++j) {
            int k = n - i - j;
            if(10000*i + 5000*j + 1000*k == y) {
                cout << i << " " << j << " " << k << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
}

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

using namespace std;

typedef pair<int, int> P;

P f(P a, P b)
{
	return P(b.first - a.first, b.second - a.second);
}


int main()
{
	int m, n;

	while (true) {
		cin >> m;
		if (m == 0) break;

		vector<P> seiza(m);

		for (int i = 0; i < m; ++i) cin >> seiza[i].first >> seiza[i].second;

		cin >> n;

		vector<P> image(n);

		for (int i = 0; i < n; ++i) cin >> image[i].first >> image[i].second;

		P s0 = seiza[0];

		for (int i = 0; i < n; ++i) {
			int cnt = 1;

			P amount_of_change = f(s0, image[i]);
			for (int j = 1; j < m; ++j) {
				P sj = seiza[j];
				for (int k = 0; k < n; ++k) {
					if (sj.first + amount_of_change.first == image[k].first && sj.second + amount_of_change.second == image[k].second) {
						cnt++;
					}
				}
			}

			if (cnt == m) printf("%d %d\n", amount_of_change.first, amount_of_change.second);
		}
	}
}

Measured memory_bytes: 1184
from bisect import bisect_right, bisect_left

n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        a = l[i]
        b = l[j]
        left = abs(a-b)
        right = a+b
        q = max(j+1, bisect_left(l, right))
        w = max(j+1, bisect_right(l, left))
        # left < c < right
        ans += q-w
print(ans)

Measured memory_bytes: 51180
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 200010
int n,A,B,C,D;
char s[MAXN];
bool check(int l,int r)
{
	for(int i=l;i<r;i++)
		if(s[i]=='#'&&s[i+1]=='#')
			return 0;
	return 1;
}
int main()
{
	scanf("%d%d%d%d%d%s",&n,&A,&B,&C,&D,s+1);
	if(!check(A,max(C,D)))
		printf("No\n");
	else if(C<D)
		printf("Yes\n");
	else
	{
		for(int i=B;i<=D;i++)
			if(s[i]!='#'&&s[i-1]!='#'&&s[i+1]!='#')
			{
				printf("Yes\n");
				return 0;
			}
		printf("No\n");
	}
}

Measured memory_bytes: 384
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	long long n, a, b, c, d, e;
	cin >> n >> a >> b >> c >> d >> e;

	long long min_capacity = min(min(min(min(a, b), c), d), e);
	if (min_capacity >= n) {
		cout << "5\n";
		return 0;
	}

	long long ans = 5;
	n -= min_capacity;
	ans += ceil((double) n / min_capacity);
	cout << ans << "\n";

	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  string s,t,ans;cin>>s>>t;
  rep(i,n) {
    ans+=s[i];
    ans+=t[i];
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!
# from collections import Counter
# from functools import *
import itertools  
import numpy as np
def LI():
    return (map(int,input().split()))

n,m,x=LI()
c=[]
a=[]
for i in range(n):
    ct,*at=LI()
    c.append(ct)
    a.append(at)
    
a=np.array(a)

ans=10**15
rrr=list(itertools.product((0,1),repeat=n))
# print(rrr)
for i in rrr:
    tmp=np.array([0]*m)
    cost=0
    for j,k in enumerate(i):
        if k==1:
            tmp+=a[j]
            cost+=c[j]
        if all(tmp>=x):
            ans=min(ans,cost)
if ans==10**15:
    ans=-1
print(ans)
        
        

Measured memory_bytes: 27628
#include<bits/stdc++.h>
using namespace std;
#define MAXN	2005
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
int gcd(int x, int y) {
	if (y == 0) return x;
	else return gcd(y, x % y);
}
bool mp[MAXN][MAXN], visited[MAXN];
vector <int> a[MAXN], b[MAXN], tmp;
int value[MAXN], n;
void work(int pos, int fa) {
	visited[pos] = true;
	for (int i = 1; i <= n; i++)
		if (mp[pos][i] && !visited[i]) {
			work(i, pos);
			tmp.clear();
			unsigned p = 0, q = 0;
			while (p < b[pos].size() || q < b[i].size())
				if (q == b[i].size() || p < b[pos].size() && b[pos][p] > b[i][q]) tmp.push_back(b[pos][p++]);
				else tmp.push_back(b[i][q++]);
			b[pos] = tmp;
		}
	b[pos].insert(b[pos].begin(), value[pos]);
}
int main() {
	read(n);
	for (int i = 1; i <= n; i++)
		read(value[i]);
	sort(value + 1, value + n + 1);
	for (int i = 1; i <= n; i++)
		mp[0][i] = mp[i][0] = true;
	for (int i = 1; i <= n; i++)
	for (int j = i + 1; j <= n; j++)
		mp[i][j] = mp[j][i] = gcd(value[i], value[j]) != 1;
	work(0, 0);
	for (unsigned i = 1; i < b[0].size(); i++)
		printf("%d ", b[0][i]);
	printf("\n");
	return 0;
}

Measured memory_bytes: 20352
#include <bits/stdc++.h>
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int, int> pi;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MKP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
const int INF = 999999;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll MOD = 1000000007;


vll A;
int N;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  REP(i,N){
    ll x;
    cin >> x;
    A.push_back(x);
  }
  int min = *std::min_element(A.begin(), A.end());
  int max = *std::max_element(A.begin(), A.end());
  cout << max - min << endl;
  return 0;	
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int a = scan.nextInt();
    int b = scan.nextInt();
    int k = scan.nextInt();

    for (int i = Math.min(a, b);; i--) {
      if ((a % i == 0) && (b % i == 0)) {
        k--;
        if (k == 0) {
          System.out.println(i);
          return;
        }
      }
    }

  }

}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  int n;cin>>n;
  int count = 0;
  REP(i,n){
    int t;
    cin>>t;
    if(t !=(i+1)){
      count++;
    }
  }

  if(count<=2){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }


 

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
// #define LOCAL
#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif // LOCAL
int const nax = 3e5 + 10, mod = 1e9 + 7;

void plusle(int &a, int b) {
    if ((a += b) >= mod) a -= mod;
}
int add (int a, int b) {
    return ((a += b) >= mod) ? a - mod : a;
}
int mul (int a, int b) {
    return 1LL * a * b % mod;
}

int n, k, a[nax];
int f[22][1050];
int c[1020][1020];


int main(){
    scanf("%d %d", &n, &k);
    c[0][0] = 1;
    for (int i = 1 ; i <= 1000 ; ++ i ) {
        c[i][0] = 1 ;
        for (int j = 1 ;j  <= 1000 ; ++ j)
            c[i][j] = add(c[i - 1][j - 1], c[i - 1][j]);
    }

    for(int i = 1 ;i <= k ;i ++)
        scanf("%d", a  + i);

    for (int i = 0 ; i <= a[1] ; ++ i)
        f[1][i] = mul(c[n][i], c[n - i][a[1] - i]);

    for (int j = 2 ; j <= k ; ++ j)
        for (int i = 0 ; i <= n ; ++ i)
            for (int from = 0 ; from <= n - i && i <= a[j]; ++ from)
                plusle(f[j][from + i] ,mul(f[j - 1][from], mul(c[n - from][ i], c[n - i][a[j] - i])));

    printf("%d\n", f[k][n]);
}
/*
    Good Luck
        -Lucina
*/


Measured memory_bytes: 4352
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
x, y = map(int, input().split())
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 8936
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
long long gcd(long long a, long long b) { return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b) { return a/gcd(a,b)*b;}

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

int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  int a;
  rep(i, n) {
    cin >> a;
    mp[a] = i + 1;
  }

  map<int, int>::iterator itr;
  for (int i = 1; i <= n; ++i) {
    itr = mp.find(i);
    if (i != n) cout << itr->second << " ";
    else cout << itr->second << endl;
  }
  return 0;
}

Measured memory_bytes: 5504
#include<iostream>
#include<sstream>
#include<fstream>
#include<algorithm>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<cctype>
#include<vector>
#include<string>
#include<cmath>
#include<ctime>
#include<stack>
#include<queue>
#include<map>
#include<set>
#define mem(a,b) memset(a,b,sizeof(a))
#define random(a,b) (rand()%(b-a+1)+a)
#define ll long long
#define ull unsigned long long
#define e 2.71828182
#define Pi acos(-1.0)
#define ls(rt) (rt<<1)
#define rs(rt) (rt<<1|1)
#define lowbit(x) (x&(-x))
using namespace std;
int read()
{
	int s=1,x=0;
	char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-') s=-1;ch=getchar();}
	while(isdigit(ch)) {x=10*x+ch-'0';ch=getchar();}
	return x*s;
}
int main()
{
	int n=read();
	cout<<n*n*n<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
const long long MOD = 998244353;
using namespace std;


int main(int argc, char* argv[])
{
    int h,w;
    scanf("%d%d", &h, &w);
    int i,j;
    for(i=0; i<h; i++) {
        for(j=0; j<w; j++) {
            char str[6]={0};
            scanf("%s", str);
            if(strcmp(str, "snuke")==0) {
                printf("%c%d\n", 'A'+j, i+1);
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 128
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
x = int(arr_data[0][1])

arr = [int(arr_data[1][i]) for i in range(n)]

mysum = sum(arr)

arr.sort()
cnt = 0
temp = 0

if x==mysum:
    
    cnt=n
    
else:
    for i in range(0,n-1):

        if arr[i] + temp <= x:

            temp += arr[i]
            cnt += 1
        else:

            break
        
print(cnt)


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

int main(){
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  for(int i=0; i<n;i++){
    cin >> p.at(i);
  }
  sort(p.begin(),p.end());
  int ans=0;
  for(int i=0; i<k;i++){
    ans += p.at(i);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main()
{
    int N; cin >> N;
    int S = N + (N % 2 == 0);
    vector<pair<int, int>> ans;
    for (int i = 1; i <= N; i++) {
        for (int j = i + 1; j <= N; j++) {
            if (i + j != S) {
                ans.emplace_back(i, j);
            }
        }
    }
    cout << ans.size() << '\n';
    for (auto p : ans) cout << p.first << ' ' << p.second << '\n';
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;
int main(){
	int N,H;
	cin>>N>>H;
	vector<pair<string,int> >v(N);
	for(int i=0;i<N;i++)cin>>v[i].first>>v[i].second;
	int ok=0,ng=0;
	for(int n=0,i=0;;){
		cout<<"? "<<v[n].first<<endl;
		string s;
		cin>>s;
		if((v[n].first[i]|32)==(s[0]|32)){
			++ok;
			v[n].first[i]='_';
			if(++i==v[n].first.size())i=0,++n;
		}else{
			++ng;
			if(--v[n].second<0){
				i=0,++n;
				if(!--H){
					cout<<"! Game Over"<<endl;
					return 0;
				}
			}
		}
		if(n==v.size())break;
	}
	int r=ok*1000/(ok+ng);
	cout<<"! Game Clear "<<r/10<<'.'<<r%10<<endl;
}

Measured memory_bytes: 1300
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, string> pls;

ll v[51];

int main()
{
	ll k,N;
	cin >> k;

	N = 50;
	for (int i = 0; i < 50; i++)
		v[i] = 49 + k / 50;
	k %= 50;

	for (int i = 0; i < k; i++) {
		v[i] += N + 1;
		for (int j = 0; j < N; j++)
			v[j]--;
	}
	cout << N << endl;
	for (int i = 0; i < N; i++) {
		cout << v[i];
		if (i != N - 1)cout << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

#define arr_print_d0dn(a, n) for(int i=0;i<(n);++i)printf(i==(n)-1?"%d\n":"%d ",(a)[i])
#define arr_rprint_d0dn(a, n) for(int i=(n)-1;i>=0;--i)printf(i?"%d ":"%d\n", (a)[i])
#define arr_print_dndn(a, n) for(int i=0;i<(n);++i)printf("%d\n", (a)[i])

int insertion_sort(int *a, const int N, const int G) {
    int cnt = 0;
    for(int i = G; i < N; ++i) {
        int tmp = a[i];
        int j = i - G;
        while(j >= 0 && a[j] > tmp) {
            // G: gap
            a[j + G] = a[j];
            j -= G;
            cnt++;
        }
        a[j + G] = tmp;
    }
    return cnt;
}

void shell_sort(int *a, const int N) {
    int cnt = 0;
    // m: g-arr size
    int m = 0;
    int G[100] = {};
    // h: well known value (from Wikipedia)
    for(int h = 1; h <= N; h = 3 * h + 1) {
        G[m] = h;
        m++;
    }
    for(int i = m - 1; i >= 0; --i) {
        // insertion sort with G[i] gap
        cnt += insertion_sort(a, N, G[i]);
    }

    printf("%d\n", m);
    arr_rprint_d0dn(G, m);
    printf("%d\n", cnt);
    arr_print_dndn(a, N);
}

int main() {
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i = 0; i < n; ++i) {
        scanf("%d", a + i);
    }
    shell_sort(a, n);
    return 0;
}



Measured memory_bytes: 5628
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

int main() {
  int n;
  cin >> n;
  V<ll> x(n), l(n);
  rep(i, n) cin >> x[i] >> l[i];

  V<P> r(n);
  rep(i, n) r[i] = {x[i] + l[i], i};
  sort(r.begin(), r.end());

  int ans = 0;
  ll m = -1e10;
  rep(i, n) {
    int j = r[i].second;
    if (m <= x[j] - l[j]) {
      ans++;
      m = x[j] + l[j];
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 6436
#include<bits/stdc++.h>
 // #include <ext/pb_ds/tree_policy.hpp>
 // #include <ext/pb_ds/assoc_container.hpp>
 #include<chrono>
  using namespace std;
   using namespace std::chrono;      
  // using namespace __gnu_pbds; 
 #define fastio     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
 #define fi         first
 #define se         second
 #define int         long long 
 #define pb         push_back
 #define emp        emplace_back
 #define vv(x)      vector<x>
 #define mp(x,y)    map<x,y>
 #define dq(x)      deque<x>
 #define pql(x)     priority_queue<x>
 #define pqs(x)     priority_queue<x,vv(x),greater<x> >
 #define M          1000000007
 #define forf(i,a,b) for(int i=a;i<b;i++)
 #define it(x)      x::iterator
 #define ll         long long 
 #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
 #define time__(d)  for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
 #define vii        vector<int>
 #define big        1e18
 #define sm         -2e18
 #define mkr        make_pair
 #define vpi        vector<pair<int,int> >
 #define pii        pair<int,int>
 #define rng        500005
 #define sz(x)      (int)x.size()
 #define rv(x)      reverse(x.begin(),x.end())
 #define out(x)     cout<<x.fi<<" "<<x.se<<endl;
#define MEM(x,val) memset(x,val,sizeof(x))

 // typedef tree<pii, null_type, less<pii>, rb_tree_tag,  
 //            tree_order_statistics_node_update>  odst; 


void pr_init()
{
   
    #ifndef ONLINE_JUDGE
    freopen("gin.txt", "r", stdin);
   // freopen("output.txt", "w", stdout);
   
    #endif
}

void solve()
{
  int d,t,s;
  cin >> d >> t >> s;
  double tm = (double)d/(double)s;

  cout<<((tm<=t)?"Yes\n":"No\n");
}

int32_t main()
{
  pr_init();
  fastio;
  auto start = high_resolution_clock::now(); 
  solve(); 
  auto stop = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop - start); 
  
    // cout << "Time taken by function: "
    //      << duration.count() << " microseconds" << endl; 

  return 0;
}

Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        String c1 = stdin.nextLine();
        String c2 = stdin.nextLine();
        String c3 = stdin.nextLine();
        System.out.printf("%c%c%c%n", c1.charAt(0), c2.charAt(1), c3.charAt(2));
    }
}


Measured memory_bytes: 20692
[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let n = read int
    let vs = reads float

    let rec loop xs =
        match List.sort xs with
        | [] -> failwith "error"
        | [y] -> y
        | y :: z :: zs ->
            loop (((y + z) / 2.0) :: zs)

    printfn "%.6f" (loop vs)
    0

Measured memory_bytes: 12892
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define degreeToRadian(deg) (((deg)/360)*2*M_PI)
#define radianTodegree(rad) (((rad)/2/M_PI)*360)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;
const int MOD = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//cin.tie(0);ios::sync_with_stdio(false);
//cout << fixed << setprecision(15) << y << endl;
int main() {
  string s;
  cin >> s;

  stack<char> sc;
  for (auto v : s) {
    if (v == 'B' && !sc.empty()) sc.pop();
    else if (v != 'B') sc.push(v);
  }
  string ans = "";
  while (!sc.empty()) {
    ans += sc.top();
    sc.pop();
  }
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3568
#include <iostream>

using namespace std;

int main() {
  long long n, sum=0;
  cin >> n;
  
  for (int num=1; num<=n; num++) {
  	if (num % 5 == 0 && num % 3 == 0) continue;
    else if (num % 5 == 0) continue;
    else if (num % 3 == 0) continue;
    else sum += num;
}
  cout << sum;
  
}

Measured memory_bytes: 3192
#include<bits/stdc++.h>
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF 1145141919
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)

using namespace std;

int main(void){
  unsigned long long int N,M,j=0,p=0;
  cin >> N >> M;
  unsigned long long int A[N];
  rep(i,N) cin >> A[i];
  pair<unsigned long long int,unsigned long long int> B[M];
  rep(i,M) cin >> B[i].second >> B[i].first;
  sort(B,B+M,greater<pair<unsigned long long int,unsigned long long int>>());
  int C[N]={};
  while(p<N && B[M-1].second!=0){
    while(B[j].second!=0){
      C[p]=B[j].first;
      p++;
      B[j].second--;
    }
    j++;
  }
  unsigned long long int D[2*N];
  rep(i,N) D[i]=A[i];
  for(int i=N;i<2*N;i++) D[i]=C[i-N];
  sort(D,D+2*N,greater<unsigned long long int>());
  unsigned long long int ans=0;
  rep(i,N) ans+=D[i];
  cout << ans << endl;
}

Measured memory_bytes: 4480
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

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

int main(){
    string S,T;
    cin >> S;
    cin >> T;
    int ans = 0;
    for(int i=0;i<3;i++){
        if(S[i] == T[i])ans++;
    }
    
    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;

class Therefore
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine();

        var parse= input[input.Length - 1].ToString();

        var check = int.Parse(parse);


        var ans = "";

        if(check == 2 || check == 4 || check == 5 || check == 7 || check == 9)
        {
            ans = "hon";
        }else if (check == 0 || check == 1 || check == 6 || check == 8)
        {
            ans = "pon";
        }
        else
        {
            ans = "bon";
        }





        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 27476
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define F first
#define S second
#define pll pair<ll,ll>
#define all(x) x.begin(), x.end()
#define ed cout << "\n"
#define vll vector<ll>
#define vpll vector<pll>
#define ar array
#define sz(x) (ll)x.size()                                        
#define NAME ""
bool isFile = 0;
 
typedef long long ll;
typedef long double ld;
 
const ll INF=1e9+1234;                                                   
const int N = 2e5 + 1234; 
const ll MOD=998244353;
const ll mod=1e9+7;                                            
double EPS = 3e-18;
const double PI = acos(-1);  
 
 
void faster()
{
	if(isFile)
	{
		freopen(NAME".in","r",stdin);
		freopen(NAME".out","w",stdout);
	}
	ios_base::sync_with_stdio(false);                                                
    cin.tie(NULL);                                         
    cout.tie(NULL);                                
}
		 

void solve() 
{
	int s,w;
	cin >> s >> w;
	if(w >= s)
		cout << "unsafe";
	else
		cout << "safe";	 			  														     	 	
}
            
                           
int main()                                     
{                            
	faster();                
	int t = 1;
	//cin >> t;	
	while(t--)
	{               	
		solve();
		ed;
	}
	return 0;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7, inv2 = (mod + 1) / 2;
const int N = 200010;
int n, a[N], cnt[N], tot = 1, ans;
int tr[2][N], up[N], dn[N], zr[N], idn[N];

inline int add(const int &x, const int &y) {
	return x + y < mod ? x + y : x + y - mod;
}
inline int sub(const int &x, const int &y) {
	return x - y < 0 ? x - y + mod : x - y;
}
inline int mul(const int &x, const int &y) { return (int)((ll)x * y % mod); }
int ksm(int x, int y = mod - 2) {
	int ss = 1; for(; y; y >>= 1, x = mul(x, x)) if(y & 1) ss = mul(ss, x);
	return ss;
}
void Add(int x, int w) {
	for(; x <= n; x += x & -x)
		tr[0][x] = add(tr[0][x], w), tr[1][x] = add(tr[1][x], 1);
}
int Ask(int x, int w) {
	int ss = 0; for(; x; x -= x & -x) ss = add(ss, tr[w][x]); return ss;
}
int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]), ++cnt[a[i]];
	for(int i = n; i; i--) cnt[i] += cnt[i + 1];
	for(int i = n; i; i--)
		tot = mul(tot, sub(cnt[i], n - i)), cnt[i] -= n - i;
	if(!tot) { puts("0"); return 0; }
	up[0] = dn[0] = 1;
	for(int i = 1, x; i <= n; i++) {
		x = mul(cnt[i] - 1, ksm(cnt[i]));
		if(!x) zr[i] = zr[i - 1] + 1, up[zr[i]] = i, dn[i] = dn[i - 1];
		else zr[i] = zr[i - 1], dn[i] = mul(dn[i - 1], x);
		idn[i] = ksm(dn[i]);
	}
	for(int i = 1, x; i <= n; i++) {
		x = sub(Ask(a[i], 0), Ask(up[zr[a[i]]] - 1, 0));
		x = mul(x, mul(dn[a[i]], mul(tot, inv2)));
		ans = add(ans, x);
		Add(a[i], idn[a[i]]);
	}
	for(int i = 1; i <= n; i++) tr[0][i] = tr[1][i] = 0;
	for(int i = n, x; i; i--) {
		x = sub(Ask(a[i] - 1, 0), Ask(up[zr[a[i]]] - 1, 0));
		x = mul(x, mul(dn[a[i]], mul(tot, inv2)));
		ans = sub(ans, x);
		ans = add(ans, mul(Ask(a[i] - 1, 1), tot));
		Add(a[i], idn[a[i]]);
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 6528