akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
#define RF(x) freopen(x,"r",stdin)
#define WF(x) freopen(x,"w",stdout)
typedef long long LL;
using namespace std;
typedef pair<LL,LL> PLL;
typedef pair<int,int> PII;
const LL MOD = 1e9+7;
const int SIZE = 1e6+5;
const LL INF = 1LL<<60;
const double eps = 1e-7;

bool isp[100009];
LL a[100009];
vector<LL> p;
vector<LL> p2;
vector<LL> p3;
unordered_map<LL,int> m;

int main(){
	REPP(i,2,100009)isp[i]=1;
	REPP(i,2,100009){
		if(isp[i]){
			p.PB(i);p2.PB((LL)i*i);p3.PB((LL)i*i*i);
			for(int j=2*i;j<100009;j+=i)isp[j]=0;
		}
	}
	DRI(n);
	REP(i,n){
		scanf("%lld",&a[i]);
	}
	REP(i,n){
		for(int j=0;p3[j]<=a[i];j++){
			while(a[i]%p3[j]==0)a[i]/=p3[j];
		}
		m[a[i]]++;
	}
	int ans=m[1]>0;
	sort(a,a+n);
	REP(i,n){
		if(i&&a[i]==a[i-1])continue;
		LL inv=1;
		LL x=a[i];
		bool over=0;
		for(int j=0;p2[j]<=x;j++){
			int fc=0;
			while(x%p[j]==0){
				x/=p[j];fc++;
			}
			if(fc==1){
				if(inv<INF/p2[j])inv*=p2[j];
				else{over=1;break;}
			}
			if(fc==2){
				if(inv<INF/p[j])inv*=p[j];
				else{over=1;break;}
			}
		}
		//printf("%lld %lld",x,inv);
		if((!over)&&x<100000&&inv<INF/(x*x))inv=inv*x*x;
		else{
			ans+=m[a[i]];continue;
		}
		if(m[inv]==0||a[i]<inv)ans+=max(m[a[i]],m[inv]);
	}
	printf("%d",ans);
}


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

const int INF = 2100000000;

int main() {
  auto min = [](int a, int b) { return (a < b ? a : b); };
  int N, K;
  std::cin >> N >> K;
  std::vector<int> h(N + 1);
  for (int i = 1; i <= N; i++) std::cin >> h[i];

  // dp[i] := 足場 i に移動するのに要するコスト
  std::vector<int> dp(N + K + 1, INF);
  dp[0] = 0;
  dp[1] = 0;

  for (int i = 1; i < N; i++) {
    for (int j = 1; j <= K; j++) {
      dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]));
    }
  }
  std::cout << dp[N] << std::endl;
}

Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;


public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line;
		do {
			List<String> list = new ArrayList<String>();
			for (int i = 0 ; i < 8 ; i++) {
				line = br.readLine();
				if (!line.equals("00000000")) list.add(line);
			}
			if (list.size() == 1) System.out.println("C");
			else if (list.size() == 4) System.out.println("B");
			else if (list.size() == 2) {
				int j1 = list.get(0).indexOf('1');
				int j2 = list.get(1).indexOf('1');
				if (j1 < j2) System.out.println("E");
				else if (j1 == j2) System.out.println("A");
				else System.out.println("G");
			} else {
				int j1 = list.get(0).indexOf('1');
				int j3 = list.get(2).indexOf('1');
				if (j1 < j3) System.out.println("F");
				else System.out.println("D");
			}
		} while ((line = br.readLine()) != null);

	}
}

Measured memory_bytes: 16892
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    
    vector<int> vec =  vector<int>(N,0);
    
    int A;
    for (int i = 0; i < N-1; i++)
    {
        cin >> A;
        A--;
        vec.at(A)++;
    }
    
    for (int i = 0; i < N; i++)
    {
        cout << vec.at(i) << endl;
    }
    
}

Measured memory_bytes: 4052
from collections import defaultdict
class UnionFind:
    def __init__(self, n):
        class KeyDict(dict):
            # 辞書にないときの対応
            def __missing__(self,key):
                self[key] = key
                return key
        self.parent = KeyDict()
        self.rank = defaultdict(int)
        self.weight = defaultdict(int)

    # 根を探す
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            # 経路圧縮
            # 自分自身じゃない場合は、上にさかのぼって検索(再帰的に)
            y = self.find(self.parent[x])           
            self.weight[x] += self.weight[self.parent[x]]   #圧縮時にweightを更新(和)
            self.parent[x] = y      #親の置き換え(圧縮)
            return self.parent[x]

    # 結合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        # 低い方を高い方につなげる(親のランクによる)
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
        
        if self.rank[x] == self.rank[y]:
            self.rank[x] += 1

    ### 重み付き
    def weighted_union(self, x, y, w):
        # print("unite",x,y,w,self.weight)
        px = self.find(x)
        py = self.find(y)
        # 低い方を高い方につなげる(親のランクによる)
        # if px == py: return 0
        if self.rank[px] < self.rank[py]:
            self.parent[px] = py
            self.weight[px] = - w - self.weight[x] + self.weight[y]
        else:
            self.parent[py] = px
            self.weight[py] =  w + self.weight[x] - self.weight[y]
        if self.rank[px] == self.rank[py]:
            self.rank[px] += 1
        return 0

    # 判定
    def judge(self, x, y):
        return self.find(x) == self.find(y)


