akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;

int N;
string s, t;

bool check(int len) {
    return s.substr(N - len, len) == t.substr(0, len);
}

int main(){
    cin >> N >> s >> t;
    for(int i = N; i >= 0; --i) {
        if(check(i)) {
            cout << 2 * N - i << endl;
            break;
        }
    }
}

Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<cmath>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<ctype.h>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<math.h>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<stdio.h>
#include<stdlib.h>
#include<streambuf>
#include<string.h>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
using namespace std;
typedef long long LL;
const int md=1000000007;
int fac[8010],inv[8010];
int dp[4111][4111];
int a[200010],b[200010];
LL pwr(LL a,int x){
	LL res=1;
	int cur=1;
	while(x){
		if (x&cur){
			res=res*a%md;
			x^=cur;
		}
		cur<<=1;
		a=a*a%md;
	}
	return res;
}
int main(void){
	fac[0]=inv[0]=1;
	for (int i=1;i<=8000;++i){
		fac[i]=1ll*fac[i-1]*i%md;
		inv[i]=pwr(fac[i],md-2);
	}
	int n;
	scanf("%d",&n);
	for (int i=1;i<=n;++i){
		scanf("%d%d",&a[i],&b[i]);
		++dp[2005-a[i]][2005-b[i]];
	}
	for (int i=1;i<=4020;++i){
		for (int j=1;j<=4020;++j){
			dp[i][j]+=dp[i-1][j]+dp[i][j-1];
			if (dp[i][j]>=md) dp[i][j]-=md;
		}
	}
	int res=0;
	for (int i=1;i<=n;++i){
		res+=dp[a[i]+2005][b[i]+2005];
		if (res>=md) res-=md;
		res-=(1ll*fac[(a[i]+b[i])<<1]*inv[a[i]<<1]%md*inv[b[i]<<1]%md);
		if (res<0) res+=md;
	}
	printf("%d",1ll*res*inv[2]%md);
	return 0;
}

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

