akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define double long double
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
#define ALL(a)  (a).begin(),(a).end()
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int nCr(int n, int r) {
	int ans = 1;
	for (ll i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
int per(int n, int r) {
	r = n - r;
	int sum = 1;
	int i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}
struct union_find {
	int par[200010], size_[200010];
	void init(int x) {
		rep(i, x) { par[i] = i; size_[i] = 1; }
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (size_[x] < size_[y]) {
			par[x] = y;
			size_[y] += size_[x];
		}
		else {
			par[y] = x;
			size_[x] += size_[y];
		}
	}
};

int ctoi(const char c) {
	switch (c) {
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default: return -1;
	}
}
int keta(int a) {
	return to_string(a).size();
}

signed main() {
	int m, d;
	cin >> m >> d;
	int ans = 0;
	Rep(i, m) {
		Rep(j, d) {
			if (j/10>1&&j%10>1&&(j / 10) * (j % 10) == i) { ans++; }
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
num = []
n = int(input())
while n != 0:
  num.append(n % 10)
  n /= 10
num.reverse()

if num[-1] == 2 or num[-1] == 4 or num[-1] == 5 or num[-1] == 7 or num[-1] == 9:
    print("hon")
elif num[-1] == 0 or num[-1] == 1 or num[-1] == 6 or num[-1] == 8:
    print("pon")
else:
    print("bon")

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

using namespace std;

typedef long long ll;

const int MAX_N = 2e5 + 10;
const ll MOD = 1e9 + 7;

int N;
pair<int, int> event[MAX_N];
ll ans = 1;

int main() {
    scanf("%d", &N);
    for (int i = 1; i <= 2 * N; i++) {
        scanf("%d", &event[i].first);
        event[i].second = i <= N ? 1 : -1;
    }
    sort(event + 1, event + 2 * N + 1);
    int sum = 0;
    for (int i = 1; i <= 2 * N; i++) {
        if (sum * event[i].second < 0) {
            (ans *= abs(sum)) %= MOD;
        }
        sum += event[i].second;
    }
    printf("%lld\n", ans);
}


Measured memory_bytes: 1792
n=int(input())
na,cnt=['AC','WA','TLE','RE'],[0,0,0,0]
while n:
  s=input()
  cnt[na.index(s)]+=1
  n-=1
for i in range(4):
  print(na[i],"x",cnt[i],sep=" ",end='\n')
 

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

void solve(std::string S)
{
    long long ssize = S.size();
    for (int i = 0; i < ssize; i++)
    {
        cout << "x";
    }
    cout << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
class Main{
    public static void main(String[] a){
        for(int i = 1; i < 10; i++) {
            for(int j = 1; j < 10; j++) {
            int k = i * j;
            System.out.println(i + "x" + j + "=" + k);
            }
        }
    }
}

Measured memory_bytes: 24116
#include <iostream>
using namespace std;
 
void print_grade(int m, int f, int r) {
    int sum = m + f;
 
    if (m == -1 || f == -1) {
        cout << "F";
    } else if (sum >= 80) {
        cout << "A";
    } else if (sum >= 65) {
        cout << "B";
    } else if (sum >= 50) {
        cout << "C";
    } else if (sum >= 30) {
        if (r >= 50) {
            cout << "C";
        } else {
            cout << "D";
        }
    } else {
        cout << "F";
    }
    cout << endl;
}
 
int main() {
    int m,f,r;
    while(true) {
        cin >> m >> f >> r;
 
        if (m == -1 && f == -1 && r == -1)
            break;
 
        print_grade(m,f,r);
    }
    return 0;
}

Measured memory_bytes: 1152
#include<stdio.h>
int main(void){
    int a[3],b[3];
    int all;
    for(int i=0;i<3;i++){
        scanf("%d %d",&a[i],&b[i]);
        all=all+a[i]+b[i];
    } 

    if(all==15){
        printf("YES");
    }else{
        printf("NO");
    }

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define sayyes cout<<"Yes"<<endl;
#define sayno cout<<"No"<<endl;
using namespace std;
typedef long long ll;
const double PI=acos(-1);
typedef pair<int,int>P;
const int mod =1e9+7;



int main()
{
    string s;
    cin>>s;
    string t;
    int n=s.length();
    for(auto v:s)
    {
        if(v!='x')
        {
            t+=v;
        }
    }
    if(t!=string(t.rbegin(),t.rend()))
    {
        cout<<-1<<endl;
    }
    else
    {
        int ans=0;
        int front=0;
        int back=n-1;
        while(back-front>0)
        {
            if(s[front]!=s[back])
            {
                ans++;
                s[front]=='x'?front++:back--;  
            }
            else
            {
                front++,back--;
            }
            
        }
        cout<<ans;
        
    }
    
}


Measured memory_bytes: 640
/***************************************************************************
                                AUTHOR: SPARSH SINHA
            **************************************************************************/


#include <bits/stdc++.h>
using namespace std;
#define si(N) scanf("%d",&N);
#define sll(N) scanf("%lld",&N);
#define ss(s) scanf("%s",s);
#define ll long long
#define pi pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define eb emplace_back
#define rep(i,a,b) for(int i = a; i<=b;i++)
#define fori(i,n) for(int i = 0 ; i < n; i++)
#define umapii unordered_map<int,int>
#define umapll unordered_map<ll,ll>
#define mapll map<ll,ll>
#define mapii map<int,int>
#define debug(x)       cerr<< #x <<" : "<<x<<endl;
#define debuga(A,N)    cerr<< #A <<" : [";for(int i = 0; i<N;i++) cerr<<A[i]<<" "; cerr<<"]\n";
#define debuga2(A,N,M) cerr<< #A << " : \n"; for(int i=0;i<N;i++){cerr<<"[";for(int j=0;j<M;++j) cerr<<A[i][j]<<" ";cerr<<"]\n";}
#define debugp(p)      cerr<< #p <<" : "<<"("<<(p).first<<","<<(p).second<<")\n";
#define debugv(v)      cerr<< #v <<" : "<<"[";for(int i = 0; i< (v).size(); i++) cerr<<v[i]<<" "; cerr<<"]\n";
#define debugv2(v)     cerr<< #v << " : \n"; for(int i=0;i<v.size();i++){cerr<<"[";for(int j=0;j<(v[0].size());++j) cerr<<v[i][j]<<" ";cerr<<"]\n";}
#define debugs(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin(); itr!=m.end();itr++) cerr<<*itr<<" "; cerr<<"]\n";
#define debugm(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin();itr!=m.end(); itr++) cerr<<"("<<itr->first<<","<<itr->second<<") ";cerr<<"]\n";
const int INF = 1e9 + 7;

int main()
{
     ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0);
     int N , A , B;
     cin>>N>>A>>B;
     int tx = N*A;
     int tr = B;
     if( tx < tr) cout<<tx;
     else cout<<tr;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdint.h>

using namespace std;

int32_t main()
{
  int32_t x, a, b;
  cin >> x >> a >> b;

  if (abs(x - a) < abs(x - b)) {
    cout << "A" << endl;
  } else {
    cout << "B" << endl;
  }

  return 0;
}


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

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	char out[10];
	string a;
	cin >> a;
	int p = 0;
	rep(i, a.length()){
		if(a[i] == 'B'){
			if(p != 0){
				out[p-1] = '\0';
				p--;
			}
		}else{
			out[p] = a[i];
			p++;
		}
	}
	//out[0] = '1';
	rep(i, p){
		cout << out[i];
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, q;
  int in;
  scanf("%d%d%d", &n, &k, &q);
  vector<int> score(n, 0);
  int thr = k-q;
  
  
  for(int i = 0; i < q; i++) {
    scanf("%d", &in);
    score[in-1]++;
  }
  for(int i = 0; i < n; i++) {
    if(thr+score[i] > 0) printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int v, e;
  cin >> v >> e;
  vector<vector<int>> to(v);
  vector<int> ideg(v);
  rep(i, e) {
    int s, t;
    cin >> s >> t;
    to[s].push_back(t);
    ideg[t]++;
  }
  stack<int> st;
  rep(i, v) {
    if (!ideg[i])
      st.push(i);
  }
  vector<int> ts;
  while (!st.empty()) {
    int idx = st.top();
    st.pop();
    ts.push_back(idx);
    for (auto next : to[idx]) {
      ideg[next]--;
      if (!ideg[next])
        st.push(next);
    }
  }
  for (auto e : ts)
    cout << e << endl;
  return 0;
}


Measured memory_bytes: 3716
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        // string a = Console.ReadLine();
        int[] n = Read.ints();
        int[] a = Read.ints();
        Array.Sort(a);
        int sum = 0;
        for(int i = 0;i<n[1] ; i++) {sum += a[a.Length - 1 - i]; }
        Console.WriteLine(sum);  Console.ReadLine();  }
 
    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b)
    {
        return a * b / gcd(a, b);
    }
    public static bool IsPrime(long n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
 
        for (long i = 2; i < n; i++)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
 
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] longs()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }
    public static int Int()
    {
        return int.Parse(Console.ReadLine());
    }
    public static int[] ints()
    {
        return Console.ReadLine().Split().Select(int.Parse).ToArray();
    }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i) 
#define REP(i,k,n) for (i = k; i <= n; ++i) 
#define REPR(i,k,n) for (i = k; i >= n; --i)
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);
 
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
 freopen("input.txt", "r", stdin);
 freopen("output.txt", "w", stdout);
#endif  

 ll n , q , flag = 1;
 cin>>n>>q;
 ll dp[n+1] = { 0 };
 while(q--)
 {
   ll a;
   cin>>a;
   dp[a] = -1;
 }
  if(dp[1]==-1)
  {
    dp[1] = -1;
    dp[0] = 1;
  } else {
    dp[1] = 1;
    dp[0] = 1;
  }
  for(ll i = 2;i<=n;i++)
  {
    if(dp[i]==-1)
    {
        continue;
    }
    if(dp[i-1]==-1&&dp[i-2]==-1)
       { 
        flag = 0;
        break;
       }
        if(dp[i-1]!=-1)
        {
            dp[i] = (dp[i] + dp[i-1])%1000000007;
        }
        if(dp[i-2]!=-1)
        {
            dp[i] = (dp[i] + dp[i-2])%1000000007;
        }
      }
  
  if(flag==0)
  cout<<0;
  else cout<<dp[n];
  return 0;
  
}

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

using namespace std;
const int N = 200000 + 10;
typedef long long ll;
int b[N], pre[N], vis[N], a[N], mark[N];
vector<int> path[N];
typedef long long LL;
LL nn,mm,p;

LL quick_mod(LL a, LL b)
{
    LL ans = 1;
    a %= p;
    while(b)
    {
        if(b & 1)
        {
            ans = ans * a % p;
            b--;
        }
        b >>= 1;
        a = a * a % p;
    }
    return ans;
}

LL C(LL n, LL m)
{
    if(m > n) return 0;
    LL ans = 1;
    for(int i=1; i<=m; i++)
    {
        LL a = (n + i - m) % p;
        LL b = i % p;
        ans = ans * (a * quick_mod(b, p-2) % p) % p;
    }
    return ans;
}

LL Lucas(LL n, LL m)
{
    if(m == 0) return 1;
    return C(n % p, m % p) * Lucas(n / p, m / p) % p;
}
int main()
{
    int n, idr, idl;
    p = 1000000000 + 7;
    memset(vis, 0, sizeof(vis));
    scanf("%d", &n);
    for(int i = 1; i<=n+1; i++)
    {
        scanf("%d", &a[i]);
        if(vis[a[i]])
            idr = i, idl = vis[a[i]];
        else vis[a[i]] = i;
    }
    map<pair<pair<int, int>, int>, int> mp;
//    for(int i = 1; i<=n+1; i++)
//        for(int j = i+1; j<=n+1; j++)
//        for(int k = j+1; k<=n+1; k++)
//    {
//        if(mp[make_pair(make_pair(a[i], a[j]), a[k])] == 0)
//        mp[make_pair(make_pair(a[i], a[j]), a[k])] = 1;
//        else
//        cout<<a[i]<<" "<<a[j]<<" "<<a[k]<<endl;
//
//    }
    idr = n+1-idr, idl--;
    LL sb = n+1, fuck = 1;
    //cout<<idr+idl<<endl;
    for(int i = 1; i<=n+1; i++)
    {
       // printf("%lld 1\n", (Lucas(n+1, i) - Lucas(idr+idl, i-1)+ p)%p);
        printf("%lld\n", (sb - fuck + p)%p);
       // cout<<sb <<" "<<fuck<<" "<<i<<endl;
        sb = sb * (n+1-i)%p;
        sb = sb * quick_mod(i+1, p-2)%p;
        if(i == 1)
            fuck = idr+idl;
        else
        {
            fuck = fuck * (idl+idr-i+1)%p;
            fuck = fuck * quick_mod(i, p-2)%p;
        }
    }
    return 0;
}


Measured memory_bytes: 9344
#include <cstdio>
#include <algorithm>
int head[100001], next[199999], to[199999], len[199999], N, E, q[100001], fa[100001], fe[100001], size[100001], mxson[100001];
long long O;
int main()
{
	scanf("%d", &N);
	for (int i = 1, u, v, l; i < N; i++)
	{
		scanf("%d%d%d", &u, &v, &l);
		next[++E] = head[u], to[E] = v, len[E] = l, head[u] = E;
		next[++E] = head[v], to[E] = u, len[E] = l, head[v] = E;
	}
	int H = 0, T = 1, u;
	q[1] = 1;
	while (H < T)
		for (int e = head[u = q[++H]]; e; e = next[e])
			if (to[e] != fa[u])
			{
				fa[q[++T] = to[e]] = u;
				fe[to[e]] = e;
			}
	for (int i = 1; i <= N; i++)
		size[i] = 1;
	for (int i = N; i > 1; i--)
	{
		size[fa[q[i]]] += size[q[i]];
		mxson[fa[q[i]]] = std::max(mxson[fa[q[i]]], size[q[i]]);
	}
	for (int i = 2; i <= N; i++)
		O += (long long)std::min(size[i], N - size[i]) * len[fe[i]];
	O <<= 1;
	for (int i = 2; i <= N; i++)
		if (size[i] << 1 > N && mxson[i] << 1 < N)
		{
			int XA = 1000000000;
			for (int e = head[i]; e; e = next[e])
				XA = std::min(XA, len[e]);
			printf("%lld\n", O - XA);
			return 0;
		}
	for (int i = 2; i <= N; i++)
		if (size[i] << 1 == N)
		{
			printf("%lld\n", O - len[fe[i]]);
			return 0;
		}
	return 0;
}


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

using namespace std;

int a,b,c,d,n,m,i,j,t[200005];
string s,q;

int main() 
{
    cin>>s;
    if (s[0]==s[1] || s[1]==s[2] || s[2]==s[3]) cout<<"Bad"; else cout<<"Good";
}

Measured memory_bytes: 256
count = 0
count2 = 1
def printChessboard(h, w) : 
    global count
    global count2
    for i in range(0, h) :  
        for j in range(0, w) : 
            if count == 0 : 
                print("#",end="") 
                count += 1
            else : 
                print(".",end="") 
                count -=1
        if count2 == 1 :
            count = 1
            count2 -= 1
        else :
            count = 0
            count2 += 1
        print('')
    print('')
for j in range(30):
    h, w = map(int, input().split())
    if h == 0 and w == 0:
        break
    else:
        printChessboard(h, w)  
        count = 0
        count2 = 1




Measured memory_bytes: 7016
#include<iostream>
#include<vector>
#include<algorithm>

#define REP(i,n) for(int i=0;i<(n);i++)

using namespace std;
int field[50][50];
int w, h;

void dfs(int i, int j){
    field[i][j] = 0;
    for(int di=-1; di<=1; di++){
        for(int dj=-1; dj<=1; dj++){
            int ni = i+di;
            int nj = j+dj;
            if(field[ni][nj]==1 && 0 <= ni && ni < h &&
                    0 <= nj && nj < w){
                dfs(ni,nj);
            }
        }
    }
    return;
}

int main(){
    while(cin >> w >> h){
        if(w==0 && h==0) break;
        REP(i,h){
            REP(j,w){
                cin >> field[i][j];
            }
        }

        int cnt = 0;
        REP(i,h){
            REP(j,w){
                if(field[i][j] == 1){
                    dfs(i,j);
                    cnt++;
                }
            }
        }
        cout << cnt << endl;
    }

    return 0;
}

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

int gcd(int a, int b) {
	return b ? gcd(b, a % b) : a;
}

int main() {
	int n; cin >> n;
	vector<int>a(n), l(n), r(n);
	for (auto&& x : a)cin >> x;
	for (int i = 0; i < n - 1; i++)l[i + 1] = gcd(l[i], a[i]);
	for (int i = n - 1; i > 0; i--)r[i - 1] = gcd(r[i], a[i]);

	int ans = 1;
	for (int i = 0; i < n; i++) {
		ans = max(ans, gcd(l[i], r[i]));
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1408
#include <stdio.h>

int main(void){
    int n,i,j;
    scanf("%d",&n);
    for(i = 1;i<=n;i++){
        if(i % 3 == 0){
            printf(" %d",i);
        } else {
            for(j = i;j>0;j /= 10){
                if(j % 10 == 3){
                    printf(" %d",i);
                    break;
                }
            }
        }
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>

int main(){
	long long dp[21][100] = {}; //init
	std::vector<int> numbers;
	int num,x;

	std::cin >> num;

	for(int i=0; i<num; ++i){
		std::cin >> x;
		numbers.push_back(x);
	}

	dp[numbers.at(0)][0] = 1; //first step

	for(int i=1; i<num-1; ++i){
		
		for(int j=numbers.at(i); j<21; ++j){ //0 < j - numbers.at(i)
			dp[j-numbers.at(i)][i] += dp[j][i-1];
		}

		for(int j=0; j<21-numbers.at(i); ++j){ //j + numbers.at(i) < 21
			dp[j+numbers.at(i)][i] += dp[j][i-1];
		}

	}

	std::cout << dp[numbers.at(num-1)][num-2] << std::endl; //num-2 = (num-1)-1
}

Measured memory_bytes: 1232
#include<stdio.h>
#include<stdlib.h>


//prototype
int judge(int,int);


//global
int *data, data_n;

int main(){
  int *mihon, mihon_n;
  int i;

  
  //input
  scanf("%d",&data_n);
  data=(int *)malloc(sizeof(int)*data_n);
  for(i=0;i<data_n;i++) scanf("%d",&data[i]);
  scanf("%d",&mihon_n);
  mihon=(int *)malloc(sizeof(int)*mihon_n);
  for(i=0;i<mihon_n;i++) scanf("%d",&mihon[i]);


  //judge
  for(i=0;i<mihon_n;i++){
    if(judge(0,mihon[i])==1) printf("yes\n");
    else printf("no\n");
  }
  
  
  free(data);
  free(mihon);
  return 0;
}


//input i&m  output 1/0
int judge(int i, int m){
  int res;
  
  if(m==0) return 1;
  else if(i>=data_n) return 0;
  res=judge(i+1,m)||judge(i+1,m-data[i]);
  return res;

}



Measured memory_bytes: 2108
mod = 10**9 + 7
n = int(input())
A = list(map(lambda x: int(x) % mod, input().split()))

# out = 0
# for i in range(n - 1):
#     for j in range(n - i - 1):
#         k = i + j + 1
#         # print(A[i], A[k])
#         out += (A[i] * A[k])
#         out %= mod
B = A[1:n]
B_s = 0
for i in range(n - 1):
    B_s += B[i] % mod

out = 0
for i in range(n - 1):
    out += A[i] * B_s
    out %= mod
    B_s -= A[i + 1]
    B_s %= mod
    if B_s < 0:
        B_s += mod

print(out)


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

int main ()
{
	char s[100],i,p,c=0;
	scanf("%s",s);
	p=strlen(s);
	
	for(i=0;i<p;i++)
	{
		if((i+1)%2!=0&&s[i+1]=='R')
		{
			printf("No\n");
			c=1;
			break;
		}
		else if((i+1)%2==0&&s[i+1]=='L')
		{
			printf("No\n");
			c=1;
			break;
		}
		if(s[0]=='L')
		{
			printf("No\n");
			c=1;
			break;
			
		}

	}
	   if(c==0)
	   {
	   	printf("Yes\n");
	   }
	   
	    

	return 0;

	 
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
ll m=1000000007;
ll sieve[1000001]={0},i,j;
ll power(ll p, ll k)
{
ll a=1;
while(k)
{
if(k&1)
a=(a*p)%m;
p=(p*p)%m;
k>>=1;
}
return a;
}
using namespace std;
int main()
{
ll n;
cin>>n;
vector<ll> s(n);
ll i,j,ans=0;
ll a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
s[i]=a[i];
}
sort(a,a+n);
sort(s.begin(),s.end());
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
 auto it1=lower_bound(s.begin(),s.end(),s[i]+s
[j]);
auto it2 =s.begin();
 ans+=(it1-it2)-(j+1);
}
}
cout<<ans;
}

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

int main() {
  int r, D, x[11];
  cin >> r >> D >> x[0];

  for (int i = 0; i < 10; i++) {
    x[i+1] = r * x[i] - D;
    cout << x[i+1] << endl;
  }

  return 0;
}

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

int main(){
	//1854
  int A,B,K;
  cin>>A>>B>>K;
  
  	if(K*2>B-A+1){
		for(int i=A;i<=B;i++){
  			cout<<i<<endl;
    	}
	}else{
  		for(int i=0;i<K;i++){
      	cout<<A+i<<endl;
        }
		for(int i=0;i<K;i++){
          cout<<B-K+1+i<<endl;
    	}
	}
}

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

int main(){
  ll a;
  string b;
  cin >> a >> b;

  int b_ = 100 * (b[0] - 48) + 10 * (b[2] - 48) + (b[3] - 48);

  ll ans = a * b_;
  ans /= 100;

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
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; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

int main(){
    ll N, D, X;
    cin >> N >> D >> X;
    vector<ll> A(N);
    REP(i, N) cin >> A[i];

    ll res = X;
    REP(i, N) {
        for (int j=1; j<=D; j+=A[i]) {
            res++;
        }
    }
    cout << res << "\n";
}


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

int main()
{
    int n, i;
    cin >> n;
    int a[n + 1], dp[n + 1];
    for(i = 1; i <= n; ++i)
        cin >> a[i];

    dp[1] = 0;
    dp[2] = abs(a[2] - a[1]);
    for(i = 3; i <= n; ++i)
        dp[i] = min(abs(a[i] - a[i - 1]) + dp[i - 1], abs(a[i] - a[i - 2]) + dp[i - 2]);
    cout << dp[n] << "\n";
    return 0;
}

Measured memory_bytes: 1024
#define _USE_NATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <random>
#include <tuple>


using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
#define EPS 1e-9
const int INF = 1050000000;
const long long LINF = 1LL << 60;
const ll MOD = 1e9 + 7; 
const int MINF = -1050000000;

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if ((a + b + c) >= 22) cout << "bust" << endl;
	else cout << "win" << endl;
	
	return 0;
}


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

int main() {
	// your code goes here
	int a[3],total;
	for(int i=0;i<3;i++) cin>>a[i];
	
	sort(a,a+3);
	
	printf("%s\n", a[0]+a[1] == a[2] ? "Yes" : "No");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long Abs(long long n)
{
  if(n<0)
  {
    return -n;
  }
  else
  {
    return n;
  }
}
int main()
{
  long long a,u,b,v,t;
  cin>>a>>u>>b>>v>>t;
  if(t*(u-v)>=Abs(b-a))
  {
    cout<<"YES";
  }
  else
  {
    cout<<"NO";
  }
  return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>

int main(void) {

  int n;
  scanf("%d", &n);
  int a[n+1];
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int count = 0;
  for (int i = 1; i <= n; i += 2) {
    if (a[i]%2 == 1) {
      count++;
    }
  }
  printf("%d\n", count);

  return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  string a[n], b[m];
  REP(i, n) cin >> a[i];
  REP(i, m) cin >> b[i];

  REP(j, n - m + 1) REP(i, n - m + 1) {
    REP(y, m) REP(x, m) {
      if (a[j + y][i + x] != b[y][x]) {x = m; y = m; break;}
      if (x == m - 1 && y == m - 1) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
coin = [10,50,100,500]
c = 0
while True:
    c += 1
    price = int(input())
    if (price == 0):
        break
    pur = list(map(int,input().split()))
    sumpur = sum(c*n for c,n in zip(coin, pur))
    change = sumpur - price
    afterpur = [(change%50)//10, (change%100)//50, (change%500)//100, change//500]
    if (c > 1):
        print()
    for i in range(4):
        if (afterpur[i] < pur[i]):
            print(coin[i], pur[i] - afterpur[i])


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

int main(){
	int N, M, i, l;
	if(scanf("%d%d", &N, &M));
	l=sqrt(M);
	for(i=N; i<=l; i++){
		if(M%i==0){
			printf("%d\n", M/i);
			return 0;
		}
	}
	for(i=l;; i--){
		if(M%i==0 && M/i>=N){
			printf("%d\n", i);
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 128
#include <queue>
#include <set>
#include <unordered_set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef pair<int,int> pii;

/// pair<int,int> hasher
namespace std{
	template<typename I>
	class hash<pair<I,I>>{
		public:
		size_t operator()(const pair<I,I> &p) const {return hash<long long>() (((long long)(p.first))<<32|p.second);}
	};
}

double solve(const vector<pii> &a){
	set<int>ys;
	for(auto &e:a)ys.insert(e.second);
	int n=a.size();
	vector<double>mx,my;
	mx.reserve(n*2);
	my.reserve(n*2);
	for(int i=0;i<n;i++){
		mx.push_back(a[i].first);
		my.push_back(a[i].second);
		if(i==n-1)continue;
		//??????????????§y??§?¨??????????ys?????????????????????
		if(a[i].second<a[i+1].second){ //??????i????°???§??????
			for(auto it=ys.begin();it!=ys.end();++it){
				if(a[i].second<*it && *it<a[i+1].second){
					double dy=a[i+1].second-a[i].second;
					double dx=(a[i+1].first-a[i].first)/dy*(*it-a[i].second);
					mx.push_back(a[i].first+dx);
					my.push_back(*it);
				}
			}
		}else{ //??????i????±±??§??????
			for(auto it=ys.end();it--!=ys.begin();){
				if(a[i+1].second<*it && *it<a[i].second){
					double dy=a[i+1].second-a[i].second;
					double dx=(a[i+1].first-a[i].first)/dy*(*it-a[i].second);
					mx.push_back(a[i].first+dx);
					my.push_back(*it);
				}
			}
		}
	}
	int m=mx.size();
	priority_queue<pair<double,pii>>q;
	unordered_set<pii>se;
	q.push({0,{0,m-1}});
	for(;!q.empty();){
		double c=q.top().first;
		int l=q.top().second.first;
		int r=q.top().second.second;
		q.pop();
		if(se.find({l,r})!=se.end())continue;
		se.insert({l,r});
		if(l==r)return -c;
		for(int i=-1;i<2;i++)for(int j=-1;j<2;j++){
			if((i||j) && 0<=l+i&&l+i<m && 0<=r+j&&r+j<m && fabs(my[l+i]-my[r+j])<1e-9)
				q.push({c-hypot(mx[l]-mx[l+i],my[l]-my[l+i])-hypot(mx[r]-mx[r+j],my[r]-my[r+j]),{l+i,r+j}});
		}
	}
	abort();
}

int main(){
	int N,x,y;
	for(;scanf("%d",&N),N;){
		vector<pii>a(N);
		for(int i=0;i<N;i++)scanf("%d%d",&a[i].first,&a[i].second);
		printf("%f\n",solve(a));
	}
}

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

int main() {
    string s,t;
    cin >> s >> t;
    cout << t + s << endl;
}

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

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

    std::vector<int> d(n);
    for(int i = 0; i < n; ++i){
        std::cin >> d.at(i);
    }

    int ans = 0;
    for(int i = 0; i < n - 1; ++i){
        for(int j = i + 1; j < n; ++j){
            ans += d.at(i) * d.at(j);
        }
    }

    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P,P> PP;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e5 + 5);
const double EPS = 1e-10;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

ll n, m;
vector<vector<int> > g;
vector<int> visited;
bool odd_cycle = false;

void dfs(int i, int cnt){
    visited[i] = cnt;
    for(auto to : g[i]){
        if(visited[to]==-1) dfs(to,(cnt+1)%2);
        else if(visited[to]==cnt) odd_cycle = true;
    }
}

int main() {
    cin >> n >> m;
    g.resize(n);
    visited.resize(n,-1);
    REP(i,m){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    dfs(0,0);
    if(odd_cycle){
        cout << n*(n-1)/2 - m << endl;
    }
    else{
        ll ev=0, od = 0;
        REP(i,n){
            if(visited[i]%2) od++;
            else ev++;
        }
        cout << n*(n-1)/2 - ev*(ev-1)/2 - od*(od-1)/2 - m << endl;
    }
    return 0;
}


Measured memory_bytes: 6656
import java.util.Scanner;

public class Main {

    public static void main(String args[]) throws Exception {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A[] = new int[N];

        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        int cnt = 0;
        boolean flg = true;
        while (flg) {
            for (int j = 0; j < A.length; j++) {
                if (A[j] % 2 != 0) {
                    flg = false;
                    break;
                }
                A[j] = A[j] / 2;
            }
            if (flg) {
                cnt++;
            }
        }

        System.out.println(cnt);
    }
}


Measured memory_bytes: 21076
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long int ll;
#define forn(i,p,n); for(long long i=p;i<n;++i)
#define pb push_back
void solve(){
	string str;
	cin >> str;
	if(str == "SSS"){
		cout<<0;
		return ;
	}
	if(str=="RRS" || str=="SRR"){
		cout<<2;
		return ;
	}
	if(str=="RSS" || str=="SRS" || str=="SSR" || str=="RSR"){
		cout<<1;
		return ;
	}
	cout<<3;
	return ;
}
 
int main()
{
	fast;
	// int test;
	// cin >> test;
	// while(test--){
		solve();
	// 	cout<<"\n";
	// }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define mp 	    make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define mod        1000000007
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
ll power(ll a , ll b,ll modi)
{
    ll res = 1 ;
    while(b)
    {
        if(b%2) {
            res = (res * a) % modi ;
        }
        b/=2 ;
        a = (a*a) % modi ;
    }
    return res ;
}
bool pali(vector<char>ch)
{
	for(int i=0;i<ch.size();i++)
	if(ch[i]!=ch[ch.size()-i-1])
	return false;
	return true;
}
ll coun[200001];
ll ans[200001];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t=1;
	//cin>>t;
	while(t--)
	{
	  ll n;
	  cin>>n;
	  ll a[n];
	  for(ll i=0;i<n;i++){
	  
	  cin>>a[i];
	  coun[a[i]]++;
	  }
	  ll sum=0;
	  for(ll i=1;i<=200000;i++)
	  {
	  	ans[i]=(coun[i]*(coun[i]-1))/2;
	  	sum+=ans[i];
	  }
	  
	  for(ll i=0;i<n;i++)
	  {
	  	coun[a[i]]--;
	  	ll b=(coun[a[i]]*(coun[a[i]]-1))/2;
	  	cout<<sum-ans[a[i]]+b<<endl;
	  	coun[a[i]]++;
	  }
	}
return 0;
}

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

#define ll long long



int main()
{
    int n;
    scanf("%d",&n);
    int ar[n+1][4];
    for(int i=1;i<=n;i++){
        for(int j=1;j<=3;j++)
            scanf("%d",&ar[i][j]);
    }
    int dp[n+1][4];
    memset(dp,0,sizeof dp);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=3;j++){
            if(j==2){
                dp[i][j]=max(ar[i][j]+dp[i-1][j-1],ar[i][j]+dp[i-1][j+1]);

            }
            else if(j==1)
                dp[i][j]=max(ar[i][j]+dp[i-1][j+1],ar[i][j]+dp[i-1][j+2]);
            else
                dp[i][j]=max(ar[i][j]+dp[i-1][j-1],ar[i][j]+dp[i-1][j-2]);
        }
    }
    int ans=-1;
    for(int i=1;i<=3;i++)
        ans=max(dp[n][i],ans);
    printf("%d\n",ans);
}


Measured memory_bytes: 3328
import sys
sys.setrecursionlimit(10**9)
import collections

def main():
    n = int(input())
    s = [input() for i in range(n)]
    m = int(input())
    t = [input() for i in range(m)]

    s = collections.Counter(s)
    t = collections.Counter(t)

    ans = 0
    for key, value in s.items():
        if key in t:
            ans = max(ans, value-t[key])
        else:
            ans = max(ans, value)

    print(ans)
    return


if __name__ == "__main__":
    main()
    sys.exit(0)

Measured memory_bytes: 65380
/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    int n = Integer.parseInt(br.readLine());
    Interval[] intervals = new Interval[n];
    PriorityQueue<Interval> lMax = new PriorityQueue<>(new LMaxComparator());
    PriorityQueue<Interval> rMin = new PriorityQueue<>(new RMinComparator());
    int leftCount = 0;
    int rightCount = 0;
    for (int i=0; i<n; i++) {
      String[] s = br.readLine().split(" ");
      int l = Integer.parseInt(s[0]);
      int r = Integer.parseInt(s[1]);
      intervals[i] = new Interval(l,r,i);
      lMax.offer(intervals[i]);
      rMin.offer(intervals[i]);
      if (r<0) {
        leftCount++;
      } else if (l>0) {
        rightCount++;
      }
    }
    boolean[] vis = new boolean[n];
    //boolean right = Math.abs(lMax.peek().l)>Math.abs(rMin.peek().r);
    boolean right = rightCount>leftCount;
    long sum = 0;
    long pos = 0;
    for (int i=0; i<n; i++) {
      if (right) {
        Interval curr = lMax.poll();
        while (vis[curr.id]) {
          curr = lMax.poll();
        }
        //System.out.println(curr.toString());
        vis[curr.id] = true;
        if (curr.l<=pos && pos<=curr.r) {
          sum += 0;
        } else {
          if (curr.l>pos) {
            sum += curr.l-pos;
            pos = curr.l;
          } else {
            sum += pos-curr.r;
            pos = curr.r;
          }
        }
      } else {
        Interval curr = rMin.poll();
        while (vis[curr.id]) {
          curr = rMin.poll();
        }
        //System.out.println(curr.toString());
        vis[curr.id] = true;
        if (curr.l<=pos && pos<=curr.r) {
          sum += 0;
        } else {
          if (curr.l>pos) {
            sum += curr.l-pos;
            pos = curr.l;
          } else {
            sum += pos-curr.r;
            pos = curr.r;
          }
        }
      }
      right = !right;
    }
    sum += Math.abs(pos);
    System.out.println(sum);
  }
}
class LMaxComparator implements Comparator<Interval> {
  public int compare(Interval i1, Interval i2) {
    return i2.l-i1.l;
  }
}
class RMinComparator implements Comparator<Interval> {
  public int compare(Interval i1, Interval i2) {
    return i1.r-i2.r;
  }
}
class Interval {
  int id;
  int l,r;
  public Interval(int ll, int rr, int idd) {
    id = idd;
    l = ll;
    r = rr;
  }
  public String toString() {
    return String.format("[%d,%d]",l,r);
  }
}


Measured memory_bytes: 48416
import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

# sys.setrecursionlimit(5000)

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return map(lambda x: x + d, A)
def ldec(A, d=1): return map(lambda x: x - d, A)

A, B, C = nn()
K = n1()

i = 0
while i < K and A >= B:
    i += 1
    B *= 2

while i < K and B >= C:
    i += 1
    C *= 2

if A < B and B < C:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 72900
#include<iostream>
#include<iomanip>
#include<stack>
#include<queue>
#include<list>
#include<vector>
#include<set> 
#include<map>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<ctime>
#define ll long long
#define db long double
#define inf 101
#define INF (ll)1e15 
#define pi acos(-1)
#define rd(n) {n=0;char ch;int f=0;do{ch=getchar();if(ch=='-'){f=1;}}while(ch<'0'||ch>'9');while('0'<=ch&&ch<='9'){n=(n<<1)+(n<<3)+ch-48;ch=getchar();}if(f)n=-n;}
using namespace std;

int a[inf];
int p[inf];

int main(){
	int n;
	rd(n)
	int minn=n+1,maxn=0;
	for (int i=1;i<=n;i++){
		rd(a[i])
		p[a[i]]++;
		minn=min(minn,a[i]);
		maxn=max(maxn,a[i]);
	}
	for (int i=(maxn%2==0?minn+1:minn);i<=maxn;i++){
		if (p[i]<=1){
			puts("Impossible");
			return 0;
		}
	}
	if ((maxn%2==0 && p[minn]!=1) || (maxn%2==1 && p[minn]!=2)){
		puts("Impossible");
		return 0;
	}
	puts("Possible");
	return 0;
}

Measured memory_bytes: 256
object Main extends App {

  val Array(a,b) = scala.io.StdIn.readLine.split(" ").map(_.toLong)

  def solve(): String = {
    val ans: Double = (a * a - b * b).toDouble / (2 * (a - b))
    if(ans % 1 == 0) ans.toInt.toString else "IMPOSSIBLE"
  }
  println(solve)
}


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

using namespace std;

typedef long long LL;

struct cww{cww(){
    ios::sync_with_stdio(false);cin.tie(0);
    cout<<fixed;
    cout<<setprecision(10);
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)

#define fi first
#define se second
#define pb push_back

template <typename T>inline void chmin(T &l,T r){l=min(l,r);}
template <typename T>inline void chmax(T &l,T r){l=max(l,r);}

template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}

int main(){
    int P,Q;
    cin>>P>>Q;
    vector<string> p(P),q(Q);
    cin>>p>>q;
    for(int i=0,ii=Q;ii<=P;i++,ii++)
        for(int j=0,jj=Q;jj<=P;j++,jj++){
            int eq=1;
            REP(k,Q)
                REP(l,Q)
                if(p[i+k][j+l]!=q[k][l])eq=0;
            if(eq){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef map<int,int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vl;
typedef vector<vector<ll>> vll;
typedef vector<bool> vb;
typedef set<int> si; 
typedef queue<int> qi;
typedef stack<int> sti;
typedef priority_queue<int> pqi;
#define fori(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,b,a) for(int i = (b); i >= (a); --i)
#define all(a) (a).begin(), (a).end()
//#define __builtin_popcountll bitCountLL
//#define __builtin_popcount bitCount
//__builtin_ctz 末尾0的个数, __builtin_clz 前导0的个数
//__builtin_ffs 最后一个1的位置
#define maxn 100005
#define Mod 1000000007
const ll INF = 1e10;
const ll ML = 4e18;
ll count(string x) {
    ll res = 0;
    fori(i,0,x.size()) {
        res = res * 10 + (x[i] - '0');
    }
    return res;
}    
void solve() {
    int n;
    cin >> n;
    vl a(n);
    map<pii,int> mp;
    fori(i,0,n) {
        string x;
        cin >> x;
        int p = x.find('.');
        string t,s;
        if(p == -1) {
            t = x;
            s = "";
        }
        else {
            t = x.substr(0,p);
            s = x.substr(p + 1);
        }
        a[i] = (count(t) * INF) + count(s) * pow(10ll,10 - s.size());
        int b = 0 ,c = 0;
        while(a[i] % 2 == 0 || a[i] % 5 == 0) {
            if(a[i] % 2 == 0) {
                a[i] /= 2;
                b++;
            }
            if(a[i] % 5 == 0) {
                a[i] /= 5;
                c++;
            }
        }
        mp[{b,c}]++;
    }
    ll  res = 0;
    vector<pair<pii,int>> vp(all(mp));
    fori(i,0,vp.size()) {
        pii m = vp[i].first;
        int x = m.first, y = m.second;
        ll cnt = vp[i].second;
        if(x + x >= 20 && y + y >= 20)res += ll(cnt) * (cnt - 1) / 2;
        fori(j,i + 1, vp.size()) {
            pii t = vp[j].first;
            int ct = vp[j].second;
            int tx = t.first, ty = t.second;
            if(tx + x >= 20 && ty + y >= 20) res += (ll)ct * cnt;
        }
    }
    cout << res << endl;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	//cout.precision(30); cout << fixed;
//	freopen("D:\\data_in.txt", "r", stdin);
   
    solve();
   
    /*
    clock_t start,finish;
    start = clock();
    
    finish = clock();
    cout << "\n" << (double)(finish - start) / (double)(CLOCKS_PER_SEC) * 1000 << "ms" << endl;
    */
    return 0;
}

/***************************************************************
 question:
 idea:
 tag:
 record:
 ***************************************************************/


Measured memory_bytes: 5108
x=int(input())

a=0
b=0
z=False
if int(x**0.2)**5==x:
  a=int(x**0.2)
else:
  b=1
  while z==False:
    #print(str(b)+"kkk")
    a1=x+b**5
    #print(a1**0.2)
    if (a1**0.2).imag==0 and int(a1**0.2)**5==a1:
      a=int(a1**0.2)
      break
    else:
      a2=x-b**5
      if (a2**0.2).imag==0 and int(a2**0.2)**5==a2:
        a=int(a2**0.2)
        b*=-1
        break
      else:
        b+=1

print(str(a)+" "+str(b))

Measured memory_bytes: 9476
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
using namespace std;
#define MOD 1000000007
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int N;
i64 X, Ai[2020];
i64 R[2020];

int main()
{
	scanf("%d%lld", &N, &X);
	i64 ret = 1LL << 62LL;

	for (int i = 0; i < N; ++i) scanf("%lld", Ai + i);
	for (int i = 0; i < N; ++i) R[i] = Ai[i];

	for (int m = 0; m < N; ++m) {
		i64 tmp = 0;
		for (int i = 0; i < N; ++i) tmp += R[i];
		ret = min(ret, tmp + X * m);

		for (int i = 0; i < N; ++i) {
			R[i] = min(R[i], Ai[(i + N - m - 1) % N]);
		}
	}

	printf("%lld\n", ret);

	return 0;
}


Measured memory_bytes: 256