akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<math.h>

using namespace std;


// this class works only if mod is prime number and mod is so big number .
class mll
{
  public:
    mll(int _data=0,int mod = 1000000007):data(_data),MOD(mod){
    };
    ~mll(){};
    long long data;
    long long MOD ;
    //  overload
    mll  operator + (mll obj){
      return (this->data+obj.data)%this->MOD;
    }
    mll  operator - (mll obj){
      return (this->data-obj.data)%this->MOD;
    }
    mll  operator * (mll obj){
      return (this->data*obj.data)%this->MOD;
    }
    mll  operator / (mll obj){
      long long div_buf[65]={1,obj.data%this->MOD};
      for(int i=2;i<=64;i++){
        div_buf[i]=(div_buf[i-1]*div_buf[i-1])%this->MOD;
      }
      mll bmod2(1);
      //calc b^(MOD-2)
      for(int i = 0;i<64;i++){
        if(((this->MOD-2)>>i)%2){
          bmod2 = bmod2*div_buf[i+1];
        }
      }
      return bmod2*(*this);

    }
    //  overload for long long
    mll  operator + (long long  obj){
      return (this->data+obj)%this->MOD;
    }
    mll  operator - (long long  obj){
      return (this->data-obj)%this->MOD;
    }
    mll  operator * (long long  obj){
      return (this->data*obj)%this->MOD;
    }
    mll  operator / (long long  obj){
      long long div_buf[65]={1,obj%this->MOD};
      for(int i=2;i<=64;i++){
        div_buf[i]=(div_buf[i-1]*div_buf[i-1])%this->MOD;
      }
      mll bmod2(1);
      //calc b^(MOD-2)
      for(int i = 0;i<64;i++){
        if(((this->MOD-2)>>i)%2){
          bmod2 = bmod2*div_buf[i+1];
        }
      }
      return bmod2*(*this);
    }

    // for iostream

    friend istream& operator >> (istream &in,mll &dt);
    friend ostream& operator << (ostream &out,mll &dt);
  private:
};

istream& operator >> (istream &in,mll &dt){
  in >> dt.data;
  return in;
}
ostream& operator << (ostream &out,mll &dt){
  out << dt.data;
  return out;
}

mll combMOD(mll n,mll r)
{
  mll ans(1);
  for(long long i=0;i<r.data;i++){
    mll buf(1+i);
    ans = ans*(n-i);
    ans = ans/buf;
  }
  return ans;
}
int main(){
  mll h,w,a,b;
  cin >> h >> w >> a >>b;
  mll sh = h-a-1;
  mll sw = b-1;
  mll scmb,lcmb;
  scmb = combMOD(sh+sw,sh);
  lcmb = combMOD(a-1+w-b,a-1);
  mll ans(0);
  for(int i=1;i<=(w-b).data;i++){
    scmb = scmb*(sh+sw+i);
    scmb = scmb/(sw+i);
    lcmb = lcmb*(w-b-i+1);
    lcmb = lcmb/(w-b+a-1-i+1);
    ans = ans+ scmb*lcmb;
  }
  cout <<ans << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	string s;cin>>s;
	char tmp;
	ll ans = 0;
	for(int i = 0; i < s.size(); i++) {
		if (i % 2 == 0){
			tmp = 'g';
		}
		else{
			tmp = 'p';
		}
		if (s[i] == 'p' && tmp == 'g'){
			ans--;
		}
		else if (s[i] == 'g' && tmp == 'p'){
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		final Scanner sc = new Scanner(System.in);
		
		char[] input = sc.next().toCharArray();
		final long K = sc.nextInt();
		
		long count = 0;
		for(int i = 0; i < input.length; i++){
			if(count > K){ break; }
			
			final int a_diff = (26 - (input[i] - 'a')) % 26;
			//System.out.println(input[i] + " " + a_diff);
			if(count + a_diff <= K){
				input[i] = 'a';
				count += a_diff;
			}
		}
		
		count += (K - count) / 26 * 26;
		input[input.length - 1] = (char)(input[input.length - 1] + (K - count));
		
		System.out.println(String.valueOf(input));
		
	}
 
	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;
 
		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}	
 
		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}
 
		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}
 
		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 11604
#include <iostream>
#include <complex>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

typedef complex<double> Point, Vector;
typedef pair<Point, Point> Segment, Line;
typedef vector<Point> Polygon;
typedef pair<Point, double> Circle;

#define X real()
#define Y imag()
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

namespace std{
    bool operator<(const Point &a, const Point &b){
        return !equals(a.X, b.X) ? a.X < b.X : a.Y < b.Y;
    }
}

double norm(Vector a){
    return a.X * a.X + a.Y * a.Y;
}

double abs(Vector a){
    return sqrt(norm(a));
}

double arg(Vector p){
    return atan2(p.Y, p.X);
}

Vector polar(double a, double r){
    return Point(cos(r) * a, sin(r) * a);
}

pair<Point, Point> getCrossPoints(Circle c1, Circle c2){
    double d = abs(c1.first - c2.first);
    double a = acos((c1.second * c1.second + d * d - c2.second * c2.second) / (2 * c1.second * d));
    double t = arg(c2.first - c1.first);
    return make_pair(c1.first + polar(c1.second, t + a), c1.first + polar(c1.second, t - a));
}

