akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long 
#define PI 3.141592653589793238

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pref_trie;
typedef tree<long int,null_type,less<long int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef cc_hash_table<long int,long int, hash<long int>, equal_to<long int>, direct_mask_range_hashing<long int>, 
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;
typedef gp_hash_table<long int,long int> HashTable;

int main(){
   IOS;
 /*    #ifndef ONLINE_JUDGE
         freopen("in.txt",  "r",  stdin);
         freopen("out.txt", "w", stdout);
     #endif */
 	long int x,y,a,b,c;
 	cin>>x>>y>>a>>b>>c;

 	vector<long int> red(a),green(b),colorless(c);

 	for(long int i = 0; i < a; i++)
 		cin>>red[i];

 	for(long int i = 0; i < b; i++)
 		cin>>green[i];

 	for(long int i = 0; i < c; i++)
 		cin>>colorless[i];

   priority_queue<long int,vector<long int>,greater<long int>> pq;
   sort(red.begin(),red.end());
   sort(green.begin(),green.end());
   sort(colorless.begin(),colorless.end());

   while(x--){
   	 	pq.push(red.back());
   	 	red.pop_back();
   }

   while(y--){
   	pq.push(green.back());
   	green.pop_back();
   }

   while(colorless.size() && pq.top() < colorless.back()){
   	 pq.pop();
   	 pq.push(colorless.back());
   	 colorless.pop_back();
   }

   long int ans = 0;
   while(pq.size()){
   	ans += pq.top();
   	pq.pop();
   }

   cout<<ans;

   return 0;
}

Measured memory_bytes: 4852
#include <bits/stdc++.h> 
 
#define INF (1<<31)//INT_MAX/2
#define MOD 1000000007
 
using ll  = long long;
using ull = unsigned long long;
 
