akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxn=1e6+5;
vector<ll> V;
int pre[maxn];
int main() {
    ll n,m,k;cin>>n>>m>>k;
    vector<int> a(n+1),b(m+1);
    ll ans=0,now=0,bnow=m,bsum=0;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=m;i++) cin>>b[i],bsum+=b[i];
    
    for(int i=0;i<=n;i++) {
    	k-=a[i];
    	if(k<0) break;
    	while(bsum>k) {
    		bsum-=b[bnow];bnow--;
    	}
    	ans=max(ans,i+bnow);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4848
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1000000007; 
const int INF = 1000000000; //1e9
const int NIL = -1;
const long long LINF = 1000000000000000000; // 1e18
const long double EPS = 1E-10;

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


const int inf = 1000110000; //1e9
void dfs(int v, int prv, std::vector<int>& a, std::vector<int>& ans,
         std::vector<std::vector<int>>& G, std::vector<int> &LIS){
    auto itr(std::lower_bound(LIS.begin(), LIS.end(), a[v]));
    int aa(*itr);
    *itr = a[v];
    ans[v] = std::distance(LIS.begin(),
                           std::lower_bound(LIS.begin(), LIS.end(), inf));
    for(int e: G[v]){
        if(e == prv) continue;
        dfs(e, v, a, ans, G, LIS);
    }
    *itr = aa;
}


int main(){
    int N; std::cin >> N;
    std::vector<int> a(N), ans(N, 0), LIS(N, inf);
    for(int i(0); i < N; ++i) std::cin >> a[i];
    std::vector<std::vector<int>> G(N);
    {
        int u, v;
        for(int i(0), i_len(N-1); i < i_len; ++i){
            std::cin >> u >> v;
            --u; --v;
            G[u].push_back(v);
            G[v].push_back(u);
        }
    }
    dfs(0, -1, a, ans, G, LIS);
    for(int i(0); i < N; ++i){
        std::cout << ans[i] << "\n";
    }
    return 0;
}


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

namespace ABC125
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            string[] v = Console.ReadLine().Split(' ');
            int[] vn = v.Select(x => int.Parse(x)).ToArray();

            string[] c = Console.ReadLine().Split(' ');
            int[] cn = c.Select(x => int.Parse(x)).ToArray();

            int result = 0;
            for (int i = 0; i < n; i++)
            {
                if (0 <= (vn[i] - cn[i]))
                    result += (vn[i] - cn[i]);
            }

            Console.WriteLine(result);
        }
    }
}

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

int main(){
    int h,w;
    cin >> h >> w;
    vector <vector <int>> m(h, vector <int> (w,3000));
    queue <vector <int>> q;
    int ans=0;

    string s,s2;
    vector <int> s3(3,0);
    rep(i,h){
        cin >> s;
        rep(j,w){
            s2=s[j];
            if(s2=="#"){
                s3[0]=i;
                s3[1]=j;
                q.push(s3);
                m[i][j]=0;
            }
        }
    }

    int x,y,z;
    vector <int> xyz,pu(3);
    while(q.size()!=0){
        xyz=q.front();
        q.pop();
        ans=max(ans,xyz[2]);
        m[xyz[0]][xyz[1]]=xyz[2];

        if(xyz[0]!=0){
            if(m[xyz[0]-1][xyz[1]]>xyz[2]+1){
                pu[0]=xyz[0]-1;
                pu[1]=xyz[1];
                pu[2]=xyz[2]+1;
                q.push(pu);
                m[xyz[0]-1][xyz[1]]=pu[2];
            }
        }
        if(xyz[0]!=h-1){
            if(m[xyz[0]+1][xyz[1]]>xyz[2]+1){
                pu[0]=xyz[0]+1;
                pu[1]=xyz[1];
                pu[2]=xyz[2]+1;
                q.push(pu);
                m[xyz[0]+1][xyz[1]]=pu[2];
            }
        }
        if(xyz[1]!=0){
            if(m[xyz[0]][xyz[1]-1]>xyz[2]+1){
                pu[0]=xyz[0];
                pu[1]=xyz[1]-1;
                pu[2]=xyz[2]+1;
                q.push(pu);
                m[xyz[0]][xyz[1]-1]=pu[2];
            }
        }
        if(xyz[1]!=w-1){
            if(m[xyz[0]][xyz[1]+1]>xyz[2]+1){
                pu[0]=xyz[0];
                pu[1]=xyz[1]+1;
                pu[2]=xyz[2]+1;
                q.push(pu);
                m[xyz[0]][xyz[1]+1]=pu[2];
            }
        }
    }
    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 59572
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,i,acn=0,wan=0;
  cin>>n>>m;
  vector<int> p(m),ac(n),wa(n);
  vector<string> s(m);
  for(i=0;i<m;i++){
    cin>>p.at(i)>>s.at(i);
    if(s.at(i)=="AC") ac.at(p.at(i)-1)=1;
    else if(s.at(i)=="WA" && ac.at(p.at(i)-1)==0) wa.at(p.at(i)-1)++;
  }
  for(i=0;i<n;i++){
    acn+=ac.at(i);
    if (ac.at(i)==1) wan+=wa.at(i);
  }
  cout<<acn<<' '<<wan<<endl;
}

Measured memory_bytes: 6912
#include<bits/stdc++.h>	
typedef long long ll;
#define pb push_back
#define mod 1000000007ll
const ll maxn = 9e18;
using namespace std;
const ll maxsize = 100000009;


