akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

ll POW(ll n, ll p) {
    ll ret = 1;
    for (; p > 0; p >>= 1, n = n * n % mod) {
        if (p & 1)ret = ret * n % mod;
    }
    return ret;
}
ll INV(ll n) { return POW(n, mod - 2); }

int main() {
    init();

    int n; cin >> n;
    VI a(n); cin >> a;
    map<int, int> m;
    each(i, a) {
        int x = i;
        for (int j = 2; j * j <= x; ++j) {
            int cnt = 0;
            while (x % j == 0) {
                x /= j;
                ++cnt;
            }
            if (cnt > 0)chmax(m[j], cnt);
        }
        if (x > 1)chmax(m[x], 1);
    }

    ll lcm = 1;
    each(i, m)lcm = lcm * POW(i.first, i.second) % mod;

    ll ans = 0;
    each(i, a)ans = (ans + lcm * INV(i) % mod) % mod;
    cout << ans << "\n";
}

Measured memory_bytes: 768
#include<cstdio>
#include<cstring>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
int temp[maxn];
int main()
{
	int n,k = 0;
	cin>>n;
	for(int i = 1; i <= n; i++){
		cin>>a[i];
		temp[a[i]]++;
	}
	for(int i = 1; i <= n; i++){
		if(temp[a[i]-1] > temp[a[i]+1]) temp[a[i]-1]++;
		else if(temp[a[i]-1] < temp[a[i]+1]) temp[a[i]+1]++;
		else if(temp[a[i]-1] == temp[a[i]+1]){
			temp[a[i]-1]++;
			temp[a[i]+1]++;
		}
	}
	sort(a+1,a+1+n);
	for(int i = a[1]-1; i <= a[n]+1; i++){
		if(temp[i] > k)
			k = temp[i];
	}
	cout<<k<<endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << " "
#define dumpL(x) cout << #x << " : " << x << '\n'
#define LINE cout << "line : " << __LINE__ << " "
#define LINEL cout << "line : " << __LINE__ << '\n'
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << " "
#define dumpVL(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl
#define STOP assert(false)
#else
#define dump(x) 
#define dumpL(x) 
#define LINE 
#define LINEL 
#define dumpV(v) 
#define dumpVL(v) 
#define STOP assert(false)
#endif
 
namespace std {
template<class S, class T>
ostream &operator <<(ostream& out, const pair<S, T>& a) {
    out << '(' << a.fi << ", " << a.se << ')';
    return out;
}
}

int main(){
    int H, W, N;
    cin >> H >> W >> N;
    vi y(N), x(N);
    rep(i, N) {
        cin >> y[i] >> x[i];
        --x[i];
        --y[i];
    }
    map<int, vector<int>> mp;
    rep(i, N) mp[y[i]].push_back(x[i]);
    for(auto& p : mp) sort(all(p.se));
    auto cnt = [&](int y, int x) {
        if(y < 0 || y + 2 >= H || x < 0 || x + 2 >= W) return 0;
        int ret = 0;
        auto it = mp.lower_bound(y);
        while(it!= mp.end() && it->fi <= y+2) {
            auto& v = it->se;
            ret += upper_bound(all(v), x+2) - lower_bound(all(v), x);
            ++it;
        }
        return ret;
    };
    set<pii> used;
    vector<ll> ans(10);
    rep(i, N) {
        REP(dx, -2, 3) REP(dy, -2, 3) {
            int yy = y[i] + dy;
            int xx = x[i] + dx; 
            pii p = make_pair(yy, xx);
            if(used.count(p)) continue;
            used.insert(p);
            auto t = cnt(yy, xx);
            if(t != 0) ans[t]++;
            if(t != 0){
                dump(yy);
                dump(xx);
                dumpL(t);
            }
        }
    }
    ll sum = accumulate(ans.begin(), ans.end(), 0LL);
    ans[0] = (H-2LL)*(W-2LL) - sum;
    rep(i, 10) {
        cout << ans[i] << endl;
    }
    return 0;
}

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";}
#define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

//Z algorithm O(S)
//????????±?????\???
class ZAlgorithm {
public:
	ZAlgorithm() {}
	//?????????: a[i]: s??¨s[i:s.size()-1]???????????±?????\???????????????
	vector<int> construct(const string &s) {
		int n = s.size();
		vector<int> a(n);
		a[0] = n;
		int i = 1, j = 0;
		while (i < n) {
			while (i + j < n && s[j] == s[i + j]) ++j;
			a[i] = j;
			if (j == 0) { ++i; continue; }
			int k = 1;
			while (i + k < n && k + a[k] < j) a[i + k] = a[k], ++k;
			i += k; j -= k;
		}
		return a;
	}
	//?????????: a[i]: t??¨s[i:s.size()-1]???????????±?????\???????????????
	vector<int> construct(const string &s, const string &t) {
		vector<int> a = construct(t + s);
		a.erase(a.begin(), a.begin() + t.size());
		int T = t.size();
		for (int &e : a)if (e > T)e = T;
		return a;
	}
	//?????????: a[i]: t??¨s[i:s.size()-1]???????????±?????\?°?????????????
	vector<int> construct_reverse(string s, string t) {
		reverse(s.begin(), s.end());
		reverse(t.begin(), t.end());
		vector<int> a = construct(s, t);
		reverse(a.begin(), a.end());
		return a;
	}
};

signed main() {
	ZAlgorithm ZA;
	string s, t; cin >> s >> t;
	vector<int> res1 = ZA.construct(s, t);
	vector<int> res2 = ZA.construct_reverse(s, t);
	int ans = 0;
	int S = s.size(), T = t.size();
	rep(i, 0, S - T + 1) {
		if (res1[i] + res2[i + T - 1] == T - 1)ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 8096
#include <stdio.h>
#include <math.h>

#define EPS 1e-10

int main(void) {
    double xa, ya, xb, yb, xc, yc, xd, yd, cp;
    while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf",
                 &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) == 8) {
        cp = (xb-xa)*(xd-xc)+(yb-ya)*(yd-yc);
        if (fabs(cp) < EPS) {
            puts("YES");
        }
        else {
            puts("NO");
        }
    }
    return 0;
}

Measured memory_bytes: 612
#include <stdio.h>

int main(void) {

  int d;
  scanf("%d", &d);
  long c[26];
  for (int i = 0; i < 26; i++) {
    scanf("%ld", &c[i]);
  }
  long s[d][26];
  for (int i = 0; i < d; i++) {
    for (int j = 0; j < 26; j++) {
      scanf("%ld", &s[i][j]);
    }
  }
  long score,max;
  int max_contest;
  long last[26];
  for (int i = 0; i < 26; i++) {
    last[i] = -1;
  }
  for (int i = 0; i < d; i++) {
    for (int contest = 0; contest < 26; contest++) {
      score = s[i][contest];
      for (int j = 0; j < 26; j++) {
        if (j == contest) {
          continue;
        }
        score -= c[j]*(d-last[j]);
      }
      if (contest == 0 || score > max) {
        max = score;
        max_contest = contest;
      }
    }
    last[max_contest] = d;
    printf("%d\n", max_contest+1);
  }

  return 0;
}

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

int main(){
  int i,j,cnt=0;
  ll n,m;
  cin>>n>>m;
  if(n==1 && m==1)cout<<1;
  else if(n==1)cout<<m-2;
  else if(m==1)cout<<n-2;
  else cout<<(n-2)*(m-2);
}

Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
void error(){
    W(-1);
    exit(0);
}
int main(){
    string s;
    R(s);
    int n=SZ(s);
    if(s[n-1]=='1')error();
    if(s[0]=='0')error();
    REP(i,n-1){
        if(s[i]!=s[n-2-i])error();
    }
    int now=1;
    FOR(i,2,n){
        W(now,i);
        if(s[i-2]=='1'){
            now=i;
        }
    }
    return 0;
}


Measured memory_bytes: 1664
use std::io::{stdin, Read};

fn main() {
    let mut input: String = String::new();
    stdin().read_line(&mut input).unwrap();
    let input = input.trim().parse::<i32>().unwrap();
    // assert!(input >= 1 && input <= 32);
    let arr: [i32; 32] = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51];
    println!("{}", arr[input as usize-1]);
}


