akhauriyash/Code-Regression huggingface dataset:
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
w = 0
ans = 0
for i in range(n - 1):
    w += (x[i + 1] - x[i]) * (i + 1) * (n - i - 1)
    w %= (10 ** 9 + 7)
for i in range(m - 1):
    ans += w * (y[i + 1] - y[i]) * (i + 1) * (m - i - 1)
    ans %= (10 ** 9 + 7)
print(ans)


Measured memory_bytes: 83044
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>

using std::cin;
using std::cout;
using std::string;

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

  long double sum = 0.0;
  for (int i = 1; i <= n; ++i)
  {
    int count = 0;
    int value = i;
    while (value < k)
    {
      value *= 2;
      count++;
    }
    sum += static_cast<long double>(1.0) / std::pow(static_cast<long double>(2.0), static_cast<long double>(count));
  }

  long double result = sum / static_cast<long double>(n);
  printf("%1.10Lf\n", result);
  // cout << result << "\n";

  return 0;
}


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

#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)
typedef unsigned long long int lli;
typedef pair<int, int> pi;

int ans[2005];
vector<int> adj[2005];

void bfs(int a, int n)
{
    vector<int> dis(2005, -1);
    dis[a] = 0;
    queue<int> qu;
    qu.push(a);
    while(!qu.empty()){
        int u = qu.front();
        qu.pop();
        for(int i=0; i<adj[u].size(); i++){
            int v = adj[u][i];
            if(dis[v] == -1){
                dis[v] = dis[u]+1;
                qu.push(v);
            }
        }
    }
    for(int i=a; i<=n; i++){
        if(dis[i] != -1)
            ans[dis[i]]++;
    }
}

int main()
{
    int n, x, y;
    cin >> n >> x >> y;

    for(int i=1; i<n; i++){
        adj[i].push_back(i+1);
        adj[i+1].push_back(i);
    }
    adj[x].push_back(y);
    adj[y].push_back(x);
    for(int i=1; i<=n; i++){
        bfs(i, n);
    }
    for(int i=1; i<n; i++){
        cout << ans[i] << "\n";
    }

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cmath>
using namespace std;

static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;

template<typename Type>
struct SegmentTree {
        vector<Type> data;
        int n;
        SegmentTree(int x) {
                n = pow(2, ceil(log2(x)));
                data.resize(2 * n - 1, INFL);
        }
        Type merge(Type x, Type y) { //更新関数
                if (x == y) return x;
                else return (max(x, y) - min(x, y));
        }
        void update(int k, Type p) { //k番目をpに更新する
                k += n - 1;
                data[k] = p;
                while (k > 0) {
                        k = (k - 1) / 2;
                        data[k] = merge(data[k * 2 + 1], data[k * 2 + 2]);
                }
        }
        // [l, r)
        Type query(int a, int b) { return query(a, b, 0, 0, n); }
        Type query(int a, int b, int k, int l, int r) {
                if (r <= a || b <= l) return INFL; //初期値
                if (a <= l && r <= b) return data[k];
                int m = (l + r) / 2;
                return merge(query(a, b, k * 2 + 1, l, m), query(a, b, k * 2 + 2, m, r));
        }
};

int main() {
        int n;
        scanf("%d", &n);
        int N = pow(2, n);
        vector<long long> a(N);
        for (int i = 0; i < N; i ++) scanf("%lld", &a[i]);
        SegmentTree<long long> st(N);
        for (int i = 0; i < N; i ++) {
                st.update(i, a[i]);
        }
        printf("%lld\n", st.data[0]);
        return 0;
}



Measured memory_bytes: 6400
n=int(input())
*d,=map(int, input().split( ))
m=int(input())
*t,=map(int, input().split( ))
from collections import Counter

dc=Counter(d);tc=Counter(t)
for ti in tc:
    if ti not in dc:
        print("NO")
        exit()
    if dc[ti]<tc[ti]:
        print("NO")
        exit()
print('YES')

Measured memory_bytes: 57048
#include <bits/stdc++.h>
using namespace std;
#define mem(a,n) memset(a,n,sizeof(a))
#define rep(i,a,n) for(int i=a;i<n;i++)
#define pb push_back
typedef long long ll;
const int INF=0x3f3f3f3f;
const double PI=3.1415926;
const int MOD=1e9+7;
const int N=1e6+5;
int main()
{
    int n,a,b;
    while(~scanf("%d%d%d",&n,&a,&b))
    {
        int d1=b-a-1;
        if(d1%2==1) puts("Alice");
        else puts("Borys");
    }
    return 0;
}

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

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

    int N; cin >> N;
    map<string, int> m;
    string W; cin >> W;
    m[W]++;
    char c = W.back();
    bool flag = true;
    for (int i = 1; i < N; i++) {
        cin >> W;
        if (++m[W] > 1) flag = false;
        if (c != W.front()) flag = false;
        c = W.back();
    }
    cout << (flag ? "Yes" : "No") << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#define fore(i,x,y) for(long long i=x;i<y;i++)
typedef long long ll;
using namespace std;

bool compare_by_b(pair<int,string> a, pair<int,string> b) {
	if (a.first != b.first) {
		return a.first > b.first;
	}
	else {
		return a.second < b.second;
	}
}

int main()
{
	double r;
	cin >> r;
	cout << 2*r * 3.14159265358979323846 << endl;
}

Measured memory_bytes: 3264
#include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if(a%2 == 0 || b%2 == 0) puts("No");
	else puts("Yes");
	return 0;
}

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