int main(int argc, char *argv[])
{
    int N, M, X, Y;
    std::cin >> N >> M >> X >> Y;

    std::vector<int> x(N);
    for (int i = 0; i < N; i++) {
        std::cin >> x[i];
    }

    std::vector<int> y(M);
    for (int i = 0; i < M; i++) {
        std::cin >> y[i];
    }

    bool flag = false;
    for (int Z = -100; Z <= 100; Z++) {
        bool xflag = true;
        if (X < Z && Z <= Y) {
            for (int j = 0; j < N; j++) {
                if (x[j] >= Z) {
                    xflag = false;
                    break; 
                }
            }
            bool yflag = true;
            if (xflag) {
                for (int k = 0; k < M; k++) {
                    if (y[k] < Z) {
                        yflag = false;
                    }
                }
                if (yflag) {
                    flag = true;
                }
            }
        }
    }

    if (flag) {
        std::cout << "No War" << std::endl;
    } else {
        std::cout << "War"    << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define N 100  

int main(){
  int i,comp,j,k,s,count,in[N+1],pi[N+1][N+1];
  
  scanf("%d",&count);

  for(i=1;i<=count;i++){
    scanf("%d%d",&in[i-1],&in[i]);
  }

  for(i=1;i<=count;i++) pi[i][i]=0;
  
  for(i=2;i<=count;i++){
    for(j=1;j<=count-i+1;j++){
      s=i+j-1;
      
      for(k=j;k<s;k++){
	if(j!=k) {
	  comp=(pi[j][k]+pi[k+1][s]+in[j-1]*in[k]*in[s]);
	  if(pi[j][s]>comp) pi[j][s]=comp;
	} 
	else pi[j][s]=(pi[j][k]+pi[k+1][s]+in[j-1]*in[k]*in[s]); 
      }
    }
  }

  printf("%d\n",pi[1][count]);

  return 0;
}
	  
  



Measured memory_bytes: 2112
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define MAXN 100005
#define endl "\n"
#define readln(x) getline(cin, x);
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
typedef pair<ll, ll> pll;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
ll fpow(ll x, ll n, ll mod){if (n==0) return 1%mod; ll u = fpow(x, n/2, mod); u = (u*u)%mod; if (n%2==1)u = (u*x)%mod;return u;}
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }

int N, K, dp[MAXN], h[MAXN];
int main(){
    //freopen("data.txt","r",stdin);
    cin >> N >> K;
    for (int i = 1; i<=N; i++){
        cin >> h[i];
    }
    memset(dp, 1000006, sizeof dp);
    dp[1] = 0;
    for (int i = 2; i<=N; i++){
        for (int j = 1; j<=K; j++){
            if (j<=i){
                dp[i] = min(dp[i], dp[i-j]+abs(h[i]-h[i-j]));
            }
        }
    }
    cout << dp[N] << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<char,char> pcc;
typedef pair<char,int> pci;
typedef vector<pair<int,int>> vpii;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
#define sci(a) scanf("%d",&a)
#define scii(a,b) scanf("%d %d",&a,&b)
#define sciii(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define sciiii(a,b,c,d) scanf("%d%d%d%d",&a,&b,&c,&d)
#define scl(a) scanf("%lld",&a)
#define scll(a,b) scanf("%lld %lld",&a,&b)
#define sclll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c
#define scllll(a,b,c,d) scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define print(a) printf("%d ",a)
#define println(a) printf("%d\n",a)
#define ln printf("\n")
#define pb(a) push_back(a)
#define m_p(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define rep(i,s,n) for(int i=s;i<=n;i++)
#define rrep(i,e,s) for(int i=e;i>=s;i--)
#define repv(i,m) for(auto i = m.begin();i != m.end();i++)
#define FileIO freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
const long long INF = 4000000000000000000LL;
/************************************* Chocolate *************************************/
const int mod = 1e9+7;
int main(){
    int n,k;
    scii(n,k);
    vi dp(k+1,0);//dp[j] = #of combos taking j candies till i-th person.
    dp[0] = 1;
    rep(i,1,n){
        int up_to;
        sci(up_to);
        vi pref(k+1);
        rrep(j,k,0){
            int l = j+1;
            int r = min(j+up_to,k);
            if(l <= r){
                pref[l] = (pref[l] + dp[j])%mod;
                if(r<k) pref[r+1] = (pref[r+1] - dp[j] + mod)%mod;
            }
        }
        int total = 0;
        rep(j,0,k){
            total = (total+pref[j])%mod;
            dp[j] = (dp[j]+total)%mod;
        }
    }
    println(dp[k]);
}

Measured memory_bytes: 4040
def cal(n):
  min_num = -1
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      num = i + (n//i)
      if min_num < 0 or num < min_num:
          min_num = num
  return min_num -2
_ = int(input())
print(cal(_))

Measured memory_bytes: 2940
let rec seq a b = if a > b then [] else a :: seq (a+1) b
let (>>=) xs f = List.map f xs |> List.concat

let factorize n =
  let rec aux c d x =
    if x = 1 then if c > 0 then [(d, c)] else []
    else if x mod d = 0 then aux (c+1) d (x/d)
    else if c > 0 then (d, c) :: aux 0 (d+1) x else aux 0 (d+1) x
  in aux 0 2 n

let sum = List.fold_left (+) 0
let () =
  Scanf.scanf "%d" @@ fun n ->
  let a = Array.make 100 0 in
  seq 1 n |> List.iter (fun i ->
    factorize i |> List.iter (fun (d, c) -> a.(d) <- a.(d) + c));
  let v0 = sum (seq 0 99 >>= fun i -> if a.(i) >= 75-1 then [1] else []) in
  let v1 = sum begin
    (seq 0 99 >>= fun i ->
     seq 0 99 >>= fun j ->
       if i = j then []
       else [
         (if a.(i) >= 14 && a.(j) >= 4 then 1 else 0) +
         (if a.(i) >= 24 && a.(j) >= 2 then 1 else 0)
       ])
  end in
  let v2 = List.length begin
    (seq 0 99     >>= fun i ->
     seq 0 99     >>= fun j ->
     seq (j+1) 99 >>= fun k ->
       if i <> j && i <> k && a.(i) >= 3-1 && a.(j) >= 5-1 && a.(k) >= 5-1
       then [1] else [])
  end in
  Printf.printf "%d\n" (v0 + v1 + v2)


Measured memory_bytes: 4608
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
#include<bitset>
#include<climits>
#include<map>
using namespace std;

int main(void)
{
    int N;
    long long K;
    cin >> N >> K;

    vector<int> A(N);
    for (int i = 0; i < N; i++)
        cin >> A[i];

    for (int i = 0; i < N; i++)
        A[i]--;

    int pos = 0;
    map<int, int> epoch;
    long long k = K;
    while (k) {
        int next = A[pos];
        if (epoch[next] != 0) {
            k = (K - epoch[next]) % (epoch[pos] + 1 - epoch[next]);
            pos = next;

            break;
        }

        epoch[next] = epoch[pos] + 1;
        pos = next;
        k--;
    }

    for (long long i = 0; i < k; i++) {
        pos = A[pos];
    }

    cout << pos + 1 << endl;

    return 0;
}


Measured memory_bytes: 11444
import math
N = int(input())
keta = math.floor(math.log(N, 10)) + 1
ans = 0
for i in range(1, keta):
    if i % 2 == 1:
        ans += 9 * pow(10, i - 1)
if keta % 2 == 1:
    ans += N - pow(10, keta - 1)+1
print(ans)


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

#ifdef _DEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif

using namespace std;

int main() {
    int N;
    cin >> N;
    map<string, int> m;
    for (int i = 0; i < N; ++i) {
        string s;
        cin >> s;
        if (m.count(s)) { m[s]++; }
        else { m[s] = 1; }
    }
    vector<pair<string, int>> ss;
    for (const auto& kv : m) {
        ss.push_back(kv);
    }
    sort(ss.begin(), ss.end(), [](const pair<string, int>& l, const pair<string, int>& r) {
        return l.second > r.second || (l.second == r.second && l.first < r.first);
    });
    int n = ss.front().second;
    for (const auto& kv : ss) {
        if (n != kv.second) break;
        cout << kv.first << endl;
    }
}

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

int H, W;
char tiles[110][110];

int main() {
  while (scanf("%d %d", &H, &W), H || W) {
    for (int i=0; i<H; i++) {
      for (int j=0; j<W; j++) {
	cin >> tiles[i][j];
      }
    }
    
    int x, y;
    x = y = 0;

    /*
    puts("debug");
    for (int i=0; i<H; i++) {
      for (int j=0; j<W; j++) {
	cout << tiles[i][j];
      }
      cout << endl;
    }
    puts("debugend");
    */
    
    while (tiles[y][x] != '.' && tiles[y][x] != '*') {   
      // printf("debug %d %d %c\n", x, y, tiles[y][x]);

      char c = tiles[y][x];
      tiles[y][x] = '*';
      if (c == '>') {
	x++;
      } else if (c == '<') {
	x--;
      } else if (c == '^') {
	y--;
      } else if (c == 'v') {
	y++;
      }

    }

    // printf("%c\n", tiles[y][x]);
    
    if (tiles[y][x] == '.') {
      printf("%d %d\n", x, y);
    } else {
      puts("LOOP");
    }
  }
}

Measured memory_bytes: 3164
import itertools
a = ["+", "-"]
b = ["+", "-"]
c = ["+", "-"]

#1行で受け取って各桁をリストにする
A = input()
l = [str(c) for c in A]

#4つの計算の間にはいる演算子の組み合わせを求めて
#計算して７になるのか全パターン実施
for v in itertools.product(a, b,c):
    #print ('v',v)
    ans =  l[0] + v[0] + l[1] + v[1] + l[2] + v[2] + l[3]
    #evalで計算
    if eval(ans) == 7:
      print(ans + "=7")
      exit()



Measured memory_bytes: 3060
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <vector>

const int mod = 1e9 + 7;

int main()
{
    int n;
    std::cin >> n;

    std::cout << (int)sqrt(n) * (int)sqrt(n) << std::endl;
}


Measured memory_bytes: 256
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    N, M = map(int, input().split())
    if N == 1 and M == 1:
        print(1)
    elif (N == 1 and M >= 2):
        print(M - 2)
    elif (N >= 2 and M == 1):
        print(N - 2)
    else:
        print((N - 2) * (M - 2))


if __name__ == '__main__':
    main()

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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> v(H);
  for (int i = 0; i < H; i++) cin >> v[i];

  for (int i = 0; i < W + 2; i++) cout << "#";
  cout << endl;
  for (int i = 0; i < H; i++) cout << "#" << v[i] << "#" << endl;
  for (int i = 0; i < W + 2; i++) cout << "#";
  cout << endl;
}


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

int main() {
  int a, b , c ,d;
  cin >> a >> b >> c >> d;
  
  if (a+b > c+d) {
    cout << "Left" << endl;
  }
  else if (a+b < c+d){
    cout << "Right" << endl;
  }
  else  {
    cout << "Balanced" << endl;
  }
}



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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	string s;
	cin>>s;
	bool yes=true;
	for(int i=0;i<s.size();++i){
		for(int j=i+1;j<s.size();++j){
			if(s.at(i)==s.at(j))yes=false;
		}
	}
	cout<<(yes?"yes"s:"no"s)<<"\n"s;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1e9
#define pb push_back
#define mp  make_pair
#define loop(a,n) for(long long i=a;i<n;i++)
#define vil vector<long long int>
#define vi vector<int>
#define sz(v) v.size()
#define setbits(x)          __builtin_popcountll(x)
using namespace std;


ll gcd(ll a,ll b){
    if(a==0)return b;
    return gcd(b%a,a);
}
bool isperfect(ll n){
    ll y=sqrt(n);
    if(n%y==0&&y*y==n)return true;
    return false;
}
bool comp(ll a,ll b){
    return a>b;
}
ll powi(ll a,ll b){
    ll ans=1;
    while(b>0){
        if(b&1)ans=ans*a;
        b=b>>1;
        a=a*a;
    }
    return ans;
}
bool isprime(ll n){
    for(int i=2;i*i<=n;i++){
        if(n%i==0)return false;
    }
    return true;
}
 bool prime[10000000];
void seive(){
   
    prime[1]=true;
    for(int i=2;i*i<10000000;i++){
        
         if(prime[i])continue;
            for(int j=i*i;j<10000000;j+=i){
                prime[j]=true;
            }
        
    }
}
int kmp(string t){
    int n=t.length();
    int kmp[n];
    kmp[0]=0;
    int i=0,r=1;
    while(r<n){
        if(t[r]==t[i]){
            kmp[r]=i+1;
            i++;
            r++;
        }
        else{
           if(i==0){
               kmp[r]=0;
               r++;
           } 
           else i=kmp[i-1];
        }
    }
    return kmp[n-1];
}
bool ispalin(ll n){
    ll ans=0;
    int i=n;
    while(n>0){
        int k=n%10;
        ans=10*ans+k;
        n=n/10;
    }
    return (i==ans);
}
#define mod 2019
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   string s;cin>>s;
   ll ans=0;
   map<int,int> m;
   int n=s.length();
   ll t=0;
    reverse(s.begin(), s.end());
   ll pot=1;
   m[0]++;
   for(int i=0;i<n;i++){
       t= (t + (s[i]-'0')*pot%mod)%mod;
       pot=(10*pot)%mod;
       ans+=m[(t)];
       m[(t)]++;
   }
   
   cout<<ans;
   
}

Measured memory_bytes: 3732
#include <bits/stdc++.h>
#include <complex>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

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

typedef vector<P> vp;
typedef vector<vp> matP;

mat dist(10,vec(10,-1));

int main() {
    cin>>A>>B>>C;
    A -= C;
    cout<<A/(B+C)<<endl;
}

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

int main(void) {
    string s;
    cin >> s;
    int length = s.length();
    for (int i = 0; i < length - 1; ++i) {
        if (s[i] == s[i + 1]) { 
            cout << i + 1  << " " << i + 2<< endl;
            return 0;
        }
    }
    for (int i = 0; i < length - 2; ++i) {
        if (s[i] == s[i + 2]) { 
            cout << i + 1 << " " << i + 3 << endl;
            return 0;
        }
    }
    cout << -1 << " " << -1 << endl;
    return 0;
}


Measured memory_bytes: 3748
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?2e18:1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	cin>>n;
	vi in(n);
	rep(i,n)cin>>in[i];
	if(n==1)cout<<"YES"<<endl;
	else{
		int co=0;
		rep(i,n)if(in[i]%2)co++;
		if(co%2)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}








Measured memory_bytes: 640
#include <bits/stdc++.h>
 
using namespace std;
 
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define FOR(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
 
typedef long long ll;
typedef long double ld;
typedef pair<ll, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;

const int MX = 300005;
int res[MX], n, acu = 0;
string s;

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);
    
    cin >> n >> s;
    for (int i = 0; i < n; i++) {
        res[i] += acu;
        if (s[i] == 'W')
            acu++;
    }

    acu = 0;
    for (int i = n - 1; i >= 0; i--) {
        res[i] += acu;
        if (s[i] == 'E')
            acu++;
    }

    cout << *min_element(res, res+n) << endl;

    return 0;
}


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