H,W = map(int, input().split())
fields = [list(input()) for i in range(H)]
uf = UnionFind(H*W)
for i in range(H):
    for j in range(W):
        if i-1 >= 0 and fields[i][j] != fields[i-1][j]:
            uf.union(i*W+j,(i-1)*W+j)
        if j-1 >= 0 and fields[i][j] != fields[i][j-1]:
            uf.union(i*W+j,i*W+j-1)
        if i+1 < H and fields[i][j] != fields[i+1][j]:
            uf.union(i*W+j,(i+1)*W+j)
        if j+1 < W and fields[i][j] != fields[i][j+1]:
            uf.union(i*W+j,i*W+j+1)


cnt_w = defaultdict(int)
cnt_b = defaultdict(int)
ps = set()
for i in range(H):
    for j in range(W):
        p = uf.find(i*W+j)
        ps.add(p)
        if fields[i][j] == ".":
            cnt_w[p] += 1
        else:
            cnt_b[p] += 1
ans = 0
for p in ps:
    ans += cnt_w[p] * cnt_b[p]
print(ans)

Measured memory_bytes: 121432
//#include <boost/multiprecision/cpp_int.hpp> 
#include<bits/stdc++.h>
#define ll long long 
#define ull unsigned ll
#define pb push_back
#define mp make_pair
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define test    ll t=0;cin>>t;while(t--)
#define fast    ios_base::sync_with_stdio(false);cin.tie(NULL)
//using namespace boost::multiprecision; 
using namespace std;

int main(void) {
	ll a,b,c,k,ans=0;
	cin>>a>>b>>c>>k;
	if(k<=a)
	ans=k;
	else{
	    ans+=a;
	    k-=a;
	}
	if(k>b){
	    while(b--)
	    k--;
	    while(k&&c){
	        ans-=1;
	        c--,k--;
	    }
	}
	cout<<ans;
	return 0;
}



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

void show_array(int *array, int &N){
	for(int i=0; i<N; ++i){
		cout << array[i];
		if(i < N-1){
			cout << " ";
		}
	}	
	cout << endl;
}


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

	int A[N]; // define a static array

	// Input values in the array
	for(int i=0; i<N; i++){
   scanf("%d", &A[i]);
	}

	// Bubble Sort
	int flag = 1;
	int temp;
	int count=0;
	int index=0;
	while(flag){
		flag = 0;

		for(int j=N-1; index<j; --j){
			if (A[j] < A[j-1]){
				temp = A[j-1];
				A[j-1] = A[j];
				A[j] = temp;

				count += 1;
				flag = 1;
			}
		}
		index += 1;
	}

	show_array(A, N);
	cout << count << endl;


	return 0;
}



Measured memory_bytes: 3212
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <string>
#define SIZE 100005
#define INF 1000000005

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

ll X[SIZE];
int W[SIZE];

int main()
{
	int n;
	ll L,T;
	scanf("%d %lld %lld",&n,&L,&T);
	bool up=true;
	for(int i=0;i<n;i++)
	{
		scanf("%lld %d",&X[i],&W[i]);
		if(W[i]!=W[0]) up=false;
	}
	if(up)
	{
		if(W[0]==1)
		{
			for(int i=0;i<n;i++) printf("%lld\n",(X[i]+T)%L);
		}
		else
		{
			for(int i=0;i<n;i++) printf("%lld\n",(X[i]-T%L+L)%L);
		}
		return 0;
	}
	vector <ll> pos;
	for(int i=0;i<n;i++)
	{
		if(W[i]==2) pos.push_back((X[i]-T%L+L)%L);
		else pos.push_back((X[i]+T)%L);
	}
	sort(pos.begin(),pos.end());
	int nm=0;
	for(int i=0;i<n;i++) if(W[i]==1) nm++;
	vector <ll> ans;
	ans.resize(n);
	for(int i=0;i<n;i++)
	{
		if(W[i]==2)
		{
			ll cnt=0;
			for(int j=0;j<n;j++)
			{
				if(W[j]==1)
				{
					ll s=X[i]-2LL*T,t=X[i];
					//[s,t] の中にいくつ入っているか
					s-=X[j],t-=X[j];
					if(s<=0)
					{
						ll pl=(-s+L)/L;
						s+=pl*L,t+=pl*L;
					}
					//printf("* %lld %lld\n",s,t);
					cnt+=t/L-(s-1)/L;
				}
			}
			//printf("%lld\n",cnt);
			cnt%=n;
			int now=i;
			while(cnt>0)
			{
				now--;
				cnt--;
				if(now<0) now+=n;
			}
			//now <-> i
			int st=0;
			for(int j=0;j<pos.size();j++)
			{
				if(pos[j]==(X[i]-T%L+L)%L)
				{
					st=j;
					break;
				}
			}
			for(int j=0;j<n;j++)
			{
				ans[(now+j)%n]=pos[(st+j)%n];
			}
			break;
		}
	}
	for(int i=0;i<n;i++) printf("%lld\n",ans[i]);
	return 0;
}