int main() {
  long long a, b, c, res = 0;
  cin >> a >> b >> c;
  for(int i = a; i <= b; ++i)
    if(i <= c && c % i == 0) ++res;
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3104
#include<iostream>
#include<vector>
#include<string>
#include<stdlib.h>
#include<algorithm>
#include<math.h>
#include<queue>
#include <forward_list>
using namespace std;


struct node {
	int x=0;
	int y=0;
	int count = 0;
};

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

	vector<node> ball(N);

	vector<vector<node>> difference(N, vector<node>(N));

	vector<node> difference_meomory(N * N);

	for (int i = 0; i < N; i++)
	{
		cin >> ball[i].x >> ball[i].y;
	}

	int end = 0;

	difference_meomory[0].x = 0;
	difference_meomory[0].y = 0;

	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++){
			difference[i][j].x = ball[i].x - ball[j].x;
			difference[i][j].y = ball[i].y - ball[j].y;


			for (int k = 0; k <= end; k++) {
				if (difference[i][j].x == difference_meomory[k].x && difference[i][j].y == difference_meomory[k].y) {
					difference_meomory[k].count++;
					break;
				}
				else if (k == end) {
					difference_meomory[end + 1].x = difference[i][j].x;
					difference_meomory[end + 1].y = difference[i][j].y;
					end++;
				}
			}

		}
	}
	int max = 0;
	for (int i = 1; i < end; i++) {
		if (max < difference_meomory[i].count)
			max = difference_meomory[i].count;
	}

	cout << N - max << endl;

}




Measured memory_bytes: 256
import itertools

n = int(input())
lst = list(map(int, input().split()))

lst_accum = list(itertools.accumulate(lst))

min_diff = 10**100
first_cut = 0
third_cut = 2
all_sum = lst_accum[-1]
for k in range(1, len(lst_accum)-2):
    second_last = lst_accum[k]
    P = lst_accum[first_cut]
    Q = second_last - P
    diff = abs(P-Q)
    while k - first_cut > 1 and diff > abs(second_last - lst_accum[first_cut+1]*2):
        first_cut += 1
        P = lst_accum[first_cut]
        Q = second_last - P
        diff = abs(P-Q)    
    
    if third_cut == k:
        third_cut += 1
    third_last = lst_accum[third_cut]
    S = all_sum - third_last
    R = third_last - second_last
    diff = abs(S-R)
    while (n-1) - third_cut > 1 and diff > abs(all_sum - lst_accum[third_cut+1]*2 + second_last):
        third_cut += 1
        third_last = lst_accum[third_cut]
        S = all_sum - third_last
        R = third_last - second_last
        diff = abs(S-R)
    
    #print(first_cut, k, third_cut)
    min_diff = min(min_diff, max(P,Q,R,S) - min(P,Q,R,S))
    #print(min_diff)
    

print(min_diff)

