akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

char cn[120000], * ci = cn + 20, ct, c, * owa = cn + 119980;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	c = ci[8];
	ci[8] = 0;
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci[8] = c;
	ci += (64 - dig >> 3) + 1;

	if (ci - owa > 0) {
		memcpy(cn, owa, 20);
		ci -= 119980;
		fread(cn + 20, 1, 119980, stdin);
	}
	return tmp;
}
//inline int getint() {
//	int A = 0;
//	while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
//	
//	if (ci - owa > 0) {
//		memcpy(cn, owa, 20);
//		ci -= 119980;
//		fread(cn + 20, 1, 119980, stdin);
//	}
//
//	return A;
//}

char* di = cn;
const int MAX = 200000;
class shuturyoku_unko {
public:
	char C[MAX * 6 + 10];
	int K[MAX + 10];
	constexpr shuturyoku_unko() : C(), K() {
		auto di = C + 1;
		C[0] = '0';
		K[1] = 1;
		rep1(i, MAX) {
			int X = i;
			int keta = 0;
			char c[10] = {};
			while (X) {
				*(c + keta) = '0' + X % 10;
				X /= 10;
				keta++;
			}
			for (int j = keta - 1; j >= 0; j--)* di++ = (*(c + j));
			K[i + 1] = K[i] + keta;
		}
	}
} f;
inline void putint(ll X) {
	int ue = X / 100000;
	if (ue) {
		for (int i = f.K[ue]; i < f.K[ue + 1]; i++)* di++ = f.C[i];
		int sita = X - ue * 100000ll;
		rep(i, 5 - f.K[sita + 1] + f.K[sita])* di++ = '0';
		for (int i = f.K[sita]; i < f.K[sita + 1]; i++)* di++ = f.C[i];
	}
	else for (int i = f.K[X]; i < f.K[X + 1]; i++)* di++ = f.C[i];
	*di++ = '\n';
}

int B[200010];

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


	fread(ci, 1, 119980, stdin);

	int N = getint();
	ll kotae = 0;
	int A[200000];
	rep(i, N) kotae += B[(A[i] = getint())]++;
	int i = 0;
	
	int amari = N % 10000;
	int shou = N / 10000;
	rep(j, shou) {
		rep(k, 10000) putint(kotae - B[A[i++]] + 1);
		fwrite(cn, 1, di - cn, stdout);
		di = cn;
	}
	rep(k, amari) putint(kotae - B[A[i++]] + 1);
	fwrite(cn, 1, di - cn, stdout);

	Would you please return 0;
}

Measured memory_bytes: 3712
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def gcd_(list):
    result = list[0]
    for el in list[1:]:
        result = gcd(result, el)
    return result


n, x = LI()
X = LI()

X.append(x)
X.sort()

X_ = [post - pre for pre, post in zip(X[:-1], X[1:])]

print(gcd_(X_))


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

using namespace std ;

#define int long long
#define N 1000000

int ans , n , k ;
int sum[N] , a[N] ;

map<int , int>M ;

signed main()
{
    scanf("%lld%lld" , &n , &k ) ;
    for(int i = 1 ; i <= n ; i++ ) scanf("%lld" , &a[i] ) ;
    for(int i = 1 ; i <= n ; i++ ) sum[i] = ( sum[i - 1] + a[i] % k ) % k ;
    M[0] = 1 ;
    int l = 0 ;
    for(int i = 1 ; i <= n ; i++ ){
        while( i - l >= k ){
            int now1 = ( ( sum[l] - l ) % k + k ) % k ;
            M[now1]-- ; l++ ;
        }
        int now = ( ( sum[i] - i ) % k + k ) % k ;
        ans += M[now] ;
        M[now]++ ;
    }
    printf("%lld\n" , ans ) ;
    return 0 ;
}

Measured memory_bytes: 18432
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		int a = sc.nextInt();
        int b = sc.nextInt();
        int c = 0;
        for(int i=0;i<=a;i++){
          for(int j=0;j<=a;j++){if(b-i-j>=0 && b-i-j<=a){c++;}}
        }
        System.out.println(c);
	}
}


