akhauriyash/Code-Regression huggingface dataset:
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*
cout<<fixed<<setprecision(20);
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=998244353;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,i;cin>>n;
	vector<int>a(n);
	for(i=0;i<n;i++){cin>>a[i];a[i]%=n;}
	vector<char>zyo(n);
	//zy 0->まだ 1-見ている 2-だめ 3->成功
	for(i=0;i<n;i++){
		//for(int j=0;j<n;j++){cerr<<(int)zyo[j];}cerr<<endl;
		if(zyo[i]!=0){continue;}
		int gen=i,acpt=1;zyo[gen]=1;
		while(-1){
			gen+=a[gen];gen%=n;
			if(zyo[gen]==1){acpt=gen;break;}
			if(zyo[gen]>=2){acpt=-1;break;}
			zyo[gen]=1;
		}
		if(acpt!=-1){
			//cerr<<"d"<<acpt<<i<<endl;
			gen=acpt;
			while(zyo[gen]==1){zyo[gen]=3;gen+=a[gen];gen%=n;}
		}
		gen=i;
		while(zyo[gen]==1){zyo[gen]=2;gen+=a[gen];gen%=n;}
	}
	int ans=0;
	for(i=0;i<n;i++){if(zyo[i]==3){ans++;}}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3512
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

s = sum(b)
for i in range(len(a)-1):
    if a[i] + 1 == a[i+1]:
        s = s + c[a[i]-1]

print(s)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<P>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>inline bool chmax(T &a, T b){if (a < b){a = b;return 1;}return 0;}
template <typename T>inline bool chmin(T &a, T b){if (a > b){a = b;return 1;}return 0;}

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

    ll one=0,zero=0;
    rep(i,n){
        if(s[i]=='0') zero++;
        else one++;
    }

    cout<<2*min(one,zero)<<endl;
    return 0;
}

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

int main(){
	int i, h, m[3] = {};
	for(i = 0; i < 10; ++i){
		cin >> h;
		if( m[2] >= h )
			continue;
		else if( m[1] >= h )
			m[2] = h;
		else if( m[0] >= h ){
			m[2] = m[1];
			m[1] = h;
		}else{
			m[2] = m[1];
			m[1] = m[0];
			m[0] = h;
		}
	}

	cout << m[0] << "\n" << m[1] << "\n" << m[2] << "\n";
	
	return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
int A[100000];
int n;

int chk(int m){
	int x = m;
	for (int i=0;i<n;i++){
		x = A[i] - x;
	}
	return m-x;
}

void pans(int m){
	int x = m;
	for (int i=0;i<n;i++){
		printf("%d ",2*x);
		x = A[i] - x;
	}
}
int main(){
	cin >> n;
	
	for (int i=0;i<n;i++){
		cin >> A[i];
	}
	
	int l=0,r=1000000000;
	while (l<=r){
		int m = (l+r)/2;
		if (chk(m)<0) l = m+1;
		else if (chk(m)>0) r = m-1;
		else {
			pans(m);
			break;
		}
	}

	
	return 0;
}

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

const int MAXN = 1000001;

int spf[MAXN];

void sieve()  {
  spf[1] = 1;
  for (int i = 2; i < MAXN; i++)

    spf[i] = i;

  for (int i = 4; i < MAXN; i += 2)
    spf[i] = 2;

  for (int i = 3; i * i < MAXN; i++)  {
    if (spf[i] == i) {
      for (int j = i * i; j < MAXN; j += i)
        if (spf[j] == j)
          spf[j] = i;
    }
  }
}

vector<int> getFactorization(int x)  {
  vector<int> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    cin >> a[i];
  int gcd_ = a[0];
  for (int i = 0; i < n; i++)
    gcd_ = __gcd(a[i], gcd_);
  sieve();
  set<int> s;
  bool ok = true;
  for (int i = 0; i < n; i++) {
    vector<int> primes = getFactorization(a[i]);
    for (int p : primes) {
      if (s.count(p)) {
        ok = false;
        break;
      }
    }
    for (int p : primes)
      s.insert(p);
  }
  if (ok)
    cout << "pairwise coprime";
  else if (gcd_ == 1)
    cout << "setwise coprime";
  else
    cout << "not coprime";
  return 0;
}

Measured memory_bytes: 14808
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
typedef long long ll;
typedef unsigned long long ull;
int X, Y, Z;
int main(){
	cin.tie(0);
	cin.sync_with_stdio(0);
	cin >> X >> Y >> Z;
	swap(X, Y); swap(X, Z);
	cout << X << " " << Y << " " << Z << nl;
	return 0;
}

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

int main() {
    int H, W, N;
    cin >> H >> W >> N;
    vector<int> C(N);
    for (int i = 0; i < N; i++) cin >> C[i];

    vector<vector<int>> A(H, vector<int>(W));
    int cnt = 0;
    for (int i = 0; i < H; i++) {
        if (i % 2 == 0) {
            for (int j = 0; j < W; j++) {
                A[i][j] = cnt + 1;
                C[cnt]--;
                if (C[cnt] == 0) cnt++;
            }
        }
        else {
            for (int j = W - 1; j >= 0; j--) {
                A[i][j] = cnt + 1;
                C[cnt]--;
                if (C[cnt] == 0) cnt++;
            }
        }
    }

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W - 1; j++) {
            cout << A[i][j] << " ";
        }
        cout << A[i][W - 1] << endl;
    }
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;