Measured memory_bytes: 25804
#include <bits/stdc++.h>
using namespace std;
// #define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double  ld;
#define pii pair<ll,ll> 
#define pic pair<ll,char>
#define vi vector< ll > 
#define vvi vector< vi > 
#define vpi vector< pii > 
#define vvpi vector< vpi > 
#define st  set <ll, greater <ll> >
#define mst  multiset <ll, greater <ll> >
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mapp  unordered_map <ll, ll>
#define ppii pair< pii, pii > 
#define test(t) ll t;cin>>t;while(t--)
#define inarr(n) ll arr[n];for(ll i=0;i<n;i++)cin>>arr[i];
#define ingra(m) vvi arr(100005);for(ll i=0;i<m;i++){ll u,v;cin>>u>>v;arr[u].pb(v);arr[v].pb(u);}
#define mem(a,b) memset(a,b,sizeof(a))
#define inn freopen("input.txt", "r", stdin)
#define outt freopen("output.txt", "w", stdout)
#define all(arr) arr.begin(),arr.end()
// ll power(ll x,ll y){ll res = 1;while(y){if(y&1) res = (res*x)%mod;y=y/2,x=(x*x)%mod;}return res%mod;}
ll dp[1000001];
vvi arr(1000001);
ll mod;
ll parent[1000001];
ll pparent[1000001];
ll pref[1000001];
ll suf[1000001];
void dfs(ll u,ll par)
{
    dp[u] = 1;
    ll i;
    for(i=0;i<arr[u].size();i++)
    {
        ll v = arr[u][i];
        if(v!=par)
        {
            dfs(v,u);
            dp[u] = (dp[v]+1)*dp[u]%mod;
        }
    }
}
void dfsup(int u, int par){
    pref[0] = 1;
    for(int i = 0; i < (int)arr[u].size(); i++){
        int v = arr[u][i];
        pref[i + 1] = pref[i];
        if(v == par) continue;
        pref[i + 1] = (pref[i + 1] * (dp[v] + 1)) % mod;
    }
    suf[(int)arr[u].size() + 1] = 1;
    for(int i = (int)arr[u].size() - 1; i >= 0; i--){
        int v = arr[u][i];
        suf[i + 1] = suf[i + 2];
        if(v == par) continue;
        suf[i + 1] = (suf[i + 1] * (dp[v] + 1)) % mod;
    }
    for(int i = 0; i < (int)arr[u].size(); i++){
        int v = arr[u][i];
        if(v == par) continue;
        parent[v] = pref[i] * suf[i + 2] % mod;
    }
    for(ll i=0;i<arr[u].size();i++)
    {
        ll v = arr[u][i];
        if(v!=par)
        {
            // pparent[v] = ((1+pparent[u])*max(1LL,parent[v]))%mod;
            dfsup(v,u);
        }
    }
}
void dfs1(ll u,ll par)
{
    
     if(par!=0)
        pparent[u] = ((1+pparent[par])*parent[u])%mod;
    ll i;
    for(i=0;i<arr[u].size();i++)
    {
        ll v = arr[u][i];
        if(v!=par)
        {
            // pparent[v] = ((1+pparent[u])*max(1LL,parent[v]))%mod;
            dfs1(v,u);
        }
    }
}
signed main()
{
    fast;
    ll n;
    cin>>n>>mod;
    ll i;
    for(i=0;i<n-1;i++)
    {
        ll u,v;
        cin>>u>>v;
        arr[u].pb(v);
        arr[v].pb(u);
    }
    dfs(1,0);
    dfsup(1,0);
    dfs1(1,0);
    for(i=1;i<=n;i++)
    {
        // cout<<dp[i]<<" "<<parent[i]<<" "<<pparent[i]<<endl;
        cout<<(dp[i]*(1+pparent[i]))%mod<<"\n";
    }
}


Measured memory_bytes: 41716
#include <bits/stdc++.h>
#define int long long
#define all(c) (c).begin(),(c).end()

using namespace std;

signed main()
{
int n,m,A;
A=0;
cin>>n>>m;
vector<int> a(n,0);
for(int i=0; i<n; i++){
	cin>>a[i];
}
int sum =0;
for(int i=0; i<n; i++){
	sum = sum+a[i];
}
int p = 4*m;
int val = sum/p;
bool b  = sum%p;
sort(all(a));
if(b){
	val++;
}

if(a[n-m]<val){
	cout<<"No";
}
else{
	cout<<"Yes";
}

}
	