Measured memory_bytes: 4084
N = int(input())
a = list(map(int,input().split()))
# >0
r = 0
res = 0
for i in range(N):
    sa = 0
    r += a[i]
    if i%2==0:
        if r <= 0:
            sa = 1-r
            r += sa
    else:
        if r >= 0:
            sa = r+1
            r -= sa
    res += sa

# <0
r = 0
res2 = 0
for i in range(N):
    sa = 0
    r += a[i]
    if i%2==1:
        if r <= 0:
            sa = 1-r
            r += sa
    else:
        if r >= 0:
            sa = r+1
            r -= sa
    res2 += sa
print(min(res,res2))


Measured memory_bytes: 14468
round = lambda x: (x*2+1)//2

def rec(num):
    ans = round(num / (-2))
    remain = num - (-2)*ans
    if ans == 0:
        print(int(remain), end='')
        return
    rec(ans)
    print(int(remain), end='')
    return

def p_ans(num):
    rec(num)
    print()

if __name__ == '__main__':
    N = int(input())
    p_ans(N)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

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

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

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

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


template <typename T>
T amarinasi(T a,T b){
    if(a%b==0)
{
    return a/b;
}
else if(a%b>0)
{
    return a/b+1;
}
else
{
    return a/b-1;
}
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

//----------------------------------------------------------------


int main(){
  std::cout << std::fixed << std::setprecision(10);
long double l;
cin>>l;
cout<<(l*l*l)/27<<endl;
}



Measured memory_bytes: 256
#include <iostream>
//#include <iomanip>
//#include <string>
#include <vector>
#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
//void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

void DFS(vvll &g,vll &cnt,int n){
	if(cnt.at(n)!=-1) return ;
	ll res = 0 ;
	for(int i=0;i<g.at(n).size();i++){
		DFS(g,cnt,g.at(n).at(i)) ;
		res = max(res,cnt.at(g.at(n).at(i))+1) ;
	}
	cnt.at(n) = res ;
}

int main(){
	ll n,m ;
	cin >> n >> m ;
	vvll g(n,vll(0)) ;
	vb root(n,true) ;
	for(int i=0;i<m;i++){
		ll a,b ;
		cin >> a >> b ;
		a-- ; b-- ;
		g.at(a).emplace_back(b) ;
		root.at(b) = false ;
	}
	vll cnt(n,-1) ;
	for(int i=0;i<n;i++){
		if(root.at(i)){
			DFS(g,cnt,i) ;
		}
	}
	ll ans = 0 ;
	for(int i=0;i<n;i++) ans = max(ans,cnt.at(i)) ;
//	for(auto i:cnt) cout << i << " " ; cout << endl ;
	cout << ans << endl ;
}


Measured memory_bytes: 15872
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long ans = N / (A + B) * A;
        long amari = N % (A + B);
        if(amari >= A) {
            System.out.println(ans + A);
        }else {
            System.out.println(ans + amari);
        }
    }
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}


void solve()
{
   string s,t;
    
   cin >> s >> t;
    
    
   int n = s.length();
    
    int f = 1;
    
    if(t.length() == n + 1)
    {
        f(i,n) if(t[i] != s[i]) f = 0;
    }
    else f = 0;
    
    if(f) cout <<"Yes";
    else cout <<"No";
    
    
}

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

