akhauriyash/Code-Regression huggingface dataset:
use std::io;
use std::str::FromStr;

fn main() {
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();
    let mut it = buf.split_whitespace().map(|n| usize::from_str(n).unwrap());
    let (x1,x2, x3, x4, x5) = (it.next().unwrap(), it.next().unwrap(), it.next().unwrap(), it.next().unwrap(), it.next().unwrap());

   if x1 == 0{
        println!("{}", 1);
   }else if x2 == 0{
        println!("{}", 2);
   }else if x3 == 0{
        println!("{}", 3);
   }else if x4 == 0{
        println!("{}", 4);
   }else if x5 == 0{
        println!("{}", 5);
    }
        
}

Measured memory_bytes: 2004
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}

vector<pair<int,int>> v;

void func(int id, int n){
  int cnt = 0;
  
  while(n != 0){
    int dec = n - n/2;
    
    n /= 2;
    v.push_back(make_pair(dec,id));
  }
  return;
}

int main(){
  int n,m;
  cin >> n >> m;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  
  rep(i,n){
    func(i,a[i]);
  }
//  for(auto v1:v){
//    printf("%d, %d\n",v1.first,v1.second);
//  }
  sort(v.begin(),v.end(),greater<pair<int,int>>());
//  for(auto v1:v){
//    printf("%d, %d\n",v1.first,v1.second);
//  }
  
  ll ans = 0;
  rep(i,n) ans += a[i];
  
  for(auto v1:v){
    int dec,id;
    tie(dec,id) = v1;
    ans -= dec;
    m--;
    if (m == 0) break;
  }
  
  
  cout << ans;
  
  
  return 0;
}

Measured memory_bytes: 35556
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;
typedef long long ll;

