akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define fastio     ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define debug(x)   cerr<<#x<<": "<<x<<endl;
#define all(x)     (x).begin() , (x).end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl       '\n'
#define MAX        1000000
typedef long long int ll;
using namespace std;


const ll mod = 1e9+7;
const double eps = 1e-9;




void solve(){
    int a,b,c,k;
    cin>>a>>b>>c>>k;
    if(a>=k)cout<<k;
    else if(a+b>=k)cout<<a;
    else cout<< (a - (k-b-a));
    return;
}





int main(){
    fastio
    int test=1;
    while(test--)
        solve();
    return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#define int long long 
using namespace std;
typedef pair<int,int> ii;

int fact[2000005];
int mod = 998244353;
long long qexp(long long b, long long p){
    long long res = 1;
    while(p){
        if(p&1) res = (res * b) % mod;
        b = (b * b) % mod;
        p >>= 1;
    }
    return res;
}
int inv(long long b){ return qexp(b, mod-2); }
int choose(int N, int C){
	if(N < C) return 0;
	int res = fact[N];
	res *= inv(fact[C]);
	res %= mod;
	res *= inv(fact[N-C]);
	res %= mod;
	return res;
}
int split(int total, int N){ ///split total objects to N groups
	return choose(N + total - 1, N - 1);
}

int ans = 0;
void fix(int &x){
	x %= mod;
	if(x < 0) x += mod;
}
signed main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	
	fact[0] = 1;
	for(int i = 1;i <= 2000000;i++) fact[i] = (fact[i-1] * i) % mod;
	
	int N, M; cin >> N >> M;
		
	for(int ones = 0;ones <= M;ones++){
		int zeros = N - ones;
		
		int leftover = 3*M - ones;
		if(leftover & 1) continue;
		
		leftover /= 2; ///The number of 2s to assign elsewhere
		
		int ways01 = choose(N, ones); ///ways to arrange the 0s and 1s
		
		int total2 = split(leftover, N); ///total ways to assign 
		int oneTooBig = ones * split(leftover - M, N);
		int zeroTooBig = zeros * split(leftover - M - 1, N);
		
		total2 -= oneTooBig;
		total2 -= zeroTooBig;
		
		fix(total2);
		ans += total2 * ways01;
		fix(ans);
	}
	
	cout << ans;
}




Measured memory_bytes: 19280
def is_possible(t0, x0, y0, t, x, y):
    dt, dm = t - t0, abs(x - x0) + abs(y - y0)
    if dt < dm:
        return False
    if (dt + dm) % 2 == 0:
        return True
    return False
n = int(input())
path = [(0, 0, 0)]
can_travel = True
for _ in range(n):
    t0, x0, y0 = path[-1]
    t, x, y = (int(i) for i in input().split())
    can_travel &= is_possible(t0, x0, y0, t, x, y)
    path.append((t, x, y))

print('Yes' if can_travel else 'No')

Measured memory_bytes: 17328
#include<iostream>
#include<vector>
using namespace std;
typedef long long li;
#define dist(a,b) max((a)-(b),(b)-(a))
#define minimize(a,b) (a>(b)?a=(b),1:0)
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

int main(){
  int n; cin >>n;
  vector<li> a(n),s(n+1,0);
  rep(i,n){
    cin >>a[i];
    s[i+1]=s[i]+a[i];
  }
  li m=s[n];
  rep(i,n+1){
    minimize(m,dist(s[i],s[n]-s[i]));
  }
  print(m);
}


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

#define FOR(i, x, n) for(int i = x; i < n; i++)

using namespace std;
typedef long long int ll;


ll binPow(ll a, ll b, ll m){
    a = a%m;
    ll res = 1;
    while(b){
        if(b&1)res = res*a%m;
        a = a*a;
    }
    return res;
}

ll binPow(ll a, ll b){
    a = a;
    ll res = 1;
    while(b){
        if(b&1)res = res*a;
        a = a*a;
    }
    return res;
}

ll gcd(ll a, ll b){
    while(a){
        ll temp = a;
        a = b%a;
        b = temp;
    }
    return b;
}

int main(){
    ll a, b;
    cin >> a >> b;
    if(a > b){
        ll temp = a;
        a = b;
        b = temp;
    }
    bool ans[(int)1e6 + 10] = {false};
    ll temp = a;
    for(ll i = 2; i*i <= temp; i++){
        if(a%i == 0){
            ans[i] = true;
            while(a%i == 0)a /= i;
        }
    }
    ll c = 1;
    temp = b;
    for(ll i = 2; i*i <= temp; i++){
        if(b%i == 0){
            if(ans[i] || i == a)c++;
            while(b%i == 0)b /= i;
        }
    }
    if(a == b && a != 1){
        c += 1;
    }
    cout << c;
}


Measured memory_bytes: 1280
# import math


def get_int_args():
    args = input().split()
    return list(map(int, args)), len(args)


def get_str_args():
    return input().split()


if __name__ == '__main__':
    a, b, c = tuple(get_int_args()[0])
    if (a <= b * c):
        print('Yes')
    else:
        print('No')

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

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

    string S;
    cin >> S;
    int N = S.size();
    vector<int> dp(N, 0);
    dp.at(0) = 1;
    if (N > 1) dp.at(1) = (S.at(0) == S.at(1)) ? 1 : 2;
    if (N > 2) dp.at(2) = (S.at(1) == S.at(2)) ? 2 : dp.at(1) + 1;
    for (int i = 3; i < N; ++i) {
        if (S.at(i - 1) != S.at(i)) {
            dp.at(i) = dp.at(i - 1) + 1;
        } else {
            dp.at(i) = dp.at(i - 3) + 2;
        }
    }
    cout << dp.at(N - 1) << endl;

    return 0;
}

