akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define DEBUG "::"
#define REPI(itei) for(long long int i = 0,iteii=itei;i < iteii;i++)
#define REPJ(itej) for(long long int j = 0,itejj=itej;j < itejj;j++)
#define REPK(itek) for(long long int k = 0,itekk=itek;k < itekk;k++)
using namespace std;
typedef long long int ll;
int main(){
    int D;
    const int day = 25;
    cin >> D;
    cout << "Christmas";
    REPI(day-D){
        cout << " Eve";
    }
    cout << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

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

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

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

P arrange(P u) {
    if (u.fi == 0) return P(0, 1);
    if (u.se == 0) return P(1, 0);
    if (u.fi < 0) {
        u.fi = -u.fi;
        u.se = -u.se;
    }
    ll g = gcd(abs(u.fi), abs(u.se));
    u.fi /= g;
    u.se /= g;
    return u;
}

vector<ll> inv, fact, invfact;
void Mod_build(int n = 201010) {
    fact.resize(n + 1);
    inv.resize(n + 1);
    invfact.resize(n + 1);
    fact[0] = inv[0] = invfact[0] = 1;
    inv[1] = 1;
    for (ll i = 0; i < n; i++) {
        fact[i + 1] = fact[i] * (i + 1) % mod;
        if (i > 0) inv[i + 1] = mod - inv[mod % (i + 1)] * (mod / (i + 1)) % mod;
        invfact[i + 1] = invfact[i] * inv[i + 1] % mod;
    }
}
ll perm(int n, int k) {
    if (n < 0 || k < 0 || k > n) return 0;
    return fact[n] * invfact[n - k] % mod;
}
ll comb(int n, int k) {
    if (n < 0 || k < 0 || k > n) return 0;
    return (fact[n] * invfact[n - k] % mod) * invfact[k] % mod;
}
ll powmod(ll n, ll k) {
    k %= mod - 1;
    if (k < 0) k += mod - 1;
    ll ret = 1;
    while (k) {
        if (k & 1) ret = ret * n % mod;
        n = n * n % mod;
        k >>= 1;
    }
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Mod_build();
    int i, j;
    map<P, ll> ma;
    int n;
    cin >> n;
    ll a[n], b[n];
    for (i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    ll c = 0;
    for (i = 0; i < n; i++) {
        if (a[i] == 0 && b[i] == 0) {
            c++;
        } else {
            ma[arrange(P(b[i], a[i]))]++;
        }
    }
    ll ans = 1;
    for (i = 0; i < n; i++) {
        if (a[i] == 0 && b[i] == 0) continue;
        ans *= (powmod(2, ma[arrange(P(b[i], a[i]))]) + powmod(2, ma[arrange(P(-a[i], b[i]))]) + mod - 1) % mod;
        ans %= mod;
        ma[arrange(P(b[i], a[i]))] = 0;
        ma[arrange(P(-a[i], b[i]))] = 0;
    }
    cout << (ans + c - 1 + mod) % mod << endl;
}

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

int main(){
  int N, AC = 0, WA = 0, TLE = 0, RE = 0;
  string judge;
  
  cin >> N;
  
  for(int i = 0; i < N; i++){
    cin >> judge;
    if(judge == "AC")
      AC++;
    else if(judge == "WA")
      WA++;
    else if(judge == "TLE")
      TLE++;
    else if(judge == "RE")
      RE++;
  }
  
  cout << "AC x " << AC << endl;
  cout << "WA x " << WA << endl;
  cout << "TLE x " << TLE << endl;
  cout << "RE x " << RE << endl;
  
  return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
    string n;
    cin >> n;
    ll sum = 0;
    for (int i = 0; i < n.size(); i++) {
        sum += n.at(i) - '0';
    }
    if (sum % 9 == 0) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    
}


Measured memory_bytes: 3688
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

# https://qiita.com/drken/items/03c7db44ccd27820ea0d#f-問題---lcs
S = input().rstrip()
T = input().rstrip()

X = len(S) + 100
dp = [ [0 for _ in range(X)] for _ in range(X) ]

# DP作成
for i in range(len(S)):
    for j in range(len(T)):
        if S[i] == T[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j]+1)

        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j])
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j+1])

# 復元
ans = ""
i = len(S)
j = len(T)
while i > 0 and j > 0:
    if (dp[i][j] == dp[i-1][j]):
        i -= 1
    elif (dp[i][j] == dp[i][j-1]):
        j -= 1
    else:
        ans = S[i-1]+ans
        i -= 1
        j -= 1

print(ans)

Measured memory_bytes: 122460
import java.util.Scanner;

public class Main {
  