using namespace std;

#define debug(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(int i=0;i<(int)(n);i++)
#define foi(i,k,n) for(int i=(k); i<(int)(n); i+=1)
#define fod(i,n,k) for(int i=k; i>=(int)n; i-=1)
#define fast_io ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define all(x) x.begin(), x.end()
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define endl "\n"

#define int long long
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

#define fir first
#define sec second
#define pb push_back
#define mp make_pair

typedef long long llint;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<llint> VL;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MII;
typedef set<int> SI;
string tostr(int n) {stringstream rr;rr<<n;return rr.str();}
llint toint(string s) {stringstream ss(s); llint x; ss >> x; return x;}
//typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//gp_hash_table<string, llint> table;


//int mpow(llint base, llint exp) {
  //base %= MOD;
  //llint result = 1;
  //while (exp > 0) {
    //if (exp & 1) result = ((llint)result * base) % MOD;
    //base = ((llint)base * base) % MOD;
    //exp >>= 1;
  //}
  //return result;
//}


//void makegraph(int n, int m){
	//int i, u, v;
	//while(m--){
		//cin>>u>>v;
		//u--, v--;
		//g[u].pb(v);
		//g[v].pb(u);
	//}
//}

//void dfs(int u, int par){
	//for(int v:g[u]){
		//if (v == par) continue;
		//dfs(v, u);
	//}
//}


// ------------------------------------------------------------------ILB----------------------------------------------------------------  //



void solve(){
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	auto v = {a * c, b * c, a * d, b * d};
	cout << *max_element(all(v));
}




int32_t main() {
	fast_io;
    int t = 1;
    //cin >> t;
    //int xx = 0
    while(t--) {
		//xx++;
		//cout << "Case ";
      solve();
    }
    return 0;
}



Measured memory_bytes: 3668
#include<iostream>
using namespace std;
const int INF = 1e9;

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

    int h[n], ans[n+2];
    for(int i = 0; i < n; i++)  cin >> h[i], ans[i] = INF;
    
    ans[0] = 0;

    for(int i = 0; i < n; i++){
        ans[i+1] = min(ans[i+1], ans[i] + abs(h[i]-h[i+1]));
        ans[i+2] = min(ans[i+2], ans[i] + abs(h[i]-h[i+2]));
    }

    cout << ans[n-1] << endl;

    return 0;
}

Measured memory_bytes: 1024
# https://atcoder.jp/contests/abc138/tasks/abc138_d

import sys
input = sys.stdin.readline
from copy import deepcopy


class Graph:
    def __init__(self, n, dictated=False, decrement=True, edge=[]):
        self.n = n
        self.dictated = dictated
        self.decrement = decrement
        self.edge = [set() for _ in range(self.n)]
        self.parent = [-1]*self.n
        self.info = [-1]*self.n
        for x, y in edge:
            self.add_edge(x,y)

    def add_edge(self, x, y):
        if self.decrement:
            x -= 1
            y -= 1
        self.edge[x].add(y)
        if self.dictated == False:
            self.edge[y].add(x)

    def add_adjacent_list(self, i, adjacent_list):
        if self.decrement:
            self.edge[i] = set(map(lambda x:x-1, adjacent_list))
        else:
            self.edge[i] = set(adjacent_list)

    def dfs2(self, info, start, goal=-1, time=0, save=False):
        """
        :param info: 各頂点の付加情報
        :param start: スタート地点
        :param goal: ゴール地点
        :param save: True = 前回の探索結果を保持する
        :return: ゴール地点までの距離。存在しなければ -1
        """

        if self.decrement:
            start -= 1
            goal -= 1
        # if not save:
        #     self.parent = [-1] * self.n
        #
        edge2 = deepcopy(self.edge)


        p, t = start, time
        self.parent[p] = -2
        while True:
            if edge2[p]:
                q = edge2[p].pop()
                if q == self.parent[p] and not self.dictated:
                    """ 逆流した時の処理 """
                    """"""""""""""""""""
                    continue
                if self.parent[q] != -1:
                    """ サイクルで同一点を訪れた時の処理 """
                    """"""""""""""""""""
                    continue
                if q == goal:
                    """ ゴール時の処理"""
                    # return t + 1
                    """"""""""""""""""""
                    continue
                """ p から q への引継ぎ"""
                info[q] += info[p]
                """"""""""""""""""""
                self.parent[q] = p
                p, t = q, t + 1
            else:
                """ 探索完了時の処理 """
                """"""""""""""""""""
                if p == start and t == time:
                    break
                p, t = self.parent[p], t-1
                """ 二度目に訪問時の処理 """

                """"""""""""""""""""
        return info


######################################################################################################

N, Q = map(int, input().split())  # N:頂点数, Q: クエリの数
M = N-1

graph = Graph(N, dictated=False)

for _ in range(M):
    x, y = map(int, input().split())
    graph.add_edge(x,y)

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

print(*graph.dfs2(info, start=1))


Measured memory_bytes: 282640
# -*- coding: utf-8 -*-
N, M = map(int, input().split(' '))
A = list(map(int, input().split(' ')))
import heapq

