akhauriyash/Code-Regression huggingface dataset:
def solve():
  n = int(input())
  time = 0
  x,y = 0,0
  travel = True
  for i in range(n):
    t,nx,ny = (int(i) for i in input().split())
    timediff = t-time
    xdif = abs(nx-x)
    ydif = abs(ny-y)
    
    movement = xdif + ydif
    if movement > timediff:
      travel = False
    elif movement == time:
      pass
    else:
      if movement%2 == timediff%2:
        pass
      else:
        travel = False
    x,y = nx,ny
    time = t
  print("Yes") if travel else print("No")
    
solve()

Measured memory_bytes: 3064
function Main(input) {
    var ab = input.split(' ')
    var a = parseInt(ab[0], 10);
    var b = parseInt(ab[1], 10);

    var res = Math.ceil((b-1) / (a-1));

    console.log(res);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
#include <iostream>
#include <stdio.h>

using namespace std;

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

  int num = 0;
  for(int i = 1; i <= n; i++){
    if(i % 2){
      num++;
    }
  }

  double k = (double)num / n;

  printf("%.10f\n", k);

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/


#define INF INT_MAX/2
int N, F[101][11], P[101][11];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) rep(j, 0, 10) cin >> F[i][j];
    rep(i, 0, N) rep(j, 0, 11) cin >> P[i][j];

    int ans = -INF;
    rep(msk, 1, 1 << 10) {
        int sm = 0;
        rep(i, 0, N) {
            int c = 0;
            rep(j, 0, 10) if (msk & (1 << j)) if (F[i][j]) c++;
            sm += P[i][c];
        }
        ans = max(ans, sm);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>

struct a {
    intmax_t i;
    intmax_t A;
};

int compare (const void *a, const void *b)
{
    if(((struct a *)a)->A < ((struct a *)b)->A)
        return -1;
    if(((struct a *)a)->A > ((struct a *)b)->A)
        return 1;
    return 0;
}

int main (void)
{
    intmax_t N;
    struct a a[(int)1e5];
    intmax_t ans = 0;

    scanf("%jd", &N);
    for(size_t i = 0; i < N; i++) {
        scanf("%jd", &a[i].A);
        a[i].i = (i + 1);
    }

    qsort(a, N, sizeof(struct a), compare);

    for (size_t i = 0; i < N; i++) {
        printf("%jd", a[i].i);
        if (i < (N - 1)) 
            printf(" ");
        else
            printf("\n");
    }

    return 0;
}


Measured memory_bytes: 3324
#include<bits/stdc++.h>
using namespace std;
bool visit[100005];
int main()
{
    int i,j,k,n,m,s,c;
    memset(visit,false,sizeof(visit));
    vector<int>v;
    v.push_back(2);
    for(i=3;i*i<=100033;i+=2){
        if(visit[i]==false){
            for(j=i*i;j<=100033;j+=i+i) visit[j]=true;
        }
    }
    for(i=3;i<=100033;i+=2){if(visit[i]==false)v.push_back(i);}
    cin>>n;
    m=lower_bound(v.begin(),v.end(),n)-v.begin();
    cout<<v[m]<<endl;

}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <iomanip>

using namespace std;

mt19937 Rand(16092002);
mt19937_64 BigRand(16092002);

typedef long long ll;

const int N = 300 + 7;
const int M = 1e9 + 7;

int dp[N][N][N];
vector <pair <int, int> > gr[N];

inline int add(int a, int b)
{
    int c = a + b;
    if (c >= M)
    {
        c -= M;
    }
    return c;
}

int main()
{
#ifdef ONPC
    freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#endif
    int n;
    cin >> n;
    int m;
    cin >> m;
    for (int i = 0; i < m; i++)
    {
        int l, r, x;
        cin >> l >> r >> x;
        gr[r].push_back({l, x});
    }
    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++)
    {
        for (int a = 0; a < n; a++)
        {
            for (int b = 0; b < n; b++)
            {
                vector <int> good(3, 1);
                for (auto to : gr[i + 1])
                {
                    {
                        int A = i + 1, B = a, C = b;
                        int cnt = 0;
                        cnt += (A >= to.first);
                        cnt += (B >= to.first);
                        cnt += (C >= to.first);
                        good[0] &= (cnt == to.second);
                    }
                    {
                        int A = i + 1, B = i, C = b;
                        int cnt = 0;
                        cnt += (A >= to.first);
                        cnt += (B >= to.first);
                        cnt += (C >= to.first);
                        good[1] &= (cnt == to.second);
                    }
                    {
                        int A = i + 1, B = a, C = i;
                        int cnt = 0;
                        cnt += (A >= to.first);
                        cnt += (B >= to.first);
                        cnt += (C >= to.first);
                        good[2] &= (cnt == to.second);
                    }
                }
                if (good[0])
                {
                    dp[i + 1][a][b] = add(dp[i + 1][a][b], dp[i][a][b]);
                }
                if (good[1])
                {
                    dp[i + 1][i][b] = add(dp[i + 1][i][b], dp[i][a][b]);
                }
                if (good[2])
                {
                    dp[i + 1][a][i] = add(dp[i + 1][a][i], dp[i][a][b]);
                }
            }
        }
    }
    int ans = 0;
    for (int a = 0; a < n; a++)
    {
        for (int b = 0; b < n; b++)
        {
            ans = add(ans, dp[n][a][b]);
        }
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 112512
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, l, r) for (int i = (l); i < (r); i++)

int main() {
    int h, w;
    while (cin >> h >> w, h) {
        vector<vector<int>> field(h, vector<int>(w));
        rep(i, 0, h) rep(j, 0, w) cin >> field[i][j];
        int ans = 0;
        rep(top, 0, h) rep(bottom, top + 2, h)      // [top, bottom]
        rep(left, 0, w) rep(right, left + 2, w) {   // [left, right]
            int edge_min = 10, pond_max = -1, pond_sum = 0, pond_cnt = 0;
            rep(i, top, bottom + 1) rep(j, left, right + 1) {
                bool is_edge = i == top || i == bottom;
                is_edge |= j == left || j == right;
                if (is_edge) {
                    edge_min = min(edge_min, field[i][j]);
                } else {
                    pond_max = max(pond_max, field[i][j]);
                    pond_sum += field[i][j];
                    pond_cnt += 1;
                }
            }
            if (edge_min > pond_max) {
                ans = max(ans, edge_min * pond_cnt - pond_sum);
            }
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3068
import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    var count:Int = 0
    val w = cin.next()
    
    while(true){
	    var s = cin.next()
	    if(s == "END_OF_TEXT") break
    	s = s.toLowerCase()
	    if(s == w){
	    count++ 
	}
	
    }
    println(count)

}


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

int main(){
	string S;
	cin >> S;
	if(S[0] == '9' || S[1] == '9') cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

#define ll long long int
#define str string

ll MOD = 1000000007, INFL = 1ll << 60, INF = 1 << 30;
pair <ll, ll> A[10000000] = {}, X[1000000] = {};
int dy[] = { 0, 0, 1, -1 }, dx[] = { 1, -1, 0, 0 };
vector <ll> v;
ll a = 0, b = 0, c = 0, n = 0, sum = 0, max = INF;
str S;
ll ans = 0;

int findDigits(int n) {
	int i = 0;
	while (n > 0) {

		sum += n % 10;
		n /= 10;
		i++;
	}
	return i;
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//Code Line
	cin >> A[0].second >> A[1].second >> A[2].second >> A[3].second >> A[4].second;
	for (int i = 0; i < 5; i++) {
		A[i].first = A[i].second % 10;
		if (A[i].second % 10 == 0)A[i].first = 100;
	}
	sort(A, A + 5);
	for (int i = 4; i > 0; i--) {
		if (A[i].second % 10 != 0) {
			A[i].second = A[i].second / 10;
			A[i].second *= 10;
			A[i].second += 10;
		}
		else {
			A[i].second = A[i].second / 10;
			A[i].second *= 10;
		}
		ans += A[i].second;
	}
	cout << ans + A[0].second << endl;
	cin >> n;
	//Code Line
	return 0;
}


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

int main() {
    // your code goes here
    ll i,n,x[100005],ans=0,mod=1e9+7,d,mm,f=1,seq=1;
    cin >> n;
    for(i=0;i<n;i++){
        cin >> x[i];
        if(i!=0){
            if(i!=1) f=(f*(i-1))%mod;
            d=x[i]-x[i-1];
            ans=(ans*i)%mod;
            if(i!=1){
                seq=(seq*i)%mod;
                seq=(seq+f)%mod;
            }
            mm=(seq*d)%mod;
            ans=(ans+mm)%mod;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
macro_rules! input {
    ($ttype:ty) => {
        {
            let mut input = String::new();
            let _= std::io::stdin().read_line(&mut input);
            input.trim().parse::<$ttype>().unwrap()
        }
    };

    ($($ttype:ty),*) => {
        {
            use std::io::BufRead;
            let mut input = String::new();
            let stdin = std::io::stdin();
            let _ = stdin.lock().read_line(&mut input);
            let mut iter = input.trim().split_whitespace();
            (
                $(iter.next().unwrap().parse::<$ttype>().unwrap(),)*
            )
        }
    };

    ($ttype:ty; $x:expr) => {
        {
            use std::io::BufRead;
            let mut input = String::new();
            let stdin = std::io::stdin();
            let _ = stdin.lock().read_line(&mut input);
            let v: Vec<$ttype> = input
                .trim()
                .split_whitespace()
                .map(|x| x.parse().unwrap())
                .collect();
            v
        }
    };

    ($ttype:ty; $x:expr; $y:expr) => {
        {
            use std::io::BufRead;
            let mut matrix = Vec::with_capacity($y);
            for _ in 0..$y {
                let mut input = String::new();
                let stdin = std::io::stdin();
                let _ = stdin.lock().read_line(&mut input);
                let v: Vec<$ttype> = input
                    .trim()
                    .split_whitespace()
                    .map(|x| x.parse().unwrap())
                    .collect();
                matrix.push(v);
            }
            matrix
        }
    };
}

fn gcd(x: i64, y: i64) -> i64 {
    if x % y == 0 {
        y
    } else {
        gcd(y % x, x)
    }
}

fn lcm(x: i64, y: i64) -> i64 {
    if x > y {
        (y / gcd(x, y)) * x
    } else {
        (y / gcd(y, x)) * x
    }
}

fn main() {
    let n = input!(usize);
    let mut t: Vec<i64> = Vec::with_capacity(n);
    for _ in 0..n {
        t.push(input!(i64));
    }
    t.sort();

    let mut answer = t.pop().unwrap();
    while let Some(x) = t.pop() {
        answer = lcm(answer, x);
    }
    println!("{}", answer);
}

Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <queue>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define fr(i,k,N) for(ll i=k; i<N;i++)
#define rep(i,N) for(ll i=0; i<N;i++)
#define alll(v) v.begin(),v.end()
using namespace std;
template <class X> void pr(X test){cout<<test<<endl;}
template <class X> void prr(X test){for(auto it:test){cout<<it<<endl;}}
template <class X> void prrr(X test){int f=0;for(auto it:test){cout<<(f++!=0?" ":"")<<it;}cout<<endl;}

class UF { // union find from https://github.com/kartikkukreja/blog-codes (MIT)
    // [usage]
    // auto uf = new UF(n);
    // uf->merge(l, r); // 0 <= l, r <= n-1
    // ...
public:
    int *id; // inner id
    int cnt; // number of all vartices
    int *sz; // sz[i] means size of i's set
    UF(int N)   {
        cnt = N;
        id = new int[N];
        sz = new int[N];
        for(int i=0; i<N; i++) {
            id[i] = i;
            sz[i] = 1;
        }
    }
    ~UF() {
        delete [] id;
        delete [] sz;
    }
    int find(int p) {
        int root = p;
        while (root != id[root]) root = id[root];
        while (p != root) {
            int newp = id[p];
            id[p] = root;
            p = newp;
        }
        return root;
    }
    void merge(int x, int y) {
        int i = find(x);
        int j = find(y);
        if (i == j) return;
        
        if (sz[i] < sz[j]) {
            id[i] = j;
            sz[j] += sz[i];
        } else {
            id[j] = i;
            sz[i] += sz[j];
        }
        cnt--;
    }
    bool connected(int x, int y) {
        return find(x) == find(y);
    }
    int count() {
        return cnt;
    }
};

// return sorted 約数s 1 <= x <= n
vector<ll> divv(ll n) {
  vector<ll> v;
  for(ll i = 1; i*i <= n; i++) {
    if(n%i == 0) {
      v.push_back(i);
      if(i*i != n) v.push_back(n/i);
    }
  }
  sort(alll(v));
  return v;
}

int main() {
    ll n,m,l;
    cin>>n>>m>>l;

    rep(i, 10) {
        auto y = n * l - m;
        pr(y);
        l = y;
    }
    return 0;
}

Measured memory_bytes: 888
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


int main(){
	int a; cin >> a;
	string s; cin >> s;
	if(a >= 3200) cout << s << endl;
	else cout << "red" << endl;
}



Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int a[n+5];
    for(int i=0;i<n;i++)
    cin>>a[i];
    int sum=0;
    for(int i=0;i<n;i++)
    sum=sum+a[i];
    int count=0;
    for(int i=0;i<n;i++)
    {
        if(a[i]*4*m>=sum)
        count++;
    }
    if(count>=m)
    cout<<"Yes";
    else
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll,ll>;

ll solve() {
    ll N;
    cin >> N;
    vector<ll> X(N), L(N);
    vector<pii> a;
    for ( int i = 0; i < N; i++ ) {
        cin >> X[i] >> L[i];
        a.push_back(pii(X[i]+L[i], X[i]-L[i]));
    }
    sort(a.begin(), a.end());
    ll ans = 0, p = -1e11;
    for ( int i = 0; i < N; i++ ) {
        if ( p <= a[i].second ) {
            p = a[i].first;
            ans++;
        }
    }

    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3956
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
//setprecision(15)有効数字15桁
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
struct edge {
    int to, cost;
};
int n, m;
vector<bool> used(1000000,false);
vector<vector<pair<int,int> > > g(1000000);
vector<int> score(1000000);
bool dfs(int n){
    used[n]=true;
    for(int i=0;i<g[n].size();i++){
        if(!used[g[n][i].first]){
        score[g[n][i].first]=g[n][i].second+score[n];
        if(!dfs(g[n][i].first)) return false;
        }
        else{
            if(score[g[n][i].first]!=g[n][i].second+score[n]){
                return false;
            }
            else{
            }
        }
    }
    return true;
}
const int MAX_N=100000;
int par[MAX_N];  //親 **親を探すときはfind
int rank1[MAX_N]; //木の深さ
void init(int n)
{
    for (int i = 0; i < n; i++)
    {
        par[i] = i;
        rank1[i] = 0;
    }
}
//木の根を求める
int find(int x)
{
    if (par[x] == x)
    {
        return x;
    }
    else
    {
        return par[x] = find(par[x]);
    }
}
//併合
void unite(int x, int y)
{
    x = find(x);
    y = find(y);
    if(x==y) return;
    if(rank1[x]<rank1[y]){
        par[x]=y;
    }
    else{
        par[y]=x;
        if(rank1[x]==rank1[y]) rank1[x]++;
    }
}
bool same(int x,int y){
    return find(x)==find(y);
}
int size(int x) {
        return -par[find(x)];
    }
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>m;
    vector<bool> usedr(n,false);
    init(n);
    for (int i = 0; i < m; i++)
    {
        score[i]=0;
        int l, r, d;
        cin >> l>>r>>d;
        l--;
        r--;
        g[l].push_back(make_pair(r,d));
        g[r].push_back(make_pair(l,-d));
        unite(l,r);
    }
    for(int i=0;i<n;i++){
        if(find(i)==i){
            if(!dfs(i)) return no,0;
        }
    }
    yes;
}


Measured memory_bytes: 37504
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;

int main(){

    long long n, a, b;
    cin >> n >> a >> b;

    long long minsum = b + a*(n - 1);
    long long maxsum = a + b*(n - 1);

    if(a > b){
        cout << 0 << endl;
    }
    else if(n > 2){
        cout << maxsum - minsum + 1 << endl;
    }
    else if(n == 2){
        cout << 1 << endl;
    }
    else{
        if(a != b){
            cout << 0 << endl;
        }
        else{
            cout << 1 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define sc(x) scanf("%lld",&x);
int main(){
    ll n, u, ans = 0; sc(n)
    bool check;
    vector<int> cnt;
    string s;
    queue<int> que;
    que.push(3), que.push(5), que.push(7);
    while (!que.empty()){
        check = true;
        u = que.front(); que.pop();
        s = to_string(u);
        cnt = {0, 0, 0};
        for (int i = 0; i < s.size(); i++){
            if (s[i] == '3') cnt[0]++;
            else if (s[i] == '5') cnt[1]++;
            else if (s[i] == '7') cnt[2]++;
        }
        for (int i = 0; i < 3; i++) if (cnt[i] == 0) check = false;
        if (u*10+3 <= n) que.push(u*10+3);
        if (u*10+5 <= n) que.push(u*10+5);
        if (u*10+7 <= n) que.push(u*10+7);
        if (check) ans += 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	int A, B, C;
	cin >> A >> B >> C;
	if (C >= A && C <= B) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    int N;
    cin >>N;
    cout << (N*(N+1))/2 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;
 
vi adj[100001];
int out[100001];
int in[100001];
vi type[100001];
int color[100001];
bool used2 = false;
int cnt = 0;
int c[3];
ll mm = 0;
ll tote = 0;
bool dfs(int u, int col)
{
	used2|=(in[u]&&out[u]);
	cnt++; c[col]++;
	color[u] = col;
	bool res = 1;
	mm += out[u];
	tote++;
	for(int i = 0; i < adj[u].size(); i++)
	{
		int v = adj[u][i];
		int nw = (col+type[u][i])%3;
		if(color[v] == -1)
		{
			res&=dfs(v, nw);
		}
		else
		{
			if(color[v] != nw) res=false;
		}
	}
	return res;
}
 
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n, m; cin>>n>>m;
	for(int i = 0; i < m; i++)
	{
		int u, v; cin>>u>>v; u--; v--;
		adj[u].pb(v); adj[v].pb(u);
		type[u].pb(1); type[v].pb(2);
		out[u]++; in[v]++;
	}
	memset(color,-1,sizeof(color));
	ll res = 0;
	for(int i = 0; i < n; i++)
	{
		if(color[i] == -1)
		{
			used2 = false; cnt = 0;
			memset(c,0,sizeof(c));
			mm = 0; tote = 0;
			bool ans=dfs(i, 0);
			//cerr<<c[0]<<' '<<c[1]<<' '<<c[2]<<' '<<mm<<'\n';
			if(ans)
			{
				if(used2)
				{
					for(int j = 0; j < 3; j++)
					{
						res += ll(c[j])*ll(c[(j+1)%3]);
					}
				}
				else
				{
					res += mm;
				}
			}
			else
			{	
				res += ll(tote)*ll(tote);
			}
		}
	}
	cout<<res<<'\n';
}


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

using namespace std;
using ll = long long;

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

	ll k, a, b;
	cin >> k >> a >> b ;

	ll ans = 1;
	if( b-a > 2){
		ll t = min(k, a-1);

		ans += t;
		k -= t;

		if(ans == a){
			ans += (b-a) * (k/2);
			ans += k%2; 
		}
		else{
			ans += k;
		}
	}
	else{
		ans += k;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n; cin>>n;
	int A[n]; int B[n]; int C[n];
	for(int i = 0; i <n; i++){
		cin>>A[i]>>B[i]>>C[i];
	}
	int dp[n][3];
	dp[0][0] = A[0];
	dp[0][1] = B[0];
	dp[0][2] = C[0];
	for(int i = 1; i < n; i++){
		dp[i][0] = max(dp[i-1][1],dp[i-1][2])+A[i];
		dp[i][1] = max(dp[i-1][0],dp[i-1][2])+B[i];
		dp[i][2] = max(dp[i-1][0],dp[i-1][1])+C[i];
	}
	cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<"\n";
}

Measured memory_bytes: 2560
import java.util.*;

public class Main{
    public static void main(String[]  args){
	Scanner sc = new Scanner(System.in);
	String N = sc.next();
	if(N.charAt(0)==N.charAt(1) && N.charAt(1)==N.charAt(2)|| N.charAt(1)==N.charAt(2)&&N.charAt(2)==N.charAt(3)){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
}


Measured memory_bytes: 21844
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        Integer n = Integer.parseInt(sc.next());
        Integer k = Integer.parseInt(sc.next());
        String s = sc.next();

        // 主処理
        String result = "";
        for (int i = 0; i < n; i++) {
            result += (i == k - 1) ? String.valueOf(s.charAt(i)).toLowerCase() : s.charAt(i);
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
}

Measured memory_bytes: 21204
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
#define pb push_back
#define fs first
#define se second
#define M 1000000007
ll exp(ll a,ll p)
{
	if(p==1)
		return a;
	if(p==0)
		return 1;
	ll st=exp(a,p/2);
	st=(st*st)%M;
	if(p%2 != 0)
		st=(st*a)%M;
	return st;
} 
int solve(int A, int B, int C) {
    ll mn=0,mx=1e18;
    ll ans=INT_MAX,mid;
    ll g=__gcd(A,B);
    ll l=(A*B)/g;
    cout<<l<<endl;
    while(mn<=mx)
    {
        mid=mn+(mx-mn)/2;
        ll f2=mid/A;
        ll f3=mid/B;
        ll f4=mid/l;
        ll t=f2+f3-f4;
        cout<<mid<<" "<<t<<endl;
        if(t>=A)
        {
            mx=mid-1;
            ans=min(mid,ans);
        }
        else 
        {
            mn=mid+1;
        }
        
    }
    return ans%M;
}
vector<ll>fact(10);
ll score(vector<ll>&arr)
{
	ll ans=0;
	ll n=arr.size();
	for(ll i=0;i<n;i++)
	{
		ll c=0;
		for(ll j=i+1;j<n;j++)
			if(arr[i]>arr[j])
				c++;
		ans+=c*fact[n-i-1];
	}
	return ans+1;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	// ll t;
	// cin>>t;
	// while(t--)
	// {
		
	// }
	fact[0]=1;
	for(ll i=1;i<10;i++)
		fact[i]=i*fact[i-1];
	ll n;
	cin>>n;
	vector<ll>arr1(n),arr2(n);
	for(ll i=0;i<n;i++)
		cin>>arr1[i];
	for(ll i=0;i<n;i++)
		cin>>arr2[i];
	ll s1=score(arr1),s2=score(arr2);
	cout<<abs(s1-s2)<<endl;
}


Measured memory_bytes: 256
//コンパイラ最適化用
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
typedef pair<ll, ld> pld;
typedef pair<pii, int> ppiii;
typedef pair<pii, ll> ppiill;
typedef pair<pll, ll> ppllll;
typedef pair<pli, int> pplii;
typedef map<int, int> mii;
typedef deque<ll> dll;
typedef queue<ll> qll;
typedef priority_queue<ll> pqll;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqrll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<int>> vvint;
typedef vector<vector<pll>> vvpll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define cin(x) cin >> x

signed main(){
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    //入力
    ll N = 0, K =0;
    cin >> N >> K;

    vll A(N), B(N);
    REP(i,N) cin >> A[i] >> B[i];


    //本文
    vll num(1000000,0);

    REP(i,N){
        num[A[i]]+=B[i];
    }
    ll sum =0;
    REP(i,1000000){
        sum += num[i];
        if(sum>=K){cout << i;break;}
    }
    //REP(i,N) cout << ans.at(i) <<endl;
  return 0;
}

Measured memory_bytes: 12680
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');//Splitで区切り文字を指定して複数個受け取る。
		long n = long.Parse(input[0]);
		long x = long.Parse(input[1]);
    long[] answers = new long[2*n-1];

    if(x == 1 || x == 2*n-1) Console.WriteLine("No");
    else
    {
      Console.WriteLine("Yes");
      if(x == n)//中央値
      {
        for(long i = 0; i < 2*n-1; i++) answers[i] = i+1;
      }
      else if(x < n)
      {
        for(long i = 0; i < n; i++) answers[i] = n-i;//543219876のように並べる
        for(long i = 0; i < n-1; i++) answers[2*n-2-i] = n+1+i;
        answers[n-1] = x;
        answers[n-x] = 1;
      }else
      {
        for(long i = 0; i < n; i++) answers[i] = n+i;//567891234のように並べる
        for(long i = 0; i < n-1; i++) answers[2*n-2-i] = n-1-i;
        answers[n-1] = x;
        answers[n-(2*n-1-x)-1] = 2*n-1;      
      }

      for(long i = 0; i < answers.Length; i++)
      {
        Console.WriteLine(answers[i]);
      }
    }
	}
}

Measured memory_bytes: 18528
h,w = map(int,input().split())
a = []
for i in range(0, h):
    a.append(list(input().split()))
    
for i in range(0,h):
    for j in range(0,w):
        if a[i][j] == 'snuke':
            print(chr(ord('A')+j),i+1,sep='')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int h,w,i,j;
    cin>>h>>w;
    char a[h][w];
    for(i=0; i<h; i++)
    {
        for(j=0; j<w; j++)
        {
            cin>>a[i][j];

        }

    }

    for(i=0; i<w+2; i++)
    {
        cout<<"#";
    }
    cout<<endl;
    for(i=0; i<h; i++)
    {
        cout<<"#";
        for(j=0; j<w; j++)
        {
            cout<<a[i][j];

        }
        cout<<"#";
        cout<<endl;
    }



    for(i=0; i<w+2; i++)
    {
        cout<<"#";
    }
    cout<<endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define  Rep(i,j,n) for(li i=(j);i<(n);i++)
#define  rep(i,n) Rep(i,0,(n))
#define  all(a) begin(a),end(a)
using namespace std;
typedef long int li;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
 
int main()
{
    int n,sum=0;
    cin>>n;
    vi t(n);
    rep(i,n) cin>>t[i],sum+=t[i];
    int m;
    cin>>m;
    vi p(m),x(m);
    rep(i,m) cin>>p[i]>>x[i];

    rep(i,m) cout<<sum-t[p[i]-1]+x[i]<<endl;

    return 0;
}

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


int main() 
{
    string s;
    int q;
    cin >> s >> q;
    deque<string> ss(s.size());
    rep(i, s.size()) ss[i] = s[i];
    int cnt = 0;
    rep(i,q)
    {
        int a;
        cin >> a;
        if(a==1)
        {
            cnt += 1;
        }
        else
        {
            int b;
            string pul;
            cin >> b >> pul;
            if(cnt%2!=0)
            {
                if(b==1)
                    b = 2;
                else
                    b = 1;
            }
            if(b==1)
                ss.push_front(pul);
            else
                ss.push_back(pul);
        }
    }

    

    if(cnt%2==0)
    {
        rep(i, ss.size()) cout << ss[i];
        cout << endl;
    }
    else
    {
        reverse(ss.begin(), ss.end());
         rep(i, ss.size()) cout << ss[i];
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 17152
#include<stdio.h>

typedef struct{
  int value;
  char moji;
}Set;

void BubbleSort(void);
void SelectionSort(void);
void isstable(void);

int n;
Set A[36],B[36];

int main(){
  //Set A[36],B[36];
  int i;

  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf(" %c%d",&A[i].moji,&A[i].value);
    //printf("%c\n", A[i].moji);
    B[i]=A[i];
  }
//for(i=0;i<n;i++)printf("%c%d\n", A[i].moji,A[i].value);
  BubbleSort();

  SelectionSort();

  return 0;
}

void BubbleSort(){
  int i,j;
  Set c;
  for(i=0;i<n;i++){
    for(j=n-1;j>i;j--){
      if(A[j].value<A[j-1].value){
        c = A[j];
        A[j] = A[j-1];
        A[j-1] = c;
      }
    }
  }
  for(i=0;i<n-1;i++){
    printf("%c%d ", A[i].moji,A[i].value);
  }
  printf("%c%d\n", A[i].moji,A[i].value);
  printf("Stable\n");
}

void SelectionSort(){
  int i,j,min;
  Set c;

  for(i=0;i<n;i++){
    min = i;
    for(j=i;j<n;j++){
      if(B[j].value<B[min].value) min = j;
    }
    c = B[i];
    B[i] = B[min];
    B[min] = c;
  }
  for(i=0;i<n-1;i++){
    printf("%c%d ", B[i].moji,B[i].value);
  }
  printf("%c%d\n", B[i].moji,B[i].value);
  isstable();
}

void isstable(){
  int i,x=0;
  for(i=0;i<n;i++){
    if(A[i].value==B[i].value && A[i].moji!=B[i].moji) x=1;
  }
  if(x==1) printf("Not stable\n");
  else printf("Stable\n");
}

Measured memory_bytes: 608
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
	int c[4][4];
	int i,j;
	for (i=1;i<=3;i++){
		for (j=1;j<=3;j++){
			cin>>c[i][j];
		}
	}
	int a1,a2,a3,b1,b2,b3;
	for (a1=0;a1<=c[1][1];a1++){
		for (b1=0;b1<=c[1][1];b1++){
			if (a1+b1!=c[1][1]){
				continue;
			}
			for (a2=0;a2<=c[2][1];a2++){
				if (a2+b1!=c[2][1]){
					continue;
				}
				for (b2=0;b2<=c[1][2];b2++){
					if (a2+b2!=c[2][2]){
						continue;
					}
					for (a3=0;a3<=c[3][1];a3++){
						if (a3+b2!=c[3][2]){
							continue;
						}
						for (b3=0;b3<=c[1][3];b3++){
							if (a3+b3!=c[3][3]){
								continue;
							}
							if (a1+b1==c[1][1]&&
								a1+b2==c[1][2]&&
								a1+b3==c[1][3]&&
								a2+b1==c[2][1]&&
								a2+b2==c[2][2]&&
								a2+b3==c[2][3]&&
								a3+b1==c[3][1]&&
								a3+b2==c[3][2]&&
								a3+b3==c[3][3]){
									cout<<"Yes"<<endl;
									return 0;
							}
						}
					}
				}
			}
		}
	}
	cout<<"No"<<endl;


	return 0;
}

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

int main() {
  int N;
  cin >> N;
  __int64_t res(1);
  for (int i = 0; i < N; ++i) {
    res *= (i+1);
    res %= 1000000007;
  }
  cout << res << endl;
}


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

typedef long long ll;

int main() {
	ll n, a, b, c;
	scanf("%lld", &n);
	for(a = 1; a <= 3500; a++) {
		for(b = 1; b <= 3500; b++) {
			ll A = a*b*n, B = 4*a*b-a*n-b*n;
			if(B <= 0) continue;
			if(A % B == 0) {
				printf("%lld %lld %lld\n", a, b, A/B);
				return 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
        
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return
        
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def size(self, x):
        return -self.parents[self.find(x)]
        
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())
    
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())



def main():
    N = int(input())
    nodes = []
    for i in range(N):
        x, y = map(int, input().split())
        nodes.append((x, y, i))

    uf = UnionFind(N)
    nodes_sorted_by_x = sorted(nodes)
    nodes_sorted_by_y = sorted(nodes, key=lambda i: i[1])

    edges = []
    for i in range(N - 1):
        dx = abs(nodes_sorted_by_x[i][0] - nodes_sorted_by_x[i + 1][0])
        dy = abs(nodes_sorted_by_x[i][1] - nodes_sorted_by_x[i + 1][1])
        cost = min(dx, dy)
        edges.append((cost, nodes_sorted_by_x[i][2],  nodes_sorted_by_x[i + 1][2]))

    for i in range(N - 1):
        dx = abs(nodes_sorted_by_y[i][0] - nodes_sorted_by_y[i + 1][0])
        dy = abs(nodes_sorted_by_y[i][1] - nodes_sorted_by_y[i + 1][1])
        cost = min(dx, dy)
        edges.append((cost, nodes_sorted_by_y[i][2],  nodes_sorted_by_y[i + 1][2]))

    edges.sort()
        
    ans = 0
    for edge in edges:
        w, s, t = edge
        if not uf.same(s, t):
            ans += w
            uf.union(s, t)
    print(ans)

    #print(nodes_sorted_by_x)
    #print(nodes_sorted_by_y)
if __name__ == '__main__':
    main()


Measured memory_bytes: 47320
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for(int (i)=(a);(i)<(b);(i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)
#define REP(i, n) FOR((i), 0, (n))

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T>
void print_container(T &container, string delim=" ") {
    bool first = true;
    for(auto &t: container){
        if(!first){
            cout << delim;
        }
        first = false;
        cout << t;
    }
    cout << endl;
}



int main() {
    int n;
    cin >> n;
    vector<ll> a(n);

    map<ll, vector<int>> pos;

    REP(i, n){
        cin >> a[i];
        ll val = i - a[i];
        pos[val].push_back(i);
    }
    for(auto t: pos)
        sort(t.second.begin(), t.second.end());

    ll ans = 0;
    REP(i, n){
        ll target = i + a[i];
        if(!pos.count(target))
            continue;
            
        auto t1 = lower_bound(pos[target].begin(), pos[target].end(), i+1);
        if(t1 == pos[target].end())
            continue;
        
        ll num = distance(t1, pos[target].end());
        ans += num;
    }
    cout << ans << endl;


    
    return 0;
}

Measured memory_bytes: 24652
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
using ll = long long;
// typedef vector<int> v;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}
#define rep(i, c) for(int i = 0; i < int(c); i++)
#define ALL(x) (x).begin(), (x).end() //sort(ALL(obj))みたいな
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値
#define pb push_back //
// const int MOD = 1000000007;



int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  int count = 0;
  while (a > 0 && c > 0) {
    count += 1;
    c = c-b;
    if (c <= 0) {
      cout << "Yes" << endl;
      return 0;
    }
    a = a-d;
    if (a <= 0) {
      cout << "No" << endl;
      return 0;
    }
  }
}


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

int main() {
  int N, K;
  cin >> N >> K;

  vector cnt(K + 1, vector<int>(K + 1));
  rep(i, N) {
    int x, y, b;
    char c;
    cin >> x >> y >> c;
    if(c=='W')y += K;
    b = x / K % 2 == y / K % 2 ? 1 : -1;
    if(b > 0) cnt[0][0]++;
    int nx = x % K + 1, ny = y % K + 1;
    cnt[nx][0] -= b;
    cnt[0][ny] -= b;
    cnt[nx][ny] += b * 2;
  }
  rep(i, K + 1)rep(j, K)cnt[i][j + 1] += cnt[i][j];
  rep(j, K + 1)rep(i, K)cnt[i + 1][j] += cnt[i][j];
  int ans = 0;
  rep(i, K)rep(j, K)ans = max({ans, cnt[i][j], N - cnt[i][j]});
  cout << ans << endl;
}


Measured memory_bytes: 7528
if __name__ == "__main__":
    N = int(input())
    S = input()

    R = set()
    G = set()
    B = set()
    for i in range(N):
        if S[i] == 'R':
            R.add(i)
        elif S[i] == 'G':
            G.add(i)
        elif S[i] == 'B':
            B.add(i)

    except_cnt = 0
    for w in range(1, N//2 + 1):
        for i in range(N):
            j = i + w
            k = j + w
            if i in R and j in G and k in B:
                except_cnt += 1
            if i in R and j in B and k in G:
                except_cnt += 1
            if i in B and j in R and k in G:
                except_cnt += 1
            if i in B and j in G and k in R:
                except_cnt += 1
            if i in G and j in B and k in R:
                except_cnt += 1
            if i in G and j in R and k in B:
                except_cnt += 1

    print(len(R) * len(G) * len(B) - except_cnt)


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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

void solve() {
  string s;
  cin >> s;
  int n = s.size();
  s = "0" + s;
  vi p(n + 1);
  dump(s);
  int ans = 0;
  rep(i, n) {
    int x = n - i;
    int d = s[x] - '0' + p[i];
    if (d == 10) {
      p[i + 1]++;
      d = 0;
    }
    if (d < 5) {
      ans += d;
    } else if (d > 5) {
      ans += (10 - d);
      p[i + 1]++;
    } else {
      if (s[x - 1] - '0' >= 5) {
        ans += (10 - d);
        p[i + 1]++;
      } else {
        ans += d;
      }
    }
    dump(i, d, ans);
  }
  if (p[n]) ans++;
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

Measured memory_bytes: 5320
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N,X,T;
	cin>>N>>X>>T;
	if(N<=X)
	cout<<T;
	if(N>X and N%X==0)
	cout<<N/X*T;
	if(N>X and N%X!=0)
	cout<<(N/X+1)*T;
	return 0;
}

Measured memory_bytes: 3540
import sys
input = sys.stdin.readline

class Dinic:
    def __init__(self, len_X, len_Y):
        self.len_X, self.len_Y = len_X, len_Y
        self.edges = [[] for _ in range(len_X)]
        self.matched = [-1] * len_Y
        self.visited = set()

    def add_edge(self, x, y):
        self.edges[x].append(y)

    def dfs(self, x):
        """
        :param x: X側の未マッチングの頂点の1つ
        :param visited: 空のsetを渡す（外部からの呼び出し時）
        :return: 増大路が見つかればTrue
        """
        for next_x in self.edges[x]:
            if next_x in self.visited:
                continue
            self.visited.add(next_x)
            if self.matched[next_x] == -1 or self.dfs(self.matched[next_x]):
                self.matched[next_x] = x
                return True
        return False

    def solve(self):
        """ 増大路発見に成功したらTrue(=1)。合計することでマッチング数となる """
        res = 0
        for x in range(self.len_X):
            self.visited = set()
            res += self.dfs(x)
        return res

#################################################################################################

N = int(input())

X = []
Y = []
for i in range(N):
    X.append([int(i) for i in input().split()])

for i in range(N):
    Y.append([int(i) for i in input().split()])

dinic = Dinic(len(X), len(Y))

for i in range(len(X)):
    for j in range(N):
        if X[i][0] < Y[j][0] and X[i][1] < Y[j][1]:
            dinic.add_edge(i, j)

print(dinic.solve())


Measured memory_bytes: 73920
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mod1 1000000007
#define ff first
#define ss second
#define INF 1e9
#define INFLL 1e18
typedef long long int ll;
// #define intLL unsigned long long int//used when x<2^64-1 && x>0
#define int long long//used when x<2^63-1
int fact[200005];
int power(int a, int b)
{
    int res=1;
    while(b)
    {
        if(b&1)
        {
            res*=a;
            res%=mod1;
        }
        a*=a;
        a%=mod1;
        b/=2;
    }
    return res;
}
int add(int a, int b)
{
    return (0LL+a+b)%mod1;
}
int sub(int a, int b)
{
    return add(a, mod1-b);
}
int mul(int a, int b)
{
    return (1LL*a*b)%mod1;
}
int inv(int x)
{
    return power(x, mod1-2);
}
int nCr(int n, int r)
{
    return mul(fact[n], inv(mul(fact[r], fact[n-r])));
}
int cmp(const pair<int, int> &a, const pair<int, int> &b)
{
    return (a.ff>b.ff);
}
int32_t main()
{

    IOS;
    int n, m, s;
    cin>>n>>m>>s;
    vector<pair<int, pair<int,int>>> gr[55];//{v, {cost, time}}
    for(int i=0;i<m;i++)
    {
        int u, v, a, b;
        cin>>u>>v>>a>>b;
        u--, v--;
        gr[u].pb({v, {a, b}});
        gr[v].pb({u, {a, b}});
    }
    int c[n+1], d[n+1];
    for(int i=0;i<n;i++)
    {
        cin>>c[i]>>d[i];
        c[i]=min(c[i], 2500LL);
    }
    s=min(s, 2500LL);
    int dp[n+1][2501];
    for(int i=0;i<n;i++)
        for(int j=0;j<2501;j++)
            dp[i][j]=INFLL;
    dp[0][s]=0;//dp[i][j] means reached at vertex i with j coins left and dp[i][j] time spent
    for(int lol=0;lol<2*n+1;lol++)
    {
        for(int i=0;i<n;i++)
        {
            for(auto it: gr[i])
            {
                for(int j=0;j<=2500;j++)
                {
                    if(j-it.ss.ff>=0)
                    {
                        dp[i][j-it.ss.ff]=min(dp[i][j-it.ss.ff], dp[it.ff][j]+it.ss.ss);
                    }
                }
            }
            for(int j=0;j<=2500;j++)
            {
                if(j-c[i]>=0)
                    dp[i][j]=min(dp[i][j], dp[i][j-c[i]]+d[i]);
            }
        }
    }
    for(int i=1;i<n;i++)
    {
        int ans=INFLL;
        for(int j=0;j<=2500;j++)
            ans=min(ans, dp[i][j]);
        cout<<ans<<"\n";
    }
    return 0;
}

Measured memory_bytes: 4648