Measured memory_bytes: 1428
#include <vector>
#include <map>
#include <set>
#include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
#define maxn 1000010
const ll mod=1e9+7;
#define sz(a) a.size()
typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vll;
typedef vector<bool> vb;
typedef set<int> si;
#define fori(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,b,a) for(int i = (b); i >= (a); --i)
#define all(a) (a).begin(), (a).end()
#define __builtin_popcountll bitCountLL
#define __builtin_popcount bitCount
//__builtin_ctz 末尾0的个数, __builtin_clz 前导0的个数
//__builtin_ffs 最后一个1的位置
const int INF = 2e9;
const ll ML = 4e18;
ll Pow(ll x, ll p) {
    ll res = 1;
    while(p) {
        if(p & 1) res = (res * x) % mod;
        p >>= 1;
        x = (x * x ) % mod;
    }
    return res;
}
ll fac[maxn], inv[maxn];
void init() {
    fac[0] = fac[1] = 1;
    fori(i,2,maxn) fac[i] = (fac[i-1] * i) % mod;
    inv[maxn-1] = Pow(fac[maxn-1],mod-2);
    rep(i,maxn-2,0) inv[i] = (inv[i+1] * (i + 1)) % mod;
    ///inv[i]=Pow(i,mod-2);
}
ll C(int a, int b) {
    return (fac[b] * inv[a] % mod * inv[b - a] % mod) % mod;
}
ll A(int a, int b) {
    return fac[b] * inv[b-a] % mod;
}
ll cnt[maxn];
ll mul(ll a, ll b){
    return (a%mod)*(b%mod)%mod;
}
vector<int>a[maxn];
int main()
{
    init();
    int n;cin>>n;
    ///if(n==1)return cout<<0<<endl,0;
    ///ll ans=2*C(2,n)%mod;
    ll a=1,b=1,c=1;
    for(int i=1; i<=n; i++){
        a=a*10%mod;
        b=b*9%mod;
        c=c*8%mod;
    }
    a=(a-b%mod+mod)%mod;
    a=(a-b%mod+mod)%mod;
    a=(a+c%mod)%mod;
    cout<<a<<endl;

    return 0;
}/*
// for(int i=1; i<=n-2; i++)ans=ans*10%mod;
   // ans=ans*A(n,n)%mod;
    //a=((a-(b*2%mod)+mod)%mod-c+mod)%mod;
    //cout<<ans<<endl;
    */


Measured memory_bytes: 42220
import numpy as np
s = int(input())
A = [0]*2010
A[0] = 1
A[1] = A[2] = 0
for i in range(3, s+1):
    for j in range(i-2):
        A[i] += A[j]
        A[i] %= 7+10**9
print(A[s]%(7+10**9))

Measured memory_bytes: 27048
#include<iostream>
using namespace std;
int main(void)
{
    int N,Hu,B,j=0,human[10],A;
    char card[100];
    while(1){
            B=0;j=0;
        cin>>N;
        if(N==0)break;
         for(int i=0;i<10;i++)human[i]=0;
        for(int i=0;i<100;i++){
            cin>>card[i];
            if(card[i]=='M')human[j]++;
            else if(card[i]=='S'){
                B+=human[j]+1;
                human[j]=0;
            }else{
                human[j]+=B+1;
                B=0;
            }
            if(j==N-1)j=0;
            else j++;
        }
        for(int i=0;i<N-1;i++){
            for(int k=0;k<N-1;k++){
                if(human[k]>human[k+1]){
                    A=human[k];
                    human[k]=human[k+1];
                    human[k+1]=A;
                }
            }
    }
    for(int i=0;i<N;i++){
        cout<<human[i];
        if(i!=N-1)cout<<" ";
        else{
            cout<<" "<<B<<"\n";
        }
    }
}
}

Measured memory_bytes: 1160
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
using namespace std;

typedef int64_t ll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define vll vector<ll>
#define all(v) v.begin(), v.end()



int main() {
	ll a, b, h;
	cin >> a;
	cin >> b;
	cin >> h;
	cout << (a + b) * h / 2 << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

int main(void) {
  string sa, sb, sc;

  cin >> sa;
  cin >> sb;
  cin >> sc;

  int turn = 'a';
  while(1) {
    switch(turn) {
    case 'a':
      if(sa.length() == 0) {
	printf("A\n");
	return 0;
      }
      turn = sa[0];
      sa.erase(0, 1);
      break;
    case 'b':
      if(sb.length() == 0) {
	printf("B\n");
	return 0;
      }
      turn = sb[0];
      sb.erase(0, 1);
      break;
    case 'c':
      if(sc.length() == 0) {
	printf("C\n");
	return 0;
      }
      turn = sc[0];
      sc.erase(0, 1);
      break;
    }
  }
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	char str[255], baru[255];
	scanf("%s", str);
	for(int i = 0, j = 0 ; str[i] != '\0' ; i++){
		if(str[i] == '0'){
			baru[j] = '0';
			j++;
			baru[j] = '\0';
		}else if(str[i] == '1'){
			baru[j] = '1';
			j++;
			baru[j] = '\0';
		}else{
			if(j > 0){
				baru[--j] = '\0';
			}
		}
	}
	printf("%s\n", baru);
	return 0;
}

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

using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))

#define MOD 1000000007
#define INF 1000000000

int N;
int a[3];    // i: %4 した数 , 値: iの個数

