akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
            Console.ReadLine();
        }

        public void Solve(ConsoleInput cin)
        {
            int a = cin.ReadInt;
            long sum = 1;

            for (int i = 1; i < a+1; i++)
            {
                sum = sum * i % 1000000007;
            }

            Console.WriteLine(sum);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long num) { var ret = new string[num]; for (long i = 0; i < num; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long num) { var ret = new int[num]; for (long i = 0; i < num; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long num) { var ret = new long[num]; for (long i = 0; i < num; ++i) ret[i] = ReadLong; return ret; }
    }
}

Measured memory_bytes: 13268
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int l = 0;
        int r = N;
        int[] cnt = new int[N];
        int ans = 0;
        for (int i = 0; i < M; i++) {
            l = Math.max(l, scanner.nextInt());
            r = Math.min(r, scanner.nextInt());
        }
        System.out.println(r - l >= 0 ? r - l + 1 : 0);
    }

}


Measured memory_bytes: 65232
<?php
list($h,$w) = explode(" ",trim(fgets(STDIN)));
while($h > 0){
    $i = 0;
    while($i < $h){
        $a[$i] = array_fill(0,$w,"#");
        ++$i;
    }
    $h -= 2;
    while($h > 0){
        $i = 1;
        while($i < $w - 1){
            $a[$h][$i] = ".";
            ++$i;
        }
        --$h;
    }
    foreach($a as $val){
        foreach($val as $val2){
            echo $val2;
        }
        echo PHP_EOL;
    }
    unset($a);
    echo PHP_EOL;
    list($h,$w) = explode(" ",trim(fgets(STDIN)));
}

Measured memory_bytes: 18408
/*
    Author : RAJON BARDHAN
    AUST CSE 27th Batch
    All my programming success are dedicated to my mom , dad , little sister madhobi , teachers , friends and love TANIA SULTANA RIMY

    Problem Name : DSL_2_A - Range Minimum Query
    ALGORITHM : Square Root Decomposition
*/

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define memo(a,b) memset(a,b,sizeof(a))
#define INF 1e9
#define EPS 1e-8
#define PI 3.14159265358979323846

typedef long long ll ;
typedef unsigned long long ull ;

/* int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; */ // 4 Direction
/* int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; */ // 8 Direction
/* int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; */ // Knight Direction
/* int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; */ // Hexagonal Direction

const int blockSZ = 600 ;
int arr[100000+10] , BLOCK[600] ;

int getID(int index)
{
    return index / blockSZ ;
}

void update(int index,int value)
{
    arr[index] = value ;
    int blockID = getID(index) , start = blockID*blockSZ , end = (blockID+1)*blockSZ-1 ;

    for(int i=start ; i<=end ;i++)
    {
        if(i==start) BLOCK[blockID] = arr[i] ;
        else BLOCK[blockID] = min(BLOCK[blockID],arr[i]);
    }
}

int query(int L,int R)
{
    int lid = getID(L) , rid = getID(R) ;

    if(lid==rid)
    {
        int mn = 2147483647 ;
        for(int i=L;i<=R;i++) mn = min(mn,arr[i]);
        return mn ;
    }

    int mn1 = 2147483647 , mn2 = 2147483647 , mn3 = 2147483647 ;

    for(int i=L;i<=lid*blockSZ+blockSZ-1;i++) mn1 = min(mn1,arr[i]);
    for(int i=lid+1;i<rid;i++) mn2 = min(mn2,BLOCK[i]);
    for(int i=rid*blockSZ;i<=R;i++) mn3 = min(mn3,arr[i]);

    return min(min(mn1,mn3),mn2);
}
int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int N , Q ;
    scanf("%d%d",&N,&Q);
    for(int i=0;i<N;i++) update(i,2147483647);

    while( Q-- )
    {
        int d , x , y ;
        scanf("%d%d%d",&d,&x,&y);

        switch( d )
        {
            case 0 :
                update(x,y);
                break ;
            case 1 :
                printf("%d\n",query(x,y));
                break ;
        }
    }
    return 0;
}

Measured memory_bytes: 1580
#include<bits/stdc++.h>
#define llong long long
#define mkpr make_pair
#define riterator reverse_iterator
using namespace std;

inline int read()
{
	int x = 0,f = 1; char ch = getchar();
	for(;!isdigit(ch);ch=getchar()) {if(ch=='-') f = -1;}
	for(; isdigit(ch);ch=getchar()) {x = x*10+ch-48;}
	return x*f;
}

const int N = 3e5;
const int P = 1e9+7;
char a[N+3];
int trans[9][2] = {{3,1},{4,2},{5,2},{6,0},{7,1},{8,2},{3,3},{4,4},{5,5}};
llong dp[N+3][9];
int n;

void updsum(llong &x,llong y) {x = x+y>=P?x+y-P:x+y;}

int main()
{
	scanf("%s",a+1); n = strlen(a+1);
	dp[0][0] = 1ll;
	for(int i=1; i<=n; i++)
	{
		for(int j=0; j<9; j++)
		{
			if(a[i]!='1') {updsum(dp[i][trans[j][0]],dp[i-1][j]);}
			if(a[i]!='0') {updsum(dp[i][trans[j][1]],dp[i-1][j]);}
		}
	}
	llong ans = (dp[n][1]+dp[n][2]+dp[n][5]+dp[n][8])%P;
	printf("%lld\n",ans);
	return 0;
}

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

const int MOD = 1000000007;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to))
#define sort(a) sort(a.begin(), a.end())
#define reverse(s) reverse(s.begin(), s.end())
#define p(s) cout << (s) << endl

typedef long long ll;
using namespace std;

