akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long

int main(){
    ll N;
    cin >> N;
    ll n=100;
    vector<int> counter(10001);
    for(int i=0;i<n;i++){
        for(int j=i;j<n;j++){
            for(int k=j;k<n;k++){
                int x=i+1,y=j+1,z=k+1;
                //cout << x << "," << y << "," << z << " ";
                ll num = x*x + y*y + z*z + x*y + y*z + z*x;
                if(num<=10000){
                    int plus;
                    if(i==j && j==k){
                        plus = 1;
                    }else if(i==j or j==k){
                        plus = 3;
                    }else{
                        plus = 6;
                    }
                    counter.at(num) += plus;
                }
                //cout << num << endl;
            }
        }
    }
    
    rep(i,N){
        cout << counter.at(i+1) << endl;
    }

    return 0;
}


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

#define debug(...) fprintf(stderr, __VA_ARGS__)

#ifndef AT_HOME
#define getchar() IO::myGetchar()
#define putchar(x) IO::myPutchar(x)
#endif

namespace IO {
	static const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;

	inline char myGetchar() {
		static char buf[IN_BUF], *ps = buf, *pt = buf;
		if (ps == pt) {
			ps = buf, pt = buf + fread(buf, 1, IN_BUF, stdin);
		}
		return ps == pt ? EOF : *ps++;
	}

	template<typename T>
	inline bool read(T &x) {
		bool op = 0;
		char ch = getchar();
		x = 0;
		for (; !isdigit(ch) && ch != EOF; ch = getchar()) {
			op ^= (ch == '-');
		}
		if (ch == EOF) {
			return false;
		}
		for (; isdigit(ch); ch = getchar()) {
			x = x * 10 + (ch ^ '0');
		}
		if (op) {
			x = -x;
		}
		return true;
	}

	inline int readStr(char *s) {
		int n = 0;
		char ch = getchar();
		for (; isspace(ch) && ch != EOF; ch = getchar())
			;
		for (; !isspace(ch) && ch != EOF; ch = getchar()) {
			s[n++] = ch;
		}
		s[n] = '\0';
		return n;
	}

	inline void myPutchar(char x) {
		static char pbuf[OUT_BUF], *pp = pbuf;
		struct _flusher {
			~_flusher() {
				fwrite(pbuf, 1, pp - pbuf, stdout);
			}
		};
		static _flusher outputFlusher;
		if (pp == pbuf + OUT_BUF) {
			fwrite(pbuf, 1, OUT_BUF, stdout);
			pp = pbuf;
		}
		*pp++ = x;
	}

	template<typename T>
	inline void print_(T x) {
		if (x == 0) {
			putchar('0');
			return;
		}
		static int num[40];
		if (x < 0) {
			putchar('-');
			x = -x;
		}
		for (*num = 0; x; x /= 10) {
			num[++*num] = x % 10;
		}
		while (*num){
			putchar(num[*num] ^ '0');
			--*num;
		}
	}

	template<typename T>
	inline void print(T x, char ch = '\n') {
		print_(x);
		putchar(ch);
	}

	inline void printStr_(const char *s, int n = -1) {
		if (n == -1) {
			n = strlen(s);
		}
		for (int i = 0; i < n; ++i) {
			putchar(s[i]);
		}
	}

	inline void printStr(const char *s, int n = -1, char ch = '\n') {
		printStr_(s, n);
		putchar(ch);
	}
}
using namespace IO;

const int N = 1000005;

int n, q;
char op[N];

int pw[13];

int ans[N];

struct Trie {
	int rt, cnt, son[N][3], id[N];
	bool tag[N];

	void build(int &u, int d, int v) {
		u = ++cnt, tag[u] = 0;
		if (d == n) {
			id[u] = v;
			return;
		}
		for (int i = 0; i < 3; ++i) {
			build(son[u][i], d + 1, v + i * pw[d]);
		}
	}

	void rev(int u) {
		std::swap(son[u][1], son[u][2]);
		tag[u] ^= 1;
	}

	void down(int u) {
		if (tag[u]) {
			rev(son[u][0]), rev(son[u][1]), rev(son[u][2]);
			tag[u] = 0;
		}
	}

	void add(int u) {
		if (!son[u][0]) {
			return;
		}
		down(u);
		int t = son[u][2];
		son[u][2] = son[u][1];
		son[u][1] = son[u][0];
		son[u][0] = t;
		add(son[u][0]);
	}

	void getans(int u, int d, int v) {
		if (d == n) {
			ans[id[u]] = v;
			return;
		}
		down(u);
		for (int i = 0; i < 3; ++i) {
			getans(son[u][i], d + 1, v + i * pw[d]);
		}
	}
} T;