Measured memory_bytes: 3620
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  string s;
  cin >> s;
  int n = s.size();

  bool N = false, W = false, S = false, E = false;
  for(int i=0;i<n;i++){
    if(s[i] == 'N') N = true;
    if(s[i] == 'W') W = true;
    if(s[i] == 'S') S = true;
    if(s[i] == 'E') E = true;
  }

  bool ans = true;
  if(N && !S) ans = false;
  if(!N && S) ans = false;
  if(E && !W) ans = false;
  if(!E && W) ans = false;

  if(ans){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
a = int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

lst = [a,b,c,d,e]
lst.sort()

M=max(lst)
m=min(lst)
if M-m<=k:
  print("Yay!")
else:
  print(":(")

Measured memory_bytes: 3064
# -*- coding: utf-8 -*-
import sys

N=input()
S=["None"]+list(raw_input())
Q=input()
query=[ sys.stdin.readline().split() for _ in range(Q) ]

#BIT
bit=[ [ 0 for _ in range(N+1) ] for _ in range(27) ]  #1-indexed bit[1]:aのbit, bit[2]:bのbit ...

def add(idx,a,w):
    while a<=N:
        bit[idx][a]+=w
        a+=a&-a

def sum(idx,a):
    ret=0
    while 0<a:
        ret+=bit[idx][a]
        a-=a&-a
    return ret

for i,x in enumerate(S):
    if i==0: continue
    add(ord(x)-96,i,1)  #a~zのどのbit配列か,特定文字のbit配列の何番目,bitに代入する値


for q1,q2,q3 in query:
    q1=int(q1)
    q2=int(q2)
    if q1==1:
        before_q3=S[q2] #文字列Sの変更前の文字をbefore_q3に代入
        S[q2]=q3        #文字列Sの変更部分1文字を更新
        q3=ord(q3)-96                   #変更後の文字をアスキーコード10進数で表現
        before_q3=ord(before_q3)-96     #変更前の文字をアスキーコード10進数で表現
        add(q3,q2,1)                    #a~zのどのbit配列か,特定文字のbit配列の何番目,bitに代入する値
        add(before_q3,q2,-1)    #置き代えた文字は-1しなきゃいけない
    elif q1==2:
        q3=int(q3)
        cnt=0
        for i in range(1,27):
            if 0<sum(i,q3)-sum(i,q2-1):
                cnt+=1
        print cnt

Measured memory_bytes: 169352
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
#define REP(i,n) for(int i=0;i<(int)n;++i)
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
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 S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
string num2bit(ll num, ll len){
    string bit = "";
    REP(i, len){
    bit += char('0'+(num>>i & 1));
    }
    return bit;
}

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

    ll N, K, C;
    cin >> N >> K >> C;
    string S;
    cin >> S;

    vector<ll> L(K), R(K);
    vector<ll> resL, resR;
    REP(i, S.size()){
        if(S[i] == 'o'){
            ll sz = (int)resL.size();
            if(sz==0){
                resL.push_back(i);
                L[sz] = i;
            }else{
                if(sz<K and resL.back()+C<i){
                    resL.push_back(i);
                    L[sz] = i;
                }
            }
        }
    }

    reverse(S.begin(), S.end());
    REP(i, S.size()){
        ll sz = (int)resR.size();
        if(S[i] == 'o'){
            if(sz==0){
                resR.push_back(i);
                R[K-1-sz] = N-1-i;
            }else{
                if(sz<K and resR.back()+C<i){
                    resR.push_back(i);
                    R[K-1-sz] = N-1-i;
                }
            }
        }
    }

    //cout << L << endl;
    //cout << R << endl;

    REP(i, K) if(L[i] == R[i]) cout << L[i]+1 << endl;

    return 0;
}

Measured memory_bytes: 8200
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= 9; j++) {
				if (i*j == N) {
					System.out.println("Yes");
					System.exit(0);
				}
			}
		}
		System.out.println("No");
	}
}

Measured memory_bytes: 23764
/*
[arc099] C - Minimization
*/

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

const int MAX_N = 100000;

int N, K;
int a[MAX_N];

ll solve() { return (N - 1 + K - 1 - 1) / (K - 1); }

int main() {
    cin >> N >> K;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }

    cout << solve() << endl;

    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