  public static void main(String[] args) {
    
    Scanner sc = new Scanner(System.in);
    
    int H = Integer.parseInt(sc.next());
    int W = Integer.parseInt(sc.next());
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());
    final long mod = 1000000007;
    combination c = new combination(H + W, mod);
    int x = B + 1;
    int y = H - A;
    long ans = 0;
    while (1 <= x && x <= W && 1 <= y && y <= H) {
      ans = (ans + c.C(x - 1 + y - 1, x - 1) * c.C(W - x + H - y, W - x) % mod) % mod;
      x++;
      y--;
    }
    System.out.println(ans);
  }
  
  static class combination {
    public int n;
    public long p;
    public long factTable[];
    public long reverceTable[];
    
    public combination(int n, long p) {
      this.n = n;
      this.p = p;
      factTable = new long[n + 1];
      factTable[0] = 1;
      for (int i = 1; i <= n; i++) {
        factTable[i] = factTable[i - 1] * i % p;
      }
      reverceTable = new long[n + 1];
      reverceTable[0] = 1;
      reverceTable[n] = 1;
      long x = factTable[n];
      long m = p - 2;
      while (m > 0) {
        if ((m & 1) == 1) {
          reverceTable[n] = reverceTable[n] * x % p;
        }
        x = x * x % p;
        m >>= 1;
      }
      for (int i = n - 1; i > 0; i--) {
        reverceTable[i] = reverceTable[i + 1] * (i + 1) % p;
      }
    }
    
    public long C(int n, int r) {
      if (r < 0 || n < r) {
        return 0;
      } else {
        return (factTable[n] * reverceTable[r] % p) * reverceTable[n - r] % p;
      }
    }
  }
  
}

Measured memory_bytes: 27348
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <string>
#include <numeric>
#include <cmath>
#include <map>
#include <iomanip>

using namespace std;

void solve(){
    string s, t;
    cin >> s >> t;
    int a, b;
    cin >> a >> b;
    string tmp;
    cin >> tmp;
    if(tmp == s) cout << --a << ' ' << b << endl;
    else cout << a << ' ' << --b << endl;
}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(16);
    
    solve();

    return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main(){
  var A,B int
  fmt.Scan(&A, &B)
  if A >= 13{
    fmt.Println(B)
  }else if A >= 6 && A <= 12{
    fmt.Println(B/2)
  }else{
    fmt.Println(0)
  }
}


Measured memory_bytes: 512
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author cherrypi59
 */

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

class DTeleporter {
public:
    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        int N;
        lint K;
        in>>N>>K;
        vc<int> A(N);
        REP(i, N) in>>A[i], A[i]--;
        int cur = 0;
        vc<int> track, used(N, 0);
        while(not used[cur]){
            track.pb(cur);
            used[cur] = 1;
            cur = A[cur];
        }
        int cy = A[track.back()], left = -1, len = LEN(track);
        REP(i, len) if(track[i]==cy){
            left = i;
            break;
        }
        if(K<=left){
            out<<track[K]+1<<'\n';
        }else{
            K -= left;
            out<<track[left+K%(len-left)]+1<<'\n';
        }
    }
};


int main() {
	DTeleporter solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 5860
#include <iostream>
using namespace std;
const int H_MAX = 100;
int main (void) {
    int H, W;

    cin >> H >> W;
    string C[H];
    for (int i = 0; i < H; i++) cin >> C[i];

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < 2; j ++) {
            cout << C[i] << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>
#include <array>
// ===============================================================
//using系
#pragma region header
using namespace std;
using lint = long long;
using ld = long double;
using ulint = unsigned long long;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr lint mod = 1000000007;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#define INF (lint)10000000000000000;
#define mod (int)1000000007
#pragma region header
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
#pragma endregion
#pragma endregion



int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s; cin >> s;
	lint a = 0;
	lint b = 0;
	lint x = 0;
	for (int i = 0; i < (int)s.size(); i++) {
		if (s[i] == 'S') a++;
		else b++;
		x = max(x, b - a);
	}
	a = 0;
	b = 0;
	lint y = 0;
	for (int i = (int)s.size() - 1; i >= 0; i--) {
		if (s[i] == 'S') a++;
		else b++;
		y = max(y, a - b);
	}
	cout << x + y << endl;

	return 0;
}

Measured memory_bytes: 3684
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    if(s[3]==s[2]&&s[4]==s[5])
	cout<<"Yes";
	else
	cout<<"No";    
	return 0;
}


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

int main(){
  
  int N, count = 1;
  cin >> N;
  vector<int> d(N);  
  for (int i=0; i<N; i++)
    cin >> d.at(i);
  
  for (int i=0; i<N-1; i++){
    for (int j=0; j<N-1; j++){
      if(d.at(j) < d.at(j+1))
        swap(d.at(j), d.at(j+1));
    }
  }
  
  for (int i=0; i<N-1; i++){
    if( d.at(i) > d.at(i+1) )
      count++;
  }
  
  cout << count << endl;
  
}