Measured memory_bytes: 4352
#include <stdio.h>

int main(int argc, const char * argv[]) {
    
    int a;
    int b;
    
    scanf("%d %d", &a, &b);

    int A = a*b;
    int L = 2*a+2*b;
    printf("%d %d\n", A, L);
    return 0;
}


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

int main() {
	string s;

	cin >> s;

	for (int i = 0 ; i < 4; i++) cout << s[i];

	cout << " ";

	for (int i = 4; i < 12; i++) cout << s[i];

	cout << endl;

	return 0;
}

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




int main(){
  

  int64_t n;
  cin>>n;
  
  vector<int64_t> data(n);
  
  for (int64_t i=0;i<n;i++){
    int64_t tmp;
    cin>>tmp;
    data.at(i)=tmp;
  }
  
  int64_t answereven=0;
  
  int64_t sum1=0;
  
  for (int64_t i=0;i<n;i++){
    sum1+=data.at(i);
    if (i%2==0 and sum1<=0){
      answereven+=1-sum1;
      sum1=1;
    }
    
    else if (i%2==1 and sum1>=0){
      answereven+=sum1+1;
      sum1=-1;
    }
    
  }
  
  int64_t answerodd=0;
  
  sum1=0;
  
    for (int64_t i=0;i<n;i++){
    sum1+=data.at(i);
    if (i%2==0 and sum1>=0){
      answerodd+=sum1+1;
      sum1=-1;
    }
    
    else if (i%2==1 and sum1<=0){
      answerodd+=1-sum1;
      sum1=1;
    }
    
  }
    
      
  cout<<min(answereven,answerodd)<<endl;
    
    
  
  
  
  
    
  
  
  
}

Measured memory_bytes: 1024
n = int(input())

ans = [0]*(10**4+1)

for i in range(1,200):
    for j in range(1,200):
        for k in range(1,200):
            a = i**2 + j**2 + k**2 + (i*j) + (j*k) + (k*i)
            if a <= 10**4:
                ans[a] += 1
                
for i in range(1,n+1):
    print(ans[i])

Measured memory_bytes: 69128
n = int(input())
h = list(map(int, input().split()))

for i in range(n):
    if i == 0:
        h[i] -= 1
    else:
        if h[i] - h[i-1] >= 1:
            h[i] -= 1

flag = False
for i in range(n-1):
    if h[i] > h[i+1]:
        flag = True
        break

if flag:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 14224
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>

using namespace std;


long long com[55][55];

void c_set()
{
	com[0][0]=1;
	for(int i=1;i<=50;i++)
	{
		for(int j=0;j<=i;j++)
		{
			com[i][j]=(j!=0 ? com[i-1][j-1] : 0) + (j!=i ? com[i-1][j] : 0);
		}
	}
}


