akhauriyash/Code-Regression huggingface dataset:
H,W=map(int,input().split())

M=[list(map(int,input().split())) for i in range(H)]

LIST=[]

for i in range(H):
    for j in range(W-1):
        if M[i][j]%2==1:
            LIST.append((i+1,j+1,i+1,j+2))
            M[i][j]-=1
            M[i][j+1]+=1


for i in range(H-1):
    if M[i][W-1]%2==1:
        LIST.append((i+1,W,i+2,W))
        M[i][W-1]-=1
        M[i+1][W-1]+=1


print(len(LIST))

for i in LIST:
    print(i[0],i[1],i[2],i[3])


Measured memory_bytes: 26996
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

int main() {
    ll a, b, q;
    cin >> a >> b >> q;

    vl s(a+2), t(b+2);
    s[0] = t[0] = -INF;
    exrep(i, 1, a) {
        cin >> s[i];
    }
    exrep(i, 1, b) {
        cin >> t[i];
    }
    s[a+1] = t[b+1] = INF;
    
    vvl u(2, vl(2));
    vl ans(q, INF);
    rep(h, q) {
        ll x;
        cin >> x;

        ll sepos = lower_bound(all(s), x) - s.begin(); 
        u[0][1] = s[sepos];
        u[0][0] = s[sepos-1];

        ll tepos = lower_bound(all(t), x) - t.begin();  
        u[1][1] = t[tepos];
        u[1][0] = t[tepos-1];

        rep(i, 2) {
            rep(j, 2) {
                rep(k, 2) {
                   ll dist = 0;
                   dist += abs(u[i][j] - x) + abs(u[i][j] - u[i^1][k]);
                   ans[h] = min(ans[h], dist);
                }
            }
        }
    }
    
    rep(i, q) {
        out(ans[i]);
    }
    
    re0;
}

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

const int mod = 1e9 + 7;

string g[1000];

long long int power(long long int x,long long int b){
	long long int res=1;
	while(b){
		if(b&1)	res=res*x%mod;
		x=x*x%mod;
		b>>=1;
	}
	return res;
}

template<int sz>
struct Matrix{
	long long int a[sz][sz];
	Matrix(){
		for(int i=0;i<sz;i++)
			for(int j=0;j<sz;j++)
				a[i][j]=0;
	}
	Matrix<sz> operator*(const Matrix<sz>& rhs)const{
		Matrix<sz> C;
		for(int i=0;i<sz;i++)
			for(int j=0;j<sz;j++)
				for(int k=0;k<sz;k++)
					C.a[i][j]=(C.a[i][j]+a[i][k]*rhs.a[k][j])%mod;
		return C;
	}
	void exp(long long int b){
		Matrix<sz> X=*this;
		Matrix<sz> res;
		for(int i=0;i<sz;i++)
			res.a[i][i]=1;
		while(b){
			if(b&1)	res=res*X;
			X=X*X;
			b>>=1;
		}
		*this=res;
	}
};

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int H,W;
	long long int K;
	cin>>H>>W>>K;
	for(int i=0;i<H;i++)
		cin>>g[i];
	if(K==0||K==1){
		cout<<1<<endl;
		return 0;
	}
	int black=0;
	for(int i=0;i<H;i++)
		for(int j=0;j<W;j++)
			black+=g[i][j]=='#';
	int LR=0,UD=0,lr=0,ud=0;
	for(int i=0;i<H;i++)
		if(g[i][0]=='#'&&g[i][W-1]=='#')
			LR++;
	for(int j=0;j<W;j++)
		if(g[0][j]=='#'&&g[H-1][j]=='#')
			UD++;
	for(int i=0;i<H;i++)
		for(int j=0;j<W;j++){
			if(i!=0&&g[i][j]=='#'&&g[i-1][j]=='#')
				ud++;
			if(j!=0&&g[i][j]=='#'&&g[i][j-1]=='#')
				lr++;
		}
	if(LR&&UD)
		cout<<1<<endl;
	else if(!LR&&!UD)
		cout<<power(black,K-1)<<endl;
	else{
		if(UD){
			swap(LR,UD);swap(lr,ud);
		}
		Matrix<2> M;
		M.a[0][0]=black;
		M.a[0][1]=mod-lr;
		M.a[1][0]=0;
		M.a[1][1]=LR;
		M.exp(K-1);
		cout<<(M.a[0][0]+M.a[0][1])%mod<<endl;
	}
}


Measured memory_bytes: 1280
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys
from decimal import *
#input = sys.stdin.readline


#N=int(input())

#A=list(map(int,input().split()))
#XY=[list(map(int,input().split())) for i in range(N)]

a,b,c=map(int,input().split())
X=gcd(gcd(a,b),c)
c//=X
a//=X
b//=X
getcontext().prec = 500
c=Decimal(c).sqrt()
b=Decimal(b).sqrt()
a=Decimal(a).sqrt()

if c-a-b>0.0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 6096
#include <cstdio>
#include <cstdint>
#include <cinttypes>
#include <iostream>
#include <vector>
#include <utility>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
using namespace std;
using u8t = std::uint64_t;
using i8t = std::int64_t;
#define F(I,N) for(i8t I=0,I##_N=N;I<I##_N;I++)
#define FR(I,N) for(i8t I=N;I--;)
#define R(V) i8t V;std::cin>>V;
#define RV(V,N) std::vector<i8t> V;F(_i,N){R(_x)V.push_back(_x);}
#define RL1(line) std::getline(std::cin,line);
#define RL(line) std::string line;RL1(line)
#define RM(V,L,C) std::vector<char> V;F(_i,L){RL(_l)F(_j,C)V.push_back(_l[_j]);}
#define P(X) std::cout<<(X)<<std::endl;
int main() {
  R(N);
  i8t sum=0;
  F(I,N+1){
    if(I%5==0||I%3==0)continue;
    sum+=I;
  }
  P(sum);
  return 0;
}


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