priority_queue = []
for a in A:
    heapq.heappush(priority_queue, -a)

for _ in range(M):
    a = -1 * heapq.heappop(priority_queue)
    a //= 2
    heapq.heappush(priority_queue, -a)

ans = sum([-1 * a for a in priority_queue])

print(ans)





Measured memory_bytes: 73436
#include <iostream>

using namespace std;

int main(){
	int card_array[101], card_num;
	cin >> card_num;
	int temp;
	for (int i = 0; i < card_num; ++i) cin >> card_array[i];
	for (int i = 0; i < card_num - 1; ++i){
		for (int j = 0; j < card_num - 1; ++j){
			if (card_array[j] < card_array[j + 1]){
				temp = card_array[j];
				card_array[j] = card_array[j + 1];
				card_array[j + 1] = temp;
			}
		}
	}
	int difference = 0;
	for (int i = 0; i < card_num; ++i){
		if (i % 2 == 0) difference += card_array[i];
		else difference -= card_array[i];
	}
	cout << difference << endl;
	return 0;
}

Measured memory_bytes: 256
import scala.io.StdIn._

object Main {
  def main(args: Array[String]): Unit = {
    def lines: Unit ={
      def loop(line: String): Unit ={
        if (line != "0") {
          println(line.split("").map(_.toInt).sum)
          loop(readLine())
        }
      }
      loop(readLine())
    }

    lines
  }
}

Measured memory_bytes: 44392
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
    int a, b;
    
    scanf("%d%d", &a, &b);

    if (a < b) swap(a, b); 

    while (1) {
        a = a%b;
        if (a < b) swap(a, b);   
        if (b == 0) break;
    }
    
    printf("%d\n", a);
    
    return 0;
}

Measured memory_bytes: 3204
local mfl, mce, mmi = math.floor, math.ceil, math.min
local bls, brs = bit.lshift, bit.rshift
local SegTree = {}
SegTree.updateAll = function(self)
  for i = self.stagenum - 1, 1, -1 do
    for j = 1, self.cnt[i] do
      self.stage[i][j] = false
    end
  end
end
SegTree.create = function(self, n)
  local stagenum, mul = 1, 1
  self.cnt, self.stage = {1}, {{}}
  while mul < n do
    mul, stagenum = mul * 2, stagenum + 1
    self.cnt[stagenum], self.stage[stagenum] = mul, {}
  end
  self.stagenum = stagenum
  for i = 1, mul do self.stage[stagenum][i] = false end
  self:updateAll()
end
SegTree.getRange = function(self, left, right)
  if left == right then return self.stage[self.stagenum][left] end
  local start_stage = 1
  local stagenum = self.stagenum
  while right - left + 1 < bls(1, stagenum - start_stage) do
    start_stage = start_stage + 1
  end
  local ret = false
  local t1, t2, t3 = {start_stage}, {left}, {right}
  while 0 < #t1 do
    local stage, l, r = t1[#t1], t2[#t1], t3[#t1]
    table.remove(t1) table.remove(t2) table.remove(t3)
    local sz = bls(1, stagenum - stage)
    if (l - 1) % sz ~= 0 then
      local newr = mmi(r, mce((l - 1) / sz) * sz)
      table.insert(t1, stage + 1) table.insert(t2, l) table.insert(t3, newr)
      l = newr + 1
    end
    if sz <= r + 1 - l then
      ret = ret or self.stage[stage][mce(l / sz)]
      l = l + sz
    end
    if l <= r then
      table.insert(t1, stage + 1) table.insert(t2, l) table.insert(t3, r)
    end
    if ret then break end
  end
  return ret
end
SegTree.setValue = function(self, idx, value)
  self.stage[self.stagenum][idx] = value
  for i = self.stagenum - 1, 1, -1 do
    local dst = brs(idx + 1, 1)
    local rem = dst * 4 - 1 - idx
    self.stage[i][dst] = self.stage[i + 1][idx] or self.stage[i + 1][rem]
    idx = dst
  end
end
SegTree.new = function(n, func, emptyvalue)
  local obj = {}
  setmetatable(obj, {__index = SegTree})
  obj:create(n, func, emptyvalue)
  return obj
end

local n = io.read("*n", "*l")
local s = io.read()
local q = io.read("*n", "*l")
local sts = {}
local t = {}
for i = 1, 26 do
  sts[i] = SegTree.new(n, function(a, b) return a or b end, false)
end
for i = 1, n do
  t[i] = s:sub(i, i):byte() - 96
  sts[t[i]]:setValue(i, true)
end

for iq = 1, q do
  local iqstr = io.read()
  local ic = iqstr:sub(1, 1)
  if ic == "1" then
    local i, cs = iqstr:match("%d (%d+) (%w)")
    i = tonumber(i)
    local c = cs:byte() - 96
    if t[i] ~= c then
      sts[t[i]]:setValue(i, false)
      t[i] = c
      sts[c]:setValue(i, true)
    end
  else
    local l, r = iqstr:match("%d (%d+) (%d+)")
    l, r = tonumber(l), tonumber(r)
    local cnt = 0
    for i = 1, 26 do
      if sts[i]:getRange(l, r) then cnt = cnt + 1 end
    end
    print(cnt)
  end
end


Measured memory_bytes: 317488
#include <iostream>
#include <map>
#include <vector>

using namespace std;

int K;
vector<vector<int>> Tree;
map<pair<int, int>, int> mp;

void dfs(int cur_v, int par_v, int prev_c) {
  int c = 1;
  for (auto nxt_v : Tree[cur_v]) {
    if (nxt_v == par_v) {
      continue;
    }
    if (c == prev_c) {
      c++;
    }
    mp[make_pair(cur_v, nxt_v)] = c;
    mp[make_pair(nxt_v, cur_v)] = c;
    dfs(nxt_v, cur_v, c);
    c++;
  }
}

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

  Tree = vector<vector<int>>(N);
  vector<pair<int, int>> Edge(N);

  for (int i = 0; i < N - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    Tree[a].push_back(b);
    Tree[b].push_back(a);
    Edge[i] = make_pair(a, b);
  }

  K = 0;
  for (int i = 0; i < N; i++) {
    K = max(K, (int)Tree[i].size());
  }

  dfs(0, -1, -1);

  cout << K << endl;
  for (int i = 0; i < N - 1; i++) {
    cout << mp[Edge[i]] << endl;
  }

  return 0;
}