template<class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}

template<class T>
T max(vector<T> &v) {
  return *max_element(v.begin(), v.end());
}

template<class T>
T min(vector<T> &v) {
  return *min_element(v.begin(), v.end());
}

void py(bool isUpper = false) {
  if (isUpper) {
    p("YES");
  } else {
    p("Yes");
  }
}

void pn(bool isUpper = false) {
  if (isUpper) {
    p("NO");
  } else {
    p("No");
  }
}

int main() {
  int n;
  cin >> n;
  string a, b, c;
  cin >> a >> b >> c;

  int count = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] != b[i] && b[i] != c[i] && a[i] != c[i]) {
      count += 2;
    } else if (a[i] == b[i] && b[i] == c[i]) {
      continue;
    } else {
      count++;
    }
  }
  p(count);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <utility>

using namespace std;

vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};

template<typename T> 
void show(T a){
  for(auto i : a){ cout << i << " "; }
  cout << endl;
}
template<typename T> 
void showmatrix(T a){
  for(auto j: a){for(auto i : j){ cout << i; }cout << endl;}
  cout << endl;
}


int main(int argc, char *argv[]){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  
  int n, m;
  cin >> n >> m;
  vector<int> v(m, 0);
  int tmp;
  for(int i = 0; i < n; i++){
    cin >> tmp;
    for(int j = 0; j < tmp; j++){
      int t;
      cin >> t;
      v[t-1]++;
    }
  }
  int count = 0;
  for(int i = 0; i < m; i++){
    if(v[i] == n) count++;
  }
  //show(v);
  cout << count << endl;

}


Measured memory_bytes: 256
import java.util.*;

class Main {
        public static void main(String args[]) {
                Scanner sc = new Scanner(System.in);
                while(true){
                        int N = sc.nextInt();
                        if(N==0) {
                                break;
                        }
                        int[] a = new int[N];
                        for (int i = 0; i < N; i++) {
                                a[i] = sc.nextInt();
                        }
                        Arrays.sort(a);
                        long ans = 0;
                        for (int i = 0; i < N; i++) {
                                ans += (N - i - 1) * a[i];
                        }
                        System.out.println(ans);
                }
        }
}

Measured memory_bytes: 47528
#include<cstdio>
#include<cstring>
#include<queue>
#include<utility>
using namespace std;
typedef struct P{int x,y,t;};
int M[10][10],MX[12]={-2,-2,-2,-1,-1,0,0,1,1,2,2,2},MY[12]={-1,0,1,-2,2,-2,2,-2,2,-1,0,1};
int lim(int y,int x){return y>=0&&x>=0&&x<10&&y<10;}
int main()
{
	int N,f=0;
	P tmp;
	for(;scanf("%d%d",&tmp.x,&tmp.y),tmp.x+tmp.y;)
	{
		tmp.t=f=0;
		memset(M,0,sizeof(M));
		scanf("%d",&N);
		for(int i=0;i<N;i++)
		{
			int x,y;
			scanf("%d%d",&x,&y);
			for(int my=-1;my<2;my++)
				for(int mx=-1;mx<2;mx++)
					if(lim(y+my,x+mx))
						M[y+my][x+mx]|=1<<i;
		}
		queue<P> Q;
		Q.push(tmp);
		for(;!Q.empty();)
		{
			tmp=Q.front();Q.pop();
			if(tmp.t==N)
			{
				f=1;
				break;
			}
			for(int i=0;i<12;i++)
			{
				int nx=tmp.x+MX[i],ny=tmp.y+MY[i];
				if(lim(nx,ny)&&M[ny][nx]&(1<<tmp.t))
				{
					P next={nx,ny,tmp.t+1};
					Q.push(next);
				}
			}
		}
		puts(f?"OK":"NA");
	}
	return 0;
}

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

int main() {
    int a, b; cin >> a >> b;
    if (a <= 0 && 0 <= b) cout << "Zero" << endl;
    else if (a > 0) cout << "Positive" << endl;
    else {
        int num = b - a + 1;
        if (num % 2 == 0) cout << "Positive" << endl;
        else cout << "Negative" << endl;
    }
}

Measured memory_bytes: 256
/**
 * Author: Behradm
 * Created: 10-05-2020 16:33:41
 * In the Name of God
**/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define LOCAL

#ifdef LOCAL
	#define debugi(x) cerr << "{" << #x << "}: " << (x) << '\n'
	#define debug(v, begin, end) cerr << "{ | "; for(auto i = begin; i < end; i++){cerr << #v << "[" << i << "]: " << v[i] << " | ";} cerr << " }\n"
	#define debugp(a, b) cerr << "\n{ " << a << " " << b << " }\n"
#else
	#define debugi(x) 42
	#define debug(v, begin, end) 42
	#define debugp(a, b) 42 
#endif

int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
	cout.tie(0);
	cout.precision(6);
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int res = 0;
	res = min(k, a);
	k -= min(k, a);

	if ( k > 0)
		k -= b;

	if ( k > 0) {
		res -= min(c, k);
	}
	/*if (k >= a) {
		res = a;
		k -= a;
	}

	if (k >= b){
		k -= b;
	}

	if (k > 0){
		res -= min(c, k);
	}*/
	cout << res << '\n';
	return 0;
}



Measured memory_bytes: 3652
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define int long long
#define pi 3.141592653589793238462643383279502
#define M 998244353
#define F first
#define S second
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
bool isPowerOfTwo(int n)
{
   if(n==0)
   return false;

   return (ceil(log2(n)) == floor(log2(n)));
}
int power(int x, unsigned int y)
{
    int res = 1;

    while (y > 0)
    {
        if (y & 1)
            res = res*x;


        y = y>>1;
        x = x*x;
    }
    return res;
}