#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pi 3.14159265

using namespace std;
#define prime 1000000007

const ll N = 300005;

#define W(x) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << "\n";

int n, x, a, b, t;
int v[300100];

using namespace std;

int ce(int a, int b){
	return (a+b-1)/b;
}

int main(){
	cin >> a >> b >> t;

	printf("%d\n", (t/a) * b);
		
	return 0;
}

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



typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define MOD 1000000007
// #define MOD 998244353
// #define MOD LLONG_MAX
const double PI=3.14159265358979323846;

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 (b<a) { a=b; return 1; } return 0; }




int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0,};




void printv(vint &v){
  for(auto e:v) cout<<e<<" ";
  cout<<endl;
}


int main() {


  cout<<fixed<<setprecision(10);

  ll a,b; cin>>a>>b;
  if(b%a == 0) cout<<a+b<<endl;
  else cout<<b-a<<endl;


}

//


Measured memory_bytes: 256
#include <cmath>
#include <cstdio>

#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <numeric>
#include <string>
#include <array>

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) x.begin(), x.end()

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a.at(i);

  sort(all(a));
  ll lhf = *max_element(all(a));
  ll rhf_abs=100000000000000007;
  ll rhf =0;
  rep(i, lhf%2 +1){
    ll lhfdiv2 = lhf/2 + i;
    rep (i, n) {
      if (rhf_abs > abs(a.at(i)-lhfdiv2)){
        rhf_abs = min(rhf_abs, abs(a.at(i) - lhfdiv2));
        rhf = a.at(i);
      }
    }
  }
  cout << lhf << " " << rhf << endl;


  return 0;
}

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

using namespace std;
#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define w first
#define b second
#define lb lower_bound
#define ub upper_bound
#define pii pair < int, int >
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 

int n;
vector < int > g[N], ch[N];
vector<pii> pf[N], sf[N];
pair < int, int > dp1[N]; //Down
pair < int, int > dp2[N]; // Up

int mult (int a, int b) {
	return a * (ll)b % mod;
}

int add (int a, int b) {
	a += b;
	if (a >= mod) a -= mod;

	return a;
}

pair < int, int > mer (pii a, pii b) {
	pii p;
	p.w = mult(a.w, b.w);
	p.b = add(mult(a.w, b.b), mult(a.b, add(b.w, b.b)));
	return p;
}

pii calc (pii x) {
	x.b = add(x.w, x.b);
	return x;
}

void dfs (int v, int pr = 0) {
	pair < int, int > cur = {1, 0};
	for (auto to : g[v]) if (to != pr) {
		dfs(to, v);
		ch[v].pb(to);
		cur = mer(cur, dp1[to]);
	}
	dp1[v] = calc(cur);
}

void go (int v) {
	for (int i = 0; i < ch[v].size(); i ++) {
		pair < int, int > cur = {1, 0};
		if (i > 0) cur = mer(cur, pf[v][i-1]);
		if (i < sz(ch[v]) - 1) cur = mer(cur, sf[v][i+1]);
		if (v != 1) cur = mer(cur, dp2[v]);
		auto to = ch[v][i];
		dp2[to] = calc(cur);
		go(to);
	}
}

int main () {
   	SpeedForce;

   	cin >> n >> mod;
   	for (int i = 1; i < n; i ++) {
   		int l, r;
   		cin >> l >> r;
   		g[l].pb(r);
   		g[r].pb(l);
   	}

   	dfs(1);

   	for (int v = 1; v <= n; v ++) {
   		pair < int, int > cur = {1, 0};
   		for (auto to : ch[v]) {
   			cur = mer(cur, dp1[to]);

   			pf[v].pb(cur);
   		}
   		cur = {1, 0};

   		for (int i = sz(ch[v]) - 1; i >= 0; i --) {
   			auto to = ch[v][i];
   			cur = mer(cur, dp1[to]);
   			sf[v].pb(cur);
   		}
   		reverse(sf[v].begin(), sf[v].end());
   	}

   	go(1);

   	for (int i = 1; i <= n; i ++) {
   		pair < int, int > cur = {1, 0};
   		if (ch[i].size()) cur = mer(cur, pf[i].back());
   		if (i != 1) cur = mer(cur, dp2[i]);
   		cur = calc(cur);

   		cout << cur.b << '\n';
   	}

	
   	return Accepted;
}

// B...a

Measured memory_bytes: 79616
/// However long the night,
///     The dawn will break
/// ICPC next year

#pragma gcc optimize("03")
#include<bits/stdc++.h>
using namespace std ;
const int N = 5e2+5 ;