/**
 * Main
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long X = sc.nextLong();
        long count = 0;
        double Yokin = 100;
        double Kinri = 1.01;

        while (Yokin < X) {
            Yokin = Yokin*Kinri;
            Yokin = Math.floor(Yokin);
            count++;
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 27112
def search(l):
    global i
    if len(l) == 0:
        return
    v = p[i]
    i += 1
    for j in range(len(l)):
            if l[j] == v:
                id = j
                break
    if len(l) != 1:
        search(l[:id])
        search(l[id+1:])
        ans.append(v)
    else:
        ans.append(v)

n = int(input())
p = [int(_) for _ in input().split()]
m = [int(_) for _ in input().split()]
i = 0
ans = []
search(m)
print(" ".join(map(str, ans)))



Measured memory_bytes: 5604
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1] * (n + 1)
    self.rnk = [0] * (n + 1)

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

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if x == y:
      return 
    elif self.rnk[x] > self.rnk[y]:
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if self.rnk[x] == self.rnk[y]:
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)

  def Count(self, x):
    return -self.root[self.Find_Root(x)]
  
N, M = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(M)]
res = 0
for i in range(M):
  uf = UnionFind(N)
  for j in range(M):
    if i == j:
      continue
    uf.Unite(A[j][0], A[j][1])
  for k in range(1, N + 1):
    if k != A[i][0] and k != A[i][1]:
      if uf.Count(k) != N:
        res += 1
      break
print(res)

Measured memory_bytes: 42352
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; for(auto v : V) os << v << " "; return os << "]"; }
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; for(auto s:S) os<<s<<" ";return os<<"}"; }
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) { return os << "(" << P.first << "," << P.second << ")";}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) { os << "{ "; for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") "; return os<<"}"; }
#ifdef LMAO
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | "; __f(comma+1, args...); }
#else
    #define trace(...) 42
#endif
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define endl "\n"
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
#define all(x) x.begin(), x.end()
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAX = 1000010;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;    
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ld EPS = 1e-7;
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)   
/*****************start************/
void solve()
{
    int n,k;
    cin>>n>>k;
    vector<ll> a(n);
    for(auto &i:a)
        cin>>i;
    for(int i=k;i<n;i++)
    {
        if(a[i]<=a[i-k])
        {
            cout<<"No"<<endl;
        }
        else
        {
            cout<<"Yes"<<endl;
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout<<fixed<<setprecision(25);cerr<<fixed<<setprecision(10);
    auto start = std::chrono::high_resolution_clock::now();
    // tcase{
        solve();
    // }
    auto stop = std::chrono::high_resolution_clock::now(); 
    auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start); 
    // cerr << "Time taken : " << ((long double)duration.count())/((long double) 1e9) <<"s "<< endl;     
    return 0;
}


Measured memory_bytes: 4808
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<limits.h>
#include<cmath>
#include<queue>
#include<stack>

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

#define rep(i,n) for(ll i = 0; i < (ll)n; i++)
#define swap(a,b) a^=b;b^=a;a^=b;
#define chmax(a,b) {if(a < b) a = b;}
#define chmin(a,b) {if(a > b) a = b;}

using namespace std;
typedef long long ll;
ll gcd(ll, ll);
vector<bool> to_binary(int);
ll nCr(ll n, ll r);

const ll INF = 1LL << 60;

typedef tuple<ll, ll> mtupl;

/*

bool mycomp(mtupl x, mtupl y) {
	return get<1>(x) < get<1>(y);
}

int vsum(vector<int> v) {
	int res = 0;
	for (auto it = v.begin(); it != v.end(); it++)
		res += *it;
	return res;
}

int vmin(vector<int> v) {
	int min = INT32_MAX;
	for (auto it = v.begin(); it != v.end(); it++)
		min = std::min(min, *it);
	return min;
}

int vmax(vector<int> v) {
	int max = INT32_MIN;
	for (auto it = v.begin(); it != v.end(); it++)
		max = std::max(max, *it);
	return max;
}

ll gcd(ll A, ll B) {
	if (A == 0 || B == 0) return max(A, B);
	int r = A % B;
	while (r != 0) {
		A = B;
		B = r;
		r = A % B;
	}
	return B;
}

vector<ll> prime_factor(int64_t n) {
	//map< ll, ll > ret;
	vector<ll> ret;
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			//ret[i]++;
			ret.push_back(i);
			n /= i;
		}
	}
	if (n != 1)ret.push_back(n);// ret[n] = 1;
	return ret;
}

const int MAX = 1000000;
const int MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int 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;
	}
}
ll COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct edge {
	ll to;
	ll cost;
};

*/

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

	string s;
	cin >> s;
	ll q;
	cin >> q;
	string before = "", after = "";
	int rev = 0;

	for (ll i = 0; i < q; i++) {
		int t;
		cin >> t;
		if (t == 1) { //反転
			rev++;
			rev %= 2;
		}
		else { //追加
			int f;
			char c;
			cin >> f;
			cin >> c;
			f += rev;
			f %= 2;

			if (f == 1) {
				before = c + before;
			}
			else {
				after.push_back(c);
			}
		}
	}
	if (rev == 0) { //最終的に反転なし
		cout << before + s + after << endl;
	}
	else {
		for (auto it = after.rbegin(); it != after.rend(); it++) {
			cout << *it;
		}
		for (auto it = s.rbegin(); it != s.rend(); it++) {
			cout << *it;
		}
		for (auto it = before.rbegin(); it != before.rend(); it++) {
			cout << *it;
		}
		cout << endl;

	}


ProgramEndPointLabel:;

	//Program End
#ifndef DEBUG
	system("pause");
#endif // !DEBUG


	return 0;
}




Measured memory_bytes: 1416
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
int main() {
    string s, t;
    cin >> s;
    cin >> t;
    int n = s.size();
    t.erase(n);
    if (t == s) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3632
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());

		PriorityQueue<Integer> q = new PriorityQueue<>(Collections.reverseOrder());

		for (int i = 0; i < n; i++) {
			q.add(Integer.parseInt(sc.next()));
		}

		for (int i = 0; i < m; i++) {
			q.add(q.poll()/2);
		}

		long ans = 0;
		Integer[] a = q.toArray(new Integer[0]);

		for (int i = 0; i < a.length; i++) {
			ans += a[i];
//			System.out.println(ans);
		}

		System.out.println(ans);
		sc.close();
	}
}

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

using namespace std;
bool solve(int A[], int n, int a, int b);

int main(int argc, char *argv[])
{
	int n, m;
	int A[2000];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> m;
		A[i] = m;
	}
	int p, q;
	cin >> p;
	for (int i = 0; i < p; i++)
	{
		cin >> q;
		if (solve(A, n, 0, q))
			cout << "yes";
		else
			cout << "no";
		cout << endl;
	}
	return 0;
}



bool solve(int A[], int n, int a, int b)
{
	if (b == 0) return true;
	
	if (a < n) 
		return solve(A, n, a+1, b) || solve(A, n, a+1, b-A[a]);
	return false;
}


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

using namespace std;

int main() {
    int n, m, i, j;
    cin>>n>>m;
    if(n%2)
    for(i=1;i<=m;i++)
    {
        printf("%d %d\n", i, n+1-i);
    }
    else if(n%4)
    {
        if(m<=n/4)
        {
        for(i=1;i<=m;i++)
        printf("%d %d\n", i, n+1-i);
    }
    else
    {
        for(i=1;i<=(n/4);i++)
        printf("%d %d\n", i, n+1-i);
        for(i=1;i<=(m-(n/4));i++)
        printf("%d %d\n", (n/4)+i, 3*(n/4)+2-i);
    }
    }
    else
    {
        if(m<=n/4)
        {
        for(i=1;i<=m;i++)
        printf("%d %d\n", i, n+1-i);
    }
    else
    {
        for(i=1;i<=(n/4);i++)
        printf("%d %d\n", i, n+1-i);
        for(i=1;i<=(m-(n/4));i++)
        printf("%d %d\n", (n/4)+i, 3*(n/4)-i);
    }
    }
    return 0;
}