template<typename T>
T gcd(T a,T b)
{
	if(a<b) swap(a,b);
	T r = a % b;
	while(r!=0)
	{
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
int main()
{
	int T;
	cin >> T;
	unsigned long int A,B,C,D;
	for(int i=0;i<T;i++)
	{
		scanf("%ld%ld%ld%ld",&A,&B,&C,&D);
		if(A<B || D<B || C<A%B || C<B-gcd(B,D))	puts("No");
		else		puts("Yes");
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())

using namespace std;
using ll = long long;

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; }
const int INF = 1001001001;
const long long INFL = (1LL<<60);
const double eps = (1e-9);

const double pi = 3.141592653589793;

double calc_angle(int h, int m) {
  double tmp = 30.0 * h - 5.5 * m;
  if (tmp < 0) tmp = -tmp;
  if (tmp > 360) tmp -= 360;
  if (tmp <= 180) return tmp;
  else return 360 - tmp;
}

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

  int a, b, h, m;
  cin >> a >> b >> h >> m;

  double angle = calc_angle(h, m);
  cerr << "angle: " << angle << endl;

  double ans = sqrt(a * a + b * b - 2 * a * b * cosl((pi/180.0) * angle));

  printf("%.10lf\n", ans);

  return 0;
}


Measured memory_bytes: 4188
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>

using namespace std;

#define mod 1000000007

int main()
{
    int n;
    cin >> n;
    int cnt[100001] = {};
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        cnt[a]++;
    }
    bool haveanswer = true;
    if(n % 2 == 1){
        if(cnt[0] != 1){
            haveanswer = false;
        } else {
            for(int i = 1; i <= n - 1; i++){
                if((i % 2 == 1 && cnt[i] != 0) || ( i % 2 == 0 && cnt[i] != 2)){
                    haveanswer = false;
                    break;
                }
            }
        }
    } else {
        for(int i = 0; i <= n - 1; i++){
            if((i % 2 == 1 && cnt[i] != 2) || (i % 2 == 0 && cnt[i] != 0)){
                haveanswer = false;
                break;
            }
        }
    }
    if(haveanswer){
        int ans = 1;
        for(int i = 0; i < n / 2; i++){
            ans = (ans * 2) % mod;
        }
        cout << ans << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1LL<<59)

#define int ll

signed main(){
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    if(a>0){
        cout<<(b-a)*e<<endl;
    }
    else{
        int ans = d;
        ans += (0-a)*c;
        ans += (b-0)*e;
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 3088
#include<bits/stdc++.h>
#define For(i, j, k) for(register int i = j; i <= k; ++i)
#define Forr(i, j, k) for(register int i = j; i >= k; --i)
using namespace std;

namespace pb_ds {

    namespace io {
        const int MaxBuff = 1 << 16;
        const int Output = 1 << 22;
        char B[MaxBuff], *S = B, *T = B;
        #define getc() ((S == T) && (T = (S = B) + fread(B, 1, MaxBuff, stdin), S == T) ? 0 : *S++)
        char Out[Output], *iter = Out;
        inline void flush() {
            fwrite(Out, 1, iter - Out, stdout);
            iter = Out;
        }
    }

    template<class Type> inline Type read() {
        using namespace io;
        register char ch; register Type ans = 0; register bool neg = 0;
        while(ch = getc(), (ch < '0' || ch > '9') && ch != '-')     ;
        ch == '-' ? neg = 1 : ans = ch - '0';
        while(ch = getc(), '0' <= ch && ch <= '9') ans = ans * 10 + ch - '0';
        return neg ? -ans : ans;
    }

    template<class Type> inline void write(register Type x, register char ch = '\n') {
        using namespace io;
        if(!x) *iter++ = '0';
        else {
            if(x < 0) *iter++ = '-', x = -x;
            static int s[100]; register int t = 0;
            while(x) s[++t] = x % 10, x /= 10;
            while(t) *iter++ = '0' + s[t--];
        }
        *iter++ = ch;
    }
}

using namespace pb_ds;
const int N = 1e5 + 10;
long long f[N], sum[N], a[N];
int n, m, cnt;

int main() {
	a[++ cnt] = n = read<int>(), m = read<int>();
	For(i, 1, m) {
		long long x = read<long long>();
		for (;;) { if (*(a + cnt) < x) break; -- cnt; }
		*(a + (++ cnt)) = x;
	}

	*(sum + cnt) = 1;
	Forr(i, cnt, 2) {
		*(sum + i - 1) += (*(sum + i) * (*(a + i) / *(a + i - 1)));
		long long res = *(a + i) % *(a + i - 1);

		for (;;) {
			if (res == 0) break;
			int l = 0, r = cnt, x;
			while (l <= r) {
				int mid = l + r >> 1;
				if (a[mid] <= res) x = mid, l = mid + 1;
				else r = mid - 1;
			}
			//int x = upper_bound(a + 1, a + 1 + cnt, res) - a - 1;
			if (x == 0) { *(f + res) += *(sum + i); break; }
			*(sum + x) += (res / *(a + x)) * (*(sum + i)), res %= *(a + x);
		}
	}
	*(f + *(a + 1)) = *(sum + 1);
	Forr(i, n - 1, 1) *(f + i) += *(f + i + 1);		
	For(i, 1, n) write(*(f + i), '\n');
	io::flush();
	return 0;
}


Measured memory_bytes: 5888
#include <bits/stdc++.h>
 
// headers {{{
using namespace std;
// using namespace rel_ops;
 
typedef long long int64;
typedef unsigned long long uint64;
const double pi=acos(-1.0);
const double eps=1e-11;
const int INF=0x7FFFFFFF;
template<class T> inline bool checkmin(T &a,T b){return b<a?a=b,1:0;}
template<class T> inline bool checkmax(T &a,T b){return b>a?a=b,1:0;}
template<class T> inline T sqr(T x){return x*x;}
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
#define MP(A,B) make_pair(A,B)
#define PB(X) push_back(X)
#define mem(a,b) memset(a, b, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ff first
#define ss second
#define sz(g) int(g.size())
#ifdef LOCAL
#define dbg(args...) printf(args); //##__VA_ARGS__
#define dout cout
#define out(x) (cout<<#x<<": "<<x<<endl)
template<class T>void show(T a, int n){for(int i=0; i<n; ++i) cout<<a[i]<<' '; cout<<endl;}
template<class T>void show(T a, int r, int l){for(int i=0; i<r; ++i)show(a[i],l);cout<<endl;}
#else
#define dbg(...)
#define dout if(true);else cout
#define out(...)
#define show(...)
#endif
// }}}

void solve() {
        int n;
        cin >> n;
        vector<int64> v(n);
        rep(i, n) cin >> v[i];
        string s;
        cin >> s;
        for (int j = n-1; j >= 0; j--) {
            if (s[j] == '0') {
                for (int k = 62; k >= 0; k--) {
                    if (v[j] & (1ll<<k)) {
                        for (int t = 0; t < j; t++) if (v[t] & (1ll<<k)) {
                            v[t] ^= v[j];
                        }
                        break;
                    }
                }
            } else {
                if (v[j] > 0) {
                    cout << 1 << endl;
                    return;
                }
            }
        }
        cout << 0 << endl;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL); 
    int T; cin >> T; rep(cas, T) {
        solve();
    }
    return 0;
}



Measured memory_bytes: 3608
#include <iostream>

using namespace std;
typedef long long int lli;

int main(void) {
	lli a, b, set, n;
	lli set_blue, solos, solo_blue;

	cin >> n >> a >> b;

	set = a + b;
	set_blue = (n / set) * a;
	solos = n % set;

	if (solos <= a)
		solo_blue = solos;
	else
		solo_blue = a;

	cout << set_blue + solo_blue << endl;

	return 0;

}

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

using namespace std;

int main(void){

  int a,b;
  while( cin >> a >> b , a || b ){
    int ans = a + b;
    char ANS = 'A';
    for( int i = 1 ; i < 5 ; i++ ){
      cin >> a >> b;
      if( ans < a + b ){
	ans = a + b;
	ANS = 'A' + i;
      }
    }
    cout << ANS << " " << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1156
N, T = (int(i) for i in input().split())
ct_matrix = [list(map(int,input().split())) for _ in range(N)]

c_min = 1001
for k in range(N):
    if ct_matrix[k][0] < c_min:
        if ct_matrix[k][1] > T:
            continue
        else:
            c_min = ct_matrix[k][0]

if c_min == 1001:
    print('TLE')
else:
    print(c_min)

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

int INF = 1e9;
 
int main(void){
    string s;
    cin>>s;
    map<char, priority_queue <int> > mp;
    rep(i, s.size()){
        mp[s[i]].push(i);
        if(mp[s[i]].size() == 1){
            mp[s[i]].push(-1);
            mp[s[i]].push(s.size());
        }
    }

    int ans = INF;
    for(auto p : mp){
        int tmp = 0;
        int bef = p.second.top();
        p.second.pop();
        while(!p.second.empty()){
            int now = p.second.top();
            p.second.pop();
            tmp=max(tmp, bef-now-1);
            bef=now;
        }
        //cout<<p.first<<" "<<tmp<<endl;
        ans=min(ans, tmp);
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){
    int n;
    cin >> n;
    ll max,min,sum;
    vector<ll> p(n);
    
    for(int i=0; i<n; i++)
        cin >> p[i];
    
    max = min = sum = p[0];
    for(int i=1; i<n; i++){
        if(min > p[i]) min = p[i];
        if(max < p[i]) max = p[i];
        sum+=p[i];
    }
    cout << min << " " << max << " " << sum << endl;
    return 0;
}


Measured memory_bytes: 3176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define bit(k) (1LL<<(k))
#define SUM(v) accumulate(all(v), 0LL)

typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
struct fast_ios{ fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; }fast_ios_;

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; }

#define TOSTRING(x) string(#x)
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; }
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { os  << "["; for(auto _: v) os << _ << ", "; os << "]"; return os; };
template <typename T> ostream &operator<<(ostream &os, set<T> &st) { os << "("; for(auto _: st) { os << _ << ", "; } os << ")";return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair< T, U >& p){os << "{" <<p.first << ", " << p.second << "}";return os; }
template <typename T, typename U> ostream &operator<<(ostream &os, const map<T, U> &mp){ os << "["; for(auto _: mp){ os << _ << ", "; } os << "]" << endl; return os; }

#define DUMPOUT cerr
void dump_func(){ DUMPOUT << endl; }
template <class Head, class... Tail> void dump_func(Head &&head, Tail &&... tail) { DUMPOUT << head; if (sizeof...(Tail) > 0) { DUMPOUT << ", "; } dump_func(std::move(tail)...); }

#ifdef DEBUG
#define dbg(...) dump_func(__VA_ARGS__)
#define dump(...) DUMPOUT << string(#__VA_ARGS__) << ": "; dump_func(__VA_ARGS__)
#else
#define dbg(...)
#define dump(...)
#endif

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const long double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/


int main() {
    ll N, Z, W;
    cin >> N >> Z >> W;
    vector<ll> a(N);
    rep(i,N)cin >> a[i];
    vvec<ll> dp(N+1, vec<ll>(2));
    for(int i = N-1; i >= 0; i--){
        // 先手番
        dp[i][0] = -INFLL;
        ll Y = (i ? a[i-1]: W);
        chmax(dp[i][0], abs(Y-a[N-1]));
        for(int j = i+1; j < N; j++){
            chmax(dp[i][0], dp[j][1]);
        }

        // 後手番
        dp[i][1] = INFLL;
        ll X = (i ? a[i-1]: Z);
        chmin(dp[i][1], abs(X - a[N-1]));
        for(int j = i+1; j < N; j++){
            chmin(dp[i][1], dp[j][0]);
        }
    }
    cout << dp[0][0] << endl;
}
/*
どちらかが最後のカードを持つ

dp[山札から取った枚数][後手かどうか] 
:= その状態からスタートした時の、最終的なカードの差の最適値(先手なら最大値、後手なら最小値)
*/

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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    ll N;
    cin >> N;
    V<ll> A(N), B(N);
    REP(i, N) cin >> A[i];
    REP(i, N) cin >> B[i];

    ll shift = 0;

    REP(i, N){
        auto itr = lower_bound(ALL(A), B[i]);
        if(itr == A.end() or *itr != B[i]){
            continue;
        }
        ll tmp = upper_bound(ALL(A), B[i]) - A.begin();
        tmp -= i;
        chmax(shift, tmp);
    }

    auto rotate = [](V<ll> &x, ll k){
        ll n = x.size();
        V<ll> tmp(n);
        REP(i, n) tmp[i] = x[(i-k+n)%n];
        return tmp;
    };

    auto res = rotate(B, shift);

    bool ok = true;
    REP(i, N){
        if(A[i] == res[i]) ok = false;
    }

    if(ok){
        cout << "Yes\n";
        for(auto x: res) cout << x << " ";
        cout << "\n";
    }else{
        cout << "No\n";
    }

    return 0;
}

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

using namespace std;

int main() {
  int N, K;
  cin >> N >> K;
  string S;
  cin >> S;
  S.push_back('#');
  char prev = '*';
  int cnt = 0;
  for (char c : S) {
    if (prev == c) {
      ++cnt;
    }
    prev = c;
  }

  cout << min(cnt + 2 * K, N - 1) << endl;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    int n,m;
    cin>>n>>m;
    vector<ll> a(n);
    int i,j;
    int sum=0;
    for(i=0;i<n;i++){
        cin >> a.at(i);
        sum+=a.at(i);
    }
    int hyo=0;
    for(i=0;i<n;i++){
        if(sum<=a.at(i)*4*m)hyo++;
        //cout << hyo << endl;
    }
    if(hyo>=m)cout << "Yes" <<endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int ans[] = {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};

int main(){
    
    // 1. 入力情報.
    int K;
    scanf("%d", &K);
    
    // 2. 出力.
    printf("%d\n", ans[K - 1]);
    return 0;
    
}

Measured memory_bytes: 256
S = input()
a = ''
b = ''
ac = 0
bc = 0
for i in range(4):
  if a == '':
    a = S[i]
    ac = 1
  else:
    if S[i] == a:
      ac = ac + 1
    else:
      if b == '':
        b = S[i]
        bc = 1
      else:
        if S[i] == b:
          bc = bc + 1
if ac == 2 and bc == 2:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = (a); i < (b); ++i)
#define rrep(i,a,b) for(int i = (b); i --> (a);)
#define all(v) (v).begin(),(v).end()
#define trav(x,v) for(auto &x : v)
#define sz(v) int(v.size())
typedef vector<int> vi;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> Q;
typedef pair<int,Q> S;

struct UF {
	vi t;
	UF(int n){
		t.resize(n,-1);
	}

	int find(int a){
		return t[a]<0 ? a : t[a] = find(t[a]);
	}

	void uni(int a, int b){
		a = find(a), b = find(b);
		if(a == b) return;
		if(t[a] < t[b]) swap(a,b);
		t[b] += t[a];
		t[a] = b;
	}

	bool same(int a, int b){
		return find(a) == find(b);
	}
};

Q id(0,0);

int md, o;
vector<ll> tw;

int act(Q p, int x){
	return (p.first + tw[p.second]*x)%md;
}

Q mul(Q p, Q q){
	return Q( (p.first + tw[p.second]*q.first)%md,
		(p.second + q.second)%o);
}

Q inv(Q p){
	return mul( Q(0,o-p.second), Q(md-p.first,0) );
}

int gcd(int a, int b){
	while(b){
		a %= b;
		swap(a,b);
	}
	return a;
}

Q pow(Q p, int e){
	Q res = id;
	do {
		if(e % 2) res = mul(res, p);
		p = mul(p, p);
	} while(e /= 2);
	return res;
}

S gen(S s, Q p){
	Q q = s.second;
	while(q.second){
		int k = p.second / q.second;
		p = mul(p, pow(inv(q), k));
		swap(p,q);
	}
	s.first = gcd(s.first, q.first);
	s.second = p;
	return s;
}

int main(){
	cin.sync_with_stdio(0);
	cin.tie(0);

	int n, m, q;
	cin >> n >> m >> q >> md;

	ll t = 1;
	do {
		tw.push_back(t);
		t = t * 2 % md;
	} while(t != 1);
	o = sz(tw);
	tw.push_back(1);

	vi as(m), bs(m), cs(m);
	rep(i,0,m) cin >> as[i] >> bs[i] >> cs[i], --as[i], --bs[i];

	vector<vi> ls(n);
	rep(i,0,m){
		ls[as[i]].push_back(i);
		ls[bs[i]].push_back(i);
	}
	vector<bool> vis(n, false);
	vector<Q> to(n);
	function<void(int)> dfs = [&](int v){
		vis[v] = true;
		trav(i, ls[v]){
			int u = as[i]+bs[i]-v;
			if(!vis[u]){
				to[u] = mul( to[v], Q(cs[i],1) );
				dfs(u);
			}
		}
	};
	int root = 0;
	to[root] = id;
	dfs(root);
	vector<Q> fr(n);
	rep(i,0,n) fr[i] = inv(to[i]);
	S gp(0,id);
	rep(i,0,m){
		gp = gen(gp, mul(to[bs[i]], mul(Q(cs[i],1), fr[as[i]]) ) );
		gp = gen(gp, mul(to[as[i]], mul(Q(cs[i],1), fr[bs[i]]) ) );
	}
	UF uf(md);
	rep(i,0,md){
		uf.uni(i, (i+gp.first)%md);
		uf.uni(i, act(gp.second, i));
	}
	rep(_,0,q){
		int s, t, r;
		cin >> s >> t >> r;
		--s, --t;
		if( uf.same( act(to[t] , 0), act(to[s], r)))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}


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

int a[100002], b[100002], c[100002];
long dp[100002][3];

int main(){
    int N;

    cin >> N;
    for(int n=1;n<=N;n++){
        cin >> a[n] >> b[n] >> c[n];
    }
    dp[0][0] = 0;
    dp[0][1] = 0;
    dp[0][2] = 0;

    for(int n=1;n<=N;n++){
        dp[n][0] = max(dp[n-1][1]+b[n], dp[n-1][2]+c[n]);
        dp[n][1] = max(dp[n-1][0]+a[n], dp[n-1][2]+c[n]);
        dp[n][2] = max(dp[n-1][0]+a[n], dp[n-1][1]+b[n]);
    }
    cout << max({dp[N][0], dp[N][1], dp[N][2]}) << "\n";
    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define reprr(i, m, n) for (ll i = m; i < n; i++)
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
using Graph = vector<vector<pair<ll, ll>>>;


int main()
{
    ll S, W; cin >> S >> W;
    if (S <= W) cout << "un";
    cout << "safe" << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

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

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

void solve(std::string S)
{
    string rev = S;
    reverse(rev.begin(), rev.end());

    if (S.size() < 26)
    {
        for (char i = 'a'; i <= 'z'; i++)
        {
            if (find(S.begin(), S.end(), i) == S.end())
            {
                cout << S << i << endl;
                break;
            }
        }
    }
    else
    {
        if (S == "zyxwvutsrqponmlkjihgfedcba")
        {
            cout << -1 << endl;
        }
        else
        {
            string T = S;
            next_permutation(S.begin(),S.end());
            for (int i = 0; i < S.size(); i++)
            {
                cout << S[i];
                if(S[i] != T[i])break;
            }
            cout << endl;
            
        }
    }
}

int main()
{
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define int long long

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

    int k;
    cin >> k;

    int ans = 0;

    for (int a = 1; a <= k; a++) {
        for (int b = 1; b <= k; b++) {
            for (int c = 1; c <= k; c++) {
                ans += gcd(a, gcd(b, c));
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 3192
#include <bits/stdc++.h>
#include <bitset>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

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

int main(){
    cin>>N;
    vec t(N), a(N), u(N, INF), b(N, 1);
    rep(i,N) cin>>t[i];
    rep(i,N) cin>>a[i];
    if(N == 1){
        cout<<int(a[0] == t[0])<<endl;
        return 0;
    }
    u[0] = b[0] = t[0];
    u[N-1] = b[N-1] = a[N-1];
    reps(i,1,N){
        u[i] = min(u[i], t[i]);
        if(t[i-1] < t[i]) b[i] = max(b[i], t[i]);
    }
    bool ok = u[N-1] >= a[N-1] && a[N-1] >= b[N-1];
    Rrep(i, N - 1){
        u[i] = min(u[i], a[i]);
        if(u[i] > u[i+1]) b[i] = max(b[i], a[i]);
        if(b[i] > u[i]) ok = false;
    }
    ll ans = ok;
    rep(i,N){
        (ans *= u[i] - b[i] + 1)%=MOD;
    }
    /*rep(i,N) cout<<u[i]<<' ';
    cout<<endl;
    rep(i,N) cout<<b[i]<<' ';
    cout<<endl;*/
    cout<<ans<<endl;
}

Measured memory_bytes: 3328
N = int(input())
L = list(map(int,input().split()))

ans = 0
for no1,l1 in enumerate(L):
  for no2, l2 in enumerate(L):
    for no3, l3 in enumerate(L):
      if (no1 < no2) and (no2 < no3):
        sort_L = sorted( [l1,l2,l3] ) 
        if (len(set(sort_L )) == 3) and (sort_L[0] + sort_L[1] > sort_L[2]):
          ans += 1
      else:
        continue
print( ans )


Measured memory_bytes: 68620
/*
[ ( ^ _ ^ ) ]
*/

// problem: atc/dp_i

import java.io.*;
import java.util.*;


public class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;


    void solve(InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        double[] p = new double[n+1];
        for(int i=1; i<=n; i++) {
            p[i] = in.nextDouble();
        }
        double[][] dp = new double[n+1][n+1];
        dp[0][0] = 1;
        for(int i=1; i<=n; i++) {
            if(i==1) {
                dp[i][0] = 1 - p[i];
                continue;
            }
            dp[i][0] = dp[i-1][0] * (1 - p[i]);
        }
        for(int i=1; i<=n; i++) {
            for(int j=1; j<=n; j++) {
                dp[i][j] = dp[i-1][j] * (1-p[i]) + dp[i-1][j-1] * p[i];
            }
        }
        double rs = 0;
        for(int i=(n+1)/2; i<=n; i++) {
            rs += dp[n][i];
        }
        out.println(rs);
    }
    

    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 130508
/*
 * written by Yaqi Zhang (zhang623@wisc.edu)
 * University of Wisconsin-Madison
 * 2020
 */
#include <bits/stdc++.h>

#define INF 0x3f3f3f3f

using namespace std;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<int> A(n);
    for(int i = 0; i < n; ++i) cin >> A[i];
    vector<pair<int, int>> cbs(m);
    for(int i = 0; i < m; ++i) {
        int b, c;
        cin >> b >> c;
        cbs[i] = {c, b};
    }
    sort(A.begin(), A.end());
    sort(cbs.rbegin(), cbs.rend());
    int idx = 0;
    long long ans = accumulate(A.begin(), A.end(), 0LL);
    bool done = false;
    for(const auto & cb : cbs) {
        int c = cb.first, b = cb.second;
        // maximum is b
        for(int i = 0; i < b; ++i) {
            if(A[idx] < c) ans += c - A[idx++];
            else {
                done = true;
                break;
            }
            if(idx == n) {
                done = true;
                break;
            }
        }
        if(done) break;
    }
    cout << ans << endl;
    return 0;
    
}



Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, e) for (int i = s; i < e; ++i)
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define sum(a) accumulate(a.begin(), a.end(), 0LL)
#define __lcm(a, b) std::__detail::__lcm(a, b)
typedef long long ll;
const long mod = 1e9 + 7;

int main(void) {
#ifdef DEBUG
  freopen("input.txt", "r", stdin);
#endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);

  long N;
  cin >> N;
  vector<long> A(N + 1);
  rep(i, 0, N + 1) {
    cin >> A[i];
  }
  vector<long> B(N);
  rep(i, 0, N) {
    cin >> B[i];
  }
  long ans = 0;
  rep(i, 0, N) {
    ans += min(A[i] + A[i+1], B[i]);
    if (B[i] > A[i]) {
      A[i+1] = max(A[i] + A[i+1] - B[i], 0L);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <cstdio>
#include<cstring>
#include <algorithm>
#include <queue>
#define max 1005
using namespace std;
char map[max][max];
bool vis[max][max];
int h,w,n,ans;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
struct node
{
    int x;
    int y;
    int time;
} start;
void BFS(node st,char ed)
{
    queue<node>q;
    q.push(st);
    vis[st.x][st.y]=1;
    while(!q.empty())
    {
        node now=q.front();
        q.pop();
        for(int i=0;i<4;i++)
        {
            node next=now;
            next.x+=dx[i];
            next.y+=dy[i];
            next.time++;
            if(next.x>=0&&next.x<h&&next.y>=0&&next.y<w&&map[next.x][next.y]!='X'&&!vis[next.x][next.y])
            {
                if(map[next.x][next.y]==ed)
                {
                    ans+=next.time;
                    next.time=0;
                    start=next;
                    return ;
                }
                else
                {
                    q.push(next);
                    vis[next.x][next.y]=1;
                }
            }
        }
    }
}
int main(void)
{
    while(scanf("%d%d%d",&h,&w,&n)==3)
    {
        for(int i=0;i<h;i++)
        scanf("%s",&map[i]);
        for(int i=0;i<h;i++)
        {
        	for(int j=0;j<w;j++)
        	{
                if(map[i][j] == 'S')
                {
                start.x = i;
                start.y = j;
                start.time = 0;
                }
			}
		}
        ans=0;
        for(int i=1;i<=n;i++)
        {
            memset(vis, 0, sizeof(vis));
            BFS(start,'0'+i);
        }
        printf("%d\n", ans);
    }
    return 0;
}

Measured memory_bytes: 3024
/*
...........__________    							 |										    ___  __
.............|       |     						     |											 |   /
.............|       |     						     |									  		 |  /
.............|       |                               |                         __                | /      _______
.............|_______|  _______            _______   |______   ________   /|  /  |               |/       |      |
.............| \               | |      | |          |      |          | / | /   |               |\       |
.............|  \       _______| |      | |_______   |      |   _______|   |/    |               | \      |
.............|   \      |      | |      |         |  |      |  |       |   |     |               |  \     |
.........  __|    \__|  |______| |______| ________|  |      |_ |_______|   |     |__|           _|   \__ _|        .

*/
#include<bits/stdc++.h>
using namespace std ;
#define int 				long long
#define ull 				unsigned long long int
#define ld 					long double
#define vi 					vector<int>
#define vii 				vector<pair<int,int>>
#define vvi 				vector<vector<int>>
#define pf 					push_front
#define popb 				pop_back
#define pb 					push_back
#define eb 					emplace_back
#define pii 				pair<int,int>
#define prec(x) 			fixed<<setprecision(15)<<x
#define all(x) 				x.begin(),x.end()
#define rall(x) 			x.rbegin(),x.rend()
#define mset(a,b) 			memset(a,b,sizeof(a))
#define mcpy(a,b) 			memcpy(a,b,sizeof(a))
#define fo0(i,n) 			for(int i=0,i##end=n;i<i##end;i++)
#define fo1(i,n) 			for(int i=1,i##end=n;i<=i##end;i++)
#define fo(i,a,b) 			for(int i=a,i##end=b;i<=i##end;i++)
#define foe(i,x)			for(__typeof((x).end())i=(x).begin();i!=(x).end();++i)
#define fre(i,x)			for(__typeof((x).rend())i=(x).rbegin();i!=(x).rend();++i)
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0)
#define inf 1e18
const int mod=1e9+7;
const int N=4e5+10;

void raushan_kumar(){
	int n,k;cin>>n>>k;
	int cnt=0;
	while(n>0){
		cnt++;
		n/=k;
	}
	cout<<cnt<<endl;
}

int32_t main()
{
	fast;int t=1;
	//cin>>t;
	while(t--){
		raushan_kumar();
	}

}

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

using namespace std;

/*long C(long n, long r){
    if(n < r) return 0;
    long p[n+1][n+1];
    p[0][0] = 1;
    for(int i = 1; i <= n; i++){
        p[i][0] = 1;
        p[i][i] = 1;
        for(int j = 1; j <= i-1; j++){
            p[i][j] = p[i-1][j] + p[i-1][j-1];
        }
    }
    return p[n][r];
}*/

void solve()
{
    int N, K;
    cin >> N >> K;
    vector<int> l;
    for(int i = 0; i < N; i++) {
        int _l;
        cin >> _l;
        l.push_back(_l);
    }
    sort(l.begin(), l.end(), greater<int>());
    int ans = 0;
    for(int i = 0; i < K; i++) ans += l[i];
    cout << ans << endl;
    return;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define dum(x) cout<<#x<<'='<<x<<endl
#define ll long long
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v.at(i);
  }
  v.insert(v.begin(), 0);
  v.push_back(0);
  int d = 0;
  for (int i = 0; i < v.size() - 1; i++) {
    d += abs(v.at(i) - v.at(i + 1));
  }
  int ans = 0;
  for (int i = 1; i < v.size() - 1; i++) {
    ans = d - abs(v.at(i - 1) - v.at(i)) - abs(v.at(i) - v.at(i + 1)) + abs(v.at(i - 1) - v.at(i + 1));
    cout << ans << endl;
  }
}

Measured memory_bytes: 1656
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
typedef long long int ll;
using namespace std;
using Graph = vector<vector<int> >;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,m;
cin>>n>>m;
vector<int>p(m);
vector<string>s(m);
set<int> log,log_p;

int penalty=0;
int score=0;

rep(i,m){
    cin>>p[i]>>s[i];
    if(s[i]=="AC")log_p.insert(p[i]);
}
rep(i,m){
    if(log.count(p[i]))continue;
    if(s[i]=="AC"){
        log.insert(p[i]);
        score++;
    }
    else if(log_p.count(p[i])){
        penalty++;
    }
}

cout<<score<<" "<<penalty<<endl;
//system("pause");
return 0;
}

Measured memory_bytes: 15488
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll;
typedef vector<vector<long long> > vvll;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i,n) _rep2((i),0,(n))
#define _rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define fi first
#define se second
#define mkp make_pair
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int a,b,c,d,e,f;
	cin>>a>>b>>c>>d>>e>>f;
	double sug = -1;
	int x=100*a, y=0;
	rep(i,31){
		rep(j,31){
			rep(k,51){
				rep(l,51){
					ll aa = 100*a*i+100*b*j;
					ll bb = c*k+d*l;
					if(aa*e<bb*100) continue;
					if(aa+bb>f) continue;
					if(aa+bb==0) continue;
					double t = 100.*bb/(aa+bb);
					// cout<<t<<endl;
					if(t>sug){
						x = aa;
						y = bb;
						sug = t;
					}
				}
			}
		}
	}
	cout<<x+y<<" "<<y<<endl;
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

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

int N, A, B, C, D;
string S;

bool solve() {
    int R1 = min(C, D), R2 = max(C, D);
    for ( int i = A; i < C; i++ ) {
        if ( S[i] == '#' && S[i+1] == '#' ) return false;
    }
    for ( int i = B; i < D; i++ ) {
        if ( S[i] == '#' && S[i+1] == '#' ) return false;
    }
    if ( D < C ) {
        bool ok = false;
        for ( int i = B - 1; i < D; i++ ) {
            if ( S[i] == '.' && S[i+1] == '.' && S[i+2] == '.' ) {
                ok = true;
                break;
            }
        }
        if ( !ok ) return false;
    }
    return true;
}

int main() {
    cin >> N >> A >> B >> C >> D >> S;
    A--, B--, C--, D--;
    
    string ans = solve() ? "Yes" : "No";
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll high_precision
using namespace std;
class high_precision
{
	public:
	int a[50],lenth;
	void read()
	{
		memset(a,0,sizeof(a));
		string s;
		cin>>s;
		lenth=s.size();
		for (int i=0;i<lenth;i++)
		a[i]=s[lenth-i-1]-'0';
		while (lenth>=1 && a[lenth-1]==0) --lenth;
	}
	void write()
	{
		for (int i=lenth-1;i>=0;--i) printf("%d",a[i]);
	}
	high_precision operator *(high_precision &num)
	{
		high_precision ans;
		ans.lenth = lenth + num.lenth;
		for (int i=0;i<=ans.lenth;++i) ans.a[i]=0;
		ans.lenth=0;
		for (int i=0;i<lenth;i++)
		{
			int mo=0;
			for(int j=0;j<num.lenth;j++)
			{
				ans.a[i+j]=mo+a[i]*num.a[j]+ans.a[i+j];
				mo=ans.a[i+j]/10;
				ans.a[i+j]%=10;
			}
			ans.a[i+num.lenth]=mo;
		}
		int k=lenth+num.lenth;
		while (k>0 && ans.a[k]==0) --k;
		ans.lenth=k+1;
		return ans;
	}
	void operator =(long long num)
	{
		int l=0;
		while (num)
		{
			a[l++]=num%10;
			num=num/10;
		}
		lenth=l;
	}
};
bool compare(ll a,ll b)
{
	if (a.lenth!=b.lenth) return a.lenth>b.lenth;
	for (int i=a.lenth-1;i>=0;--i)
	if (a.a[i]!=b.a[i]) return a.a[i]>b.a[i];
	return false;
}
ll ANS,mx;
ll A[100010];
int n;
bool b=false,bb=false;
int main()
{
	cin>>n;
	ANS=1;
	mx=1000000000000000000;
	for (int i=1;i<=n;++i)
	{
		A[i].read();
		if (A[i].lenth==0) bb=true;
		if (compare(A[i],mx)) b=true;
	}
	if (bb) {printf("0"); return 0;}
	else if (b) {printf("-1"); return 0;}
	for (int i=1;i<=n;++i)
	{
		ANS=ANS*A[i];
		if (compare(ANS,mx)) {printf("-1"); return 0;}
	}
	ANS.write();
	return 0;
}

Measured memory_bytes: 23648
#include <set>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <limits>
#include <map>
#include <numeric>
#include <list>
using ll = long long;
using namespace std;
static ll imin = std::numeric_limits<ll>::min() / 2;
static ll imax = std::numeric_limits<ll>::max() / 2;
#define rep(i, n) for(ll i = 0; (i)<(n); ++(i))
#define rep1(i, n) for(ll i = 1; (i)<(n); ++(i))
#define rev_rep(i, n) for(ll i = (n) - 1; (i) >= 0; --(i))
#define range(a, i, b) for(ll i = (a); (i) < (b); ++(i))
#define dump(x) cout << #x << ":" << x << "\n";
#define all(v) v.begin(), v.end()
#define readl(N) ll N; cin >> N
#define readlv(N, vec) vector<ll> vec(N); rep(i, N){cin >> vec[i];}
#define greater_than [](ll l, ll r){return l > r;}
template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::map<T1, T2>& mp);
template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::pair<T1, T2>& pair);
template<class T>
std::ostream& operator << (std::ostream& os, std::vector<T>& vec);
template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::pair<T1, T2>& pair){
  os << '(' << pair.first << ',' << pair.second << ')';
  return os;
}

template<class T>
std::ostream& operator << (std::ostream& os, std::vector<T>& vec){
  std::size_t n = vec.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(ll i = 0; i<n - 1; ++i){
    os << vec[i] << " ";
  }
  os << vec[n - 1];
  os << std::endl;
  return os;
}

template<class T1, class T2>
std::ostream& operator << (std::ostream& os, std::map<T1, T2>& mp){
  std::size_t n = mp.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(auto && x:mp){
    os << x << " ";
  }
  os << std::endl;
  return os;
}

template<class T>
std::ostream& operator << (std::ostream& os, std::set<T>& mp){
  std::size_t n = mp.size();
  if(n == 0){
    return os;
  }
  os << " ";
  for(auto && x:mp){
    os << x << " ";
  }
  os << std::endl;
  return os;
}

template<class T> inline bool chmin(T& a, T const b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T const b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

ll fact(ll n){
  ll res=1;
  while(n>0){
    res*=n;
    n--;
  }
  return res;
}
    
ll pow(ll i, ll n){
  ll res=1;
  while(n>=0){
    res*=i;
    n--;
  }
  return res;
}

ll gcd(ll l, ll r){
  if(l<r){
    return gcd(r, l);
  }
  if(r == 0){
    return l;
  }
  return gcd(r, l % r);
}

template<class T>
vector<T> accum_sum(vector<T> a){
  vector<T> b(a.size() + 1);
  b[0] = a[0];
  rep(i, a.size()){
    b[i + 1] = b[i] + a[i];
  }
  return b;
}
constexpr ll mod = 1e9+7;

ll modfact(ll n){
  ll res=1;
  while(n>0){
    res %=mod;
    res*=n;
    n--;
  }
  return res%mod;
}
   

int main(int argc, char const* argv[])
{
  char s[100];
  int a,b,c;
  scanf("%d/%d/%d",&a,&b,&c);
  bool h=true;
  if(a>2019){
    h=false;
  }else if(b>4){
    h = false;
  }else if(c>30){
    h=false;
  }
  if(h){
    cout<<"Heisei"<<endl;
  }else{
    cout<<"TBD"<<endl;
  }
  return 0;
}


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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

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


Measured memory_bytes: 256