int n ,k ,a[N] ;
long long sum ,cur[N] ;
bool ok(long long x){
    vector<long long> v ;
    for(int i=0;i<n;++i) v.push_back(a[i]%x);
    sort(v.begin(),v.end());
    for(int i=n-1;i>=0;--i) cur[i] = cur[i+1] + x - v[i] ;
    long long cur1=0 ;
    for(int i=0;i<n;++i){
        cur1 += v[i] ;
        if(cur1!=cur[i+1]) continue ;
        if(cur1<=k) return 1;
    }
    return 0;
}
int main(){
    cin >> n >> k ;
    long long ans = 0  ;
    for(int i=0;i<n;++i){
        cin >> a[i] ;
        sum += a[i] ;
        ans = __gcd(ans,1ll*a[i]);
    }
    for(long long i=1;i*i<=sum;++i){
        if(sum%i) continue ;
        if(ok(i)) ans = max(ans,i);
        if(ok(sum/i)) ans = max(ans,sum/i);
    }
    cout << ans ;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<numeric>
#include<set>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long li;
#define ceil(a,b) (((a)+(b)-1)/(b))
#define yn(i) ((i)?"Yes":"No")
#define chmin(a,b) (a>(b)?a=(b),1:0)
#define abs(n) max((n),-(n))
#define dist(a,b) max((a)-(b),(b)-(a))
#define chmax(a,b) (a<(b)?a=(b),1:0)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define MOD 1000000000
#define rep(i,n) for(int i=0;i<(n);i++)

#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

// Container コンテナ型, map以外
template< template<class ...> class Ctn,class T>
std::ostream& operator<<(std::ostream& os,const Ctn<T>& v){
  auto itr=v.begin();
  while(itr!=v.end()){
    if(itr!=v.begin())cout << " ";
    cout << *(itr++);
  }
  return os;
}




string key="keyence";

void add(char m,string s,set<string> st){
  int n=s.size();
  rep(i,n){
    if(s[i]!=m) continue;
    string t;
    repa(j,i,n){
      t.push_back(s[j]);
      st.insert(t);
    }
  }
}

int main(){
  int a,b,c; cin >>a >>b >>c;
  print(ceil(c,(max(a,b))));
}





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

int main() {
    vector<ll> dp(40);
    dp[0] = dp[1] = 1;
    dp[2] = 2;
    for(int i = 3; i<=35; i++){
        dp[i] = dp[i-1]+dp[i-2]+dp[i-3];
    }
    int k;
    while(cin >> k, k){
        cout << (dp[k]-1)/3650+1 << endl;
    }
    return 0;
}



Measured memory_bytes: 3040
#include<bits/stdc++.h>
using namespace std;
#define EPS (1e-10)
#define int long long

typedef vector<double> arr;
typedef vector<arr> mat;

double det(mat A){
  int n=A.size();
  double res=1;
  for(int i=0;i<n;i++){
    int pivot=i;
    for(int j=i+1;j<n;j++)
      if(abs(A[j][i])>abs(A[pivot][i])) pivot=j;
    swap(A[pivot],A[i]);
    res*=A[i][i]*(i!=pivot?-1:1);
    if(abs(A[i][i])<EPS) break;
    for(int j=i+1;j<n;j++)
      for(int k=n-1;k>=i;k--)
	A[j][k]-=A[i][k]*A[j][i]/A[i][i];
  }
  return res;
}

bool isTriangle(double a1,double a2,double a3){
  if(a1+a2<=a3||a2+a3<=a1||a3+a1<=a2) return 0;
  return 1;
}
double tetrahedra(double OA,double OB,double OC,double AB,double AC,double BC){
  if(!isTriangle(OA,OB,AB)) return 0;
  if(!isTriangle(OB,OC,BC)) return 0;
  if(!isTriangle(OC,OA,AC)) return 0;
  if(!isTriangle(AB,AC,BC)) return 0;
  mat A(5,arr(5,0));
  A[0][0]=    0;A[0][1]=AB*AB;A[0][2]=AC*AC;A[0][3]=OA*OA;A[0][4]=1;
  A[1][0]=AB*AB;A[1][1]=    0;A[1][2]=BC*BC;A[1][3]=OB*OB;A[1][4]=1;
  A[2][0]=AC*AC;A[2][1]=BC*BC;A[2][2]=    0;A[2][3]=OC*OC;A[2][4]=1;
  A[3][0]=OA*OA;A[3][1]=OB*OB;A[3][2]=OC*OC;A[3][3]=    0;A[3][4]=1;
  A[4][0]=    1;A[4][1]=    1;A[4][2]=    1;A[4][3]=    1;A[4][4]=0;
  //cout<<"det(A):"<<det(A)<<endl;
  if(det(A)<=0) return 0; 
  return sqrt(det(A)/288.0);
}
signed main(){
  int n;
  while(cin>>n,n){
    double a[n];
    double ans=0;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
	for(int k=j+1;k<n;k++){
	  for(int x=0;x<n;x++){
	    if(i==x||j==x||k==x) continue;
	    for(int y=0;y<n;y++){
	      if(i==y||j==y||k==y||x==y) continue;
	      for(int z=0;z<n;z++){
		if(i==z||j==z||k==z||x==z||y==z) continue;
		ans=max(ans,tetrahedra(a[i],a[j],a[k],a[x],a[y],a[z]));
	      }
	    }
	  }
	}
      }
    }
    printf("%.10f\n",ans);
  }
  return 0;
}


/*
verified on 2017/04/26
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2060
*/

Measured memory_bytes: 3080
#include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
//static const ll MOD = 1;
static const ll MAX_L = (ll)1 << 62;

static const ll FACT_SIZE = 1000000;
ll fact[FACT_SIZE] = {};

ll Pow(ll n, ll p) {
	if (p == 0)return 1;
	if (p == 1)return n;
	ll t = Pow(n, p / 2);
	if (p & 1) return (t * t % MOD) * n % MOD;
	//if (p & 1) return t * t * n;
	else return t * t % MOD;
	//else return t * t;
}
void factorial(ll f) {
	fact[0] = fact[1] = 1;
	rep(i, 1, FACT_SIZE) fact[i] = fact[i - 1] * i % MOD;
	//rep(i, 1, FACT_SIZE) fact[i] = fact[i - 1] * i;
}

ll nCr(ll n, ll r) {
	if (fact[0] == 0)	factorial(1000000);
	return ((fact[n] * (Pow(fact[r], MOD - 2) % MOD)) % MOD * Pow(fact[n - r], MOD - 2)) % MOD;
	//return fact[n] / (fact[r] * fact[n - r]);
}

ll a[50] = {};
int main() {
	ll n, p; cin >> n >> p;
	ll o = 0, e = 0;
	rep(i, 0, n) {
		cin >> a[i];
		if (a[i] & 1) o++;
		else e++;
	}
	if (o == 0) {
		if (p == 1) cout << 0 << endl;
		else {
			ll ans = 1;
			rep(i, 0, e) {
				ans *= 2;
			}
			cout << ans << endl;
			//cout << Pow(2, e) << endl;
		}
		return 0;
	}
	else {
		if (p == 1) {
			ll ans = 0;
			repe(i, 0, o) {
				if (i & 1) {
					ans += nCr(o, i)*Pow(2, e);
				}
			}
			cout << ans << endl;
			return 0;
		}
		else {
			ll ans = 0;
			repe(i, 0, o) {
				if (!(i & 1)) {
					ans += nCr(o, i)*Pow(2, e);
				}
			}
			cout << ans << endl;
			return 0;
		}
	}

	return 0;
}