Measured memory_bytes: 21716
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
#include <numeric>
using namespace std;
typedef unsigned long long int ulint;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define RE return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
const int mod=(int)1e9+7;
const llint big=(llint)(2.19e15)+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
template <class T> void soun(T& ar)
{sort(ar.begin(),ar.end());ar.erase(unique(ar.begin(),ar.end()),ar.end());}
llint gcd(llint a,llint b){if(a%b==0){return b;}else{return gcd(b,a%b);}}
llint lcm(llint a,llint b){return a/gcd(a,b) *b;}
template<class T,class U> auto LB(T& ve,U in){return lower_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto UB(T& ve,U in){return upper_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto LBI(T& ve,U in){return LB(ve,in)-ve.begin();}
template<class T,class U> auto UBI(T& ve,U in){return UB(ve,in)-ve.begin();}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
using pli=pair<llint,int>;
using daic=priority_queue<pli,vector<pli>,greater<pli>>;
int main(void){
	//どうせこういうのは最長共通部分列は回文になる(証明はしていない)
	//両側から適当なDPでもすれば答えにたどり着く?
	string s;cin>>s;
	int n,h,i,j,K,ans=0;cin>>K;n=s.size();
	static int dp[301][301][302]={0};
	for(i=0;i<n;i++){
		for(j=n-1;j>i;j--){
			for(h=0;h<=K;h++){
				if(s[i]==s[j]){maxeq(dp[i+1][j-1][h],dp[i][j][h]+2);}
				else{maxeq(dp[i+1][j-1][h+1],dp[i][j][h]+2);}
				maxeq(dp[i+1][j][h],dp[i][j][h]);
				maxeq(dp[i][j-1][h],dp[i][j][h]);
			}
		}
		maxeq(ans,dp[i][i][K]+1);
		if(i>0){maxeq(ans,dp[i][i-1][K]);}
	}
	cout<<ans<<endl;
	RE;
}

Measured memory_bytes: 106368
A = int(input())
B = int(input())
C = int(input())
X = int(input())

s = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i + 100*j + 50*k == X:
                s += 1
print(s)

Measured memory_bytes: 3060
#include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	int now = m;
	int max = m;
	bool flag = true;
	vector<int> in(n), out(n);
	for (int i = 0; i < n; i++) {
		cin >> in[i] >> out[i];
		now = now + in[i] - out[i];
		if (now > max) max = now;
		if (now < 0) {
			cout << 0 << endl;
			flag = false;
			break;
		}
	}
	if (flag) cout << max << endl;

}


Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,i,ans=0;
  cin>>n;
  vector<int> a(n);
  for(i=0;i<n;i++) cin>>a.at(i);
  for(i=0;i<n;i++){
    if(a.at(i)==i+1){
      ans++;
      i++;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3760
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <set>
using namespace std;

vector<vector<int> > G;
const int max_n = 2048 + 128;

int dp[max_n][max_n];
int best;

void solve(int n, int k, int now, int parent) {
  for (auto nxt : G[now]) {
    if (nxt == parent) continue;
    solve(n, k, nxt, now);
  }
  for (int i = 0; i <= (k - 1) / 2; i ++) {
    int sum = 0;
    int diff_max = 0;
    for (auto nxt : G[now]) {
      sum += dp[nxt][i];
      diff_max = max(diff_max, dp[nxt][k-1-i] - dp[nxt][i]);
    }
    dp[now][i+1] = sum + 1;
    dp[now][k-i] = sum + diff_max + 1;
    best = max(best, sum + diff_max + 1);
  }
}

int main()
{
  int n, k;
  cin >> n >> k;
  k ++;
  G.resize(n);
  for (int i=0; i<n-1; i++) {
    int a, b;
    cin >> a >> b;
    a --;
    b --;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  solve(n, k, 0, -1);
  cout << n - best << endl;
}


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

typedef long long ll;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(false);
    cout.precision(10);
    cout<<fixed;

    string s;
    cin >> s;
    int n = s.size();
    int tren = 0;
    ll res = 0;
    for(int i=0; i<n; i++){
        if(s[i] == 'B') tren++;
        else{
            res += tren;
        }
    }
    cout << res;
    return 0;
}


Measured memory_bytes: 720
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define modul 998244353
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,x,a[105];
map<ll,ll>viz;
int32_t main(){
CODE_START;
cin>>x>>n;
for(ll i=1;i<=n;i++)
{
    cin>>a[i];
    viz[a[i]]=1;
}
ll mx=mod,pos=-1;
for(ll i=-200;i<=200;i++)
{
    if(viz[i]==0){
if(abs(i-x)<mx){
    mx=abs(i-x);
    pos=i;
}
    }
}
cout<<pos<<endl;
}


Measured memory_bytes: 3680
#include <bits/stdc++.h>
using namespace std;
#define int long long


int32_t main() 
{
 
  ios::sync_with_stdio(0); 
  cin.tie(0); cout.tie(0);
 
  int n;
  cin >> n;

  int dp[n + 1];
  for(int i = 1; i <= n; i++)
      dp[i] = 1e9;

  dp[0] = 0;
  
  for(int i = 0; i <= n; i++){
     dp[i + 1] = min(dp[i + 1], dp[i] + 1);
      for(int j = 6; i + j <= n; j *= 6)
          dp[i + j] = min(dp[i + j], 1 + dp[i]);

      for(int j = 9; i + j <= n; j *= 9)
          dp[i + j] = min(dp[i + j], 1 + dp[i]); 
  }

  cout << dp[n];

  return 0;
}

Measured memory_bytes: 4312
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define SZ 250000
#define B 500

long a[SZ+B+5];
long b[B+5];
bool same[B+5];

inline void update(int blk){
  same[blk] = true;
  rep(i,B) same[blk] &= a[blk*B+i]==a[blk*B];
}

inline bool check(){
  rep(i,B) if(!same[i] || a[i*B]+b[i]!=0) return false;
  return true;
}

void query(int l, int r, int x){
  if(l/B == r/B){
    rep(i,l,r) a[i] += x;
    update(l/B);
  }
  else{
    rep(i,l,(l/B+1)*B) a[i] += x;
    rep(i,l/B+1,r/B) b[i] += x;
    rep(i,r/B*B, r) a[i] += x;
    update(l/B);
    update(r/B);
  }
}

int main(){
  int n;
  cin>>n;
  vector<int> s(n);
  rep(i,n) scanf("%d", &s[i]);

  fill(a, a+SZ, 0);
  fill(b, b+B, 0);
  rep(i,n/2) a[i] = s[i] - s[n-i-1];

  rep(i,B) update(i);

  int q;
  cin>>q;
  rep(_,q){
    int l,r,x;
    scanf("%d %d %d", &l, &r, &x);
    l--;

    if(r<n/2){
      query(l,r,x);
    }
    else if(l>=n/2){
      query(n-r, n-l, -x);
    }
    else{
      query(l,n/2,x);
      query(n-r,n/2,-x);
    }

    if(check()) puts("1");
    else puts("0");
  }

  return 0;
}

Measured memory_bytes: 6836
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repe(i, n) for (int i = 0; i <= (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define KOZYUN(a) sort(all(a),greater<int>())
#define int ll
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORe(i, m, n) for(int i = m;i <= n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
#define IN(a) cin >> a
#define INT(a) int a; cin >> a
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int lcm(int a, int b) { int g = gcd(a, b); return a / g * b; }
/*素数判定*/int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*約数列挙*/vector<int> getDivisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string s; cin >> s;
    string r = s;
    REVERSE(r);
    int ans = 0;
    rep(i,s.size()) if(s[i] != r[i]) ans++;
    OUT(ans/2);

    return 0;
}

Measured memory_bytes: 256
s = int(input())
b = int(1e9)
a = s // b
if a * b < s:
	a += 1
x, y = 1, a * b - s
print("0 0 %d %d %d %d" % (x, b, a, y))

'''
a, b
(0, 0), (x, b), (a, y)
s = a * b - x * y

2*a*b-(a-x)*b-a*(b-y)-x*y=s
x*b+y*a-x*y=s
'''

Measured memory_bytes: 3060
#include<bits/stdc++.h>
//     #include<boost/multiprecision/cpp_int.hpp>
// using boost::multiprecision::cpp_int; // use cpp_ll as data type for large numbers 
    using namespace std;
    typedef long long ll;
    typedef long double ld;
    typedef unsigned long long ull;
    typedef vector<int> vi;
    typedef vector<long long> vll;
    typedef pair<ll,ll> pll;
     
    const ll mod = 1e9 + 7;
    const ld PI = 3.1415926535897932384626;
    const ld eps = 1e-9;                            
     
    #define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define sidha(i,a,b) for(ll i=(ll)(a);i<(ll)(b);++i)
    #define ulta(i,a,b) for(ll i=(ll)(a);i>=(ll)(b);--i)
    #define stl(container,itr) \
        for(auto itr = container.begin(); itr != container.end(); itr++)
    #define sab(v) v.begin(), v.end()
    #define rall(v) v.rbegin(), v.rend()            
    #define test ll t;cin>>t;while(t--)
    #define sz size()
    #define pb push_back
    #define mp make_pair
    #define fi first
    #define se second
    #define LOG2(X) (63ll - __builtin_clzll(X))
    #define endl '\n'
    #define modinv(x) power(x, mod-2)
    #define MAX 100005
     
    ll power(ll x, ll y) { 
        ll ans=1;
        x=x%mod;
        while(y>0) { 
            if (y&1) 
                ans=(ans*x)%mod; 
            y=y>>1;
            x=(x*x)%mod; 
        } 
        return ans; 
    }
    
    // vector<ll> arr[MAX];
    // ll visit[MAX];
    // void dfs(ll n){
    //     visit[n]=1;
    //     for(ll i=0;i<arr[n].size();++i){
    //         if(visit[arr[n][i]]==0) dfs(arr[n][i]);
    //     }
    // }
    
    // ll spf[MAX];
    // void sieve(){
    //     sidha(i,1,MAX)  spf[i]=i;
    //     for(ll i=4;i<MAX;i+=2)  spf[i]=2;
    //     for(ll i=3;i*i<=MAX;i++){
    //         if(spf[i]==i){
    //             for(ll j=i*i;j<MAX;j+=i){
    //                 if(spf[j]==j)   spf[j]=i;
    //             }
    //         }
    //     }
    // }

    int main()
    {
        boost;
        ll x,k,d;
        cin>>x>>k>>d;
        if(x>0){
            // if(x-k*d>=0)    cout<<x-k*d;
            // else{
                ll tmp=x/d;
                tmp=min(tmp,k);
                ll tmp1=min(tmp,k)*d;
                tmp1=x-tmp1;
                if((k-tmp)%2)   cout<<abs(tmp1-d);
                else    cout<<abs(tmp1);
            //}
        }
        else if(x<0){
            // if(x+k*d<=0)    cout<<abs(x+k*d);
            // else{
                ll tmp=(abs(x))/d;
                tmp=min(tmp,k);
                ll tmp1=min(tmp,k)*d;
                tmp1=x+tmp1;
                if((k-tmp)%2)   cout<<abs(tmp1+d);
                else    cout<<abs(tmp1);
            //}
        }
        else{
            if(k%2) cout<<d;
            else    cout<<"0";
        }
        return 0;
    }
    

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


int main()
{
    std::ios_base::sync_with_stdio(0);	
    cin.tie(0);
    cout.tie(0);
    
	
	ll n,k;
	cin>>n>>k;
	
	ll arr[n];
	
	for(ll i=0;i<n;i++)cin>>arr[i];
	
	sort(arr,arr+n);
	
	ll ans = 0;
	
	for(ll i=0;(i<n) && (i<(n-k));i++)
	{
		ans+=arr[i];
	}	
	cout<<ans;
	
}


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

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }
        int table[11][11] = {};
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                cin >> table[i][j];
            }
        }
        for (int i = 0; i < n; i++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += table[i][j];
            }
            table[i][n] = sum;
        }
        for (int i = 0; i <= n; i++) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += table[j][i];
            }
            table[n][i] = sum;
        }
        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= n; j++) {
                printf("%5d",table[i][j]);
            }
            printf("\n");
        }
    }
}