int main() {
	int A, B;
	cin >> A >> B;
	int K; cin >> K;
	int cnt = 0;
	int ans = 0;
	int div = min(A, B);
	for (int i = div; cnt < K; i--) {
		if (A % i == 0 && B % i == 0) {
			cnt++;
			ans = i;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3616
#include "bits/stdc++.h"
using namespace std;
vector <int> v;
vector <int> g[10005];
int a[10005];

void dfs(int x, int par) {
	a[x] = v.back();
	v.pop_back();
	for(auto i : g[x]) {
		if(i - par) {
			dfs(i, x);
		}
	}
}

int main(int argc, char const *argv[])
{
	int n;
	scanf("%d", &n);
	for(int i = 1; i < n; i++) {
		int p, q;
		scanf("%d %d", &p, &q);
		g[p].push_back(q);
		g[q].push_back(p);
	}
	for(int i = 1; i <= n; i++) {
		int x;
		scanf("%d", &x);
		v.push_back(x);
	}
	sort(v.begin(), v.end());
	long long ans = 0;
	for(int i = 0; i < n-1; i++) {
		ans += v[i];
	}
	dfs(1, 0);
	
	printf("%lld\n", ans);
	for(int i = 1; i <= n; i++) {
		printf("%d ", a[i]);
	}
	printf("\n");
	return 0;
}

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

#define LL long long
#define LD long double
#define SC(t,x) static_cast<t>(x)
#define AR(t) vector < t >
#define PII pair < int, int >
#define PLL pair < LL, LL >
#define PIL pair < int, LL >
#define PLI pair < LL, int >
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define PRF first
#define PRS second
#define INIT(ar,val) memset ( ar, val, sizeof ( ar ) )
#define lp(loop,start,end) for ( int loop = start; loop < end; ++loop )
#define lpd(loop,start,end) for ( int loop = start; loop > end; --loop )
#define lpi(loop,start,end) for ( int loop = start; loop <= end; ++loop )
#define lpdi(loop,start,end) for ( int loop = start; loop >= end; --loop )
#define qmax(a,b) (((a)>(b))?(a):(b))
#define qmin(a,b) (((a)<(b))?(a):(b))
#define qabs(a) (((a)>=0)?(a):(-(a)))

const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 19;

int l;
int a[MAXN];
LL n;

void init ();
void input ();
void work ();



int main ()
{
	init ();
	input ();
	work ();
}



void init ()
{
	// Init Everything Here

	ios::sync_with_stdio ( false );
}

void input ()
{
	// input method

	cin >> n;
}

void work ()
{
	// main work

	l = 0;
	int ans = 0;
	for ( LL t = n; t; t /= 10, ++l ) a[l] = t % 10, ans += t % 10;

	lpdi ( i, l - 1, 0 ) {
		if ( a[i] ) ans = qmax ( ans, a[i] - 1 + i * 9 );
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
import sys

import bisect


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    A = []
    B = []
    for i in range(N):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)
    pass
    A.sort()
    B.sort()
    if N % 2 == 0:
        n = N // 2
        mini = (A[n]+A[n-1]) /2
        maxi = (B[n]+B[n-1]) /2
        print(int((maxi-mini)*2)+1)
    else:
        n = N//2
        mini = A[n]
        maxi = B[n]
        print(maxi-mini+1)



if __name__ == "__main__":
    main()


Measured memory_bytes: 25480
#pragma GCC optimize("O3")   //
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef unsigned long long ull;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,k,q,T;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

const int MAXN = 1000001;

vector<vi> C(MAXN,vi());
vl H;

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

    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);

    ll a,b,c,d,e;

    cin >> n >> m;
    rep(c1,0,n){
        cin >> a;
        H.push_back(a);
    }
    rep(c1,0,m){
        cin >> a >> b;
        a--;b--;
        C[a].push_back(b);
        C[b].push_back(a);
    }

    ll ans = 0;
    rep(c1,0,n){
        bool yes = 1;
        trav(y,C[c1]){
            if(H[y] >= H[c1])yes = 0;
        }
        ans += yes;
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 30364
/*
	Author: Luis Manuel Díaz Barón (LUISMO)
	Problem:
	Online Judge:
	Link:
	Idea:
*/
#include<bits/stdc++.h>
// Types
#define ll long long
#define ull unsigned long long
// IO
#define sf scanf
#define pf printf
#define mkp make_pair
#define fi first
#define se second
#define endl "\n"

using namespace std;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll inf = 1e16 + 3;
const int mod = 1e9 + 7;
const int lim = 2e5 + 2;

string str;
string cc;

int Ti, Fi;


void addEnd(string c, bool reversed)
{
	if(!reversed)
		str += c;
	else str = (c + str);
}

void addBeg(string c, bool reversed)
{
	if(reversed)
		str += c;
	else str = (c + str);
}

void solve()
{
	bool rev = false;
	cin >> str;

	// cout << str << endl; return;
	int Q;
	cin >> Q;

	queue<string> toEnd;
	stack<string> toBeg; 
	while(Q --)
	{
		int Ti; cin >> Ti;
		if(Ti == 1)
			rev = !rev;
		else
		{
			cin >> Fi >> cc;

			if( (!rev && Fi == 1) || (rev && Fi == 2))
				toBeg.push(cc);
			else toEnd.push(cc);
		}		
		// cout << str << endl; return;
	}
	// cout << rev << endl;
	string eee = "";
	while(toEnd.size() > 0)
	{
		string aux = toEnd.front();
		toEnd.pop();
		eee += aux;
	}

	string bbb = "";
	while(toBeg.size() > 0)
	{
		string aux = toBeg.top();
		toBeg.pop();
		bbb += aux;
	}

	str = bbb + str + eee;
	
	for(int i = 0; i < str.size(); i++)
	{
		if(rev)
			cout << str[str.size() - 1 - i];
		else cout << str[i];
	}
}

void fastIO()
{
	cin.sync_with_stdio(false);
	cin.tie(0);
}

void IO()
{
	if(fopen("d:\\lmo.in","r") != NULL)
	{
		freopen("d:\\lmo.in","r",stdin);
	}
	else if(fopen("/media/Beijing/lmo.in","r") != NULL)
	{
		freopen("/media/Beijing/lmo.in", "r", stdin);
	}
}

int main()
{
	IO();

	fastIO();

	solve();
}


Measured memory_bytes: 11628
//Catchharsh
    #include<bits/stdc++.h>
    #define ll long long int 
    #define ld long double
    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define F first
    #define S second
    #define pb push_back
    #define endl '\n'
    const ll MOD = 1e9+7;
    const ll INF = 1011111111;
    const ll LLINF = 1000111000111000111LL;
    const ld EPS = 1e-10;
    const ld PI = 3.14159265358979323;
    using namespace std;
    ll power (int x,int n)
    {
        if(n==0)
        return 1;
        else if(n%2==0)
        return power((x*x),n/2);
        else
        return x*power((x*x),(n-1)/2); 
    }
    vector<ll> seve;
    void  seveprime()
    {
      int prime[1000000]={0};
      for(int i=2;i*i<1000000;i++)
       {
        if(prime[i]==0)
         {
          for(int j=i*2;j<=1000000;j+=i)
           prime[j]=1;
         }
       }
       for(int i=2;i<=1000000;i++)
       {
         if(prime[i]==0)
           seve.pb(i);
       }
    }
    int main()
    {   
         IOS;
         ll n,m,i,j,k;
         cin>>n>>m;
         vector<ll> v(n);
         for(i=0;i<n;i++)
          cin>>v[i];
        vector<ll> ans(n+1);
        ans[0]=0;
        for(i=1;i<n;i++)
          {ans[i]=v[i-1]+ans[i-1];}
        ans[n]=ans[n-1]+v[n-1];
        ll an=0;
       for(i=0;i<n+1;i++)
       {
        // cout<<ans[i]<<" ";
         if(ans[i]<=m)
          an++;
       }
       cout<<an;

    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MAX 100
#define INFTY (1<<21)
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n, M[MAX][MAX];

void dijkstra() {
  int minv;
  int d[MAX], color[MAX];

  for ( int i = 0; i < n; i ++) {
    d[i] = INFTY;
    color[i] = WHITE;
  }

  d[0] = 0;
  color[0] = GRAY;
  while ( 1 ) {
    minv = INFTY;
    int u = -1;
    for ( int i = 0; i < n; i++) {
      if (minv > d[i] && color[i] != BLACK) {
        u = i;
        minv = d[i];
      }
    }
    if ( u == -1 ) break;
    color[u] = BLACK;
    for (int v = 0; v < n; v++) {
      if (color[v] != BLACK && M[u][v] != INFTY) {
        if (d[v]> d[u] + M[u][v]) {
          d[v] = d[u] + M[u][v];
          color[v] = GRAY;
        }
      }
    }
  }
  for (int i =0; i< n; i++) {
    cout << i << " " << ( d[i] == INFTY ? -1 : d[i]) << endl;
  }
}

int main(){
	cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      M[i][j] = INFTY;
    }
  }
  int k, c, u, v;
  for (int i = 0; i < n; i++) {
    cin >> u >> k;
    for (int j = 0; j<k;j++) {
      cin >> v >> c;
      M[u][v] = c;
    }
  }
  dijkstra();

  return 0;
}



Measured memory_bytes: 3132
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

def main():
    n,k = map(int,input().split())
    p = list(map(int,input().split()))
    p.sort()
    ans = 0
    for i in range(k):
        ans += p[i]
    print(ans)
 
if __name__ == "__main__":
    main()

Measured memory_bytes: 9492
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long ll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }

int main() {

	ll a, b;
	cin >> a >> b;
	cout << lcm(a, b) << "\n";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int N,K; cin>>K>>N;
  int A[N];
  for (int i=0;i<N;i++) cin>>A[i];
  int M = A[N-1]-A[0];
  for (int i=1; i<N; i++) {
    M = min(M, K-A[i]+A[i-1]);
  }
  cout<<M<<endl;
  return 0;
}

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

using namespace std;

#define el				'\n'
#define sz(v)			((int)((v).size()))
#define all(v)          ((v).begin()),((v).end())
#define clr(v, d)		memset(v, d, sizeof(v))

double const EPS = 1e-8, PI = acos(-1);
const int N = 1e5 + 9, M = 2000 + 9, OO = (int) 1e9 + 1;
const long long MOD = 1e9 + 7;

typedef long long ll;

void OUTPUT() {
	cout << fixed << setprecision(12);
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}

void INPUT() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	cout << fixed << setprecision(0);
//	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}

int n, cnt, arr[N], ans = 0;

int main() {
	OUTPUT();
//	INPUT();
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> arr[i];
	}
	for (int i = n - 2; i >= 0; i--) {
		if (arr[i] >= arr[i + 1])
			cnt++;
		else
			cnt = 0;
		ans = max(ans, cnt);
	}
	cout << ans;

	return 0;

}


Measured memory_bytes: 640
#include<stdio.h>
int main(void)
{
	int N,a,b;
	scanf("%d",&N);
	a=N/100;
	b=N%100%10;
	if(a==b){
		printf("Yes\n");
		}
	else{
		printf("No\n");
		}
	return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <vector>

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

    if (s.length() == 2) {
        std::cout << s << std::endl;
    } else {
        std::reverse(s.begin(), s.end());
        std::cout << s << std::endl;
    }
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int n, m, currMax = 0, count = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> m;
        if (m >= currMax)
        {
            count++;
            currMax = m;
        }
    }
    cout << count;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
const int maxn = 1e3 + 5;
using namespace std;

char a[maxn],b[maxn],c[maxn];
int cnta,cntb,cntc;

int main(){
	scanf("%s", a);
	scanf(" %s", b);
	scanf(" %s", c);
	char now = a[cnta];
	cnta++;
	while(1){
		if(now == 'a'){
			if(a[cnta] == '\0'){ printf("A\n");break;}
			now = a[cnta];
			cnta++;
		}
		else if(now == 'b'){
			if(b[cntb] == '\0'){printf("B\n");break;}
			now = b[cntb];
			cntb++;
		}
		else if(now == 'c'){
			if(c[cntc] == '\0'){printf("C\n");break;}
			now = c[cntc];
			cntc++;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n; cin >> n;
    vector<long long> as(n);
    vector<long long> ans(n);
    long long sum=0;
    for(int i=0; i<n; ++i){
        cin >> as[i];
        sum+=as[i];
    }
    long long left=0, right=sum;
    while(left<=right){
        long long mid=(left+right)/2; 
        ans[0]=mid;
        for(int i=1; i<n; ++i){
            ans[i]=as[i-1]-ans[i-1];
        }
        if(ans[0]==as[n-1]-ans[n-1]) break;
        if(ans[0]<as[n-1]-ans[n-1]) left=mid+1;
        else right=mid-1;
    }
    bool first=true;
    for(int i=0; i<n; ++i){
        if(first) first=false;
        else cout << " ";
        cout << ans[i]*2;
    }
    cout << endl;
    return 0;
}



Measured memory_bytes: 2944
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<unsigned ll>
#define mp make_pair
#define F first
#define S second
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const unsigned ll l=1000000007;
const int MAX_=2000;
int T;

void print(string res, int i)
{
  printf("Case #%d: %s\n",T-i,res.c_str());
  // cout << res;
}
void print(ll res, int i)
{
  printf("Case #%d: %lld\n",T-i,res);
  // cout << res;
}

// ll ans(vll &a, int i)
// {
//   if(i == 0)
//     return 1;

//   int cnta=0,cntb=0;

//   for(auto x: a)
//   {
//     if(x & (1<<i) == 0)
//     {
//       cnta++;
//     }
//     else
//       cntb++;
//   }

//   if(cnta == a.size())
//   {
//     return ans(a,i-1);
//   }

//   if(cntb == a.size())
//   {
//     return 1<<i + ans(a,i-1);
//   }

//   ll toret1, toret2;

// }

void solve(int t)
{
  int n;
  int arr[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cin >> n;
  n--;
  cout << arr[n] << endl;
}

int main()
{
  IOS
  int t,testCases;
  testCases=1;
  #ifdef DEBUG
    freopen("input.txt","r",stdin);
    cin >> testCases;
    cout << "Running " << testCases << " testcases" << endl;
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);
  #endif

  while(testCases--)
  {
    t=1;
    // cin >> t; //comment this in case of singular test case
    T = t;
    while(t--)
    {
      // cout << "HERE" << endl;
      solve(t);
    }
  }
  return 0;

}




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

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

    cout << a+a*a+a*a*a << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n-1;i>=0;i--)
#define Pool(i, m, n) for(ll i=n-1;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(x) cout<<x<<endl
#define Gput(a,b) G[a].push_back(b)


int ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}

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

 ll a=s.size();
 ll b=ctoi(s[0]);
bool z=true;
  if(a==1)putout(b);
  else{
 Loop(i,1,a){
if(s[i]!='9')z=false;
 }
    if(z){
 putout((a-1)*9+b);
    }
else putout((a-1)*9+b-1);


  }
}