Measured memory_bytes: 8064
h,w = map(int, input().split())
c=[]
for i in range(10):
    data = list(map(int,input().split()))
    c.append(data)
a = []
for i in range(h):
    data = list(map(int,input().split()))
    a.append(data)

costs=[10**10]*10
costs[1]=0

used=[]
used.append(1)
now=1

while True:
    for i in range(0,10):
        if i in used:
            continue
        if costs[i] > c[i][now]+costs[now]:
            costs[i] = c[i][now]+costs[now]

    argmin=-1
    costmin=10**5
    for i in range(0,10):
        if i in used:
            continue
        if costs[i] < costmin:
            costmin=costs[i]
            argmin=i
    if argmin==-1:
        break
    now=argmin
    used.append(now)

ans=0
for i in range(h):
    for j in range(w):
        if a[i][j] != -1:
            ans+=costs[a[i][j]]
print(ans)

Measured memory_bytes: 3444
#include <iostream>
#include <string>
#include <map>
#include <deque>
#include <vector>
typedef unsigned int UINT;
using namespace std;

int main(void) {
    const string Lf = "Left";
    const string Ba = "Balanced";
    const string Ri = "Right";
    
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int L = A+B, R=C+D;

    if (L == R)
        cout << Ba << endl;
    else if (L > R)
        cout << Lf << endl;
    else
        cout << Ri << endl;

    return 0;
}

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

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

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

int main(){
    long int a,b,c;
    long double ab;
    scanf("%ld %ld %ld",&a,&b,&c);
    ab = 2*sqrtl(a*b);
    if(a+b+ab<c){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
const int mod = 998244353, N = 110000;

int n, a[N], b[N];

inline int addMod(int a, int b) {
	return (a += b) >= mod ? a - mod : a;
}

inline ll quickpow(ll base, ll pw) {
	ll ret = 1;
	while (pw) {
		if (pw & 1) ret = ret * base % mod;
		base = base * base % mod, pw >>= 1;
	}
	return ret;
}

template <class T>
inline void read(T &x) {
	x = 0;
	char ch = getchar(), w = 0;
	while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	x = w ? -x : x;
	return;
}

int main() {
	read(n);
	ll tot = -1, sum = 1, ans = 1;
	for (R int i = 0; i <= n; ++i) {
		read(a[i]), b[i] = a[i];
		tot += a[i], ans += (ll) i * a[i];
	}
	for (R int i = n; ~i; --i) {
		if (i <= 30 && a[i] > 1 << i)
			return printf("-1\n"), 0;
		if (i) a[i - 1] += (a[i] + 1) >> 1;
	}
	for (R int i = 0; i <= n; ++i) {
		sum -= b[i];
		ll w = min(sum, tot);
		ans -= w * i, tot -= w, sum <<= 1;
		if (!tot) break;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4420
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    cin >> str;
    long l, ca=0, cz=0;
    l = str.size();
    for(long i=0; i<l; i++)
    {
        if(str[i]=='A') break;
        ca++;
    }
     for(long i=l-1; i>0; i--)
    {
        if(str[i]=='Z') break;
        cz++;
    }
    cout << l-ca-cz << endl;
    
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
 
  vector<int> t(N + 1), x(N + 1), y(N + 1);
  for (int i = 0; i < N; i++) {
    cin >> t[i + 1] >> x[i + 1] >> y[i + 1];
  }
 t[0]=0; x[0]=0; y[0]=0;

  for (int i = 0; i < N; i++) {
    int dt = t[i + 1] - t[i];
    int dxy = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]); 
    if (dxy > dt || dt % 2 != dxy % 2) {cout << "No" << endl; return 0;}
  }
 
  cout << "Yes"<< endl;
}

Measured memory_bytes: 4536
#cf17A
S=input()
i=0
C='AKIHABARA'
check=[]
def DP(s,i):
	global check
	if i==9:
		check.append(s)
	elif C[i]=='A':
		DP(s+'A',i+1)
		DP(s,i+1)
	else:
		DP(s+C[i],i+1)
DP('',0)
if S in check:
	print('YES')
else:
	print('NO')

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin >> n;
    vector<char> a(n);
    int i,j;
    int h=0;

    for(i=0;i<n;i++){
        int w=0;
        cin >> a.at(i);
        for(j=0;j<i;j++){
            if(a.at(j)==a.at(i))w++;
        }
        if(w==0)h++;
    }
    if(h==3)cout << "Three" <<endl;
    else cout <<"Four" << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = [[0 for _ in range(N)] for _ in range(4)]
for i in range(N):
	A[0][i], A[1][i], A[2][i] = map(int, input().split())
for j in range(3):
	for k in range(N):
		if A[j].count(A[j][k])==1:
			A[3][k] += A[j][k]

for l in A[3]: print(l)



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

const int INF = 2e9;

int main(){
    vector<string> s(3);
    rep(i,3) cin >> s[i];
    map<char,string> mp;
    mp['a'] = s[0];
    mp['b'] = s[1];
    mp['c'] = s[2];
    char now = 'a';
    while(true){
        char n = mp[now][0];
        if(mp[now].size() == 0){
            char ans = now - 32;
            cout << ans << endl;
            return 0;
        }
        mp[now] = mp[now].substr(1);
        now = n;
    }
}

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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define read(x) int x; cin>>x;
#define print(x) for(int i=0; i<(int) x.size(); i++) cout<<x[i]<<" "; cout<<endl;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;

const ll INFLL = (ll) 1e16;
const int INF = (int) 1e8;

int solution = INF;
int n, m, x;
vector<vector<int> > books(13, vector<int>(13, 0));
vector<int> prices(13);

void solve(int i,vector<int> skills, int price) {
	if(i==n) {
		for(int j=0; j<m; j++) {
			if(skills[j] < x) return;
		}
		solution = min(solution, price);
	} else {
		solve(i+1, skills, price);
		
		for(int j=0; j<m; j++) {
			skills[j]+=books[i][j];
		}
		solve(i+1, skills, price+prices[i]);
	}
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin>>n>>m>>x;
	for(int i=0; i<n; i++) {
		cin>>prices[i];
		vector<int> book(m);
		for(int j=0; j<m; j++) {
			cin>>books[i][j];
		}
	}
	
	vector<int> initial(m, 0);
	solve(0, initial, 0);
	if(solution==INF) solution=-1;
	cout<<solution<<endl;
	return 0;
}


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

int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<char>> s(H, vector<char>(W));
  for(int i=0; i<H; i++){
    for(int j=0; j<W; j++){
      cin >> s.at(i).at(j);
    }
  }
  bool can = true;
  const vector<int> di = {-1,0,1,0};
  const vector<int> dj = {0,-1,0,1};
  for(int i=0; i<H && can; i++){
    for(int j=0; j<W && can; j++){
      if(s.at(i).at(j)=='#'){
        bool can_ij = false;
        for(int k=0; k<4; k++){
          int ni = i+di.at(k);
          int nj = j+dj.at(k);
          if(ni<0 || ni>=H) continue;
          if(nj<0 || nj>=W) continue;
          if(s.at(ni).at(nj)=='#'){
            can_ij = true;
          }
        }
        if(!can_ij){
          can = false;
          break;
        }
      }
    }
  }
  if(can){
    cout << "Yes";
  }else{
    cout << "No";
  }
  return 0;
}