int main(){
	
	long long N;
	cin>>N;
	N*=2;
	long long n = N;
	vector<long long> Y;
	for(long long i=2;i*i<=N;i++){
		if(N%i==0){
			Y.push_back(i);
			N/=i;
			while(N%i==0){
				N/=i;
				Y.back() *= i;
			}
		}
	}

	if(N!=1)Y.push_back(N);
	
	long long ans = Inf;
	
	rep(i,(1<<Y.size())){
		long long x = 1LL;
		rep(j,Y.size()){
			if((i>>j)&1)x *= Y[j];
		}
		long long y = n/x;
		//cout<<x<<','<<y<<','<<endl;
		vector<long long> r = {x,y};
		vector<long long> m = {0LL,(y*2 - 1)%y};
		pair<long long,long long> C = crt(m,r);
		
		if(C.second==0)continue;
		if(C.first==0)ans = min(ans,C.second);
		else ans = min(ans,C.first);
	}
	
	cout<<ans<<endl;
	
	return 0;
}
 

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define IOS {ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
#define endl "\n"
#define int long long int
#define f(i, a, b) for(int i=a; i<b; i++)
#define fb(i, a, b) for(int i=a; i>=b; i--)
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define S(x) (int) x.size()
#define LB lower_bound
#define UB upper_bound
#define fp(x, y) fixed<<setprecision(y)<<x
#define M 100005
#define mod 1000000007
#define PI 3.141592653589793238462643383279502884
using namespace std;

void solve()
{
	int a, b;
	cin>>a>>b;
	cout<<a*b;
}

int32_t main()
{
    IOS
    int t = 1;
    // cin>>t;
    f(tno, 1, t+1)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
const ll MOD2=(ll)998244353;
const ll INF=(ll)1e18+10;
const double PI = 2.0*acos(0);

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};

void solve(int ca){
    int N; cin>>N;
    vector<pair<int,int>> inc,dec;
    string str;
    for (int i = 0; i < N; ++i) {
        cin>>str;
        int height=0,base=0;
        for(char c:str){
            if(c=='(') ++height;
            else --height;
            chmin(base,height);
        }
        if(height>0) inc.emplace_back(base,height);
        else dec.emplace_back(base-height,-height);
    }
    sort(inc.rbegin(),inc.rend());
    sort(dec.rbegin(),dec.rend());
    int up=0;
    for(auto i:inc){
        if(up+i.first<0){
            cout<<"No"<<endl;
            return;
        }
        up+=i.second;
    }
    int down=0;
    for(auto i:dec){
        if(down+i.first<0){
            cout<<"No"<<endl;
            return;
        }
        down+=i.second;
    }
    if(up==down){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

//#define MULTI
int main() {
#ifdef MULTI
    int N; cin>>N;
    for (int i = 0; i < N; ++i) {
        solve(i+1);
    }
#else
    solve(0);
#endif
    return 0;
}


Measured memory_bytes: 11164
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	char c;
	cin >> c;
	if(c <= 'Z') cout << "A" << endl;
	else cout << "a" << endl;
	return 0;
}

Measured memory_bytes: 3632
def main():
    H, W = map(int, input().split())
    C = []
    for _ in range(H):
        C.append(input())
    D = []
    for i in range(H):
        D.append(C[i])
        D.append(C[i])
    return D

if __name__ == '__main__':
    D = main()
    for i in range(len(D)):
        print(D[i])

Measured memory_bytes: 3064
a,b,c,d=map(int,input().split())
def gcd(x,y):
  z=x%y
  if z==0:
    return y
  else:
    return gcd(y,z)
ans=(b-b//c-b//d+b//(c*d//gcd(c,d)))-((a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//gcd(c,d)))
print(ans)

Measured memory_bytes: 3060
# coding=utf-8

class Tree():
    def __init__(self, init_field):
        self.root = init_field

    def search(self, field_id, field):
        global final_queen_pos
        #print("field_id:", field_id)
        #field.print_field()
        q_r = rest_row[field_id - n]
        if final_queen_pos:
            return None
        else:
            for q_c, cell in enumerate(field.state[q_r]):
                if cell == 0:
                    if final_queen_pos:
                        break
                    if field_id == 7:
                        field.queen_pos.append([q_r, q_c])
                        final_queen_pos = field.queen_pos
                        break
                    else:
                        next_field = Field(field_id + 1, field)
                        field.children.append(next_field)
                        next_field.update(q_r, q_c)
                        self.search(field_id + 1, next_field)
                else:
                    continue

class Field():
    def __init__(self, field_id, parent=None):
        self.id = field_id
        self.parent = parent
        self.children = []

        if field_id == 0:
            self.state = [[0 for _ in range(W)] for H in range(H)]
            self.queen_pos = []
        else:
            self.state = []
            self.queen_pos = []
            for row in self.parent.state:
                x = row.copy()
                self.state.append(x)
            for parent_queen_pos in self.parent.queen_pos:
                self.queen_pos.append(parent_queen_pos)

    def update(self, q_r, q_c):
        self.queen_pos.append([q_r, q_c])
        for i in range(8):
            self.state[q_r][i] = 1
            self.state[i][q_c] = 1
        summ = q_c + q_r
        diff = q_c - q_r
        for i in range(8):
            if (0 <= i + diff < 8):
                self.state[i][i + diff] = 1
            if (0 <= summ - i < 8):
                self.state[i][summ - i] = 1

    def print_field(self): #for debug
        print("queen_pos:", self.queen_pos)
        for row in self.state:
            print(*row)


H, W = 8, 8
n = int(input())
init_field = Field(0)
tree = Tree(init_field)
field_list = [init_field]
rest_row = [i for i in range(8)]
queen_pos = []
final_queen_pos = None
final_result = [["." for _ in range(8)] for _ in range(8)]

for _ in range(n):
    r, c = map(int, input().split())
    queen_pos.append([r, c])
    rest_row.remove(r)

if n < 8:
    i = 0
    prev_field = init_field
    for q_r, q_c in queen_pos:
        i += 1
        field = Field(i, prev_field)
        field.update(q_r, q_c)
        field_list.append(field)
        prev_field.children = [field]
        prev_field = field

    tree.search(i, field)

    for q_r, q_c in final_queen_pos:
        final_result[q_r][q_c] = "Q"

    for row in final_result:
        print("".join(row), end = "\n")

else:
    for q_r, q_c in queen_pos:
        final_result[q_r][q_c] = "Q"

    for row in final_result:
        print("".join(row), end = "\n")

Measured memory_bytes: 7912
#include <bits/stdc++.h>
using namespace std;
int main(){

  int N;
  cin >> N;
  char alf[]={'z','a','b','c','d','e','f','g','h','i','j'};

  int combi = pow(2,20);
  vector<vector<string>> data(combi,vector<string>(10));
  data.at(0).at(0) = alf[1];
  
  int input_num,output_num,str_count;
  
  for (int i_clm=1; i_clm<N; i_clm++){

    if(i_clm==1){
      output_num = 0;
      input_num = 1;
    }else{
      input_num = output_num;
      output_num = 0;
    }
        
    for(int i_row_b=0; i_row_b < input_num; i_row_b++){
      
      //元となる文字列から文字の種類を取得
      str_count=0;
      for(int i_len=0; i_len < strlen(alf); i_len++){
        for(int ii_len=0; ii_len < data.at(i_row_b).at(i_clm-1).length(); ii_len++){
          if (alf[i_len] == data.at(i_row_b).at(i_clm-1)[ii_len]){
            str_count++;
            break;
          }
        }
      }

      //文字列を出力 
      for(int i_row_a=0; i_row_a < str_count+1; i_row_a++){
        data.at(output_num).at(i_clm) = data.at(i_row_b).at(i_clm-1) + alf[i_row_a+1];
        output_num++;
      }
    }  
  
  }
    
  for (int i=0; data.at(i).at(N-1)!="";i++){
    cout << data.at(i).at(N-1) << endl;  
  }

}


Measured memory_bytes: 133248
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int pn[55]={11,31,41,61,71,91,101,131,151,181,
            191,211,241,251,271,281,311,331,401,421,
            431,461,491,521,541,571,601,641,661,691,
            701,751,761,811,821,881,911,941,971,991,
            1021,1051,1061,1091,1151,1171,1181,1201,1231,1291,
            1301,1321,1361,1381,1451
            };
int main(void){
    int n;cin>>n;
    vector<int> pr(55556,0);
    rep(i,55556){
        if(i==0||i==1)continue;
        for(int j=i*2;j<=55555;j+=i){
            if(pr[j]==0)pr[j]++;
        }
    }
    int cou=0;
    rep(i,55556){
        if(i==0||i==1)continue;
        if(pr[i]==0&&i%5==1){
            cout<<i<<" ";
            cou++;
        }
        if(cou==n)break;
    }
    cout<<endl;
}


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

int main() {
	int N, M;
	while( cin >> N >> M, N&&M ) {
		vector<int>D( 200 );
		for( size_t i = 0; i < N; i++ ) {
			int L;
			cin >> L;
			for( size_t j = 0; j < L; j++ ) {
				int X;
				cin >> X;
				D[X]++;
			}
		}
		int ans = 0;
		M--;
		for( size_t i = 0; i < 200; i++ ) {
			if( D[i] > M ) {
				ans = i;
				M = D[i];
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 3112
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
  int A, B, C, D ,E ,F;
  string S,Sa,Sb,Sc;
  cin >> A >> B >> C;
  D = max({A, B , C});
  E = min({A, B, C});
  cout << D - E << endl;
        return 0;
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int,input().split()))
mochi=1000
x=A[0]
y=0
k=0
kabu=0
for i in range(1,N):
    if i<N-1:
        if A[i-1]<=A[i] and A[i]>=A[i+1]:
            x=A[i]
            y=min(A[k:i])
            kabu=mochi//y
            mochi-=kabu*y
            mochi+=kabu*x
            k=i
    else:
        if A[i-1]<A[i]:
            x=A[i]
            y=min(A[k:i])
            kabu=mochi//y
            mochi-=kabu*y
            mochi+=kabu*x
            k=i

print(mochi)

Measured memory_bytes: 9008
#include<stdio.h>

int main(){
	int n,i,tmp;
	long long sum=0,max=-1000000,min=1000000;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&tmp);
		if(max<tmp) max=tmp;
		if(min>tmp) min=tmp;
		sum+=tmp;
	}
	printf("%lld %lld %lld\n",min,max,sum);
	return 0;
}


Measured memory_bytes: 2696
import java.util.Scanner;

public class Main{
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int i = 1;
		while (true) {
			int a = sc.nextInt();
			if (a == 0) {
				break;
			}
			System.out.println("Case " + i + ": " + a);
			++i;
		}
		sc.close();
	}

}



Measured memory_bytes: 42432
use v5.18; # strict say state
use warnings;

my ($n, $k) = split / /, <STDIN>;
my @a = split / /, <STDIN>;
@a = sort { $a <=> $b } @a;
my $MOD = 1e9 + 7;
my $modpow = sub {
  my ($a, $n) = @_;
  my $r = 1;
  while ($n > 0) {
    $r = $r * $a % $ MOD if $n & 1;
    $a = $a * $a % $MOD;
    $n >>= 1;
  }
  return $r;
};
my $modinv = sub {
  my $a = shift;
  $modpow->($a, $MOD - 2);
};
my (@fac, @finv);
$fac[0] = 1;
$finv[0] = 1;
for my $i (1..$n) {
  $fac[$i] = $fac[$i-1] * $i % $MOD;
  $finv[$i] = $modinv->($fac[$i]);
}
my $combi = sub {
  my ($n, $k) = @_;
  $fac[$n] * ($finv[$n-$k] * $finv[$k] % $MOD) % $MOD;
};
my $ans = 0;
for (my $i=0; $i<=$n-$k; $i++) {
  my $c = $combi->($n-$i-1, $k-1);
  $ans += ($MOD + $a[$n-$i-1]) * $c;
  $ans %= $MOD;
  $ans += ($MOD - $a[$i]) * $c;
  $ans %= $MOD;
}
say $ans;

Measured memory_bytes: 22676
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
      cin>>n;

       int arr[n];
        for(int i=0;i<n;i++)
          cin>>arr[i];

       long int sum=0;
        for(int i=0;i<n;i++)
          for(int j=i+1;j<n;j++)
            sum+=arr[i]*arr[j];

          cout<<sum;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<stdio.h>
#include<time.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(void) {
	vector<int> n(3);
	REP(i, 3) cin>>n[i];
	sort(ALL(n));
	cout<<n[0]<<" "<<n[1]<<" "<<n[2]<<endl;
}

Measured memory_bytes: 3068
using System;
namespace AGC014A
{
    class Program
    {
        static bool Check(long a, long b, long c)
        {
            return a % 2 == 0 && b % 2 == 0 && c % 2 == 0;
        }
        static void Main()
        {
            string[] s = Console.ReadLine().Split(' ');
            long a, b, c;
            a = long.Parse(s[0]);
            b = long.Parse(s[1]);
            c = long.Parse(s[2]);
            if (a == b && b == c && Check(a, b, c))
            {
                Console.WriteLine(-1);
                Environment.Exit(0);
            }
            for (long i = 0; ; i++)
            {
                if (!Check(a, b, c))
                {
                    Console.WriteLine(i);
                    Environment.Exit(0);
                }
                long at = a, bt = b, ct = c;
                a = (bt + ct) / 2;
                b = (at + ct) / 2;
                c = (at + bt) / 2;
            }
        }
    }
}

Measured memory_bytes: 11092
import itertools

N,M = map(int,input().split())

con = [[] for _ in range(N)]
for i in range(M):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    con[a].append(b)
    con[b].append(a)

per = list(itertools.permutations(range(N)))

count = 0

for x in per:
    if x[0] != 0:
        continue
    det = 0
    for k in range(N-1):
        if x[k+1] in con[x[k]]:
            continue
        else:
            det = -1
            break
    if det == 0:
        count += 1

print(count)




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

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int x; cin >> x;
    if(x >= 30) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define si(x) (ll)((x).size())
#define pb push_back
#define F first
#define S second
#define rep(i,n) for(ll i=0;i<n;i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define per1(i,n) for(ll i=n;i>=1;i--)
#define all(x) (x).begin(), (x).end()
#define make_unique(x) (x).resize(unique(all(x))-(x).begin())
const int N = 2e5;
void solve()
{
    ll n, x, y, w, h, maxlevel = 0;
    cin >> w >> h >> n;

    cout << (n + max(w, h) - 1) / max(w, h);

}

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    // cin >> t;

    while(t--)
    {
        solve();
        // cout << endl;
    }


}




Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define all(a)          (a).begin(), (a).end()
#define sort(a)         sort(all(a))
#define uniq(a)         sort(a);(a).erase(unique(all(a)), (a).end())
#define reverse(a)      reverse(all(a))
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }
#define pb              push_back
#define fst             first
#define int             long long
#define INF             __LONG_LONG_MAX__

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