int main()
{
	int n,a,b;
	cin >> n >> a >> b;
	vector<long long> v(n);
	for(int i=0;i<n;i++)
		cin >> v[i];
	
	sort(v.begin(),v.end());
	reverse(v.begin(),v.end());
	
	long double ans=0;
	for(int i=0;i<a;i++)
		ans+=v[i];
	ans/=a;
	cout << fixed << setprecision(9) << ans << endl;

	c_set();


	long long x=v[a-1];
	int c=0;
	int bc=0;
	bool flag=false;
	for(int i=0;i<n;i++)
	{
		if(v[i]==x)
		{
			c++;
			flag=true;
		}
		else
		{
			if(flag==false)bc++;
			else	break;
		}
	}
	long long an=0;

	if(bc==0)
	{
		for(int i=a;i<=min(b,c);i++)
		{
			long long tmp=com[c][i];
			an+=tmp;
		}
	}
	else
	{
		an+=com[c][a-bc];
	}
	cout << an << endl;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }

int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int X = (C % B == 0) ? (C/B) : (C/B+1);
    int Y = (A % D == 0) ? (A/D) : (A/D+1);
    bool ret = X > Y;
    cout << (ret?"No":"Yes") << "\n";
    return 0;
}


Measured memory_bytes: 3624
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
struct mm
{
	int c,s,f;
}g[501];
int main()
{
	int n,i,j,t,x;
	scanf("%d",&n);
	for(i=0;i<n-1;i++)
	scanf("%d%d%d",&g[i].c,&g[i].s,&g[i].f);
	for(i=0;i<n-1;i++)
	{
		t=g[i].c+g[i].s;
		for(j=i+1;j<n-1;j++)
		{
			x=t-g[j].s;
			if(x<0)
			{
				t=g[j].s+g[j].c;
			}
			else
			{
				
				if(x%g[j].f!=0)
				x/=g[j].f,x++;
				else
				x/=g[j].f;
				t=g[j].s+g[j].f*x+g[j].c;
			}
		}
		printf("%d\n",t);
	}
	printf("0\n");
}

Measured memory_bytes: 128
from pprint import pprint
s=input()
t=input()
d={}
for c in 'abcdefghijklmnopqrstuvwxyz':
  d[c]=set()
for c1, c2 in zip(s,t):
  d[c1].add(c2)
te = set()
for key in d.keys():
  if len(d[key]) >= 2:
    print("No")
    break
  if len(d[key]) == 1:
    val = list(d[key])[0]
    if val in te:
      print("No")
      break
    te.add(val)
else:
  print("Yes")


Measured memory_bytes: 4400
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

bool flag = true;

int main()
{
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  int total1 = A;
  int total2 = C;
  int count = 0;

  while (total1 > 0 && total2 > 0)
  {
    total2 -= B;
    total1 -= D;
    count++;
  }

  if (total2 <= 0)
  {
    flag = false;
    cout << "Yes" << endl;
  }

  if (flag == true && total1 <= 0)
  {
    cout << "No" << endl;
  }
  else if (flag == true && total1 > 0)
  {
    cout << "Yes" << endl;
  }
}

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

using namespace std;
 