int main()
{
    cin >> N;
    ZERO(a);
    REP(i, N) {
        int tmp;
        cin >> tmp;
        if(tmp % 4 < 3) {
            a[(tmp%4)]++;
        }
        else {
            // 余り 3 と余り 1 は合算
            a[1]++;
        }
    }
    // 2 はまとめて 1 としてカウント可能
    if(0 < a[2]) { a[1]++; }
    // 2 はもう用済み
    // ここからは 1 と 0 を交互に減らす
    if(a[0] + 1 >= a[1]) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main() {
	int dice[3] = {1, 2, 3};
	char input[8];
	int n;
	int ans;

	int temp;
	int i;

	do {
		scanf("%d", &n);
		if(!n)
			break;

		ans = 1;
		dice[0] = 1; dice[1] = 2; dice[2] = 3;

		for(i = 0; i < n; i++) {
			scanf("%s", input);
			
			if(!strcmp(input, "North")) {
				temp = dice[0];
				dice[0] = dice[1];
				dice[1] = 7 - temp;
			}

			else if(!strcmp(input, "East")) {
				temp = dice[2];
				dice[2] = dice[0];
				dice[0] = 7 - temp;
			}

			else if(!strcmp(input, "West")) {
				temp = dice[0];
				dice[0] = dice[2];
				dice[2] = 7 - temp;
			}

			else if(!strcmp(input, "South")) {
				temp = dice[1];
				dice[1] = dice[0];
				dice[0] = 7 - temp;
			}

			else if(!strcmp(input, "Right")) {
				temp = dice[1];
				dice[1] = dice[2];
				dice[2] = 7 - temp;
			}

			else {
				temp = dice[2];
				dice[2] = dice[1];
				dice[1] = 7 - temp;
			}

			ans += dice[0];
		}

		printf("%d\n", ans);
	} while(1);

	return 0;
}

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

main()
{

    long long i,j,k,l,m,n,o,q,p;
    while(cin>>n)
    {
        int  x[n];
        for(i=0; i<n; i++) cin>>x[i];
        int mx=x[0];
        j=0;
        l=0;
        for(i=1; i<n; i++)
        {

            j=x[i-1]-x[i];
          if(j>0) {
            l+=j;
            x[i]=x[i-1];

          }

        }
        cout<<l<<endl;
    }
    return 0;
}




Measured memory_bytes: 4388
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
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() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  cout << a*b/2 << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[3009][3009][3], a[3009], n;

ll solve(ll st, ll en, ll ch)
{
    if(st == en)
        return a[st];
    long long& res = dp[st][en][ch];
    if(res != 1e17)
        return res;
    if(ch == 1){
        res = max(a[st] - solve(st + 1, en, 2), a[en] - solve(st, en - 1, 2));
    }
    else{
        res = max(a[st] - solve(st + 1, en, 1) , a[en] - solve(st, en - 1, 1));
    }
    //cout<<"st = "<<st<<" en = "<<en<<" ch = "<<ch<<" dp = "<<res<<"\n";
    return (res);
}
main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    cin>>n;
    for(int i = 1; i <= n; i++)
    {
        cin>>a[i];
    }
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= n; j++)
            for(int k = 0; k <= 3; k++)
                dp[i][j][k] = 1e17;
    cout<<solve(1, n, 1)<<"\n";
    //cout<<dp[1][n][1];
}


Measured memory_bytes: 211968
#include<bits/stdc++.h>
using namespace std;
#define MMAX 100000+5
#define ffor(i,s,n) for(int i=(s);i<(n);i++)
int n,m;
int A[MMAX];
int ct=0;



int main(){
		cin>>n>>m;
		memset(A,-1,sizeof(A));
		ffor(i,0,MMAX){
			int a,b;
			cin>>a>>b;
			if(A[a]==-1) A[a]=b;
			else A[a]=min(A[a],b);
		}
		int r=-1;
		ffor(i,0,MMAX){
			if(A[i]==-1) continue;
			if(r==-1){
				ct++;
				r=A[i]-1;
			}
			else if(r<i){
				ct++;
				r=A[i]-1;
			}else{
				r=min(A[i]-1,r);
			}
			//cout<<r<<endl;
		}
		
		cout<<ct<<endl;
				
    return 0;

}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
#define inf 20000000000000000
#define N 200050
#define mid ((a + b)/2)
#define l (2*nod)
#define r (2*nod + 1)
using namespace std;
 
int n, q, S, T, A[N], tree[4*N], lazy[4*N], ans;
 
void prop(int nod, int a, int b)
{
	if(!lazy[nod]) return;
 
	tree[nod] += (lazy[nod]*(b - a + 1));
 
	if(a != b) lazy[l] += lazy[nod], lazy[r] += lazy[nod];
 
	lazy[nod] = 0;
}
 
void upd(int nod, int a, int b, int i, int j, int x)
{
	prop(nod, a, b);
 
	//cout<<"UPDATE "<<a<<" "<<b<<" "<<i<<" "<<j<<" "<<x<<"\n";
 
	if(j < a || i > b) return;
 
	if(i <= a && j >= b)
	{
		tree[nod] += (x*(b - a + 1));
 
		if(a != b) lazy[l] += x, lazy[r] += x;
 
		return;
	}
 
	upd(l, a, mid, i, j, x), upd(r, mid + 1, b, i, j, x);
 
	tree[nod] = tree[l] + tree[r];
}
 
int query(int nod, int a, int b, int i, int j)
{
	if(i < 0 || i > n || j > n || j < 0) return inf;
 
	prop(nod, a, b);
 
	if(j < a || i > b) return 0;
 
	if(i <= a && j >= b) return tree[nod];
 
	return query(l, a, mid, i, j) + query(r, mid + 1, b, i, j);
}
 
int32_t main()
{
	ios::sync_with_stdio(false); cin.tie(0);
 
	cin>>n>>q>>S>>T;
 
	for(int i = 0; i <= n; i++) cin>>A[i], upd(1, 0, n, i, i, A[i]);
 
	//cout<<query(1, 0, n, n, n)<<"\n";
 
	for(int i = 0; i < n; i++) ans += (A[i] <= A[i + 1] ? (- A[i + 1] + A[i])*S : (A[i] - A[i + 1])*T);
 
	//cout<<ans<<"\n";
 
	for(int i = 1; i <= q; i++)
	{
		int li, ri, xi;
 
		cin>>li>>ri>>xi;
 
		int Hl = query(1, 0, n, li, li);
 
		int Hr = query(1, 0, n, ri, ri);
 
		int H_depois = query(1, 0, n, ri + 1, ri + 1);
 
		int H_antes = query(1, 0, n, li - 1, li - 1);
 
		upd(1, 0, n, li, ri, xi);
 
		int dl = 0, dr = 0;
 
		if(H_antes != inf && H_antes <= Hl) dl -= abs(Hl - H_antes)*S ;
 
		else if(H_antes  != inf) dl += abs(Hl - H_antes)*T;
 
		if(Hr <= H_depois && H_depois != inf) dr -= abs(H_depois - Hr)*S ;
 
		else if(H_depois != inf) dr += abs(H_depois - Hr)*T;
 
		ans = ans - dl - dr;
 
		//cout<<"H :: "<<H_antes<<" "<<H_depois<<"\n";
 
		//cout<<"DIMINUINDO "<<dl<<" "<<dr<<"\n";
 
		Hl += xi, Hr += xi;
 
		dl = 0, dr = 0;
 
		if(H_antes <= Hl&& H_antes != inf) dl -= abs(Hl - H_antes)*S ;
 
		else if(H_antes != inf) dl += abs(Hl - H_antes)*T;
 
		if(Hr <= H_depois && H_depois != inf) dr -= abs(H_depois - Hr)*S ;
 
		else if(H_depois != inf) dr += abs(H_depois - Hr)*T;
 
		ans += dl + dr;
 
		//cout<<"ADICIONANDO "<<dl<<" "<<dr<<"\n";
 
		cout<<ans<<"\n";
	}
}