ll mypow(ll x, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    n >>= 1;
  }
  return res;
}

vector<P> factor(ll n) {
  vector<P> ret;
  ll q = n;
  for (ll d = 2; d * d <= n; d++) {
    if (q % d > 0) continue;
    ll cnt = 0;
    while (q % d == 0) {
      cnt++;
      q /= d;
    }
    ret.push_back(make_pair(d, cnt));
  }
  if (q > 1) ret.push_back(make_pair(q, 1));
  return ret;
}

void solve() {
  ll n; cin >> n;
  map<ll, ll> map;
  rep(i, n) {
    ll ai; cin >> ai;
    vector<P> v = factor(ai);
    for (P vi : v) {
      if (map.find(vi.first) == map.end()) map.insert(make_pair(vi.first, vi.second));
      else map[vi.first] = max(map[vi.first], vi.second);
    }
  }

  ll ans = 1;
  for (auto it : map) {
    ans *= mypow(it.first, it.second);
  }
  outl(ans);
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}



Measured memory_bytes: 3172
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; }
template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; }
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cout << H << " "; debug_out(T...); }
#ifdef _DEBUG
  #define debug(...) debug_out(__VA_ARGS__)
#else
  #define debug(...) 
#endif

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  int n;
  cin >> n;
  int res = n/1.08;
  for (int i = 1; i <= res+1; ++i) {
    int temp = i*1.08;
    if (temp == n) {
      cout << i << endl;
      return 0;
    }
  }
  cout << ":(" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e9;