int main () {
	string a,b;
	int k,aa,bb,i;
	cin >> a >> b;


	if (a.size()>b.size())k=1;
	else if (a.size()<b.size())k=2;
	else{
		for(i=0;i<a.size();i++){
			aa = a[i] - '0';
			bb = b[i] - '0';
			if (aa>bb){
				k=1;
				break;
			}else if (aa<bb){
				k=2;
				break;
			}
		}
		if (i==a.size()){
			k=3;
		}
	}




	if(/*a>b*/k==1){
		cout << "GREATER" << endl;
	}else if(/*a<b*/k==2){
		cout << "LESS" << endl;
	}else{
		cout << "EQUAL" << endl;
	}


	
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll n,m;
vector<ll> G[100010];
bool used[100010];
bool color[100010];

bool dfs(int i,bool c){
	bool f = true;
	used[i] = true;
	color[i] = c;
	REP(j,G[i].size()){
		if(used[G[i][j]] && c == color[G[i][j]])
			f = false;
		if(!used[G[i][j]]){
			f &= dfs(G[i][j],!c);
		}
	}
	return f;
}

int main(){
	cin >> n >> m;
	REP(i,m){
		ll a,b;
		cin >> a >> b;
		G[a - 1].pb(b - 1);G[b - 1].pb(a - 1);
	}

	fill(used,used+n,false);

	if(dfs(0,true)){
		ll b = 0,w = 0;
		REP(i,n){
			if(color[i])b++;
			else w++;
		}
		cout << b * w - m << endl;
	}else
		cout << n * (n - 1) / 2 - m << endl;
	return 0;
}


Measured memory_bytes: 8320
#include <bits/stdc++.h>
#define E 2.718
using namespace std;
typedef long long ll;
const ll INF=0x7f7f7f7f;
const int maxn=1e6+8;
const double eps=1e-10;
const ll mod=1000000007;
ll n,m,b;
bool viss[30];
char s[100005],t[100005];
int nex[100005][30];
int loca[30];// 标记初始位置
void restart(int len)
{
    for(int i=1;i<=len+1;i++)
        for(int k=1;k<=26;k++)
            nex[i][k]=-1;
    for(int i=len;i>=2;i--)
    {
        for(int k=1;k<=26;k++) nex[i-1][k]=nex[i][k];
        nex[i-1][s[i]-'a'+1]=i;
    }
}
int main()
{
    bool f=false;
    scanf("%s%s",s+1,t+1);
    int lens=strlen(s+1),lent=strlen(t+1);
    restart(lens);
    for(int i=1;i<=lens;i++)
    {
        if(!viss[s[i]-'a'+1])
        {
            loca[s[i]-'a'+1]=i;
            viss[s[i]-'a'+1]=true;
        }
    }
    for(int i=1;i<=lent;i++)
        if(viss[t[i]-'a'+1]==false)
        {
            f=true;
            break;
        }
    if(f) printf("-1\n");
    else
    {
        ll ans=0;// 次数与最后长度
        ll st=loca[t[1]-'a'+1],peace=1;;
        while(peace!=lent)
        {
            ll temp=t[peace+1]-'a'+1;
            if(nex[st][temp]!=-1)
                st=nex[st][temp];
            else
            {
                st=loca[temp];
                ans++;
            }
            peace++;
        }
        printf("%lld\n",ans*lens+st);
    }
    return 0;
}


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

using namespace std;


int main() {
    int ab = 0, bc = 0, ca = 0;
    cin >> ab >> bc >> ca;
    vector<int> vec;
    vec.push_back(ab);
    vec.push_back(bc);
    vec.push_back(ca);

    sort(vec.begin(), vec.end());
    cout << (vec[0] * vec[1]) / 2 << endl;
}

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

using namespace std;

int main(){

    string S, T;
    cin >> S;
    cin >> T;

    int ans = 0;
    for(int i = 0; i < S.length(); i++) if(S.at(i) == T.at(i)) ans++;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import numpy as np
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
s = np.sort(s)
index_nonten = np.where(s%10!=0)[0]
sum = np.sum(s)
if sum%10==0:
    if len(index_nonten)==0:
        sum = 0
    else:
        sum -=s[index_nonten][0]
print (sum)

Measured memory_bytes: 21780
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

int n, m;
vector<int> v[8];
int used[8];
int ans = 0;

void dfs(int current, int t) {
	if(t == 0) {
		bool flag = true;
		rep(i, 0, n) {
			if(!used[i]) flag = false;
		}
		if(flag) ans++;
		used[current]--;
		return;
	}

	rep(i, 0, v[current].size()) {
		used[v[current][i]]++;
		dfs(v[current][i], t - 1);
	}

	used[current]--;
}

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

	cin >> n >> m;
	rep(i, 0, m) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}

	rep(i, 0, 8) used[i] = 0;
	used[0] = 1;
	dfs(0, n - 1);
	cout << ans << endl;

}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
    long long int X,N,p,T;

    scanf("%lld%lld%lld",&N,&X,&T);
    double a=(double)N/X;

    if(a>N/X)
    p=a+1;
    else
       p=a ;
    printf("%lld\n",p*T);


    return 0;
}


Measured memory_bytes: 2172
import sys


def main():
    input = sys.stdin.buffer.readline
    n, m = map(int, input().split())
    c = [0] + list(map(int, input().split()))
    dp = [list(range(n + 1)) for _ in range(m + 1)]
    for i in range(1, m + 1):
        for j in range(n + 1):
            if j - c[i] >= 0:
                dp[i][j] = min(dp[i - 1][j], dp[i][j - c[i]] + 1)
            else:
                dp[i][j] = dp[i - 1][j]
    print(dp[m][n])


if __name__ == "__main__":
    main()



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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if (max({a,b,c})==7 && min({a,b,c})==5 && a+b+c==17) cout << "YES" << endl;
  else cout << "NO" << endl;

}

Measured memory_bytes: 256
import math
X, K, D = list(map(int, input().split()))

a = (K * D - X) / (2*D)
a1, a2 = math.floor(a), math.ceil(a)

left = 0
right = K
def f(a):
    return X - K * D + 2 * a * D

mid = None
flag = 0
while left+1 < right:
    mid = (left + right) // 2

    if f(mid) == 0:
        flag = 1
        break
    elif f(mid) < 0:
        left = mid
    else:
        right = mid

if flag:
    print(abs(X - K * D + 2 * mid * D))
else:
    res1 = abs(X - K * D + 2 * left * D)
    res2 = abs(X - K * D + 2 * right * D)
    print(min(res1, res2))


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

bool chk(char c) {
    return ('2' <= c && c <= '9');
}

int conv(string s) {
    int res = 0;

    for (int i = 0; i < s.length(); ++i) {
        if (s[i] == 'm') {
            if (i == 0) res += 1000;
            else {
                string t = ""; t += s[i-1];
                res += atoi(t.c_str())*1000;
            }
        }
        else if (s[i] == 'c') {
            if (chk(s[i-1])) {
                string t = ""; t += s[i-1];
                res += atoi(t.c_str())*100;
            }
            else res += 100;
        }
        else if (s[i] == 'x') {
            if (chk(s[i-1])) {
                string t = ""; t += s[i-1];
                res += atoi(t.c_str())*10;
            }
            else res += 10;
        }
        else if (s[i] == 'i') {
            if (chk(s[i-1])) {
                string t = ""; t += s[i-1];
                res += atoi(t.c_str());
            }
            else res += 1;
        }
    }
    return res;
}

string solve(int s) {
    string res = "";

    int b[] = {1000, 100, 10, 1};
    char m[] = {'m', 'c', 'x', 'i'};

    for (int i = 0; i < 4; ++i) {
        int t = s/b[i];
        if (t == 0) continue;
        else {
            if (t == 1) res += m[i];
            else res += to_string(t)+m[i];
            s -= t*b[i];
        }
    }

    return res;
}

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

    while (n--) {
        string a, b;
        cin >> a >> b;
        cout << solve(conv(a)+conv(b)) << endl;
    }
}

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

