akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

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

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

	vi a(5, 0);

	REP(i, 5)	scanf("%d", &a[i]);

	VSORT(a);

	printf("%d %d %d %d %d\n", a[4], a[3], a[2], a[1], a[0]);

}

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

using namespace std;

#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i <= (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

int main(){
	IO;
	ll n,k,p,ans=0;
	priority_queue<int,vector<int>,greater<int>> q;
	cin>>n>>k;
	while(n--){
		cin>>p;
		q.push(p);
	}
	while(k--){
		ans+=q.top();
		q.pop();
	}
	cout<<ans<<"\n";
	return 0;
}

// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""


Measured memory_bytes: 3680
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <cinttypes>
#include <string.h>

#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define abs(a) (((a) < 0) ? -(a) : (a))

#define FOR(var, to)          for (register int var = 0; var < to; var++)
#define FROMTO(var, from, to) for (register int var = from; var <= to; var++)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

static inline int ri() {
	int a;
	scanf("%d", &a);
	return a;
}

static inline s64 rs64() {
	s64 a;
	scanf("%" SCNd64, &a);
	return a;
}

static inline void wi(int a) {
	printf("%d", a);
}

static inline void wu64(u64 a) {
	printf("%" PRIu64, a);
}

int main() {
	char a[102];
	char b[102];

	scanf("%s", a);
	scanf("%s", b);
	
	int res = 0;
	res = strlen(b) - strlen(a);
	if (!res) {
	for(size_t i = 0; i < 102; i++) {
		if (a[i] < b[i]) {res = 1;break;}
		if (a[i] > b[i]) {res = -1;break;}
		if (!a[i] && !b[i]) {res = 0;break;}
	}
	}
	
	
	if (res < 0) printf("GREATER");
	else if (res > 0) printf("LESS");
	else printf("EQUAL"); 
	
	return 0;
}


Measured memory_bytes: 128
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def solve():
    n, m = MI()

    maxl, minr = MI()
    for _ in range(m-1):
        l, r = MI()
        if maxl < l:
            maxl = l
        if r < minr:
            minr = r
    if maxl <= minr:
        print(minr - maxl + 1)
    else:
        print(0)

if __name__ == '__main__':
    solve()


Measured memory_bytes: 3064
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();

            out.println(b - a == c - b ? "YES" : "NO");
        }

    }

    static class InputReader {
        private BufferedReader in;
        private StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 21460
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n,k;
  cin>>n>>k;
  if(n%k==0) cout<<0<<endl;
  else cout<<1<<endl;

  return 0;
}


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

namespace AtTest.CumulativeSum
{
    class ABC_098_C
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string input = Console.ReadLine();
            int[] weArray = new int[n];
            int eCnt = 0;
            for (int i = 0; i < n; i++)
            {
                if (input[i] == 'W')
                {
                    weArray[i] = -1;
                }
                else
                {
                    weArray[i] = 1;
                    eCnt++;
                }
            }

            int min = 3 * 100000;
            int changeCnt = eCnt;
            for(int i = 0; i < n; i++)//leader
            {
                if (weArray[i] == 1)
                {
                    changeCnt--;//自分のぞく
                }

                if (i > 0 && weArray[i - 1] == -1)
                {
                    changeCnt++;
                }

                if (changeCnt < min)
                {
                    min = changeCnt;
                }
            }

            Console.WriteLine(min);
        }
    }
}


Measured memory_bytes: 13280
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  bool f =false;
  
  char c;
  for (int i;i < N;i++){
    cin >> c;
    if(c == 'Y'){
      f = true;
    }
  }
  if(f){
    cout << "Four" << endl;
  }else{
    cout << "Three" << endl;
  }
}
  


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

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

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

namespace init__ {

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

}

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

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

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

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

ll calc(ll r, ll div) {
    r--;
    return r / div;
}

ll calc(ll l, ll r, ll div) { return calc(r + 1, div) - calc(l, div); }

int main() {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    ll div_c = calc(A, B, C);
    ll div_d = calc(A, B, D);
    ll div_cd = calc(A, B, C / gcd(C, D) * D);
    cout << (B - A + 1) - (div_c + div_d - div_cd) << endl;
    return 0;
}