Measured memory_bytes: 256
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF (1 << 29) * 2
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  double n, d;
  scanf("%lf%lf", &n, &d);
  printf("%d\n", (int)ceil(n / (2 * d + 1)));
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main()
{
    string s;
    cin >> s;
    if(s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I')
    {
        cout << "Yes\n";
    }
    else
    {
        cout << "No\n";
    }
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	cout << (n * (n - 1) + m * (m - 1) )/2<< endl;
	return 0;
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main() {
	int A, B, C, X, tmp;
	int ways = 0;
	cin >> A >> B >> C >> X;
	for (int i = 0; i <= A; i++) {
		
		for (int j = 0; j <= B; j++) {
		
			for (int k = 0; k <= C; k++) {
				if (50 * k + 100 * j + 500 * i == X) ways++;
			}
		}
	}

	cout << ways << endl;

	return 0;
}


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

#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

using namespace std;

typedef long long int lli;

vector<int> st;
int index;

bool calc(vector<vector<int>> &t, int pos, int bef) {
    if (pos == 0) return true;
    for (auto T : t[pos]) {
        if (T != bef) {
            st[index++] = T;
            if (calc(t, T, pos)) return true;
            index--;
        }
    }
    return false;
}

int countTree(vector<vector<int>> &t, int pos, int bef) {
    int cnt = 0;
    for (auto T : t[pos]) {
        if (T != bef) {
            cnt += countTree(t, T, pos);
        }
    }
    return cnt + 1;
}

int main () {
    int N;
    cin >> N;
    vector<vector<int>> Tree(N);
    REP (i, 0, N - 1) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        Tree[a].push_back(b);
        Tree[b].push_back(a);
    }
    st.resize(N);
    index = 1;
    st[0] = N - 1;
    calc(Tree, N - 1, -1);

    int a = st[index / 2 - 1];
    int b = st[index / 2];
    Tree[a].erase(find(Tree[a].begin(), Tree[a].end(), b));
    Tree[b].erase(find(Tree[b].begin(), Tree[b].end(), a));
    int x = countTree(Tree, 0, -1);
    int y = countTree(Tree, N - 1, -1);
    cout << (x > y ? "Fennec" : "Snuke") << endl;
    return 0;
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n;cin >> n;
    map<int,int> s;
    ll res = 0;
    rep(i,n){
        int m; cin >> m;
        s[m]++;
    }
    for(auto a:s){
        if(a.second % 2)res+= 1;
    }
    cout << res << endl;
}


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

class BIT {
		vector<int> dat;
		int const N;
	public:
		BIT(int N) : N(N), dat(N+1, 0) {}
		void add(int k, int a) {
			while (k <= N) {
				dat[k] += a;
				k += k & -k;
			}
		}
		int sum(int k) {
			int res = 0;
			while (k >= 1) {
				res += dat[k];
				k -= k & -k;
			}
			return res;
		}
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int n, q;
	cin >> n >> q;
	BIT rsq(n);
	for (auto i = 0; i < q; i++) {
		int c, x, y;
		cin >> c >> x >> y;
		if (c) cout << rsq.sum(y)-rsq.sum(x-1) << endl;
		else rsq.add(x, y);
	}
	return 0;
}

Measured memory_bytes: 1524
#17:24
h,w = map(int,input().split())
n = int(input())
c = list(map(int,input().split()))
ans1 = []
for i in range(n):
  ans1 += [i+1] * c[i]
ans2 = []
for x in range(h):
  ans2.append(ans1[w*x:w*(x+1)])
for x in range(h):
  if x % 2 == 1:
    ans2[x].reverse()
#print(ans1)
#print(ans2)
for x in range(h):
  print(' '.join(list(map(str,ans2[x]))))

Measured memory_bytes: 39664
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
using namespace std;
#define ll long long
#define pb push_back
#define pll pair<ll,ll> 
#define mll map<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0; i<n; i++)
#define All(x,v) for(auto x:v)
#define arrin(a,n) ll a[n]; rep(i,n) cin>>a[i]
#define vi vector<int>
#define nl "\n"
#define print(arr) All(x,arr) cout<<x<<" "; cout<<nl
#define sz(x) (int)x.size()
#define all(v) v.begin(),v.end()
#define ing(m,ad) rep(i,m){ int u,v; cin>>u>>v; u--;v--; ad[u].pb(v); ad[v].pb(u);}
#define vdsort(v) sort(v.begin(),v.end(),greater<int>())
#define F first
#define S second
#define mod (ll)100000000007
const int MAXN=100001;
int spf[MAXN];
int gcd(int x, int y){ return y?gcd(y,x%y):x; }

void precal(){  
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++)  spf[i] = i; 
    for (int i=4; i<MAXN; i+=2) spf[i] = 2; 
    for (int i=3; i*i<MAXN; i++) { 
        if (spf[i] == i) 
            for (int j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j)  spf[j] = i; 
    } 
} 
vector<int> getFactorization(int x){
    vector<int> ret; 
    while (x != 1) { 
        ret.push_back(spf[x]); 
        x = x / spf[x]; 
    } 
    return ret; 
}

ll exp(ll n, ll m){
    ll a = 1;
    while (m){
        if (m & 1) a = (a * n % mod) % mod;
        m /= 2;
        n = (n*n) % mod;
    }
    return a;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    // freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ll n,k,t=1;
    // cin>>t;
    while(t--){
        cin>>n>>k;
        arrin(h,n);
        ll dp[n];
        rep(i,n) dp[i]=mod;
        dp[0]=0; dp[1]=abs(h[1]-h[0]);
        for(int i=2; i<n; i++){
            for(int j=1;j<=k;j++){
                if(i-j>=0) dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]));
            }
        }
        cout<<dp[n-1]<<nl;
    }
    return 0;
}

Measured memory_bytes: 4736
#include <bits/stdc++.h>
using namespace std;
int main(){
    int R,G,B,N;
    cin>>R>>G>>B>>N;
    long long count=0;
    for(int i=0;i<=N/R;i++){
        for(int j=0;j<=N/G;j++){
            if((N-i*R-j*G)%B==0&&(N-i*R-j*G)>=0){count++;}
        }
    }
    cout<<count<<endl;
}

Measured memory_bytes: 256
#pragma warning( disable : 6031)

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <math.h>
int minimum(int a, int b) { return a < b ? a : b; }
int maximum(int a, int b) { return a > b ? a : b; }
const long long mod = 1000000007;
//const long long mod = 998244353;
using std::vector;
using std::pair;
using std::string;
using std::map;
using std::abs;
int main() {
	char S[15], T[15];
	scanf("%s", S);
	scanf("%s", T);
	bool yes = true;
	for (int i = 0; T[i] != 0; i++) {
		if (S[i] != T[i]) {
			if (S[i] == 0 && T[i + 1] == 0) {
				yes = true;
				break;
			}
			else {
				yes = false;
				break;
			}
		}
	}
	printf(yes ? "Yes" : "No");
	return 0;
}

Measured memory_bytes: 1736
#include<bits/stdc++.h>
using namespace std;
int main(){

  int A;
  int B;
  
  cin >> A;
  cin >> B;
  
  if(A == 1 && B == 2 || A == 2 && B == 1){
    cout << '3' << endl;
  }
  else if(A == 1 && B == 3 || A == 3 && B == 1){
    cout << '2' << endl;
  }
  else{
    cout << '1' << endl;
  }
  
}