int main() {
	read(n);
	q = readStr(op + 1);
	pw[0] = 1;
	for (int i = 1; i <= n; ++i) {
		pw[i] = pw[i - 1] * 3;
	}
	T.build(T.rt, 0, 0);
	for (int i = 1; i <= q; ++i) {
		if (op[i] == 'S') {
			T.rev(T.rt);
		} else {
			T.add(T.rt);
		}
	}
	T.getans(T.rt, 0, 0);
	for (int i = 0; i < pw[n]; ++i) {
		print(ans[i], ' ');
	}
	putchar('\n');
}


Measured memory_bytes: 23372
fn main() {
    println!("{}", solve(input()));
}

fn input() -> u64 {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.pop();

    let n: u64 = buf.parse().unwrap();
    n
}

fn solve(n: u64) -> u64 {
    let all_sum = n * (n + 1) / 2;
    let sum_3 = ((n/3) * ((n/3)+1) / 2) * 3;
    let sum_5 = ((n/5) * ((n/5)+1) / 2) * 5;
    let sum_15 = ((n/15) * ((n/15)+1) / 2) * 15;

    all_sum - (sum_3 + sum_5 - sum_15)
}

Measured memory_bytes: 2164
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int A,B,C,D;
    cin >> A >>B >> C >> D;
    while(A>0&&C>0){
        C-=B;
        if(C<=0){
            cout << "Yes" << endl;
            return 0;
        }
        A-=D;
        if(A<=0){
            cout << "No" << endl;
        }
    }
    return 0;
}

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

typedef long long int ll;
#define INF 1999999999
#define MODA 1000000007

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int r;
    cin >> r;
    cout << r * r << endl;

    return 0;
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int n, m;
  ll k;
  cin >> n >> m >> k;
  vector<ll> a(n), b(m);
  rep(i, n) cin >> a[i];
  rep(i, m) cin >> b[i];

  a.insert(a.begin(), 0);
  b.insert(b.begin(), 0);
  rep(i, n) a[i+1] += a[i];
  rep(i, m) b[i+1] += b[i];

  int ans = 0;

  for(int i = 0; i <= n; ++i) {
    if(a[i] > k) break;

    ll d = k-a[i];

    auto it = upper_bound(ALL(b), d);
    --it;
    chmax(ans, i+(int)distance(b.begin(), it));
  }

  for(int i = 0; i <= m; ++i) {
    if(b[i] > k) break;

    ll d = k-b[i];

    auto it = upper_bound(ALL(a), d);
    --it;
    chmax(ans, i+(int)distance(a.begin(), it));
  }

  cout << ans << endl;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

template< typename Data, typename T >
struct ReRooting {
 
  struct Node {
    int to, rev;
    Data data;
  };
 
  using F1 = function< T(T, T) >;
  using F2 = function< T(T, Data) >;
 
  vector< vector< Node > > g;
  vector< vector< T > > ldp, rdp;
  vector< int > lptr, rptr;
  const F1 f1;
  const F2 f2;
  const T ident;
 
  ReRooting(int n, const F1 &f1, const F2 &f2, const T &ident) :
      g(n), ldp(n), rdp(n), lptr(n), rptr(n), f1(f1), f2(f2), ident(ident) {}
 
  void add_edge(int u, int v, const Data &d) {
    g[u].emplace_back((Node) {v, (int) g[v].size(), d});
    g[v].emplace_back((Node) {u, (int) g[u].size() - 1, d});
  }
 
  void add_edge_bi(int u, int v, const Data &d, const Data &e) {
    g[u].emplace_back((Node) {v, (int) g[v].size(), d});
    g[v].emplace_back((Node) {u, (int) g[u].size() - 1, e});
  }
 
 
  T dfs(int idx, int par) {
 
    while(lptr[idx] != par && lptr[idx] < g[idx].size()) {
      auto &e = g[idx][lptr[idx]];
      ldp[idx][lptr[idx] + 1] = f1(ldp[idx][lptr[idx]], f2(dfs(e.to, e.rev), e.data));
      ++lptr[idx];
    }
    while(rptr[idx] != par && rptr[idx] >= 0) {
      auto &e = g[idx][rptr[idx]];
      rdp[idx][rptr[idx]] = f1(rdp[idx][rptr[idx] + 1], f2(dfs(e.to, e.rev), e.data));
      --rptr[idx];
    }
    if(par < 0) return rdp[idx][0];
    return f1(ldp[idx][par], rdp[idx][par + 1]);
  }
 
  vector< T > solve() {
    for(int i = 0; i < g.size(); i++) {
      ldp[i].assign(g[i].size() + 1, ident);
      rdp[i].assign(g[i].size() + 1, ident);
      lptr[i] = 0;
      rptr[i] = (int) g[i].size() - 1;
    }
    vector< T > ret;
    for(int i = 0; i < g.size(); i++) {
      ret.push_back(dfs(i, -1));
    }
    return ret;
  }
};