Measured memory_bytes: 256
function Main(input) {
  "use strict";
  const lines = input.split("\n");
  const line1 = lines[0].split(" ");
  const line2 = lines[1].split(" ");

  const N = parseInt(line1[0], 10);
  const As = line2.map(s => parseInt(s, 10))

  var t_a = 0;
  var t_b = 0;
  var max = 0;
  for (let i = 0; i < N; i++) {
    max = 0;
    for (let k = 0; k < As.length; k++) {
      max = Math.max(max, As[k])
    }
    if (i%2==0) {
      t_a += max
    } else {
      t_b += max
    }

    As.splice(As.findIndex(a => a === max), 1)
  }
  console.log(t_a - t_b)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29664
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265359
using namespace std;

int main()
{
  int n; cin >> n;
  vector<string> s(n);
  rep(i, n) cin >> s[i];

  sort(s.begin(), s.end());
  s.erase(unique(s.begin(), s.end()), s.end());

  cout << s.size() << endl;

  return 0;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(x) (x).begin(),(x).end()
#define dup(x,y) (((x)+(y)-1)/(y))
#define sz(x) (int)(x).size()
#define MOD 1000000007
#define pint pair<int,int>
#define pdouble pair<double,double>
using namespace std;
typedef long long ll;

int main(){
    int n, m;
    cin >> n >> m;
    priority_queue<int,vector<int>,greater<int>> q;
    rep(i,n) {
        int a;
        cin >> a;
        q.push(a);
    }
    vector<pint> bc(m);
    rep(i,m) cin >> bc[i].second >> bc[i].first;
    sort(all(bc));
    int count = 0;
    for(int i = m; i > 0; i--){
        if(count > n) break;
        rep(j,bc[i-1].second){
            if(q.top() < bc[i-1].first){
                q.pop();
                q.push(bc[i-1].first);
            }
            count++;
        }
    }
    ll ans = 0;
    rep(i,n) {
        ans += q.top();
        q.pop();
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
int  W,H,N;
    cin >> W >> H >> N ;
  
  int x[100];
  int y[100];
  int a[100];
  
  for (int i=0; i<N; i++){
  cin >> x[i] >> y[i] >> a[i] ;
  }  
  
  int xMin=0;
  int xMax=W;
  int yMin=0;
  int yMax=H;
  
  for (int i=0; i<N; i++){
   if (a[i]==1)
     xMin=max(xMin, x[i]);
   if (a[i]==2)
     xMax=min(xMax, x[i]);
   if (a[i]==3)
     yMin=max(yMin, y[i]);
   if (a[i]==4)
     yMax=min(yMax, y[i]);
  }
  
  int xgap=xMax-xMin;
  int ygap=yMax-yMin;
  
  if (xgap>0 && ygap>0){  
  cout << xgap*ygap << endl;  
  }
  else cout << '0' << endl;
}
  


Measured memory_bytes: 256
#include <climits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <memory.h>
#include <cassert>
#define FAST_INPUT_OUTPUT

//#define MORE_THAN_ONE_TESTCASE // COMMENT IT








#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define vvi vector<vector<int>>
#define viil vector<vector<long long>>
#define mii map<int , int>
#define mll map<long long , long long>
#define msi map<string , i>
#define msl map<string , long long>
#define mci map<char , int >
#define mcl map<char , long long>
#define umii unordered_map<int,int>
#define umll unordered_map<long long ,long long>
#define umsi unordered_map<string , int>
#define umsl map<string , long long> 
#define si set<int>
#define sl set<long long>
#define pii pair<int , int >
#define psi pair<string,int>
#define psl pair<string , long > 
#define pll pair<long long , long long>
#define vpii vector<pii>
#define vpll vector<pll>
#define vpsi vector<psi>
#define vpsl vector<psl>
#define pqi priority_queue<int>
#define pql priority_queue<long long>
#define ub upper_bound
#define lb lower_bound
#define bint long long int
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define iv(v) for(auto &i:v){cin>>i;}
#define ov(v) for(auto i:v){cout<<i<<" ";}cout<<endl;
#define ovn(v) for(auto i:v){cout<<i<<endl;}
#define euv(v) for(auto i:v){cerr<<i<<" ";}cerr<<endl;
#define eovn(v) for(auto i:v){cerr<<i<<endl;}
#define os(s) for(auto itr:s){cout<<itr<<" ";}cout<<endl;
#define osn(s) for(auto itr:s){cout<<itr<<endl;}
#define eos(s) for(auto itr:s){cerr<<itr<<" ";}cerr<<endl;
#define eosn(s) for(auto itr:s){cerr<<itr<<endl;}
#define rep(i,x) for(auto i=0 ; i<x; ++i)
#define repa(i,a,b) for(auto i=a; i<b; ++i)
#define repe(i,x) for(auto i=0; i<=x; ++i)
#define repea(i,a,b) for(auto i=a;i<=b;++i)
#define ef else if
#define wh while
#define el else
#define ivar(x) int x; cin>>x
#define lvar(x) bint x; cin>>x
#define svar(x) string x; cin>>x
#define cvar(x) char x; cin>>x
#define fvar(x) float x; cin>>x
#define dvar(x) double x; cin>>x
#define endl '\n'
using namespace std;


auto SOLUTION_FUNCTION( void ) ->void {
    // your solution goes here 
    ivar(r);cout<<r*r<<endl;
    return ;
}

int main(void){
#ifdef FAST_INPUT_OUTPUT
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout<<setprecision(10);
    cout<<fixed;
    cout<<boolalpha;
#endif
#ifdef MY_LOCAL_PROJECT
    freopen("input","r",stdin);
    freopen("output","w",stdout);
#endif
    int testcase = 1;


#ifdef MORE_THAN_ONE_TESTCASE
    cin>>testcase;
#endif
    
    while(testcase--){
        SOLUTION_FUNCTION();
    }

#ifdef MY_LOCAL_PROJECT
    cout<<"Time : "<<1.0*(double)clock()/CLOCKS_PER_SEC<<endl;
#endif
    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
n = int(input())
s = input().rstrip()
c0 = [1,1,-1,-1]
c1 = [1,-1,1,-1]
for j in range(4):
  chk = [c0[j],c1[j]]
  for i in range(1,n-1):
    k = 1 if s[i] == 'o' else -1
    c = chk[i-1]*chk[i]*k
    chk.append(c)
  K = 1 if s[0] == 'o' else -1
  L = 1 if s[-1] == 'o' else -1
  if chk[-1]*chk[0]*K == chk[1] and chk[-2]*chk[-1]*L == chk[0]:
    chk = [l+1 for l in chk]
    ans = ''.join(list(map(str,chk)))
    ans = ans.replace('2','S')
    ans = ans.replace('0','W')
    print(ans)
    exit()
print(-1)

Measured memory_bytes: 108428
#include <iostream>
#include <queue>

using namespace std;

struct task {
    string name;
    int time;
};

int main()
{
    int n, q;
    int elaps = 0;
    queue<task> Q;

    cin >> n >> q;

    for(int i = 0; i < n; i++) {
        task tmp;
        cin >> tmp.name >> tmp.time;
        Q.push(tmp);
    }

    while(!Q.empty()) {
        task p = Q.front(); Q.pop();
        if(p.time <= q) {
            elaps += p.time;
            cout << p.name << " " << elaps << endl;
        }
        else {
            p.time -= q;
            elaps += q;
            Q.push(p);
        }
    }
    return 0;
}

Measured memory_bytes: 6252
import java.util.Scanner;
import java.util.Arrays;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        int k,n;
        long sum;
        n=scan.nextInt();
        k=scan.nextInt();
        sum=0;
        long[] arr = new long[n];
        for(int i=0;i<arr.length;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        n-=k;
        for(int i=0;i<n;i++){
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}

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

int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int N, K, i;
	string S;
	cin >> N >> K;
	cin >> S;
	for (i = 0; i < S.size(); i++) {
		if (i == K - 1)
			S[i] = (S[i] - 'A') + 'a';
	}
	cout << S << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
#define  pb  push_back
#define  F   first
#define  S   second
const int N=1e5+5;
string s;
int main()
{
    ft
    ll t,i,j,n,m,l=0,r,p,q,ss=0;
    cin>>s;
    n=s.size();
    for(i=n-1;i>=0;i--)
    {
        if(s[i]=='Z')
        {
            l=i;
            break;
        }
    }
    for(i=0;i<l;i++)
    {
        if(s[i]=='A')
        {
            cout<<(1+l-i)<<"\n";
            break;
        }
    }
    return 0;
}



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

int main(){
  int n, t;
  cin >> n >> t;
  vector<int> a(n), b(n);
  
  for(int i = 0; i < n; i++){
  	cin >> a.at(i) >> b.at(i);
  	if(b.at(i) > t){
    	a.at(i) += 1001;
    }
  }
  int m = 1001;
  for(int i = 0; i < n; i++){
  	m = min(m, a.at(i));
  }
  if(m == 1001){
  	cout << "TLE" << endl;
  }
  else{
  	cout << m << endl;
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<list>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
using namespace std;
#define REP(i,m,n) for(int i = (m); i < (n);i++)
#define rep(i,n) REP(i,0,n)

int pos(int _c) {
	return (_c == 1)?14:_c;
}
	
int main() {
	int alice,bob;
	cin >> alice >> bob;
	cout << ((pos(alice)==pos(bob))?"Draw":((pos(alice)<pos(bob))?"Bob":"Alice")) << endl;
	
	return 0;
}


Measured memory_bytes: 256
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = int.Parse(line[0]);
        var b = int.Parse(line[1]);
        var c = int.Parse(line[2]);
        Console.WriteLine(c >= a && c <= b ? "Yes" : "No");
    }
}

Measured memory_bytes: 11092
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> PL;
typedef long double ldouble;

char S[2][100010];
int P[2][100010][2];
int L[2];

void solve(){
	scanf("%s%s", S[0]+1, S[1]+1);
	int q;
	rep(u, 2){
		int N = (int)strlen(S[u] + 1);
		L[u] = N;
		for(int i=1;i<=N;i++){
			int c = (S[u][i] - 'A');
			int d[2] = {};
			d[c] = 1;
			rep(t, 2){
				P[u][i][t] = P[u][i-1][t] + d[t];
			}
		}
	}
	scanf("%d", &q);
	rep(i, q){
		int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d);
		int x[2][2] = {};
		rep(u, 2)rep(v, 2){
			if(u == 0)x[u][v] = P[u][b][v] - P[u][a-1][v];
			else x[u][v] = P[u][d][v] - P[u][c-1][v];
		}
		int y[2] = {};
		rep(u, 2){
			y[u] = (x[u][0] - x[u][1]) % 3;
			if(y[u] < 0)y[u] += 3;
		}
		if(y[0] == y[1])puts("YES");
		else puts("NO");
	}
}

int main(){
	int Tc = 1; // scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		// printf("Case #%d: ", tc);
		solve();
	}
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
using namespace std;
struct sgt{
	struct node{
		int val = -1;
		node* left = NULL, * right = NULL;
		node(){};
		node(int val):val(val){};
	};
	node* root = new node;
	void push(node* now){
		if(!now)return;
		if(now->left and now->val != -1){
			if(now->left->val == -1)now->left->val = now->val;
			else now->left->val = min(now->left->val, now->val);
		}
		if(now->right and now->val != -1){
			if(now->right->val == -1)now->right->val = now->val;
			else now->right->val = min(now->right->val, now->val);
		}
	}
	void modify(int l, int r, node* now, int val, int nowl = 0, int nowr = 1000000000){
		if(l > nowr || r < nowl)return;
		if(l <= nowl and r >= nowr){
			if(now->val == -1)now->val = val;
			else now->val = min(now->val, val);
		}
		else{
			if(!now->left)now->left = new node(now->val);
			if(!now->right)now->right = new node(now->val);
			int mid = (nowl + nowr) >> 1;
			modify(l, r, now->left, val, nowl, mid);
			modify(l, r, now->right, val, mid + 1, nowr);
		}
	}
	int query(int t, node* now, int nowl = 0, int nowr = 1000000000){
		push(now);
		if(nowl == nowr and t == nowl)return now->val;
		if(!now->left)now->left = new node(now->val);
		if(!now->right)now->right = new node(now->val);
		int mid = (nowl + nowr) >> 1;
		if(t > mid)return query(t, now->right, mid + 1, nowr);
		else return query(t, now->left, nowl, mid);
	}
}tree;
int main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	int n, q;
	cin >> n >> q;
	for(int i = 0, s, e, x;i < n;++i){
		cin >> s >> e >> x;
		tree.modify(s - x, e - x - 1, tree.root, x);
	}
	for(int i = 0, t;i < q;++i){
		cin >> t;
		cout << tree.query(t, tree.root) << '\n';
	}
}


Measured memory_bytes: 388480
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};
#define foR for

// FHCまでにスタックオーバーフローの罠を解決する

template<typename T>
struct BIT{
    vector<T> bit;
    BIT(int n) : bit(n+1) {}
    void add(int a,T w){
        for(int x=++a; x < bit.size(); x+=(x&(-x)) ){
            bit[x] += w;
        }
    }
    // return v[0]+v[1]+...+v[a-1];
    T sum(int a){
        T ret=0;
        for(int x=a;x>0;x-=(x&(-x)) ){
            ret+=bit[x];
        }
        return ret;
    }
};

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int n,q;
    cin>>n>>q;
    BIT<int> b(n+1);
    int c[n];
    for(int i=0;i<n;i++){
        cin>>c[i];
        c[i]--;
    }
    array<int,3> a[q];
    int ans[q]={};
    for(int i=0;i<q;i++){
        int l,r;
        cin>>l>>r;
        a[i] = {r,l,i};
    }
    int pre[n]={};
    sort(a,a+q);
    int now = 0;
    for(int i=0;i<n;i++){
        if(pre[c[i]]){
            b.add(pre[c[i]],-1);
        }
        b.add(i+1,1);
        pre[c[i]] = i+1;
        while(now<q && a[now][0]==i+1){
            ans[a[now][2]] = b.sum(n+1) - b.sum(a[now][1]);
            now++;
        }
    }
    for(int i=0;i<q;i++)cout << ans[i] << "\n";
}

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

int main()
{
  int n ,l;
  cin >> n >> l;
  vector<int> ll(n);
  int i;
  for(i = 0; i < n; i++)
  {
    ll.at(i) = l+i;
  }
  int min = 10000;
  int ch = 0;
  for(i = 0; i < n; i++)
  {
    if(abs(ll.at(i)) < min)
    {
      ch = i;
      min = abs(ll.at(i));
    }
  }
  int sum = 0;
  for(i = 0; i < n; i++)
  {
    if(i != ch)sum += ll.at(i);
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
package main

import "fmt"

func abs(a, b int) int {
	if a < b {
		return b - a
	}
	return a - b
}

func main() {
	var x, n int
	fmt.Scan(&x, &n)
	p := make(map[int]bool)
	k := 0
	for i := 0; i < n; i++ {
		fmt.Scan(&k)
		p[k] = true
	}
	dmin := 1000
	ans := -1
	for i := 0; i <= 101; i++ {
		if !p[i] {
			d := abs(i, x)
			if d < dmin {
				dmin = d
				ans = i
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1852
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
typedef map<lint,lint> M;
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 
    

//解説AC
  int main(){
    lint n;
    cin>>n;
    string s;
    cin>>s;
    lint q;
    cin>>q;
    set<lint>st[26];
    rep(i,26)st[i].insert(INF);
    rep(i,n){
        lint a=s[i]-'a';
        st[a].insert(i);
    }
    rep(i,q){
        lint a,b,c;
        char d;
        cin>>a;
        if(a==1){
        cin>>b>>d;
        --b;
        lint e=s[b]-'a';
        s[b]=d;
        lint f=s[b]-'a';
        st[e].erase(b);
        st[f].insert(b);   
        }else{
        lint g,h;
        cin>>g>>h;
        --g;--h;
        lint count=0;
        rep(j,26){
            auto x=st[j].lower_bound(g);
            lint l=*x;
            if(g<=l&&l<=h)count++;
        }
        cout<<count<<endl;
        }
    }
     }
     

  
 
  
      
      
    
 
  
          
  

Measured memory_bytes: 27320
#include<iostream>
#define D 1000000007
using namespace std;

int main() {
  int N; cin >> N;
  long long ans=1;
  for(int i = 1; i <= N; i++){
    ans = ans * i;
    if(ans > D) ans = ans % D;
  }
  cout << ans % D << endl;

  return 0;
}


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

int main() {
    int n,m,x;cin>>n>>m>>x;
    int c[n];
    int a[n][m];
    for (int i=0;i<n;i++) {
        cin>>c[i];
        for (int j=0;j<m;j++)
            cin>>a[i][j];
    }
    int mn=1e9;
    for (int i=0;i<1<<n;i++) {
        int b[m]{};
        int cost=0;
        for (int j=0;j<n;j++)
            if (i&1<<j) {
                cost+=c[j];
                for (int k=0;k<m;k++)
                    b[k]+=a[j][k];
            }
        int f=1;
        for (int j=0;j<m;j++)
            f&=b[j]>=x;
        if (f)
            mn=min(mn,cost);
    }
    if (mn==1e9)
        mn=-1;
    cout<<mn<<endl;
    return 0;
}

Measured memory_bytes: 3576
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

int main(){
	int n,m;
	cin >> n >> m;
	vector<int> number(n+m);
	int count = 0;
	for( int i=0; i<n; i++ ) number[i] = 2;
	for( int j=n; j<n+m; j++ ) number[j] = 1;
	for( int i=0; i<n+m; i++ ){
		for( int j=0; j<n+m; j++ ){
			if( i==j ) continue;
			if(fmod( number[i]+number[j] , 2 )==0 ) count++;
		}
	}
	cout << count/2 << endl;
	return 0;
}


Measured memory_bytes: 256
from math import gcd
from collections import Counter

N = int(input())
C = Counter()
for i in range(N):
  x = round(float(input()) * 10 ** 9)
  C[gcd(x, 10**18)] += 1

ans = 0
for k1, v1 in C.items():
  for k2, v2 in C.items():
    if k1 * k2 % 10 ** 18 == 0:
      if k1 == k2:
         ans += v1 * (v1 - 1) // 2
      if k1 < k2:
         ans += v1 * v2

print(ans)


Measured memory_bytes: 9360
package main

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

const MAX = 20000

type Valley struct {
	from int
	area int
}

type Valleys struct {
	container [MAX]Valley
	top       int
}

func (v *Valleys) pop() Valley {
	if v.isEmpty() {
		return Valley{}
	}

	valley := v.container[v.top]
	v.top--
	return valley
}

func (v *Valleys) push(valley Valley) {
	v.top++
	v.container[v.top] = valley
}

func (v *Valleys) isEmpty() bool {
	return v.top == 0
}

func (v *Valleys) len() int {
	return v.top
}

func (v *Valleys) toString() string {
	buf := bytes.Buffer{}

	buf.WriteString(strconv.Itoa(v.len()))
	buf.WriteString(" ")

	for i := 1; i <= v.top; i++ {
		valley := v.container[i]
		buf.WriteString(strconv.Itoa(valley.area))
		buf.WriteString(" ")
	}
	return strings.TrimRight(buf.String(), " ")
}

type Stack struct {
	container [MAX]int
	top       int
}

func (s *Stack) pop() int {
	if s.isEmpty() {
		return -1
	}

	v := s.container[s.top]
	s.top--
	return v
}

func (s *Stack) push(n int) {
	s.top++
	s.container[s.top] = n
}

func (s *Stack) isEmpty() bool {
	return s.top == 0
}

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	num, _ := strconv.Atoi(scanString())
	return num
}

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

func init() {
	sc.Split(bufio.ScanWords)
}

func main() {
	s := scanString()

	stack := Stack{}
	valleys := Valleys{}
	total := 0
	for i := 0; i < len(s); i++ {
		char := string(s[i])
		switch char {
		case "\\":
			stack.push(i)
		case "/":
			if stack.isEmpty() {
				continue
			}
			from := stack.pop()
			area := i - from
			total += area

			for !valleys.isEmpty() {
				valley := valleys.pop()
				if from < valley.from {
					area += valley.area
				} else {
					valleys.push(valley)
					break
				}
			}
			valleys.push(Valley{from, area})
		}
	}

	fmt.Println(total)
	fmt.Println(valleys.toString())
}



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

int main() {
    string str;
    cin >> str;
    if(str.at(0) == '9' || str.at(1) == '9') cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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 (a > b){ a = b; return 1;}return 0;}
template <class T>
void printv(vector<T> v) {for (T t : v) {cout << t << " ";}cout << '\n';}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" <<endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

int main()
{
    int m1, m2, d1, d2;
    cin >> m1 >> d1;
    cin >> m2 >> d2;

    if (d2 == 1) cout << 1 << endl;
    else cout << 0 << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return 1; }
  return 0; }
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return 1; }
  return 0; }
ll MOD = 1000000007;

int main(void){
  ll n,m; cin >> n >> m;
  ll a[n];
  vector<pair<ll,ll>> ans;
  rep(i,n){
    cin >> a[i];
    ans.push_back(make_pair(a[i],1));
  }
  ll b[m],c[m];
  rep(i,m){
    cin >> b[i] >> c[i];
    ans.push_back(make_pair(c[i],b[i]));
  }
  sort(ans.begin(),ans.end());
  reverse(ans.begin(),ans.end());
  ll sum = 0;
  ll true_ans = 0;
  ll i = 0;
  while(sum <= n){
    true_ans += ans.at(i).first * ans.at(i).second;
    sum += ans.at(i).second;
    if(sum >= n) break;
    i++;
  }
  ll x = ans.at(i).first;
  true_ans -= (sum-n)*x;
  cout << true_ans << endl;
  return 0;
}


Measured memory_bytes: 8888
#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>

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

using namespace std;
typedef long long ll;
typedef pair<int, int>P;

const ll sqrtN = 512;

struct SqrtDecomposition {
	int N, K;
	vector<ll>data;
	vector<ll>bucketSum;
	SqrtDecomposition(ll n) :N(n) {
		K = (N + sqrtN - 1) / sqrtN;
		data.assign(K*sqrtN,0);
		bucketSum.assign(K,0);
	}
	void add(ll x, ll y) {
		ll k = x / sqrtN;
		data[x] += y;
		ll sum = 0;
		for (int i = k * sqrtN; i < (k + 1)*sqrtN; ++i)
			sum += data[i];
		bucketSum[k] = sum;
	}
	int getSum(ll x, ll y) {
		int sum = 0;
		for (int k = 0; k< K; ++k) {
			ll l = k * sqrtN, r = (k + 1) * sqrtN;
			if (r <= x || y <= l)continue;
			if (x <= l && r <= y)sum += bucketSum[k];
			else {
				for (int i = max(x, l); i < min(y, r); ++i)
					sum += data[i];
			}
		}
		return sum;
	}
};

int main()
{
	ll N, Q; cin >> N >> Q;
	SqrtDecomposition decomp(N);
	while (Q--) {
		int c, x, y;
		cin >> c >> x >> y;
		if (c == 0)decomp.add(x, y);
		else cout << decomp.getSum(x, y + 1) << endl;
	}
	return 0;
}

Measured memory_bytes: 3636
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for {
		scanner.Scan()
		s := scanner.Text()
		if s == "0" {
			break
		}
		sum := 0
		for _, c := range s {
			sum += int(c - '0')
		}
		fmt.Println(sum)
	}
}


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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL<<60;
const ll mod = 1000000007;		

int n, k;
VLL v(1001*(1001 + 1) / 2);

int f(ll a) {
	int cnt = 0;
	for (ll i : v) {
		if ((i&a) == a)cnt++;
	}
	return cnt;

}



int main() {
	
	
	
	cin >> n >> k;
	VLL a(n), b(n + 1, 0);
	REP(i, n) {
		cin >> a[i];
		b[i + 1] = b[i] + a[i];
	}
	
	ll l = 0;
	REP(i, n + 1) {
		FOR(j, i + 1, n + 1) {
			v[l]=(b[j] - b[i]);
			l++;
		}
	}

	ll ans = 0;

	for (int i = 40; i >= 0; i--) {
		if (f(ans | (1LL << i)) >= k) {
			ans |= (1LL << i);
		}
	}

	cout << ans << endl;

	
}
 

Measured memory_bytes: 4224
N = int(input())
nu = [int(x) for x in input().split()]
r2 = [None] * N

for i in range(len(nu)):
  r2[nu[i] - 1] = i
#for i in nu:
#  r2[i] = nu.index(i)
print(" ".join([str(x + 1) for x in r2]))

Measured memory_bytes: 18372
<?php
$c[] = ints();
$c[] = ints();
$c[] = ints();
for ($a[0] = 0; $a[0] <= 100; $a[0]++) {
    $b[0] = $c[0][0] - $a[0];
    $b[1] = $c[0][1] - $a[0];
    $b[2] = $c[0][2] - $a[0];
    $a[1] = $c[1][0] - $b[0];
    $a[2] = $c[2][0] - $b[0];
    for ($i = 1; $i < 3; $i++) {
        for ($j = 1; $j < 3; $j++) {
            if ($c[$i][$j] !== $a[$i] + $b[$j]) continue 3;
        }
    }
    exit('Yes');
}
echo 'No';

function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}


Measured memory_bytes: 4732
#include <bits/stdc++.h>
#define int long long
//#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
int32_t main()
{
    //FIO;

    int n;
    cin>>n;
    int arr[n];
    for (int i = 0; i < n; i++)
    {
       cin>>arr[i];
    }
    int sum=0;

    for (int i = 1; i < n; i++)
    {
       if(arr[i]<arr[i-1])
       {    
          
           sum=sum+(arr[i-1]-arr[i]);
           arr[i]=arr[i-1];
       }
    }
    cout<<sum;



    

    return 0;
}


Measured memory_bytes: 5172
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < s.length(); i++) {
			if(i % 2 == 0) {
				sb.append(s.charAt(i));
			}

		}
		System.out.println(sb);
	}
}