Measured memory_bytes: 256
#include "stdio.h"
char map[12][12];
int n,h,w;
void begin()
{
    int i,j;
    char c;
    n=0;
    for (i=0;i<=h+1;i++)
    {
        for (j=0;j<=w+1;j++)
        {
            if (i*j == 0 || i==h+1 || j==w+1)
            {
                map[i][j] == '.';
            }
            else
            {
               while (c = getchar())
               {
                  if (c == '\n')
                  {
                    continue;
                  }
                  map[i][j] = c;
                  break;
               }
            }
            if (map[i][j] == '#')
            {
                n++;
            }
        }
    }
}
int main()
{
    int x,y,i,u;
    while (scanf ("%d%d",&h,&w) != EOF)
    {
         begin();
         x = y = i = 1;
         u = n;
         while (u--)
         {
             if (map[x][y+1] == '#')
             {
                 y++;
                 i++;
             }
             else if (map[x+1][y] == '#')
             {
                 x++;
                 i++;
             }
         }
         printf ("%s\n",i==n?"Possible":"Impossible");
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <sstream>
#include <cassert>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <chrono>
#include <ctime>

using namespace std;

#define en '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) int((x).size())

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9 + 7;
const ll INFLL = 1e18;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
const int MAX_SIZE = 5e5;

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

bool IS_ONE_TEST = 1;
ld START_TIME, TIME;

void fast_in_out() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

void solve() {
    int x, y, a, b;
    cin >> x >> y;
    if (y % 2) {
        cout << "No" << en;
        return;
    }
    b = y / 2 - x;
    a = x - b;
    if (a < 0 || b < 0) {
        cout << "No" << en;
        return;
    }
    cout << "Yes" << en;
}

int main() {
    START_TIME = clock();
    fast_in_out();
    int TESTS = 1;
    if (!IS_ONE_TEST) cin >> TESTS;
    while (TESTS--) { solve(); }
#ifdef __APPLE__
    TIME = (clock() - START_TIME) / CLOCKS_PER_SEC;
    cerr << en << TIME * 1000 << " ms." << en;
#endif
    return 0;
}

/*
     ▄▀▀▀▄
▄███▀░◐░░░▌
    ▌░░░░░▐
    ▐░░░░░▐
    ▌░░░░░▐▄▄
    ▌░░░░▄▀▒▒▀▀▀▀▄
   ▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
   ▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
    ▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄
      ▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄
           ▌▌░▌▌
           ▌▌░▌▌
         ▄▄▌▌▄▌▌        */


Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int A = scanner.nextInt();
		int P = scanner.nextInt();
		int x = 0;
		int y = 0;
		x = A * 3 + P;
		y = x / 2;
		System.out.println(y);
	}
}