Measured memory_bytes: 12964
import math
A, B = [int(i) for i in input().split()]
cand = set(list(range(math.ceil(A/0.08), math.ceil((A+1)/0.08))))
cand &= set(list(range(math.ceil(B/0.1), math.ceil((B+1)/0.1))))
if(len(cand)==0):
    print(-1)
else:
    print(min(cand))


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int l, r, d; cin >> l >> r >> d;
  	int ans = 0;
	for(int i = l; i <= r; i++){
      if(!(i % d)) ans++;
    }
  	cout << ans;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <unordered_map>
#include <assert.h>
using namespace std;

#define ran(i, a, b) for ((i) = (a); (i) < (b); (i)++)
#define rep(i, a) ran ((i), 0, (a))
#define rep1(i, a) ran ((i), 1, (a)+1)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long long ll;
#define _0 first
#define _1 second
#define _pb(x) push_back(x)
#define _mp(x, y) make_pair(x, y)
#if defined(SHIROKO1_LOCAL) && !defined(NDEBUG)
#define DEBUG(...) fprintf(stderr, "[DEBUG] " __VA_ARGS__)
#else
#define DEBUG(...) ((void)0)
#endif

ll gcd(ll a, ll b) { ll r; while (a) { r = b%a; b = a; a = r; } return b; }
ll lcm(ll a, ll b) { return a/gcd(a, b)*b; }

int main()
{
	int n;
	ll a = 1;
	cin >> n;
	while (n--) {
		ll x;
		cin >> x;
		a = lcm(a, x);
	}
	cout << a << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    bool t[30] = {};
    for( int i=0; i<28; ++i ) {
        int s;
        cin >> s;
        t[s-1] = true;
    }
    for( int i=0; i<30; ++i )
        if ( !t[i] )
            cout << i+1 << endl;
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
#define int long long
#define rep(i,m,n) for(int i=m;i<n;i++)
#define repr(i,n,m) for(int i=n;i>=m ;i--)
#define mod 1000000007
#define float long double
#define pb push_back
#define mp make_pair
#define print(v1) rep(i,0,v1.size()){cout<<v1[i]<<" ";} cout<<"\n";
using namespace std;
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.second < b.second);
}
int modulo(int n,int m=1000000007){
    if(n<0){
        return (m-abs(n)%m)%m;
    }
    else return n%m;
}
void solve()
{ 
    int d,t,s;
    cin>>d>>t>>s;
    int x=ceil(d/(s*1.0));
    // cout<<x;
    if(x<=t){
      cout<<"Yes";
    }
    else
      cout<<"No";
}
signed main()
{
   ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   // #ifndef ONLINE_JUDGE
   // freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
   // #endif
   int t=1;
   //cin>>t;
   while(t--)
   {
      solve();
      cout<<"\n";
   }
   cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
  return 0;
 }

Measured memory_bytes: 3920
#include <iostream>
#include <cstring>
using namespace std;

int main()
{
    int a, b;
    string op;
    cin >> a >> op >> b;
    if (op == "+")
    {
        cout << a + b;
    }
    else
    {
        cout << a - b;
    }
    return 0;
}

Measured memory_bytes: 256
#import<bits/stdc++.h>
#define LL long long
using namespace std;
typedef struct{int x;int y;}H;
int a,b,c,d,i,j,k,m,n,s,t,x,y,z,w[11][11];
int pv[300000];
char h,u[105];
H e[200040];
queue<int>B,D;
int A(H a,H b){return a.x<b.x||a.x==b.x&&a.y<b.y;}
void BP(void);
void bfs(int s);
void dfs(int s);
int dgs(int x){int s=0;for(;x;x/=10)s+=x%10;return s;}
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int max2(int x,int y){return x>y?x:y;}
int max3(int x,int y,int z){return x>y?x>z?x:z:y>z?y:z;}
int min2(int x,int y){return x<y?x:y;}
int min3(int x,int y,int z){return x<y?x<z?x:z:y<z?y:z;}
int prime(int x){if(x<2||x%6^1&&x%6^5)return x==2|x==3;for(int i=5;i*i<=x;i+=6)if(x%i<1||x%(i+2)<1)return 0;return 1;}
int vowel(char x){return x%32==1||x%32==5||x%32==9||x%32==15||x%32==21;}
int Q(int m){int y=(int)(sqrt((double)(m)));if(y*y==m)return 1;else return 0;}
main()
{
	scanf("%d%d",&n,&d);
	for(;i<n;i++)for(j=0;j<d;j++)scanf("%d",&w[i][j]);
	for(i=0;i<n;i++)
	{
		for(k=i;++k<n;)
		{
			for(a=j=0;j<d;j++)a+=(w[k][j]-w[i][j])*(w[k][j]-w[i][j]);s+=Q(a);
		}
		
	}
	printf("%d",s);
}
void BP(void)
{
	for(int i=0;e[++i].x;)
	{
		if(e[i].x>e[i-1].x)
		{
			for(int j=e[i-1].x;j++<e[i].x;)
			{
				pv[j]=i;
			}
		}
	}
}
void bfs(int s)
{
	
}
void dfs(int s)
{
	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    int flag ;
    flag = (c-a)*60;
    int min ;
    min = (d-b);
    int ans ;
    ans = flag + min;
    e = ans - e;
    if(e<0){
        e =0;
    }
    cout<<e;
    

}

Measured memory_bytes: 3636
#include<iostream>
#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

#define INF 9223372036854775807

int main() {

    long long n ;
    cin >> n ;
    long long ans = INF  ;
    for(int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0){
            pair<long,long> tmp ;
            tmp.first = i ;
            tmp.second = n/i ;
            if(ans>((tmp.first-1)+(tmp.second-1))) ans = (tmp.first-1)+(tmp.second-1) ;
        }
    }
    
    printf("%lld\n",ans) ;

 return 0 ;
}  


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

using namespace std;

vector<string> suffix{"dream", "dreamer", "erase", "eraser"};

string s;

bool possible() {
    if (s.size() == 0) return true;
    for (int i = 0; i < suffix.size(); ++i) if (s.size() >= suffix.at(i).size() && s.substr(s.size() - suffix.at(i).size()) == suffix.at(i)) {
            s = s.substr(0, s.size() - suffix.at(i).size());
            return possible();
    }
    return false;
}