int main(){

    int N, X, Y, distance;
    cin >> N >> X >> Y;
    vector<int> dis(N-1);


    for(int i=1; i<=N-1; i++){
        for(int j=i+1; j<=N; j++){

            if(j<=X || i>=Y){
                distance = j - i;
            }else if(i<=X && j>=Y){
                distance = j - i - (Y-X-1);
            }else if(i>=X && j<=Y){
                distance = min(j-i, (i-X)+(Y-j)+1);
            }else if(i<=X){
                distance = min(j-i, (X-i)+(Y-j)+1);
            }else{
                distance = min(j-i, (j-Y)+(i-X)+1);
            }
            dis.at(distance-1)++;
        }
    }

    for(int i=0; i<N-1; i++){
        cout << dis.at(i) << endl;
    }    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    int n;
    cin >> n;
    string s;
    unordered_map<string, vector<int>> cnt;
    for(int i = 0; i < n; i++) {
        cin >> s;
        sort(s.begin(), s.end());
        cnt[s].push_back(i);
    }
    ll ans = 0;
    for(auto& p: cnt) {
        ll num = p.second.size();
        ans += num*(num-1) / 2;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 15268
#include<bits/stdc++.h>
#define maxn 2005
using namespace std;
vector<int> G[maxn];
int vis[maxn],dis[maxn];
int ans[maxn];
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,x,y;
	cin >> n >> x >> y;
	for(int i=1;i<n;i++) {
		G[i].push_back(i + 1);
		G[i + 1].push_back(i);
	}
	G[x].push_back(y);
	G[y].push_back(x);
	for(int st=1;st<=n;st++) {
		dis[st] = 0;
		vis[st] = st;
		queue<int> q;
		q.push(st);
		while(!q.empty()) {
			int u = q.front();
			q.pop();
			for(int v : G[u])
				if(vis[v] != st) {
					vis[v] = st;
					dis[v] = dis[u] + 1;
					q.push(v);
				}
		}
		for(int ed=1;ed<=n;ed++)
			ans[dis[ed]]++;
	}
	for(int i=1;i<n;i++)
		cout << ans[i] / 2 << '\n';
 	return 0;
}


Measured memory_bytes: 384
N, K, Q = map(int, input().split())
score = [K] * N
minus = [0] * N

for i in range(Q):
    now = int(input()) - 1
    minus[now] += 1

for j in range(N):
    if K - Q + minus[j] > 0:
        print('Yes')
    else :
        print('No')

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


int main() {
	cout << setprecision(10);
	cerr << setprecision(10);
	int N, K;
	cin >> N >> K;
	vector<long double>A(N);
	long double maxsize = 0;
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
		maxsize = (maxsize > A[i] ? maxsize : A[i]);
	}
	long double eps = 0.00001;
	long double l = eps;
	long double r = maxsize;
	while (r - l > eps) {
		long double x = (l + r) / 2;
		long long count = 0;
		for (int i = 0; i < N; ++i) {
			count += floor((A[i] / x));
			if (0 != fmod(A[i], x)) {
				count++;
			}
		}
		if (count > K + N) {
			l = x;
		}
		else {
			r = x;
		}
	}
	cout << ceil(r - eps) << endl;
	/*
	int ans = r / 1;
	if (0 != fmod(r, 1)) {
		ans++;
	}
	cout << ans << endl;*/
	return 0;
}


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

#define int long long
using ll = long long;
using ld = long double;
using intpair = pair<int, int>;
using intmap = map<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
const int MOD = 1e9 + 7;
inline int mod(ll a, int m = MOD) { return (a % m + m) % m; }
inline bool bit(ll b, ll i) { return b & (1 << i); }
inline ll ceiv(ll a, ll b) { return (a + b - 1) / b; }
// struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;

#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

signed main(){
    int x; cin >> x;
    cout << (x < 30 ? "No" : "Yes") << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e5 + 7;
int n;
int a[maxx];
ll ans;
struct PP {
	string s;
} p[maxx];

bool cmp(PP x, PP y) { return x.s < y.s; }

void Init() {
	scanf("%d", &n);
	for(int i = 1; i <= n; i++) {
		cin >> p[i].s;
		for(int j = 0; j < 15; j++) a[j] = 0;
		int l = p[i].s.length();
		for(int j = 0; j < l; j++) a[j] = p[i].s[j] - 'a';
		sort(a, a + l);
		for(int j = 0; j < l; j++) p[i].s[j] = 'a' + a[j];
	}
	sort(p + 1, p + n + 1, cmp);
}

void Solve() {
	ll cnt = 1ll;
	for(int i = 1; i < n; i++) {
		if(p[i].s == p[i + 1].s) cnt++;
		else {
			ans += cnt * (cnt - 1) / 2;
			cnt = 1ll;
		}
	}
	if(p[n].s == p[n - 1].s) ans += cnt * (cnt - 1) / 2;
	printf("%lld\n", ans);
}

int main() {
	Init();
	Solve();
}

Measured memory_bytes: 7296
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)

int main(){
    ll n, W;
    cin >> n >> W;
    vector<ll> w(n), v(n);
    for(int i = 0; i < n; i++){
        cin >> w[i] >> v[i];
    }
    int MAXV = 100*1000;
    ll INF = 1e12+11;
    vector<vector<ll>> dp(n+1,vector<ll>(MAXV+1,INF));
    dp[0][0] = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j <= MAXV; j++){
            dp[i+1][j] = min(dp[i][j],dp[i+1][j]);
            if(j+v[i]<=MAXV){
                dp[i+1][j+v[i]] = min(dp[i][j+v[i]], dp[i][j]+w[i]);
            }
        }
    }
    int ans = 0;
    for(int i = 0; i <= MAXV; i++){
        if(dp[n][i]<=W){ans = max(ans,i);}
    }
    cout << ans << endl;

}