Measured memory_bytes: 256
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int n, pm, pe, pj;
    for(;;){
      n = sc.nextInt(); if(n == 0)break;
      for(;n-- > 0;out.println(solve(pm, pe, pj))){
        pm = sc.nextInt(); pe = sc.nextInt(); pj = sc.nextInt();
      }
    }
    sc.close();
  }
  private static String solve(int m, int e, int j){
    if(m == 100)return "A";
    if(e == 100)return "A";
    if(j == 100)return "A";
    if(m + e >= 180)return "A";
    if(m + e + j >= 240)return "A";
    if(m + e + j >= 210)return "B";
    if(m + e + j >= 150 && m >= 80)return "B";
    if(m + e + j >= 150 && e >= 80)return "B";
    return "C";
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}

Measured memory_bytes: 38256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <map>
using namespace std;

#define INF 1e9
#define LLINF 1e18
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

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


int main() {
    int a, b, ans;
    cin >> a >> b;
    ans = a + b;
    if (ans >= 24) ans -= 24;
    cout << ans << endl;
}

Measured memory_bytes: 256
//This program is written by Brian Peng.
#pragma GCC optimize("Ofast","inline","no-stack-protector")
#include<bits/stdc++.h>
using namespace std;
#define Rd(a) (a=read())
#define Gc(a) (a=getchar())
#define Pc(a) putchar(a)
int read(){
	int x;char c(getchar());bool k;
	while(!isdigit(c)&&c^'-')if(Gc(c)==EOF)exit(0);
	if(c^'-')k=1,x=c&15;else k=x=0;
	while(isdigit(Gc(c)))x=(x<<1)+(x<<3)+(c&15);
	return k?x:-x;
}
void wr(int a){
	if(a<0)Pc('-'),a=-a;
	if(a<=9)Pc(a|'0');
	else wr(a/10),Pc((a%10)|'0');
}
signed const INF(0x3f3f3f3f),NINF(0xc3c3c3c3);
long long const LINF(0x3f3f3f3f3f3f3f3fLL),LNINF(0xc3c3c3c3c3c3c3c3LL);
#define Ps Pc(' ')
#define Pe Pc('\n')
#define Frn0(i,a,b) for(int i(a);i<(b);++i)
#define Frn1(i,a,b) for(int i(a);i<=(b);++i)
#define Frn_(i,a,b) for(int i(a);i>=(b);--i)
#define Mst(a,b) memset(a,b,sizeof(a))
#define File(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout)
#define N (200010)
int n,a[N],b[N],da[N],db[N*3],z[N*3];
void gz(int*s,int n);
signed main(){
	db[Rd(n)]=-1;
	Frn0(i,0,n)Rd(a[i]);
	Frn0(i,0,n)da[i]=a[i]^a[(i+1)%n];
	Frn0(i,0,n)Rd(b[i]);
	Frn0(i,0,n)db[i]=b[i]^b[(i+1)%n];
	copy(da,da+n,db+n+1),copy(da,da+n-1,db+(n<<1)+1),gz(db,n*3);
	Frn0(i,0,n)if(z[i+n+1]==n)wr(i),Ps,wr(a[i]^*b),Pe;
	exit(0);
}
void gz(int*s,int n){
	int l(0),r(0);
	Frn0(i,1,n){
		if(i<=r&&z[i-l]<=r-i){z[i]=z[i-l];continue;}
		for(r=max(r,l=i);r<n&&s[r]==s[r-l];++r);
		z[i]=(r--)-l;
	}
}

Measured memory_bytes: 10496
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for (int i = 0; i < (n); ++i)
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; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
struct UnionFind {
    vector<int> par,siz; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) , siz(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
        for(int i = 0; i < N; i++) siz[i] = 1;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[ry] = rx; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
        siz[rx]+=siz[ry];
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
    int size(int x){
        return siz[root(x)];
    }
};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;cin >> n >> m;
    vector<ll> a(n);
    rep(i,n){
        cin >> a[i];
    }
    UnionFind uf(n);
    rep(i,m){
        int x,y;cin >> x >> y;
        uf.unite(x,y);
    }
    int cnt=0;
    vector<vector<ll>> b(n);
    rep(i,n){
        if(uf.root(i)==i){
            cnt++;
        }
        b[uf.root(i)].push_back(a[i]);
    }
    if((cnt-1)*2>n){
        cout << "Impossible" << endl;
        return 0;
    }
    if(cnt==1){
        cout << 0 << endl;
        return 0;
    }
    ll ans=0;
    priority_queue<ll,vector<ll>,greater<ll>> pq;
    rep(i,n){
        if(!b[i].size()){
            continue;
        }
        sort(b[i].begin(),b[i].end());
        ans+=b[i][0];
        for(int j=1;j<b[i].size();j++){
            pq.push(b[i][j]);
        }
    }
    for(int i=0;i<cnt-2;i++){
        ans+=pq.top();
        pq.pop();
    }
    cout << ans << endl;
}

Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vl  = vector<ll>;
using vi  = vector<int>;
#define _GLIBCXX_DEBUG
#define IO_STREAM cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(ll i=sta;i<end;++i)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll INF = 1000000000000000;
const ll MOD = 1000000007;
const double PI = acos(-1);
//||
#define DBG(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<endl
//DBG("","","","");