int main(void) {
  int64 n;
  cin >> n;
  vector<int64> p(n);
  REP(i, n) cin >> p[i];
  int64 res = 0;
  REP(i, n-2) {
    res += ((p[i] < p[i+1]) + (p[i+2] < p[i+1]) == 1);
  }
  cout << res << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
     
#define ll long long
#define loop(i,a,n) for(ll i=a;i<n;++i)
#define revloop(i,a,b) for(ll i=a;i>=b;--i)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF 1000000000000000000
#define MOD 1000000007 

void func()
{
    ll n;
    cin>>n;
    map<string,ll> m;
    loop(i,0,n){
        string s;
        cin>>s;
        m[s]++;
    }
    cout<<"AC x "<<m["AC"]<<"\n";
    cout<<"WA x "<<m["WA"]<<"\n";
    cout<<"TLE x "<<m["TLE"]<<"\n";
    cout<<"RE x "<<m["RE"]<<"\n";
}
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" , stdin);
    freopen("output.txt", "w" , stdout);
    #endif
 
    ll t=1;
    //cin>>t;
    while(t--)
    {
        func();
    }
}

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

int main() {
    string s;
  int c;
  cin >> s;
  if(s=="SUN")
  c=7;
  if(s=="MON")
  c=6;
    if(s=="TUE")
  c=5;
      if(s=="WED")
  c=4;
        if(s=="THU")
  c=3;
          if(s=="FRI")
  c=2;
            if(s=="SAT")
  c=1;
  cout<< c << endl;
}

Measured memory_bytes: 256
def popular_vote(n, m ,al):
    al.sort(reverse=True)
    sum = 0
    for a in al:
        sum += a
    # print(sum)
    if al[m-1] >= sum/(4.0*m):
        print('Yes')
    else:
        print('No')

n, m = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]

popular_vote(n, m, al)        

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

//INSERT ABOVE HERE
const int MAX = 1010;
int dp[MAX][MAX];
int bm[MAX][MAX];

signed main(){
  int h,w,p,q;
  cin>>h>>w>>p>>q;
  vector<string> st(h);
  for(int i=0;i<h;i++) cin>>st[i];

  memset(bm,0,sizeof(dp));

  auto in=[&](int y,int x){return 0<=y&&y<h&&0<=x&&x<w;};
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(st[i][j]!='*') continue;
      for(int a=-1;a<=1;a++)
        for(int b=-1;b<=1;b++)
          if(in(i+a,j+b)) bm[i+a][j+b]=1;
    }
  }
    
  memset(dp,-1,sizeof(dp));
  struct T{
    int y,x,d;
    T(){}
    T(int y,int x,int d):y(y),x(x),d(d){}
    bool operator<(const T &a)const{return d>a.d;};
  };

  priority_queue<T> pq;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      if(st[i][j]=='s') pq.emplace(i,j,dp[i][j]=0);

  int dy[]={1,-1,0,0};
  int dx[]={0,0,1,-1};
  auto cmp=[&](int a,int b){return a<0||b<a;};
  while(!pq.empty()){
    T s=pq.top();pq.pop();
    int y=s.y,x=s.x,d=s.d;
    //cout<<y<<" "<<x<<":"<<d<<endl;
    if(dp[y][x]<d) continue;
    if(st[y][x]=='g'){
      cout<<d<<endl;
      return 0;
    }
    
    auto check=
      [&](int ny,int nx,int nd)->void{
        if(!in(ny,nx)||!cmp(dp[ny][nx],nd)) return;
        dp[ny][nx]=nd;
        pq.emplace(ny,nx,dp[ny][nx]);
      };
    
    for(int k=0;k<4;k++){
      int ny=y+dy[k],nx=x+dx[k];
      if(in(ny,nx)&&st[ny][nx]!='#') check(ny,nx,d+p);
    }
    
    if(bm[y][x]) continue;
    
    for(int a=-1;a<=1;a++)
      for(int b=-1;b<=1;b++)
        check(y+a,x+b,d+(abs(a)+abs(b))*p+q);
  }
  cout<<"INF"<<endl;
  return 0;
}



Measured memory_bytes: 12088
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

char c[500005];
long long ans,now1=0,now2=0,ok[500005];

int main(void){
	scanf("%s",c+1);
	int len=strlen(c+1);
	memset(ok,-1,sizeof(ok));
	for(int i=1;i<=len;i++){
		if(c[i]=='>'&&c[i+1]=='<')ok[i]=0;
	}
	if(c[1]=='<')ok[0]=0;
	if(c[len]=='>')ok[len]=0;
	for(int i=0;i<=len;i++){
		if(ok[i]==0){
			int j=i-1;
			long long now=1;
			while(j>=0){
				ok[j]=max(ok[j],now);
				now++;
				if(c[j+1]!=c[j])break;
				j--;
			}
			j=i+1,now=1;
			while(j<=len){
				ok[j]=max(ok[j],now);
				now++;
				if(c[j+1]!=c[j])break;
				j++;
			}
//			for(int j=0;j<=len;j++)
//			printf("%lld ",ok[j]);
//			printf("\n");
		}
	}
	for(int i=0;i<=len;i++)
	ans+=ok[i];
	printf("%lld",ans);
}
 /*
 <>>><<><<<<<>>><
 */