Measured memory_bytes: 80256
class Dice
    TOP = 0; BOTTOM = 1; NORTH = 2; SOUTH = 3; EAST = 4; WEST = 5;

    attr_reader :dice
    def initialize
        @dice = Array.new(6)
        @dice[TOP] = 1
        @dice[BOTTOM] = 6
        @dice[NORTH] = 5
        @dice[SOUTH] = 2
        @dice[EAST] = 3
        @dice[WEST] = 4
    end

    def north
        tmp = @dice.dup
        tmp[TOP] = @dice[SOUTH]
        tmp[SOUTH] = @dice[BOTTOM]
        tmp[BOTTOM] = @dice[NORTH]
        tmp[NORTH] = @dice[TOP]
        @dice = tmp
    end

    def east
        tmp = @dice.dup
        tmp[TOP] = @dice[WEST]
        tmp[WEST] = @dice[BOTTOM]
        tmp[BOTTOM] = @dice[EAST]
        tmp[EAST] = @dice[TOP]
        @dice = tmp
    end

    def west
        tmp = @dice.dup
        tmp[TOP] = @dice[EAST]
        tmp[EAST] = @dice[BOTTOM]
        tmp[BOTTOM] = @dice[WEST]
        tmp[WEST] = @dice[TOP]
        @dice = tmp
    end

    def south
        tmp = @dice.dup
        tmp[TOP] = @dice[NORTH]
        tmp[NORTH] = @dice[BOTTOM]
        tmp[BOTTOM] = @dice[SOUTH]
        tmp[SOUTH] = @dice[TOP]
        @dice = tmp
    end

    def right
        tmp = @dice.dup
        tmp[SOUTH] = @dice[EAST]
        tmp[EAST] = @dice[NORTH]
        tmp[NORTH] = @dice[WEST]
        tmp[WEST] = @dice[SOUTH]
        @dice = tmp
    end

    def left
        tmp = @dice.dup
        tmp[SOUTH] = @dice[WEST]
        tmp[WEST] = @dice[NORTH]
        tmp[NORTH] = @dice[EAST]
        tmp[EAST] = @dice[SOUTH]
        @dice = tmp
    end

    def print_r
#        p @dice
    end
end

while true
    n = gets.to_i
    exit if n==0

    d = Dice.new

    res = 1
    n.times do
        l = gets.chomp
        d.send l.downcase
        res += d.dice[Dice::TOP]
        d.print_r
    end

    puts res
end

Measured memory_bytes: 5672
#include"iostream"
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
#include<list>
#include<map>
#include<string>
#include<algorithm> 
#include <queue> 
#include <sstream>
#include <fstream>
#include<cmath>
#define INF 100000000000
#define LL long long
using namespace std;
map<LL , LL> m;
long long N, M, K, ans,A,B;

string s;

int main() {
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '0')A++;
		else B++;
	}
	cout << 2*min(A,B) << endl;
	return 0;
}

Measured memory_bytes: 512
#include<stdio.h>
int main(void){
  
  int n,i;
  
  while(1)
    {
      i=0;
      scanf("%d",&n);
      if(n==0)break;
      
      while(n!=1)
	{
	  i++;
	  if(n%2==0)n=n/2;
	  else n=3*n+1;
	}
      printf("%d\n",i);
    }
  return 0;
}

Measured memory_bytes: 0
import java.lang.*;
import java.util.*;

class Now {
	private static Now singleton = null;
	private static int id;
	private static String exp;

	private Now() {
		id = 0;
	}

	private Now(String exp) {
		this.exp = exp;
		id = 0;
	}

	public static synchronized void initialize(String exp) {
		singleton = new Now(exp);
	}

	public static synchronized Now getInstance() {
		if(singleton == null){
			singleton = new Now();
		}
		return singleton;
	}

	public static int getId() {
		return id;
	}

	public static String getExp() {
		return exp;
	}

	public static int plusId() {
		id++;
		return id;
	}
}


interface Parser {
	public int parse();
}

class Expression implements Parser{

	public int parse(){
		int res = new Term().parse();

		while(true){
			char now = Now.getExp().charAt(Now.getId());
			
			if(now == '+') {
				Now.plusId();
				res += new Term().parse();
			}
			else if(now == '-') {
				Now.plusId();
				res -= new Term().parse();
			}
			else {
				break;
			}
		}

		return res;
	}
}

class Term implements Parser {

	public int parse(){
		int res = new Factor().parse();
		while(true) {
			char now = Now.getExp().charAt(Now.getId());

			if(now == '*') {
				Now.plusId();
				res *= new Factor().parse();
			}
			else if(now == '/') {
				Now.plusId();
				res /= new Factor().parse();
			}
			else {
				break;
			}
		}

		return res;
	}
}

class Factor implements Parser {

	public int parse() {
		int res=0;
		char now = Now.getExp().charAt(Now.getId());

		if(now == '(') {
			Now.plusId();
			res = new Expression().parse();
			Now.plusId();
		}
		else {
			return new Number().parse();
		}

		return res;
	}
}

class Number implements Parser {