ll arr[maxsize];
vector<ll> v(maxsize);
map<ll, ll> m;	

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

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

bool is_palindrome(string s) {
	string t(s.rbegin(), s.rend());
	return t == s;
}
 
 
void solve() {
	double l;
	cin >> l;			
	double side = l / 3;
	cout << side * side * side << endl;
}


	

int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(35);
	solve();
	return 0;
}






Measured memory_bytes: 784296
N = int(input())
A = list(map(int,input().split()))

x1 = sum(A) - 2 * sum(A[1::2])
ans = []
ans.append(str(x1))
for i in range(N-1):
    x1 = 2 * A[i] - x1
    ans.append(str(x1))
print(' '.join(ans))

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

int main() {
  int n;

  cin >> n;
  map<string,int> mp;

  for(int i=0; i<n; i++){
    string s;
    cin >> s;

    auto itr = mp.find(s);
    if(itr != mp.end()){
      itr->second++;
    }else{
      mp.emplace(s,0);
    }

  }

  int mpmax=0;

  for(auto& e:mp){
    if(mpmax < e.second){
      mpmax = e.second;
    }
  }

  for(auto itr = mp.begin();itr != mp.end();itr++){
      if(itr->second == mpmax)cout << itr->first <<endl;
  }

  return 0;

}

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

int main()
{
	const double eps = 1e-9;
	double xa,ya,xb,yb,xc,yc,xd,yd;
	while(cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd){
		if(abs((xb - xa) * (xd - xc) + (yb - ya) * (yd - yc)) <= 0){
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
}

Measured memory_bytes: 1216
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n        = Integer.parseInt(br.readLine());
		String[] tmp = br.readLine().split(" ");
		int cnt      = 0;

		for(int i = 0; i < n; i++) {

			long x = Long.parseLong(tmp[i]);

			while(x % 2 == 0) {

				x /= 2;
				cnt++;
			}

		}


		System.out.println(cnt);

	}
}


Measured memory_bytes: 35912
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
#define vi vector<int>
#define vl vector<ll>
using namespace std;
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; }
const int INF = 1e9;
const ll mod = 1000000007;

using Graph = vector<vector<int>>;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,x; cin >> n >> x;
    vector<int> a(n); rep(i,n) cin >> a[i];
    sort(all(a));
    int cnt = 0;
    rep(i,n) {
        if (x>=a[i]) {
            x -= a[i];
            cnt++;
        } else {
            break;
        }
    }
    if (cnt==n && x) cnt--;
    cout << cnt << "\n";
}


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

#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define foe(it,c) for (__typeof(c.begin()) it = c.begin(); it != c.end(); it++)
#define long long long 
#define db double 
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

const int INF = 1e9+7;
const int MOD = 1e9+7;
const int dx[4] = {0,0,-1,1};
const int dy[4] = {-1,1,0,0};

map <int, int> cnt;

int main()
{
  fastio;
  int n; cin >> n;
  long res = 0;
  for (int i = 1; i <= n; i++){
    int x; cin >> x;
    res += cnt[i - x];
    cnt[i + x]++;
  }
  cout << res;
  return 0;
}

Measured memory_bytes: 20608
from collections import Counter
def factorization(n) -> list:
	if n==1:
		return [1]
	ret = []
	i = 2
	while i*i<=n:
		while n%i==0:
			n //= i
			ret.append(i)
		i += 1
	if n!=1:
		ret.append(n)
	return ret

n,m = map(int,input().split())
mod = 10**9+7
if m==1:
	print(1);exit()

factors = Counter(factorization(m))
mx = n+max(factors.values())

fac = [1]*(mx+1)
inv = [1]*(mx+1)
for i in range(1,mx+1):
	fac[i] = fac[i-1] * i % mod
inv[-1] = pow(fac[-1], mod - 2, mod)
for i in range(mx-1, -1, -1):
	inv[i] = inv[i+1] * (i+1) % mod
def cmb(n,r):
	assert n >= r >= 0
	return fac[n] * inv[n-r] * inv[r] % mod
	
ans=1
for v in factors.values():
	ans*=cmb(n+v-1,v)
	ans%=mod

print(ans)

Measured memory_bytes: 11252
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    N = int(input())
    H = list(map(int, input().split()))
    logging.info("Hello!")

    for i in range(1, N):
        if H[N - i] < H[N - i - 1]:
            if H[N - i] == H[N - i - 1] - 1:
                H[N - i - 1] -= 1
            else:
                print("No")
                exit()


    print("Yes")
        
    
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 16056
#include <bits/stdc++.h>
using namespace std;
vector<int> dx= {1, 0, -1, 0};
vector<int> dy = {0, 1, 0, -1};
const int INF=100000000;

int main(){
    string s;
    cin>>s;
    vector<string> v={"SUN","MON","TUE","WED","THU","FRI","SAT"};
    for(int i=0; i<7; i++){
        if(v.at(i)==s) cout<<7-i<<endl;
    }
}


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

int main() {
	int N, M, a, b, c[50] = { 0 };
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> a >> b;
		c[a-1]++;
		c[b-1]++;
	}
	for (int i = 0; i < N; i++) {
		cout << c[i] << endl;
	}
}


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

using namespace std;

int n,m;
double dp[101][101];
double t[101][101];