Measured memory_bytes: 4608
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;



int main(){
	long long int n;
	cin >> n;
	vector<long long int> a(n), b(n);
	for(long long int i=0;i<n;i++){
		b.at(i) = 0;
	}
	for(long long int i=0;i<n;i++){
		cin >> a.at(i);
		b.at((a.at(i)-1))++;
	}
	long long int num = 0;
	for(long long int i=0;i<n;i++){
		if(b.at(i) >= 2){
			long long int m = (b.at(i)*(b.at(i)-1))/2;
			num += m;
		}
	}
	for(long long int i=0;i<n;i++){
		long long int ans = num;
		long long int p = b.at(a.at(i)-1)*(b.at(a.at(i)-1)-1)/2;
		if(p > 0){
			ans -= p;
		}
		long long int q = (b.at(a.at(i)-1)-1)*(b.at(a.at(i)-1)-2)/2;
		if(q > 0){
			ans += q;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 5760
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

#define FOR(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)

using namespace std;

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> img(h);
    FOR(i, 0, h) {
        cin >> img[i];
    }
    cout << string(w + 2, '#') << endl;
    FOR(i, 0, h) {
        cout << "#" << img[i] << "#" << endl;
    }
    cout << string(w + 2, '#') << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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 qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){
     int n, m,ans = 0;;
     cin >> n >> m;
     for(int i=1;i<=n;i+=2){
         ans++;
     }
     cout << (ans<m ? "NO" : "YES") fin;

  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
int n, a, b;
int main() {
	read(n), read(a), read(b);
	if ((b - a) & 1) puts("Borys");
	else puts("Alice");
	return 0;
}

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

int main()
{
    int a, b, c, ans;
    cin >> a >> b >> c;
    if (a * c <= b)
        ans = c;
    else
    {
        ans = b / a;
    }

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

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() (int, []int) {
	n := readInt()
	return n, readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func eprintln(args ...interface{}) (int, error) {
	return fmt.Fprintln(os.Stderr, args...)
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int

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

func main() {
	defer stdout.Flush()
	n := readInt()
	a := make([]int, n)
	b := make([]int, n)
	c := make([]int, n)
	for i := range a {
		a[i] = readInt()
	}
	for i := range b {
		b[i] = readInt()
	}
	for i := range c {
		c[i] = readInt()
	}

	sort.Ints(a)
	sort.Ints(b)
	sort.Ints(c)

	i := 0
	k := 0
	ans := 0
	for j := range b {
		for i < n && a[i] < b[j] {
			i++
		}
		for k < n && c[k] <= b[j] {
			k++
		}
		//eprintln("add", i, k, i*k)
		ans += i * (n - k)
	}
	println(ans)
}

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


Measured memory_bytes: 6016
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define ll long long
#define vi vector<int>
#define pi pair<int, int>
#define pb push_back
#define ppb pop_back

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const int N = 2e5 + 667;

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

    ll a, b;
    cin >> a >> b;
    ll c = b -  a;
    if(a == b){
        if(a < 0) cout << "Negative";
        else if(a > 0) cout << "Positive";
        else cout << "Zero";
        return 0;
    }
    if(a == 0 || b == 0){
        cout << "Zero";
        return 0;
    }
    if(b >= 0 && a <=0){
        cout << "Zero";
        return 0;
    }
    if(a > 0 && b > 0){
        cout << "Positive";
        return 0;
    }
    if(c % 2 == 1){
        cout << "Positive";
    }
    else{
        cout << "Negative";
    }
    return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);

		Queue<DataS> queue = new ArrayDeque<>();
		int n = scan.nextInt();
		int q = scan.nextInt();
		for (int i = 0; i < n ; i++) {
			String name = scan.next();
			int time = scan.nextInt();
			DataS dataS = new DataS( name, time );
			queue.add(dataS);
		}

		int time = 0;
		while(queue.size() != 0) {
			DataS dataS = queue.poll();
			int dataTime = dataS.getTime();
			if(dataTime > q) {
				time += q;
				dataS.setTime(dataTime - q);
				queue.add(dataS);
			}else {
				time += dataS.getTime();
				System.out.println(dataS.getName() + " " + time);
			}
		}

	}

	static class DataS{
		private String name;
		private int time;
		public DataS(String name , int time) {
			this.name = name;
			this.time = time;
		}
		public String getName() {
			return name;
		}

		public void setTime(int time) {
			this.time = time;
		}

		public int getTime() {
			return time;
		}
	}

}



Measured memory_bytes: 74292
#include <bits/stdc++.h>
#define int long long
#define range(i, a, b) for(auto i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
#define all(a) (a).begin(),(a).end()
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const long double EPS = 1e-8;
using vi = vector <int>;
using vvi = vector <vi>;

signed main() {
	int n;
	cin >> n;
	string march = "MARCH";
	int cnt[5] = {};
	string in;
	rep (i, n) {
		cin >> in;
		rep (j, 5) {
			if (in[0] == march[j]) {
				cnt[j]++;
				break;
			}
		}
	}
	int ans = 0;
	rep (i, 5) range (j, i + 1, 5) range (k, j + 1, 5) {
		ans += cnt[i] * cnt[j] * cnt[k];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()){
    return vector2<T>(n0, vector<T>(n1, e));
}

template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()){
    return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}

typedef tuple<int, int, int> tup;

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

    int n;
    cin >> n;
    auto edge = initVec2<int>(n + 1, 0);
    rep(i, n - 1){
        int a, b;
        cin >> a >> b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }

    vector<int> dep(n + 1, -1);
    vector<int> par(n + 1, 0);
    stack<tup> st;
    st.emplace(1, 1, 0);
    while(not st.empty()){
        int v, d, p;
        tie(v, d, p) = st.top();
        st.pop();
        if(dep[v] != -1){
            continue;
        }
        dep[v] = d;
        par[v] = p;
        for(int u : edge[v]){
            if(dep[u] != -1){
                continue;
            }
            st.emplace(u, d + 1, v);
        }
    }

    int len = dep[n];
    int id = n;
    rep(i, len / 2){
        id = par[id];
    }

    vector<bool> used(n + 1, false);
    stack<int> sti;
    sti.push(n);
    while(not sti.empty()){
        int v = sti.top();
        sti.pop();

        if(used[v] || v == id){
            continue;
        }
        used[v] = true;
        for(int u : edge[v]){
            if(used[u]){
                continue;
            }
            sti.push(u);
        }
    }

    int snuke = 0;
    rep(i, n + 1){
        if(used[i]){
            snuke++;
        }
    }

    int fennec = n - snuke;
    if(fennec > snuke){
        cout << "Fennec" << endl;
    }else{
        cout << "Snuke" << endl;
    }

    return 0;
}


Measured memory_bytes: 7680
// Original: https://github.com/tanakh/competitive-rs
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::HashMap;

fn main() {
    input!(mut a: [usize; 3]);
    a.sort();
    println!("{}", a[0] + a[1]);
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
  long long a,b,x,z,c;
  
  
  cin>>a>>b>>x;
  z=b/x;
   if(a==0)
  cout<<z+1;
  else
  {
   c=(a-1)/x;
cout<<z-c;
}
    return 0;
}


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

int main() {
  string S;
  cin >> S;
  if (S == "SUN") cout << 7 << endl;
  if (S == "MON") cout << 6 << endl;
  if (S == "TUE") cout << 5 << endl;
  if (S == "WED") cout << 4 << endl;
  if (S == "THU") cout << 3 << endl;
  if (S == "FRI") cout << 2 << endl;
  if (S == "SAT") cout << 1 << endl;
}

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

using namespace std;

#define MAX 505
#define ll long long
#define pb push_back
#define mk make_pair
#define sc second
#define fr first
#define pii pair < int, int >

const int N = (int)1e4 + 5;
const int INF = (int)1e9 + 7;

int main () {
        long long x, y; cin >> x >> y;
        if (x > 0 && y > 0) { // + +
                if (y > x) {
                        cout << y - x;
                } else if (y < x) {
                        cout << x - y + 2;
                }
        } else {
                if (x < 0 && y > 0) {
                        cout << abs(abs(y) - abs(x)) + 1;
                } else if (x > 0 && y < 0) {
                        cout << abs(abs(y) - abs(x)) + 1;
                } else if (x < 0 && y < 0) { // - -
                        if (abs(x) > abs(y)) {
                                cout << abs(x) - abs(y);
                        } else if (abs(x) < abs(y)) {
                                cout << abs(y) - abs(x) + 2;
                        }
                } else if (x == 0 || y == 0) {
                        if (x == 0) {
                                if (y < 0) {
                                        cout << abs(y) + 1;
                                } else if (y > 0) {
                                        cout << abs(y);
                                }
                        } else {
                                if (x < 0) {
                                        cout << abs(x);
                                } else {
                                        cout << x + 1;
                                }
                        }
                }
        }
        cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(long long i=0; i<(int)n; i++)
#define rep2(i,a,n) for(long long i=(a); i<(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using psi = pair<string, int>;
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};
const int mod = 1e9+7;
int gcd(int a, int b){if(a%b == 0){return(b);}else{return(gcd(b, a%b));}}
int lcm(int a, int b){return a * b / gcd(a, b);}

int N, M, K, H, W, L, R, T, X;
string S;
signed main(){
  cin >> H >> W;
  vvi a(H,vi(W));
  int odd = 0;
  rep(i,H){rep(j,W){
    cin >> a[i][j];
    if(a[i][j]%2 == 1) odd++;
  }}
  if (odd <=1){
    cout << 0 << endl;
    return 0;
  }

  int cnt = 0;
  int dir = 1;
  int i = 0;
  int j = 0;
  vvi ans;
  while (1){
    int ni = i;
    int nj = j+dir;
    if(i%2 == 0 && nj == W){
      dir = -1;
      nj = W-1;
      ni = i+1;
    }
    if(i%2 == 1 && nj == -1){
      dir = 1;
      nj = 0;
      ni = i+1;
    }
   
    if(ni >= H) break;
      
    if(a[i][j]%2 == 1){
      cnt++;
      vi b = {i+1, j+1, ni+1, nj+1};
      ans.push_back(b);
      a[ni][nj]++;
      if(a[ni][nj]%2 == 0) odd--;
    } 
    i = ni;
    j = nj;
    if(odd<2) break;
  }
  
  cout << cnt << endl;
  rep(i,ans.size()){
    cout << ans[i][0]<< " " << ans[i][1] << " "<< ans[i][2]<< " " << ans[i][3] << endl;
  }
  return 0;
}

Measured memory_bytes: 13964
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
b = set([int(input()) for _ in range(N)])
flag = False
# yoko
for i in range(3):
    if all([a in b for a in A[i]]):
        flag = True

if not flag:
    for j in range(3):
        tmp = [A[0][j], A[1][j], A[2][j]]
        if all([a in b for a in tmp]):
            flag = True

if not flag:
    tmp = [A[0][0], A[1][1], A[2][2]]
    if all([a in b for a in tmp]):
        flag = True

if not flag:
    tmp = [A[0][2], A[1][1], A[2][0]]
    if all([a in b for a in tmp]):
        flag = True

print('Yes' if flag else 'No')


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long ll;

int A, B, C, X, Y, ans;

int main()
{
	//ios_base::sync_with_stdio(false); cin.tie(NULL);
	//freopen("input.in","r",stdin);
	cin >> A >> B >> C >> X >> Y;
	if (2 * C < A + B) {
		int minxy = min(X,Y);
		ans = 2 * C * minxy;
		//cout << ans << '\n';
		X -= minxy;
		Y -= minxy;
		//cout << X << ' '  << Y << '\n';
		ans += X * min(A,2*C);
		ans += Y * min(B,2*C);
		cout << ans << '\n';
	}
	else {
		ans = A * X + B * Y;
		cout << ans << '\n';
	}
	
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define Check system("pause")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)



int main()
{
	ios::sync_with_stdio(false);
	int a,b,c,k;
	cin>>a>>b>>c>>k;
	if(k<=a)
	cout<<k;
	else if(k<=a+b)
	cout<<a;
	else
	cout<<2*a+b-k;
	return 0;
}




Measured memory_bytes: 3676
using System;
using System.Collections.Generic;
public class ABC126C {
    public static void Main() {
        double N, K, ans = 0;
        string[] str = System.Console.ReadLine().Split(' ');
        N = int.Parse(str[0]);
        K = int.Parse(str[1]);
        for(double n = 1; n <= N; n++) {
            double score = n;
            int exp = 0;
            while(score < K) {
                exp += 1;
                score *= 2;
            }
            ans += (1f / N) * Math.Pow(1f / 2f,exp);
        }
        System.Console.WriteLine(ans);
    }
}

Measured memory_bytes: 11092
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; } value
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> bingo(9);
  REP(i,9) cin >> bingo[i];
  int n;
  cin >> n;
  bool a = false;
  vector<int> cho(n);
  REP(j,n) cin >> cho[j];
  REP(i,9) {
    REP(j,n) {
      if(bingo[i] == cho[j]) bingo[i] = -1;
    }
  }
  if(bingo[0] == -1 && bingo[1] == -1 && bingo[2] == -1) a = true;
  if(bingo[3] == -1 && bingo[4] == -1 && bingo[5] == -1) a = true;
  if(bingo[6] == -1 && bingo[7] == -1 && bingo[8] == -1) a = true;
  if(bingo[0] == -1 && bingo[3] == -1 && bingo[6] == -1) a = true;
  if(bingo[1] == -1 && bingo[4] == -1 && bingo[7] == -1) a = true;
  if(bingo[2] == -1 && bingo[5] == -1 && bingo[8] == -1) a = true;
  if(bingo[3] == -1 && bingo[6] == -1 && bingo[9] == -1) a = true;
  if(bingo[0] == -1 && bingo[4] == -1 && bingo[8] == -1) a = true;
  if(bingo[2] == -1 && bingo[4] == -1 && bingo[6] == -1) a = true;

  YesorNo(a);
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] b = new int[N];
		for(int i = 0; i < N; i++) {
			b[i] = sc.nextInt();
		}
		List<Pair> stack = new ArrayList<>();
		String ans = "";
		for(int i = N - 1; i > -1; i--) {
			if(b[i] > i + 1) {
				ans = "-1";
				break;
			} else {
				if(b[i] == 1) {
					ans += "1\n";
					stack.forEach(entry -> entry.setCount(entry.getCount() - 1));
					boolean flag = true;
					while(!stack.isEmpty() && flag) {
						flag = false;
						for(int j = 0; j < stack.size(); j++) {
							if(stack.get(j).getCount() <= 0) {
								ans += stack.get(j).getNum() + "\n";
								stack.remove(j);
								for(int k = 0; k < j; k++) {
									stack.get(k).setCount(stack.get(k).getCount() - 1);
								}
								flag = true;
								break;
							}
						}
					}
				} else {
					stack.add(new Pair(b[i]));
				}
			}
		}
		System.out.println(ans);
	}
}