signed main()
{
int a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int k;
cin>>k;
cout<<a[k-1]<<endl;

}










Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int a,b,c,x;
    scanf("%d %d %d",&a,&b,&c);
    if(a>b){
        x=a;
        a=b;
        b=x;
    }
    if(a>c){
        x=a;
        a=c;
        c=x;
    }
    if(b>c){
        x=b;
        b=c;
        c=x;
    }
    printf("%d %d %d\n",a,b,c);
    return 0;
}


Measured memory_bytes: 2112
import itertools


def main():
    H, W, K = list(map(int, input().split(' ')))
    C = [input() for _ in range(H)]
    ans = 0
    for hp in itertools.product([0, 1], repeat=H):
        for wp in itertools.product([0, 1], repeat=W):
            black_cnt = 0
            for h in range(H):
                if hp[h] == 0:
                    continue
                for w in range(W):
                    if wp[w] == 0:
                        continue
                    if C[h][w] == '#':
                        black_cnt += 1
            if black_cnt == K:
                ans += 1
    print(ans)



if __name__ == '__main__':
    main()

Measured memory_bytes: 9228
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef int Int;
typedef pair<Int,Int> pii;
typedef pair<Int,double> pid;
typedef pair<double,double> pdd;
typedef pair<Int,pii> pip;
typedef pair<double,Int> pdp;
#define A first
#define B second
#define pb(x) push_back(x)
#define ALL(x) x.begin(),x.end()
#define SZ(x) (x).size()
#define CLR(x) memset(x,0,sizeof x)
#define pdebug() printf("%d\n",__LINE__)
#define Itype(a) typeof(a.begin()) 
#define REP(i,a,b) for(int i = (a);i <= (b);i++)
#define FORO(i,n) REP(i,0,(int)n-1)
#define FORI(i,n) REP(i,1,(int)n)
#define FORIT(i,t) for(Itype(t) i = t.begin();i != t.end();i++)
#define eps 1e-6
#define sqr(x) ((x)*(x))
#define dist(_a,_b) sqrt(sqr(_a.A-_b.A)+sqr(_a.B-_b.B))
#define norm(_a) sqrt(sqr(_a.A)+sqr(_a.B))
template<typename T>void getMin(T &a,T b) { if(a > b) a = b; }
template<typename T>void getMax(T &a,T b) { if(a < b) a = b; }
const int MOD = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M;
    cin >> N >> M;
    vector<pii> p(N);
    FORO(i, N) cin >> p[i].A >> p[i].B;
    sort(ALL(p));
    ll ans = 0;
    int t = M;
    FORO(i, N) {
        ans += (ll)p[i].A * min(t, p[i].B);
        t -= p[i].B;
        if(t <= 0) break;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
import sys
from collections import deque

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, X, Y = map(int, readline().split())

    X -= 1
    Y -= 1

    G = [[] for _ in range(N)]
    for i in range(N - 1):
        G[i].append(i + 1)
        G[i + 1].append(i)

    G[X].append(Y)
    G[Y].append(X)

    count = [0] * N

    for i in range(N):
        dist = [-1] * N
        dist[i] = 0
        queue = deque([i])
        while queue:
            v = queue.popleft()
            for nv in G[v]:
                if dist[nv] == -1:
                    dist[nv] = dist[v] + 1
                    count[dist[nv]] += 1
                    queue.append(nv)

    ans = [c // 2 for c in count[1:]]
    print('\n'.join(map(str, ans)))
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 75300
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define chmax(x,y) x = max(x,y)

 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int> > VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;
typedef vector<LL> VL;
typedef vector<vector<long long>> VVLL;
typedef vector<set<int>> VSI;
const int MOD = 1e9+7;
const int INF = 1e9;
const LL LINF = 1e18;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}
struct UnionFind {
    VI d;
    UnionFind(int n = 0): d(n,-1) {}
    int find(int x) {
        if(d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x,int y) {
        x = find(x); y = find(y);
        if(x == y) return false;
        if(d[x] > d[y]) swap(x,y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x,int y) { return find(x) == find(y); }
    int size(int x) { return -d[find(x)]; }
};
int deg[100005];
VI to[100005];

int main() {
    LL n,k;
    cin >> n >> k;
    LL ans = 0;
    while(n>0) {
        n /= k;
        // cout << n << endl;
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する

int main(){
    int n;
    string s;
    cin>>n;
    cin>>s;
    int max = 0;
    for(int i=0;i<n;i++){
        string l = s.substr(0,i);
        string r = s.substr(i,n);
        //cout<<l<<" "<<r<<endl;
        map<char,int> L,R;
        for(int j = 0;j<l.length();j++){
            L[l[j]]++;
        }
        for(int k = 0;k<r.length();k++){
            R[r[k]]++;
        }
        int nibu=0;
        for(auto c:L){
            char moji = c.first;
            if(R.count(moji)){
                nibu++;
            }
        }
        if(nibu>max){
            max = nibu;
        }
    }
    cout<<max<<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define MAXN 300010
struct Point
{
    int x,y;
    bool operator < (const Point &a) const
    {
        return x<a.x;
    }
}p[MAXN];
struct node
{
    int l,r,w,lazy;
}tree[MAXN*4];
void PushUp(int i)
{
    if(tree[i].l==tree[i].r) return ;
    tree[i].w=max(tree[i<<1].w,tree[i<<1|1].w);
}
void PushDown(int i)
{
    if(tree[i].l==tree[i].r||!tree[i].lazy) return;
    int tmp=tree[i].lazy;
    tree[i<<1].lazy+=tmp,tree[i<<1].w+=tmp;
    tree[i<<1|1].lazy+=tmp,tree[i<<1|1].w+=tmp;
    tree[i].lazy=0;
}
void Build(int i,int l,int r)
{
    tree[i].l=l,tree[i].r=r,tree[i].lazy=0,tree[i].w=0;
    if(l==r)
        return;
    int mid=(l+r)/2;
    Build(i<<1,l,mid);
    Build(i<<1|1,mid+1,r);
}
void Modify(int i,int l,int r,int k)
{
    if(tree[i].l>r||tree[i].r<l) return;
    if(l<=tree[i].l&&tree[i].r<=r)
    {
        tree[i].lazy+=k;
        tree[i].w+=k;
        return;
    }
    PushDown(i);
    Modify(i<<1,l,r,k);
    Modify(i<<1|1,l,r,k);
    PushUp(i);
}
int st[2][MAXN],top[2];
int ans,w,h,n;
void Solve()
{
    sort(p+2,p+1+n);
    Build(1,1,n);
    top[0]=top[1]=0;
    st[0][0]=st[1][0]=1;
    Modify(1,1,n,h<<1);
    for(int i=2;i<=n;i++)
    {
        Modify(1,1,i-1,(p[i].x-p[i-1].x)<<1);
        ans=max(ans,tree[1].w);
        if(p[i].y>=(h>>1))
        {
            Modify(1,st[0][top[0]],i-1,(p[i].y-h)<<1);
            while(top[0]&&p[st[0][top[0]]].y>=p[i].y)
            {
                Modify(1,st[0][top[0]-1],st[0][top[0]]-1,(p[i].y-p[st[0][top[0]]].y)<<1);
                top[0]--;
            }
            st[0][++top[0]]=i;
        }
        else
        {
            Modify(1,st[1][top[1]],i-1,-p[i].y<<1);
            while(top[1]&&p[st[1][top[1]]].y<=p[i].y)
            {
                Modify(1,st[1][top[1]-1],st[1][top[1]]-1,(p[st[1][top[1]]].y-p[i].y)<<1);
                top[1]--;
            }
            st[1][++top[1]]=i;
        }
    }
}
int main()
{
    scanf("%d%d%d",&w,&h,&n);
    n++;
    for(int i=2;i<=n;++i)
        scanf("%d%d",&p[i].x,&p[i].y);
    p[++n].x=w,p[n].y=h;
    Solve();
    swap(w,h);
    for(int i=1;i<=n;i++)
        swap(p[i].x,p[i].y);
    Solve();
    printf("%d\n",ans);
}
/*
感觉这个性质已经劝退95%的人了... 
首先你要想到，这个矩形肯定经过某个坐标的中点
*/

Measured memory_bytes: 22144
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <iterator>
#include <cmath>
#include <deque>
#include <stack>
#include <functional>
#include <queue>

#define int long long

int dp[100000];

signed main()
{
    {
        if (fopen("input.txt", "r")) {
            freopen("input.txt", "r", stdin);
            freopen("output.txt", "w", stdout);
        }
        std::ios_base::sync_with_stdio(false);
        std::cin.tie(NULL);
        std::cout.tie(NULL);
    }
    
    dp[0] = 0;
    int s = 3, k = 2;
    for (int i = 1; i != 100000; ++i) {
        if (i == s) {
            ++k;
            s += k;
        }
        dp[i] = k - 1;
    }
    int n;
    std::cin >> n;
    int ans = 0;
    for (int i = 2; i <= 1000000; ++i)
        if (n % i == 0) {
            int d = 0;
            while (n % i == 0) {
                ++d;
                n /= i;
            }
            ans += dp[d];
        }
    if (n > 1)
        ++ans;
    std::cout << ans;
    return 0;
}

Measured memory_bytes: 4420
#include <iostream>
using namespace std;
int H,W;
char C[110][110];
char res[210][110];
int main()
{
  cin >> H >> W;
  for(int i=0;i<H;++i){
    for(int j=0;j<W;++j){
      cin >> C[i+1][j];
    }
  }
  for(int i=1;i<=2*H;++i){
    for(int j=0;j<W;++j){
      cout << C[(i+1)/2][j];
    }
    cout  << "\n";
  }
  
  return 0;
}


Measured memory_bytes: 256
using System;
using System.IO;
using System.Linq;

namespace GCD_On_Blackboard
{
    class Program
    {
        public static void Main(string[] args)
        {
            using (var sc = new SetConsole())
            {
                int n = Console.ReadLine().ToInt();
                var input = GetArrayIntInput();
                var l = new int[n + 1];
                var r = new int[n + 2];
                l[0] = 0;
                r[n + 1] = 0;
                for (int i = 1; i <= n; i++)
                {
                    l[i] = GCD(l[i - 1], input[i - 1]);
                }
                for (int i = n; i > 0; i--)
                {
                    r[i] = GCD(r[i + 1], input[i - 1]);
                }
                var m = new int[n + 1];

                for (int i = 1; i <= n; i++)
                {
                    m[i] = GCD(l[i - 1], r[i + 1]);
                }
                CWrite(m.Max());
            }
        }

        static string[] GetArrayCharInput() => Console.ReadLine().Split();
        static int[] GetArrayIntInput() => Console.ReadLine().StringToIntArray();
        static int GetIntInput() => Console.ReadLine().ToInt();
        static void CWrite<T>(T str) => Console.WriteLine(str);
        static int GCD(int x, int y)
        {
            if (y == 0) { return x; }
            if (x == 0) { return y; }

            if (y > x)
            {
                int tmp = x;
                x = y;
                y = tmp;
            }

            int mod;
            do
            {
                mod = x % y;
                x = y;
                y = mod;
            }
            while (mod != 0);

            return x;
        }
    }

    class SetConsole : IDisposable
    {
        readonly StreamWriter sw = new StreamWriter(Console.OpenStandardOutput());
        public SetConsole()
        {
            sw.AutoFlush = false;
            Console.SetOut(sw);
        }
        public void Dispose()
        {
            Console.Out.Flush();
            sw.AutoFlush = true;
            Console.SetOut(sw);
        }
    }

    static class ExtentionsLibrary
    {
        public static int[] StringToIntArray(this string str) =>
            str.Split().Select(int.Parse).ToArray();
        public static int ToInt(this string str) => int.Parse(str);
    }
}


Measured memory_bytes: 29532
#include<bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define MOD (int)1e9+(int)7
typedef long long ll;
//dark power
//#define int ll
//define Error、大抵は、セミコロン忘れとか、Defineは関係ない
/*
vector<int> d(100000);
vector<int> b(100000);
class UnionFind{
	public:
	UnionFind(signed n){rep(i,n){d[i]=i;b[i]=0;}}
	signed find(signed x){
		if(d[x]==x){
			return x;
		}else{
			return d[x]=find(d[x]);
		}
	}
	UnionFind(signed n){rep(i,n){d[i]=i;b[i]=0;}}
	void unite(signed x,signed y){
		x=find(x);
		y=find(y);
		if(x==y)return;
		if(b[x]<b[y]){
			d[x]=y;
		}else{
			d[y]=x;
			if(b[x]==b[y])b[x]++;
		}
	}
	bool same(signed x,signed y){return (find(x)==find(y));}
};
*/
signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	vector<int> v(n);
	rep(i,n)cin>>v[i];
	sort(all(v));
	v[n-1]=v[n-1]/2;
	int sum=0;
	rep(i,n)sum+=v[i];
	cout<<sum<<endl;

	return 0;
}

Measured memory_bytes: 256
N, X = map(int, input().split())

size = [1]
patty = [1]
for i in range(N):
    size.append(size[i]*2 + 3)
    patty.append(patty[i]*2 + 1)

def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= size[N-1] + 1:
        return f(N-1, X-1)
    elif X == size[N-1] + 2:
        return patty[N-1] + 1
    elif X >= size[N-1] + 3:
        return patty[N-1] + 1 + f(N-1, X-size[N-1]-2)
print(f(N,X))


Measured memory_bytes: 9196
#include <bits/stdc++.h>
using namespace std;
                     
#define int             long long
#define ld              long double
#define mp              make_pair
#define ff              first
#define ss              second
#define pb              push_back
#define fo(i,n)         for(i=0;i<n;i++)
#define fo1(i,n)        for(i=1;i<=n;i++)
#define FO(i,k,n)       for(i=k;k<=n?i<=n:i>=n;k<=n?i++:i--)
#define all(c)          c.begin(),c.end()
#define rall(c)         c.rbegin(),c.rend()
#define si              set<int>
#define vi              vector<int>
#define mii             map<int,int>
#define pii             pair<int,int>
#define vpii            vector<pii>
#define vvi             vector<vi>
#define usi             unordered_set<int>
#define umii            unordered_map<int,int>
#define pqmx            priority_queue<int>
#define pqmn            priority_queue<int,vi,greater<int> >
#define sp(x)           cout<<setprecision(x)<<fixed;
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define in(a,n)         vi a(n);fo(i,n)cin>>a[i];
#define in1(a,n)        vi a(n+1);fo1(i,n)cin>>a[i];
#define w(t)            int t;cin>>t;while(t--)
#define gcd             __gcd
#define lcm(x,y)        x*(y/gcd(x,y))
#define endl            '\n'
#define PI              3.14159265358979323846
#define inf             1e18
#define mod             1000000007
void __p(int x) {cout<<x;}
void __p(int32_t x){cout<<x;}
void __p(float x){cout<<x;}
void __p(double x){cout<<x;}
void __p(ld x) {cout<<x;}
void __p(char x){cout <<'\''<<x<<'\'';}
void __p(const char *x){cout <<'\"' <<x<<'\"';}
void __p(const string &x) {cout<<'\"'<<x<<'\"';}
void __p(bool x) {cout<<(x?"true":"false");}
void _p() {cout << "]\n";}
template<typename T,typename V>     void __p(const pair<T,V> &x) {cout<<'{';__p(x.first);cout<<',';__p(x.second);cout<<'}';}
template<typename T>                void __p(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __p(i); cout << "}";}
template <typename T,typename... V> void _p(T t, V... v) {__p(t);if(sizeof...(v))cout<<", ";_p(v...);}
int po(int x,int p,int m = inf) {int ans=1;x%=m;while(p>0){if(p&1)ans=(ans*x)%m;p=p>>1;x=(x*x)%m;}return ans;}
int inv(int x,int m=mod){return po(x,m-2,m)%m;}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout<<"["<<#x<<"]=[";_p(x)
#else 
#define dbg(x...)
#endif
//=================================================================================




const int N=1e6+6;
int n,m,k,x,y,z,a,b,c,d,i,j,l,r;








void sol()
{   ld m;
    cin>>n>>m;
    x=m;
    
    
    y=n*x;
    ld z=m-x;
    z=(ld)n*z;
    y=y+z;
    cout<< y <<endl;
}





int32_t main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //sp(10);
    // w(t)
    sol();
    return 0;
}

Measured memory_bytes: 3744
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

#define ALL(x) (x).begin(), (x).end()
#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)


void solve(long long P, long long Q, long long R){
    lint res = 999999;
    res = min(res, P+Q);
    res = min(res, R+Q);
    res = min(res, P+R);
    cout << res << "\n";
}

int main(){

    long long P;
    scanf("%lld",&P);
    long long Q;
    scanf("%lld",&Q);
    long long R;
    scanf("%lld",&R);
    solve(P, Q, R);
    return 0;
}



Measured memory_bytes: 256
n=int(input())
l=list(map(int, input().split()))
l.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]+l[j]>l[k] and l[i]!=l[j] and l[j]!=l[k]:
        ans+=1
print(ans)

Measured memory_bytes: 9172
#include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';

//INSERT ABOVE HERE
set<string> ans;

// use ~ as anary minus at end
// 1~ as -1
string conv(int val){
  string res=to_string(abs(val));
  if(val<0) res+='~';
  //cout<<val<<':'<<res<<endl;
  return res;
}

int calc(int a,int b,char c){
  if(c=='+') return a+b;
  if(c=='-') return a-b;
  if(c=='*') return a*b;
  if(c=='/') return a/b;
  abort();
}

void dfs2(vector<int> vs,vector<char> cs,vector<int> &res){
  if(cs.empty()){
    res.emplace_back(vs[0]);
    return;
  }
  for(int i=0;i<(int)cs.size();i++){
    auto nv=vs;
    auto nc=cs;
    if(vs[i+1]==0 and cs[i]=='/') continue;
    int tmp=calc(vs[i],vs[i+1],cs[i]);
    nv.erase(nv.begin()+i);
    nc.erase(nc.begin()+i);
    nv[i]=tmp;
    dfs2(nv,nc,res);
  }
}

vector<string> solve2(vector<int> vs,vector<char> cs){
  vector<int> res;
  dfs2(vs,cs,res);
  vector<string> tmp;
  for(int val:res) tmp.emplace_back(conv(val));
  return tmp;
}

void dfs(string s){
  // cout<<s<<endl;

  if(s[0]!='('){
    ans.emplace(s);
    return;
  }

  int op=0,ma=0;
  for(char c:s){
    if(c=='(') op++;
    if(c==')') op--;
    chmax(ma,op);
  }

  int n=s.size();
  int l=0,r=0;
  for(int i=0;i<n;i++){
    if(op==ma and s[i]==')') r=i;

    if(s[i]=='(') op++;
    if(s[i]==')') op--;

    if(op==ma and s[i]=='(') l=i;
  }

  vector<int> vs;
  vector<char> cs;
  vs.emplace_back(0);
  for(int i=l+1;i<r;i++){
    if(s[i]=='~') vs.back()*=-1;
    else if(s[i]=='+' or s[i]=='-' or s[i]=='*' or s[i]=='/')
      cs.emplace_back(s[i]),vs.emplace_back(0);
    else
      vs.back()=vs.back()*10+(s[i]-'0');
  }

  auto res=solve2(vs,cs);
  for(string t:res)
    dfs(s.substr(0,l)+t+s.substr(r+1));
}

int solve(string s){
  ans.clear();
  dfs(s);
  cout<<ans.size()<<newl;
  return 0;
}

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

  string s;
  while(cin>>s,s!="#") solve("("+s+")");
  return 0;
}



Measured memory_bytes: 33516
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  double d, f;
  cin >> a >> b;
  d = (double) ( a + b ) / 2;
  f = (double) (int) d;
  cout << ( f == d ? (int) d : (int) d + 1 ) << endl;
}

Measured memory_bytes: 3580
#include<bits/stdc++.h>
#include<iomanip>
#include <numeric>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007
#define KETA 40

using namespace std;

typedef long long  ll;
typedef pair<ll,ll> P1;
typedef pair<string,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<Pi,int> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int main() {

	int r;
	cin>>r;
	cout<<r*r*3<<endl;

	return 0;

}


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

using namespace std;

typedef unsigned long long int ll;

int main(){
    ll a,b,k;
    
    cin>>a>>b>>k;
    
    if(k <= a)
        cout<<a-k<<" "<<b<<endl;
        
    else if(k <= a+b)
        cout<<"0 "<<b - (k - a)<<endl;
        
    else
        cout<<"0 0"<<endl;
    
  	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <algorithm>
#include <cstdlib>
using namespace std;

int main() {
	long long N;
	long long Y;
	bool b = false;
	cin >> N >> Y;
	long long i, j, k;
	for (i = 0; i <= N; i++) {
		for (j = 0; j <= N - i; j++) {
			if (10000 * i + 5000 * j + 1000 * (N - i - j) == Y) {
				cout << i << " " << j << " " << N - i - j;
				b = true;
				break;
			}
		}
		if (b == true) {
			break;
		}
	}
	if (b == false) {
		cout << -1 << " " << -1 << " " << -1;
	}
}

Measured memory_bytes: 256
//
#include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define MOD 1000000007
#define PI 3.14159265
#define EPS 1e-9
#define Pi acos(-1.0)
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;

/*CODE START HERE*/

int a, b, ans;

bool f(int x){
    int aux = x;
    int temp = 10000;
    while(aux){
        if(aux%10 != ((int)x/temp)%10)
            return false;
        
        aux/=10;
        temp/=10;
    }
    return true;
}

int main(){
    ios::sync_with_stdio(0);
    cin >> a >> b;
    ans = 0;
    forr(i,a,b+1){
        if(f(i))
            ans++;
    }
    cout << ans << "\n";
    return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> P;

#define fr first
#define sc second

const int INF = 1000000000;

int main(){
	static ll n;
	static ll x[100010],l[100010];
	
	scanf("%lld",&n);
	for(int i = 0 ; i < n ; i ++){
		scanf("%lld%lld",&x[i],&l[i]);
	}
	
	vector<ll> X;
	for(int i = 0 ; i < n ; i ++){
		X.push_back(x[i]-l[i]);
		X.push_back(x[i]+l[i]);
	}
	sort(X.begin(),X.end());
	X.erase(unique(X.begin(),X.end()),X.end());
	
	static int nex[200010];
	for(int i = 0 ; i < 200010 ; i ++){
		nex[i] = INF;
	}
	for(int i = 0 ; i < n ; i ++){
		int s = lower_bound(X.begin(),X.end(),x[i]-l[i]) - X.begin();
		int t = lower_bound(X.begin(),X.end(),x[i]+l[i]) - X.begin();
		//cout << i << " " << s << " " << t << endl;
		nex[s] = min( nex[s] , t );
	}
	for(int i = 200008 ; i >= 0 ; i --){
		nex[i] = min( nex[i] , nex[i+1] );
	}
	
	int ret = 0;
	int loc = 0;
	while(nex[loc] != INF){
		loc = nex[loc];
		ret ++;
		//cout << loc << " " << ret << endl;
	}
	cout << ret << endl;
}

Measured memory_bytes: 4336
import java.util.Arrays;
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] p = new int[n];
      int i;
      int total = 0;
      for(i=0;i<n;i++){
        p[i] = sc.nextInt();
      }
      Arrays.sort(p);
      p[n-1] = p[n-1]/2;
      for(i=0;i<n;i++){
        total = total + p[i];
      } 
      System.out.println(total);
  }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define uniq(v) v.erase(unique(v.begin(),v.end()),v.end())
#define lb(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define ub(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
using Pair = pair<ll,pair<int,int>>;
#define pq priority_queue<Pair, vector<Pair>, greater<Pair>> 
const ll mod=1000000007;
//const ll mod=998244353;
const ld pi=acos(-1.0);
const ll INF = 1LL<<61;
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; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる




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

  int n,k,c;
  string s; 
  cin>>n>>k>>c>>s;

  vector<int> ushi;
  vector<int> mae;

  int now=n-1;
  int cnt=0;
  while(now>=0){
    if(s[now]=='o') {
      ushi.pb(now);
      now-=c+1;
      cnt++;
      if(cnt==k) break;
    }
    if(s[now]=='x') {
      now--;
    }
  }

  now=0;
  cnt=0;
  while(now<=n-1){
    if(s[now]=='o') {
      mae.pb(now);
      now+=c+1;
      cnt++;
      if(cnt==k) break;
    }
    if(s[now]=='x') {
      now++;
    }
  }

  sort(all(mae));
  sort(all(ushi));

  rep(i,k){
    if(mae[i]==ushi[i]) cout << mae[i]+1 << endl;
  }

}