Measured memory_bytes: 19456
use std::io::*;
use std::str::FromStr;
use std::cmp::min;
/* 
The read function reads a string according to each one. 
*/
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//main function
fn main() {
    let a:i32 = read();
    let b:i32 = read();
    if a*b % 2 == 0{
	println!("Even");
    }else {
	println!("Odd");
    }
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc =new Scanner(System.in);

		int n=sc.nextInt();
		int h[]=new int[n];
		for(int i=0;i<n;i++) {
			h[i]=sc.nextInt();
		}
		long ans = 0;
		long count=0;
		for(int i=1;i<n;i++) {
			if(h[i-1]>=h[i]) {
				count++;
			}
			else {
				ans=Math.max(ans, count);
				count=0;
			}
		}
		ans=Math.max(ans, count);
		
		System.out.println(ans);







	}


}




Measured memory_bytes: 52544
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()
Xs = list(mapint())

pos = []
neg = []

for x in Xs:
    if x>=0:
        pos.append(x)
    else:
        neg.append(-x)

neg = neg[::-1]

ans = 10**18
if len(pos)>=K:
    ans = min(ans, pos[K-1])
if len(neg)>=K:
    ans = min(ans, neg[K-1])
lenp = len(pos)
lenn = len(neg)
if lenn>0:
    for i in range(min(lenp, K)):
        if K-(i+1)<=lenn:
            ans = min(ans, pos[i]*2+neg[K-i-2])
if lenp>0:
    for i in range(min(lenn, K)):
        if K-(i+1)<=lenp:
            ans = min(ans, neg[i]*2+pos[K-i-2])
print(ans)

Measured memory_bytes: 91316
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
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; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }

int main(void){
    // Your code here!
    int k,n;cin >> k >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    vector<ll> b(n);
    rep(i,n-1){
        b[i] = a[i+1] - a[i];   
    }
    b[n-1] = a[0]+k-a[n-1];
    ll res = k-MAX(b);
    cout << res << endl;
}


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

int k, r, b, q;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> r >> b >> q;
    k = r * 100 + b * 10 + q;
    if (k % 4 == 0) cout << "YES";
    else cout << "NO";
}



Measured memory_bytes: 256
<?php

	$inputArr = ReadStd();
	$octalArr = ChangeOctalToDecimal($inputArr);
	$answerArr = CreateAnswer($octalArr);
	Display($answerArr);

	/**
      * ?¨??????\?????????????????????????????????????????????????????????
      */
    function ReadStd(){

	    $inputArr = array();//?¨??????\?????????????????°??????????´???????

		while(intval($line_num = trim(fgets(STDIN)))!=0){
			$inputArr[] =  intval($line_num);
		}

		return $inputArr;

	}

	/**
      * ?????°??§??????????????????????????°???????????????????????°????????????????????????
      */
	function ChangeOctalToDecimal($inputArr){

		$octalArr = array();

		foreach ($inputArr as $num) {
			$octalArr[] = decoct ( $num );
		}

		return $octalArr;

	}

	/**
      * 4567???????????????5789??????????????????
      * ?????????8?????°???0,1,2,3,4,5,6,7?????????
      * ?????????8?????°???0,1,2,3,5,7,8,9???????????????????????????
      */
	function CreateAnswer($octalArr){

		$answerArr = array();

		foreach ($octalArr as $num) {
	    $targets    = array("7","6","5","4");
	    $modifieds  = array("9","8","7","5");
            // $num = str_replace ( "7" , "9" , $num );
            // $num = str_replace ( "6" , "8" , $num );            
            // $num = str_replace ( "5" , "7" , $num );
            // $num = str_replace ( "4" , "5" , $num );
            $num = str_replace ( $targets , $modifieds , $num );
            $answerArr[] = $num;
		}


		return $answerArr;

	}

	/**
      * ?????????????????????
      */
	function Display($answerArr){

		echo implode("\n",$answerArr);
	}

?>

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

#define int long long

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

/*
#define cin ifs
#define cout ofs
ifstream ifs("in.txt");
ofstream ofs("out.txt");
//*/

int N, d1, x;