Measured memory_bytes: 23892
from collections import deque

N, Q = map(int, input().split())
adj = [[] for _ in range(N + 1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    adj[a].append(b)
    adj[b].append(a)

point = [0] * (N + 1)
for _ in range(Q):
    p, x = map(int, input().split())
    point[p] += x

ans = [0] * (N + 1)
queue = deque()
queue.append(1)
visited = [0] * (N + 1)
visited[1] = 1
ans[1] = point[1]
while queue:
    v = queue.pop()
    for u in adj[v]:
        if visited[u] == 0:
            queue.appendleft(u)
            visited[u] = 1
            ans[u] = ans[v] + point[u]

print(' '.join(map(str, ans[1:])))


Measured memory_bytes: 138488
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
#include <iomanip>
#define M_PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1000000007;
const int MAX_V = 201;
int now = 0;

const int MAX = 510000;
const int MOD = 1000000007;

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

// 二項係数計算
long long 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 {
	int t;
	edge(int _t) : t(_t) {}
};
bool use[100010];


vector<edge> te[100010];
vector<edge> fe[100010];
int t[64];
int d[100100];
ll rec(int num) {
	if (num == 0) return 0;
	return rec(num - 1) + num;
}
ll gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
void Solve() {

	int n;
	cin >> n;
	int a, b;
	cin >> a >> b;
	int rem = abs(a - b);
	if((rem - 1) % 2 == 0){
		cout << "Borys" << endl;
	}
	else {
		cout << "Alice" << endl;
	}

}


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



Measured memory_bytes: 6016
#include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
#include <algorithm> 
#include <cstdlib> 
#include <ctime> 
#include <cstdio> 
#include <functional> 
#include <set> 
#include <sstream> 
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
 
using namespace std; 

int gcd(int x,int y){
	return y==0?x:gcd(y,x%y);
}

int main(){

    int n;
    cin>>n;

    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    sort(a.begin(),a.end());
    cout<<a[n-1]-a[0]<<endl;

	return 0;
}


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

int n, a[10000];

int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    while(a[i] % 2 == 0) {
      a[i] /= 2;
      ans++;
    }
  }
  printf("%d\n", ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2000000000;
constexpr ll 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;
}



int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	ll a, b, k; cin >> a >> b >> k;
	if (a <= k) {
		k -= a;
		a = 0;
	}
	else {
		a -= k;
		k = 0;
	}
	cout << a << " " << (b <= k ? 0 : b-k) << "\n";


	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,i,l,r,sum=0;
  cin >> N;
  for(i=0;i<N;i++){
   	cin >> l >> r;
    sum += (r-l)+1;
  }
  cout << sum << endl;
}
  

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	private int prim(int n, int[][] map) {
		int[] d = new int[n];
		int[] p = new int[n];
		boolean[] c = new boolean[n];
		Arrays.fill(d, Integer.MAX_VALUE);
		Arrays.fill(p, -1);
		d[0] = 0;
		while (true) {
			int min = Integer.MAX_VALUE;
			int u = -1;
			for (int i = 0; i < n; i++) {
				if (d[i] < min && c[i] == false) {
					min = d[i];
					u = i;
				}
			}
			if (u == -1) break;
			c[u] = true;
			for (int i = 0; i < n; i++) {
				if (!c[i] && map[u][i] != Integer.MAX_VALUE && map[u][i] < d[i]) {
					d[i] = map[u][i];
					p[i] = u;
				}
			}
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			if (p[i] != -1) {
				sum += map[i][p[i]];
			}
		}
		return sum;
	}

	public void run() throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		int[][] map = new int[n][n];
		for (int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(reader.readLine());
			for (int j = 0; j < n; j++) {
				int v = Integer.parseInt(st.nextToken());
				map[i][j] = v == -1?Integer.MAX_VALUE:v;
			}
		}
		reader.close();
		System.out.println(prim(n, map));
	}

	public static void main(String[] args) throws IOException {
		new Main().run();
	}
}
 