Measured memory_bytes: 5536
def answer(k: int, x: int) -> str:
    may_be_black = map(str, range(x - k + 1, x + k))
    return ' '.join(may_be_black)


def main():
    k, x = map(int, input().split())
    print(answer(k, x))


if __name__ == '__main__':
    main()

Measured memory_bytes: 9088
#include <iostream>
#include <iterator>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <numeric>
#include <iomanip>
#include <limits>
#include <set>
#include <map>
#include <type_traits>
#include <cstdint>
#include <queue>
#define _USE_MATH_DEFINES
#include <math.h>

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;

//素因数分解
void factoring(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]++;
}

//絶対値
template<class T, class U = std::make_unsigned_t<T>>
U SafeAbs( T x ) {
    return x < 0 ? -static_cast<uintmax_t>(x) : x;
}

//最大・最小
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//xのn乗
ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
//xの逆元
ll mod_inv(ll x, ll mod) {//O(log(mod))
    return mod_pow(x, mod - 2, mod);
}

//nCr
ll ncr(ll n, ll r, ll mod){
	ll res=1;
	ll num=1,den=1;
	for(ll i=n;i>=n-r+1;i--){
		(den*=i)%=mod;
	}
	for(ll i=1;i<=r;i++){
		(num*=i)%=mod;
	}
	
	res=den*mod_inv(num,mod);

	return res%mod;
}