double solve(int times, int prev){
  if(dp[times][prev] != -1) return dp[times][prev];
  if(times == m) return dp[times][prev] = 1;

  double tmp=-1;
  for(int i=0;i<n;i++){
    if(times == 0){
      tmp = max(tmp, solve(times+1, i) * 1);
    }else{
      tmp = max(tmp, solve(times+1, i) * t[prev][i]);
    }
  }
  
  return dp[times][prev] = tmp;
}

int main(void){
  while(cin >> n >> m){
    if(!(n|m)) break;
    fill((double *)dp, (double *)dp+101*101, -1);
    int ret;
    double retd;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	cin >> t[i][j];
      }
    }
    retd = solve(0,0) * 100;
    /*
    if(ret%10 >= 5){
      ret += 10;
    }
    ret /= 10;
    */
    printf("%.2lf\n", round(retd) /  100);
  }
}

Measured memory_bytes: 1144
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}
ll LCM(ll a,ll b){return (a*b)/GCD(a,b);}
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main()
{
	int n;
	cin >> n;
	int a[n];
	bool ck = 1;
	ll ans = 0;
	REP(i, n) cin >> a[i];
	while (ck){
		ck = 0;
		REP(i, n){
			if (a[i] % 2 == 0){
				ck = 1;
				a[i] /= 2;
				ans++;
			}
		}
	}

	cout << ans << endl;


}


Measured memory_bytes: 256
#include<iostream>
main(){int n,m,i,a,c[1000001];for(std::string s;std::cin>>n>>m>>s,n;printf("%d\n",a))for(a=0,i=m;--i;a+=c[i]>=n)c[i]=s.substr(i,3)=="IOI"?c[i+2]+1:0;}

Measured memory_bytes: 5836
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000007
const int INF = 1LL<<30;

int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    set<int> b;
    rep(i,n){
        cin>>a[i];
        b.insert(a[i]);
    }

    sort(all(a));
    vector<bool> ok(1000010,true);
    rep(i,n-1){
        if(a[i]==a[i+1]) ok[a[i]]=false;
    }
    
    for(auto x : b){
        for(int j=2*x;j<1000010;j+=x) ok[j]=false;
    }
    

    int ans=0;
    for(auto x : b){
        if(ok[x]){
            ans++;
            //cout<<a[i]<<endl;
        }
    }

    cout<<ans<<endl;
}

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

class Program
{
    static void Main(string[] args) {
#if DEBUG
        System.Diagnostics.Debug.WriteLine("-----TextFile1");
        System.Diagnostics.Debug.WriteLine(process("../TextFile1.txt"));
        System.Diagnostics.Debug.WriteLine("-----TextFile2");
        System.Diagnostics.Debug.WriteLine(process("../TextFile2.txt"));
        System.Diagnostics.Debug.WriteLine("-----TextFile3");
        System.Diagnostics.Debug.WriteLine(process("../TextFile3.txt"));
#endif

#if !DEBUG
        String ret = process(new System.IO.StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static string process(string filePath) {
        using (var input = new System.IO.StreamReader(filePath)) {
            if(input.EndOfStream) return "NO PROC";
            return process(input);
        }
    }

    static string process(System.IO.TextReader input) {
        var ss     = input.ReadLine();
        var spl   = ss.Split(' ');
        long s     = long.Parse(spl[0]);
        long c     = long.Parse(spl[1]);
        
        long r = 0;

        if(c <= s * 2) {
            r = c / 2;
        } else {
            r += s;
            c -= s * 2;
            r += c / 4;
        }
        return r + "";
    }
    
}

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

vector<int> sw[10];
int pr[10];

int tmp[10];

int main() {
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int k;
        cin >> k;
        sw[i] = vector<int>(k);
        for(int j = 0; j < k; j++) {
            cin >> sw[i][j];
            sw[i][j]--;
        }
    }
    for(int i = 0; i < m; i++) cin >> pr[i];

    int ans = 0;
    for(int b = 0; b < (1 << n); b++) {
        bool success = true;
        int bt = b;
        for(int i = 0; i < n; i++) {
            tmp[i] = bt % 2;
            bt /= 2;
        }
        for(int j = 0; j < m; j++) {
            int s = 0;
            for(int i = 0; i < sw[j].size(); i++) s+= tmp[sw[j][i]];

            if (s % 2 != pr[j]) success = false;
        }
        if(success) ans++;
    }

    printf("%d\n", ans);
    return 0;
}

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

long long x[100005], w[100005];

int main()
{
    cin.sync_with_stdio(false);
    long long n,l,t;
    cin>>n>>l>>t;
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> w[i];
    }

    long long shift = 0;

    if (w[0] == 1)
    {
        for (int j = 1; j < n; j++)
        {
            if (w[j] == 1) continue;
            long long init = (x[j] + l - x[0]) % l;
            if (init <= 2 * t) shift = (shift + (2 * t - init) / l + 1) % n;
        }
    }
    else
    {
        for (int j = 1; j < n; j++)
        {
            if (w[j] == 2) continue;
            long long init = (x[0] + l - x[j]) % l;
            if (init <= 2 * t) shift = (shift + (2 * t - init) / l + 1) % n;
        }
    }

    if (w[0] == 2) shift = (n - shift) % n;

    vector<long long> res;
    for (int i = 0; i < n; i++)
    {
        res.push_back(((x[i] + (w[i] == 1 ? 1 : -1) * t) % l + l) % l);
    }

    sort(res.begin(), res.end());