double f(int n) {
    if (n == 0) {
        return 0;
    }
    return 1 + (1 + 2.0 / n) * f(n - 2);
}

signed main() {
    cin >> N >> d1 >> x;
    cout << fixed << setprecision(15) << (d1 + (N - 0.5) * x) * f(N * 2);
    return 0;
}

Measured memory_bytes: 3328
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,k:usize
    }

    let mut md = ModComb::new(MX, MOD);
    for i in 1..=k {
        let i = i as i64;
        let k = k as i64;
        let n = n as i64;
        let mut a = md.comb(n - k + 1, i) * md.comb(k - 1, i - 1);
        a %= MOD;
        println!("{}", a);
    }
}
const MX: usize = 1010101;
const MOD: i64 = 1000000007;

/// x ^ n % m
pub fn mod_pow(x: i64, n: i64, m: i64) -> i64 {
    let mut res = 1;
    let mut x = x % m;
    let mut n = n;
    while n > 0 {
        if n & 1 == 1 {
            res = (res * x) % m;
        }
        x = (x * x) % m;
        n >>= 1;
    }
    res
}
struct ModComb {
    fact: Vec<i64>,
    fact_inv: Vec<i64>,
    n: usize,
    p: i64,
}
impl ModComb {
    fn initialize(&mut self) {
        let n = self.n;
        self.fact[0] = 1;
        for i in 1..n {
            self.fact[i] = (self.fact[i - 1] * i as i64) % self.p;
        }
        self.fact_inv[n - 1] = mod_pow(self.fact[n - 1], self.p - 2, self.p);
        for i in (0..n - 1).rev() {
            self.fact_inv[i] = (self.fact_inv[i + 1] * (i + 1) as i64) % self.p;
        }
    }
    fn new(max_n: usize, p: i64) -> ModComb {
        let mut ft = ModComb {
            fact: vec![0; max_n + 1],
            fact_inv: vec![0; max_n + 1],
            n: max_n + 1,
            p: p,
        };
        ModComb::initialize(&mut ft);
        ft
    }
    fn fact(&self, n: usize) -> i64 {
        self.fact[n]
    }
    fn comb(&self, n: i64, k: i64) -> i64 {
        if n < k {
            return 0;
        }
        (self.perm(n, k) * self.fact_inv[k as usize]) % self.p
    }
    fn perm(&self, n: i64, k: i64) -> i64 {
        if n < k {
            return 0;
        }
        self.fact[n as usize] * self.fact_inv[(n - k) as usize] % self.p
    }
    fn nsk(&self, n: i64, k: i64) -> i64 {
        if n < k {
            return 0;
        }
        let mut res = 0;
        for i in 0..k + 1 {
            let v = self.comb(k, i) * mod_pow(i, n, self.p) % self.p;
            if (k - i) % 2 == 1 {
                res = (res + self.p - v) % self.p;
            } else {
                res = (res + v) % self.p;
            }
        }
        return res * self.fact_inv[k as usize] % self.p;
    }
}


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

int main(){
  int n; cin >>n;
  vector<int> a(n);
  rep(i,n) cin >>a[i];
  vector<int> cnt(1000005);
  for(int x : a){
    if(cnt[x]!=0){
      cnt[x] = 2;
      continue;
    }
    for(int i = x; i<=1000005; i+=x) cnt[i]++;
  }
  int ans = 0;
  for(int x : a){
    if(cnt[x]==1){
      ans++;
    }
  }
  cout << ans << endl;
  return 0; 
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)

using ll = long long;

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	int len = v.size();
    cout << '[';
	for (int i = 0; i < len; ++i) {
		s << v[i]; if (i < len-1) s << ", ";
	}
    cout << ']';
	return s;
}

int main(){

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

    int n;
	cin >> n;
	vector<pair<int, int>> blue(n);
	vector<pair<int, int>> red(n);

	rep(i, n){
	    int a, b; cin >> a >> b;
		red[i] = make_pair(b, a);
	}
	rep(i, n){
	    int c, d; cin >> c >> d;
		blue[i] = make_pair(c, d);
	}

	sort(blue.begin(), blue.end());
	sort(red.rbegin(), red.rend());

	bool done[n] = {false};

	int ans = 0;
	for(int i = 0; i < n; ++i){
		int bx = blue[i].first, by = blue[i].second;
		for(int j = 0; j < n; ++j){
			if(done[j]) continue;
			int rx = red[j].second, ry = red[j].first;
			if(rx < bx and ry < by){
				done[j] = true;
				++ans;
				break;
			}
		}
	}


	ppp(ans);

    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,a,b;
  string str;

  cin >>n;
  cout <<"ABC" << n 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>
 
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define int         ll int
#define float       double
#define	endl		'\n'
#define maxpq       priority_queue<ll>
#define minpq       priority_queue<ll, vector<ll>, greater<ll> >
#define mii         map<int,int>
#define msi         map<string,int>
#define mis         map< int, string>
#define mpi         map<pair< int, int>, int>
#define pii         pair< int, int>
#define vi          vector< int>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define EPS         1e-9
#define INF         1e18
#define PI          3.14159265358979323846
#define MAXI        1000000
#define what_is(x)  cerr << #x << " is " << x << endl;
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
#define N 100005
signed main()
{
	fast;
    int t=1;
    //cin>>t;
    while(t--)
    {
    	int n;
    	cin>>n;
    	cout<<(1000-n%1000)%1000<<endl;
    	
	}
}

Measured memory_bytes: 3648
#include<iostream>
using namespace std;
int main(){
    int  a,b,c,d,e;
    cin>>a>>b;
    c=a+b;
    d=a-b;
    e=a*b;
    if(c<=d&&e<=d){
        cout<<d<<endl;
    }
    else if(c<=e&&d<=e){
        cout<<e<<endl;
    }
    else{
        cout<<c<<endl;
    }
}

Measured memory_bytes: 256
#-*- coding:utf-8 -*-
import math
a = []
N,Z,W = map(int,input().split())
a = list(map(int,input().split()))

if N==1:
	print(abs(a[0]-W))
elif abs(a[N-2]-a[N-1]) > abs(a[N-1]-W):
	print(abs(a[N-2]-a[N-1]))
else :
	print(abs(a[N-1]-W))

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

struct edge{
    int to,weight;
    edge(int to,int weight):to(to),weight(weight){}
};
using Graph = vector<vector<int>> ;
using GraphEdge = vector<vector<int>> ;

long long modinv(long long a, long long m=MOD) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
    /*MODの割り算の際に
    a/＝b;
    を
    a *= modinv(b,MOD);
    とする。
        */
}