Measured memory_bytes: 256
// #define DEBUGGING
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return max(low, min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { t = clamp(t, low, high); }

namespace init__ {

struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifdef DEBUGGING
#include "../debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

template <typename T>
T make_v(T init) { return init; }

template <typename T, typename... Tail>
auto make_v(T init, size_t s, Tail... tail) {
#define rec make_v(init, tail...)
    return V<decltype(rec)>(s, rec);
#undef rec
}

int main() {
    ll W, H, x, y;
    cin >> W >> H >> x >> y;
    double ans = W * H / 2.0;
    cout << ans << ' ';
    if(x * 2 == W && y * 2 == H) cout << 1;
    else cout << 0;
    cout << endl;
    return 0;
}


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

using namespace std;

typedef long long ll;

const int INF = 1000000000;

int main()
{
  int N; scanf("%d", &N);
  vector<ll> A(N);
  for (int i = 0; i < N; ++i) {
    scanf("%lld", &A[i]);
  }
  ll sum = 0;
  ll ans = 0;
  for (int l = 0, r = 0; l < N; ++l) {
    // while (r < N and (sum + A[r]) == (sum ^ A[r])) {
    while (r < N and (sum & A[r]) == 0) {
      sum ^= A[r];
      ++r;
    }
    ans += (r - l);
    if (l == r) { ++r; }
    else { sum ^= A[l]; }
  }
  printf("%lld\n", ans);
  return 0;
}


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

int main(){
  int n,m;cin>>n>>m;
  vector<bool> a(n+1,true);
  for(int i=0;i<n;i++){int aa;cin>>aa;a.at(aa)=false;}
  
  vector<ll> ans(n+1,0);
  ans.at(0)=1;
  if(a.at(1))ans.at(1)=1;
  else ans.at(1)=0;
  for(int i=2;i<=n;i++){
    if(!a.at(i))ans.at(i)=0;
    else ans.at(i)=(ans.at(i-1)+ans.at(i-2))%1000000007;
  }
  
  cout<<ans.at(n)<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;

using namespace std;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main(){
    int x,n; cin >> x >> n;
    unordered_set<int> us;
    rep(i, n) {
        int a; cin >> a;
        us.insert(a);
    }
    for(int i = 0; i < 200; i++) {
        if(us.find(x-i) == us.end()) {
            cout << x-i << endl;
            return 0;
        }
        if(us.find(x+i) == us.end()) {
            cout << x + i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 3636
main :: IO ()
main = getLine >>= \nn -> getLine >>= \s -> let [n,a,b] = (map read) $ words nn in mapM_ putStrLn $ solve (a+b) a b 0 0 s
--  where
    -- n = head ss
    -- a = undefined
    -- b = undefined

solve :: Int -> Int -> Int -> Int -> Int -> String -> [String]
solve _ _ _ _ _ []     = []
solve n a b a0 b0 (s:ss)
  | s == 'c'                        = "No"  : (solve n a b a0 b0 ss)
  | s == 'a' && a0+b0 < n           = "Yes" : (solve n a b (a0+1) b0 ss)
  | s == 'b' && a0+b0 < n && b0 < b = "Yes" : (solve n a b a0 (b0+1) ss)
  | otherwise                       = "No" : (solve n a b a0 b0 ss)

Measured memory_bytes: 5372
using System;
class AOJ
{
    public static void Main()
    {
        while (true)
        {
            string[] st = Console.ReadLine().Split(' ','\n');
            int a = int.Parse(st[0]);
            int b = int.Parse(st[1]);
            if (a == 0 && b == 0)
                break;
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j < b; j++)
                {if (i == 0 || i == a - 1 || j == 0 || j == b - 1)
                        Console.Write("#");
                    else
                        Console.Write(".");

                }
                Console.WriteLine();
            }
            Console.WriteLine();
       

        }
    }
}

Measured memory_bytes: 8844
#include <stdio.h>

int main(void)
{
	int N,i,x[1000],max=0,min,a;
	scanf("%d",&N);
	for (i=1;i<=N;i++){
		scanf("%d",&x[i]);
		if(max<x[i]){
			max=x[i];
		}
		if(min>x[i]){
			min=x[i];
		}
	}
	a=(max-min+1)/2;
	printf("%d\n",a);
	return 0;
}


Measured memory_bytes: 2756
n = int(input())
a = [int(x) for x in input().split()]
mod = 10**9+7


def inv(a, mod):
    r = [1, 0, a]
    w = [0, 1, mod]
    while w[2] != 1:
        q = r[2]//w[2]
        r_new = [r[0]-q*w[0], r[1]-q*w[1], r[2]-q*w[2]]
        r = w
        w = r_new
    x, y = w[0], w[1]    # a*x+y*mod = 1
    return (mod+x % mod) % mod


fact = [1, 1]
s = [1]

for i in range(2, n+2):
    fact.append(fact[-1]*i % mod)
    s.append(inv(i, mod))

ss = [1]
for x in s[1:]:
    ss.append((x+ss[-1])%mod)

ans = 0

for i in range(n):
    ans += a[i]*(ss[abs(i)]+ss[abs(n-1-i)]-1)
    ans %= mod

ans *= fact[n]
ans %= mod

print(ans)


Measured memory_bytes: 75160
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s,ans;
    cin>>s;
    for(int i=0; i<s.length() ; i++){
        if(s[i]=='B'){
            if(!ans.empty()){
                s.erase(s.begin()+i);
                ans.erase(ans.end()-1);
                i--;
            }
        }else{
            ans.insert(ans.end(),s[i]);
        }
    }
    cout <<ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
// 2013/11/08 Tazoe

#include <iostream>
using namespace std;

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

	int E = A/C;
	if(A%C!=0){
		E++;
	}

	int F = B/D;
	if(B%D!=0){
		F++;
	}

	int G;
	if(E>=F){
		G = L-E;
	}
	else{
		G = L-F;
	}

	cout << G << endl;

	return 0;
}

Measured memory_bytes: 1164
X , Y = map(int, input().split())
flag = 0
for x in range(X+1):
    for y in range(X+1):
        if x + y == X and 2 * x + 4 * y == Y:
            flag = 1
            break
    if flag == 1:
        break
if flag == 0:
    print("No")
else:
    print("Yes")

Measured memory_bytes: 9180
#include <iostream>
#include <cmath>
#include <iomanip>

int main() {
  int A, B, H, M;
  std::cin >> A >> B >> H >> M;

  const double hour_theta = static_cast<double>(H * 60 + M) / (12 * 60) * 2 * M_PI;
  const double minute_theta = static_cast<double>(M) / 60 * 2 * M_PI;

  const double diff_cos = A * std::cos(hour_theta) - B * std::cos(minute_theta);
  const double diff_sin = A * std::sin(hour_theta) - B * std::sin(minute_theta);
  std::cout << std::fixed << std::setprecision(10) << std::sqrt(diff_cos * diff_cos + diff_sin * diff_sin) << std::endl;

  return 0;
}


Measured memory_bytes: 4064
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    A--; B--; C--; D--;
    string S; cin >> S;
    if (C < D) {
        REP(i, B, D - 1) {
            if (S[i] == '#' && S[i + 1] == '#') {
                cout << "No" << endl;
                return 0;
            }
        }
        REP(i, A, C - 1) {
            if (S[i] == '#' && S[i + 1] == '#') {
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
    }
    else if (C > D) {

        REP(i, A, C - 1) {
            if (S[i] == '#' && S[i + 1] == '#') {
                cout << "No" << endl;
                return 0;
            }
        }
        bool ok = false;
        REP(X, B, D) {
            if (X - 1 < 0 || X + 1 >= N) continue;
            if (S[X - 1] == '.' && S[X] == '.' && S[X + 1] == '.') {
                ok = true;
            }
        }
        if (!ok) {
            cout << "No" << endl;
            return 0;
        }
        cout << "Yes" << endl;
    }

    return 0;
}


Measured memory_bytes: 592
using System;
using System.Linq;

class P {
  static void Main() {
    var s = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    int A = s[0];
    int B = s[1];
    int T = s[2];
    int p = T / A;
    Console.WriteLine(p * B);
  }
}

Measured memory_bytes: 11220
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
# import numpy as np
# import scipy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]


def main():
    h = inp()
    w = inp()
    n = inp()
    if h < w:
        h,w = w,h
    for i in range(w+1):
        if i*h>=n:
            print(i)
            return

if __name__ == "__main__":
    main()

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

int max3(int a, int b, int c){
    int best;
    if (a>=b){
        best=a;
    }
    else{
        best=b;
    }
    if (c>=best){return c;}
    else{return best;}
}

int main()
{
    int a;
    int b;
    int c;
    cin>>a>>b>>c;
    if(max3(a,b,c)==a){
        a=10*a;
    }
    else if(max3(a,b,c)==b){
        b=10*b;
    }
    else{
        c=10*c;
    }
    cout<<a+b+c;
}


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

using namespace std;

int main()
{
  vector<double> left_eye;
  vector<double> right_eye;

  int result1[4] = {0};
  int result2[4] = {0};

  double a,b;

  while(cin>>a>>b){
    left_eye.push_back(a);
    right_eye.push_back(b);
  }

  for(double e : left_eye){
    if(e >= 1.1){
      result1[0] += 1;
    }
    else if(e >= 0.6 && e < 1.1){
      result1[1] += 1;
    }
    if(e >= 0.2 && e < 0.6){
      result1[2] += 1;
    }
    if(e < 0.2){
      result1[3] += 1;
    }
  }

  for(double e : right_eye){
    if(e >= 1.1){
      result2[0] += 1;
    }
    else if(e >= 0.6 && e < 1.1){
      result2[1] += 1;
    }
    if(e >= 0.2 && e < 0.6){
      result2[2] += 1;
    }
    if(e < 0.2){
      result2[3] += 1;
    }
  }

  for(int i = 0;i < 4;++i){
    cout<<result1[i]<<" "<<result2[i]<<endl;
  }

  return 0;
}


Measured memory_bytes: 3080
#include <cstdio>
#include <string>
#include <iostream>

using namespace std;
string s;
int ans;

int main() {
	cin >> s;

	if (s[0] == '1') ans++;
	if (s[1] == '1') ans++;
	if (s[2] == '1') ans++;

	printf("%d\n", ans);

	return 0;
}

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

// short names
typedef long long ll;
#define down_queue(...) priority_queue<__VA_ARGS__>
#define up_queue(...) priority_queue<__VA_ARGS__, vector<__VA_ARGS__>, greater<__VA_ARGS__>>
#define all(x) x.begin(), x.end()
#define rall(x) x.begin(), x.end(), greater<int>()
#define split_str(str, sp_word) istringstream stream(str); string res; for(int cnt = 0; getline(stream,res,sp_word); cnt++)
#define digit(x) ((int)log10((double)(x)) + 1)
#define mp(...) make_pair(__VA_ARGS__)
#define pb(...) push_back(__VA_ARGS__)
#define pf(...) push_front(__VA_ARGS__)
vector<int> digit_split(int n){vector<int> result(digit(n));for(int i = 0; n; i++){result[i] = n % 10;n /= 10;}return result;}
#define vec_cpy(to,from) copy(all(to),back_inserter(from))
#define ary_cpy(to,from) memcpy(to, from, sizeof(from))
#define MOD 1000000007 

// math
ll gcd(ll a,ll b){while(b){ll tmp = a % b;a = b;b = tmp;}return a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
bool is_prime(ll n){switch(n){case 0:case 1: return false;case 2: return true;}if(n % 2 == 0) return false;for(ll i=3;i * i <= n; i += 2)if(n%i == 0) return false;return true;}
string to_qn(ll quaternary, ll from){string result = "";if(!from) return "0";else{while(from){result = (char)((from % quaternary) + '0') + result;from /= quaternary;}return result;}}

int main(){
  string in;
  cin >> in;
  cout << count(all(in), '1');
}

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

using namespace std;

int main(void){
	int n,i,ans=1,temp;
	string order;
	while(cin >> n){
	if(n == 0)break;
//	cin >> n;
	int dice[6] = {1,2,3,5,4,6};
	for(i=0;i<n;i++){
		cin >> order;
		if(order == "North"){
			temp = dice[0];
			dice[0] = dice[1];
			dice[1] = dice[5];
			dice[5] = dice[3];
			dice[3] = temp;
			ans += dice[0];
		}
		else if(order == "East"){
			temp = dice[0];
			dice[0] = dice[4];
			dice[4] = dice[5];
			dice[5] = dice[2];
			dice[2] = temp;
			ans += dice[0];
		}
		else if(order == "West"){
			temp = dice[0];
			dice[0] = dice[2];
			dice[2] = dice[5];
			dice[5] = dice[4];
			dice[4] = temp;
			ans += dice[0];
		}
		else if(order == "South"){
			temp = dice[0];
			dice[0] = dice[3];
			dice[3] = dice[5];
			dice[5] = dice[1];
			dice[1] = temp;
			ans += dice[0];
		}
		else if(order == "Right"){
			temp = dice[1];
			dice[1] = dice[2];
			dice[2] = dice[3];
			dice[3] = dice[4];
			dice[4] = temp;
			ans += dice[0];
		}
		else if(order == "Left"){
			temp = dice[1];
			dice[1] = dice[4];
			dice[4] = dice[3];
			dice[3] = dice[2];
			dice[2] = temp;
			ans += dice[0];
		}
	}
	cout << ans << endl;
	ans =1;
	}
	return 0;
}

Measured memory_bytes: 1208
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]

b[n//2] = a[0]
idx = n - 1
for i in range(0, n//2):
    b[i] = a[idx]
    idx -= 2

idx = 1 + (n+1) % 2
for i in range(n//2+1, n):
    b[i] = a[idx]
    idx += 2

print(" ".join([str(i) for i in b]))


Measured memory_bytes: 29764
import java.io.*;
import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        
        int[][][] people = new int[4][3][10];
        int n = sc.nextInt();
        
        for (int i = 0; i < n; i++) {
            int b = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            int v = sc.nextInt();
            
            people[b-1][f-1][r-1] += v;
        }
        
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                for (int k = 0; k < 10; k++) {
                    if (k != 9) {
                        System.out.printf(" %d", people[i][j][k]);
                    }
                    else {
                        System.out.printf(" %d\n", people[i][j][k]);
                    }
                }
            }
            if (i != 3) {
                System.out.println("####################");
            }
        }
    }
}

Measured memory_bytes: 30596
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	int ans=0;
	cin >>n;
	cout<<n*n<<endl;
}

Measured memory_bytes: 3624
from itertools import accumulate

N, K = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(lambda x: (x+1)/2, P))

Q_cum = list(accumulate([0] + Q))
res = 0
for i in range(N-K+1):
    temp = Q_cum[i+K]- Q_cum[i]
    res = max(res, temp)
print(res)

Measured memory_bytes: 115920
#include<stdio.h>
int main(void){
    int n;
    scanf("%d",&n);
    int a[n];
    int i;
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    printf("%d",a[n-1]);
    for(i=n-2;i>=0;i--){
        printf(" %d",a[i]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int n; cin>>n;
    vector<P> A(n);
    rep(i,n) {
        ll p; cin>>p;
        A[i].first = p;
        A[i].second = i; 
    }

    sort(A.begin(), A.end(), greater<>());
    multiset<int> st;
    st.insert(-1); st.insert(-1);
    st.insert(n); st.insert(n);

    ll ans = 0;

    rep(i,n) {
        int k = A[i].second;
        ll val = A[i].first;
        auto b = st.upper_bound(k); --b;
        auto c = st.upper_bound(k);
        auto a = prev(b);
        auto d = next(c);

        // cout << "b = " << *b << ", c = " << *c << '\n';

        ll ltmp = (*b-*a) * (*c-k);
        ll rtmp = (*d-*c) * (k-*b);
        // cout << "ltmp = " << ltmp << '\n';
        // cout << "rtmp = " << rtmp << '\n';
        ll tmp = (ltmp+rtmp)*val;
        // cout << "tmp = " << tmp << '\n';
        ans += tmp;
        st.insert(k);
    }

    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 6528
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#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 <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
// #pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=(1LL<<60);
const ld pi=acosl((ld)1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"

bool solve(){
  ll a,b,c;cin>>a>>b>>c;
  ll x=(ld)2*sqrtl(a*b);
  if(a+b+x<c)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return false;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout<<fixed;
	cout<<setprecision(30);
  // ll Q;cin>>Q;
	// while(Q--)solve();
  solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void fast(){
cin.tie(0);
cin.sync_with_stdio(0);
}
long long gcd(long long a, long long b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
long long gcd_t(long long a,long long b,long long c)
{
    return gcd(a,gcd(b,c));
}
int main()
{
    fast();
    int n;long long s=0;cin>>n;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            for(int k=1;k<=n;k++)
            {

                s+=gcd_t(i,j,k);
            }
        }
    }
cout<<s;
return 0;
}


Measured memory_bytes: 3600
#include <stdio.h>
int main(){
  int n;
  scanf("%d",&n);
  if ((n/100) % 10 == 1)
    n += 800;
  else
    n -= 800;
  if ((n/10) % 10 == 1)
    n += 80;
  else
    n -= 80;
  if (n % 10 == 1)
    n += 8;
  else
    n -= 8;
  printf("%d\n",n);
  return 0;
}


Measured memory_bytes: 128
// Author :
// Date :
// Problem:
// Solution:
// Comment:

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstring>

#define pp push
#define pb push_back
#define mp make_pair
#define xx first
#define yy second

using namespace std;

vector < pair <int,int> > pts;

main(){
    int n , m;
    int x , y;
    
    scanf("%d%d",&n,&m);
    
    for(int i = 0 ; i < n ; i++){
        scanf("%d %d",&x,&y);
        pts.pb(mp(x,y));
    }
    
    int xx,yy;
    
    sort( pts.begin() , pts.end() );
    
    for(int i = 0 ; i < m ; i++){
        int cnt = 0;
        
        scanf("%d %d %d %d",&x,&y,&xx,&yy);
        
        for(int j = 0 ; j < n ; j++){
            if(x <= pts[j].xx && xx >= pts[j].xx && y <= pts[j].yy && yy >= pts[j].yy){
                cnt++;
            }
            if(x > pts[j].xx && xx < pts[j].xx) break;
        }
        printf("%d\n",cnt);
    }

    #ifdef GEREL
        for(;;);
    #endif

    return 0;
}

Measured memory_bytes: 1300
// ------------------------------------
// Date:2018/ 4/14
// Problem:/ / / c.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

int N;

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

  cin >> N;
  vector< int > X(N);
  REP(i, N)
    cin >> X[i];

  vector< int > tmp(X);
  sort(ALL(tmp));

  REP(i, N) {
    int center = tmp[N / 2 - 1];
    if (X[i] <= center) {
      center = tmp[N / 2];
    }
    cout << center << endl;
  }
  

  return 0;
}



Measured memory_bytes: 3840
S = input()
N = len(S)

L = "abcdefghijklmnopqrstuvwxyz"

ans = 10**9
for s in L:
    X = S
    res = ""
    cnt = 0
    while(1):
        res = ""
        if X.count(s)==len(X):
            break
        for i in range(len(X)-1):
            if X[i]==s or X[i+1]==s:
                res += s
            else:
                res += X[i]
        X = res
        cnt += 1
    ans = min(ans,cnt)

print(ans)

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

using namespace std;

int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    int ai=a[n-1];
    int index=lower_bound(a,a+n,ai/2)-a;
    if(a[index]==ai/2){
        cout<<ai<<" "<<a[index]<<endl;
        return 0;
    }
    if(a[index]<ai && a[index-1]<=ai-a[index]){
        cout<<ai<<" "<<a[index]<<endl;
    }
    else{
        cout<<ai<<" "<<a[index-1]<<endl;
    }
    return 0;
}

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

using namespace std;
using ll = long long;


int main()
{
    char c;
    cin >> c;
    cout << (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o' ? "vowel" : "consonant") << endl;
}

Measured memory_bytes: 256