int main() {
    cin >> s;
    cout << (possible() ? "YES" : "NO") << endl;
    return 0;
}


Measured memory_bytes: 1704
#include <bits/stdc++.h>
#define ll long long
#define db long double
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

using namespace std;

void solve2(int n, int m) {
	if (n==2) {
		cout << -1;
		return;
	}

	vector<vector<int> > nxt(n);
	vector<pair<int, int> > edges;
	for (int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		u--, v--;
		edges.push_back({u, v});
		nxt[u].push_back(v), nxt[v].push_back(u);
	}

	for (int i = 0; i < n; ++i) reverse(nxt[i].begin(), nxt[i].end());

	int a = 0, b = 1;
	if (edges[0].second == 1) b = 2;

	for (int i = 0; i < m; ++i) {
		int u = edges[i].first, v = edges[i].second;
		nxt[u].pop_back(), nxt[v].pop_back();

		if (b == u || b == v) swap(a, b);

		if (u == a) {
			int Q = -1;
			if (nxt[b].size()) Q = nxt[b].back();
			if (Q == a) {
				cout << 'v';
				a = v;
			}
			else cout << '^';
		}
		else if (v == a) {
			int Q = -1;
			if (nxt[b].size()) Q = nxt[b].back();
			if (Q == a) {
				cout << '^';
				a = u;
			}
			else cout << 'v';
		}
		else cout << '^';
	}

}

const int N = 50000;

bitset<N> arr[N];

void solve1(int n, int m) {
	for (int i = 0; i < n; ++i) {
		arr[i][i] = 1;
	}

	vector<pair<int, int> > edges;
	bitset<N> a, b;

	for (int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		u--, v--;
		a = arr[u], b = arr[v];
		arr[u] |= b;
		arr[v] |= a;
		edges.push_back({u, v});
	}

	int target = -1;
	for (int i = 0; i < n; ++i) {
		if (arr[i].count() == n) target = i;
	}
	if (target == -1) {
		cout << -1;
		return;
	}

	vector<bool> avail(n, false);
	avail[target] = true;
	vector<char> ans(m);
	for (int i = m - 1; i >= 0; i--) {
		int u = edges[i].first, v = edges[i].second;
		if (!avail[u] && !avail[v]) ans[i] = 'v';
		else if (avail[u] && avail[v]) ans[i] = 'v';
		else if (avail[u]) {
			avail[v] = true;
			ans[i] = '^';
		}
		else{
			avail[u] = true;
			ans[i] = 'v';
		}
	}

	for (int i = 0; i < m; ++i) cout << ans[i];

}


int main(){
#ifdef LOCAL
	freopen("D_input.txt", "r", stdin);
	//freopen("D_output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n, m, t;
	cin >> n >> m >> t;

	if (t == 2) solve2(n, m);
	else solve1(n, m);


	
}


Measured memory_bytes: 306936
#include<stdio.h>
#include<math.h>
int isPrime(int k){
    int i,flag=1;
    if(k==1) return 0;
    for(i=2;i<=sqrt(k);i++){
	if(k%i==0) flag=0;
    }
    if(flag) return 1;
    else return 0;
}

int main(void){
    int n,a[10000],i;
    int ans=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
	scanf("%d",&a[i]);
	if(isPrime(a[i])) ans++;
    }
    printf("%d\n",ans);
    return 0;
}

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

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

using namespace std;

typedef long long LL;

int N, M;

LL C[1000][1000];
LL S[1000];

LL INF = pow(10, 13);

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "[ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "]";

    return os;
}

void recurse(int a, LL c, vector<int> p) {
    if (S[a] == INF) return;

    if (find(p.begin(), p.end(), a) != p.end()) {
        if (c > S[a]) {
            S[a] = INF;
            c = INF;
        }
    } else {
        p.push_back(a);
        S[a] = c;
    }

    REP(b, N) {
        if(C[a][b] == 0) continue;

        if(S[b] >= c + C[a][b]) continue;

        recurse(b, min(c + C[a][b], INF), p);
    }
}



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

    cin >> N >> M;

    REP(i, N) REP(j, N) C[i][j] = 0;
    REP(i, N) S[i] = -INF;

    REP(i, M) {
        int a, b, c;
        cin >> a >> b >> c;

        C[a-1][b-1] = c;
    }

    recurse(0, 0, {});

    cout << fixed << setprecision(20);

    if (S[N-1] == INF) cout << "inf" << endl;
    else cout << S[N-1] << endl;

}


Measured memory_bytes: 16640
#include <bits/stdc++.h>
#ifdef DEBUG
#include "_debug.cpp"
#include "callable.hpp/callable.hpp"
#endif
#define endl '\n'
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a, b;
    cin >> a >> b;
    cout << (a <= 8 and b <= 8 ? "Yay!" : ":(") << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  string s;
  cin>>s;
  ll n=sz(s);
  ll ans=0;
  s.pb('g');
  ll a=0;
  ll b=0;
  rep(i,n){
    if(s[i]=='A'){
      ans+=a*b;
      b=0;
      a++;
    }
    else if(a>0&&s[i]=='B'&&s[i+1]=='C'){
      b++;
      i++;
    }
    else if(s[i]=='C'||s[i]=='B'){
      ans+=a*b;
      a=0;
      b=0;
    }
  }
  ans+=a*b;
  COUT(ans);
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <cmath>

#define INF 100000

using namespace std;

void chmin(int &a, int b) { if(a>b) a=b; }
void chmax(int &a, int b) { if(a<b) a=b; }

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

	int N = tmp.size();

	int ans = 0;

	for(int i = 0; i < N; i++){
		ans += (tmp[i] - '0' == i%2 ? 0 : 1);
	}

	chmin(ans, N - ans);

	cout << ans << endl;
}

Measured memory_bytes: 512
x1, y1, x2, y2 = map(int, input().split())
diffX = x2 - x1
diffY = y2 - y1
x3 = 0
y3 = 0
x4 = 0
y4 = 0
if diffX >= 0 & diffY >= 0:
    x3 = x2 + diffY * -1
    y3 = y2 + diffX
    x4 = x3 + diffX * -1
    y4 = y3 + diffY * -1
elif diffX >= 0 & diffY <= 0:
    x3 = x2 + diffY * -1
    y3 = y2 + diffX
    x4 = x3 + diffX
    y4 = y3 + diffY