Measured memory_bytes: 3764
import copy
N = int(input())
A = [int(input()) for i in range(N)]
set_A = list(set(A))
set_A.sort(reverse=True)
A_copy = copy.deepcopy(A)
A_copy.sort(reverse=True)
Max = max(A)
cnt = 0
for i in range(N):
    if A[i] == Max:
        cnt += 1
for i in range(N):
    if A[i] == Max:
        if cnt > 1:
            print(Max)
        else:
            print(set_A[1])
    else:
        print(Max)


Measured memory_bytes: 98256
a, b, k = map(int,input().split(" "))
if k*2<(b-a+1):
	for i in range(k):
		print(a+i)
	for i in range(k):
		print(b-k+i+1)
else :
	for i in range(b-a+1):
		print(a+i)

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

using namespace std;
#define lint long long


int main() {
    string s;
    cin >> s;
    for(int i = 0; i < 4; ++i){
        cout << s[i];
    }
    cout << " ";
    for(int i = 4; i < 12; ++i){
        cout << s[i];
    }
    cout << endl;
}

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

int main()
{
ll h , w ;
cin >> h >> w ;
if(h%3==0)ans=0;
else ans=w;
if(w%3==0)ans=0;
else ans=min(ans,h);

rep(i,h+1){
  ll a=i*w;
  ll b=(h-i)*(w/2);
  ll c=(h-i)*(w-w/2);
  vector<ll> v={a,b,c};
  sort(v.begin(),v.end());
  ans=min(ans,v[2]-v[0]);
}rep(i,w+1){
  ll a=i*h;
  ll b=(w-i)*(h/2);
  ll c=(w-i)*(h-h/2);
  vector<ll> v={a,b,c};
  sort(v.begin(),v.end());
  ans=min(ans,v[2]-v[0]);
}
cout << ans << endl;
return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    const string S = "snuke";
    int H, W;
    cin >> H >> W;
    int ansh = 0;
    char answ = 0;
    REP(i,H) REP(j,W) {
        string s; cin >> s;
        if (s == S) {
            ansh = i+1;
            answ = 'A' + j;
        }
    }

    cout << answ << ansh << '\n';

    return 0;
}

Measured memory_bytes: 3612
def solve(record):
    point_a = 0
    point_b = 0
    while record != []:
        if record.pop(0) == "A":
            point_a += 1
        else:
            point_b += 1
    if point_a > point_b:
        point_a += 1
    else:
        point_b += 1
    print(point_a, point_b)


while 1:
    record1 = list(input())
    if record1[0] == "0":
        break

    record1.pop(0)
    solve(record1)

    record2 = list(input())
    record2.pop(0)
    solve(record2)

    record3 = list(input())
    record3.pop(0)
    solve(record3)



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

int main() {
  int H,W;
  cin >> H >> W;
  
  for (int i=0; i<W+2; i++) {
    cout << "#" ;
  }
  
  cout << endl;
  
  for (int i=0; i<H; i++) {
    cout << "#";
    
    vector<char> A(W);
    for (int j=0; j<W; j++) {
      cin >> A.at(j);
      cout << A.at(j);
    }
    
    cout << "#" << endl;
  }

  for (int i=0; i<W+2; i++) {
    cout << "#" ;
  }
  
  cout << endl;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n,m,min,max;
    int tmp;
    cin >> n >> m;
    min = 1;
    max = n;
    FOR(i,0,m){
        cin >> tmp;
        if(min < tmp) {
            min = tmp;
        }
        if(max < tmp){
            cout << 0;
            return 0;
        }
        cin >> tmp;
        if(tmp < max)
            max = tmp;
        if(tmp < min){
            cout << 0;
            return 0;
        }
    }
    cout << max - min+1;
    return 0;
}

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

using namespace std;
#define MOD 1000000007

vector<int> e[200010];
int N, a, b, f[200010], g[200010], s[200010], ans[200010];
long long fact[200010], inv[200010];

long long power(long long x, int y) {
    long long ans = 1;
    while (y) {
        if (y & 1) {
            ans = ans * x % MOD;
        }
        x = x * x % MOD;
        y /= 2;
    }
    return ans;
}

void dfs1(int x, int fa) {
    int l = e[x].size();
    s[x] = 1;
    f[x] = 1;
    for (int i = 0; i < l; ++i) {
        if (e[x][i] != fa) {
            dfs1(e[x][i], x);
            s[x] += s[e[x][i]];
            f[x] = (long long)f[x] * f[e[x][i]] % MOD * inv[s[e[x][i]]] % MOD;
        }
    }
    f[x] = f[x] * fact[s[x] - 1] % MOD;
}