class Pair {
	int num;
	int count;

	protected Pair(int num) {
		super();
		this.num = num;
		this.count = num - 1;
	}

	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	@Override
	public String toString() {
		return "Pair [num=" + num + ", count=" + count + "]";
	}

}


Measured memory_bytes: 28884
#include <stdio.h>

class Dice2{
public:
	Dice2(){
		number = new int[6];
		relative = new int[55];
		relative[31] = relative[43] = relative[24] = relative[12] = 0;
		relative[3] = relative[20] = relative[52] = relative[35] = 1;
		relative[1] = relative[40] = relative[54] = relative[15] = 2;
		relative[4] = relative[10] = relative[51] = relative[45] = 3;
		relative[2] = relative[30] = relative[53] = relative[25] = 4;
		relative[21] = relative[42] = relative[34] = relative[13] = 5;
 	};
	~Dice2(){
		delete[] number;
		delete[] relative;
	};

	void setNumber(int index,int num){
		number[index] = num;
	};

	int returnRight(int top,int front){
		int top_index,front_index;
		for(int i = 0; i < 6; i++){
			if(number[i] == top)
				top_index = i;
			if(number[i] == front)
				front_index = i;
		}
		return number[relative[10*top_index+front_index]];
	}
private:
	int* number;
	int* relative;
};