//二分探索
bool isOk(ll index, ll key,vector<ll> &a){
	
	if(a[index]>key){
		return true;
	}
	
	return false;
}

ll bin_search(ll key, vector<ll> &a){
	
	ll l=-1;
	ll r=a.size();

	while(abs(r-l)>1){
		ll mid = (l+r)/2;
		if(isOk(mid, key, a)){
			r=mid;
		}
		else{
			l=mid;
		}
	}
	return r;
}

/*
//深さ優先探索
void dfs(vector<vector<ll>> &gra,vector<bool> &seen, ll v){

	seen[v]=true;

	for(auto next : gra[v]){
		if(seen[next]){
			continue;
		}

		dfs(gra,seen,next);
	}
	
}
*/
const ll MOD=1000000007;

ll min(ll a, ll b){
	if(a>=b){
		return b;
	}
	else{
		return a;
	}
}

bool over(ll a,ll b){
	ll p=a*b;
	if(p/a==b){
		return false;
	}
	else{
		return true;
	}
}

void solve(){

	ll x,y;
	cin>>x>>y;
	bool ans=false;
	if(y%2==0){
		if(2*x-y/2>=0 && (-x+y/2)>=0){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	else
	{
		cout<<"No"<<endl;
	}
	

}


int main(){
	
	solve();
	
    return 0;
}


Measured memory_bytes: 3628
import sys
import math

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

#実際の二人の得票数を数える
N = ri()
T_cnt = 1
A_cnt = 1
for _ in range(N):
    t, a = rl()
    n = max(-(-T_cnt//t), -(-A_cnt//a))
    T_cnt, A_cnt = t * n, a * n

answer = T_cnt + A_cnt
print(answer)
#24

Measured memory_bytes: 3060
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N,X=rl()
x=list(map(lambda x:abs(X-int(x)),input().split()))

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

import functools
ans = functools.reduce(gcd, x)
print(ans)

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

// syntax sugar: `for (int i = 0; i < N; ++i)`
#define rep(i, N) for (int i = 0; i < (int)(N); ++i)
// syntax sugar: `for (int i = 0; i < N; ++i)`
#define REP(type, name, beginValue, endCondValue) \
  for (type name = beginValue; name < endCondValue; ++name)
// syntax sugar: 多次元vector
#define VECTOR_DIM3(T, name, d1, d2, d3, initValue) \
    std::vector<std::vector<std::vector<T>>> name(d1, std::vector<std::vector<T>>(d2, std::vector<int>(d3, initValue)));
#define VECTOR_DIM2(T, name, d1, d2, initValue) \
    std::vector<std::vector<T>> name(d1, std::vector<T>(d2, initValue));
#define VECTOR_DIM1(T, name, d1, initValue) \
    std::vector<T> name(d1, initValue);
#define ll long long
#define ld long double


// ABC098C - Attention
int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  unordered_map<int, int> left; // i番目の人がリーダーの時に、東に向いた人数
  unordered_map<int, int> right; // i番目の人がリーダーの時に、西に向いた人数

  rep(i, N) {
    // i がリーダー
    int ln = 0, rn = 0;
    if (i > 0) {
      left[i] = left[i-1] + (S[i-1] == 'E' ? 0 : 1);
    } else {
      left[i] = 0;
    }
    // N-iがリーダー
    if (N-1-i < N-1) {
      right[N-1-i] = right[N-i] + (S[N-i] == 'W' ? 0 : 1);
    } else {
      right[N-1-i] = 0;
    }
    //cout << "i=" << i << ",left[i]=" << left[i] << ",N-i=" << N-i << ",right[N-i-1]=" << right[N-i-1] << endl;
  }
  int minNum = INT_MAX, sum;
  rep(i, N) {
    sum = left[i] + right[i];
    if (minNum > sum) {
      minNum = sum;
    }
  }

  cout << minNum << endl;
  return 0;
}



Measured memory_bytes: 27476
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left

import sys
# sys.setrecursionlimit(1000000)
INF = 10 ** 17

def main():
    n, k = getList()
    nums = [0] + getList()
    cnt = 1
    if k == 1:
        print(1)
        return
    cur = 1
    visited = [-1 for i in range(n+1)]
    visited[1] = 1
    rooped = False
    while(True):
        cur = nums[cur]
        cnt += 1

        if visited[cur] != -1:
            roop = cnt - visited[cur]
            k -= ((k-cnt) // roop) * roop
            rooped = True
        if not rooped:
            visited[cur] = cnt


        if cnt == k:
            print(nums[cur])
            return

        # print(k, cnt, cur)
        # print(visited)
        # if cnt >= 10:
        #     break

if __name__ == "__main__":
    main()



Measured memory_bytes: 102048
#include<cstdio>
#include<string>
#include<cstring>
#include<utility>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<algorithm>
#include<vector>
#include<iostream>
#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define inf 0x7fffffff
using namespace std;
ll f(ll x)
{
	if(x==-1)
	{
		return 0;
	}
	if(x%4==0)
	{
		return x;
	}
	if(x%4==1)
	{
		return 1ll;
	}
	if(x%4==2)
	{
		return x+1;
	}
	if(x%4==3)
	{
		return 0ll;
	}
	return 31415926ll;
}
int main()
{
	int i,j,k,n,m;
	ll x,y;
	scanf("%lld%lld",&x,&y);
	printf("%lld",f(x-1)^f(y));
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
	int n;
	while(cin >> n, n){
		int res = 0;
		for(int i=0;i<n*(n-1)/2;i++){
			int t; cin >> t;
			res += t;
		}
		cout << res/(n-1) << endl;
	}
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

//MOD
//--------------------------------------------
#define MUL(a,b) (((a) % MOD) * ((b) % MOD)) % MOD

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//main code
int n;
VL ans;
VL b;
int main(int argc, char const* argv[])
{
	cin >> n;
	b = VL(n);
	for (int i = 0; i < n; i++) {
		cin >> b[i];
	}
	for (int i = 0; i < n; i++) {
		for (int j = n-i-1; j >= 0; j--) {
			if (b[j] == j+1) {
				ans.push_back(j+1);
				for (int k = j; k < n-1; k++) {
					b[k] = b[k+1];
				}
				break;
			}
			if (j == 0) {
				cout << -1 << endl;
				return 0;
			}
		}
	}
	for (int i = n-1; i >= 0; i--) {
		cout << ans[i] << endl;
	}
	return 0;
}



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

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

  vector<int> L(N, 0);
  rep(i, N) cin >> L[i];
  
  int ans = 0;
  for(int i = 0; i < N - 2; i++){
    for(int j = i + 1; j < N - 1; j++){
      for(int k = j + 1; k < N; k++){
         if (abs(L[j] - L[k]) < L[i] && L[i] < L[j] + L[k] && L[i] != L[j] && L[j] != L[k] && L[k] != L[i]) ans++; 
      }
    }
  }
  cout << ans;
}

Measured memory_bytes: 3536