Measured memory_bytes: 27072
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;


const long long int mod=1000000007;
const long long int INF=99999999999999999;

long long int n,q,l,r;
char d[200005],t[200005];
string s;

int main() {
	cout << fixed << setprecision(18);
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s;
		for(int j=0;j<s.length();j++){
			if(s[j]=='0'){continue;}
			long long int memo=(s[j]-'0'),cou=0;
			j++;
			while(s[j]!='0'){
				cou++;
				j++;
			}
			if(memo>=2&&memo<=6){
				cout<<(char)('a'+(memo-2)*3+cou%3);
			}else if(memo==7){
				cout<<(char)('p'+cou%4);
			}else if(memo==8){
				cout<<(char)('t'+cou%3);
			}else if(memo==9){
				cout<<(char)('w'+cou%4);
			}else if(memo==1){
				if(cou%5==0){
					cout<<'.';
				}else if(cou%5==1){
					cout<<',';
				}else if(cou%5==2){
					cout<<'!';
				}else if(cou%5==3){
					cout<<'?';
				}else if(cou%5==4){
					cout<<' ';
				}
				
			}
			
		}
		cout<<endl;
	}
} 


Measured memory_bytes: 3120
#include<stdio.h>
#include<string.h>
typedef struct treetype{
	long l,r,ll,rr,min;
}treetype;
treetype tree[3000005];
long r,c,q,i,j,c1,c2,r1,r2,ans,top,dd;
bool ok;
long a[1000005];
long start[1000005];
long min(long a,long b){
	return a<b?a:b;
}
void maketree(long i,long l,long r)
{
  long mid,lson,rson;
  tree[i].l=l;tree[i].r=r;
  tree[i].min=0;
  if (l==r){
  	  tree[i].min=a[dd];
  	  dd++;
		return;
  }
  mid=(l+r)/2;
  top++;
  tree[i].ll=lson=top;
  maketree(top,l,mid);
  top++;
  tree[i].rr=rson=top;
  maketree(top,mid+1,r);
	tree[i].min=min(tree[lson].min,tree[rson].min);  
}
long count(long i,long a,long b){
	long lson,rson,l,r,mid;
	lson=tree[i].ll;rson=tree[i].rr;l=tree[i].l;r=tree[i].r;
	if (l==a && r==b)
	  return tree[i].min;
  mid=(l+r)/2;
  if (a>mid)
    return count(rson,a,b);
  else if (b<=mid)
    return count(lson,a,b);
  else
    return min(count(lson,a,mid),count(rson,mid+1,b));
}
int main(){
	//freopen("data.in","r",stdin);
	//freopen("data.out","w",stdout);
	while (scanf("%ld %ld %ld",&r,&c,&q)==3){
		if (r==0)
		  return 0;
		memset(tree,0,sizeof(tree));
		memset(start,0,sizeof(start));
		memset(a,0,sizeof(a));
		if (r<=c){
		  for (i=0;i<r;i++)
		    for (j=0;j<c;j++)
		      scanf("%ld",&a[i*c+j]);
		}
		else if (r>c){
			for (i=0;i<r;i++)
			  for (j=0;j<c;j++)
			    scanf("%ld",&a[j*r+i]);
		}
		top=0;ok=false;
		if (r>c){
			int temp=r;r=c;c=temp;
			ok=true;
		}
		dd=0;
		for (i=0;i<r;i++){
			top++;
 	    start[i]=top;
		  maketree(top,0,c-1);
		}
		for (i=0;i<q;i++){
			scanf("%ld %ld %ld %ld",&r1,&c1,&r2,&c2);
			if (ok){
				int temp=r1;
				r1=c1;
				c1=temp;
				temp=r2;
				r2=c2;
				c2=temp;
			}
			ans=2147483647;
			for (j=r1;j<=r2;j++)
		    ans=min(ans,count(start[j],c1,c2));
      printf("%ld\n",ans);
		}
	}
}

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