#define sz              200005
#define Fast            ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

vector < ll > arr,brr;

int main(){
    Fast;
    int a,b,c, i,j,k, n,m,t, cs=1;

    cin>>n>>m>>k;
    for(i=0; i<n; i++){
        cin>>a;
        arr.push_back(a);
        if(i)arr[i]+=arr[i-1];
    }
    for(i=0; i<m; i++){
        cin>>a;
        brr.push_back(a);
        if(i)brr[i]+=brr[i-1];
    }
    int tot;
    a=upper_bound(arr.begin(),arr.end(),k)-arr.begin();
    b=upper_bound(brr.begin(),brr.end(),k)-brr.begin();
    tot=max(a,b);

    for(i=0; i<n; i++){
        if(arr[i]>k){
            b=upper_bound(brr.begin(),brr.end(),k-arr[i])-brr.begin();
            tot=max(tot,b);
            break;
        }
        else{
            a=i;
            b=upper_bound(brr.begin(),brr.end(),k-arr[i])-brr.begin();
            tot=max(tot,a+b+1);
        }
    }
    cout<<tot<<endl;


    return 0;
}



Measured memory_bytes: 7892
#include <stdio.h>

int main(void)
{
    int H, R;

    scanf("%d%d", &H, &R);
    
    if (H + R == 0){
        printf("0\n");
    }
    else if (H + R < 0){
        printf("-1\n");
    }
    else {
        printf("1\n");
    }
    
    return (0);
}