    int idx = lower_bound(res.begin(), res.end(), ((x[0] + (w[0] == 1 ? 1 : -1) * t) % l + l) % l) - res.begin();
    res.push_back(-1);
    if (res[idx + 1] == res[idx] && w[0] == 1) ++idx;

    for (int xx = 0; xx < n; xx++)
    {
        int i = (idx + xx + n - shift) % n;
        printf("%lld\n", res[i]);
    }
}


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

using namespace std;

#define MS(a, b) memset(a, b, sizeof(a))
#define REP(a, b, c) for (int a = b, _n = c; a <= _n; ++a)
#define DREP(a, b, c) for (register int a = b, _n = c; a >= _n; --a)
#define FOR(a, b, c) for (register int a = b, _n = c; a < _n; ++a)
#define EREP(a, b) for (register int a = head[b]; a; a = edge[a].nxt)

inline int rd () {
    int x = 0; bool f = 0; char c = getchar();
    while (c < '0' && c != '-') c = getchar();
    if (c == '-') f = 1, c = getchar();
    while (c >= '0') x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
    return f ? -x : x;
}

namespace Geometry {
    struct Point {
        double x, y;
    };
    Point operator + (const Point& A, const Point& B) { return (Point){ A.x + B.x, A.y + B.y }; }
    Point operator - (const Point& A, const Point& B) { return (Point){ A.x - B.x, A.y - B.y }; }
    Point operator * (const Point& A, const double& p) { return (Point) { A.x * p, A.y * p }; }
    Point operator / (const Point& A, const double& p) { return (Point) { A.x / p, A.y / p }; }

    const double eps = 1e-10;
    int dcmp (double x) {
        if (fabs(x) < eps) return 0;
        else return x < 0 ? -1 : 1;
    }

    typedef Point Vector;
    double Dot (Vector A, Vector B) { return A.x * B.x + A.y * B.y; }
    double Length (Vector A) { return sqrt(Dot(A, A)); }
    double Angle (Vector A, Vector B) { return acos(Dot(A, B) / Length(A) / Length(B)); }
    double Cross (Vector A, Vector B) { return A.x * B.y - A.y * B.x; }
    double Area1 (Point A, Point B, Point C) { return Dot(B - A, C - A); }
    double Area2 (Point A, Point B, Point C) { return Cross(B - A, C - A); }

    Vector Rotate (Vector A, double rad) { return (Vector) { A.x * cos(rad) - A.y * sin(rad), A.x * sin(rad) + A.y * cos(rad) }; }

    struct Line {
        Point p;
        Vector v;
    };
    Point LineIntersection (Line a, Line b) {
        Vector u = a.p - b.p;
        double t = Cross(b.v, u) / Cross(a.v, b.v);
        return a.p + a.v * t;
    }
    double PointToLine (Point A, Line l) {
        return fabs(Cross(l.v, A - l.p)) / Length(l.v);
    }
}
using namespace Geometry;


void _main () {
    Point A, B, p;
    scanf ("%lf%lf", &A.x, &A.y);
    scanf ("%lf%lf", &B.x, &B.y);
    Vector v = B - A;
    v = v / Length(v);
    swap(v.x, v.y);
    v.y = -v.y;

    Vector ba = B - A;
    int Q = rd();
    while (Q--) {
        scanf ("%lf%lf", &p.x, &p.y);
        double t = Cross(ba, p - A) / Length(ba) * 2;

        p = p + v * t;
        printf ("%.10f %.10f\n", p.x, p.y);
    }
}

int main () {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
#endif
    _main();
    return 0;
}



Measured memory_bytes: 3240
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

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