using namespace std;

int n;
int act[3];
int dp[2][3];

int main()
{
	cin >> n;

	cin >> act[0] >> act[1] >> act[2];
	dp[0][0] = act[0];
	dp[0][1] = act[1];
	dp[0][2] = act[2];

	for (int i = 1; i < n; ++i)
	{
		int curr = i % 2, prev = (i + 1) % 2;
		
		for (int j = 0; j < 3; ++j)
		{
			cin >> act[j];
			dp[curr][j] = 0;
		}

		for (int j = 0; j < 3; ++j)
		{
			for (int k = 0; k < 3; ++k)
			{
				if (j == k)
					continue;
				dp[curr][j] = max(dp[curr][j], dp[prev][k] + act[j]);
			}
		}
	}

	int curr = (n - 1) % 2;
	cout << *max_element(&dp[curr][0], &dp[curr][0] + 3) << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;

const ll mod=1000000007;

ll fpow(ll b,ll e)
{
    ll res=1;
    while(e)
    {
        if(e&1) res=(res*b)%mod;
        b=(b*b)%mod;
        e/=2;
    }
    return res;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    const int N=200000;
    vector<ll> f(N+1,1);
    for(ll i=1;i<=N;i++) f[i]=(f[i-1]*i)%mod;
    vector<ll> finv(N+1,1);
    finv[N]=fpow(f[N],mod-2);
    for(ll i=N-1;i>=0;i--) finv[i]=(finv[i+1]*(i+1))%mod;
    auto c=[&](int a,int b)->ll
    {
        ll res=f[a];
        res=(res*finv[b])%mod;
        res=(res*finv[a-b])%mod;
        return res;
    };
    auto p=[&](array<int,2> a,array<int,2> b)->ll
    {
        return c(b[0]-a[0]+b[1]-a[1],b[0]-a[0]);
    };
    int n,m,k;
    cin >> n >> m >> k;
    vector<array<int,2>> v(k+1);
    for(int i=0;i<k;i++) cin >> v[i][0] >> v[i][1];
    v[k]={n,m};
    sort(v.begin(),v.end());
    vector<ll> res(k+1,0);
    for(int i=0;i<=k;i++) res[i]=p({1,1},v[i]);
    for(int i=0;i<=k;i++)
    {
        for(int j=i+1;j<=k;j++)
        {
            if(v[j][0]<v[i][0]||v[j][1]<v[i][1]) continue;
            res[j]=(res[j]-res[i]*p(v[i],v[j]))%mod;
            if(res[j]<0) res[j]+=mod;
        }
    }
    cout << res[k] << "\n";
    return 0;
}


Measured memory_bytes: 6300
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int main(){
	int a;
	cin >> a;
	if (a == 3 || a == 5 || a == 7){
		cout << "YES" << endl;
	}
	else{
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		// Scanner sc = new Scanner(new File("test_1.txt"));
		// Scanner sc = new Scanner(new File("test_2.txt"));
		// Scanner sc = new Scanner(new File("in4.txt"));
		int N = sc.nextInt();
		int ans = 0;		
		while (sc.hasNextInt()) {
			int n = Integer.parseInt(sc.next());
			boolean is_prime = true;
			for (int i = 2; i * i <= n; i++)
				if (n % i == 0)
					is_prime = false;
			if (is_prime)
				ans++;
		}

		System.out.println(ans);		
	}
}

Measured memory_bytes: 39824
N, A, B = map(int, input().split())
#結局、上限はA+B*(N-1)、下限はA*(N-1)+B
if N == 1:
  if A == B:
    print(1)
  else:
    print(0)
elif A > B:
  print(0)
else:
  print(A+B*(N-1) - (A*(N-1)+B) + 1)

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

template <typename T> void output(T, int);
int gcd(int a, int b);
void prime_map(map<ll, ll> &, ll);

int main() {
    // source
    int a,b;
    cin>>a>>b;
    if(a+b<10){
        cout<<a+b<<endl;
    }else{
        cout<<"error"<<endl;
    }
    return 0;
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

template <typename T> T min(T a, T b) {

    if (a < b) {
        return a;
    } else {
        return b;
    }
}

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

void prime_map(map<ll, ll> &m, ll num) {
    ll cache = num;
    repd(i, 2, sqrt(num) + 2) {
        if (num % i == 0) {
            if (m[i] == 0) {
                m[i] = 1;
            } else {
                m[i]++;
            }

            num /= i;
            break;
        }
    }

    if (cache == num) {
        if (m[num] == 0) {
            m[num] = 1;
        } else {
            m[num]++;
        }
        return;
    } else {
        prime_map(m, num);
    }
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
using R = double;
using Data = pair < ll, vector <ll>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 60;
struct edge { ll from; ll to; ll cost; };
typedef pair<ll, ll>pll;
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)
#define INF INT_MAX/2

int main(){
	int p, q, r;
	cin >> p >> q >> r;

	int sum = p + q + r;
	cout << min(sum - p, min(sum - q, sum - r)) << endl;
	

	
	return 0;
}


Measured memory_bytes: 256
from collections import deque

N = int(input())
A = sorted(list(map(int,input().split())))

ans_list = []
p = deque()
n = deque()

# 最大にプラス、最小にマイナスを割り当てる
p.append(A[-1])
n.append(A[0])

# 正ならプラスを負ならマイナスを割り当てる
for a in A[1:-1]:
    if a >= 0:
        p.append(a)
    elif a < 0:
        n.append(a)

# プラスが１つになるまで消す
while len(p) != 1:
    x = n.pop()
    y = p.pop()
    n.append(x-y)
    ans_list.append((x, y))

# マイナスがなくなるまで消す
while len(n) != 0:
    x = p.pop()
    y = n.pop()
    p.append(x-y)
    ans_list.append((x,y))

# 残ったものが最大値
M = p[0]
print(M)
for x, y in ans_list:
    print(x, y)

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

int main() {
  string s;cin>>s;
  while(1){
    s.pop_back();
    int n=s.size();
   if(s.substr(0,n/2)==s.substr(n/2)){
     cout<<n<<endl;
     return 0;
   }
  }
}

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

using namespace std;

typedef long long LL;

#define REP(i,n) for (int i = 0; i < (n); ++i)
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define ROF(i,b,a) for (int i = (b); i >= (a); --i)

int main() {
	int n, m;
	cin >> n >> m;
	cout << (n == m ? "Yes" : "No")	<< '\n';
	return 0;
}


Measured memory_bytes: 256
using System;

class Solution
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var n = int.Parse(input[0]);
        var x = int.Parse(input[1]);
        var t = int.Parse(input[2]);

        var result = n / x;
        if (n % x != 0)
        {
            result++;
        }
        result *= t;
        Console.WriteLine(result);
    }
}

