akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout<<#x<<"="<<x<<endl;
#define endl '\n'
#define M 1000000007
#define int long long
#define INF 1e18
#define N 1000005

using namespace std;

void solve()
{
	ll n;
	cin >> n;
	ll ans = 0;
	bool f = false;
	while (n--)
	{
		ll x, y;
		cin >> x >> y;
		if (x == y)ans++; else ans = 0;
		if (ans == 3)
		{
			f = true;
		}
	}
	if (f)cout << "Yes" << endl;
	else cout << "No" << endl;
}

int32_t main()
{
	IOS
	ll T = 1;
	// cin >> T;
	for (ll i = 1; i <= T; ++i)
	{
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d[4];
int main(){
	cin>>a>>b>>c;
	if(a%2==0||b%2==0||c%2==0)cout<<0; else{
		d[1]=a;
		d[2]=b;
		d[3]=c;
		sort(d+1,d+4);
		cout<<d[1]*d[2];
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ul;
typedef signed long long ll;
ul over = 1000000007;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  string s, t;
  cin >> s >> t;
  string ans = "UNRESTORABLE";
  if (s.size() < t.size()) {
    cout << ans << endl;
    return 0;
  }
  for (int i=0; i<=s.size()-t.size(); ++i) {
    bool flg = true;
    for (int j=0; j<t.size(); ++j) {
      if (s[i+j]==t[j] || s[i+j]=='?') continue;
      else flg = false;
    }
    if (!flg) continue;
    string sn;
    for (int k=0; k<s.size(); ++k) {
      if (i<=k && k<i+t.size()) sn+=t[k-i];
      else if (s[k]=='?') sn+='a';
      else sn+=s[k];
    }
    if (ans[0]=='U') ans = sn;
    else ans = min(ans, sn);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
N = int(input())

def find_prime(n):
    prime_list = []
    find_list = list(range(2,n+1))
    while True:
        if find_list[0] > n**(1/2):
            prime_list.extend(find_list)
            break
        else:
            head = find_list[0]
            prime_list.append(head)
            find_list.pop(0)
            find_list = [num for num in find_list if num % head != 0]
    return prime_list

prime = find_prime(5555)
five = []
for num in prime:
    if num%5 == 1:
        five.append(num)

ans = []
for num in range(N):
    ans.append(five[num])

print(*ans)

Measured memory_bytes: 38640
mod = 10**9+7
n = int(input())
a = list(map(int, input().split()))
s = [0]*(n-1)
for i in range(n-1):
    if i == 0:
        s[i] = a[-i-1]
    else:
        s[i] = s[i-1] + a[-i-1]
        s[i] %= mod
ans = 0
for i in range(n-1):
    ans += s[i]*a[-i-2]
    ans %= mod
print(ans)

Measured memory_bytes: 93892
# K, N = map(int, input().split())
# points = list(map(int, input().split()))

# s_sum = max(points) - min(points)
# e_sum = abs(points[-1] - max(map(lambda x: x+K, points[:-1])))

# print(min([s_sum, e_sum]))

# 解けなかった

K, N = map(int, input().split())
points = list(map(int, input().split()))
l = 0

points.append(points[0]+K) # ループの辺間距離を計算するため
for i in range(N+1):
    l = max([l, points[i] - points[i-1]])

ans = K - l
print(ans)

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }


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

    ll ans = 0;

    for (int x = 1; x <= k; x++) {
        for (int y = 1; y <= k; y++) {
            for (int z = 1; z <= k; z++) {
                ans += gcd(x, gcd(y, z));
            }
        }
    }


    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3596
# セグメント木 最新バージョン
#verify
class SegTree():
    # 1-indexed
    def __init__(self, lists, function, basement):
        self.n = len(lists)
        self.K = (self.n-1).bit_length()
        self.f = function
        self.b = basement
        self.seg = [basement]*(2**(self.K+1)+1)
        X = 2**self.K
        for i, v in enumerate(lists):
            self.seg[i+X] = v
        for i in range(X-1, 0, -1):
            self.seg[i] = self.f(self.seg[i << 1], self.seg[i << 1 | 1])

    def update(self, k, value):
        X = 2**self.K
        k += X
        self.seg[k] = value
        while k:
            k = k >> 1
            self.seg[k] = self.f(self.seg[k << 1], self.seg[(k << 1) | 1])

    def query(self, L, R):
        num = 2**self.K
        L += num
        R += num
        vL = self.b
        vR = self.b
        while L < R:
            if L & 1:
                vL = self.f(vL, self.seg[L])
                L += 1
            if R & 1:
                R -= 1
                vR = self.f(self.seg[R], vR)
            L >>= 1
            R >>= 1
        return self.f(vL, vR)

    def find_max_index(self, L, R, X):
        # [L,R)でX以下の物で最大indexを取得
        return self.fMi(L, R, X, 1, 0, 2**self.K)

    def find_min_index(self, L, R, X):
        # [L,R) でX以下の物で最小のindexを取得する
        return self.fmi(L, R, X, 1, 0, 2**self.K)

    def fMi(self, a, b, x, k, l, r):
        if self.seg[k] > x or r <= a or b <= l:
            return -1
        else:
            if k >= 2**self.K:
                return k-2**self.K
            else:
                vr = self.fMi(a, b, x, (k << 1) | 1, (l + r) // 2, r)
                if vr != -1:
                    return vr
                return self.fMi(a, b, x, k << 1, l, (l + r) // 2)

    def fmi(self, a, b, x, k, l, r):
        if self.seg[k] > x or r <= a or b <= l:
            return -1
        else:
            if k >= 2**self.K:
                return k-2**self.K
            else:
                vl = self.fmi(a, b, x, k << 1, l, (l+r)//2)
                if vl != -1:
                    return vl
                return self.fmi(a, b, x, k << 1 | 1, (l+r)//2, r)
N = int(input())
S = list(input())
Q = int(input())
que = [tuple(input().split()) for i in range(Q)]
alpha = "abcdefghijklmnopqrstuvwxyz"
Data = {alpha[i]: [0]*N for i in range(26)}
for i in range(N):
    Data[S[i]][i] += 1
SEG = {alpha[i]: SegTree(Data[alpha[i]], max, 0) for i in range(26)}
for X, u, v in que:
    if X == "1":
        u = int(u)-1
        NOW = S[u]
        S[u] = v
        SEG[NOW].update(u, 0)
        SEG[v].update(u,1)
    else:
        s, t = int(u)-1, int(v)-1
        res = 0
        for j in range(26):
            res += SEG[alpha[j]].query(s, t+1)
        print(res)

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

int main()
{
	long long k,n,count=0;
  	cin>>n>>k;
  	vector<long long> a(n);
  	for(long long i=0;i<n;i++) cin>>a[i];
	sort(a.begin(), a.end(), greater <int>() );
	for(long long i=k;i<n;i++) count=count+a[i];
	cout<<count<<endl;
	
	return 0;
}

Measured memory_bytes: 1792
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

class SegTree
  attr_accessor:node,:n
  def initialize(n)
    @n=1
    @n*=2 while @n<n
    @node=array(2*@n-1,1,0)
  end

  def update(i,x)
    i=@n+i-1
    @node[i]=x
    while i>0
      i=(i-1)/2
      @node[i]=@node[i*2+1]+@node[i*2+2] 
    end
  end
  
  def find(s,t,num,l,r)
    return 0 if (r<=s or t<=l)
    return @node[num] if (s<=l and r<=t)
    mid=(l+r)/2
    val1=find(s,t,num*2+1,l,mid)
    val2=find(s,t,num*2+2,mid,r)
    return val1+val2
  end
end

loop do
n,k=get_i
break if n==0 and k==0
st=SegTree.new(n)
n.times do|i|
  st.update(i,gets.to_i)  
end
i=0
max=-10**9
while i+k<n
  val=st.find(i,i+k,0,0,st.n)  
  max=val if val>max
  i+=1
end

puts max
end


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

using namespace std;

int main(){
  int a, b;

  cin >> a >> b;
  

  for ( int i = 1; i <= 3; i++ ){
    if ( ( a * b * i ) % 2 == 1 ){
      cout << "Yes" << endl;
      return 0;
    }
  }

  cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, a, b) for(int i = b - 1; i >= a; i--)

int main(){
    int M, K; cin >> M >> K;
    if(K >= (1 << M)) cout << -1 << endl;
    else if(M == 1){
        if(K == 1) cout << -1 << endl;
        else{
            cout << "0 0 1 1\n";
        }
    }
    else{
        cout << K << " ";
        rep(i, 0, (1 << M)){
            if(i == K) continue;
            cout << i << " ";
        }
        cout << K;
        rrep(i, 0, (1 << M)){
            if(i == K) continue;
            cout << " " << i ;
        }
        cout << endl;
    }
}

Measured memory_bytes: 1792
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<math.h>
#define L(_i,_N) for(int _i=0;_i<_N;_i++)
#define C(_Dis) cout<<_Dis<<endl;

using namespace std;

typedef long long int lli;

int main() {
	lli a, b,c,i;
	while (cin >> a >> b) {
		if (a > b) swap(a, b);
		c = a*b;
		while (1){
			if (b == 0) break;
			i = b;
			b = a%b;
			a = i;
		}
		cout << a << " " << c / a  << endl;
	}
	return 0;
}

Measured memory_bytes: 3068
// C++(GCC 9.2.1)
// 解き直し.
// https://img.atcoder.jp/arc064/editorial.pdf
// ① 1_27.txt, 1_28.txt, 1_30.txt, 1_31.txt で, WA版となったため, ロジック修正.
// -> d[i] / 2 は d[i] * 500000004 % MOD に 修正 -> 最終的に, もとに戻した.
// ② 1_27.txt で, WA版となったため, ロジック修正.
// -> mPow の 第二引数が, 切り捨てだったものを, 切り上げに修正.
// ③ 2. 例外. を 廃止.
// -> ② の 修正でカバーできるため.
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define pb push_back
#define all(x) x.begin(), x.end()
const LL MOD = 1e9 + 7;

// 与えられた正の整数のすべての約数を抽出.
// @param X: 約数を抽出したい正の整数.
// @return ret: すべての約数.
vector<LL> div(LL X){
    vector<LL> ret;
    ret.pb(1);
    for(LL d = 2; d * d <= X; d++){
        if(X % d == 0){
            ret.pb(d);
            if(d * d != X) ret.pb(X / d);
        }
    }
    if(X > 1) ret.pb(X);
    sort(all(ret));
    return ret;
}

// Fermat's little theorem から, 大きな冪乗の計算を行う.
// @param a: べき乗したい正整数.
// @param b: 指数.
// @return:  べき乗した計算結果(mod版).
LL mPow(LL a, LL b){
    LL t = 1;
    while(b){
        if(b & 1) t = (t * a) % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return t % MOD;
}

int main(){
    
    // 1. 入力情報.
    LL N, K;
    scanf("%lld %lld", &N, &K);
    
    // 2. 例外.
    // if(N == 1){
    //     printf("%lld\n", K);
    //     return 0;
    // }
    
    // 3. N の 約数.
    vector<LL> d = div(N);
    // for(auto &p : d) printf("%lld ", p);
    // puts("");
    
    // 4. 各最小周期に対応する数列の個数.
    int l = d.size();
    LL num[l];
    memset(num, 0, sizeof(num));
    rep(i, l){
        // num[i] = mPow(K, d[i] / 2);
        // num[i] = mPow(K, d[i] * 500000004 % MOD);
        num[i] = mPow(K, (d[i] + 1) / 2);
        rep(j, i){
            if(d[i] % d[j] == 0) num[i] = (num[i] + MOD - num[j]) % MOD;
        }
    }
    
    // 5. 解答を求めるための数式を計算.
    LL ans = 0, nd;
    rep(i, l){
        // nd = (d[i] & 1) ? d[i] : d[i] / 2;
        // nd = (d[i] & 1) ? d[i] : (d[i] * 500000004 % MOD);
        nd = (d[i] & 1) ? d[i] : d[i] / 2;
        ans += num[i] * nd;
        ans %= MOD;
    }
    
    // 6. 出力.
    printf("%lld\n", ans);
    return 0;
    
}

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

string s,t;
int n,m,a=1e9;

int main(){

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

    cin>>s>>t;
    n=s.size();m=t.size();
    for(int i=0;i+m<=n;i++){
        int c=0;
        for(int j=0;j<m;j++)c+=s[i+j]!=t[j];
        a=min(a,c);
    }
    cout<<a<<endl;

    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define int long long
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; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB(x) push_back(x)
#define MP make_pair
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) max_element(x.begin(),x.end())
#define MIN(x) min_element(x.begin(),x.end())
#define couty cout<<'Y'<<'e'<<'s'<<endl
#define coutn cout<<'N'<<'o'<<endl
#define coutY cout<<'Y'<<'E'<<'S'<<endl
#define coutN cout<<'N'<<'O'<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;
//fixed<<setprecision(15);

signed main(){
    int x,y; cin >> x >> y;
    int res=1;
    while(true){
        x*=2;
        if(x>y) break;
        res++;
    }
    COUT(res);
}

Measured memory_bytes: 384
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
diff = [a-b for a,b in zip(A, B)]
orderdiff = sorted(diff, reverse=True)

# 浮いている分からマイナスを補填、何個使ったかを管理するためのリスト
plsdiffcnt = [0] * (N + 1)
plsdiffcnt[0] = orderdiff[0]
for i in range(len(orderdiff)-1):
  if orderdiff[i] > 0:
    plsdiffcnt[i+1] = plsdiffcnt[i] + orderdiff[i+1]

#マイナス値の合計とその個数を取得
mnscnt = 0
mnssum = 0
for i in diff:
  if i < 0:
    mnscnt += 1
    mnssum -= i
    
if all([i >= 0 for i in diff]):
  print(0)
  exit()
    
if sum(diff) < 0:
  print(-1)
  exit()
     
for i, v in enumerate(plsdiffcnt):
  if mnssum <= v:
    ans = i + 1
    break
print(mnscnt+ans)


Measured memory_bytes: 20404
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Linq.Expressions;

static class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private int N;
    private string[] A;
    private string[] b;
    private void Scan()
    {
        N = int.Parse(Console.ReadLine());
        A = Console.ReadLine().Split(' ');
    }

    private void Swap(ref string a, ref string b)
    {
        var t = a;
        a = b;
        b = t;
    }

    private void BubbleSort()
    {
        var C = A.ToArray();
        for (int i = 0; i < N; i++)
        {
            for (int j = N - 1; j > i; j--)
            {
                if (C[j][1] < C[j - 1][1])
                {
                    Swap(ref C[j], ref C[j - 1]);
                }
            }
        }
        b = C;
        Console.WriteLine(string.Join(" ", C));
        Console.WriteLine("Stable");
    }

    private void SelectionSort()
    {
        var C = A.ToArray();
        for (int i = 0; i < N; i++)
        {
            int minj = i;
            for (int j = i; j < N; j++)
            {
                if (C[j][1] < C[minj][1])
                {
                    minj = j;
                }
            }
            Swap(ref C[minj], ref C[i]);
        }
        Console.WriteLine(string.Join(" ", C));
        for (int i = 0; i < N; i++)
        {
            if (b[i] != C[i])
            {
                Console.WriteLine("Not stable");
                return;
            }
        }
        Console.WriteLine("Stable");
    }

    public void Solve()
    {
        Scan();
        BubbleSort();
        SelectionSort();
    }
}

Measured memory_bytes: 9232
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define speed                                                                  \
  ios_base::sync_with_stdio(0);                                                \
  cin.tie(0);                                                                  \
  cout.tie(0);
#define oprecision                                                             \
  cout.precision(30);                                                          \
  cerr.precision(7);
#define bb bool
#define ii int
#define ll long long
#define ff float
#define dd double
#define cc char
#define ss string
#define forn(sz) for (int i = 1; i <= sz; i++)
#define forni(i, sz) for (int i = 1; i <= sz; i++)
#define fornid(i, m, sz) for (int i = m; i <= sz; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vii vector<ii>
#define vii64 vector<ll>
#define vb vector<bb>
using namespace std;
ll sz, k, arr[600010], dp[600010];
int main() {
  speed;
  oprecision;
  /*#ifndef ONLINE_JUDGE
freopen("outd.txt", "rt", stdin);
#endif*/
  // code
  for (int i = 2; i <= 600005; i++) {
    dp[i] = 1000000000LL;
  }
  cin >> sz >> k;
  forn(sz) cin >> arr[i];
  forn(sz) {
    for (int j = 1; j <= k; j++) {
      dp[i + j] = min(dp[i] + abs(arr[i] - arr[i + j]), dp[i + j]);
    }
  }
  cout << dp[sz];
// endl
#ifndef ONLINE_JUDGE
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}


Measured memory_bytes: 6400
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
const int MOD=1e9+7;
 
int main() {
    int a,b;
    cin >> a >> b;
    int d=b-a;
    cout << d*(d-1)/2-a << endl;
    
}

Measured memory_bytes: 256
import numpy as np

n = int(input())
a,b = list(map(int, input().split()))
p = list(map(int, input().split()))
p = np.array(p)
try:
    print(np.min([np.sum(p <= a), np.sum((a < p) * (p <= b)), np.sum((b < p))]))
except:
    print(0)

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

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

   for(int i=0;i<100;i++){
    for(int j=0;j<100;j++){
      if((N-4*i-7*j)==0) {cout <<"Yes"<<endl; return 0;}
    }
  }
   cout<<"No"<<endl;

return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1e6;
const double PI = acos(-1.0);
#define Test ll tesnum;tesnum = read();while(tesnum--)
ll read();

int main()
{
    char c;
    cin>>c;
    if(c>='a'&&c<='z'){
        cout<<"a"<<endl;
    }else
        if(c>='A'&&c<='Z'){
            cout<<"A"<<endl;
        }
    return "BT7274", NULL;
}

inline ll read() {
    ll hcy = 0, dia = 1;char boluo = getchar();
    while (!isdigit(boluo)) {if (boluo == '-')dia = -1;boluo = getchar();}
    while (isdigit(boluo)) {hcy = hcy * 10 + boluo - '0';boluo = getchar();}
    return hcy * dia;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
//#define print(ele) cout << (ele) << "\n"
#define print10(ele) cout << fixed << setprecision(10) << (ele) << "\n"

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

void print() { cout << endl; }

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) != 0) cout << " ";
  print(forward<Tail>(tail)...);
}

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  bool turn = true;
  while (1) {
    if (turn) {
      c -= b;
      turn = false;
    } else {
      a -= d;
      turn = true;
    }
    if (a < 1 || c < 1) break;
  }
  print(a < 1 ? "No" : "Yes");
  return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

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

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

int main() {
  int N;
  cin >> N;
  if ((N / 10) % 10 == 9 || (N % 10) == 9) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

#define rep(i, n) for(int i=0; i < n; i++)
#define REP(i, n, m) for(int i=n; i < m; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

ll mod=1000000007;

const ll INF = 1LL << 60;

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

int n,x,y;


int main() {
  cin >> n >> x >> y;
  x--;y--;
  vector<int> cnt(n+1);

  rep(i,n-1){
    for(int j=i+1;j<n;j++){
      int val = min((j-i),abs(x-i)+1+abs(y-j));
      cnt[val]++;
    }
  }

  reps(i,n-1)cout << cnt[i] << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>

using namespace std;

#define mem(a,b) memset(a,b,sizeof(a))
typedef long long ll;

const int N=1e5+10;

int a[N];

void solve(){
    int n;
    scanf("%d",&n);

    for(int i=1;i<=n;i++) scanf("%d",a+i);
    sort(a+1,a+n+1);

    ll ans=0,ans2=0;
    int cnt=0;
    bool flag=0;

    for(int i=n;i>=1;i--){
        int cur=1;
        while(i-1>=1 && a[i-1]==a[i]) i--,cur++;
        if(cur>=2 && cnt<=1){
            if(cnt==0) ans=a[i];
            else ans*=a[i];
            cnt++;
        }
        if(cur>=4){
            ans2=max(ans2,1LL*a[i]*a[i]);
        }
    }

    if(cnt<2) ans=0;
    ans=max(ans,ans2);
    printf("%lld\n",ans);
}

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


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;
#define MAX_N 200010

ll N;
ll A[MAX_N] = {};

signed main()
{
    cin >> N;
    REP(i, N) { cin >> A[i]; }

    ll snuke = A[0];
    ll arai = 0;
    for(ll i = 1; i < N; ++i) { arai += A[i]; }
    ll ans = abs(snuke - arai);
    for(ll i = 1; i < N-1; ++i) {
        snuke += A[i];
        arai -= A[i];
        ans = min(ans, abs(snuke - arai));
    }
    printf("%lld\n", ans);
    return 0;
}


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

using namespace std;

const int INF = 1e9;


int main()
{
	int x, n;	cin >> x >> n;
	vector <int> v(n);
	vector <int> occ(105);
	for (int &dat : v)
		cin >> dat, occ[dat]++;
	if (n == 0)
	{
		cout << x << "\n";
		return 0;
	}
	int l = -1, r = -1;
	for (int i = x; i < 102; i++)
	{
		if (occ[i] == 0)
		{
			l = i;
			break;
		}
	}

	for (int i = x; i >= 0; i--)
		if (occ[i] == 0)
		{
			r = i;
			break;
		}
	// cout << l << " " << r << "\n";
	if (l - x < x - r)
		cout << l << "\n";
	else 
		cout << r << "\n";



}


// 2 1
// 1 3
//  3 2 1 3 1 3

//  3 5 6 



// 4 2
//  2 2 		4 2 			4 4			
// 2 2 2  		2 2 4			2 4 4		4 4 4

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
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; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int a, b;
    cin >> a >> b;
    if (a * b % 2 == 0) cout << "Even" << endl;
    else cout << "Odd" << endl;


    return 0;
}

Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;


long P = 10^^9+7;
long[10^^5*4+50] F, RF;

long pow(long x, long n) {
    long y = 1;
    while (n) {
        if (n%2 == 1) y = (y * x) % P;
        x = x^^2 % P;
        n /= 2;
    }
    return y;
}

void init()
{
    F[0] = F[1] = 1;
    foreach (i, ref x; F[2..$]) x = (F[i+1] * (i+2)) % P;

    {
        RF[$-1] = 1;
        auto x = F[$-1];
        auto k = P-2;
        while (k) {
            if (k%2 == 1) RF[$-1] = (RF[$-1] * x) % P;
            x = x^^2 % P;
            k /= 2;
        }
    }
    foreach_reverse(i, ref x; RF[0..$-1]) x = (RF[i+1] * (i+1)) % P;
}

long comb(N)(N n, N k)
{
    if (k > n) return 0;
    auto n_b = F[n];    // n!
    auto nk_b = RF[n-k]; // 1 / (n-k)!
    auto k_b = RF[k];    // 1 / k!

    auto nk_b_k_b = (nk_b * k_b) % P; // 1 / (n-k)!k!

    return (n_b * nk_b_k_b) % P;  // n! / (n-k)!k!
}

void main()
{
    init();
    auto nk = readln.split.to!(long[]);
    auto n = nk[0];
    auto k = nk[1];

    long r;
    foreach (i; 0..min(n, k+1)) {
        r = (r + (comb(n, i) * comb(n-1, n-i-1)) % P) % P;
    }
    writeln(r);
}

Measured memory_bytes: 6528
using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
using static System.Math;
using System.Linq;
using static System.Array;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            //var N = long.Parse(Console.ReadLine());
            //var AB = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            var AB = Console.ReadLine().Split(' ').ToArray();
            var A = long.Parse(AB[0]);

            var B1 = long.Parse(AB[1].Split('.')[0])*100;
            var B2 = long.Parse(AB[1].Split('.')[1]);
            var B = B1 + B2;

            Console.WriteLine((A*B)/100);



            

            
        }

    }

}


Measured memory_bytes: 27912
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
using namespace std;
int n,m,a[100005];
int main(){
	char ch;
	while(cin>>ch){
		n++;
		if(n&1)cout<<ch;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <math.h>
#include <deque>
using ll = long long;
using namespace std;

int main(){
    int n;
    cin >> n;
    cout << n*800 - n/15*200<< endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int v[2001][2001] , rv[2001][2001] , rh[2001][2001] , a[2001][2001];

int main()
{
    int n , m , q;
    cin >> n >> m >> q;
    for(int i = 1; i <= n; i ++) {
        for(int j = 1; j <= m; j ++) {
            char x;
            cin >> x;
            x -= 48;
            a[i][j] = x;
            v[i][j] = v[i-1][j] + v[i][j-1] - v[i-1][j-1] + x;
            rv[i][j] = rv[i-1][j] + rv[i][j-1] -rv[i-1][j-1] + (x && a[i][j-1]);
            rh[i][j] = rh[i-1][j] + rh[i][j-1] -rh[i-1][j-1] + (x && a[i-1][j]);
        }
    }
    while(q --) {
        int x1,y1,x2,y2;
        cin >> x1 >> y1 >> x2 >> y2;
        int vs = v[x2][y2] - v[x2][y1-1] - v[x1-1][y2] + v[x1-1][y1-1];
        int rvs = rv[x2][y2] - rv[x2][y1] - rv[x1-1][y2] + rv[x1-1][y1];
        int rhs = rh[x2][y2] - rh[x2][y1-1] - rh[x1][y2] + rh[x1][y1-1];
        cout << vs - rvs - rhs << endl;
    }
    return 0;
}


Measured memory_bytes: 64384
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    vector< iP > v;
    v.pb( MP( 0, MP( 0, 0 ) ) );

    for( int i = 0; i < n; ++i ) {
        int t, x, y;
        cin >> t >> x >> y;
        v.pb( MP( t, MP( x, y ) ) );

    }

    bool flg = true;
    for( int i = 1; i < v.size(); ++i ) {
        int dist = abs( v[i].S.F - v[i - 1].S.F ) + abs( v[i].S.S - v[i - 1].S.S );
        if( dist > v[i].F - v[i - 1].F ) flg = false;
        else if( dist % 2 && ( v[i].F - v[i - 1].F ) % 2 == 0 ) flg = false;
        else if( !( dist % 2 ) && ( v[i].F - v[i - 1].F ) % 2 ) flg = false;

    }
    if( flg ) cout << "Yes";
    else cout << "No";
    cout << endl;
    return 0;
}



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

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

    int y = x / 500;
    int z = x % 500;
    int a = z / 5;
    int ans = y*1000 + a*5;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3620
#n=list(map(int,input().split()))
n = int(input()) 
#num = [input() for i in range(n)] 
a=[0]*n    
ama=list(map(int,input().split()))

for i in reversed(ama):
    if sum(a[n-1::n])%2==i:
        next
    else:
        a[n-1]=(a[n-1]+1)%2
    n=n-1


print(sum(a))
print(" ".join(list(map(str,list(map(lambda x: x+1, [i for i, x in enumerate(a) if x == 1]))))))


#for i in range(n):
#    print(max(num[:i]+num[i+1:]))

Measured memory_bytes: 20020
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

H,W,D = MI()
A = [LI() for i in range(H)]
d = {}
for i in range(H):
    for j in range(W):
        d[A[i][j]] = (i,j)

B = [0]*(H*W+1)
for i in range(1,D+1):
    a = i+D
    while a <= H*W:
        B[a] = B[a-D] + abs(d[a][0]-d[a-D][0]) + abs(d[a][1]-d[a-D][1])
        a += D

Q = I()
for i in range(Q):
    L,R = MI()
    print(B[R]-B[L])


Measured memory_bytes: 82512
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
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<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};


int main(){
    string s;cin >> s;
    if(s.length()%2){
        puts("No");
        return 0;
    }
    for (int i = 0; i < s.length(); i+=2) {
        if(s[i] != 'h' || s[i+1] != 'i'){
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
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)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;
int main(){
    int n,m;
    cin>>n>>m;
    vector<ll> mp;
    ll l[m],r[m],c[m];
    ll base=1e6+1;
    rep(i,m){
        cin>>l[i]>>r[i]>>c[i];
        mp.push_back(base*c[i]+l[i]);
        mp.push_back(base*c[i]+r[i]);
    }
    rep(i,n)mp.push_back(i+1);
    sort(mp.begin(),mp.end());
    mp.erase((mp.begin(), mp.end()),mp.end());
    int k=mp.size();
    vector<pint> v[k];
    rep(i,m){
        int li=lower_bound(mp.begin(),mp.end(),base*c[i]+l[i])-mp.begin();
        int ri=lower_bound(mp.begin(),mp.end(),base*c[i]+r[i])-mp.begin();
        v[li].push_back({ri,0});
        v[ri].push_back({li,0});
        v[li].push_back({l[i]-1,1});
        v[l[i]-1].push_back({li,0});
        v[ri].push_back({r[i]-1,1});
        v[r[i]-1].push_back({ri,0});
    }
    int dist[k];
    rep(i,k)dist[i]=inf;
    dist[0]=0;
    deque<pint> dq;
    dq.push_front({0,0});
    while(dq.size()){
        int d=dq.front().second;
        int x=dq.front().first;
        dq.pop_front();
        if(d>dist[x])continue;
        for(auto& nx:v[x]){
            int nd=d+nx.second;
            if(nd<dist[nx.first]){
                dist[nx.first]=nd;
                if(nx.second)dq.push_back({nx.first,nd});
                else dq.push_front({nx.first,nd});
            }
        }
    }
    cout<<(dist[n-1]==inf?-1:dist[n-1])<<endl;
   return 0;
}

Measured memory_bytes: 41068
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
using namespace std;

struct node{
    int key;
    node* right;
    node* left;
    node* parent;
};

node *root;

//??????x??\???????°????
node* treeMinimum(node* x){
    while (x->left!=NULL)
        x=x->left;
    return x;
}

node* treeSuccessor(node* x){
    if(x->right!=NULL)
        return treeMinimum(x->right);
    node* y=x->parent;
    while(y!=NULL&&x==y->right){
        x=y;
        y=y->parent;
    }
    return y;
}

void treeDelete(node* z){
    //????????????????±?
    node* y;
    //y????????????
    node* x;

    //????????????????????????
    if(z->left==NULL||z->right==NULL)
        y=z;
    else
        y=treeSuccessor(z);

    //??????y????????????x
    if(y->left!=NULL)
        x=y->left;
    else
        x=y->right;

    if(x!=NULL)
        x->parent=y->parent;
    if(y->parent==NULL)
        root=x;
    else if(y==y->parent->left)
        y->parent->left=x;
    else
        y->parent->right=x;
    if(y!=z)
        z->key=y->key;
    delete y;

}

//?????\
void insert(int k){
    node *y = NULL;
    node *x = root;
    node *z;

    z = new node;
    z->key=k;
    z->left=NULL;
    z->right=NULL;

    while(x!=NULL){
        y=x;
        if(z->key<x->key)
            x=x->left;
        else
            x=x->right;
    }

    z->parent=y;
    if(y==NULL)
        root=z;
    else{
        if(z->key<y->key)
            y->left=z;
        else
            y->right=z;
    }

}

//????´¢
node* find(node* u,int k){
    while(u!=NULL&&k!=u->key){
        if(k<u->key)
            u=u->left;
        else
            u=u->right;
    }
    return u;
}

void inorder(node* u){
    if(u==NULL)
        return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}

void preorder(node* u){
    if(u==NULL)
        return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}

int main(){
    int n,i,x;
    string com;

    scanf("%d",&n);

    for(i=0;i<n;i++){
        cin>>com;
        if(com[0]=='f'){
            scanf("%d",&x);
            node* t=find(root,x);
            if(t!=NULL)
                printf("yes\n");
            else
                printf("no\n");
        }
        else if(com=="insert"){
            scanf("%d",&x);
            insert(x);
        }
        else if(com=="print"){
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
        else if(com=="delete"){
            scanf("%d",&x);
            treeDelete(find(root,x));
        }
    }
}

Measured memory_bytes: 21912
import java.io.BufferedReader

fun main(args: Array<String>) {
    /** comment in when you submit **/
    System.`in`.bufferedReader().use { println(getOutputString(it)) }

    /** delete below after your test **/
    // executeTest()
}

private fun getOutputString(reader: BufferedReader): String {
    val num = reader.readLine().toInt()

    val modulo = 1000000007

    var reminder = 1L
    for (i in 1..num) {
        reminder *= i

        while (reminder > modulo) reminder -= modulo
    }

    return reminder.toString()
}

Measured memory_bytes: 21560
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] a_list = br.readLine().split("");
        String[] b_list = br.readLine().split("");
        String[] c_list = br.readLine().split("");

        Deque<String> a, b, c;
        a = new ArrayDeque<String>(Arrays.asList(a_list));
        b = new ArrayDeque<String>(Arrays.asList(b_list));
        c = new ArrayDeque<String>(Arrays.asList(c_list));

        String turn = "a";
        while (turn != null) {
            switch (turn) {
                case "a":
                    turn = a.poll();
                    if (turn == null) System.out.println("A");
                    break;
                case "b":
                    turn = b.poll();
                    if (turn == null) System.out.println("B");
                    break;
                case "c":
                    turn = c.poll();
                    if (turn == null) System.out.println("C");
                    break;
            }
        }
    }

}


Measured memory_bytes: 23380
#include <iostream>
#include <string>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
using ll = long long;
typedef long long ll;

int gcd(int m, int n);
int lcm(int a, int b);

int main(void){
    using namespace  std;
    ll N, K;
    cin >> N >> K;
    ll ret = N % K;
    cout << (ret < K - ret ? ret : K - ret) << endl;

    return 0;
}

int gcd(int m, int n){
    int r;
    do{
        r = m % n;
        m = n;
        n = r;
    } while (r != 0);

    return m;
}

int lcm(int a, int b){
    long temp = a * b;
    return temp / gcd(a, b);
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {

	buf := make([]byte, 1000)
	sc.Buffer(buf, 1400000000)

	// input
	line := strings.Split(readLine(), "")

	price := 700
	for i := 0; i < 3; i++ {
		if line[i] == "o" {
			price += 100
		}
	}
	fmt.Println(price)
}

func readLine() string {

	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define _USE_MATH_DEFINES
#define ios std::ios::sync_with_stdio(false);cin.tie(NULL)
#define ll long long int
#define PI acos(-1.0)
#define EPS 1e-9 //epsilon 10^-9, checking for equality 
#define pb push_back
#define fi first
#define se second
#define go(i,a,n) for(int i=a;i<n;i++)
#define og(i,a,n) for(int i=n-1;i>=a;i--)
#define rep(i,n) go(i,0,n)
#define per(i,n) og(i,0,n)
#define sz(x) (x.size())
#define isort(x) sort(x.begin(),x.end())
#define dsort(x) sort(x.rbegin(),x.rend())
#define all(x) x.begin(),x.end()
#define rall(x) (x).rbegin(),(x).rend()
#define pr(x) cout<<(x)<<endl
#define exist(e,s) ((s).find(e)!=(s).end()) //Element e in structure s
#define existstr(c,s) ((s).find(c) !=string::npos) //Character in structure
#define fo(x,s) for(auto &x:s) //for all x in structure s
typedef vector<int> vi;typedef vector<ll> vll;typedef vector< vector<int> > vvi;
typedef vector< vector<ll> > vvll;typedef pair<int,int> ii;typedef pair<int, pair<int,int> > iii;
typedef pair<ll,ll> pll;typedef vector<ii> vii;typedef vector<iii> viii;typedef map<int,int> mii;
const int inf=1e9+7; //10^9 +7
inline void rvi(vi& v, int n){int temp; go(i,0,n){cin>>temp;v.pb(temp);}}
inline void rvll(vll& v, int n){ll temp;go(i,0,n){cin>>temp;v.pb(temp);}}
inline void prvi(vi&a){go(i,0,a.size()){cout<<a[i]<<" ";}cout<<endl;}
inline void prvll(vll&a){go(i,0,a.size()){cout<<a[i]<<" ";}cout<<endl;}
inline void prmii(map<int,int>& m){for(auto x:m){cout<<x.fi<<" "<<x.se<<endl;}}
inline vll prefixsum(vi& a){vll b;b.pb(a[0]);go(i,1,a.size()){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vi& a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];og(i,0,sz(a)-1){b[i]=a[i]+b[i+1];}return b;}
inline vll prefixsum(vll& a){vll b;b.pb(a[0]);go(i,1,a.size()){b.pb(a[i]+b[i-1]);}return b;}
inline vll suffixsum(vll& a){vll b(sz(a));b[sz(a)-1]=a[sz(a)-1];og(i,0,sz(a)-1){b[i]=a[i]+b[i+1];}return b;}
void solve();
int main(){ios;solve();return 0;}
//--------SOLVE---------------------------------------------------------------------
void solve()
{
	int a,b;
	cin>>a>>b;
	for(int i=1;i<=3;i++)
	{
		if( (a*b*i) &1){
			cout<<"Yes"<<endl;
			return;
		}
	}
	cout<<"No"<<endl;



}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>
#include <queue>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<int, int> qii;
typedef pair<int, int> pii;

#define PI 3.14159265359
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rept(i,n) rep(i,0,n)

//int型を受け取ってその桁数を返す
int check_digits(int n) {
	int digits = 0;
	while (n != 0) {
		n /= 10;
		digits++;
	}
	return digits;
}


//最大公約数を返す関数
int gcd(int n) {
	return 0;
}


//最小公倍数を返す関数
int mcd(int n) {
	return 0;
}


//2点間の距離を返す
float dis(int x1, int y1, int x2, int y2) {
	return sqrt(pow(abs(x1-x2),2) + pow(abs(y1-y2),2));
}


int main()
{
	int n, m,ans=0,left=0,right=1000000,temp_l,temp_r;
	vi bucket(110000,0);
	cin >> n >> m;
	
	rept(i, m) {
		cin >> temp_l >> temp_r;
		if (temp_l > left)left = temp_l;
		if (temp_r < right)right = temp_r;
	}

	if (left > right)cout << 0 << endl;
	else cout << right - left + 1 << endl;

	system("pause");
	return 0;
}



Measured memory_bytes: 624
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-5;
const ld pi = acos(-1.0);

void solve() {
	int a, b, c, d; cin >> a >> b >> c >> d;
	if (c == -1 || d == -1) {
		if (a > b) {
			cout << "Bob" << endl;
		}
		else if (a < b) {
			cout << "Alice" << endl;
		}
		else {
			cout << "Draw" << endl;
		}
	}
	else {
		if (c > d) {
			cout << "Alice" << endl;
		}
		else if (c < d) {
			cout << "Bob" << endl;
		}
		else {
			cout << "Draw" << endl;
		}
	}
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}



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

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

    if(n <= 4) {
        vector<long> v;
        switch(n) {
            case 3:
                v = {2, 3, 25};
                break;
            case 4:
                v = {2, 3, 4, 9};
                break;
        }
        for(auto &e: v) cout << e << ' ';
        cout << endl;
        return 0;
    }

    // 2 4
    // 3 9

    for(auto t: {2, 4})
        cout << t << ' ';
    for(auto t: {3, 9})
        cout << t << ' ';
    n -= 4;

    set<long> res;
    {
        vector<long> rs;
        long s = 0;
        for(long c=6; c <= 30000 && rs.size()<n; c+=2)
            if(c%3)
                rs.push_back(c), s += c;
        long cnt = rs.size();
        for(long i=0; i<cnt; i++)
            if((s%3) && (rs[i]%3 == s%3)) s=0;
            else res.insert(rs[i]);
        n -= res.size();
    }

    {
        vector<long> rs;
        for(long c=12; c <= 30000; c+=3)
            if((c % 2) && !res.count(c))
                rs.push_back(c);
        long cnt = min(n, (long)rs.size()) /2*2;
        copy_n(rs.begin(), cnt, inserter(res, res.begin()));
        n -= cnt;
    }

    for(long c=6; c <= 30000 && n; c+=6)
        if(!res.count(c)) res.insert(c), n--;

    for(auto &e: res)
        cout << e << ' ';
    cout << endl;
}


Measured memory_bytes: 1328
#include "bits/stdc++.h"

using namespace std;

//------------------------------- Libraries --------------------------------//

//------------------------------- Type Names -------------------------------//

using i64 = int_fast64_t;

using seika = string;
//akari : 1D, yukari : 2D, maki : 3D vector
template <class kizuna>
using akari = vector<kizuna>;
template <class yuzuki>
using yukari = akari<akari<yuzuki>>;
template <class tsurumaki>
using maki = akari<yukari<tsurumaki>>;
//akane : ascending order, aoi : decending order
template <class kotonoha>
using akane = priority_queue<kotonoha, akari<kotonoha>, greater<kotonoha>>;
template <class kotonoha>
using aoi = priority_queue<kotonoha>;

//------------------------------- Dubug Functions ---------------------------//
inline void print()
{
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest)
{
    cout << first << ' ';
    print(rest...);
}
//------------------------------- Solver ------------------------------------//

void solve()
{
    int n;
    cin >> n;
    akari<i64> xs(2 * n), ys(2 * n), xs2, ys2;
    for (int i = 0; i < n; i++)
    {
        cin >> xs[2 * i] >> ys[2 * i] >> xs[2 * i + 1] >> ys[2 * i + 1];
    }
    xs2 = xs, ys2 = ys;
    sort(xs2.begin(), xs2.end());
    sort(ys2.begin(), ys2.end());
    yukari<int> as(2 * n + 1, akari<int>(2 * n + 1));
    for (int i = 0; i < n; i++)
    {
        int xl = distance(xs2.begin(), lower_bound(xs2.begin(), xs2.end(), xs[2 * i]));
        int xr = distance(xs2.begin(), lower_bound(xs2.begin(), xs2.end(), xs[2 * i + 1]));
        int yl = distance(ys2.begin(), lower_bound(ys2.begin(), ys2.end(), ys[2 * i]));
        int yr = distance(ys2.begin(), lower_bound(ys2.begin(), ys2.end(), ys[2 * i + 1]));
        as[xl][yl]++;
        as[xr][yl]--;
        as[xl][yr]--;
        as[xr][yr]++;
    }
    for (int i = 0; i <= 2 * n; i++)
        for (int j = 0; j < 2 * n; j++)
        {
            as[i][j + 1] += as[i][j];
        }
    for (int i = 0; i < 2 * n; i++)
        for (int j = 0; j <= 2 * n; j++)
        {
            as[i + 1][j] += as[i][j];
        }
    i64 ans = 0;
    for (int i = 0; i < 2 * n; i++)
        for (int j = 0; j < 2 * n; j++)
        {
            if (as[i][j])
            {
                ans += (xs2[i + 1] - xs2[i]) * (ys2[j + 1] - ys2[j]);
            }
        }
    cout << ans << endl;
}

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



Measured memory_bytes: 65648