int main() {
    int n;
    cin >> n;
    vint a(n);
    rep(i, n) cin >> a[i];
    vint l(n+1, 0);
    vint r(n+1, 0);
    rep(i, n) l[i+1] = gcd(l[i], a[i]);
    rrep(i, n) r[i] = gcd(r[i+1], a[i]);

    int ans = 0;
    rep(i, n) ans = max(ans, (int)gcd(l[i], r[i+1]));

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1408
import math
import collections

n = int(input())
nums = list(map(int, input().split()))
ans1 = 0
ans2 = 0

even_list = nums[0::2]
odd_list = nums[1::2]

even_mod = collections.Counter(even_list).most_common(2)
odd_mod = collections.Counter(odd_list).most_common(2)

if even_mod[0][0] == odd_mod[0][0]:
    if len(even_mod) == 1:
        print(int(n / 2))
    else:
        print(n - even_mod[0][1] - max(even_mod[1][1], odd_mod[1][1]))
elif even_mod[0][0] != odd_mod[0][0]:
    for i in range(0, len(nums)):
        if i % 2 == 0:
            if nums[i] != even_mod[0][0]:
                ans1 += 1
        else:
            if nums[i] != odd_mod[0][0]:
                ans1 += 1
    print(ans1)
else:
    for i in range(0, len(nums)):
        if i % 2 == 0:
            if nums[i] != even_mod[0][0]:
                ans1 += 1
        else:
            if nums[i] != odd_mod[1][1]:
                ans1 += 1

    for i in range(0, len(nums)):
        if i % 2 == 0:
            if nums[i] != even_mod[1][1]:
                ans2 += 1
        else:
            if nums[i] != odd_mod[0][0]:
                ans2 += 1
    if ans1 < ans2:
        print(ans1)
    else:
        print(ans2)


Measured memory_bytes: 15964
#include <bits/stdc++.h>
// #include <iostream>
// #include <vector>
// #include <map>
// #include <algorithm>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

template<typename T>
T mod(T a, T b){
    return (a + b) % b;
}

template<typename T>
T gcd(T a, T b){
    if (b == 0) return a;
    return gcd(b, a % b);
}

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

// n を素因数分解
map<ll, ll> factor(ll n){
    map<ll, ll> mp;
    for (ll i = 2; i*i <= n; i++) {
        while (n % i == 0) {
            mp[i]++;
            n /= i;
        }
    }

    if (n > 1) {
        mp[n]++;
    }

    return mp;
}

// 文字列に "hoge" が含まれているか
// string str = "hogepiyo";
// if (str.find("hoge") != string::npos) {
//     cout << "文字列が含まれています" << endl;
// }

// char to string
// char c = 'a';
// string str = {c};

int f(int n){
    if (n & 1) {
        return 3 * n + 1;
    } else {
        return n / 2;
    }
}

void solve(){
    int s;
    cin >> s;

    map<int,int> mp;
    mp[s]++;

    // cout << mp[s] << endl;
    int ans = 2;
    while (mp[f(s)] == 0){
        ans++;
        s = f(s);
        mp[s]++;
    }

    // for (auto itr = mp.begin(); itr != mp.end(); itr++) {
    //     cout << itr->first << "  " << itr->second << endl;
    // }

    cout << ans << endl;

    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int group=n/3;
		int m=n%3;
		if(m!=0&&group<1) System.out.println(0);
		else{
			System.out.println(n/3);
		}
	}

}

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

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

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  string s;
  cin >> s;

  int result = 0;
  for (int i = s.size() - 2; i >= 2; i -= 2) {
    string a = s.substr(0, i / 2);
    string b = s.substr(i / 2, i / 2);
    if (a == b) {
      result = i;
      break;
    }
  }
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
m, n = map(int, input().split())
mp = [list("#" * (n + 2))] + [list("#" + input() + "#") for _ in range(m)] + [list("#" * (n + 2))]
vec = ((1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1))
for y in range(1, m + 1):
  for x in range(1, n + 1):
    if mp[y][x] == "x":
      for dx, dy in vec:
        if mp[y + dy][x + dx] == "-":
          mp[y + dy][x + dx] = "#"
    if mp[y][x] == "o":
      if mp[y][x - 1] == "-":mp[y][x - 1] = "#"
      if mp[y][x + 1] == "-":mp[y][x + 1] = "#"
for x in range(1, n + 1):
  if mp[1][x] == "-": mp[1][x] = "#"

print(sum([line.count("-") for line in mp]))


Measured memory_bytes: 5700
//コンパイラ最適化用
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
typedef pair<ll, ld> pld;
typedef pair<pii, int> ppiii;
typedef pair<pii, ll> ppiill;
typedef pair<pll, ll> ppllll;
typedef pair<pli, int> pplii;
typedef map<int, int> mii;
typedef deque<ll> dll;
typedef queue<ll> qll;
typedef priority_queue<ll> pqll;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqrll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<int>> vvint;
typedef vector<vector<pll>> vvpll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define cin(x) cin >> x

signed main(){
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    //入力
    ll A = 0, B =0;
    cin >> A >> B;

    //vll X(N);
    //REP(i,N) cin >> X[i];


    //本文
    if(B%A==0) cout << A+B;
    else cout << B-A;
    //出力
    //cout << ans << endl;
    //REP(i,N) cout << ans.at(i) <<endl;
  return 0;
}

Measured memory_bytes: 3660
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue(優先度付きキュー)：最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using ll = long long;
using namespace std;
/*ビットxにi番目のフラグが立っているかどうか
if(x & (1 << i))
↑ a << b == a*pow(b,2)
/*{0, 1, ..., n-1} の部分集合の全探索
for (int bit = 0; bit < (1 << n); ++bit)
*/

int main(){
  int n;  cin >> n;
  double cnt = 0;
  rep1(i,n){
    if(i % 2 == 1){
      cnt++;
    }
  }
  cout << setprecision(6) << (double)cnt/n;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int dp[108] = {0};
    dp[4] = 1;
    dp[7] = 1;
    for (int i = 0; i <= 100; i++) {
        if (dp[i] == 1) {
            dp[i + 4] = 1;
            dp[i + 7] = 1;
        }
    }
    if (dp[N] == 1) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    
    return 0;
}

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

int main(int argc, const char * argv[]) {
    int a, b, c;
    cin >> a >> b >> c;
    if (a < b){
        if (b < c) printf("Yes\n");
        else printf("No\n");
    }
    else printf("No\n");
    return 0;
}



Measured memory_bytes: 3092
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<iostream>
#include<list>
using namespace std;
int main()
{
    int n,i,len,m,j,q,T=0;
	char c[20];
	list<int> v;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>c;
		if(c[0]=='i') {cin>>m;v.push_front(m);}
		else if(c[6]=='L') v.pop_back();
		else if(c[6]=='F') v.pop_front();
		else
		{
			cin>>m;
			for(list<int>::iterator it=v.begin();it!=v.end();it++)
				if(*it==m)
				{
					v.erase(it);
					break;
				}
		}
	}
	 i=0;
	for(list<int>::iterator it=v.begin();it!=v.end();it++)
	{
		if(i++) cout<<' ';
		cout<<*it;
	}
	cout<<'\n';
    return 0;
}

Measured memory_bytes: 34248
#!/usr/bin/env python3
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