const int MAXN = 100001;
int main(){
    int N,K;cin >> N >> K;
    string S;
    cin >> S;
    int ans = 0;
    bool one;
    if(S[0]=='1')one=true;
    else one = false;
    int SA[MAXN];
    memset(SA,0,sizeof(SA));
    int cur=0;
    bool ones[MAXN];
    rep(i,N){   
        if(one && S[i]=='1'){
            SA[cur]++;
            ones[cur]=true;
        }
        else if(!one && S[i]=='0'){
            ones[cur] = false;
            SA[cur]++;
        }
        else{
            one = !one;
            cur++;
            SA[cur]++;
            ones[cur]=one;
        }
    }

    int front = 0;int back = 0;
    
    int tmp = K;
    int ma = 0;
    while(front<=cur){
        while(tmp>0 || ones[front]){
            if(!ones[front])tmp--;
            ans += SA[front];
            front++;
            ma = max(ma,ans);
        }
        if(!ones[back])tmp++;
        ans -= SA[back];
        back++;
    }

    
    cout << ma << endl;

    return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(a.rbegin(), a.rend());

    vector<ll> coef(n, 0);
    for (int i = 0; i < n - 1; i++) {
        if (i & 1) {
            coef[i]++;
            coef[i + 1]--;
        } else {
            coef[i]--;
            coef[i + 1]++;
        }
    }
    sort(coef.rbegin(), coef.rend());
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        ans += coef[i] * a[i];
    }
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += -coef[n - 1 - i] * a[i];
    }
    cout << max(ans, tmp) << endl;
}

Measured memory_bytes: 1792
#include <stdio.h>

int main(){
	int n;
	
	while(scanf("%d", &n) != EOF){
		int a, b, c, d, i = 0;
	
		for(a = 0; a <= 9; a++)
			for(b = 0; b <= 9; b++)
				for(c = 0; c <= 9; c++)
					for(d = 0; d <= 9; d++) if(n == a + b + c + d) i++;
	
		printf("%d\n", i);
	}
	
	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define repm(i, a, b) for (ll i = (ll)(a); i > (ll)(b); i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(), (x).rend()
#define pll pair<long long, long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vc vector<char>
#define vvc vector<vc>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
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;}
//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp
const ll mod=1e9+7;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    ll k;
    cin >> k;
    vll pl;
    vll mi;
    rep(i, n){
        ll a;
        cin >> a;
        if(a>=0) pl.push_back(a);
        else mi.push_back(a);
    }
    sort(rall(pl));
    sort(all(mi));
    if(pl.size()==0&&k%2==1){
        sort(rall(mi));
        ll ans=1;
        rep(i,k){
            ans*=abs(mi[i])%mod;
            ans%=mod;
        }
        ans*=-1;
        ans+=mod;
        cout<<ans%mod<<endl; 
        return 0;
    }
    if(n==k){
        ll ans=1;
        rep(i,pl.size()){
            ans*=pl[i]%mod;
            ans%=mod;
        }
        rep(i,mi.size()){
            ans*=abs(mi[i])%mod;
            ans%=mod;
        }
        if(mi.size()%2==1) ans*=-1;
        if(ans<0) ans+=mod;
        cout<<ans%mod<<endl;
        return 0;
    }
    ll i=0;
    ll j=0;
    long long ans=1;
    ll count=0;
    while(true){
        if(i+j==k) break;
        if(i<pl.size()&&(j==mi.size()||pl[i]>=abs(mi[j]))){
            ans*=pl[i]%mod;i++;
            ans%=mod;
        }else{
            ans*=abs(mi[j])%mod;
            count++;j++;
            ans%=mod;
        }
    }
    ans%=mod;
    if(count%2==0) cout<<ans%mod<<endl;
    else{
        if(k!=n){
            if(i!=pl.size()&&j!=mi.size()&&j!=0&&i!=0){
                if(pl[i]*pl[i-1]>mi[j]*mi[j-1]){
                    ans=ans*modinv(abs(mi[j-1]),mod)%mod*pl[i]%mod;
                }else{
                    ans=ans*modinv(pl[i-1],mod)%mod*abs(mi[j])%mod;
                }
            }else if(i!=pl.size()&&j!=0){
                    ans=ans*modinv(abs(mi[j-1]),mod)%mod*pl[i]%mod;
            }else{
                    ans=ans*modinv(pl[i-1],mod)%mod*abs(mi[j])%mod;
            }
        }
        if(ans<0)ans+=mod;
        cout<<ans%mod<<endl;
    }
}