elif diffX <= 0 & diffY >= 0:
    x3 = x2 + diffY * -1
    y3 = y2 + diffX
    x4 = x3 + diffX * -1
    y4 = y3 + diffY * -1
elif diffX <= 0 & diffY <= 0:
    x3 = x2 + diffY
    y3 = y2 + diffX * -1
    x4 = x3 + diffX
    y4 = y3 + diffY
print(x3, y3, x4, y4)


Measured memory_bytes: 3064
#include<iostream>
using namespace std;
long long n, f[45];
void fibonacci() {
	f[0] = f[1] = 1;
	for (int i = 2; i < 45; i++)
		f[i] = f[i - 1] + f[i - 2];
}
int main() {
	fibonacci();
	cin >> n;
	cout << f[n] << endl;
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
string arr[1000000];
int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
	long long n,i,j,k;
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>arr[i];
	 }  
	 sort(arr,arr+n);
	 k=1;
	 for (i=1;i<n;i++)
	 {
	 	if (arr[i]!=arr[i-1])
	 	{
	 		k++;
		 }
	 }
	 cout<<k<<endl;
}

Measured memory_bytes: 34904
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define MOD (int)(1e9 + 7)

int main()
{
    int n, k;
    cin >> n >> k;
    int vals[n];
    for (int q = 0; q < n; q++)
    {
        cin >> vals[q];
    }
    int dp[n][k+1];
    int total = 0;
    for (int q = 0; q < n; q++)
    {
        for (int w = 0; w <= k; w++)
        {
            if (q==0)
            {
                if (vals[q]-w>=0)
                {
                    dp[q][w]=1;
                }
                else
                {
                    dp[q][w]=0;
                }
            }
            else
            {
                if (w==0)
                {
                    dp[q][w]=1;
                }
                else
                {
                    dp[q][w]=(dp[q-1][w]+dp[q][w-1]) % MOD;
                    if (w-vals[q]-1>=0)
                    {
                        dp[q][w] = (((dp[q][w]-dp[q-1][w-vals[q]-1]) % MOD)+MOD)% MOD ;
                    }
                }
            }
            //cout << dp[q][w] << " ";
        }
        //cout << endl;
    }

    cout << dp[n-1][k];
    return 0;
}


Measured memory_bytes: 39296
#include <bits/stdc++.h>
#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(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
const long long INF = 1LL<<60; // 仮想的な無限大の値;
using namespace std;
using ll = long long;
using P  = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
  
// UnionFind
// coding: https://youtu.be/TdR816rqc3s?t=726
// comment: https://youtu.be/TdR816rqc3s?t=6822
struct UnionFind {
  vector<int> d;//子：親のID 根:連結成分のサイズ
  UnionFind(int n=0): d(n,-1) {}//全員根でサイズは1で初期化
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y) {
    x = find(x); y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) { return -d[find(x)];}
};
int main()
{
    int M, N;
    cin >> N >> M;
    UnionFind UF(N);
    int ans = 0;
    rep(i, M)
    {
        int a, b;
        cin >> a >> b;
        --a;--b;
        UF.unite(a, b);
    }
    rep(i, N) chmax(ans,UF.size(i));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4048
#[allow(dead_code)]
struct Utree {
    n: usize,
    par: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}
#[allow(dead_code)]
impl Utree {
    fn new(n: usize) -> Utree {
        let par: Vec<usize> = (0..n).collect();
        let rank: Vec<usize> = vec![0; n];
        let size: Vec<usize> = vec![1; n];
        Utree {
            n: n,
            par: par,
            rank: rank,
            size: size,
        }
    }
    fn find(&mut self, x: usize) -> usize {
        if self.par[x] == x {
            x
        } else {
            let parent = { self.par[x] };
            let ret = self.find(parent);
            self.par[x] = ret;
            ret
        }
    }
    fn unite(&mut self, x: usize, y: usize) {
        let x_root = self.find(x);
        let y_root = self.find(y);
        if x_root == y_root {
            return;
        };
        if self.rank[x_root] < self.rank[y_root] {
            self.par[x_root] = y_root;
            self.size[y_root] += self.size[x_root];
        } else {
            self.par[y_root] = x_root;
            self.size[x_root] += self.size[y_root];
            if self.rank[x_root] == self.rank[y_root] {
                self.rank[x_root] += 1;
            }
        }
    }
    fn is_same(&mut self, x: usize, y: usize) -> bool {
        let x_root = self.find(x);
        let y_root = self.find(y);
        x_root == y_root
    }
    fn get_size(&mut self, x: usize) -> usize {
        let x_root = self.find(x);
        self.size[x_root]
    }
}

fn main() {
    use std::io::Read;
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    
    let n: usize = iter.next().unwrap().parse::<usize>().unwrap();
    let m: usize = iter.next().unwrap().parse::<usize>().unwrap();
    let p: Vec<usize> = (&mut iter).take(n).map(|x| x.parse::<usize>().unwrap()-1).collect();
    let mut utree = Utree::new(n);
    for _ in 0..m {
        let x: usize = iter.next().unwrap().parse::<usize>().unwrap()-1;
        let y: usize = iter.next().unwrap().parse::<usize>().unwrap()-1;
        utree.unite(x, y);
    }

    let mut ret = 0usize;
    for i in 0..n {
        if utree.is_same(i, p[i]) {
            ret += 1;
        }
    }
    println!("{}", ret);
}


Measured memory_bytes: 10492
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
#define inf 1e9+7
using namespace std;
typedef long long ll;
const double pi=acos(-1);

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

int main(){
    int n;
    cin >> n;
    vector<int> h(n);
    for(int i=0;i<n;i++) cin >> h[i];
    vector<int> dp(n);
    dp[1]=abs(h[1]-h[0]);
    for(int i=2;i<n;i++) dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
    cout << dp.back() << endl;
}

Measured memory_bytes: 4008
GI = lambda: int(input()); GIS = lambda: map(int, input().split()); LGIS = lambda: list(GIS())
 
def main():
    sols = []
    for _ in range(GI()):
        x, y, h = LGIS()
        if h:
            sols.append((x, y, h))
 
    if len(sols) == 1:
        print(*sols[0])
        return
 
    for cx in range(0, 101):
        for cy in range(0, 101):
            lastH = None
            for x, y, h in sols:
                H = h + abs(x - cx) + abs(y - cy)
#                if H < 1:
#                    continue
                if lastH:
                    if H != lastH:
                        break
                lastH = H
            else:
                print(cx, cy, H)
                return
 
main()

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true){
            int x = sc.nextInt();
            String op = sc.next();
            int y = sc.nextInt();
            if(op.equals("+")) System.out.printf("%d\n", x+y);
            else if(op.equals("-")) System.out.printf("%d\n", x-y);
            else if(op.equals("*")) System.out.printf("%d\n", x*y);
            else if(op.equals("/")) System.out.printf("%d\n", x/y);
            else break;
        }
    }
}