void dfs2(int x, int fa) {
    int l = e[x].size();
    if (x > 1) {
        g[x] = f[fa] * inv[s[fa] - 1] % MOD * fact[s[x]] % MOD *
                power(f[x], MOD - 2) % MOD * g[fa] % MOD * inv[N - s[fa]] %
                MOD * fact[N - s[x] - 1] % MOD;
        ans[x] = f[x] * inv[s[x] - 1] % MOD * g[x] % MOD * inv[N - s[x]] %
                MOD * fact[N - 1] % MOD;
    } else {
        g[x] = 1;
        ans[x] = f[x];
    }
    for (int i = 0; i < l; ++i) {
        if (e[x][i] != fa) {
            dfs2(e[x][i], x);
        }
    }
}

int main() {
    scanf("%d", &N);
    fact[0] = inv[0] = 1;
    for (int i = 1; i <= N; ++i) {
        fact[i] = fact[i - 1] * i % MOD;
        inv[i] = power(fact[i], MOD - 2);
    }
    for (int i = 1; i < N; ++i) {
        scanf("%d%d", &a, &b);
        e[a].push_back(b);
        e[b].push_back(a);
    }
    dfs1(1, 0);
    dfs2(1, 0);
    for (int i = 1; i <= N; ++i) {
        printf("%d\n", ans[i]);
    }
    return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int H, W;
  cin >> H >> W;
  int dx[4] = {0, 1, 0, -1};
  int dy[4] = {1, 0, -1, 0};
  vector<string> A(H);
  REP(i, H) cin >> A[i];
  queue<P> Q;
  queue<P> Qnext;
  int ans = 0;
  for(int i = 0; i < H; i++) {
    for(int j = 0; j < W; j++) {
      if(A[i][j] == '#') { Q.push(P(i, j)); }
    }
  }
  while(1) {
    while(!Qnext.empty()) {
      Q.push(Qnext.front());
      Qnext.pop();
    }
    while(!Q.empty()) {
      int x = Q.front().first;
      int y = Q.front().second;
      Q.pop();
      for(int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if(nx < 0 || H <= nx || ny < 0 || W <= ny) { continue; }
        if(A[nx][ny] == '#') { continue; }
        A[nx][ny] = '#';
        Qnext.push(P(nx, ny));
      }
    }
    if(Qnext.empty()) { break; }
    ans++;
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;

#define ll long long

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

	if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
		cout << 0 << endl;
	} else {
		ll ans = min(a * b, min(b * c, c * a));
		cout << ans << endl;
	}

	return 0;
}


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

//Containers
typedef long long int lng;
#define vint vector<int>
#define vtwod vector<vector<int>>
#define vlng vector<long long int>
#define vstr vector<string>
#define vvint vector<int,int>
#define pint pair<int,int>
#define lint list<int>
#define qint queue<int>
#define dqint deque<int>
#define pq priority_queue<int>
#define rpq priority_queue<int,vector<int>,greater<int>>
#define fl forward_list<int>
#define st stack<int>
#define sint set<int>
#define msint multiset<int>


//Methods of containers:-
#define pb push_back
#define pf push_front
#define mp make_pair
#define F first
#define S second
#define ub upper_bound
#define lb lower_bound
#define binsear binary_search
#define popf pop_front
#define popb pop_back
#define empb emplace_back
#define empf emplace_front
#define emp emplace
#define emt empty
#define ins insert
#define insaft insert_after
#define emplaft emplace_after
#define ersaft erase_after
#define swp swap
#define splicaft splice_after


//FUNCTIONS
int min3(int a,int b,int c)
{
    return min(min(a,b),c);
}
int max3(int a,int b,int c)
{
    return max(max(a,b),c);
}
void gcd(int a,int b)
{
    cout<<__gcd(a,b)<<endl;
}