Measured memory_bytes: 3600
def Find(x, par, diff_weight):
    if par[x] < 0:
        return x
    else:
        px = Find(par[x], par, diff_weight)
        diff_weight[x] += diff_weight[par[x]]
        par[x] = px
        return px

def Unite(x, y, par, rank, diff_weight, w):
    w += diff_weight[x] - diff_weight[y]
    x = Find(x, par, diff_weight)
    y = Find(y, par, diff_weight)

    if x != y:
        if rank[x] < rank[y]:
            x, y =  y, x
            w = -w
        if rank[x] == rank[y]:
            rank[x] += 1
        par[x] += par[y]
        par[y] = x
        diff_weight[y] = w

def Same(x, y, par, diff_weight):
    return Find(x, par,diff_weight) == Find(y, par, diff_weight)

def Size(x, par, diff_weight):
    return -par[Find(x, par, diff_weight)]

def Weight(x, par, diff_weight):
    Find(x, par, diff_weight)
    return diff_weight[x]

def Diff(x, y, par, diff_weight):
    return Weight(y, par, diff_weight)  - Weight(x, par, diff_weight)

import sys
input = sys.stdin.buffer.readline
n, m = map(int, input().split())

par = [-1]*n
rank = [0]*n
diff_weight = [0]*n

for i in range(m):
    l, r, d = map(int, input().split())
    l, r = l-1, r-1
    if not Same(l, r, par, diff_weight):
        Unite(l, r, par, rank, diff_weight, d)
    else:
        if Diff(l, r, par, diff_weight) != d:
            print('No')
            exit()
else:
    print('Yes')


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

int main() {
	long long N, M;

	cin >> N >> M;

	long long ans = min( N, M / 2 );
	long long diff = M - 2 * N;
	if( diff <= 0 ) {
	}
	else {
		ans += diff / 4;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
	int L,R,d;
	cin>>L>>R>>d;
	int ans=0;
	for (int i=L;i<=R;i++){
		if (i%d==0){
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3152
import string


S = list(input())
T = list(input())

ans = "Yes"
tableT = []
for i in range(26):
  tableT.append("0")


for i in range(len(S)):
  s = ord(S[i])-97
  if tableT[s] == "0":
    tableT[s] = T[i]
  else:
    if tableT[s] != T[i]:
      ans = "No"
      break


tableS = []
for i in range(26):
  tableS.append("0")



for i in range(len(S)):
  t = ord(T[i])-97
  if tableS[t] == "0":
    tableS[t] = S[i]
  else:
    if tableS[t] != S[i]:
      ans = "No"
      break

print(ans)

Measured memory_bytes: 7092
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

pair<int,int> ba[1010];

int memo[2][1010];

int main(){
  int n = getInt();

  REP(i,n){
    ba[i].s = getInt();
    ba[i].f = getInt();
  }

  sort(ba, ba+n);

  int *now  = memo[0];
  int *next = memo[1];

  REP(i,n) now[i] = INT_MAX;
  now[0] = 0;

  REP(i,n){
    REP(j,n+1)
      next[j] = INT_MAX;

    REP(j,n){
      if(now[j] != INT_MAX){
        int t = now[j] + ba[i].s;
        next[j] = min(next[j], now[j]);
        if(t <= ba[i].f)
          next[j+1] = min(next[j+1], t);
      }
    }

    swap(next, now);
  }

  int ans = 0;
  REP(i,n+1) if(now[i] != INT_MAX) ans = i;

  print(ans);

  return 0;
}

Measured memory_bytes: 0
import java.util.*;


public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		
		System.out.println(H*W-H*w-W*h+h*w);
		
		

	}
}	

Measured memory_bytes: 23124
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <climits>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <functional>
#include <set>
#include <numeric>
#include <stack>
#include <utility>
#include <time.h>
#include <iterator>
#include <random>
//#include "util.h"

using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<bool> vbool;
typedef vector<string> vstr;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

//呪文
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const pair<_KTy, _Ty>& m) { cout << "{" << m.first << ", " << m.second << "}"; return ostr; }
template <typename _KTy, typename _Ty> ostream& operator << (ostream& ostr, const map<_KTy, _Ty>& m) { if (m.empty()) { cout << "{ }"; return ostr; } cout << "{" << *m.begin(); for (auto itr = ++m.begin(); itr != m.end(); itr++) { cout << ", " << *itr; } cout << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const vector<_Ty>& v) { if (v.empty()) { cout << "{ }"; return ostr; }	cout << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) { cout << ", " << *itr; }	cout << "}"; return ostr; }
template <typename _Ty> ostream& operator << (ostream& ostr, const set<_Ty>& s) { if (s.empty()) { cout << "{ }"; return ostr; } cout << "{" << *(s.begin()); for (auto itr = ++s.begin(); itr != s.end(); itr++) { cout << ", " << *itr; }	cout << "}"; return ostr; }
template <typename _KTy, typename _Ty> istream& operator >> (istream& istr, pair<_KTy, _Ty>& m) { cin >> m.first >> m.second; return istr; }
template <typename _Ty> istream& operator >> (istream& istr, vector<_Ty>& v) { for (size_t i = 0; i < v.size(); i++) cin >> v[i]; return istr; }
ll modpow(ll n, ll p, ll m) { ll result = 1; while (p > 0) { if (p & 1) result = (result * n) % m; p >>= 1; n = (n * n) % m; } return result; }
template <typename _Ty> _Ty ipow(_Ty x, _Ty n) { _Ty ret = _Ty(1); for (_Ty i = _Ty(0); i < n; i++) ret *= x; return ret; }
#define PI 3.14159265358979323846
#define EPS 1e-8
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define all(x) (x).begin(), (x).end()
#define fake false