int main(){
    double c1x, c1y, c1r; cin>>c1x>>c1y>>c1r;
    double c2x, c2y, c2r; cin>>c2x>>c2y>>c2r;

    Circle c1 = {Point(c1x, c1y), c1r};
    Circle c2 = {Point(c2x, c2y), c2r};

    pair<Point, Point> ansp = getCrossPoints(c1, c2);
    Point p1 = min(ansp.first, ansp.second);
    Point p2 = max(ansp.first, ansp.second);

    printf("%.10f %.10f %.10f %.10f\n", p1.X, p1.Y, p2.X, p2.Y);
}


Measured memory_bytes: 3692
/*
** 邻接表和邻接矩阵来保存图
*/

# include <cstdio>
# include <cstring>

const int MAX = 100 + 2;

int m[MAX][MAX];

int n;

void solve() {
    scanf("%d", &n);
    memset(m, 0, sizeof(m));
    int u, k, v;
    for (int i = 0; i < n; i++) {
        scanf("%d%d", &u, &k);
        while (k-- > 0) {
            scanf("%d", &v);
            m[u-1][v-1] = 1;
        }
    }
        

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (j) {
                printf(" ");
            }
            printf("%d", m[i][j]);
        }
        printf("\n");
    }
}

int main() {
    // freopen("infile", "r", stdin);
    // freopen("outfile", "w", stdout);
    solve();
    return 0;
}


Measured memory_bytes: 2792
#include<iostream>

using namespace std;
int main(){
  int n;
  std::cin >> n;
  int *d=new int[n];

  for (int i = 0; i < n; i++) {
    std::cin >> d[i];
  }

  long long sum=0;
  for (int i = 0; i < n; i++) {
    for (int i2 = 0; i2 < n; i2++) {
      if(i!=i2)sum+=d[i]*d[i2];
    }
  }
  std::cout << sum/2 << '\n';
  delete []d;

return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include<vector>
#include<climits>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<functional>
#include <numeric>
#include <map>
#define FORi(N) for(int i=0;i<N;++i)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ll gcd(ll m,ll n){
  if(n==0)return abs(m);
  return(gcd(n,m%n));
}
void putYN(bool b){
  if(b){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}
int main(){
  ull A,B;
  cin>>A>>B;
  bitset<100> b(1);
  if(A%2==1)b=b^bitset<100>(A),A++;
  if(B%2==0)b=b^bitset<100>(B),B--;
  if((B-A)/2%2==1)b=b^bitset<100>(1);
  cout<<b.to_ullong()<<endl;
  return 0;
}

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

using namespace std;

typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<uint, uint> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<uint> vu;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pii> vpii;
typedef vector<puu> vpuu;
typedef vector<pll> vpll;
typedef vector<pull> vpull;
typedef vector<string> vstr;
typedef vector<double> vdbl;
typedef vector<ldbl> vldbl;
#define pb push_back
#define ppb pop_back
#define pfr push_front
#define ppfr pop_front
#define emp emplace
#define empb emplace_back
#define be begin
#define rbe rbegin
#define all(x) (x).be(), (x).end()
#define rall(x) (x).rbe(), (x).rend()
#define fir first
#define sec second
#define mkp make_pair
#define brif(cond) if (cond) break
#define ctif(cond) if (cond) continue
#define retif(cond) if (cond) return
void canhazfast() {ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);}
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a%b) : a;}
template<typename T> T extgcd(T a, T b, T &x, T &y)
{
    T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
    while (b) {
        T q = a/b; a %= b; swap(a, b);
        x0 -= q*x1; swap(x0, x1);
        y0 -= q*y1; swap(y0, y1);
    }
    x = x0; y = y0; return a;
}
int ctz(uint x) {return __builtin_ctz(x);}
int ctzll(ull x) {return __builtin_ctzll(x);}
int clz(uint x) {return __builtin_clz(x);}
int clzll(ull x) {return __builtin_clzll(x);}
int popcnt(uint x) {return __builtin_popcount(x);}
int popcntll(ull x) {return __builtin_popcountll(x);}
int bsr(uint x) {return 31^clz(x);}
int bsrll(ull x) {return 63^clzll(x);}

#define N 200016

int a[N];

int main()
{
    canhazfast();

    int n, k;

    cin >> n >> k;
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = k; i < n; ++i) cout << (a[i] > a[i-k] ? "Yes\n" : "No\n");

    return 0;
}


Measured memory_bytes: 4428
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int arr[MAX],mx[MAX];
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    ll n,MX=0,t;
    cin>>n>>t;
    for(int i=0; i<n; i++)
        cin>>arr[i];
    mx[n-1]=arr[n-1];
    for(int i=n-2; i>=0; i--)
        mx[i]=max(mx[i+1],arr[i]);
    map<ll,int>mp;
    for(int i=0; i<n-1; i++)
    {
        if(arr[i]>=mx[i+1])
            continue;
        ll prof=mx[i+1]-arr[i];
        prof*=(t/2);
        mp[prof]++;
        MX=max(MX,prof);
    }
    ll ans=mp[MX];
    cout<<max(ans,1ll)<<endl;
    return 0;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, a, n) for (int i = a; i < (n); i++)