	public int parse() {
		int res = 0;
		String exp = Now.getExp();

		while(true) {
			char now = exp.charAt(Now.getId());
			if(!Character.isDigit(now))break;

			res *= 10;
			res += Character.digit(now,10);
			
			Now.plusId();
		}

		return res;
	}
}

public class Main {

	public void solve() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String exp;
		exp = sc.nextLine();

		for(int i=0;i<n;i++) {
			exp = sc.nextLine();
			Now.initialize(exp);
			System.out.println(new Expression().parse());	
		}
	}

	public static void main(String[] args) {
		Main problem_0109 = new Main();
		problem_0109.solve();
	}
}

Measured memory_bytes: 17240
while True:
  n,k=list(map(int,input().split()))
  if n==0 and k==0:
    break
  a=[]
  for i in range(n):
    a.append(int(input()))
  s=sum(a[0:k])
  t=[s]
  for i in range(k,n):
    s=s+a[i]-a[i-k]
    t.append(s)
  print(max(t))


Measured memory_bytes: 11700
K = int(input())
if(K==0):
    print(4)
    print(3,3,3,3)
elif(K==1):
    print(3)
    print(1,0,3)
elif(K<50):
    n = K
    li = [i for i in range(n)]
    for i in range(n):
        for j in range(n):
            if(i==j):
                li[j] += n
            else:
                li[j] -= 1
    print(n)
    print(*li)
else:
    x = K%50
    y = K//50
    li = [y+i for i in range(50)]
    for i in range(x):
        for j in range(50):
            if(i==j):
                li[j] += 50
            else:
                li[j] -= 1
    print(50)
    print(*li)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<string,int>;
const double PI = acos(-1);

int main() {
string s;
cin >> s;
bool flag1 = false,flag2 = false;
rep(i,s.size()){
  if(s.at(i)=='C')flag1 = true;
  if(flag1&&s.at(i)=='F')flag2=true;
}
cout <<(flag2?"Yes":"No")<< endl;
}


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

void solve()
{
    int n; cin >> n;
    int ans = n-1;
    for(int i = 2; i <= n-1; i++)
    {
        int m = 0;
        if(n%i == 0)
        {
            m = (n/i)-1;
        }
        else
        {
            m = n/i;
        }
        ans += m;
    }
    cout << ans << endl;
}
int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 3636
import java.util.*;
import java.lang.Math;
public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int T = sc.nextInt();
        int takoyaki = 0;
        int time = 0;
        while(takoyaki < N){
            takoyaki += X;
            time += T;
            }
        System.out.println(time);
    }
}


Measured memory_bytes: 35596
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    int a=read(),b=read(),c=read();
    swap(a,b),swap(a,c);
    pr1(a),pr1(b),pr2(c);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false);  cin.tie(NULL); cout.tie(NULL);
#define scan(a,n) for(long int index=0;index<n;index++) cin>>a[index];
#define print(a,n) for(long int index=0;index<n;index++) cout<<a[index]<<" ";cout<<endl;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define vli vector<long long int>
#define vlli vector<pair<long long int,long long int>>
#define vsi vector<string>
#define vci vector<char>


 
int main() {
   #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    fast;
    ll n;
    cin>>n;
    ll a[n],i;
    scan(a,n);
    ll ans=0;
    for(i=1;i<n;i++){
      if(a[i]<a[i-1]) {
        ans+=a[i-1]-a[i];
        a[i]=a[i-1];
      }
    }
    cout<<ans<<endl;
return 0;    
 }  

Measured memory_bytes: 5204
#include <bits/stdc++.h>
using namespace std;
int n;
int main(){
	scanf("%d",&n);
	int ans=1e9;
	for(int i=1;i<n;i++){
		int a=i,b=n-i;
		int sum=0;
		while(a) sum+=a%10,a/=10;
		while(b) sum+=b%10,b/=10;
		ans=min(ans,sum);
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mk make_pair
using namespace std;
typedef long long ll;
const int N = 605;
const int mod = 1e9 + 7;
int n, f = 1, cnt, a[N];
int bo[N];
int dp[602][302][302];
int main() {
	cin >> n;
	for (int i = 1; i <= 2 * n; ++i) 
		cin >> a[i];
	for (int i = 1; i <= n; ++i) {
		int j = 2 * i, k = 2 * i - 1;
		if (a[j] == -1 && a[k] == -1) {
			++cnt;
			f = (ll)f * cnt % mod;
		} else 
		if (a[j] != -1 && a[k] != -1) {
			bo[a[j]] = 1;
			bo[a[k]] = 1;
		} else 
		if (a[j] != -1) {
			bo[a[j]] = 2;
		} else {
			bo[a[k]] = 2;
		}
	}
	dp[0][0][0] = 1;
	for (int i = 1; i <= 2 * n; ++i) {
		for (int j = 0; j <= min(i, n); ++j) {
			for (int k = 0; k <= min(i, n); ++k) {
				if (dp[i - 1][j][k] == 0) continue;
				if (bo[i] == 0) {
					if (k)
						(dp[i][j][k - 1] += dp[i - 1][j][k]) %= mod;
					//if (j)
					//	(dp[i][j - 1][k] += dp[i - 1][j][k]) %= mod;
					(dp[i][j + 1][k] += dp[i - 1][j][k]) %= mod;
					(dp[i][j][k + 1] += dp[i - 1][j][k]) %= mod;
				}
				if (bo[i] == 1) {
					(dp[i][j][k] += dp[i - 1][j][k]) %= mod;
				}
				if (bo[i] == 2) {
					if (j)
						(dp[i][j - 1][k] += (ll)j * dp[i - 1][j][k] % mod) %= mod;
					(dp[i][j][k + 1] += dp[i - 1][j][k]) %= mod;
				}
			}
		}
	}
	//cout << 9540576 / f << "," << dp[2 * n][0][0] << endl;
	cout << (ll)dp[2 * n][0][0] * f % mod << endl;
}

Measured memory_bytes: 212352
n,y = map(int, input().split())
a = y // 10000
b = y // 5000
for i in range(0,a+1):
  for j in range(0,b+1):
    if n-i-j < 0:
      break
    total = i*10000 + j*5000 + (n-i-j)*1000
    if total == y:
      print(i, j, n-i-j)
      exit(0)
print('-1 -1 -1')

Measured memory_bytes: 3064
import java.io.InputStreamReader;
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		try(Scanner scan = new Scanner(new InputStreamReader(System.in))){
			int N = scan.nextInt();
			
			int[] a = new int[N];
			
			for(int i = 0; i<N; i++){
				a[i] = scan.nextInt();
			}
			
			int ans = 0;
			
			for(int i = 1; i<=N; i++){
				if(a[a[i-1]-1] == i){
					ans++;
				}
			}
			

			System.out.println(ans/2);
		}
	}
}