Measured memory_bytes: 27776
#include<stdio.h>

int main(void){

	int N, N1, N2, N3;

	scanf("%d", &N);

	N3 = N / 100;
	N2 = (N - N3 * 100)  / 10; 
	N1 = N - N3 * 100 - N2 * 10;

	if(N1 == 7 || N2 == 7 || N3 == 7 )
		printf("Yes");
	else
		printf("No");

	return 0;

}

Measured memory_bytes: 1724
import Control.Monad

main = do
	n <- readLn
	
	when  (n /= -1) $ do
		print $ solve n
		
		main


solve :: Int -> Int
solve n
	| n > 0 = mod n 4 + (solve (div n 4)) * 10
	| n <= 0 = 0
	

Measured memory_bytes: 4116
n, k = map(int,input().split())
r, s, p = map(int,input().split())
t = input()
te = ["" for i in range(k)]
ans = 0
for i in range(n):
    if not t[i] == te[i%k]:
        if t[i] == "r":
            ans += p
        elif t[i] == "s":
            ans += r
        else:
            ans += s
        te[i%k] = t[i]
    else:
        te[i%k] = ""

print(ans)


Measured memory_bytes: 3956
//#include <bits/stdc++.h>
//#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>

using namespace std;
using ll=long long;
using intpair=pair<int,int>;
using intpv=vector<intpair>;
using llpair=pair<ll,ll>;
using llpv=vector<llpair>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;
using pairmat=vector<llpv>;