Measured memory_bytes: 26308
class Dice:

    def __init__(self):
        # 初期値がない場合
        # 上, 南、東、西、北、下にそれぞれ1, 2, 3, 4, 5, 6がくる想定
        self.t = 1
        self.s = 2
        self.e = 3
        self.w = 4
        self.n = 5
        self.b = 6
        self.rotway = {"S": 0, "N": 1, "E": 2, "W": 3}

    def __init__(self, t, s, e, w, n, b):
        # 初期値が指定される場合
        self.t = t
        self.s = s
        self.e = e
        self.w = w
        self.n = n
        self.b = b
        self.rotway = {"S": 0, "N": 1, "E": 2, "W": 3}

    def rot(self, way):
        if way == 0:
            self.t, self.s, self.e, self.w, self.n, self.b = self.n, self.t, self.e, self.w, self.b, self.s
        elif way == 1:
            self.t, self.s, self.e, self.w, self.n, self.b = self.s, self.b, self.e, self.w, self.t, self.n
        elif way == 2:
            self.t, self.s, self.e, self.w, self.n, self.b = self.w, self.s, self.t, self.b, self.n, self.e
        elif way == 3:
            self.t, self.s, self.e, self.w, self.n, self.b = self.e, self.s, self.b, self.t, self.n, self.w
        

def main():
    import random

    n = int(input())
    diceList = [[0 for _ in range(6)] for _ in range(n)]
    for i in range(n):
        diceList[i][0],diceList[i][1],diceList[i][2],diceList[i][3],diceList[i][4],diceList[i][5] = map(int, input().split())

    flag = 0

    # 2つ目以降のさいころが、以前のさいころと一致しているか確認していく。
    for i in range(1, n):
        if flag == 1:
            break
        else:
            dice_a = Dice(diceList[i][0],diceList[i][1],diceList[i][2],diceList[i][3],diceList[i][4],diceList[i][5])
            for j in range(i):
                dice_b = Dice(diceList[j][0],diceList[j][1],diceList[j][2],diceList[j][3],diceList[j][4],diceList[j][5])

                for _ in range(100):
                    if (dice_a.t, dice_a.s, dice_a.e, dice_a.w, dice_a.n, dice_a.b) == (dice_b.t, dice_b.s, dice_b.e, dice_b.w, dice_b.n, dice_b.b):
                        flag = 1
                        break
                    else:
                        seed = random.randint(0, 3)
                        dice_a.rot(seed)

    if flag == 0:
        print("Yes")
    else:
        print("No")



if __name__ == '__main__':
    main()



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

using namespace std;

const int MAX_N = 10000;
int n;
int a[MAX_N];


void solve(){
   
    return;
}

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

    int a_Max=a[0], a_min=a[0];
    long long s=0;
    for(int i=0; i<n;i++){
        s += a[i];
        a_Max = (a_Max < a[i]) ? a[i] : a_Max;
        a_min = (a_min > a[i]) ? a[i] : a_min;
    }
    cout << a_min << " " << a_Max << " " << s << endl;

    
    return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG true