int main()
{
	//clock_t start, end;
	//start = clock();

	int n;
	cin >> n;

	ll minR = INT_MAX;
	ll ans = INT_MIN;
	for (int t = 0; t < n; t++) {
		ll R; cin >> R;
		ans = max(ans, R - minR);
		minR = min(minR, R);
	}
	cout << ans << endl;

	//end = clock();
	//printf("%d msec.\n", end - start);

	return 0;
}



Measured memory_bytes: 3104
#include<stdio.h>
#include<string.h>
int main(void){
  int a,b,i,n,sum=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d",&a,&b);
    sum+=(b-a+1);
  }
  printf("%d",sum);
  return 0;
}

Measured memory_bytes: 128
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scan = new Scanner(System.in);
        
        Map<Integer, Integer> input = new HashMap<Integer, Integer>();
        
        int in = 0;
        int x = 0;
        
        for(int i = 0 ; i < 3 ; i++){
            in = scan.nextInt();
            if(input.get(in) != null){
                x = input.get(in);
                x = x + 1;
                input.put(in, x);
            }else{
                input.put(in, 1);
            }
        }
        
        int number5 = 0;
        int number7 = 0;
        String ans = "NO";
        
        number5 = input.get(5);
        if(number5 != 0){
            if(number5 == 2){
            number7 = input.get(7);
                if(number7 != 0){
                    if(number7 == 1){
                        ans = "YES";
                    }
                }
            }
        }
        
        System.out.println(ans);
        
    }
}

Measured memory_bytes: 22612
#include <bits/stdc++.h>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
int N;
ll C;
ll sushisum=0;
ll Csushisum=0;
ll ans=0;
ll ans2=0;
ll x[100005];
ll v[100005];
ll f[100005];
ll g[100005];
ll B[100005];
ll A[100005];
ll Cf[100005];
ll Cg[100005];
int main(void)
{
  cin >> N >> C;
  for (int i = 1; i <= N; ++i)
    {
      cin >> x[i] >> v[i];
    }
  for (int i = 0; i <= N+1; i++)
    {
      sushisum+=v[i];
      A[i]=sushisum-x[i];
      if(i==N+1 || i==0) A[i]=0;
      //cout << "A " << i << ' ' << sushisum << ' ' << A[i] << endl;
    }
  //cout << endl;
  for (int i = N+1; i >= 0; i--)
    {
      Csushisum+=v[i];
      if(i==N+1 || i==0)
	{
	  B[i]=0;
	}
      else
	{
	  B[i]=Csushisum-(C-x[i]);
	}
      //cout << "B " << i << ' ' << Csushisum << ' ' << B[i] << endl;
    }
  Csushisum=0;
  sushisum=0;
  //cout << endl;
  for (int i = 0; i <= N; ++i)
    {
      sushisum+=v[i];
      f[i]=sushisum-x[i];
    }
  for (int i = N+1; i >= 0; i--)
    {
      Csushisum+=v[i];
      if(i==N+1 || i==0)
	{
	  Cf[i]=Csushisum;
	}
      else
	{
	  Cf[i]=Csushisum-(C-x[i]);
	}
    }
  for (int i = 0; i <= N+1; ++i)
    {
      if(i!=0 && i!=N+1)
	{
	  g[i]=max(g[i-1],f[i]);
	}
      else
	{
	  g[i]=max(0LL,f[i]);
	}
      //cout << "f g " << i << ' ' << f[i] << ' ' << g[i] << endl;
    }
  //cout << endl;
  for (int i = N+1; i >= 0; i--)
    {
      if(i!=N+1 && i!=0)
	{
	  Cg[i]=max(Cg[i+1],Cf[i]);
	}
      else
	{
	  Cg[i]=max(0LL,Cf[i]);
	}
      //cout << "Cf Cg " << i << ' ' << Cf[i] << ' ' << Cg[i] << endl;
    }
  //cout << endl;
  for (int i = 0; i <= N; ++i)
    {
      if(i!=0)
	{
	  if((g[i-1]-(C-x[i]))<=0)
	    {
	      ans=max(ans,B[i]);
	    }
	  else
	    {
	      ans=max(ans,B[i]+g[i-1]-(C-x[i]));
	    }
	  if((Cg[i+1]-x[i])<=0)
	    {
	      ans2=max(ans2,A[i]);
	    }
	  else
	    {
	      ans2=max(ans2,A[i]+Cg[i+1]-x[i]);
	    }
	}
      else
	{
	  ans=max(ans,0LL);
	  ans2=max(ans2,0LL);
	}
      //cout << ans << ' ' << ans2 << endl;
    }
  cout << max(ans,ans2) << endl;
  return 0;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
const long long MOD=1e09+7;



#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define vi vector<int>


int main(){
  

  int n;
  
  cin>>n;
  
  set<int> hon={2,4,5,7,9};
  set<int> pon={0,1,6,8};
  set<int> bon={3};
  
  n%=10;
  
  if (hon.find(n)!=hon.end()){
    cout<<"hon"<<endl;
  }
  
  else if (pon.find(n)!=pon.end()){
    cout<<"pon"<<endl;
  }
  else {
    cout<<"bon"<<endl;
  }
  

  
  
  
  
  
      
 

  
}

Measured memory_bytes: 3576
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;
typedef long long ll;
#include <cstring>

int main() {
  int h, w, m, x, y, ans = 0, maxh = 0, maxw = 0;
  set<pair<int, int> > s;
  set<int> sh;
  cin >> h >> w >> m;
  vector<int> sumh(h), sumw(w);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    sumh[x]++;
    sumw[y]++;
    maxh = max(maxh, sumh[x]);
    maxw = max(maxw, sumw[y]);
    s.insert({x, y});
  }
  for (int i = 0; i < h; i++) {
    if (sumh[i] == maxh) {
      sh.insert(i);
    }
  }
  for (int i = 0; i < w; i++) {
    if (sumw[i] == maxw) {
      for (auto&& xx : sh) {
        if (s.find({xx, i}) == s.end()) {
          cout << maxh + maxw << endl;
          return 0;
        }
      }
    }
  }
  cout << maxh + maxw - 1 << endl;
}

