akhauriyash/Code-Regression huggingface dataset:
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

constexpr int64_t DIV1097 = 1000000007LL;

using namespace std;

int main()
{
    int64_t N;
    std::cin >> N;

    std::vector<int64_t> isFixed(N);

    std::vector<int64_t> T;
    int64_t prev = 0;
    for (decltype(N) i = 0; i < N; ++i) {
        int64_t t;
        std::cin >> t;
        if (i == 0) {
            prev = t;
        }
        if (prev < t) {
            isFixed[i] = t;
        }
        T.push_back(t);
        prev = t;
    }

    std::vector<int64_t> A;
    for (decltype(N) i = 0; i < N; ++i) {
        int64_t t;
        std::cin >> t;
        if (i == 0) {
            prev = t;
        }
        if (prev > t) {
            isFixed[i-1] = prev;
        }
        A.push_back(t);
        prev = t;
    }

    if (N == 1) {
        if (T[0] != A[0]) {
            std::cout << 0 << std::endl;
        }
        else {
            std::cout << 1 << std::endl;
        }
        return 0;
    }
    isFixed[0] = T[0];
    isFixed[N-1] = A[N-1];

    int64_t ans = 1;
    for (int64_t i = 0; i < N; ++i) {
        if (isFixed[i] != 0) {
            if (isFixed[i] > T[i] || isFixed[i] > A[i]) {
                std::cout << 0 << std::endl;
                return 0;
            }
        }
        else {
            ans *= std::min(T[i], A[i]);
            ans %= DIV1097;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define INF 1LL << 60;
#define LLINF 1e12
#define PI 3.14159265359
#define ALL(a) (a).begin(), (a).end()
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int dy8[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dx8[] = {0, 1, 0, -1, 1, 1, -1, -1};
int ny, nx;
typedef long long ll;
using namespace std;

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

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

ll llpow(ll x, ll y)
{
    ll ans = 1;
    REP(i, y)
    ans *= x;
    return ans;
}

ll llmin(ll x, ll y) { return x < y ? x : y; }
ll llmax(ll x, ll y) { return x > y ? x : y; }

unsigned GetDigit(unsigned num) { return to_string(num).length(); }

template <typename Container>
bool exist_in(const Container &c, const typename Container::value_type &v)
{
    return (c.end() != std::find(c.begin(), c.end(), v));
}

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

ll nCr(int n, int r)
{
    if (n == r or n == 0)
        return 1;
    if (n < r)
        return 0;
    if (r == 1)
        return n;
    return nCr(n - 1, r - 1) + nCr(n - 1, r);
}

//素因数分解
vector<ll> decom;

void decompositPrime(ll n)
{
    ll a = 2;
    while (n >= a * a)
    {
        if (n % a == 0)
        {
            decom.push_back(a);
            n /= a;
        }
        else
        {
            a++;
        }
    }
    decom.push_back(n);
}

//std::cout << std::defaultfloat << std::setprecision(10);
////////////////////////////////////////
int main()
{

    char a; cin >> a;
    if(a-'a'>=0) cout << 'a' << endl;
    else cout << 'A' << endl;

    return 0;
}


Measured memory_bytes: 3592
#include<stdio.h>
int main(void) {
        int n;
        char a[101], b[101], c[101];
        scanf("%d %s %s %s", &n, a, b, c);
        int res = 0;
        for(int i=0;i<n;i++) {
                if(a[i] == b[i] && b[i] == c[i]) res += 0;
                else if(a[i] == b[i] || b[i] == c[i] || c[i] == a[i]) res += 1;
                else res += 2;
        }
        printf("%d", res);
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

const ll mod=1000000007;
const ll inf=1e16; 

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m;i>=n;i--)

int main(){
   cin.tie(nullptr);
  ios::sync_with_stdio(false);
 
 ll n,k;
 string s;
  cin >> n >> k >> s;
  
 ll num=0; 
  rep(i,0,s.length()-1) if(s[i]!=s[i+1]) num++;
  
  cout << n-1-max(0ll,num-2*k) << endl;
  
  
}

Measured memory_bytes: 512
people_count = int(input())
people = list(map(int, input().split()))

stools, previous = 0, -1
for index in range(people_count):
    if index == 0:
        previous = people[index]
    else:
        current = people[index]

        if previous > current:
            stools += abs(current - previous)
            people[index] = previous
        else:
            previous = current

print(stools)

Measured memory_bytes: 32016
#include <iostream>
#include <vector>
#include <algorithm>


using namespace std;


long long N, A, B;


int main()
{

	cin >> N;
	cin >> A;
	cin >> B;

	if (A == 0) {

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

	long long s = A + B;

	long long ans = 0;

	ans = (N / s)*A;

	long long l = min(N % s,A);

	ans += l;

	cout << ans << endl;


	return 0;
}

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

typedef long long ll;
#define gc getchar()
inline int read(){
	int x=0,f=1;char c=gc;
	for(;c<48||c>57;c=gc)
		if(c=='-')f=-1;
	for(;c>47&&c<58;c=gc)
		x=x*10+c-48;
	return x*f;
}
#define io read()

#define maxn 300005
int n,a[maxn],b[maxn];

inline void init(){
	n=io;
	for(int i=1;i<=n;++i){
		a[i]=b[i]=io;
		a[i]+=a[i-1];
		b[i]^=b[i-1];
	}
}

ll ans;
inline void solve(){
	for(int i=1,j=1;i<=n;++i){
		for(;j<=n&&(b[j]^b[i-1])==a[j]-a[i-1];++j);
		ans+=j-i;
	}
	printf("%lld\n",ans);
}

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

Measured memory_bytes: 1792
from collections import Counter


def solve(ABs):
    ac = Counter([a for (a, b) in ABs] + [b for (a, b) in ABs])
    if "".join(sorted([str(v) for v in ac.values()])) == "1122":
        return "YES"
    else:
        return "NO"


if __name__ == "__main__":
    ABs = [tuple(map(int, input().split(" "))) for _ in range(3)]
    print(solve(ABs))


Measured memory_bytes: 3436
import java.io.*;
import java.util.StringTokenizer;
import java.math.BigDecimal;

class Main {
	public static void main (String args[]) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		String buf;

		try {
			while ((buf = br.readLine())!=null) {
				BigDecimal a = new BigDecimal(buf);
				BigDecimal two = new BigDecimal("2.0");
				BigDecimal three = new BigDecimal("3.0");

				BigDecimal sum = new BigDecimal(buf);
				for (int i=2;i<=10;i++) {
					if (i%2==0) a = two.multiply(a);
					else a = a.divide(three,10,BigDecimal.ROUND_FLOOR);
					sum = sum.add(a);
				}
				System.out.println(sum.toString());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 16964
// /*
// power code taken from geeks for geeks
// */
// cout << setprecision (2) << fixed << 1.2;

#include <bits/stdc++.h>
#define MODD 1000000007LL
#define MAX_SIZE 100000000
#define MAX_N 100001LL

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

const ll INF = 1e18 + 5;

ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
double max(double a,double b){return a>b?a:b;}
double min(double a,double b){return a<b?a:b;}

ll modd(ll a){if(a<0LL) return a*-1LL;return a;}
double modd(double a){if(a<0.0) return a*-1.0;return a;}

ll modulo(ll a){return a % MODD; }

ll power(ll k, ll p){
    if (p == 0)
    return 1LL;

    ll P = power(k, p/2LL);
    P = (P * P) % MODD;

    if (p % 2 == 1)
    P = (P * k) % MODD;

return P;
}

ll power(ll k, ll p, bool f){
    if (p == 0)
    return 1LL;

    ll P = power(k, p/2LL);
    P = (P * P);

    if (p % 2 == 1)
    P = (P * k);

return P;
}


struct p_str{
    ll x, y;
};

string _reverse(string s){
    for(ll i = 0, j = s.length() - 1; i < j; i++, j--) {
        char t = s[i];
        s[i] = s[j];
        s[j] = t;
    }
    return s;
}


void solve(){
    string s, t;
    cin >> s >> t;

    ll n = s.length();
    ll m = t.length();

    ll dp[n][m];
    memset(dp, 0, sizeof(dp));

    dp[0][0] = (s[0] == t[0]);
    for(ll i = 1; i < n; i++) {
        dp[i][0] = max(dp[i-1][0], (s[i] == t[0]) );
    }
    for(ll i = 1; i < m; i++) {
        dp[0][i] = max(dp[0][i-1], (s[0] == t[i]) );
    }
    for(ll i = 1; i < n; i++) {
        for(ll j = 1; j < m; j++) {
            if(s[i] == t[j]) {
                dp[i][j] = dp[i-1][j-1] + 1;
            }
            else {
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }
    }

    // cout << "dp \n";
    // for(ll i = 0; i < n; i++) {
    //     for(ll j = 0; j < m; j++) {
    //         cout << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }

    string ans = "";
    
    ll x = n - 1;
    ll y = m - 1;
    while(x >= 0 && y >= 0) {

        // cout << "x " << x << " y " << y << endl;

        if(s[x] == t[y]) {
            ans += string(1, s[x]);
            x--;
            y--;
        }
        else if(y - 1 >= 0 && x - 1 >= 0 && dp[x - 1][y] >= dp[x][y - 1]) {
            x--;
        }
        else {
            y--;
        }
    }

    cout << _reverse(ans) << endl;
}



int main(){


    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t=1;

    // init();

    // cin>>t;

    while(t--){

        solve();
    }
    return 0;
}


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

int main() {
  string w, tmp;

  cin >> w;
  transform(w.begin(), w.end(), w.begin(), ::tolower);

  // string string = "Abc";
  // std::transform(string.cbegin(), string.cend(), string.begin(), ::toupper);
  // cout << string;

  int i = 0;
  while(cin >> tmp) {
    if(tmp == "END_OF_TEXT") break;

    transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
    if(tmp == w) i++;
  }

  cout << i << endl;
  return 0;
}



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

using namespace std;

#define ll long long int
#define ld long double
#define MAX 1000000000
#define MOD 1000000007

int main(){

    ll n1,k,i;
    cin >> n1;

    if(n1==2){
        cout << 1 << endl;
        return 0;
    }

    ll cnt1 = 0;
    ll cnt2 = 0;

    ll n2 = n1-1;

    vector<ll> a,b;

    for(i=2;i<=sqrt(n2);i++){
        if(n2%i==0){
            if(n2==n2/i){
                cnt1++;
                b.push_back(i);
            }
            else{
                cnt1++;
                cnt1++;
                b.push_back(i);
                b.push_back(n2/i);
            }
        }
    }
    b.push_back(n2);

/*
    for(i=0;i<b.size();i++){
        cout << b[i] << " ";
    }
    cout << endl;
*/

    for(i=2;i<=sqrt(n1);i++){
        if(n1%i==0){
            if(n1==n1/i){
                a.push_back(i);
            }
            else{
                a.push_back(i);
                a.push_back(n1/i);
            }
        }
    }
    a.push_back(n1);
/*
    for(i=0;i<a.size();i++){
        cout << a[i] << " ";
    }
    cout << endl;
*/
    for(i=0;i<a.size();i++){

        k = a[i];

        ll n = n1;

        while(n>=k){

            if(n%k==0){
                n=n/k;
            }
            else{
                n=n%k;
            }

        }

        if(n==1){
            b.push_back(k);
            cnt2++;
        }

    }

    sort(b.begin(),b.end());

    vector<ll> c;

    for(i=0;i<b.size()-1;i++){
        if(b[i]==b[i+1]){
        }
        else{
            c.push_back(b[i]);
        }
    }

    if(b[b.size()-1]!=b[b.size()-2]){
        c.push_back(b[b.size()-1]);
    }

    cout << c.size() << endl;

}




















Measured memory_bytes: 384
def main():
  from fractions import gcd
  n=int(input())
  num=list(map(int,input().split()))
      
  gcdl=[0]*n
  gcdr=[0]*n
  gcdl[0],gcdr[0]=num[0],num[-1]
  for i in range(n-1):
    gcdl[i+1]=gcd(num[i+1],gcdl[i])
    gcdr[i+1]=gcd(num[-i-2],gcdr[i])

  ans=0
  for i in range(n):
    if i!=0 and i!=n-1:
      test=gcd(gcdl[i-1],gcdr[-i-2])
    elif i==0:
      test=gcdr[-2]
    else:
      test=gcdl[-2]

    if test>ans:
      ans=test
  print(ans)
 
if __name__=='__main__':
  main()

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

int main() {
    string S;
    int K;
    cin >> K >> S;

    if (S.size() <= K) {
        cout << S << endl;
    }
    else {
        for (int i = 0; i < K; i++) cout << S[i];
        cout << "..." << endl;
    }
    
}

Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

void solve()
{
    int a, b, t; cin >> a >> b >> t;
    int ans = 0;
    for(int i = 1; i <= t; i++)
    {
        if(i % a == 0) ans += b;
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 256
'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

def gcd(a,b):
    return a if b == 0 else gcd(b,a%b)

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))


Measured memory_bytes: 3064
import sys
sys.setrecursionlimit(5 * 10**5)
input = sys.stdin.readline

y, m, d = map(int, input().split("/"))

if y == 2019:
    if m >= 5:
        print("TBD")
    else:
        print("Heisei")
elif y > 2019:
    print("TBD")
else:
    print("Heisei")


Measured memory_bytes: 2940
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]

class Union:
  def __init__(s, n):
    s.N = n
    s.L = [-1] * n

  def root(s, x):
    if s.L[x] < 0:
      return x, -s.L[x]
    return s.root(s.L[x])

  def merge(s, x, y):
    a, ar = s.root(x)
    b, br = s.root(y)
    if a == b:
      return True
    if ar < br:
      s.L[b] -= ar
      s.L[a] = b
    else:
      s.L[a] -= br
      s.L[b] = a
    return False

  def getList(s):
    D = []
    DN = [0] * N
    for i in range(N):
      if s.L[i] < 0:
        DN[i] = len(D)
        D.append([])
    for i in range(N):
      D[DN[s.root(i)[0]]].append(i)
    return D

M = 10**5 + 1
xL = [-1] * M
yL = [-1] * M
uni = Union(N)

for i in range(N):
  x = xy[i][0]
  y = xy[i][1]
  if xL[x] != -1:
    uni.merge(xL[x], i)
  if yL[y] != -1:
    uni.merge(yL[y], i)
  xL[x] = i
  yL[y] = i

L = uni.getList()
ans = 0
for t in L:
  xL = [0] * M
  yL = [0] * M
  xN = 0
  yN = 0
  for i in t:
    x, y = xy[i]
    if xL[x] == 0:
      xL[x] = 1
      xN += 1
    if yL[y] == 0:
      yL[y] = 1
      yN += 1
  ans += xN * yN - len(t)

print(ans)

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

int main() {
  int N;
  cin >> N;    
  long ans=0;
  for (int i=1;i<N+1; i++){
   if( (i % 3 !=0)&&(i%5 !=0)){
    ans =  ans +i; 
   }
  }
  cout << ans << endl;
  return 0;
  
}
    

Measured memory_bytes: 3676
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
 
int main(){
    ll N;
  	ll a, b;
  	ll count, ans;
   	
  	cin >> N;
	count = 0;

  	rep(a, N){
      rep(b, N){
          ans = a * b;
          if(a*b < N) count++;
          else break;
      }
    }
  	cout << count;
    return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  int ans=0;
  for(int i=a;i<=b;i++){
    if(i/10000==i%10&&(i/1000)%10==(i/10)%10){ans++;}
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
from itertools import permutations

n=int(input())
P=list(map(str,input().split()))
Q=list(map(str,input().split()))

S=sorted(P)

S=list(permutations(S))
A=[]
for i in S:
    A.append(int("".join(i)))

A.sort()

for i in range(len(A)):
    if A[i]==int("".join(P)):
        pp=i
    if A[i]==int("".join(Q)):
        qq=i
print(abs(pp-qq))

Measured memory_bytes: 46572
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#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)
#define bit(n) (1LL << (n))
#define sz(x) ((ll)(x).size())
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() {
  ll A, B, K;
  cin >> A >> B >> K;

  ll a = min(A, K);
  A -= a, K -= a;

  ll b = min(B, K);
  B -= b, K -= b;

  cout << A << ' ' << B << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<(int)N;i++)
int D,G,A=1e9;
vector<int> p(11),c(11);
void Bin(string str,int n)
{
  if(n==0)
  {
    int point=0,count=0,pos=D-1;
    for(char x:str)
    {
      if(x=='1')
      {
        rep(j,p.at(pos))
        {
          count++;
          point+=pos+1;
          if(j==p.at(pos)-1){point+=c.at(pos);}
          if(point>=G){A=min(A,count);break;}
        }
      }
      pos--;
    }
  }
  else
  {
    Bin(str+"0",n-1);
    Bin(str+"1",n-1);
  }
}
int main()
{
  string str="";
  cin>>D>>G;
  G/=100;
  rep(i,D){cin>>p.at(i)>>c.at(i);c.at(i)/=100;}
  Bin(str,D);
  cout<<A<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
#define all(v) v.begin(), v.end()
const int INF = 1 << 30;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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() {
    ll n,x,y;
    cin >> n >> x >> y;
    cout << ((n + x - 1) / x) * y << "\n";
    return 0;
}

Measured memory_bytes: 3620
def main():
  import sys
  b=sys.stdin.buffer
  h,w=map(int,b.readline().split())
  x=w+1
  s=[c>>3for c in b.read()]
  dp=[10000]*h*x
  a=p=s[0]
  dp[0]=b=q=5-a
  for i in range(1,w):
    t=s[i]
    dp[i]=b=b+(a^t)
    a=t
  for i in range(x,h*x,x):
    t=s[i]
    dp[i]=b=q=q+(p^t)
    a=p=t
    for j in range(1,w):
      k=i+j
      sk=s[k]
      t=b+(a^sk)
      l=k-x
      u=dp[l]+(s[l]^sk)
      if t>u:t=u
      dp[k]=b=t
      a=sk
  print(b+1>>1)
main()

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

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9+7
#define PB push_back
#define MP make_pair
// #define F first
// #define S second
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl //　少数の精度を高くする出力

int main(){
    ll sum;
    ll X;
    cin >> X;
    int count = 0;
    sum = 100;
    while (sum < X) {
        sum = sum + sum/100;
        count += 1;
    }

    cout << count << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
using namespace std;
 
#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int n, m, t[111], p[111], x[111], sum;
signed main(){
	cin >> n;
	for(int i=1;i<1+n;i++){
		cin >> t[i];
		sum += t[i];
	}
	cin >> m;
	for(int i=1;i<1+m;i++){
		cin >> p[i] >> x[i];
		cout << sum - t[p[i]] + x[i] <<endl;
	}
 
	
 
return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
red = [False for i in range(N+1)]
red[1] = True
box = [1 for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    if red[x]:
        red[y] = True
    box[x] -= 1
    box[y] += 1
    if box[x] == 0:
        red[x] = False

ans = 0
for i in range(1, N+1):
    if red[i] and box[i] > 0:
        ans += 1
print(ans)

Measured memory_bytes: 4760
N,M=map(int,input().split())
A=[0]*M
for i in range(M):
    A[i]=int(input())
A=set(A)

K=10**9+7

X=[0]*(N+1)
X[0]=1
X[1]=1*(1 not in A)

for i in range(2,N+1):
    if i not in  A:
        X[i]=(X[i-1]+X[i-2])%K
print(X[-1])


Measured memory_bytes: 90624
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

void max_self(ll& a, ll b) {
	a = max(a, b);
}

int main() {
	int n;
	cin >> n;
	int base = 1;
	while (base <= n) {
		base *= 2;
	}
	vector<ll> tree(base * 2), dp(n + 1), height(n), weight(n);
	ll ans = 0;
	for (int i = 0; i < n; ++i) {
		cin >> height[i];
	}
	for (int i = 0; i < n; ++i) {
		cin >> weight[i];
	}
	for (int flower = 0; flower < n; ++flower) {
		ll best = 0, x = height[flower] + base;
		while (x > 1) {
			if (x % 2 == 1) {
				max_self(best, tree[x - 1]);
			}
			x /= 2;
		}

		dp[height[flower]] = weight[flower] + best;

		for (ll i = height[flower] + base; i >= 1; i /= 2) {
		    max_self(tree[i], dp[height[flower]]);
		}
	}
	for (auto each : dp) {
		max_self(ans, each);
	}
	cout << ans << endl;
}


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

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for (auto &i : mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template <class T> ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template <class T> istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template <class T> ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll a, b;
    cin >> a >> b;
    cout << a * b << '\n';
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}


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

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template <typename T> using pq = priority_queue<T>;
template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for (auto &i : mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template <class T> ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template <class T> istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template <class T> ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll x;
    cin>>x;
    if (x >= 30) {
        cout << "Yes" << '\n';
    } else {
        cout << "No" << '\n';
    }
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}


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

using namespace std;

int main() {
    int r, c, table[101][101] = {};
    cin >> r >> c;
    for (int i = 0; i < r; ++i) {
        for (int j = 0; j < c; ++j) {
            cin >> table[i][j];
            table[r][j] += table[i][j];
            table[i][c] += table[i][j];
            table[r][c] += table[i][j];
        }
    }
    for (int i = 0; i <= r; ++i) {
        for (int j = 0; j < c; ++j) {
            cout << table[i][j] << ' ';
        }
        cout << table[i][c] << endl;
    }
    return 0;
}


Measured memory_bytes: 3140
{-# LANGUAGE BangPatterns #-}
module Main (main) where

import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as C8
import Data.Bool
import Data.List

main :: IO ()
main = do
  readStrings >>= print . showAnswer . solve . head

type Input  = String
type Output = Bool

solve :: String -> Output
solve = all ((==1) . length) . group . sort

showAnswer :: Output -> Answer
showAnswer = String . bool "no" "yes"

-- utils
readStrings :: IO [String]
readStrings = map C8.unpack . C8.words <$> C8.getLine

data Answer
  = YesNo Bool
  | YESNO Bool
  | AB Bool
  | Number Int
  | String String
  | ByteString ByteString
  | Compare Ordering
  | Compare2 Ordering

instance Show Answer where
  show (YesNo b)       = bool "No" "Yes"  b
  show (YESNO b)       = bool "NO" "YES"  b
  show (AB b)          = bool "B"  "A"    b
  show (Number i)      = show i
  show (String s)      = s
  show (ByteString bs) = C8.unpack bs
  show (Compare o)     = ordering "<" "=" ">" o
  show (Compare2 o)    = ordering "Right" "Balanced" "Left" o

ordering :: a -> a -> a -> Ordering -> a
ordering lt eq gt o = case o of
  LT -> lt
  EQ -> eq
  GT -> gt

-- | k 番目の文字に関数 f を適用する
indexMapBS :: Int -> (Char -> Char) -> ByteString -> ByteString
indexMapBS k f s = C8.concat [s1, C8.singleton (f c), s3]
  where
    (s1, s2) = C8.splitAt (k-1) s
    c = C8.head s2
    s3 = C8.tail s2

Measured memory_bytes: 380
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
long long getDigit(long long n);      // 数字の桁数を取得する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      ((a)/GCD((a),(b))*(b))
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;

// code
// ------------------------------------------------
int main()
{

  ll n,k;
  cin >>n >> k;
  cout<<n%k<<endl;

  return 0;
}
// funcの実体
// ------------------------------------------------
ll getDigit(ll n)
{
  int i = 1;
  while(1)
  {
    n = n / 10;
    if(n == 0)
      break;
    i++;
  }
  return i;
}
ll CalcSumOfDigit(ll n)
{
  ll s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


Measured memory_bytes: 256
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<string>
using namespace std;

const long mod = 1000000007;
const long indlim = 5368709119;
long gcd(long x, long y) { if (x > y) { return gcd(y, x); } long r; while (y != 0) { r = x % y; x = y; y = r; }return x; }
long lcm(long x, long y) { return(x / gcd(x, y)) * y; }
long fact(long x) { if (x == 0) return 1; else return((fact(x - 1) * x) % mod); }
long mybase(long N, long B) { if (N == 0) return 0; string S = ""; while (N != 0) { string M = to_string(N % B); N -= N % B; N /= B; S = M + S; }return stol(S); }
void indexsort(long* first, long* last, long* func) { sort(first, last, [&](long a, long b) {return func[a] < func[b]; }); }
//--------------------

int main() {

	double res; 
	long N, K; cin >> N >> K;
	double sum = 0; 
	for (int i = 1; i <= N; i++) { //さいころの面
		long beki = 0;
		while (pow(2, beki) * i < K) beki++;
		
		sum += pow(0.5, beki);
	}

	res = sum / N;

	cout << setprecision(20) << res <<  endl;
}

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

using namespace std;

int main()
{
    int n,m;
    cin >> n >> m;
    
    int TotalPoint=0;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
        TotalPoint+=a[i];
    }

    sort(a.begin(),a.end());
    
    if(a[n-m]>=(double)TotalPoint/(4*m)) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3640
#include <iostream>

int main()
{
  int A, B, C, D, E, F;
  std::cin >> A >> B >> C >> D >> E >> F;
  A *= 100;
  B *= 100;

  int max_A = F / A;
  int max_B = F / B;
  int max_C = F / C;
  int max_D = F / D;

  //std::cout << "max_A: " << max_A
  //          << "max_B: " << max_B
  //          << "max_C: " << max_C
  //          << "max_D: " << max_D
  //          << std::endl;

  float density = 0.0;
  float max_density = -1;
  int max_water = 0;
  int max_suger = 0;
  for(int a=0; a<=max_A; a++) {
    for(int b=0; b<=max_B; b++) {
      int water = a*A + b*B;
      if(water == 0 || F < water) {
        continue;
      }

      for(int c=0; c<max_C; c++) {
        for(int d=0; d<max_D; d++) {
          int suger = c*C + d*D;
          // not melted
          if(E * (water/100) < suger) continue;
          // too heavy
          if(F < water + suger) continue;

          density = 100 * suger /(float)(water + suger);
          // std::cout <<  "w: " << water
          //           << " s: " << suger
          //           << " d: " << density
          //           << " m: " << max_density
          //           << std::endl;
          if(max_density < density) {
            max_density = density;
            max_water = water;
            max_suger = suger;
          }
        }
      }
    }
  }

  std::cout << (max_water + max_suger) << " " << max_suger << std::endl;
  return 0;
}


Measured memory_bytes: 3556
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
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;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;

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

   int n;
   cin >> n;
   vector<int> a(n);
   rep(i, 0, n) cin >> a[i];

   map<int, int> mp;
   rep(i, 0, n) { mp[a[i]]++; }
   rep(i, 0, n) {
      if (mp[a[i]] != 1) {
         cout << "NO" << endl;
         return 0;
      }
   }
   cout << "YES" << endl;
   return 0;
}

Measured memory_bytes: 10368
#include <iostream>
#include <bits/stdc++.h>
#include <string.h>
#define mem(a,b) memset(a,b,sizeof(a))
 
using namespace std;
const int MOD=1e9+7;
typedef long long ll;
const int MAXN=1e5+15;
const ll INF=0x3f3f3f3f;
 
typedef pair<ll,ll>PA;
 
inline ll qpow(ll x,ll n){ll res=1;for(;n;n>>=1){if(n&1)res=(res*x);x=(x*x);}return res;}
pair<ll,ll>P;
vector<PA> V;
multiset<ll>R,B;
int cmp(PA a,PA b)
{
    return a.first<b.first;
}
int main()
{
    int n;
    ll x,y;
    ll res2,ans;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x>>y;
        V.push_back(make_pair(min(x,y),max(x,y)));
        R.insert(min(x,y));
        B.insert(max(x,y));
    }
    ll maR=-INF,maB=-INF;
    ll miR=INF,miB=INF;
    int col_max=0,col_min=0;
    sort(V.begin(),V.end(),cmp);
    for(int i=0;i<V.size();i++)
    {
        maR=max(V[i].first,maR);
        maB=max(V[i].second,maB);
        miR=min(V[i].first,miR);
        miB=min(V[i].second,miB);
    }
 
    ans=(maR-miR)*(maB-miB);
    //cout<<ans<<endl;
    for(int i=0;i<V.size();i++)
    {
        R.erase(R.find(V[i].first));
        B.insert(V[i].first);
        //swap
        B.erase(B.find(V[i].second));
        R.insert(V[i].second);
 
        //cout<<( *R.rbegin()-*R.begin() )<<" "<<( *B.rbegin()-*B.begin())<<endl;
        ans= min (ans,( *R.rbegin()-*R.begin() )*( *B.rbegin()-*B.begin()) );
    }
    cout<<ans<<endl;
    return 0;
}


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

int main () {
  int a;
  cin >> a;
  bool ans = false;
  for (int i = 1; i < 10; i++){
    if ((a%i == 0) && (a/i < 10)) {
      ans = true;
      break;
    }
  }
  if (ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: u64 = sc.next();
    let mut ans = std::u64::MAX;

    for a in 1.. {
        if a * a > n {
            break;
        }

        if n % a == 0 {
            let b = n / a;
            ans = std::cmp::min(ans, a + b - 2);
        }
    }
    println!("{}", ans);
}

/* ========== Scanner ========== */

struct Scanner<R: Read> {
    reader: R,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self
            .reader
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            token.parse::<T>().ok()
        }
    }

    fn next<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.read() {
            s
        } else {
            writeln!(stderr(), "Terminated with EOF").unwrap();
            std::process::exit(0);
        }
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next()).collect()
    }

    fn char(&mut self) -> char {
        self.next::<String>().chars().next().unwrap()
    }
}


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

int main(void){
    int x,y;
    while(true) {
        cin >> x;
        cin >> y;
        if(x == 0 && y == 0) {
            break;
        }
        if(x < y){
            cout << x << " " << y << endl;
        }
        else {
            cout << y << " " << x << endl;
        }
    }
}



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

int main() {
    string s;
    cin>>s;
    if (s.at(0)-48==s.at(1)-48&&s.at(1)-48==s.at(2)-48) {
        cout<<"Yes"<<endl;
    } else if (s.at(1)-48==s.at(2)-48&&s.at(2)-48==s.at(3)-48) {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#include <utility>
#include <set>
#include <stack>
#include <deque>
#include <ctime>
#include <random>
#include <cassert>
#include <cmath>
#include <climits>
#include <queue>
#include <cstring>
#include <bitset>
#include <iomanip>
#include <chrono>

/*
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("popcnt")
#pragma GCC target("avx2")
*/


#ifdef LOCAL
	#define dbg(x) cout << #x << " : " << x << endl;
#else 
	#define dbg(x)
#endif

#define int long long
#define fi(a,b) for (int i=a;i<b;i++)
#define fj(a,b) for (int j=a;j<b;j++)
#define fk(a,b) for (int k=a;k<b;k++)
#define fi1(a,b) for (int i=a-1;i>=b;i--)
#define fj1(a,b) for (int j=a-1;j>=b;j--)
#define fk1(a,b) for (int k=a-1;k>=b;k--)
#define fx(x,a) for (auto& x : a)
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define rep1(i, a, b) for (int i = a - 1; i >= b; --i)
#define siz(x) (int)x.size()
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;

template<typename T1, typename T2>inline void mine(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void maxe(T1 &x, T2 y) { if (x < y) x = y; }

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << ' ';
    return a;
}


typedef long long ll;
typedef unsigned long long ull;
typedef char ch;
typedef string str;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<ch> vch;
typedef vector<vch> vvch;
typedef vector<str> vs;



const int MOD = 1000000007;
const int INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const int MX = 200010;
const double EPS = 1e-9;


mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


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

    int a, b, n;
    cin >> a >> b >> n;
    if (n >= b - 1)
    	cout << a * (b - 1) / b;
    else
    	cout << a * n / b;
}

Measured memory_bytes: 3644
l,r = map(int,input().split())
if (r - l) >= 2018:
  print(0)
  exit()
rr = r%2019
lr = l%2019
if lr >= rr:
  print(0)
  exit()
mi = 2018
if (rr - lr) >=673:
  print(0)
  exit()
for i in range(lr,rr):
  for j in range(i+1,rr+1):
    a = (i*j)%2019
    if a < mi:
      mi = a
print(mi)
    
  
  


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <map>

using namespace std;

int main(){

    int N;
    string S;
    cin >> N >> S;

    map <char, int> M;

    for (int i = 0; i < N; i++){
        M[S[i]]++;
    }

    long long max = 1000000007;
    long long ans = 1;

    for (int i = 'a'; i <= 'z'; i++){
        char a = i;
        ans = ans * (M[i] + 1);
        if (i == 'z'){
            ans -= 1;
        }
        ans = ans % max;
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
inline long long read(){
    long long X=0,w=1; char ch=0;
    while(ch<'0' || ch>'9') {if(ch=='-') w=-1;ch=getchar();}
    while(ch>='0' && ch<='9') X=(X<<3)+(X<<1)+ch-'0',ch=getchar();
    return X*w;
}
const int maxn=1e6+10;
int a,b,c;
int main(){
	a=read(),b=read();
	for(int i=1;i<=3;i++){
		int now=a*b*i;
		if(now%2==1){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

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

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

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

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

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

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

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

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

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

    ($next:expr, parser) => {
        $next
    };

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

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

#[allow(dead_code)]
struct Edge {
    from: usize,
    to: usize,
}

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1_000_000_007;

fn main() {
    input! {
        n: usize,
        x: [usize; n],
    }

    let mut v = vec![];
    for (i, x) in x.into_iter().enumerate() {
        v.push((x, i));
    }
    v.sort();
    let mut ans = vec![0; n];
    for i in 0..n {
        if i < n / 2 {
            ans[v[i].1] = v[n / 2].0;
        } else {
            ans[v[i].1] = v[n / 2 - 1].0;
        }
    }
    for x in ans {
        println!("{}", x);
    }
}


Measured memory_bytes: 13548
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  vector<vector<long long int> >in1(a);
  vector<vector<long long int> >in2(b);
  
  rep(i,a)rep(j,b){
    long long int tmp;cin>>tmp;
    in1[i].pb(tmp);
  }
  rep(i,b)rep(j,c){
    long long int tmp;cin>>tmp;
    in2[i].pb(tmp);
  }
  rep(i,a){
    bool h=false;
    rep(j,c){
      long long int sum=0;
      rep(k,b){
	sum+=in1[i][k]*in2[k][j];
      }
      if(h)cout<<" ";
      cout<<sum;
      h=true;
    }
    cout<<endl;
  }
}

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

int op(int a, int b) {
    return max(a, b);
}

int e() {
    return (int)0;
}

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

    segtree<int, op, e> seg(600010);
    int ans = 0;
    rep(i, n) {
        int l = max(0, a[i] - k);
        int r = min(a[i] + k, 300000);
        int tmp = seg.prod(l, r+1) + 1;
        ans = max(ans, tmp);
        seg.set(a[i], tmp);
    }
    cout << ans << endl;
}

Measured memory_bytes: 14900
import java.util.*;
import java.io.*;
public class Main {
    static int dp[];
    static ArrayList<Integer> al[];
    static boolean vis[];
    
    static void DFS(int node)
    {
        if(!vis[node])
        {
            vis[node]=true;
            if(al[node].size()==0)
            {
                dp[node]=0;
            }
            else
            {
                for(int i=0;i<al[node].size();i++)
                {
                    if(!vis[al[node].get(i)])
                    {
                        DFS(al[node].get(i));
                    }
                    dp[node]=Math.max(dp[node],dp[al[node].get(i)]+1);
                }
            }
        }
    }
    
    public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      PrintWriter w = new PrintWriter(System.out);
      
      int n = sc.nextInt();
      int m = sc.nextInt();
      al = new ArrayList[n];
      vis=new boolean[n];
      Arrays.setAll(al,e->new ArrayList());
      dp = new int[n];
     for(int i=0;i<m;i++) 
     {
         int temp1 = sc.nextInt()-1;
         int temp2 = sc.nextInt()-1;
         al[temp1].add(temp2);
     }
     for(int i=0;i<n;i++)
     {
         if(!vis[i])
         {
             DFS(i);
         }
     }
     int max = 0;
     for(int i=0;i<n;i++)
     {
         //w.print(dp[i]+" ");
         if(dp[i]>max)
         {
             max = dp[i];
         }
     }
     w.println(max);
      w.close();
    }
}

Measured memory_bytes: 76628
// by DenyTianly
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

const int inf = 1 << 26;

int s[1005];

int main(){
	int n, tot = 0;
	scanf("%d", &n);
	for ( int i = 0; i < n; i ++ ) { scanf("%d", &s[i]); tot += s[i]; }
	if(tot%10 != 0) {
		printf("%d\n", tot);
		return 0;
	}
	
	sort(s, s+n);
	for ( int i = 0; i < n; i ++ ) {
		if((tot-s[i])%10 != 0) {
			printf("%d\n", tot-s[i]);
			return 0;
		}
	}
	puts("0");

	return 0;
}


Measured memory_bytes: 256