#define LL long long
#define Num 1000000007
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    int n, c;
    cin >> n >> c;
    int mp[3][c + 1] = {0};
    int iwa[c + 1][c + 1];

    REP(i, 1, c + 1)
    {
        REP(j, 1, c + 1)
        {
            cin >> iwa[i][j];
        }
    }
    rep(i, 3)
    {
        REP(j, 1, c + 1)
        mp[i][j] = 0;
    }
    REP(i, 1, n + 1)
    {
        REP(j, 1, n + 1)
        {
            int temp = 0;
            cin >> temp;
            mp[(i + j) % 3][temp]++;
        }
    }
    long long int ans = LLINF;

    REP(i, 1, c + 1)
    { //%0
        REP(j, 1, c + 1)
        { //%1
            REP(k, 1, c + 1)
            { //%2
                if (i == j || j == k || k == i)
                    continue;
                long long int temp = 0;
                REP(l, 1, c + 1)
                {
                    temp += mp[0][l] * iwa[l][i];
                    temp += mp[1][l] * iwa[l][j];
                    temp += mp[2][l] * iwa[l][k];
                }
                ans = min(ans, temp);
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;


void solve() {
    int N, K; cin >> N >> K;
    vector<double> p(N);
    for (int i = 0; i < N; i++) {
        double a; cin >> a;
        p[i] = (a + 1) / 2;
    }

    vector<double> sum(N+1);
    sum[0] = 0;
    for (int i = 0; i < N; i++) {
        sum[i+1] = sum[i] + p[i];
    }

    double ma = 0;
    for (int i = 0; i <= N - K; i++) {
        ma = max(ma, sum[i+K] - sum[i]);
    }

    cout << setprecision(15) << ma << endl;
}


int main() {
    solve();
    return 0;
}

Measured memory_bytes: 3328
#include <stdio.h>
int main(void){
    // Your code here!
    
    
    int n;
    scanf("%d",&n);
    
    if(n == 1)
        printf("Hello World");
    
    
    else {
        int a,b;
        scanf("%d",&a);
        scanf("%d",&b);
        
    printf("%d",a+b);
    }
    
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <map>
using namespace std;
int main(){
    string S;
    cin >> S;
    int N = S.length();
    int a[N];
    map<int ,int > p;
    int r=0;
    for(int i=0;i<2019;i++){
        p[i]=0;
    }
    p[0]++;
    int ten=1;
    int amari[N+1]={};
    for(int i=N-1;i>=0;i--){
        a[i]=S[i]-'0';
        
        r=ten*a[i]%2019;
        r=(amari[i+1]+r)%2019;
        ten=(ten*10)%2019;
        p[r]++;
        amari[i]=r;
    }
    int count=0;
    for(int i=0;i<2019;i++){
        count+=p[i]*(p[i]-1)/2;
    }
    cout << count  <<endl;
    return 0;
    return 0;
}

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

int main(){
   int h , n;
   cin >> h >> n;
    while(n--){
    	int x;
      cin >> x;
      if(h-x <= 0){
      	 cout <<"Yes\n";
         return 0;
      }
      h-=x;
    } 
 	cout <<"No\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <climits>
#define bogo_sort   std::sort
#define bozo_sort   std::stable_sort
#define alles(obj)  obj.begin(), obj.end()
#define elif        else if
#define unless(flg) if(!(flg))
#define elless(flg) else if(!(flg))
#define echo        std::cout <<
#define read        std::cin >>
#define endl        std::endl
#define fin         << '\n'
#define bash        push_back
#define fish        push_front
#define makePair    std::make_pair
#define _           << ' ' <<
// type-define
#define Stack       std::stack
#define Queue       std::queue
#define Deque       std::deque
#define PQueue      std::priority_queue
#define Set         std::set
#define Vector      std::vector
#define Pair        std::pair
#define Map         std::map
#define HashMap     std::unordered_map
#define Greater     std::greater
using String  =     std::string;
using llong   =     long long;
using boolean =     bool;
using Pii     =     Pair<int, int>;
using Vi      =     Vector<int>;
using Vii     =     Vector<Pii>;
// utils
constexpr int   dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int   dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int   INF  = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;

namespace {
    template<class A, class B> A power ( llong x, llong n, llong mod ) {
        llong ans = 1;
        while ( n > 0 ) {
            if ( n & 1 ) ans = ( ans * x ) % mod;
            x = ( x * x ) % mod;
            n >>= 1;
        }
        return ans;
    }
    template<class A, class B> A power ( A x, B n ) { return power( x, n, 1000000007 ); }
    template<class A> A gcd ( A x, A y ) { return x % y ? gcd( y, x % y ) : y; }
    template<class A, class B> A lcm   ( A x,  B y ) { return ( x / gcd(x, y) * y ); }
    template<class A> inline A abs ( A n ) { return ( n < 0 ) ? -n : n; }
    template<class A, class B> inline bool chmax ( A &a, const B &b ) { return b > a ? a = b, true : false; }
    template<class A, class B> inline bool chmin ( A &a, const B &b ) { return b < a ? a = b, true : false; }
    inline boolean isMovable ( int x, int y, int w, int h ) {
        return ( x >= 0 && y >= 0 && x < w && y < h );
    }
}

namespace Rlyeh {

    llong cnt, cnt2;

    signed call_of_Cthulhu( signed datum ) {

        int n, k;
        read n >> k;
        for ( int i = 1; i <= n; i++ ) {
            if ( k & 1 ) {
                if ( i % k == 0 ) cnt++;
            }
            else {
                if ( i % k == 0 ) cnt++;
                elif ( i % k == k/2 ) cnt2++;
            }
        }
        echo cnt*cnt*cnt+cnt2*cnt2*cnt2 fin;

        return 0;
    }
}

signed main(){std::cin.tie(0); std::ios::sync_with_stdio(false); int main_result = Rlyeh::call_of_Cthulhu(114514); return 0;}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std; inline void fileio(const char* in, const char* out) { freopen(in, "r", stdin); freopen(out, "w", stdout); }
#define TD typedef
#define forx(i,n) for(int i = 0; i < (n); ++i)
#define forxr(i,n) for(int i = (n)-1; i >= 0; --i)
TD long long ll; TD long double ld; TD pair<int,int> pii; TD pair<ll,ll> pll; TD vector<int> VI; TD vector<bool> VB; TD vector<ll> VL;
const char nl = '\n'; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; const ld EPS = 1e-9, PI = acos(-1);
#define ff first
#define ss second
#define all(c) c.begin(),c.end()

const int N = 303;
ld dp[N][N][N];
int n;

ld solve(int a1, int a2, int a3) {
  assert(a1 >= 0);
  assert(a2 >= 0);
  assert(a3 >= 0);
  const int a0 = n - a1 - a2 - a3;
  if (a0 == n) return 0;
  ld& v = dp[a1][a2][a3];
  if (v == 0) {
    v += (ld) n / (n-a0);
    if (a1) {
      v += solve(a1-1, a2, a3) * (ld) a1 / (n-a0);
    }
    if (a2) {
      v += solve(a1+1, a2-1, a3) * (ld) a2 / (n-a0);
    }
    if (a3) {
      v += solve(a1, a2+1, a3-1) * (ld) a3 / (n-a0);
    }
  }
  return v;
}

int main() { // Emily <3
  atexit([](){ cerr << "Time: " << (ld)clock() / CLOCKS_PER_SEC << nl; });
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cout << fixed << setprecision(12);
  cin >> n;
  int a[4] = {0,0,0};
  for (int i = 0; i < n; ++i) {
    int ai; cin >> ai;
    a[ai]++;
  }
  cout << solve(a[1], a[2], a[3]) << nl;

  return 0;
}



Measured memory_bytes: 432512
#include <iostream>
#include <vector>
using namespace std;

vector<int> G;
int cnt = 0;

void insertionSort(int A[], int n, int g) {
    int v, j;
    for (int i = g; i < n; i++) {
        v = A[i];
        j = i - g;
        while (j >= 0 && A[j] > v) {
            A[j+g] = A[j];
            j = j - g;
            cnt++;
        }
        A[j+g] = v;
    }
}

void shellSort(int A[], int n) {
    // Generate sequence G : g_(n+1) = 3 * g_(n) + 1
    for (int g = 1;;) {
        if (g > n) break;
        G.push_back(g);
        g = 3 * g + 1;
    }

    for (int i = G.size()-1; i >= 0; i--) {
        insertionSort(A, n, G[i]);
    }
}

int main() {
    int n;
    cin >> n;
    int A[n];
    for (int i = 0; i < n; i++) cin >> A[i];

    shellSort(A, n);
    cout << G.size() << endl;
    for (int i = G.size()-1; i >= 0; i--) {
        cout << G[i];
        if (i) cout << " ";
    }
    cout << endl << cnt << endl;
    for (int i = 0; i < n; i++) {
        cout << A[i] << endl;
    }
}


Measured memory_bytes: 6972