Measured memory_bytes: 27152
//bismillahir rahmanir rahim            //Author:Fayed Anik
 
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
//using namespace __gnu_pbds;
 
//#define         ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         mod                         1000000007
#define         INF                         2e18
#define         EPS                         1e-15
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)
 
//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;


set<ll>st;

bool p[1000005];

void sieve(){
    p[2] = 0;
    for(ll i=4;i<=1e6;i+=2) p[i]=1;
    for(ll i=3;i<=1e6;i+=2){
        if( !p[i] ){
            for(ll j=i*i;j<=1e6;j+=2*i){
                p[j] = 1;
            }
        }
    }
}

ll fastexpo(ll b,ll p){
    ll res=1;
    while(p){
        if( p&1 ) res = res*b;
        b = b*b;
        p = p>>1;
    }
    return res;
}
int main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    sieve();
    ll n;
    sfl(n);
    if(n==1){
        printf("0\n");
        return 0;
    }
    else{
        ll num = n;
        for(ll i=2;i*i<=num;i++){
            if( n%i == 0 and !p[i] ){
                ll x=i;
                while(n%i==0 and n>1){
                    st.insert(x);
                    n/=i;
                    x = x*i;
                }
            }
        }
        if( n>1 ){
            st.insert(n);
        }
        ll ans=0;
        for(auto it:st){
            if(num%it==0){
                num /= it;
                ans++;
            }
        }
        pfl(ans);
    }
    return 0;
}