signed main(){
	IO_STREAM;
	ll N,M,K;
	cin>>N>>M>>K;
	vl A(N+1),B(M+1);
	rep(i,1,N+1){
		cin>>A[i];
	}
	ll time=0;
	rep(i,1,M+1){
		cin>>B[i];
		time+=B[i];
	}
	ll ans=0;
	ll j=M;
	
	rep(i,0,N+1){
		time+=A[i];
		while(time>K&&j>0){
			time-=B[j];
			j--;
		}
		if(time>K) break;
		ans=max(ans,i+j);
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 6324
def solve(A):
  s,d,v = A
  C = [-1 for _ in [0]*(n+1)]
  c = 1
  C[s] = c
  SP = M[s]
  while 1:
    if SP==[]: return "NA"
    c += 1
    X = []
    for p in SP:
      if C[p]>0: continue
      C[p] = c
      X += [e for e in M[p] if C[e]<0 and e not in SP]
      if p==d: return [C[d],"NA"][C[p]>v]
    SP = X

n = int(raw_input())
M = {}

for _ in [0]*n:
  x = map(int, raw_input().split())
  M[x[0]] = x[2:]
for _ in [0]*int(raw_input()):
  print solve(map(int,raw_input().split()))

Measured memory_bytes: 4276
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;cin>>a>>b;
  vector<int> d(200000,0);
  for(int i=10000;i<100000;i++){
    d[i]=d[i-1];
    string s=to_string(i);
    string t=s;
    reverse(s.begin(),s.end());
    if(s==t) d[i]++;
  }
  cout<<d[b]-d[a-1]<<endl;
}

Measured memory_bytes: 1024
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define fi first
#define se second
#define rep(i,N) for(int i=0;i<(int)N;++i)
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

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

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

ll waz = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (waz - inv(waz % x) * (waz / x)) % waz;
        if (a >= 0) { return a; }
        else { return waz + a; }
    }
}