Measured memory_bytes: 5576
N = gets.strip.to_i
p =  (0...N).map{gets.strip.to_i}

pmax = p.max.floor

sum_p = 0
used_coupon = false
p.size.times{|i|
	if pmax == p[i] && !used_coupon
		sum_p += (p[i] * 0.5).floor
		used_coupon = true
	else
		sum_p += p[i]
	end
}
puts sum_p


Measured memory_bytes: 1788
// tested by Hightail: https://github.com/dj3500/hightail
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <stack>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <cassert>
using namespace std;
#define pb push_back
#define INF 1001001001
#define FOR(i,n) for(int (i)=0;(i)<(n);++(i))
#define FORI(i,n) for(int (i)=1;(i)<=(n);++(i))
#define mp make_pair
#define pii pair<int,int>
#define ll long long
#define vi vector<int>
#define SZ(x) ((int)((x).size()))
#define fi first
#define se second
#define wez(n) int (n); scanf("%d",&(n));
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m));
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k));
inline void pisz(int n) { printf("%d\n",n); }
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){FOR(i,SZ(t))s<<t[i]<<" ";return s; }
#define DBG(vari) cout<<"["<<__LINE__<<"] "<<#vari<<" = "<<(vari)<<endl;
#define ALL(t) t.begin(),t.end()
#define FOREACH(i,t) for (__typeof(t.begin()) i=t.begin(); i!=t.end(); i++)
#define TESTS wez(testow)while(testow--)
#define REP(i,a,b) for(int (i)=(a);(i)<=(b);++i)
#define REPD(i,a,b) for(int (i)=(a); (i)>=(b);--i)
#define REMAX(a,b) (a)=max((a),(b));
#define REMIN(a,b) (a)=min((a),(b));
#define IOS ios_base::sync_with_stdio(0);

const int N = 200200;
int a[N], n;

bool go () {
   ll s = 0;
   FORI(i,n) s += a[i] - 1;
   if (s % 2 == 1) return true;

   int odd = 0, id = -1, one = 0;
   FORI(i,n) if (a[i] % 2 == 1) {
      ++odd;
      id = i;
      if (a[i] == 1) one = 1;
   }
   if (one) return false;
   if (odd == 1) {
      --a[id];
      int g = 0;
      FORI(i,n) g = __gcd(g, a[i]);
      FORI(i,n) a[i] /= g;
      return !go();
   }
   return false;
}

int main () {
   scanf("%d", &n);
   FORI(i,n) scanf("%d", a+i);
   if (n > 1 && go()) printf("First"); else printf("Second");
}

Measured memory_bytes: 768
import sys
inp = sys.stdin.readline
A, B = map(int,inp().split())

def f(x):
  if(x%4 == 0):
    return x
  elif(x%4 == 1):
    return x^(x-1)
  elif(x%4 == 2):
    return x^(x-1)^(x-2)
  elif(x%4 == 3):
    return 0