#define all(in) in.begin(), in.end()
const int INF = 1e9;
const int MOD = 1e9 + 7;
int main() {
    int N, start = 0, count = 0;
    cin >> N;
    int h[N];
    rep(i, N) cin >> h[i];
    bool goal = true;
    while (true) {
        for (int i = start; i < N; i++) {
            if (h[i] > 0) {
                start = i;
                break;
            }
            if (i == N - 1) goal = false;
        }
        if (!goal) break;
        for (int i = start; i < N; i++) {
            if (h[i] - 1 >= 0) {
                h[i]--;
            } else {
                break;
            }
        }
        count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <atcoder/all>
#define ll long long int
#define rep(i,n) for(ll i=0;i<n;i++)
#define vec vector<ll>
#define mat vector<vector<ll>>

using namespace std;
//using namespace atcoder;

const ll mod=1000000007;//998244353;
const ll inf=LONG_LONG_MAX;
ll dx4[4]={1,0,-1,0};
ll dy4[4]={0,-1,0,1};
ll dx8[8]={1,0,-1,1,-1,1,0,-1};
ll dy8[8]={1,1,1,0,0,-1,-1,-1};

int main(){

  string s;
  cin >> s;

  ll a=s[0]-'0',b=s[1]-'0',c=s[2]-'0',d=s[3]-'0';

  for(ll i=-1;i<2;i+=2){
    for(ll j=-1;j<2;j+=2){
      for(ll k=-1;k<2;k+=2){
        if(a+b*i+c*j+d*k==7){
          string t;
          t=to_string(a);
          char e;
          if(i<0)e='-';
          else e='+';
          t+=e;
          t+=to_string(b);
          if(j<0)e='-';
          else e='+';
          t+=e;
          t+=to_string(c);
          if(k<0)e='-';
          else e='+';
          t+=e;
          t+=to_string(d);
          t+="=7";
          cout << t << endl;          
          return 0;
        }
      }
    }
  }

  return 0;
}

Measured memory_bytes: 3672
main(a,b,n,i,j){
  for(;scanf("%d%d",&a,&b),a;printf("%d\n",z[a][b])){
    memset(z,0,sizeof(z));
    for(scanf("%d",&n);n;n--)
      scanf("%d%d",&i,&j),z[i][j]=-1;
    z[1][1]=1;
    for(i=1;i<=a;i++)
      for(j=1;j<=b;j++)
        if((i|j)-1&&~z[i][j])
          z[i][j]=(~z[i-1][j]?z[i-1][j]:0)+(~z[i][j-1]?z[i][j-1]:0);
  }
  return 0;
}

Measured memory_bytes: 0
/*
Looking from a window above
It's like a story of love
Can you hear me?
Came back only yesterday
I'm moving further away
Want you near me
All I needed was the love you gave
All I needed for another day
And all I ever knew
Only you
Sometimes when I think of her name
When it's only a game
And I need you
Listen to the words that you say
It's getting harder to stay
When I see you
All I needed was the love you gave
All I needed for another day
And all I ever knew
Only you, only you
Uh uh uh only you, only you
Only you, only you, only you
This is going to take a long time
And I wonder what's mine
Can't take no more
Wonder if you'll understand
It's just the touch of your hand
Behind a closed door
And all I needed was the love you gave
All I needed for another day
And all I ever knew
Only you, only you, only you
All I needed was the love you gave
All I needed for another day
And all I ever knew
Only you, only you, only you
Only you
*/

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define ld long double
#define endl '\n'
#define rep(x,s,e) for(int x=s;x<=(e);x++)
#define repn for(int x=0;x<n;x++)
#define rep1n for(int x=1;x<=n;x++)
#define rep1m for(int y=1;y<=m;y++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define precise(x) cout << fixed << setprecision(x)
#define bits(x) __builtin_popcountll(x)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) ((int)(x.size()))
#define test int t; cin>>t; while(t--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)

typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef pair<int,int> pii;


void __print(int x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}


template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define see(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define see(x...)
#endif

const int inf = 3e18;
const int N = 5e5 + 100;




int32_t main(){ 
   FAST;
   int x, t;
   cin >> x >> t;
   x = max(x-t,0LL);
   cout << x << '\n';
}

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

const int MAX_N = 100;
vector<ll> h(MAX_N);

int rec(int hh, int l, int r) {
  int res = 0;
  int nl = l, nr;
  bool flag = (h[l] >= hh + 1);
  for (int i = l; i < r; i++) {
    // cerr << "log: " << flag << " " << i << endl;
    if (flag && h[i] < hh + 1) {
      nr = i;
      flag = !flag;
      // cerr << hh + 1 << " " << nl << " " << nr << endl;
      res += 1 + rec(hh + 1, nl, nr);
    } else if (!flag && h[i] >= hh + 1) {
      nl = i;
      flag = !flag;
    }
  }
  if (flag) {
    nr = r;
    res += 1 + rec(hh + 1, nl, nr);
  }
  return res;
}

int main() {
  ll n;
  cin >> n;
  rep(i, n) cin >> h[i];
  // rep(i, n) cerr << h[i] << " ";
  // cerr << endl;
  cout << rec(0, 0, n) << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int prime(int p);

int main(){
    int x;
    scanf("%d", &x);
    while(prime(x)!=1){
        x++;
    }
    printf("%d", x);
    return 0;
}

int prime(int p){
    int k = 0;
    for(int i = 1; i < p; i++){
        if(p%i==0) k++;
    }
    return k;
}

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

int main() {
 int K;
 string A = "ACL";
 string B;
 cin >> K;
 rep(i,K){
  B += A;
 }
 cout << B << endl; 
}

Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;
string r = "qwertasdfgzxcvb";

int main(){
    string str;
    while(cin >> str, str != "#"){
        int sw = 0;
        bool prev = r.find(str[0]) == string::npos;
        for(int i=1; i<str.size(); i++){
            bool now = r.find(str[i]) == string::npos;
            sw += prev ^ now;
            prev = now;
        }
        cout << sw << endl;
    }
}
                                   

Measured memory_bytes: 1188
#define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v), std::end(v)
#define REP(i, k) for (decltype(k) i = 0; i < k; i++)
#define LOOP(k) REP (ngtkana_is_a_genius, k)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T, class U> using pair = std::pair<U, T>;
template <class T> using diag_pair = std::pair<T, T>;
template <class... Args> using tuple = std::tuple<Args...>;
template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/
template <class F>
class fixed_point {
    F f;
public:
    fixed_point(F&& f_) : f(f_) {}
    template <class... Args> auto operator()(Args... args) { return f(f, args...); }
};
template <class F> auto make_fixed_point(F&& f) { return fixed_point<F>(std::forward<F&&>(f)); }

void err() {
    std::cout << "First" << '\n';
    exit(0);
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    u32 n; std::cin >> n;
    if (n%2) err();
    vec<vec<u32>> g(n);
    LOOP (n-1) {
        u32 u, v; std::cin >> u >> v; u--, v--;
        g.at(u).push_back(v);
        g.at(v).push_back(u);
    }

    vec<u32> a(n);
    auto dfs = [&](auto&& f, u32 x, u32 p) -> bool {
        bool found = false;
        for (u32 y: g.at(x)) if (y!=p) {
            if (f(f, y, x) && std::exchange(found, true)) err();
        }
        return !found;
    };
    dfs(dfs, 0, 0);

    std::cout << "Second" << '\n';
}


Measured memory_bytes: 6272
#include<stdio.h>
void swap(int* max,int* min){
  int temp=*max;
  *max=*min;
  *min=temp;
}

int main(){
  int a,b;
  while(1){
    scanf("%d %d",&a ,&b);
    if(a==0 && b==0){
      break;
    }
    if(a>b){
      swap(&a,&b);
    }
    printf("%d %d\n",a,b);
  }
}



Measured memory_bytes: 2040
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef struct _data {
	int x;
	int y;
} data;

int  main()
{
	vector<pair<int ,int> > a(3);
	map <int , int> mp;
	rep(i, 3)
	{
		cin >> a.at(i).first >> a.at(i).second;
		mp[a.at(i).first] += 1;
		mp[a.at(i).second] += 1;
	}

	for(int i= 1; i <= 4; i++)
	{
		if (mp[i] > 2)
		{
			cout << "NO\n";
			return 0;
		} 
	}
	cout << "YES\n";
	return (0);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long a,b,c;
int main(){
//	freopen("cake.in","r",stdin);
//	freopen("cake.out","w",stdout);
	scanf("%lld %lld %lld",&a,&b,&c);
	long long d=a/b;
	if(a%b) d++;
	printf("%lld",d*c);
	return 0;
}

Measured memory_bytes: 3820
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define repr(i,a,b) for(int i=a; i<b; i++)
typedef vector<int> vi;

int main() {
  int N, K, Q;
  cin >> N  >> K >> Q;
  map<int, int> mp;
  rep(i,N) {
    mp[i+1] = K-Q;
  }

  vi A(Q);
  rep(i,Q) {
    cin >> A[i];
    mp[A[i]]++;
  }

  for(auto tmp : mp) {
    if(tmp.second >= 1) cout << "Yes" << endl;
    else cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
int main()
{
    map<int,int>mp;
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        int a;
        cin>>a;
        mp[a]++;
    }
    int cnt=0;
    for(int i=1;i<=1000000;i++)
    {
        if(mp[i]==1) cnt++;
        if(mp[i])
        {
            for(int j=2;i*j<=1000000;j++)
                mp[i*j]=0;
        }
    }
    cout<<cnt<<endl;
}


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

int n, m;
vector<vector<int>> G;

int dp[100005];

int rec(int v) {
    if (dp[v] != -1) return dp[v];

    int res = 0;
    for (auto nv : G[v]) {
        res = max(res, rec(nv) + 1);
    }
    return dp[v] = res;
};


int main() 
{
    cin >> n >> m;

    G.assign(n, vector<int>());
    rep(i,m) {
        int x, y ; cin >> x >> y;
        --x;--y;
        G[x].push_back(y);
    }

    rep(v,n) dp[v] = -1;

    int ans = 0;
    rep(v,n) {
        ans = max(ans, rec(v));
    }

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


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

using namespace std;
using ll = long long;
using ld = long double;

void solve(ll N, ll M, ll C, vector<ll> B, vector<vector<ll>> A) {
  int cnt{};
  for (auto i = 0; i != N; ++i) {
    int s = C;
    for (auto j = 0; j != M; ++j) {
      s += A[i][j] * B[j];
    }
    if (s > 0) ++cnt;
  }
  cout << cnt << endl;
}

int main() {
  ll N;
  cin >> N;
  ll M;
  cin >> M;
  ll C;
  cin >> C;
  vector<ll> B(M);
  for (int i = 0; i < M; i++) {
    cin >> B[i];
  }
  vector<vector<ll>> A(N, vector<ll>(M));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      cin >> A[i][j];
    }
  }
  solve(N, M, C, move(B), move(A));
  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = [0] + list(map(int, input().split()))
ans = set()
b = [0] * (n + 1)
for i in range(n, 0, - 1):
    cnt = 0
    for j in range(i, n + 1, i):
        cnt += b[j]
    cnt %= 2
    b[i] = (a[i] % 2) - cnt
    if b[i] :
        ans.add(i)
print(len(ans))
print(*ans)
    

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

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

    int h1,m1,h2,m2,k,h,m;
    cin>>h1>>m1>>h2>>m2>>k;

    m=60+m2-m1;
    h=abs(h2-h1)*60;
    if(m>0)
    {
        h-=60;
    }
    cout<<h+m-k<<endl;
    return 0;
}


Measured memory_bytes: 3612
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std;

const int MAX_N = 2e5 + 10;
int n, A, B, C, D;
string s;
bool can1[MAX_N], can2[MAX_N];

void dfs1 (int ind) {
	can1[ind] = true;
	if (ind + 1 < n && s[ind + 1] == '.')
		dfs1(ind + 1);
	if (ind + 2 < n && s[ind + 2] == '.' && !can1[ind + 2])
		dfs1(ind + 2);
}

void dfs2 (int ind) {
	can2[ind] = true;
	if (ind + 1 < n && s[ind + 1] == '.')
		dfs2(ind + 1);
	if (ind + 2 < n && s[ind + 2] == '.' && !can2[ind + 2])
		dfs2(ind + 2);
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> A >> B >> C >> D >> s;
	A--, B--, C--, D--;

	dfs1(A);
	dfs2(B);

	if (C < D) {
		if (can1[C] && can2[D])
			cout << "Yes\n";
		else
			cout << "No\n";
		return 0;
	}

	if (!can1[C] || !can2[D]) {
		cout << "No\n";
		return 0;
	}

	for (int i = B - 1; i + 2 < n; i++)
		if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.' && can1[i] && can2[i + 1] && i + 1 <= D && i + 2 <= C) {
			cout << "Yes\n";
			return 0;
		}

	cout << "No\n";
	return 0;
}

Measured memory_bytes: 2768
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3

fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = pow(fact[-1], MOD - 2, MOD)
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(input())
ans = []
for _ in range(Q):
    x, d, n = map(int, input().split())

    if x == 0:
        ans.append(0)
        continue

    if d == 0:
        ans.append(pow(x, n, MOD))
        continue

    xd = (x * pow(d, MOD - 2, MOD)) % MOD
    if xd == 0:
        ans.append(0)
        continue

    if MOD - xd < n:
        ans.append(0)
        continue

    dn = pow(d, n, MOD)
    ans.append((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD)
print(*ans, sep='\n')


Measured memory_bytes: 93804
#include <bits/stdc++.h>
#define int long long
#define gcd            __gcd
#define setbits(x)     __builtin_popcountll(x)
#define zrobits(x)     __builtin_ctzll(x)
#define mod            1000000007
#define inf            1e18
#define deci(x,y)      fixed<<setprecision(y)<<x
#define PI             3.141592653589793238
using namespace std;
int power(int n,int p){
    int x = n;
    int ans = 1;
    while(p > 0){
        if(p&1)
            ans= (ans*x)%mod;
        x= (x*x) % mod;
        p = p>>1;
    }
    return ans;
}

int modinv(int a){
    return power(a, mod - 2);
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,l,sum=0,index;
    cin>>n>>l;
    int arr[n];
    cin>>arr[0];
    for(int i=1;i<n;i++){
        cin>>arr[i];
        if( sum < (arr[i] + arr[i-1])){
            sum = arr[i] + arr[i-1];
            index = i-1;
        }
    }
    if(sum >= l){
        cout<<"Possible"<<endl;
        for(int i=1;i<=index;i++)
            cout<<i<<endl;
        for(int i=n-1;i> index;i--)
            cout<<i<<endl;
    } else cout<<"Impossible"<<endl;
    return 0;
}

Measured memory_bytes: 4436
// D - Remainder Reminder
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
	ll N,K; cin>>N>>K;
	ll cnt = 0;
	for(ll b=K+1; b<=N; ++b){
		ll p = N / b, r = N % b;
		cnt += p * max(0LL, b - K) + (K==0? r: max(0LL, r - K + 1));
	}
	cout<< cnt <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
   int a,b,c,d;
   cin>>a>>b>>c>>d;
   int st = max(a,c);
   int et = min(b,d);
   if(st>et){
       cout<<"0";
       return 0;
   }
   cout<<et-st;
}

Measured memory_bytes: 256
import sys
from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    N = int(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    A = list(map(int, stdin.readline().rstrip().split()))
    A.sort()
    C = Counter(A)
    cannot = set()
    L= max(A)
    ans = 0
    for a in A:
        if a in cannot: continue
        if C[a] == 1:
            ans += 1
        ind = 1
        while a*ind <= L:
            cannot.add(a*ind)
            ind += 1

    print(ans)

main()


Measured memory_bytes: 103276
//BELIEVE IN YOURSELF
//next_permutation

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define pob pop_back
#define vi vector<ll>
#define mp make_pair
#define sz size()
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define rep(i,n) for(ll i=0;i<n;i++)
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define maxx 100005
#define se second
#define fi first
#define be begin()
#define en end()
#define sortv(v) sort(v.begin(),v.end());
#define sortr(v) sort(v.rbegin(),v.rend());
#define w() ll _;cin>>_;while(_--)
#define edge pair<ll,ll>
#define pq priority_queue<ll>
#define mod 1000000007
#define Endl "\n"
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define lb(v,x) std::lower_bound(v.begin(),v.end(),x)
#define ub(v,x) std::upper_bound(v.begin(),v.end(),x)

using namespace std;


int main()
{
	fast;
	ll i,j;
	ll s;
	cin>>s;
	
	if(s<3)
	{
		cout<<0<<endl;
		return 0;
	}
	if(s==3)
	{
		cout<<1<<endl;
		return 0;
	}
	vector<ll>v;
	for(i=3;i<=s;i++)
	{
		v.pb(i);
	}
	ll n=v.size();
	
	ll dp[s+1]={0};
	
	dp[0]=1;
	
	for(i=1;i<=s;i++)
	{
		for(j=0;j<n;j++)
		{
			ll x=v[j];
			
			if(i-x>=0)
			{
				dp[i]=(mod+dp[i]+dp[i-x])%mod;
			}
		}
	}
	
	cout<<dp[s]%mod<<endl;
	
	
	
	return 0;
}

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

int main() {
    string s, key = "keyence", ans = "NO", str;
    cin >> s;
    rep(i, s.size()) {
        REP(j, i, s.size()) {
            str = s.substr(0, i) + s.substr(j);
            if (str == key) ans = "YES";
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import numpy as np
def getNearestValue(list, num):

    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

n,l=map(int,input().split())
ap=[i+l-1 for i in range(1,n+1)]
aps=sum(ap)
apsav=[aps-ap[i] for i in range(n)]
print(getNearestValue(apsav,aps))

Measured memory_bytes: 12432
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <cstdio>

using namespace std;

const long long INF = 100000000000;
const long long MOD = 1000000007;

long long f(long long N){
  long long ret = 0;
  while(N%2==0){
    N /= 2;
    ret++;
  }
  return ret;
}

int main()
{
  long long N;
  cin >> N;
  long long ans = INF;
  for (int i = 0; i < N; i++)
  {
    long long x;
    cin >> x;
    //xが何回2で割れるか
    ans = min(ans, f(x));
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(3);
    rep(i, n)
    {
        int temp;
        cin >> temp;
        if (temp % 4 == 0)
            a[0]++;
        else if (temp % 2 == 0)
            a[1]++;
        else
            a[2]++;
    }
    if (a[0] >= a[2])
        cout << "Yes" << endl;
    else if (a[0]+ 1 == a[2]  && a[1] % 2 == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<chrono>
#define ll long long
#define BUF 50
using namespace std;
ll MOD = 1e9 + 7;
ll A, B, H, N, M, L, K, P, Q, R, W, X, Y, Z;
ll ans = 0;


int main() {
	cin >> N;
	ll sum[BUF];
	sum[0] = 1, sum[1] = -2;
	for (int i = 2; i < BUF; i++) {
		if(i&1)
		sum[i] = sum[i - 2] - pow(2, i);
		else sum[i] = sum[i - 2] + pow(2, i);
	}
	vector<char> S(BUF, '0');
	while (N != 0) {
		int i = 0;
		if (N > 0) {
			while (N > sum[i]) {
				i++;
			}
			S[i] = '1';
			N -= pow(2, i);
		}
		else {
			while (N < sum[i]) {
				i++;
			}
			S[i] = '1';
			N += pow(2, i);
		}
	}
	bool flag = 0;
	for (int i = BUF-1; i >= 0; i--) {
		if (S[i] == '1')flag = 1;
		if (flag)cout << S[i];
	}
	if (flag == 0)cout << 0 << endl;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll h,n; cin>>h>>n;
    ll sum=0;
    rep(i,n){
        ll a; cin>>a;
        sum+=a;
    }
    if (sum>=h){
        cout<<"Yes\n";
    }else{
        cout<<"No\n";
    }
    return 0;
}


Measured memory_bytes: 256
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    s = S()
    l = []
    for i in range(len(s)-2):
        a = s[i:i+3]
        #print(a)
        b = 0
        c = 100
        for j in a:
            b += c*int(j)
            c //= 10
        l.append(abs(b-753))
        #print(l)
    print(min(l))

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

using namespace std;

int main(){
  vector<int> g1{1, 3, 5, 7, 8, 10, 12};
  vector<int> g2{4, 6, 9, 11};
  vector<int> g3{2};
  int x,y;
  cin >> x >> y;
  
  auto it1 = find(g1.begin(), g1.end(), x);
  if((it1!=g1.end())&&find(g1.begin(), g1.end(), y)!=g1.end()){
    cout<<"Yes"<<endl;
    return 0;
  }
  it1 = find(g2.begin(), g2.end(), x);
  if((it1!=g2.end())&&find(g2.begin(), g2.end(), y)!=g2.end()){
    cout<<"Yes"<<endl;
    return 0;
  }
  it1 = find(g3.begin(), g3.end(), x);
  if((it1!=g3.end())&&find(g3.begin(), g3.end(), y)!=g3.end()){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout << "No" << endl;

}


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

using namespace std;

int main()
{
  int n;
  scanf("%d", &n);
  
  int dp[100005][3] = {};
  for (int i = 0; i < n; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    dp[i+1][0] = max(dp[i][1]+a, dp[i][2]+a);
    dp[i+1][1] = max(dp[i][0]+b, dp[i][2]+b);
    dp[i+1][2] = max(dp[i][0]+c, dp[i][1]+c);
  }
  
  printf("%d\n", max(max(dp[n][0], dp[n][1]), dp[n][2]));
  
  return 0;
}

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

using namespace std;

const int MX = 200000;

int a[MX], fst[MX + 1], lst[MX + 1], seen[MX + 1];

int main() {
	int n;
	long long k;
	ignore = scanf("%d %lld", &n, &k);
	for (int i = 0; i < n; i++) ignore = scanf("%d", a + i);
	
	fill(lst, lst + MX + 1, -1);
	
	fst[n] = -1;
	for (int i = n - 1; i >= 0; i--) {
		int x = a[i];
		if (lst[x] == -1) fst[i] = x;
		else fst[i] = fst[lst[x] + 1];
		lst[x] = i;
	}
	
	fill(seen, seen + n + 1, -1);
	
	seen[n] = 0;
	seen[0] = 1;
	
	vector<int> f = {n, 0};
	for (int i = 2; i <= k; i++) {
		int p = f.back();
		if (fst[p] == -1) {
			f.push_back(0);
		}
		else {
			f.push_back(lst[fst[p]] + 1);
		}
		
		p = f.back();
		if (seen[p] != -1) {
			int s = seen[p];
			k = (k - s) % (i - s) + s;
		}
		else seen[p] = i;
	}
	
	vector<int> ans;
	set<int> S;
	for (int x = f[k]; x < n; x++) {
		if (S.insert(a[x]).second) {
			ans.push_back(a[x]);
		}
		else {
			while (S.count(a[x]) == 1) {
				S.erase(ans.back());
				ans.pop_back();
			}
		}
	}
	
	for (int x : ans) printf("%d ", x);
	printf("\n");
	
	return 0;
}


Measured memory_bytes: 14836
import sys
range = xrange
input = raw_input

h, w = [int(x) for x in input().split()]

if h == 1 or w == 1:
    print 1
else:
    hup = h + 1 >> 1
    hdown = h >> 1
    wup = w + 1 >> 1
    wdown = w >> 1
    print hup*wup + hdown*wdown


Measured memory_bytes: 27756
#include <bits/stdc++.h>
 
#define ll long long
#define ld long double
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define forr(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forab(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define foriter(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define endl '\n'
#define INF (ll)(1e9)
#define EPS 1e-9
#define MOD (ll)(1e9+7)
#define PI 3.1415926535897932384626433832795
#define set set
#define mset multiset
#define uset unordered_set
#define umset unordered_multiset
#define map map
#define mmap multimap
#define umap unordered_map
#define ummap unordered_multimap

using namespace std;
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vll;
typedef vector<vll> vvll;
typedef pair<i64, i64> pll;

int inp(){
  int x; 
  cin>>x;
  return x;
}

//=============================================================================//

void solve() {
    ll n, d; cin>>n>>d;
    ll dist = d*d;
    ll x,y;
    ll ans=0;
    for0(i, n){
      cin>>x>>y;
      ans+=(x*x+y*y<=dist);
    }
    cout<<ans;
}

int main() {
   
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);

    int T=1;
    //cin >> T;
    while (T--) {
        solve();
        cout<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
 
#define NL '\n'
#define xx first
#define yy second
#define ll long long
#define mp make_pair
#define pb push_back
#define sz(x) x.size()
#define all(x) (x).begin(), (x).end()
#define mem(a, b) memset(a, b, sizeof(a))
#define rep(i,a,b) for(ll i=(ll)a;i<(ll)b;++i)
#define async() ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
 
//#define FayeValentine 
void dz(){cerr<<NL;}template<typename H,typename... T> void dz(H h,T... t){cerr<<' '<<h;dz(t... );}
#ifdef  FayeValentine
#define debug(...) cerr<<"("<<#__VA_ARGS__<<"):",dz(__VA_ARGS__)
#else
#define debug(...) 
#endif


ll magic(ll n, ll g){
	if(n == 0LL) return 0;
	ll h = g >> 1LL;
	if(g == n+1LL || g == n) return h; 
	if(g > n+1LL && h <= n) return (n+1LL)%h;
	if(g > n+1LL && h > n) return 0LL;
	ll ret = (n/g)*h;
	ll p = (n%g);
	if(p >= h) ret += (p-h+1LL);
	return ret;
} 


void absinthe() {
	ll a, b, d, z = 0; cin >> a >> b; a--;
	for(ll i = 1; (1LL<<i-1) <= b; i++) {
		d = (1LL<<(i));
		ll l = magic(a, d), r = magic(b, d);
		if((r-l)&1) z += (d>>1);
	}
	cout << z << NL;
}   
 
int main(){
  async();
  int __t = 1, __c; //cin >> __t;
  for(__c = 1; __c <=__t; __c++) {
    //cout << "Case " << __c << ": "; 
    absinthe();
  }
}  

Measured memory_bytes: 256
import queue

"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""

(N,K,Q) = (int(i) for i in input().split(" "))
B = [0 for i in range(N)]
for i in range(Q):
	A = int(input())
	B[A-1]+=1
for b in B:
	if b <= Q-K:
		print("No")
	else:
		print("Yes")



Measured memory_bytes: 5532
a, b, c = map(int, input().split())

if a == b and b == c and a%2==0:
    print(-1)
elif a%2==1 or b%2==1 or c%2==1:
    print(0)
else:
    count=0
    while True:
        if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
            break
        else:
            count+=1
            newA =b//2 + c//2
            newB =c//2 + a//2
            newC =a//2 + b//2
            a, b, c = newA, newB, newC
    print(count)

Measured memory_bytes: 3064
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dunk(n) cout << n << endl
int main() {
  int h,w;
  cin >> h >> w;
  vector<string> vec(h);
  rep(i,h) cin >> vec[i];
  rep(i,w+2) cout << "#";
  cout << endl;
  rep(i,h) cout << "#" << vec[i] << "#" << endl;
  rep(i,w+2) cout << "#";
  cout << endl;
}
  
  

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

int main() {

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

	Int N;
	cin >> N;

	string s1, s2;
	cin >> s1 >> s2;

	mint ans;
	Int flag;

	Int i = 0;
	if (s1[i] == s2[i]) {
		flag = 1;
		ans = 3;
		i++;
	}
	else {
		flag = 0;
		ans = 6;
		i += 2;
	}

	while (i < N) {
		if (flag == 0 && s1[i] == s2[i]) {
			i++;
			flag = 1;
		}
		else if (flag == 0 && s1[i] != s2[i]) {
			ans *= 3;
			i += 2;
		}
		else if (flag == 1 && s1[i] == s2[i]) {
			ans *= 2;
			i++;
		}
		else {
			ans *= 2;
			i += 2;
			flag = 0;
		}
	}
	cout << ans << "\n";
}

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

int main() {
    int A, B;
    cin >> A >> B;
    for (int i=1; i<=3; i++) {
        if ((A*B*i)%2!=0) {
            cout << "Yes\n";
            return 0;
        }
    }
    cout << "No\n";
}

Measured memory_bytes: 256
local bls, brs = bit.lshift, bit.rshift
local bxor = bit.bxor
local mce, mfl, msq, mmi, mma, mab = math.ceil, math.floor, math.sqrt, math.min, math.max, math.abs

local ffi = require("ffi")
local C = ffi.C
ffi.cdef[[
long long atoll(const char*);
]]

local function lltonumber(str)
  return C.atoll(str)
end

local n = io.read()
if n == "1" then print(1) os.exit() end
n = lltonumber(n)
n = 2LL * n
local lim = 31622777
local function getprimes(x)
  local primes = {}
  local allnums = {}
  for i = 1, x do allnums[i] = true end
  for i = 2, x do
    if allnums[i] then
      table.insert(primes, i)
      local lim = mfl(x / i)
      for j = 2, lim do
        allnums[j * i] = false
      end
    end
  end
  return primes
end
-- print(os.clock())
local primes = getprimes(lim)
-- print(os.clock())
local function getdivisorparts(x, primes, lim)
  local prime_num = #primes
  local tmp = {}
  local raw = {}
  local primepos = 1
  local dv = primes[primepos]
  while primepos <= prime_num and dv <= lim do
    if x % dv == 0LL then
      local p = dv
      x = x / dv
      while x % dv == 0 do
        x = x / dv
        p = p * dv
      end
      table.insert(tmp, p)
      table.insert(raw, dv)
      -- lim = mce(msq(x))
    end
    if primepos == prime_num then break end
    primepos = primepos + 1
    dv = primes[primepos]
  end
  if x ~= 1LL then
    table.insert(tmp, x)
    table.insert(raw, x)
  end
  return tmp, raw
end
-- for i = 1, #dvs do
--   print(dvs[i])-- maybe LL
-- end

local function grayCode(x)
  return bxor(x, brs(x, 1))
end

-- add_func(idx), rm_func(idx), work_func()
local function grayWalk(size, add_func, rm_func, work_func)
  local prv = 0
  local total = bls(1, size) - 1
  local bpos = {}
  for i = 1, size do
    bpos[bls(1, i - 1)] = i
  end
  -- if need first work then use below
  -- work_func()
  for i = 1, total do
    local v = grayCode(i)
    if prv < v then
      prv, v = v, v - prv
      add_func(bpos[v])
    else
      prv, v = v, prv - v
      rm_func(bpos[v])
    end
    work_func()
  end
end

local dvs, raw = getdivisorparts(n, primes, lim)
local tot = bls(1, #dvs)
local left_use = {}
local minfact = n
local kcand = 1
local left = 1LL

local function solve(a, b, x, y)
  if b == 0LL then
    x[1] = 1LL
    y[1] = 0LL
    return a
  end
  local d = solve(b, a % b, y, x)
  y[1] = y[1] - (a / b) * x[1]
  return d
end

local function add_func(idx)
  left_use[tostring(raw[idx])] = true
  left = left * dvs[idx]
end
local function rm_func(idx)
  left_use[tostring(raw[idx])] = false
  left = left / dvs[idx]
end
local x, y = {0}, {0}
local function work_func()
  local right = n / left
  solve(left, right, x, y)
  x[1] = -x[1]
  while x[1] < 0LL do
    x[1] = x[1] + right
  end
  local z = x[1] * left
  if 0LL < z and z < minfact then
  -- if x[1] * left < minfact then
    minfact = left * x[1]
    -- print(x[1], left, minfact)
  end
end
grayWalk(#dvs, add_func, rm_func, work_func)
local ans = minfact
ans = tostring(ans):gsub("LL", "")
print(ans)


Measured memory_bytes: 281112
#include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
  string S;
  cin >> S;
  cout << (S[2] == S[3] && S[4] == S[5] ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256