Measured memory_bytes: 31524
from collections import deque
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n = int(input())
G = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(lambda x:int(x)-1,input().split())
    G[a].append(b)
    G[b].append(a)

mod = 10**9 + 7
queue = deque()
queue.append(0)
parent = [-1]*n
parent[0] = 0
while queue:
    now = queue.popleft()
    for to in G[now]:
        if parent[to] == -1:
            parent[to] = now
            queue.append(to)

data1 = [[0,0] for i in range(n)]
def factorial(N,MOD,r=True):
    fact = [1]*(N+1)
    rfact = [1]*(N+1)
    r = 1
    for i in range(1,N+1):
        fact[i] = r = r * i % MOD
    rfact[N] = r = pow(fact[N],MOD-2,MOD)
    for i in range(N, 0, -1):
        rfact[i-1] = r = r * i % MOD
    if r:
        return fact,rfact
    else:
        return fact

fact,rfact = factorial(2*10**5,mod)
def com(l):
    res = 1
    s = 0
    for x in l:
        res *= rfact[x]
        res %= mod
        s += x
    res *= fact[s]
    res %= mod
    return res
def dfs(now,pre):
    if data1[now] != [0,0]:
        return
    if len(G[now]) == 1 and G[now][0] == pre:
        data1[now] = [1,1]
        return
    x,y = 0,1
    child = []
    for to in G[now]:
        if pre == to:
            continue
        dfs(to,now)
        child.append(data1[to][1])
        y *= data1[to][0]
        y %= mod
    res = y * com(child)
    res %= mod
    data1[now] = [res,sum(child)+1]
    return

dfs(0,-1)

ans = [data1[i][0] for i in range(n)]

que = deque()
que.append([0,0])
while que:
    now,pre = que.popleft()
    for to in G[now]:
        if to == pre:continue
        ans[to] = ans[now]*data1[to][1]*pow(n-data1[to][1],mod-2,mod)
        ans[to] %= mod
        que.append([to,now])

for x in ans:
    print(x)

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

#define ALL(v) v.begin(), v.end()
typedef long long ll;



using namespace std;
int main() {
	int n,k;
	
	cin >> n >> k;
	int total = 0;
	for (int i = 0; i < n; i++)
	{
		int temp;
		cin >> temp;
		if (temp >= k) total++;
	}
	
	cout << total << endl;

}

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

const int MAXN = 1e5 + 5;

int N;
int root[2];
int res[MAXN];
int match[2][MAXN];
int parity[2][MAXN];
vector <int> 	Adj[2][MAXN];
vector <int> newAdj[2][MAXN];

int curG;

void DFS(int cur)
{
	for(auto x : Adj[curG][cur])
	{
		DFS(x);
		newAdj[curG][cur].push_back(newAdj[curG][x].front());
	}
	while(newAdj[curG][cur].size() > 1)
	{
		int u = newAdj[curG][cur].back();
		newAdj[curG][cur].pop_back();
		int v = newAdj[curG][cur].back();
		newAdj[curG][cur].pop_back();
		match[curG][u] = v;
		match[curG][v] = u;
	}
	if(newAdj[curG][cur].empty())
		parity[curG][cur] = 1, newAdj[curG][cur].push_back(cur);
}

void getRes(int cur)
{
	for(int G = 0; G < 2; G++)
	{
		int to = match[G][cur];
		if(to != 0 && res[to] == 0)
			res[to] = -res[cur], getRes(to);
	}
}

int main(int argc, char **argv)
{
	cin >> N ;
	for(curG = 0; curG < 2; curG++)
	{
		for(int i = 1; i <= N; i++)
		{
			int fa;
			cin >> fa;
			if(fa == -1)
				root[curG] = i;
			else
				Adj[curG][fa].push_back(i);
		}
		DFS(root[curG]);
	}

	for(int i = 1; i <= N; i++)
		if(parity[0][i] != parity[1][i])
		{
			cout << "IMPOSSIBLE" << endl ;
			return 0;
		}

	for(int i = 1; i <= N; i++)
	{
		if(parity[0][i] == 0 || (parity[0][i] == 1 && res[i]))
			continue;
		res[i] = 1;
		getRes(i);
	}

	cout << "POSSIBLE" << endl ;
	for(int i = 1; i <= N; i++)
		cout << res[i] << " ";
	cout << endl ;
}



Measured memory_bytes: 28416