print(f(B) ^ f(A-1))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
inline int isLeapYear(const int y){
  if(y%4){
    return 0;
  }
  if(y%100){
    return 1;
  }
  if(y%400){
    return 0;
  }
  return 1;
}
inline int numOfDaysInMonth(const int m){
  if(m==2){
    return 28;
  }
  if(m==4||m==6||m==9||m==11){
    return 30;
  }
  return 31;
}
inline int numOfDaysInMonth(const int y, const int m){
  if(m==2){
    return numOfDaysInMonth(m)+ isLeapYear(y);
  }
  else{
    return numOfDaysInMonth(m);
  }
}
int X;
int Y;
int main(){
  rd(X);
  rd(Y);
  if(numOfDaysInMonth(X)==numOfDaysInMonth(Y)){
    wt_L("Yes");
    wt_L('\n');
  }
  else{
    wt_L("No");
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int X, Y;
// {
//   rd(X,Y);
//   wt(if[numOfDaysInMonth(X)==numOfDaysInMonth(Y), "Yes", "No"]);
// }


Measured memory_bytes: 256
n = int(input())
a = [int(input()) for i in range(n)]
def check():
    globals()
    s = 0
    if a[0]!=0:
        return -1
    for i in range(n-1):
        if a[i+1]<=a[i]:
            s+=a[i]
        if a[i+1]>a[i]+1:
            return -1
    return s+a[-1]
print(check())

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

long long mod = 1000000007;
long long H, W, K, S1, S2;

long long modpow(long long a, long long b, long long m) {
	long long p = 1, q = a;
	for (int i = 0; i < 30; i++) {
		if ((b / (1LL << i)) % 2 == 1) { p *= q; p %= m; }
		q *= q; q %= m;
	}
	return p;
}

long long Div(long long a, long long b, long long m) {
	return (a * modpow(b, m - 2, m)) % m;
}

int main() {
	cin >> H >> W >> K;
	for (int i = 0; i <= H - 1; i++) {
		long long r = W * W; if (i == 0) r = W * (W - 1) / 2LL;
		r %= mod; r *= (H - i); r %= mod;
		S1 += 1LL * i * r; S1 %= mod;
	}
	for (int i = 0; i <= W - 1; i++) {
		long long r = H * H; if (i == 0) r = H * (H - 1) / 2LL;
		r %= mod; r *= (W - i); r %= mod;
		S2 += 1LL * i * r; S2 %= mod;
	}
	long long I = (H * W) * (H * W - 1) / 2LL; I %= mod;
	S1 = Div(S1, I, mod);
	S2 = Div(S2, I, mod);

	long long EXP1 = (S1 + S2) % mod;
	long long EXP2 = K * (K - 1) / 2; EXP2 %= mod;
	long long EXP = EXP1 * EXP2 % mod;

	long long VAL = 1;
	for (int i = H * W - K + 1; i <= H * W; i++) { VAL *= (long long)i; VAL %= mod; }
	for (int i = 1; i <= K; i++) { VAL = Div(VAL, i, mod); }

	cout << (EXP * VAL) % mod << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <complex>
#include <tuple>

#define FAST ios_base::sync_with_stdio(false); cin.tie(0)
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
// #define repr(i, a, b) for(int i=int(a); i>=int(b); i--)
#define reps(i,n) for(int i=1;i<=int(n);++i)
#define repr(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define reprs(i,x) for(int i=((int)(x));i>0;i--)
#define iceil(x,y) (x+y-1)/y
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define LF "\n"

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

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<int, PII> PP;

ll K,A,B;

int main(){
	FAST;

	cin >> K >> A >> B;

	if (B-A<=2 || K+1<=A) {
		cout << K+1 <<LF;
	}
	else {
		K -= A-1;
		ll ans = A + K/2 * (B-A) + K % 2;
		cout << ans << LF;
	}

	return 0;
}

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

#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); 

#define int  long long int
#define pb push_back
#define fe first
#define lb lower_bound 
#define ub upper_bound
#define pii pair<pair<int,int>,pair<int,int> >
#define se second
#define endl "\n"
#define pi pair<int, int>
#define vi vector<int> 
#define vvi vector<vi>
#define bs   binary_search
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)	
#define all(c) (c).begin(),(c).end()
#define sz(x)       (int)x.size() 
#define PI 3.14159265358979323846

const int N =1e3;

int mod= 1e9+7;
int dx[4]={0,0,+1,-1};
int dy[4]={+1,-1,0,0};

string s,p;

void solve(){
      cin>>s>>p;

	
	  int ls=sz(s);
	  int lp=sz(p);

	  vector<vi> a(ls+1,vi (lp+1,0));
	  
	  string wyn;

	  rep(i,0,ls+1){
		  rep(j,0,lp+1){

			  if(i==0 || j==0)
				  a[i][j]=0; 
			  else if(s[i-1] == p[j-1]){
				  a[i][j] = a[i-1][j-1]+1;
			  }
			  else {
				  if(a[i-1][j] > a[i][j-1]){
					  a[i][j] = a[i-1][j];
				  }

				  else if(a[i-1][j] <= a[i][j-1]){
					  a[i][j] = a[i][j-1];
				  }
			  }
		  }
	  }

	  
int i=ls,j=lp,cnt=a[ls][lp];

 while(1){
  if(cnt<=0)
	   break;

  else if(a[i-1][j-1]+1==a[i][j] and s[i-1]==p[j-1]){
    wyn+=s[i-1];
	i--;
	j--;
	cnt--;
  }

  else if(a[i][j] == a[i-1][j])
	   i--;
  else if(a[i][j] == a[i][j-1])
	  j--;

 }
 
 reverse(all(wyn));
 cout<<wyn<<endl;

	  /*rep(i,0,ls+1){
		rep(j,0,lp+1){
		 cout<<a[i][j]<<" ";
		}
		cout<<endl;
	  }
		*/   

}



int32_t main() {
	cool;
	int t=1;
	//cin>>t;
	while(t--)
		solve();


	return 0;	   
}


Measured memory_bytes: 70784
open Batteries
open BatPrintf

let scan fmt f =
  Scanf.sscanf (read_line ()) fmt f

let scan_list cnv =
  read_line ()
  |> String.split_on_char ' '
  |> List.map cnv

let scan_listn n cnv =
  (0 --^ n) |> Enum.map (fun _ -> (cnv % read_line) ())

let bsearch_ge arr a =
  let l = Array.length arr in
  match Array.bsearch Int.ord arr a with
  | `All_lower -> l
  | `All_bigger -> 0
  | `Just_after n -> l - n -1
  | `At n -> l - n
  | `Empty -> 0

let rec zip xs ys =
  match xs, ys with
  | [], _ -> []
  | _, [] -> []
  | x::xs, y::ys ->
    (x, y) :: zip xs ys

let (n, r) = scan "%d %d" Tuple.Tuple2.make

let () =
  printf "%d\n" (if n >= 10 then r
                 else r + 100*(10-n))


Measured memory_bytes: 1024