/*******************************************************************CODE**************************************************************/
void doit()
{
    lng x=0,y=0;
    cin>>x>>y;
    if(y>=2*x && y<=4*x && y%2==0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(NULL);
    doit();
    return 0;
}



Measured memory_bytes: 3624
import java.util.*;
import java.util.Map.Entry;
 
 

class Main {
	 static int mod =  (int) (Math.pow(10,9)+7);
   public static void main(String[] args) {
	   
       Scanner sc = new Scanner(System.in);
       int N = sc.nextInt();
       String ans="APPROVED";
       
       String[] s = new String[(int)N];
       for (int i=0 ; i<N; i++) {
           s[i] = sc.next();
       }
       
       Arrays.sort(s);
       
       String[] t = new String[N];
       int[] cnt = new int[N];
       int tmp=-1;
       int max=0;
       for (int i=0 ; i<N; i++) {
    	   if(i==0||!s[i].equals(s[i-1])) {
    		   tmp++;
    		   t[tmp]=s[i];
    		   cnt[tmp]=1;
    	   } else {
    		   cnt[tmp]++;
    	   }
		   max=Math.max(max, cnt[tmp]);
       }
       
       for(int i=0;i<tmp+1;i++) {
    	   if(cnt[i]==max) {
    		   System.out.println(t[i]);
    	   }
       }
       
   }

}

Measured memory_bytes: 78940
#include <stdio.h>

int main(void)
{
    int a,b,m;
    scanf("%d%d%d",&a,&b,&m);
    int arya[a+1],aryb[b+1];
    for(int i=0;i<a;i++){
        scanf("%d",&arya[i]);
    }
    for(int i=0;i<b;i++){
        scanf("%d",&aryb[i]);
    }
    int x[m+1],y[m+1],c[m+1];
    for(int i=0;i<m;i++){
        scanf("%d%d%d",&x[i],&y[i],&c[i]);
    }
    int mina=arya[0];
    int minb=aryb[0];
    for(int i=0;i<a;i++){
        if(mina>arya[i]){
            mina=arya[i];
        }
    }
    for(int i=0;i<b;i++){
        if(minb>aryb[i]){
            minb=aryb[i];
        }
    }
    int ans=mina+minb;
    for(int i=0;i<m;i++){
        int xi=x[i]-1;
        int yi=y[i]-1;
        if(ans>arya[xi]+aryb[yi]-c[i]){
            ans=arya[xi]+aryb[yi]-c[i];
        }
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 2176
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using llu=unsigned long long;
#define mod 1000000007
#define mode 998244353
#define PI 3.14159265358979323846
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mms(x,y) memset(x,y,sizeof(x))
#define pqm priority_queue<ll,vector<ll>,greater<ll>>
#define pb push_back
#define um unordered_map
#define pr pair
#define mm multimap
#define ms multiset
#define mp make_pair
#define vr vector
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define inf INT_MAX
#define ninf INT_MIN
#define ff first
#define ss second
#define gcd __gcd
ll dp[3005][3005];
ll rohan(ll i,ll j,ll *a)
{
    if(i>j)return 0;
    if(dp[i][j]!=-1)return dp[i][j];
    ll l=min(rohan(i+2,j,a),rohan(i+1,j-1,a));
    ll r=min(rohan(i,j-2,a),rohan(i+1,j-1,a));
    return dp[i][j]=max(l+a[i],r+a[j]);
}
int main()
{
    fast;
    ll t,n,m,i,j,k;
    cin>>n;
    ll a[n];
    mms(dp,-1);
    k=0;
    for(i=0;i<n;i++)cin>>a[i],k+=a[i];
    cout<<2*rohan(0,n-1,a)-k;
}


Measured memory_bytes: 71040
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 60) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

ll n;
ll sum = 0;
ll a[100100];
bool f = 1;

int main() {
	cin >> n;
	rep(i, n) {
		cin >> a[i];
		sum += a[i];
	}
	if (sum % (n*(n + 1) / 2) != 0) {
		cout << "NO" << endl;
		return 0;
	}
	ll x = sum / (n*(n + 1) / 2);
	sum = 0;
	rep(i, n - 1) {
		if (a[i + 1] - a[i] - x > 0 || abs(a[i + 1] - a[i] - x) % n != 0) {
			f = 0;
		}
	}
	if (f)cout << "YES" << endl;
	else cout << "NO" << endl;

}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long
static const ll MAX = 1000000;
static const ll INFTY = 1e12;

struct edge {
    ll to, cost;
};

using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;
// 入力
int H, W;
vector<vector<char>> field;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

// 深さ優先探索
vector<bool> seen;
vector<int> colors;


int main() {

    int N;
    cin >> N;
    vector<int> x(N), y(N);
    REP(i, N){
        cin >> x[i] >> y[i];
    }
    vector<int> arr(N);
    iota(arr.begin(), arr.end(), 0);

    // int array[]={1,2,3,4};
    double sum = 0;
    do{
        double tmp = 0;
        REP(i, N-1){
            int _x = x[arr[i]] - x[arr[i+1]];
            int _y = y[arr[i]] - y[arr[i+1]];
            tmp += sqrt( (double)(pow(_x) + pow(_y)) );
        }
        // cout << tmp << endl;
        // tmp /= (double)N;
        sum += tmp;
        
     
    }while(next_permutation(arr.begin(),arr.begin()+N));
    int bunbo = 1;
    for(int i = N; i >= 1; i--){
        bunbo *= i;
    }
    
    printf("%0.10f", sum / (double)(bunbo));
 
    return 0;  
   

    
    
}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/


Measured memory_bytes: 256
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::*;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::collections::*;

fn solve() {
    input! {
        n: usize,
        av: [usize; n]
    };

    let mut cur = 0;
    for a in av {
        if a == cur + 1 {
            cur = a;
        }
    }
    let res = if cur == 0 { -1 } else { (n - cur) as isize };
    println!("{}", res);
}

fn main() {
    std::thread::Builder::new()
        .name("big stack size".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(|| {
            solve();
        })
        .unwrap()
        .join()
        .unwrap();
}


Measured memory_bytes: 3804
#include <bits/stdc++.h>
using namespace std;
  int main(){
  
  int N,X,T;
  cin >> N >> X >> T; 
 
  int a = N/X;
   int b = a+1;
  if( N % X == 0){
    cout << a*T << endl;
                 }
  else {
  
  if ( N < X ) {
  cout << T << endl;
               }
  
  else if ( N > X) {
  cout << b*T << endl;
       }
       }
             }
  


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

int f(int x){
    if(x < 10) return x;
    else return x % 10 + f(x / 10);
}

int main(){
    int n, a, b, ans = 0;
    cin >> n >> a >> b;
    for(int i = 1; i <= n; i++){
        if(a <= f(i) && f(i) <= b) ans += i;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628