Measured memory_bytes: 2056
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp> 
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> pseudo_set;
#define ll long long
#define vi vector<int>
#define si set<int> 
#define mii map<int,int>
#define pb push_back
#define pii pair<int,int>
#define extract_word(s)  stringstream str(s); while(str>>word)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define SET(s) cout<<fixed<<setprecision(s)
#define chotu ((int)1e9+7)
#define set0(a) memset(a,0,sizeof(a))

//sieve generation begin
vi PRIME;
void sieve(int n)
{
	bool a[n+1];
	memset(a,0,sizeof(a));
	a[0]=1;
	a[1]=1;
	for(int i=2;i*i<=n;i++)
	{
		if(a[i]==0)
		{
			for(int j=i*i;j<=n;j+=i)
			a[j]=1;
		}
	}
	for(int i=2;i<=n;i++)
	{
		if(a[i]==0)
		PRIME.pb(i);
	}
}
//sieve generation end
ll gcd(ll a,ll b)
{
	while(b%a)
	{
		ll c=b;
		b=a;
		a=c%a;
	}
	return a;
}
ll bigpow(ll x,ll y)
{
	if(y==0)
	return 1;
	else if(y&1)
	{
		return (x*bigpow((x*x)%chotu,(y-1)/2))%chotu;
	}
	else 
	return bigpow((x*x)%chotu,y/2);
}
//fastscanning
void fast_longint(ll &number) 
{ 
    //variable to indicate sign of input number 
    bool negative = false; 
    register ll c; 
  
    number = 0; 
    c = getchar(); 
    if (c=='-') 
    { 
        
        negative = true; 
  
        c = getchar(); 
    } 
    for (; (c>47 && c<58); c=getchar()) 
        number = number *10 + c - 48; 
    if (negative) 
        number *= -1; 
}
void fast_int(int &number) 
{ 
    //variable to indicate sign of input number 
    bool negative = false; 
    register int c; 
  
    number = 0; 
    c = getchar(); 
    if (c=='-') 
    { 
        
        negative = true; 
  
        c = getchar(); 
    } 
    for (; (c>47 && c<58); c=getchar()) 
        number = number *10 + c - 48; 
    if (negative) 
        number *= -1; 
}
void solve()
{
int a,b,c,d;
cin>>a>>b>>c>>d;
while(a>0&&c>0)
{
	c=c-b;
	if(c<=0)
	{
		cout<<"Yes";
		break;
	}
	a=a-d;
	if(a<=0)
	{
		cout<<"No";
		break;
	}
}
}
int main()
{
//code
fastio
int t;
t=1;
while(t--)
{
	solve();
	cout<<'\n';
}

}

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