int main(){
	Dice2 dice2;
	int x,q,top,front;
	for(int i = 0; i < 6; i++){
		scanf("%d",&x);
		dice2.setNumber(i,x);
	}
	scanf("%d",&q);
	for(int i = 0; i < q; i++){
		scanf("%d %d",&top,&front);
		printf("%d\n",dice2.returnRight(top,front));
	}
}






Measured memory_bytes: 2708
#include<bits/stdc++.h>
using namespace std;
#define  inf 2e18
#define  mod 1000000007
#define  bg begin()
#define  en end()
#define  ll long long int
#define  pb push_back
#define  mp make_pair
#define  vi vector<int>
#define  vll vector<long long int>
#define  vpll vector<pair<long long int,long long int> >
#define  vpii vector<pair<int,int> >
#define  vstr vector<string>
#define  mpii map<int ,int>
#define  mpll map<long long int,long long int >
#define  max3(a,b,c) max(a,max(b,c))
#define  min3(a,b,c) min(a,min(b,c))
#define  w(t) ll t; cin>>t; while(t--)
#define  vin(v,n) for(int i=0;i<n;i++){cin>>x; v.pb(x);  }
#define  for0(i,n) for(int i=0;i<n;i++)
#define  for1(i,n) for(int i=1;i<=n;i++)
#define  forv(it,v) for(auto it=v.begin();it!=v.end();it++)
#define  mem(a,val) memset(a,val,sizeof(a))
#define  Sort(vec) sort(vec.begin(),vec.end())
#define  RSort(vec) sort(vec.rbegin(),vec.rend())
#define  eb emplace_back
#define  bs binary_search
#define  lb(v,a) lower_bound(v.begin(),v.end(),a)
#define  ub(v,a) upper_bound(v.begin(),v.end(),a)
#define  deb1(x) cerr<<#x<<": "<<x<<" "<<endl
#define  deb2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define  deb3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define  deb4(a, b, c, dp) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#dp<<": "<<dp<<endl
#define  FIFO ios::sync_with_stdio(false); cin.tie(0);cout.tie(0)
#define  yes "YES"
#define  no "NO"
#define  PI 3.141592653589793238462643383279502884L
ll Ceil(ll a, ll b) {return a / b + (a % b != 0);}
ll fastModExp(ll a, ll b) { ll res = 1; while (b > 0) {if (b & 1)res = (res * a) % mod; a = (a * a) % mod; b = b >> 1;} return res;}
// 2- Dimensional vector:- vector<vector<int> > v(n, vector<int> (26, 0));
mpll mpx;
void factorize(ll n) {
    vector<ll> res;
    for (ll i = 2; i * i <= n; ++i) {
        while (n % i == 0) {
            mpx[i]++;
            n /= i;
        }
    }
    if (n != 1) {
        mpx[n]++;
    }
    return ;
}