(n, m), *LL = [[*map(int,o.split())] for o in open(0)]
UF = UnionFind(n + m)
for e, (k, *L) in enumerate(LL):
    for l in L:
        UF.union(e, l + n - 1)
print("YES" if len([*filter(lambda i: i < n, UF.roots())]) == 1 else "NO")

Measured memory_bytes: 29476
n,m = map(int, input().split())

ac = [0]*n
wa = [0]*n

for i in range(m):
    p, s = input().split()
    p = int(p)

    if(s=='AC'):
        ac[p-1] = 1
    else:
        if(ac[p-1] == 0):
            wa[p-1] += 1

for i in range(n):
    wa[i] = wa[i] * ac[i]

print('{} {}'.format(sum(ac), sum(wa)))

Measured memory_bytes: 4596
N = int(input())

def create_prime_numbers2(upper_num):
    data = [2] + list(range(3,upper_num+1,2))
    idx = 0
    length = len(data)
    primes=[]
    while length>0:
        prime = data[0]
#         print(prime)
        primes.append(prime)
        data = [d for d in data if d % prime != 0]
        idx += 1
        length = len(data)
    
    return primes


prime_nums = create_prime_numbers2(55556)

print(" ".join(map(str,[num for num in prime_nums if num%5 == 1][:N])))

Measured memory_bytes: 49244
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	a, b := readI(), readI()
	type pair struct {
		a int
		b int
	}
	prices := make(map[pair]int)
	for i := 1000; i > 0; i-- {
		prices[pair{i * 8 / 100, i * 10 / 100}] = i
	}
	if ans, ok := prices[pair{a, b}]; ok {
		fmt.Println(ans)
	} else {
		fmt.Println(-1)
	}
}