Measured memory_bytes: 0
#include<stdio.h>
int main()
{
	int n,w,a[83],i,j;
	while(~scanf("%d",&n));
	{w=1;
	for(i=1;i<=9;i++)
	 {for(j=1;j<=9;j++)
	  {a[j*i]=1;
	  }
	 }
	 if(n<=81&&a[n]==1)w=0;
	 if(w==1)printf("No\n");
	 else printf("Yes\n");
	}
}

Measured memory_bytes: 128
#include <iostream>

int main()
{
	int ans = 1;
	int processCount, increaseNum;
	std::cin >> processCount >> increaseNum;
	for (int i = 0; i < processCount; i++)
	{
		ans < increaseNum ? ans *= 2 : ans += increaseNum;
	}
	std::cout << ans;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int x = sc.NextInt();
        int y = sc.NextInt();

        bool ok = true;

        if (y < 2 * x || 4 * x < y)
        {
            ok = false;
        }
        if ((y - 2 * x) % 2 != 0)
        {
            ok = false;
        }

        string answer = ok ? "Yes" : "No";

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


Measured memory_bytes: 27392
def c_many_requirements():
    from itertools import combinations_with_replacement as h
    N, M, Q = [int(i) for i in input().split()]
    Queries = [[int(i) for i in input().split()] for j in range(Q)]

    def calc_score(seq):
        return sum(d for a, b, c, d in Queries if seq[b - 1] - seq[a - 1] == c)
    return max([calc_score(sequence) for sequence in h(range(1, M + 1), N)])

print(c_many_requirements())

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



int main()
{
   int a,b,c,sum=0;
   cin >> a >> b>>c;
   for(int i=0;i<10;i++)
   {
       sum=a*c -b;
       cout << sum <<endl;
       c=sum;
   }
}



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

int main(){
	int R, G, B, N;
  	cin >> R >> G >> B >> N;
  	
  	int count = 0;
  	for(int r=0; r<=N/R; r++){
    	for(int g=0; g<=N/G; g++){
          	int tmp =N-R*r-G*g;
            if(tmp%B==0 && tmp>=0 && tmp/B>=0){
                count ++;
        }
        }
    }
  	cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
//#define PI 3.141592653589
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "0" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl

signed main(void){
    int X,Y,A,B,C,n;
    vector<int> p,q,r,P,Q;
    cin >> X >> Y >> A >> B >> C;
    REP(i,A){cin >> n;p.push_back(n);}
    REP(i,B){cin >> n;q.push_back(n);}
    REP(i,C){cin >> n;r.push_back(n);}
    
    sort(p.begin(),p.end(),greater<>());
    sort(q.begin(),q.end(),greater<>());
    sort(r.begin(),r.end(),greater<>());
    
    p.resize(X);q.resize(Y);
    REP(i,r.size()){
        q.push_back(r[i]);
    }
    sort(q.begin(),q.end(),greater<>());
    
    
    P.push_back(0);Q.push_back(0);
    REP(i,p.size()){
        P.push_back(p[i]);
        P[P.size()-1]+=P[P.size()-2];
    }
    REP(i,q.size()){
        Q.push_back(q[i]);
        Q[Q.size()-1]+=Q[Q.size()-2];
    }
    
    
    //REP(i,P.size()){cout << P[i] << " ";}cout << endl;
    //REP(i,Q.size()){cout << Q[i] << " ";}cout << endl;
    
    int Ans=0;
    
    REP(x,X+1){//Pからx個、QからX+Y-x個取る
        if(Q.size()-1<X+Y-x)continue;
        int num=0;
        num+=P[x];
        num+=Q[X+Y-x];
        Ans=max(Ans,num);
        //cout << x MM X+Y-x MM num << endl;
    }
    
    cout << Ans << endl;
    
    return 0;
}



Measured memory_bytes: 7536
#include <iostream>
using namespace std;
int main()
{
    string s;
    cin >> s;
    for(int i=0; i<3; i++)
    {
        if(s[i] == '7')
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <random>

using namespace std;

#define int long long

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    b -= a;
    a = 0;
    if (b < 0) b *= -1;
    for (int cnt1 = 0; cnt1 <= n - 1; cnt1++) {
        int cnt2 = n - 1 - cnt1;
        int base = c * (cnt1 - cnt2);
        int mx = (cnt1 * abs(d - c));
        int mn = (cnt2 * abs(d - c));
        if (base - mn <= b && b <= base + mx) {
            cout << "YES\n";
            return 0;
        }
    }
    cout << "NO\n";
 
}   


Measured memory_bytes: 256
#include <stdio.h>

int binarySearch(int *, int);

int length=0;

int main(){
  int n=0;
  int q=0;
  int i=0;
  int count=0;
  scanf("%d",&n);
  int S[n];
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  int T[q];
  for(i=0;i<q;i++){
    scanf("%d", &T[i]);
  }
  length=sizeof(S)/sizeof(int);
  for(i=0;i<q;i++){
    if(binarySearch(S,T[i])==1)
      count++;
  }
  printf("%d",count);
  printf("\n");

  return 0;
}

int binarySearch(int *A,int key){
  int left=0;
  int right=0;
  int mid=0;
  right=length;
  while(left<right){
    mid=(left+right)/2;
    if(key==A[mid])
      return 1;

    if(key>A[mid])
      left=mid+1;
    else if(key<A[mid])
      right=mid;
  }
  return 0;
}



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

int main() {
    int n, k;
    cin >> n >> k;
    string ans;
    cin >> ans;
    ans.at(k - 1) += ('a' - 'A');
    cout << ans << endl;
}

Measured memory_bytes: 256
def main():
    S = input()
    i = 0
    A = []
    while i < len(S):
        r = i
        while S[i] == 'R':
            i += 1
        r = i - r
        l = i
        while i < len(S) and S[i] == 'L':
            i += 1
        l = i - l
        A.extend([0] * (r - 1))
        A.append((r + 1) // 2 + l // 2)
        A.append(r // 2 + (l + 1) // 2)
        A.extend([0] * (l - 1))
    print(' '.join(str(i) for i in A))

main()


Measured memory_bytes: 10980
#include<stdio.h>

static int map[12][12];

void small(int x,int y){
	map[y][x]+=1;
	map[y][x+1]+=1;
	map[y][x-1]+=1;
	map[y+1][x]+=1;
	map[y-1][x]+=1;
}

void medium(int x,int y){
	small(x,y);
	map[y+1][x+1]+=1;
	map[y-1][x-1]+=1;
	map[y-1][x+1]+=1;
	map[y+1][x-1]+=1;
}

void big(int x,int y){
	medium(x,y);
	map[y][x+2]+=1;
	map[y][x-2]+=1;
	map[y+2][x]+=1;
	map[y-2][x]+=1;
}


int main(){
	int x[100000],y[100000],select[100000];
	int i,j;
	int space=0,max=0;
	
	for(i=0;i<12;i++){
		for(j=0;j<11;j++)map[i][j]=0;
	}
	
	i=0;
	while(scanf("%d,%d,%d",&x[i],&y[i],&select[i])!=EOF){
		switch(select[i]){
		case 1:
			small(x[i]+2,y[i]+2);
			break;
		case 2:
			medium(x[i]+2,y[i]+2);
			break;
		case 3:
			big(x[i]+2,y[i]+2);
			break;
		}
		i++;
	}
	
	for(i=2;i<12;i++){
		for(j=2;j<12;j++){
			if(map[i][j]==0)space++;
			if(max<map[i][j])max=map[i][j];
		}
	}
	
	printf("%d\n%d\n",space,max);
	
	return 0;
}

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

int main()
{
	string s, t = "keyence";
	cin >> s;
	int n = s.size();
	bool ok = false;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			for (int k = j; k <= n; k++) {
				if ((j + n - k) == (int)t.size() && s.substr(0, j) == t.substr(0, j) && (k == n || s.substr(k, n - k) == t.substr(j, n - k))) {
					ok = true;
				}
			}
		}
	}
	puts(ok ? "YES" : "NO");
	return 0;
}


Measured memory_bytes: 256
from collections import Counter
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


N, M = map(int, input().split())
mat = [list(map(lambda x:int(x)-1, input().split())) for _ in range(N)]

ans = N
sports_cand = set([v for v in range(M)])
for _ in range(M-1):
    C = Counter()
    for n in range(N):
        for m in range(M):
            if mat[n][m] in sports_cand:
                C[mat[n][m]] += 1
                break
    tmp = 0
    key, val = C.most_common(1)[0]
    ans = min(ans, val)
    sports_cand -= {key}
print(ans)


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

vector<int> par(100000, -1);
vector<int> rankt(100000, 0);

void init(int n)
{
  for(int i = 0; i < n; i++)
  {
    par.at(i) = i;
  }
}

int find(int x)
{
  if(par.at(x) == x)
  {
    return x;
  }
  else
  {
    return par.at(x) = find(par.at(x));
  }
}

void unite(int x, int y)
{
  x = find(x);
  y = find(y);
  if(x == y)return;
  
  if(rankt.at(x) < rankt.at(y))
  {
    par.at(x) = y;
  }
  else
  {
    par.at(y) = x;
    if(rankt.at(x) == rankt.at(y))rankt.at(x)++;
  }
}

bool same(int x, int y)
{
  return find(x) == find(y);
}

int main()
{
  int n, m;
  cin >> n >> m;
  vector<int> x(m);
  vector<int> y(m);
  vector<int> z(m);
  int i;
  for(i = 0; i < m; i++)
  {
    cin >> x.at(i) >> y.at(i) >> z.at(i);
  }
  init(n);
  for(i = 0; i < m; i++)
  {
    unite(x.at(i)-1, y.at(i)-1);
  }
  int ans = 0;
  for(i = 0; i < n; i++)
  {
    if(find(i) == i)ans++;
  }
  cout << ans << endl;
}

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

using ll = long long;

int main()
{
    int n;
    cin >> n;
    int res = n / 2 + n % 2;
    cout << res << endl;
}


Measured memory_bytes: 256
#_*_ coding:utf-8 _*_
import sys


while True:
    vals = sys.stdin.readline()
    if(vals is  None or vals.strip() == '' ):
        break
    a,b,c,d,e,f=list( map(float,vals.strip().split()))
    temp = a * e - d * b
    x = (c * e - b * f) / temp + 0.0
    y = (c * d - a * f) / -temp + 0.0
    print('%.3f %.3f' % (x,y))

Measured memory_bytes: 7236
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
typedef long long int ll;
typedef vector<int> vecint;
typedef vector<ll> vecll;
typedef vector<double> vecd;
typedef vector<string> vecstr;
typedef vector<char> vecchar;
typedef vector<bool> vecbool;
typedef vector<vector<bool>> vec2bool;
typedef vector<vector<int>> vec2int;
typedef vector<vector<double>> vec2d;
typedef pair<int, int> P;
////////////////////////////////////////////////
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
////////////////////////////////////////////////
struct edge {
  int to;
  int dist;
};
////////////////////////////////////////////////
int main() {
  init();
  int n, m;
  cin >> n >> m;
  vector<vector<edge>> G(n);
  REP(i, m) {
    int l, r, d;
    cin >> l >> r >> d;
    l--;
    r--;
    G[l].push_back(edge{r, d});
    G[r].push_back(edge{l, -d});
  }
  vecbool seen(n, false);
  vecint pos(n, 0);
  bool ok = true;
  REP(i, n) {
    if (seen[i]) continue;
    seen[i] = true;
    queue<int> q;
    q.push(i);
    while (!q.empty() && ok) {
      int now = q.front();
      q.pop();
      //seen[now] = true;
      for (auto& e : G[now]) {
        int test = pos[now] + e.dist;
        if (seen[e.to]) {
          if (test != pos[e.to]) {
            ok = false;
            break;
          }
        } else {
          pos[e.to] = test;
          q.push(e.to);
          seen[e.to] = true;
        }
      }
    }
    if (!ok) {
      break;
    }
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 9344
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
s = sum(a)
e = 0
for i in range(1,n,2):
    e += a[i]
ans[0] = s - 2 * e
for i in range(n-1):
    ans[i+1] = 2 * a[i] - ans[i]
print(*ans)

Measured memory_bytes: 14028
alphabetlist=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

n=int(input())
S=['']*n
for i in range(0,n):
    S[i]=input()
data=[100]*26
subdata=[0]*26
for i in range(0,n):
    subdata=[0]*26
    for j in range(0,len(S[i])):
        subdata[alphabetlist.index(S[i][j])]+=1
    for j in range(0,26):
        if subdata[j]<data[j]:
            data[j]=subdata[j]
ans=''
for i in range(0,26):
    if data[i]!=100:
        for j in range(0,data[i]):
            ans+=alphabetlist[i]
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t N;
  cin >> N;
  int64_t sum = 0;
  int64_t i = 0;
while (i <= N) {
  if(i%3 == 0){sum;} 
  else if(i%5 == 0){sum;} 
  else{sum += i;}
  i++;}
  cout << sum <<  endl;}

Measured memory_bytes: 3632
#![allow(non_snake_case)]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

#[fastout]
fn main() {
    input!{
        o: Chars,
        e: Chars,
    }

    let mut ans: Vec<char> = vec![' ';2*std::cmp::max(o.len(), e.len())];

    for i in 0..o.len() {
        ans[i*2] = o[i]
    }

    for i in 0..e.len() {
        ans[i*2+1] = e[i]
    }

    println!("{}", ans.iter().filter(|&x| *x != ' ').collect::<String>());
}


Measured memory_bytes: 2168
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>

using namespace std;

bool map[20][20];
int main() {
  int H, W;
  cin >> H >> W;
  int h, w;
  cin >> h >> w;

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < W; j++) {
      map[i][j] = true;
    }
  }
  for (int j = 0; j < w; j++) {
    for (int i = 0; i < H; i++) {
      map[i][j] = true;
    }
  }
  int ans = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (!map[i][j]) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;
std::map<int, int> m;

bool ck(int n){
	int tmp ;
	while(n){
		tmp = n%10;
		if(m[tmp]==1){
			//cout<<tmp<<endl;
			return false;
		} 
		n/=10;
	}
	return true;
}

int solve() 
{
	//happy coding

	int n,k;
	cin>>n>>k;
	int a[k+1];
	for(int i=0;i<k;i++){
		cin>>a[i];
		m[a[i]] = 1;
	}
	//cout<<ck(n)<<endl;
	int i = n;
	int tc = 1;
	while(tc){
		if(ck(i)){
			cout<<i<<endl;
			return 0;
		}else{
			i++;
		}
		//cout<<i<<endl;
	}

	
	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}

Measured memory_bytes: 256
n = int(input())
s = [input() for _ in range(n)]
ans = [float('inf')] * 26
for i in range(n):
    cnt = [0] * 26
    for j in s[i]:
        cnt[ord(j) - ord('a')] += 1
    for j in range(26):
        ans[j] = min(ans[j], cnt[j])
test = ''
for i in range(26):
    for _ in range(ans[i]):
        test += chr(i + ord('a'))
print(test)


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


bool check(int x,int N,map<int,vector<int>>& mp,int cnt){
    
    if(cnt>2){
        return false;
    }
    if(x==N){
        return true;
    }

    bool c = false;

    for (auto &&t : mp[x])
    {
        c = check(t, N, mp,cnt+1);
        if(c){
            break;
        }
    }

    return c;
}

int main()
{
    int N, M;
    cin >> N >> M;
    map<int, vector<int>> mp;
    for (int i = 0; i < M; i++)
    {
        int from, to;
        cin >> from >> to;
        mp[from].push_back(to);
    }
    if(check(1,N,mp,0)){
        cout << "POSSIBLE" << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
}


Measured memory_bytes: 19448
#include<bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
using pqueg = priority_queue<int, vector<int>, greater<int>>;
using pquel = priority_queue<int, vector<int>, less<int>>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
int lcm(int a, int b){
  return a / __gcd(a, b) * b;
}
int r_int(int a, int b){
  return rand() % b + a;
}
const lint mod=1e9+7;



int main()
{
  lint h;
  cin >> h;

  lint cnt = 0, sum = 1;
  while(h != 1){
    h /= 2;
    cnt ++;
    sum += pow(2,cnt);
  }

  cout << sum << "\n";
  return 0;
}


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

using namespace std;

typedef long long int ll;

#define FOR(i,l,r) for(i=l;i<r;i++)

#define REP(i,n) FOR(i,0,n)

#define ALL(x) x.begin(),x.end()

#define P pair<ll,ll>

#define F first

#define S second

signed main(){

  ll N,i,ans;cin>>N;

  if(N>=30)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;

}

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

int main(){
  int H,W;
  bool a=true;
  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);
    }
  }
  if(H==1&&W==1){
    a=false;
  }else if(H==1){
    for(int i=1;i<W-1;i++){
      if(s.at(0).at(i)=='#'&&s.at(0).at(i-1)=='.'&&s.at(0).at(i+1)=='.'){
        a=false;
        break;
      }
    }
  }else if(W==1){
    for(int i=1;i<H-1;i++){
      if(s.at(i).at(0)=='#'&&s.at(i-1).at(0)=='.'&&s.at(i+1).at(0)=='.'){
        a=false;
        break;
      }
    }
  }else{
    if(a){
    for(int i=1;i<H-1;i++){
      for(int j=1;j<W-1;j++){
        if(s.at(i).at(j)=='#'&&s.at(i+1).at(j)=='.'&&s.at(i-1).at(j)=='.'&&s.at(i).at(j+1)=='.'&&s.at(i).at(j-1)=='.'){
          a=false;
          break;
        }
      }
      if(a){
      }else{
        break;
      }
    }
    }
    if(a){
      for(int i=1;i<H-1;i++){
        if(s.at(i).at(0)=='#'&&s.at(i-1).at(0)=='.'&&s.at(i+1).at(0)=='.'&&s.at(i).at(1)=='.'){
          a=false;
          break;
        }
        if(s.at(i).at(W-1)=='#'&&s.at(i-1).at(W-1)=='.'&&s.at(i+1).at(W-1)=='.'&&s.at(i).at(W-2)=='.'){
          a=false;
          break;
        }
      }
    }
    if(a){
      for(int i=1;i<W-1;i++){
        if(s.at(0).at(i)=='#'&&s.at(0).at(i+1)=='.'&&s.at(0).at(i-1)=='.'&&s.at(1).at(i)=='.'){
          a=false;
          break;
        }
        if(s.at(H-1).at(i)=='#'&&s.at(H-1).at(i+1)=='.'&&s.at(H-1).at(i-1)=='.'&&s.at(H-2).at(i)=='.'){
          a=false;
          break;
        }
      }
    }
    if(a){
      if(s.at(0).at(0)=='#'&&s.at(0).at(1)=='.'&&s.at(1).at(0)=='.'){
        a=false;
      }
      if(s.at(0).at(W-1)=='#'&&s.at(1).at(W-1)=='.'&&s.at(0).at(W-2)=='.'){
        a=false;
      }
      if(s.at(H-1).at(W-1)=='#'&&s.at(H-2).at(W-1)=='.'&&s.at(H-1).at(W-2)=='.'){
        a=false;
      }
      if(s.at(H-1).at(0)=='#'&&s.at(H-2).at(0)=='.'&&s.at(H-1).at(1)=='.'){
        a=false;
      }
    }
  }
  if(a){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
    
  
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {


		public static void main(String[] args) {
			// TODO 自動生成されたメソッド・スタブ
			Scanner scanner = new Scanner(System.in);
		    String S = scanner.next();
		    String T = scanner.next();
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    String U = scanner.next();
		    int a= A;
		    int b= B;

		    if(S.equals(U)) {
		    	a = --a;
		    }else{
		    	b = --b;
		    }
		    System.out.println(a+" "+b);
		}

	}

Measured memory_bytes: 38380
#include<iostream>
#include<vector>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
int main() {
    ll n;
    std::map<std::string, bool> mp;
    string s;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s;
        mp[s] = true;
    }
    cout << mp.size() << endl;
}


Measured memory_bytes: 19180
#include<stdio.h>

int main(){
  int n, i, a, b, c;
  scanf("%d", &n);
  for(i = 0;i < n;i++){
    scanf("%d%d%d", &a, &b, &c);
    a *= a;
    b *= b;
    c *= c;
    if(a + b == c || a + c == b || b + c == a)puts("YES");
    else puts("NO");
  }
  return 0;
}

Measured memory_bytes: 580
// import chie template :) {{{
import std.stdio,
       std.algorithm,
       std.array,
       std.string,
       std.math,
       std.conv,
       std.range,
       std.container,
       std.bigint,
       std.ascii;
// }}}
// tbh.scanner {{{
class Scanner {
  import std.stdio;
  import std.conv : to;
  import std.array : split;
  import std.string : chomp;

  private File file;
  private dchar[][] str;
  private uint idx;

  this(File file = stdin) {
    this.file = file;
    this.idx = 0;
  }

  private dchar[] next() {
    if (idx < str.length) {
      return str[idx++];
    }

    dchar[] s;
    while (s.length == 0) {
      s = file.readln.chomp.to!(dchar[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)() {
    return next.to!(T);
  }

  T[] nextArray(T)(uint len) {
    T[] ret = new T[len];

    foreach (ref c; ret) {
      c = next!(T);
    }

    return ret;
  }
}
// }}}

void main() {
  auto cin = new Scanner;
  int n = cin.next!int;
  int[] a1 = cin.nextArray!int(n);
  int[] a2 = cin.nextArray!int(n);
  int ma = -1;

  foreach (i; 0 .. n) {
    int sum;
    foreach (j; 0 .. n) {
      sum += j == i ? a1[j] + a2[j] : j > i ? a2[j] : a1[j];
    }
    ma = max(sum, ma);
  }

  writeln(ma);
}


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

#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>

using namespace std;


int main() {
  int N,A,B;
  cin>>N>>A>>B;
  
  if (N*A>=B) 
    cout<<B<<endl;
  if (N*A<B)
    cout<<N*A<<endl;
}

Measured memory_bytes: 256
N = int(input())
P = [float(i) for i in input().split()]

dp = [0.0] * (N + 1)
dp[0] = 1.0

for i, p in enumerate(P, 1):
    dp = [p * a + (1 - p) * b for a, b in zip([0] + dp, dp)]

print(sum(dp[-(-N // 2):]))

Measured memory_bytes: 3316
#include<iostream>

using namespace std;

int main()
{int N ; cin >> N;
 long long A[N];
 for(int i = 0; i < N; i++){cin >> A[i];}
 
 int s = 0;int  t = 0; int u = 0;
 for(int j = 0; j < N ; j++){
   if(A[j] % 4 == 0){ s++;}
   else if(A[j] % 4 == 2){t++;}
   else{ u++;}}
 
 if( t == 0 && u <= s + 1 ){cout << "Yes" << endl;}
 else if( t > 0 && u <= s){cout << " Yes" << endl;}
 else{cout << "No" << endl;}
 
 return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main()
{
    int n;
    cin >> n;
    vector<int> ans(1e5, 0);
    for(int x = 1; x <= 100; x++)
    {
        for(int y = 1; y <= 100; y++)
        {
            for(int z = 1; z <= 100; z++)
            {
                int sum = x * x + y * y + z * z + x * y + y * z + z * x;
                ans[sum]++;
            }
        }
    }
    for(int i = 1; i <= n; i++) cout << ans[i] << endl;
}
                


Measured memory_bytes: 3672
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
using namespace std;
typedef long long ll;
#define rst(A) memset(A, 0, sizeof(A))
#define rep(I, S, T) for (int I = S; I <= T; I++)
const int inf = 1<<30;

const int maxn = 1e5+7;
int cnt[maxn];
int v[maxn];
struct MX{
    int v, id;
}mx[2][2];
int n;
void getMax(int id) {
    memset(cnt, 0, sizeof(cnt));
    for (int i = id; i < n; i+=2) {
        cnt[v[i]]++;
    }
    mx[id][0].v = mx[id][1].v = 0;
    MX * arr = mx[id];
    for (int i = 1; i < maxn; i++) 
        if (cnt[i] > arr[0].v) {
            arr[1] = arr[0];
            arr[0].v = cnt[i];
            arr[0].id = i;
        }
        else if (cnt[i] > arr[1].v) {
            arr[1].v = cnt[i];
            arr[1].id = i;
        }
}
int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", &v[i]);
    getMax(0);
    getMax(1);
    if (mx[0][0].id != mx[1][0].id) printf("%d", n - mx[0][0].v - mx[1][0].v);
    else {
        int oknum = max(mx[0][1].v + mx[1][0].v, mx[0][0].v + mx[1][1].v);
        printf("%d", n - oknum);
    }
    return 0;
}

Measured memory_bytes: 1152
class UnionFind:
    def __init__(self, n):
        self.data=[-1 for i in range(n)]

    def root(self,x):
        if self.data[x]<0:
            return x
        else:
            self.data[x]=self.root(self.data[x])
            return self.data[x]

    def uni(self,x,y):
        x=self.root(x)
        y=self.root(y)
        if(x==y):
            return
        if self.data[y]<self.data[x]:
            x,y=y,x
        self.data[x]+= self.data[y]
        self.data[y] = x

    def same(self,x,y):
        return self.root(x)==self.root(y)

    def size(self,x):
        return -self.data[self.root(x)]


n,m=map(int,input().split())
uf=UnionFind(n)
cd=[]
g=[[] for i in range(n)]
sm=0.0
for i in range(n):
    cd.append(tuple(map(int,input().split())))
f=0
for j in range(m):
    p,q=map(int,input().split())
    p,q=p-1,q-1
    uf.uni(p,q)
    f=p
    g[p].append((-((cd[p][0]-cd[q][0])**2+(cd[p][1]-cd[q][1])**2)**0.50,q))
    g[q].append((-((cd[p][0]-cd[q][0])**2+(cd[p][1]-cd[q][1])**2)**0.50,p))
    sm+=((cd[p][0]-cd[q][0])**2+(cd[p][1]-cd[q][1])**2)**0.50

from heapq import heappush, heappop, heapify
used = [0 for i in range(n)]
ans = 0
for i in range(n):
    if uf.data[i]>=0:
        continue
    que = [(c, w) for c, w in g[i]]
    used[i] = 1
    heapify(que)
    while que:
        cv, v = heappop(que)
        if used[v]:
            continue
        used[v] = 1
        ans -= cv
        for c, w in g[v]:
            if used[w]:
                continue
            heappush(que, (c, w))

print(sm-ans)


Measured memory_bytes: 16576
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    vector<vector<vector<double> > > dp(301,vector<vector<double> >(301,vector<double>(301,-1)));
    int cnt[4]={};
    dp[0][0][0]=0;
    rep(i,n){
        int tmp;cin>>tmp;
        cnt[tmp]++;
    }
    function<double(int,int,int)> solve = [&](int c3,int c2, int c1){
        DEBUG{
            printf("c3 : %d, c2 : %d, c1 : %d\n",c3,c2,c1);
        }
        if(dp.at(c3).at(c2).at(c1)!=-1){return dp[c3][c2][c1];} 
        double res=0;
        // if(c3+c2+c1!=n){res += (double)n/(n-c3-c2-c1);}
        res += (double)n/(c1+c2+c3);
        if(c3!=0){res += solve(c3-1,c2+1,c1)*(double)c3/(c1+c2+c3);}
        if(c2!=0){res += solve(c3,c2-1,c1+1)*(double)c2/(c1+c2+c3);}
        if(c1!=0){res += solve(c3,c2,c1-1)*(double)c1/(c1+c2+c3);}
        return dp[c3][c2][c1] = res;
    };
    printf("%.16f\n",solve(cnt[3],cnt[2],cnt[1]));
    return 0;
}


Measured memory_bytes: 216960
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c	 = scanner.nextInt();

		List<Integer> integerList = Arrays.asList(a,b,c);
		Collections.sort(integerList);

		System.out.println(integerList.get(0) + " " + integerList.get(1) + " "
				+ integerList.get(2));
	}
}

Measured memory_bytes: 17168