Measured memory_bytes: 4820
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+8
#define EPS 1e-8
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = (j); i < (k); i++)
typedef long long ll;
typedef pair < int , int > Pii;
int main(){
	rep(i,3){
		int a,b,c,d,e,f;
		cin >> a >> b >> c >> d >> e >> f;
		int S = 3600*a+60*b+c;
		int E = 3600*d+60*e+f;
		int t = E-S;
		cout << t/3600 << " " << (t-3600*(t/3600))/60 << " " <<(t-3600*(t/3600))%60 << endl;
	}
    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif

#define REP(i,n) for(ll (i) = (0); (i) < (n); ++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) v.begin(),v.end()
#define INF 1100000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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


bool pf[210];

int main()
{
  int N; cin >> N;
  int ans = 0;
  for (int i = 1; i <= N; i+=2) {
    int cnt = 0;
    for (int j = 1; j <= i; j++) {
      if (i % j == 0) {
        cnt++;
      }
    }
    if (cnt == 8) ans++;
  }
  cout << ans << endl;

	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<long long,long long> pi;
vector<long long>tree[100005];
vector<pi>edge;
map<pi,int>m;
bool visited[100005];
void dfs(int curr,int used){
	visited[curr] = true;
	int counter = 1;
	for(int i=0; i<tree[curr].size(); i++){
		if(counter==used) counter++;
		long long next = tree[curr][i];
		if(!visited[next]){
			m.insert(make_pair(pi(curr,next),counter));
			m.insert(make_pair(pi(next,curr),counter));
			dfs(next,counter);
			counter++;
		}
	}
}
int main(){
	int n;
	cin>>n;
	for(int i=0; i<n-1; i++){
		long long a,b;
		cin>>a>>b;
		tree[a].push_back(b);
		tree[b].push_back(a);
		edge.push_back(pi(a,b));
	}	
	int maxcolor = 0;
	for(int i=1; i<=n; i++) maxcolor = max(maxcolor,(int)tree[i].size());
	dfs(1,0);
	cout<<maxcolor<<'\n';
	for(int i=0; i<edge.size(); i++){
		cout<<m.find(edge[i])->second<<'\n';
	}
}

Measured memory_bytes: 23164
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int data[26][26];
bool visited[26];
bool exist[26];
 
void rec(int now) {
  visited[now] = true;
  for(int i = 0; i < 26; i++) {
    if(exist[i] && !visited[i] && data[now][i] != 0) {
      rec(i);
    }
  }
}
 
int main(void) {
  int n;
  while(cin >> n , n) {

    fill(data[0], data[0] + 26*26, 0);
    fill(exist, exist+26, false);

    for(int i = 0; i < n; i++) {
      string str;
      cin >> str;
      data[str[0]-'a'][str[str.length()-1]-'a']++;;
      exist[str[0]-'a'] = exist[str[str.length()-1]-'a'] = true;
    }
 
    int num[26];
    fill(num, num + 26, 0);
 
    for(int i = 0; i < 26; i++) {
      for(int j = 0; j < 26; j++) {
    if(data[i][j] >= 0) {
      num[i] += data[i][j];
      num[j] -= data[i][j];
    }
      }
    }
 
    bool flag = true;
    for(int i = 0; i < 26; i++) {
      if(num[i] != 0) {
    flag = false;
    break;
      }
    }
 
    if(flag == true) {
      fill(visited, visited + 26, false);
      int cnt = 0;
      for(int i = 0; i < 26; i++) {
    if(exist[i] && !visited[i]) {
      rec(i);
      cnt++;
    }
      }
      if(cnt != 1) flag = false;
    }
 
    if(flag) cout << "OK" << endl;
    else     cout << "NG" << endl;
  }
  return 0;
}

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

const long INF=1000000000;

int main(){
	int n;
	long a[100][100];
	
	scanf(" %d", &n);
	for(int i=0; i<n; ++i){
		for(int j=0; j<n; ++j){
			long p;
			scanf(" %ld", &p);
			if(p==-1) a[i][j]=INF;
			else a[i][j]=p;
		}
	}
	
	//prim
	
	int visit[100]={0}; //????¨??????§?????????
	
	int p[100]; //MST???????????????
	p[0]=-1;
	
	int d[100];
	for(int i=0; i<n; ++i) d[i]=INF;
	d[0]=0; //????????????0???????????????????????????
	
	int u;
	while(1){
		long mincost=INF;
		
		for(int i=0; i<n; ++i){
			if(visit[i]!=-1 && d[i]<mincost){
				mincost=d[i];
				u=i;	
			}
		}
		
		if(mincost==INF) break; //????????\?????????????????????
		
		visit[u]=-1; //?¨??????????
		
		for(int i=0; i<n; ++i){
			if(visit[i]!=-1 && a[u][i]<d[i]){
				d[i]=a[u][i];
				p[i]=u;
				visit[i]=1; //?¬??¨???????????\´???????£?
			}
		}
		
	}
	
	long ans=0;
	for(int i=0; i<n; ++i){
		if(p[i]!=-1) ans+=a[i][p[i]];
		
	}
	printf("%ld\n", ans);
}

Measured memory_bytes: 1268
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 50 + 5;
int a[maxn] , b[maxn] , c[maxn] , d[maxn];
int n , m ,Q;
int ans = 0;
int res[maxn];
void dfs(int step , int last)
{
    if (step == n + 1){
        int cost = 0;
        for (int i = 1 ; i <= Q ; i++){
            if (res[b[i]] - res[a[i]] == c[i]) cost += d[i];
        }
        ans = max(ans , cost);
        return ;
    }
    for (int i = last; i <= m ; i ++){
        res[step] = i;
        dfs(step + 1 , i);
        res[step] = 0;
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin >> n >> m >> Q;
    for (int i = 1 ; i <= Q ; i++){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
    }
    dfs(1 , 1);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std ;
int main()
{
    int n,i,cnt=1;
    string s;
    cin>>n>>s;
    char temp=s[0];
    for(int i=1;i<n;i++)
    {
        if(temp!=s[i])
        {
            temp=s[i];
            cnt++;
        }
    }
    cout<<cnt;
    return 0;


}


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9

using namespace std;
typedef long long int lli;
typedef long long ll;

int main() {
    int x,t;
    cin >> x >> t;

    int ans;
    if(x < t) ans = 0;
    else ans = x-t;

    cout << ans << endl;
}


Measured memory_bytes: 256