Measured memory_bytes: 33612
#include <iostream>
using namespace std;
int MOD = 1000000007;
using ll = long long;

int main(void)
{
  ll p = 1;
  int N;
  cin >> N;
  
  for (int i=1;i<=N;i++){
    p = (p*i) % MOD;
  }
  
  cout << p << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <math.h> 
#include <set>
#include <map>
#include <deque>
#include <queue>


using namespace std;

#define ll long long int
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repp(i, n) for(int i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define riverse(v) reverse((v).begin(), (v).end())
#define pb push_back
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
using vvi = vector<vi>;
const ll MOD = 1e9 + 7;


int main() {
	int N, M;
	cin >> N >> M;
	vvi g(N + 1);
	rep(i, M) {
		int x;
		cin >> x;
		int y;
		cin >> y;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	set<int> setN;
	for (int x : g[N]) {
		setN.insert(x);
	}
	bool frag = false;
	for (int x : g[1]) {
		if (setN.count(x)) {
			frag = true;
			break;
		}
	}
	if (frag) cout << "POSSIBLE" << endl;
	else cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 16624
import sys
input = sys.stdin.readline
from collections import defaultdict


def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def divisor(n):
    i = 1
    d = []
    while i * i <= n:
        if n % i == 0:
            d.append(i)
            if i * i != n:
                d.append(n // i)
        i += 1
    return d


def solve(N, A):
    use = [1 for i in range(N+1)]
    for i in range(N, 0, -1):
        multiple = sum([use[i] for i in range(i+i, N+1, i)])
        if A[i-1] == (1 + multiple) % 2:
            use[i] = 1
        else:
            use[i] = 0
    ans = [i for i in range(1, N+1) if use[i]]
    print(len(ans))
    if len(ans) > 0:
        print(*ans)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Measured memory_bytes: 14428
#include <bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
typedef unsigned long long int ull;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> o_set; 

#define     int                 ll
#define     pb                  push_back
#define     mp                  make_pair
#define     xx                  first
#define     yy                  second    
#define     all(a)              a.begin(),a.end()
#define     vi                  vector<int>
#define     vpi                 vector<pii>
#define     pii                 pair<int, int>
#define     present(DT, val)    (DT.find(val) != DT.end()) //for set and map
#define     cpresent(DT, val)   (find(all(DT),val) != DT.end()) //vectors
#define     input               "/home/pollution/Desktop/WorkSpace/C++/Files/input.txt"
#define     output              "/home/pollution/Desktop/WorkSpace/C++/Files/output1.txt"
#define     error               "/home/pollution/Desktop/WorkSpace/C++/Files/error.txt"
#define     IO()                ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define     INF                 2e18
#define     MOD                 1000000007
#define     clr(x)              memset(x, 0, sizeof(x))
#define     init(x, a)          memset(x, a, sizeof(x))
#define     out(a)              for (auto i: a) cout<<i<<' '; cout<<'\n'
#define     cpy(a,b)            memcpy(a,b,sizeof(b))
#define     is(a)               to_string(a)
#define     ci(a,c)             a-c
#define     db(i)               cout<<"point :"<<i<<'\n';
#define     setd(val,n)         cout<<fixed<<setprecision(n)<<val<<'\n'

void solve(){
    int n,k,d,val; cin>>n>>k;
    vi a(n);
    for(int i = 0; i < k; ++i){
    	cin>>d;
    	for(int j = 0; j < d; ++j){
    		cin>>val;
    		a[val-1]++;
    	}
    }
    int ans = 0;
    for(int i = 0; i < n; ++i){
    	if(a[i]==0){
    		ans++;
    	}
    }
    cout<<ans<<'\n';
}

signed main() { 
    IO();
    
    int t=1;
    // cin>>t;
    while(t--) solve();
    return 0; 
}

Measured memory_bytes: 3652
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

using ll = long long;
using ld = long double;
using ull = unsigned long long;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const int C = 1e6 + 100;
const int A = 26;

int n;

vector<string> vv;
int cc = 1;

int go[C][A];
int ad[C][A];
int cnt[A];

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cout.setf(ios::fixed), cout.precision(20);
	cin >> n;
	string s;
	for (int i = 0; i < n; ++i) {
		cin >> s;
		reverse(ALL(s));

		int now = 0;
		for (int i = 0; i + 1 < s.size(); ++i) {
			int c = s[i] - 'a';
			if (go[now][c]) {
				now = go[now][c];
			} else {
				now = go[now][c] = cc++;
			}
		}
		++ad[now][s.back() - 'a'];

		vv.push_back(s);
	}

	ll ans = 0;

	for (auto s : vv) {
		memset(cnt, 0, sizeof(cnt));
		for (char c : s) {
			++cnt[c - 'a'];
		}

		int now = 0;
		for (int i = 0; i + 1 < s.size(); ++i) {
			for (int j = 0; j < 26; ++j) {
				if (cnt[j]) {
					ans += ad[now][j];
				}
			}

			int c = s[i] - 'a';
			now = go[now][c];
			--cnt[c];
		}
	}

	cout << ans << "\n";

	return 0;
}




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

int main() {
    int a[] = {0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0};
    int x, y; cin >> x >> y;
    if (a[x - 1] == a[y - 1]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
using namespace std;
int N_MAX = 100000;
long gcd(long m, long n)
{
  while (m>0&&n>0){
    n = n % m;
    if (n>0)
      m = m % n;
  }
  if (n==0)
    return m;
  else
    return n;
}
int main()
{
  int n;
  cin >> n;
  int a[N_MAX];
  for(int i=0;i<n;i++)
    cin >> a[i];
  long res=gcd(a[0],a[1]);
  for(int i=2;i<n;i++)
    res=gcd(res,a[i]);
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 640
lst = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(lst[k-1])


Measured memory_bytes: 2940
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include <queue>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <map>
#include <functional>
#include <limits>
#include <set>
#include <stack>
#define rep(i,a,b) for((i)=a;i<(int)(b);i++)
#define max(a,b) ((a) < (b) ? (b) : (a))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define AAA (1000000007)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;



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

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



int main() {
	string S;
	int i, j, k;
	//ll N, M, K;
	int N, M, K;
	ll n;
	cin >> n;
	ll m = 100;
	ll ii = 0;
	while (n > m) {
		ii++;
		m *= 1.01;
		
	}
	cout << ii;
	return 0;
	
}


Measured memory_bytes: 3624
#include <stdio.h>

int main() {
	int h1, m1, h2, m2, k, start = 0, finish = 0, lo = 0;
	scanf("%d%d%d%d%d", &h1, &m1, &h2, &m2, &k);
	start = h1 * 60 + m1;
	finish = h2 * 60 + m2;
	lo = finish - start - k;
	printf("%d", lo);
	return 0;
}


Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
int aaa[maxn],vis[maxn];
map<int,int> Map;
int main()
{
    int n;scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&aaa[i]);
        Map[aaa[i]]++;
    }
    int ans=0;
    sort(aaa+1,aaa+1+n);
    for(int i=30;i>=1;i--)
    for(int j=n;j>=1;j--)
    {
        if(aaa[j]>(1<<i)) continue;

        if(Map[aaa[j]]!=0)
        {
            if(Map[(1<<i)-aaa[j]]!=0)
            {
                Map[(1<<i)-aaa[j]]--;
                if(Map[aaa[j]]==0) continue;
                Map[aaa[j]]--;
                ans++;
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 29824
#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

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

int main() {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  int cnt = 0;
  while(a>0&&c>0) {
    if(cnt%2==0) c -= b;
    else a-= d;
    cnt++;
  }
  if(cnt%2==0) cout << "No" << endl;
  else cout << "Yes" << endl;

  return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> l(n);
  for (int &i : l) cin >> i;
  sort(l.rbegin(), l.rend());
  int ans = 0;
  for (int i = 0; i < n - 2; i++) {
    for (int j = i + 1; j < n - 1; j++) {
      for (int k = j + 1; k < n; k++) {
        if (l[i] < l[j] + l[k] and l[i] != l[j] and l[j] != l[k]) {
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3544
#include<bits/stdc++.h>
using namespace std;
#define ll  long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD = 1000000007;
ll cnt =0,ans=0;
const int MAX = 510000;

int main(){
   string s;
   cin >> s;
   int n = s.size();
   string t;
   cin >> t;
   for(int i=0;i<n;i++){
       if(s.at(i) != t.at(i)){
           cout << "No" << endl;
           return 0;
       }
   }
   cout << "Yes" << endl;
   
}
       


Measured memory_bytes: 3596
let n, k = Scanf.sscanf (read_line ()) "%d %d" @@ fun n k -> (n, k)

let rec pow x n = if n = 1 then x else x * pow x (n - 1)

let () =
  let a = n / k in
  let b = (n + k / 2) / k in
  Printf.printf "%d\n" @@ pow a 3 + if k mod 2 = 0 then pow b 3 else 0

Measured memory_bytes: 3812
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		
		StringBuilder all = new StringBuilder();
		StringBuilder out = new StringBuilder();
		
		while(true){
			
			int h = sc.nextInt();
			int w = sc.nextInt();
			
			if((h + w) <= 0){break;}
			
			//top
			for(int t = 0; t < w; t++){
				out = out.append("#");
			}
			out = out.append("\n");
			
			//center
			
			for(int j = 0; j < (h-2); j++){
				out = out.append("#");
				for(int i = 0; i < (w-2); i++){
						out = out.append(".");
					}
				out = out.append("#");
				out = out.append("\n");
			}
			for(int b = 0; b < w; b++){
				out = out.append("#");
			}
			out = out.append("\n");
			
			all = all.append(out + "\n");
			out.delete(0, out.length());
			
		}
		
		System.out.print(all);
	}
}

Measured memory_bytes: 23104