template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

#define PI 3.141592653589793
#define INTINF 1<<30
#define LLINF 1LL<<60
#define MPRIME 1000000007
#define MPRIME9 998244353

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())
#define matin(mat,H,W) for(int i__=0; i__<H; i__++)for(int j__=0; j__<W; j__++) cin>>mat[i__][j__]
#define out(n) cout<<n<<endl

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

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

template<class T>
inline void outmat(T& a, int y, int x) {
	for(int i=0; i<y; i++) {
		for(int j=0; j<x; j++) cout<<a[i][j]<<" ";
		cout<<endl;
	}
}

template<class T>
inline void init(T& v) {
	for(auto &a__: v) cin>>a__;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a__: v) cin>>a__;
}

template<class N> void resiz(N n) {} // empty
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

ll GCD(ll a, ll b) { //最大公約数
	if(a==0||b==0) return 0;
	if(a<b) swap(a,b);
	ll tmp = a%b;
	while(tmp!=0) {
		a = b;
		b = tmp;
		tmp = a%b;
	}
	return b;
}

ll binpow(ll a, ll ex, ll p) { //繰り返し二乗法
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}

ll Fact(ll x, ll p) { //階乗
	ll f=1;
	for(ll i=2; i<=x; i++) {
		f*=i;
		f%=p;
	}
	return f;
}