#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)

using namespace std;

template <class T>
using vec = std::vector<T>;
typedef long long ll;
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1LL << 60;

const double PI = acos(-1.0);

// long long積のオーバーフロー検出
bool detect_mul_overflow(ll a, ll b)
{
    return a >= LONG_MAX / b;
}

int lcm(int a, int b)
{
    //最小公倍数
    return a / __gcd(a, b) * b;
}

struct edge
{
    int from, to, cost;
};

// int型の2次元配列(3×4要素の)の宣言
// vector<vector<int>> data(3, vector<int>(4));

int a;

int main()
{
    cin >> a;
    if (a <= 599)
    {
        cout << 8 << endl;
    }
    else if (a >= 600 && a <= 799)
    {
        cout << 7 << endl;
    }
    else if (a >= 800 && a <= 999)
    {
        cout << 6 << endl;
    }
    else if (a >= 1000 && a <= 1199)
    {
        cout << 5 << endl;
    }
    else if (a >= 1200 && a <= 1399)
    {
        cout << 4 << endl;
    }
    else if (a >= 1400 && a <= 1599)
    {
        cout << 3 << endl;
    }
    else if (a >= 1600 && a <= 1799)
    {
        cout << 2 << endl;
    }
    else if (a >= 1800)
    {
        cout << 1 << endl;
    }

    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(x.rbegin(), x.rend())
#define REVERSE(x) reverse(ALL(x))
#define MAX(x) *max_element(ALL(x))
#define MAXI(x) max_element(ALL(x)) - x.begin()
#define SUM(x) accumulate(ALL(x), 0ll)
#define COUNT(x, y) count(ALL(x), y);
#define ANS cout << ans << "\n"
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YN YES else NO
#define yn Yes else No
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(x) cerr << "[debug] " << #x << ": " << x << "\n";
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(z, v.size()) cerr << " " << v[z]; \
  cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;
using vp = vector<P>;
using vs = vector<string>;

template <typename T>
inline istream& operator>>(istream& i, vector<T>& v) {
  rep(j, v.size()) i >> v[j];
  return i;
}

template <typename T1, typename T2>
inline istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

signed main() {
  init();
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  ll ans = -INF;
  chmax(ans, a * c);
  chmax(ans, a * d);
  chmax(ans, b * c);
  chmax(ans, b * d);
  ANS;
  return 0;
}

Measured memory_bytes: 3652
#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 equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int INF = 1000000005;
const long double EPS = 1e-10;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  
  rep(i, s.size()) {
    int t = 65 + ((int)s[i] - 65 + n) % 26;
    s[i] = (char)t;
  }
  cout << s << endl;


  
  return 0;
}

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

int main()
{
	int a,b;
	cin>>a>>b;
	for(size_t i = 1; i<=b; i++)
	{
		if((a*i)%b==0)
		{
			cout<<a*i<<endl;
			break;
		}
	}
}



Measured memory_bytes: 256
#include <iostream>
#include <string>

int main() {
  std::string s[3];
  std::cin >> s[0] >> s[1] >> s[2];

  bool flag = (s[0][s[0].size() - 1] == s[1][0])
             && (s[1][s[1].size() - 1] == s[2][0]);
  if ( flag ) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    int N, L;
    cin >> N >> L;
    int min_index = 1, min_taste = abs(L), ans = 0;
    for (int i = 1; i <= N; i++) {
        if (abs(L + i - 1) < min_taste) {
            min_taste = abs(L + i - 1);
            min_index = i;
        }
    }
    for (int i = 1; i <= N; i++) {
        if (i == min_index) {
            ;
        } else {
            ans += L + i - 1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <string>

using namespace std;

int main() {
	long long a, b, c;
	scanf("%lld", &a);
	scanf("%lld.%lld", &b, &c);

	long long d = b * 100 + c;
	long long ans = a * d / 100;
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 3232