/*-----------Input utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const buf = 200100
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, buf), buf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readR() []rune {
	return []rune(readS())
}

func readI() int {
	i, _ := strconv.Atoi(readS())
	return i
}

func readF() float64 {
	f, _ := strconv.ParseFloat(readS(), 64)
	return f
}


Measured memory_bytes: 1836
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int x = int.Parse(input[0]);
        int y = int.Parse(input[1]);
        int z;
        if(x<=9&&y<=9)
        {
            z = x * y;
        }
        else
        {
            z = -1;
        }

        Console.WriteLine(z);
    }
}

Measured memory_bytes: 11220
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<sstream>
#include<fstream>
using namespace std;
const int MAXN=1011;
const double pi=acos(-1.0);
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef double dbl;
const dbl eps = 1e-10;
const int MOD =  1000003;
#define For(a,b,c) for (int (a)=(b);(a)<(c);(a)++)
#define foreach(iter,V) for (__typeof((V.begin()) iter=(V).begin();iter!=(V).end();iter++)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
ll dp_a[MAXN][MAXN],dp_b[MAXN][MAXN],dp[MAXN];
int n,k;
ll INV;
int gcd(int a,int b){
	return (b == 0 ? a : gcd(b,a % b));
}
ll qpow(int a,int b){
	ll res = 1;
	ll base = a;
	while(b){
		if (b & 1)	res = (res * base) % MOD;
		base = (base * base) % MOD;
		b >>= 1;
	}
	return res;
}
int all;
inline void init(){
	INV = qpow(n,MOD - 2);
	if (k >= n)	{k = n - 1;all = 2;}
	memset(dp_a,0,sizeof(dp_a));
	memset(dp_b,0,sizeof(dp_b));
	int asum,bsum;
	dp_a[1][1] = 1;
	dp_b[1][1] = 0;
	asum = 1;
	bsum = 0;
	For(i,2,n + 1){
		dp_a[i][1] = bsum;
		dp_b[i][1] = asum;
		swap(asum,bsum);
		For(j,2,k + 1){
			dp_a[i][j] = dp_a[i - 1][j - 1];
			asum = (asum + dp_a[i][j]) % MOD;
			dp_b[i][j] = dp_b[i - 1][j - 1];
			bsum = (bsum + dp_b[i][j]) % MOD;
		}
	}
}
int main(){ 
//	freopen("in.txt","r",stdin);
	while(~scanf("%d%d",&n,&k) && (n || k)){
		all = 0;
	init();
	For(i,1,n + 1){
		dp[i] = 0;
		For(j,1,k + 1)	dp[i] = (dp[i] + dp_b[i][j]) % MOD;
		For(j,1,k)	dp_b[i][j + 1] = (dp_b[i][j + 1] + dp_b[i][j]) % MOD;
		For(p,1,min(k,i) + 1)	dp[i] = (dp[i] + dp_b[i - p][k - p]) % MOD;
	}
	int ans = 0;
	For(i,0,n)
		ans = (ans + dp[gcd(n,i)] * 2) % MOD;
	printf("%lld\n",(ll)(ans * INV + all ) % MOD);
	}
	return 0;
} 


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

using namespace std;

#define INF 1e9

int main() {
	int N, M, L, K, S, G;
	while ( cin >> N >> M >> L >> K >> S >> G, N || M || L || K || S || G ) {
		vector<bool> sisetu(N, false);
		for (int i = 0; i < L; ++i) {
			int n; cin >> n;
			sisetu[n] = true;
		}
		int dist[100][100];
		fill(&dist[0][0], &dist[0][0]+100*100, INF);
		for (int i = 0; i < K; ++i) {
			int x, y, t; cin >> x >> y >> t;
			dist[y][x] = dist[x][y] = t;
		}
		for (int i = 0; i < N; ++i) dist[i][i] = 0;


		for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) for (int k = 0; k < N; ++k) {
			if (dist[i][k] + dist[k][j] < dist[i][j]) {
				dist[i][j] = dist[i][k] + dist[k][j];
			}
		}

		int dp[100][101]; // dp[??????????????¨???][?????????M] = ????????????
		fill(&dp[0][0], &dp[0][0]+100*101, INF);
		dp[S][M] = 0;
//		for (int t = 0; t < N; ++t) {
		while (1) {
			bool isUpdated = false;
			for (int m = 0; m <= M; ++m) {
				for (int from = 0; from < N; ++from) {
					if (m < M && dp[from][m] != INF && sisetu[from]) {
						if (dp[from][m+1] > dp[from][m] + 1) {
							dp[from][m+1] = dp[from][m] + 1;
							isUpdated = true;
						}
					}
					if (dp[from][m] != INF) {
						for (int to = 0; to < N; ++to) {
							if (m >= dist[from][to]) {
								if (dp[to][m-dist[from][to]] > dp[from][m] + dist[from][to]) {
									dp[to][m-dist[from][to]] = dp[from][m] + dist[from][to];
									isUpdated = true;
								}
							}
						}
					}
				}
			}
			if (!isUpdated) break;
		}

		int ans = INF;
		for (int m = 0; m <= M; ++m) {
			ans = min(ans, dp[G][m]);
		}
		if (ans == INF) cout << "Help!" << endl;
		else cout << ans << endl;
	}
}

Measured memory_bytes: 1276
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> void re(T& x) { cin >> x; }
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "/home/o_o/MyCodes/pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  



void solve(){
	int x , y ; re(x,y);
	if (y % 2 == 0 and 2 * x <= y and y <= 4 * x) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}



signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
#define double long double
#define PI 3.141592653589793
typedef long long ll;
const int MOD = 1000000007;
const int INF = 11000000000000;
const double EPS = 1e-10;
using namespace std;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

vector<int> divisor(int n){
  vector<int> ret;
  for(int i = 1;i*i <= n;i++){
    if(n%i == 0){
      ret.push_back(i);
      if(i*i != n)ret.push_back(n/i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

int mod = 998244353;

int pow(int x, int y){
  if(y == 1)return x;
  int ret;
  if(y % 2 == 0){
    ret = pow(x, y/2);
    return ret*ret % mod;
  }else{
    ret = pow(x, y/2);
    return ret*ret % mod * x % mod;
  }
}
signed main() {
  int n;cin>>n;int d[110000];rep(i,n)cin>>d[i];
  int ans = 1;int a[110000];rep(i,110000)a[i] = 0;
  rep(i,n){
    a[d[i]]++;
  }
  int mx = -1;
  rep(i,n){
    mx = max(d[i], mx);
  }
  if(d[0] != 0 || a[0] > 1){
    cout << 0 << endl;return 0;
  }
  rep(i,mx){
    if(a[i] == 0){
      cout << 0 << endl;return 0;
    }
  }
  repd(i,1,n){
    if(a[i] == 0)break;
    ans = ans * pow(a[i-1], a[i]) % mod;
  }
  cout << ans << endl;
}




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

int main(){
	ll N,K;
	ll i;
	ll sum=0;
	cin>>N>>K;
	vector<ll>hp(N);
	rep(i,N){
		cin>>hp[i];
	}
	sort(hp.begin(),hp.end(),greater<>());
	//cout<<hp[0]<<hp[1]<<endl;
	for(int j=K;j<N;j++){
		sum+=hp[j];
	}
	cout<<sum<<endl;
	return 0;

}

Measured memory_bytes: 1792
#include "bits/stdc++.h"

typedef long long ll;
using namespace std;

vector< pair<int, int> > graph[100001];
bool visit[100001];
bool color[100001];

void dfs(int cur) {
  //cout << cur << endl;
  bool c = color[cur];
  visit[cur] = true;
  for (int i = 0; i < graph[cur].size(); i++) {
    pair<int, int> t = graph[cur][i];
    if (!visit[t.first])
    {
      color[t.first] = t.second % 2 == 0 ? c : !c;
      dfs(t.first);
    }
  }
}

int main(void) {
  int n; cin >> n;
  for (int i = 0; i < n; i++) 
    visit[i] = false;
  for (int i = 0; i < n - 1; i++) {
    int u, v, w; cin >> u >> v >> w;
    u--; v--;
    graph[u].push_back(make_pair(v, w));
    graph[v].push_back(make_pair(u, w));
  }  
  
  color[0] = true;
  dfs(0);

  for (int i = 0; i < n; i++) 
    cout << (color[i] ? 0 : 1) << endl;

  return 0;
}

Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
#define lp(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define ll long long
#define ii pair<string,int>ii;

string IntToStr(int tmp){
    ostringstream out;
    out << tmp;
    return out.str();
}

int main()
{
    int p,q,r;
    cin>>p>>q>>r;
    int a=p+q,b=q+r,c=r+p;
    int ar[5]={a,b,c};
    sort(ar,ar+3);
    cout<<ar[0]<<endl;

}














Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d %d", $N, $X);
$x = explode(" ", trim(fgets(STDIN)));
$x[] = $X;
sort($x);
$x_min = min($x);
$x = array_map(function($a) use($x_min) {return $a - $x_min;}, $x);

for ($i = 1; $i <= $N; $i++) {
    if (!isset($ans)) {
        $ans = gcd($x[$i - 1], $x[$i]);
    } else {
        $ans = gcd($ans, $x[$i]);
    }
    if ($ans === 1) break;
}
echo $ans;

//最大公約数
function gcd($m, $n){
    if($n > $m) list($m, $n) = array($n, $m);
     
    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    return $m;
}


Measured memory_bytes: 16884
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

type Node struct {
	key                 int
	parent, left, right *Node
}

type BinarySearchTree struct {
	root *Node
	n    int
}

func (bst *BinarySearchTree) insert(x int) bool {
	p := bst.findLast(x)
	u := &Node{key: x}
	return bst.addChild(p, u)
}

func (bst *BinarySearchTree) findLast(x int) *Node {
	w := bst.root
	var prev *Node

	for w != nil {
		prev = w
		if x < w.key {
			w = w.left
		} else {
			w = w.right
		}
	}
	return prev
}

func (bst *BinarySearchTree) addChild(p, u *Node) bool {
	if p == nil {
		bst.root = u
	} else {
		if u.key < p.key {
			p.left = u
		} else {
			p.right = u
		}
		u.parent = p
	}
	bst.n++
	return true
}

func preorder(u *Node, keys []int) []int {
	if u != nil {
		keys = append(keys, u.key)
		keys = preorder(u.left, keys)
		keys = preorder(u.right, keys)
	}
	return keys
}

func inorder(u *Node, keys []int) []int {
	if u != nil {
		keys = inorder(u.left, keys)
		keys = append(keys, u.key)
		keys = inorder(u.right, keys)
	}
	return keys
}

func print(keys []int) {
	w := bufio.NewWriter(os.Stdout)
	for _, key := range keys {
		w.Write([]byte(fmt.Sprintf(" %d", key)))
	}
	w.Write([]byte("\n"))
	w.Flush()
}

func main() {
	var n int
	fmt.Scan(&n)

	bst := new(BinarySearchTree)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	for i := 0; i < n; i++ {
		sc.Scan()
		command := sc.Text()

		if command == "insert" {
			sc.Scan()
			x, _ := strconv.Atoi(sc.Text())
			//insert
			bst.insert(x)
		} else if command == "print" {
			//print
			print(inorder(bst.root, []int{}))
			print(preorder(bst.root, []int{}))
		}
	}

	return
}



Measured memory_bytes: 51856
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define ld long double
#define ff first
#define ss second
const ll mod =   1e9 +7  ;
ll multiply(ll a, ll b ){ return ((a % mod) * (b % mod)) % mod; }
ll add(ll a, ll b) {     return ((a % mod) + (b % mod)) % mod; }
ll sub(ll a, ll b) { return ((a%mod) - (b % mod)+ mod) % mod ; }
////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
void solve(){
    ll n , m , v ,  p ;
    cin >> n >> m >> v >> p ;
    vector < ll > a(n) ;
    for( int i = 0 ; i < n ; i++) cin >> a[i]  ;
    sort(a.begin(),a.end());
    vector < ll > pre(n) ;
    pre[0] = a[0] ;
    for( int i = 1 ; i < n ; i++) pre[i] = pre[i-1] + a[i] ;
//    for( int i = 0 ; i < n ; i++) cout << a[i] << " "  ;
//    cerr << "\n" ;
    int ans = 0 ;
    for( int i = n-1 ; i >= 0  ; i--){
        ll r = n-p ;
        if(i>=r){
            ans++;
            continue ;
        }
        if(a[i]+m>=a[r]){
            int vote = v-p-i ;
            if(vote>0){
                ll sum = pre[r]-pre[i] ;
               // cout << i << " " << vote << " " << sum << " " << (a[i]+m)*(r-i)-sum<< "\n";
                if(m*vote<=(a[i]+m)*(r-i)-sum){
                    ans++;
                }
            }
            else{
                ans++;
            }
        }
        else{
            break ;
        }
    }
    cout << ans ;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1 ;
    //cin >> t ;
    while(t--){
        solve( );
    }
}


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

bool flag;
int i;
int buf;
int number[20];
int numOfNumber;

void check(int counter, int sum){
	if(sum == buf){
		flag = true;
		return;
	}
	if(flag || numOfNumber <= counter)return;
	check(counter + 1, sum);
	sum += number[counter];	
	check(counter + 1, sum);

	return;
}

int main(){
	ios_base::sync_with_stdio(false);	

	cin >> numOfNumber;

	for(int j = 0; j < numOfNumber; j++){
		cin >> number[j];
	}

	cin >> buf;

	while(cin >> buf){
		flag = false;
		check(0 , 0);
		cout << (flag ? "yes":"no") << endl;


	}



	return 0;
}

Measured memory_bytes: 1184
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;++i)
int main(){
    ios::sync_with_stdio(0);
    int n;
    cin>>n;
    int a,cnt4=0,cnt2=0,cnt1=0;
    rep(i,0,n){
        cin>>a;
        if(a%4==0){
            ++cnt4;
        }
        else if(a%2==0){
            ++cnt2;
        }
        else{
            ++cnt1;
        }
    }
    int flag=0;
    if(cnt2==0){
        if(cnt4>=cnt1-1){
            flag=1;
        }
    }
    else{
        if(cnt4>=cnt1) flag=1;
    }
    puts(flag?"Yes":"No");
    return 0;

}


Measured memory_bytes: 256