int DigitNum(ll n) { //桁数
	int digit=0;
	ll div=1LL;
	while(n/div) {
		digit++;
		div*=10;
	}
	return digit;
}


int X,Y;

void input() {
	cin>>X>>Y;
}

void solve() {
	if(Y%2==0 && 2*X<=Y && Y<=4*X) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

int main() {
	while(1) {
		input();
		solve();
		break;
	}
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

int main() {
	int t, x; scanf("%d%d", &t, &x);
	
	printf("%.8lf\n", (double)t / (double)x);
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223372036854775807
#define INF 2147483647
#define MOD 1000000007
using namespace std;



int main(int argc, char* argv[])
{
    long n,m;
    scanf("%ld%ld", &n, &m);

    if(n*2<m) {
        printf("%ld\n", MIN(n,m/2)+(m-n*2)/4);
    }
    else {
        printf("%ld\n", MIN(n,m/2));
    }


    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>



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

using namespace std;
int n , k;

int main(){
  cin >> n >> k;
  long long int ans =1;
  ans = k;
  REP(i,n-1){
    ans *= k-1;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
// Name: Counting Sort
// Level: 1
// Category: Sort, ?????????
// Note: Counting Sort, ?¨???°?????????
/*
?????????????????§??? 0 <= A[i] <= 10000 ????????§
unsigned short ???????????¨?????¢??????????´???§??????.
(unsigned short(0~65535) => 2byte, int(?????????????????????) => 4byte)
*/

#include <stdio.h>
#include <stdlib.h>

#define VMAX 10000

int n;

void counting_sort(unsigned short A[], unsigned short B[], int k) {
    int C[k+1], i;
    for (i = 0; i <= k; i++) { C[i] = 0; }
    for (i = 0; i < n; i++ ) { C[A[i]]++; }
    for (i = 1; i <= VMAX; i++) { C[i] = C[i] + C[i-1]; }
    for (i = n-1; i >= 0; i--){
        B[C[A[i]]-1] = A[i];
        C[A[i]]--;
    }
}

int main() {
    unsigned short *A, *B;
    int i;

    scanf("%d", &n);

    A = malloc(sizeof(short)*n+1);
    B = malloc(sizeof(short)*n+1);

    for (i = 0; i < n; i++ ) { scanf("%hu", &A[i]); }

    counting_sort(A, B, 10000);

    for (i = 0; i < n; i++) {
        printf("%d", B[i]);
        printf( (i == n-1) ? "\n" : " ");
    }
    return 0;
}

Measured memory_bytes: 9556
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

#define N 120

using namespace std;
 
int a[N],n;
double s;
 
int main() {
    cin >> n;
    for(int i = 1 ; i <= n ; i++) {
        double x ;
        cin>>x ;
        x = 1 / x ;
        s += x ;
    }
    cout<<1 / s<<endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 504
from _collections import deque

N,Q = map(int,input().split())
K = [[] for _ in range(N)]
point = [0]*N

for i in range(N-1):
    a,b = map(int,input().split())
    K[a-1].append(b-1)
    K[b-1].append(a-1)

for i in range(Q):
    p,x = map(int,input().split())
    point[p-1] += x

ans = [0]*N
q = deque()
q.append((0,-1))
while(len(q)>0):
    a,parent = q.popleft()
    ans[a] = ans[parent] + point[a]
    for i in K[a]:
        if i != parent:
            q.append((i,a))

for i in ans:
    print(i,end=" ")

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

#define debug(x) cerr<<#x<<'='<<x<<endl
#define set0(x) memset(x,0,sizeof(x))
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
template<typename T> void read(T &x){
	x = 0;char ch = getchar();ll f = 1;
	while(!isdigit(ch)){if(ch == '-')f*=-1;ch=getchar();}
	while(isdigit(ch)){x = x*10+ch-48;ch=getchar();}x*=f;
}

int mod = 998244353;
inline int mul(int x,int y){return 1ll*x*y%mod;}
inline int add(int x,int y){return x+y>=mod?x+y-mod:x+y;}
inline int sub(int x,int y){return x-y<0?x-y+mod:x-y;}
inline int sq(int x){return 1ll*x*x%mod;}
int mpow(int a,int b){return b == 0 ? 1 : ( b&1 ? mul(a,sq(mpow(a,b/2))) : sq(mpow(a,b/2)));}

const int N = 1000000;
int fac[N+10],invfac[N+10],n,k;

int C(int n,int m){
	if(n<0 || m<0 || m>n)return 0;
	return mul(fac[n],mul(invfac[m],invfac[n-m]));
}

int rect(int n,int m,int l){
	if(n<0 || m<0)return 0;
	if(l<0)return 0;
	//cout<<n<<' '<<m<<' '<<l<<' '<<C(n+m,m)<<' '<<C(n+m,m-l)<<endl;
	return sub(C(n+m,m),C(n+m,m-l));
}

int main() {
	fac[0] = 1;
	for(int i=1;i<=N;i++)fac[i] = mul(fac[i-1],i);
	invfac[N] = mpow(fac[N],mod-2);
	for(int i=N-1;i>=0;i--) invfac[i] = mul(invfac[i+1],i+1);
	read(n);read(k);
	int ans = 0;
	for(int r = 1;r<=k;r++){
		int b = k-r;
		if(b>r)continue;
		if(b == r){
			ans = add(ans,rect(r,b-1,b-n+1));
		}else{
			ans = add(ans,rect(r,b,r-n+1));
		}
		//cout<<r<<' '<<b<<' '<<ans<<endl;
	}
	cout<<ans<<endl;
	return 0;
}


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

using namespace std;

#define fRead(x)        freopen(x,"r",stdin)
#define fWrite(x)       freopen (x,"w",stdout)

#define LL              long long
#define ULL             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             5e13
#define PI              acos(-1.0)
#define mk              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>
#define all(a)          a.begin(),a.end()
#define Unique(a)       sort(all(a)),a.erase(unique(all(a)),a.end())

#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())

#define FastRead        ios_base::sync_with_stdio(0);cin.tie(nullptr);

string str[504];
string a[504];
string b[504];

int main()
{
   FastRead
   int n,m;
   cin >> n >> m;
   REP(i,n)cin >> str[i] , a[i] = b[i] = str[i];

   REP(i,m)a[0][i] = '#';
   REP(i,m)b[n-1][i] = '#';

   for(int j = 1;j < m - 1;j+=2){
      for(int i = 1; i < n - 1;i++)a[i][j] = '#';
   }
   for(int j = 2;j < m - 1;j+=2){
      for(int i = 1; i < n - 1;i++)b[i][j] = '#';
   }
   REP(i,n)
   {
      cout <<a[i] << "\n";
   }
   cout << "\n";
   REP(i,n)
   {
      cout <<b[i] << "\n";
   }
}


Measured memory_bytes: 1536