int main() {
    ll n;
    cin >> n;
    ll count = 0;
    factorize(n);
    forv(it, mpx) {
        ll a = it->first;
        ll b = it->second;
        ll z = (sqrt(1 + 8 * b) - 1) / 2;
        count += z;
    }
    cout << count << endl;

    return 0;
}

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

using ll = long long;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin >> n;
	vector<ll> a(n+1), b(n);
	for(ll& x : a) cin >> x;
	for(ll& x : b) cin >> x;
	ll ans = 0;
	for(int i = 0; i < n; i++) {
		if(a[i] > 0) {
			int take = min(a[i], b[i]);
			ans += take;
			a[i] -= take;
			b[i] -= take;
		}
		if(a[i+1] > 0) {
			int take = min(a[i+1], b[i]);
			ans += take;
			a[i+1] -= take;
			b[i] -= take;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 1792
#[allow(unused_imports)]
use proconio::{
   fastout, input,
   marker::{Bytes, Chars, Isize1, Usize1},
};

fn main() {
   input! {
      n:usize,m:usize,
      a:[usize;m]
   }
   let sum = a.iter().sum::<usize>();
   if sum > n {
      println!("-1");
   } else {
      println!("{}", n - sum);
   }
}


Measured memory_bytes: 2264
n,m=map(int,input().split())
a=[None]*n
g=[[] for _ in range(n)]
for _ in range(m):
    l,r,d=map(int,input().split())
    g[l-1].append((r-1,d))
    g[r-1].append((l-1,-d))
for i in range(n):
    if a[i]==None:
        a[i]=0
        q=[i]
    while q:
        j=q.pop()
        for x,e in g[j]:
            if a[x]==None:
                a[x]=a[j]+e
                q.append(x)
            elif a[x]!=a[j]+e:
                print("No")
                exit()
                
print("Yes")


Measured memory_bytes: 65968
#include <iostream>
#include <vector>
#include <cstring>

using namespace std;

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

int main(){
	int n;
	while(cin >> n, n){
		int size[100];
		vector<int> vol[100];
		for(int i=0;i<n;i++){
			int offset;
			cin >> size[i] >> offset;
			vol[i].resize(size[i]);
			for(int j=0;j<size[i];j++) cin >> vol[i][(j+size[i]-offset)%size[i]];
		}
		int left = n;
		bool used[100];
		memset(used, false, sizeof(used));
		while(true){
			int prevsize = left;
			for(int i=0;i<n;i++){
				if(used[i]) continue;
				for(int j=0;j<n;j++){
					if(i==j||used[j]) continue;
					int gd = lcm(size[i], size[j]);
					if(gd==size[i]*size[j]) continue;
					vector<int> vi;
					for(int k=0;k<gd;k++)
						vi.push_back(vol[i][k%size[i]]+vol[j][k%size[j]]);
					size[i] = gd;
					vol[i] = vi;
					used[j] = true;
					left--;
				}
			}
			if(prevsize == left) break;
		}
		int ans = 0;
		for(int i=0;i<n;i++){
			if(used[i]) continue;
			int tmp = 0;
			for(int j=0;j<size[i];j++) tmp = max(tmp, vol[i][j]);
			ans += tmp;
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1752
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};

int main() {
    ll n,m;
    ll ans = 0;
    cin >> n >> m;
    ans = n*(n-1)/2;
    UnionFind uf(n);
    vector<int> a(m),b(m);
    vector<ll> ansv;
    for (int i = 0; i < m; ++i) {
        cin >> a[i] >> b[i];
        a[i]--,b[i]--;
    }
    for (int i = 0; i < m; ++i) {
        ansv.push_back(ans);
        if(!uf.issame(a[m-1-i],b[m-1-i])){
            ans -= uf.size(a[m-1-i])*uf.size(b[m-1-i]);
            uf.merge(a[m-1-i],b[m-1-i]);
        }
    }
    for (int i = 0; i < m; ++i) {
        cout << ansv[m-1-i] << endl;
    }
    return 0;
}

Measured memory_bytes: 3444
using System;
using System.Linq;

static class StringExtention {
    public static string Reversed(this string s) {
        return string.Join("", s.Reverse());
    }
}

class Program
{
	static void Main(string[] args)
	{
		// 入力
        string a = Console.ReadLine();
		string b = a.Reversed();
        
        var count = 0;
        for (int i = 0; i < a.Length; i++)
        {
            if (a[i] != b[i])
            {
                count++;
            }
        }

        Console.WriteLine(count/2);


	}
}

Measured memory_bytes: 13268
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<queue>
using namespace std;

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

    vector<long long> A(N + 1);
    for (int i = 0; i < N + 1; i++)
        cin >> A[i];

    vector<long long> B(N);
    for (int i = 0; i < N; i++)
        cin >> B[i];

    long long ans = 0;
    for (int i = 0; i < N; i++) {
        int exp = min(A[i], B[i]);
        A[i] -= exp;
        B[i] -= exp;
        ans += exp;

        exp = min(A[i + 1], B[i]);
        A[i + 1] -= exp;
        B[i] -= exp;
        ans += exp;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1792