void printVector(const vector<int>& vec) {
    for (int value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<ll> p;

ll phi(ll x) {
    ll a = x;
    ll b = x;
    for (ll k = 0; k != p.size(); ++k) {
        if (a % p[k] == 0) {
            while (a % p[k] == 0) {
                a /= p[k];
            }
            b = b / p[k] * (p[k] - 1);
        }
        if (a == 1) { break; }
    }
    return b;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

int main()
{
    IO;

    ll A, B; cin >> A >> B;

    cout << lcm(A, B) << endl;

}

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

int main(){
  int n,l;
  string s[110];
  cin>>n>>l;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }
  sort(s,s+n);
  for(int i=0;i<n;i++){
    cout<<s[i];
  }
}


Measured memory_bytes: 256
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<stack>
#include<unordered_map>
#include<bitset>
#include<limits>
#include<complex>
#include<array>
#include <iostream>

using namespace std;
#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define REP(i,n) rep(i,0,n)
#define ll long long
int main()
{
  ll N,K;
  cin >> N >> K;
  ll A[200050];
  ll B[200050];
  ll X = 0;
  ll Y = 0;
  for(ll i = 0;i < N;i++)
  {
    cin >> A[i];
    B[i] = -1;
  }
  ll now = 0;
  while(true)
  {
    X++;
    if(B[A[now]-1] ==1) Y++;
    B[A[now]-1]++;
    now = A[now]-1;
    if(B[A[now]-1] > 1) break;
  }
  now =0;
  ll L =0;
  if(X-Y >= K) L =K;
  else L = X -Y +(K-X+Y)% Y;
  for(ll i =0;i<L;i++)
    now=A[now]-1;
  
  cout << now+1 << endl;
   
}





Measured memory_bytes: 6652
#include<bits/stdc++.h>
using namespace std;
using hatugen = pair<int, int>;

int N;
vector<vector<hatugen>> V;

bool judge(int bit){
    for(int i = 0; i < N; i++){
        if(!(bit & (1 << i))){
            continue;
        }
        for(hatugen xy : V.at(i)){
            int x = xy.first;
            int y = xy.second;
            if(y == 1 && !(bit & (1 << x))){
                return false;
            }
            if(y == 0 && (bit & (1 << x))){
                return false;
            }
        }
    }
    return true;
}

int main(){
    int A;
    cin >> N;
    V.resize(N);
    for(int i = 0; i < N; i++){
        cin >> A;
        V.at(i).resize(A);
        for(int j = 0; j < A; j++){
            cin >> V.at(i).at(j).first >> V.at(i).at(j).second;
            --V.at(i).at(j).first;
        }
    }
    int ans = 0;
    for(int bit = 0; bit < (1 << N); bit++){
        if(judge(bit)){
            int b = 0;
            for(int i = 0; i < N; i++){
                if(bit & (1 << i)){
                    b++;
                }
            }
            ans = max(ans, b);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <cmath>
using namespace std;
//typedef __int64 LL;
typedef long long int LL;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef pair<int,int> P;
//typedef pair<LL,LL> PL;

const int MOD=1000000007;
int INF=100100100;


int main(){
	LL a,b,c;cin>>a>>b>>c;
	LL ans=0;
	if(a==b && b==c && a%2==0)
	{
		cout<<-1<<"\n";
		return 0;
	}
	while(a%2==0 && b%2==0 && c%2==0)
	{
		LL sum=a+b+c;
		a=(sum-a)/2;	
		b=(sum-b)/2;
		c=(sum-c)/2;
		ans++;
	}
	cout<<ans<<"\n";
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
 
int main(){
    ll k;
    cin>>k;
    ll s=0,i,j,l;
    for(i=1;i<=k;i++){
        for(j=1;j<=k;j++){
            for(l=1;l<=k;l++){
                s=s+(__gcd(i,__gcd(j,l)));         
            }
        }
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 3636
nl = list(map(int, input().split()))
n = nl[0]
l = nl[1]

aji = []
aji_abs = []
for i in range(n):
    aji.append(l + i)
    aji_abs.append(abs(l + i))

if min(aji_abs) == 0:
    print(sum(aji))
elif max(aji) < 0:
    print(sum(aji) - max(aji))
else:
    print(sum(aji) - min(aji))

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int A1 = sc.nextInt();
    		final int A2 = sc.nextInt();
    		final int A3 = sc.nextInt();

    		if (A1 + A2 + A3 >= 22) {
    			System.out.println("bust");
    		} else {
    			System.out.println("win");
    		}

    	} finally {
    		sc.close();
    	}
    }
}


Measured memory_bytes: 23124
// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>

using namespace std;

#define rep(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool smin(T &a, const T &b)   { return a > b ? a = b : a;    }
template<typename T> inline bool smax(T &a, const T &b)   { return a < b ? a = b : a;    }

typedef long long LL;

const int N = (int) 0, mod = (int) 0;

int main() {
	long long ways = 0;
	int odd = 0, even = 0;
	int n, p;
	cin >> n >> p;
	for (int j = 0; j < n; ++j) {
		int x;
		cin >> x;
		odd += x & 1;
		even += ~x & 1;
	}
	ways = (1ll << (max(odd, 1) - 1)) * (1ll << even);
	if (p) ways = (1ll << n) - ways;
	cout << ways << endl;
}





Measured memory_bytes: 256
fun main(arg: Array<String>) {
    val N = nextInt()
    val S1 = next()
    val S2 = next()
    val MOD = 1000000007L
    var ans = 0L
    var tate = false
    var n = 0
    fun isTate(n: Int) = S1[n] == S2[n]
    while (n < N) {
        if (ans == 0L) {
            if (isTate(n)) {
                ans = 3
                tate = true
            } else {
                ans = 6
                tate = false
            }
        } else if (isTate(n)) {
            ans *= if (tate) 2 else 1
            tate = true
        } else {
            ans *= if (tate) 2 else 3
            tate = false
        }
        ans %= MOD
        n += if (tate) 1 else 2
    }
    println(ans)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfLong() = listOfString().map { java.lang.Long.parseLong(it) }


Measured memory_bytes: 31608
import java.io.*;
   
class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        //String s = "3 5";
        String[] str = s.split(" ");
        int x = Integer.parseInt(str[0]);
        int y = Integer.parseInt(str[1]);
          
        int z = x * y;
        int w = (x + y ) * 2;
        System.out.println(z+" "+w);
    }
}
 

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

using namespace std;

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

  int L = N / 2;
  int R = L + 1;
  int min_L = N;
  vector<pair<int, int>> P;
  for (int d = 1; d < (N + 1) / 2; d += 2) {
    if (P.size() < M) {
      P.push_back({L + 1, R + 1});
    }
    min_L = min(min_L, L);
    L--;
    R++;
  }

  vector<int> D;
  for (int d = 2; d < (N + 1) / 2; d += 2) {
    D.push_back(N - d);
  }
  sort(D.begin(), D.end());

  L = min_L - 1;
  for (int d : D) {
    if (P.size() < M) {
      P.push_back({L + 1, L + d + 1});
    }
    L--;
  }

  sort(P.begin(), P.end());
  int offset = P[0].first - 1;
  for (auto& p : P) {
    p.first -= offset;
    p.second -= offset;
  }

  for (auto& p : P) {
    cout << p.first << " " << p.second << endl;
  }

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<double> a(n);
  double ans = 0;
  rep(i,n){
    cin >> a[i];
    ans += 1/a[i];
  }
  cout << fixed << setprecision(10);
  cout << 1/ans << endl;
}


Measured memory_bytes: 256
s = gets.chomp
t = gets.chomp

index = t.split("").uniq.map {|c| s.index c}
if index.include? nil
  puts "-1"
  exit
end

search_fieald = s + s
length = search_fieald.length

cache = {}
search_fieald.split("").each_with_index do |ss, i|
  cache.has_key?(ss) ? cache[ss].push(i) : cache[ss] = [i]
end

unit = 0
current_pos = 0

t.split("").each do |tp|
  find_pos = cache[tp].bsearch {|x| x >= current_pos }
  if find_pos.nil?
    unit += 1
    current_pos = cache[tp][0] + 1
  else
    current_pos = find_pos + 1
  end
end

puts "#{unit * length + current_pos}"


Measured memory_bytes: 25084
#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>

#define MAX 200

int S[MAX];
int top=0;

bool isEmpty(){
  if(top ==0){
    return true;
  }
  else return false;
}

void push(int x){
  top++;
  S[top]=x;
}

int pop(){
  if(isEmpty()){
    fprintf(stderr,"underflow\n");
    exit(EXIT_FAILURE);
    
  }
  else{
    top = top-1;
    return S[top+1];
  }
}





int main () {
  char met[MAX];
  int a,b;
  while(scanf("%s",met)!=EOF){

    if(met[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(met[0]=='-'){
      a=pop();
      b=pop();
      push(b-a);
    }
    else if(met[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else push(atoi(met));
  }

  printf("%d\n",pop());

  return 0;
}
      
      



Measured memory_bytes: 2108
import numpy as np
N,K = map(int,input().split())
h = list(map(int,input().split()))
h = np.array(h)
dp = [0]*N
dp = np.array(dp)
dp[1]=abs(h[1]-h[0])
for i in range(1,N):
  j = max(0,i-K)
  dp[i] = min(dp[j:i]+abs(h[i]-h[j:i]))
print(dp[N-1])

Measured memory_bytes: 22908
#include <algorithm>
#include <string.h>
#include <iostream>
#include <stdio.h>

using namespace std;

typedef long long ll;

const ll N = 2e5 + 10;

ll n;
ll a[N];


int main() {
	cin >> n;
	for (ll i = 1; i <= n; i++) {
		cin >> a[i];
	}

	ll res = a[1];
	for (ll i = 2; i <= n; i++) res ^= a[i];

	for (ll i = 1; i <= n; i++) {
		cout << (res ^ a[i]) << " ";
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 200010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 29;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

const string S = "YAKI";
void solve() {
	string str;
	cin >> str;
	if(sz(str) <= 3) {
		cout << "No\n";
	}
	else {
		bool ok = true;
		rep(i, 0, 4) {
			if(str[i] != S[i]) {
				ok = false;
				break;
			}
		}
		if(ok) cout << "Yes\n";
		else cout << "No\n";
	}		
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
#ifdef LOCAL
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}

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

#define pp push_back
#define pf push_front
#define mp make_pair
#define fs first
#define sc second
#define sf scanf

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;

const int N = (int) 17;
const int INF = (ll) 2e9 + 7;

int n, m, x;

int a[N][N];
int c[N];
int k[N];

ll f(int i) {
	if (i > n) {
		for (int j = 1; j <= m; ++j) {
			if (k[j] < x) return INF;
		}
		return 0;
	}

	for (int j = 1; j <= m; ++j) {
		k[j] += a[i][j];
	}
	ll u = f(i + 1) + c[i];
	for (int j = 1; j <= m; ++j) {
		k[j] -= a[i][j];
	}
	ll v = f(i + 1);
	return min(u, v);
}

int main(int argc, char *argv[])
{
	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);

	sf("%d %d %d", &n, &m, &x);
	for (int i = 1; i <= n; ++i) {
		sf("%d", &c[i]);
		for (int j = 1; j <= m; ++j) {
			sf("%d", &a[i][j]);
		}
	}

	ll ans = f(1);
	if (ans >= INF) ans = -1;
	printf("%lld\n", ans);

	return 0;
}


Measured memory_bytes: 3828
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define upperlimit 1000100
#define INF 1000000100
#define INFL 1000000000000000100
#define eps 1e-8
#define endl '\n'
#define sd(n) scanf("%d",&n)
#define slld(n) scanf("%lld",&n)
#define pd(n) printf("%d",n)
#define plld(n) printf("%lld",n)
#define pds(n) printf("%d ",n)
#define pllds(n) printf("%lld ",n)
#define pdn(n) printf("%d\n",n)
#define plldn(n) printf("%lld\n",n)
#define REP(i,a,b) for(i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define clr(a) memset(a,0,sizeof(a))
using namespace std;
 
ll gcd(ll n1,ll n2){
    if(!n1)return n2;
    if(!n2)return n1;
    if(n1%n2==0)return n2;
    return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent){
    base%=mod;
    ll ans=1;
    while(exponent){
        if(exponent&1)ans=(ans*base)%mod;
        base=(base*base)%mod;
        exponent/=2;
    }
    ans%=mod;
    return ans;
}
int main()
{
    string s,t;
    cin>>s>>t;
        int n,m;
        n=s.size();
        m=t.size();
        if(n<m){ cout<<" UNRESTORABLE"<<endl;
                return 0;
        }
        else{  
                 int r; 
             for(int i=n-m;i>=0;i--){
                  r=1;
                  for(int j=0;j<m;j++){ 
                         if(s[i+j]!=t[j] && s[i+j]!= '?') r=0 ;
                          
                  }
                  if(r==1){
                         for(int k=0;k<m;k++){
                                s[i+k]=t[k];
                         } 
                         for(int l=0 ; l<n;l++){
                                 if( s[l]=='?' )s[l]='a';
                         }
                         cout<<s<<endl;
                         return 0; 
                  }
             }
             if(r==0)cout<<"UNRESTORABLE"<<endl;
             return 0;
        } 

}


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

 
int main()
{
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;
 
	string res = "XXX";
	res[0] = toupper(s1[0]);
	res[1] = toupper(s2[0]);
	res[2] = toupper(s3[0]);
 
	cout << res << endl;
 
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
using namespace std;
int n;
long long a[100005],b[100005],add;
int main()
{
	scanf("%d",&n);for(int i=1;i<=n;++i) scanf("%lld%lld",&a[i],&b[i]);
	for(int i=n;i;--i) {
		long long mod=(add+a[i])%b[i];
		if(mod) add+=b[i]-mod;
	}
	printf("%lld\n",add);
	return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<ll> A(N), B(N);
    rep(i, N) cin >> A[i] >> B[i];
    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    ll ans = 0;
    rep(i, N) ans += (B[i] - (A[i] + ans) % B[i]) % B[i];
    cout << ans << endl;
}

Measured memory_bytes: 4824
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<set>
using namespace std;
const int inf=2147483647,dx[]={-1,0,1,0},dy[]={0,-1,0,1};
const int N=100005,M=1000005,mod=1000000007;
const long long llinf=9223372036854775807ll;
int n,m;
char ch;
bool a[405][405],clr,u[405][405];
vector<pair<int,int> > v;
long long ans,res,cnt;
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
		{
			cin>>ch,a[i][j]=((ch=='#')?true:false);
			if(a[i][j])
				v.push_back(make_pair(i,j));
		}
	for(int i=0;i<v.size();i++)
	{
		if(u[v[i].first][v[i].second])
			continue;
		queue<pair<int,int> > q;
		while(!q.empty())
			q.pop();
		clr=true;
		cnt++;
		q.push(make_pair(v[i].first,v[i].second));
		u[v[i].first][v[i].second]=true;
		while(!q.empty())
		{
			int len=q.size();
			clr=!clr;
			for(int j=1;j<=len;j++)
			{
				pair<int,int> c=q.front();
				q.pop();
				for(int d=0;d<4;d++)
				{
					int xx=c.first+dx[d],yy=c.second+dy[d];
					if(a[xx][yy]==clr&&!u[xx][yy]&&xx>0&&xx<=n&&yy>0&&yy<=m)
					{
						q.push(make_pair(xx,yy)),u[xx][yy]=true;
						if(!clr)
							res++;
						else
							cnt++;
					}
				}
			}
		}
		ans+=(res*cnt);
		res=cnt=0;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 2548
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define all(s) s.begin(),s.end()
#define pb push_back
#define uno unordered_map
#define pi 3.1415926536
#define dig(a) fixed<<setprecision(a)
#define foreach(var,i) for(auto i = var.begin();i!=var.end();i++)
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL);
ll power(ll a, ll n) {ll res = 1; while (n) {if (n % 2) {res *= a;} n >>= 1; a *= a;} return res;}
ll powerm(ll a, ll n, ll m) {ll res = 1; while (n) {if (n % 2) {res = (res * a) % m;} n >>= 1; a = (a * a) % m;} return res;}
const int M=1e9+7;
ll mod(ll x){
      return ((x%M + M)%M);
}
ll add(ll a, ll b){
      return mod(mod(a)+mod(b));
}
ll mul(ll a, ll b){
      return mod(mod(a)*mod(b));
}

int main(){
	fast();
	int t=1;
	//cin>>t;
	while(t--){
		int x,y;
		cin>>x>>y;
		if(y>=2*x && y<=4*x){
		cout<<(y%2==0?"Yes":"No")<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
		
	}
	
	return 0;
}


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

int main(void){
	long long N,M;
	cin >> N >> M;
	//まずSを消費する
	//SがN個なので・・・N*2個のMを消費する。
	long long ans = 0;
	if((N*2)<=M){
		ans += N;
		M -= (2*N);
		ans += (M/4);
	}else{
		ans += M/2;
	}
	cout << ans;
}

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

int main()
{
    int h, w;
    cin >> h >> w;
    char b[h][w];
    for (int i = 0; i < h; i++)
        for (int j = 0; j < w; j++)
            cin >> b[i][j];

    int dh[4] = {-1, 1, 0, 0};
    int dw[4] = {0, 0, 1, -1};

    int ans = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (b[i][j] == '.')
            {
                queue<pair<int, int>> q;
                q.push(make_pair(i, j));
                vector<vector<bool>> visited(h, vector<bool>(w, 0));
                visited[i][j] = 1;
                int step[h][w];
                step[i][j] = 0;
                int maxp = 0;
                while (!q.empty())
                {
                    pair<int, int> cr = q.front();
                    maxp = max(maxp, step[cr.first][cr.second]);
                    q.pop();
                    for (int i = 0; i < 4; i++)
                    {
                        int nh = cr.first + dh[i];
                        int nw = cr.second + dw[i];
                        if (nh > h - 1 || nh < 0 || nw > w - 1 || nw < 0 ||
                            b[nh][nw] == '#' || visited[nh][nw] == 1)
                            continue;
                        else
                        {
                            q.push(make_pair(nh, nw));
                            visited[nh][nw] = 1;
                            step[nh][nw] = step[cr.first][cr.second] + 1;
                        }
                    }
                }
                ans = max(ans, maxp);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.141592653589793
#define debug(x) cout << #x << " = " << x << '\n';
using namespace std;


bool f(pair<int, int> a, pair<int, int> b) {
    return a.second < b.second;
}

int main() {
//    cout << fixed << setprecision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);


    int n;
    cin >> n;
    pair<int, int> a[n];
    for (int i = 0; i < n; i++) {
        int x, l;
        cin >> x >> l;
        a[i] = mp(x - l, x + l);
    }

    sort(a, a + n, f);
    int dp[n];
    dp[0] = 1;
    int ind = 0;
    for (int i = 1; i < n; i++) {
        dp[i] = dp[i - 1];
        while (ind < i && a[ind].second <= a[i].first) ++ind;
        if (ind) dp[i] = max(dp[i], dp[ind - 1] + 1);
    }

    cout << dp[n - 1];
}

Measured memory_bytes: 1408
import java.util.*;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int[] k = new int[n-1];

        for(int i = 1 ; i <= n ; i++){
            for(int j = i+1 ; j <= n ; j++){
                k[Math.min(j-i, Math.abs(i-x)+1+Math.abs(j-y))-1]++;
            }
        }

        StringBuilder strb = new StringBuilder();
        for(int num : k){
            strb.append(""+num+"\n");
        }
        System.out.println(strb.toString());
    }
}


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

#define int long long
#define ct(n) cout << n << endl;
#define cts(n) cout << n << " ";
#define cte cout << endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define repo(i,o,n) for(int i=o;i<n;i++)
#define repm(i,n) for(int i=n-1;i>=0;i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define vcopy(v1,v2) copy((v1).begin(), (v1).end(), back_inserter((v2)));
#define pb(n) push_back(n);

int a,b;

main() {
    cin >> a >> b;
    ct((a+b)%24)
}




Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

int main(int argc, const char * argv[]) {
  
  int N, Q;
  cin >> N >> Q;
  string S;
  cin >> S;
  
  vector<int> accum(N, 0);
  for (int i=1; i<N; i++) {
    if (S[i-1] == 'A' && S[i] == 'C') {
      accum[i] = accum[i-1]+1;
    } else {
      accum[i] = accum[i-1];
    }
  }
  
  int l, r;
  for (int i=0; i<Q; i++) {
    cin >> l >> r;
    cout << accum[r-1]-accum[l-1] << endl;
  }
  return 0;
}

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

#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028L;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N;
pair<string, pint> res[110000];
signed main() {
    cin >> N;
    rep(i, N) {
        cin >> res[i].first >> res[i].second.first;
        res[i].second.first *= -1;
        res[i].second.second = i + 1;
    }
    sort(res, res + N);
    rep(i, N) { cout << res[i].second.second << endl; }
}


Measured memory_bytes: 2816