akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

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

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

typedef long long LL;

const int oo = 0x3f3f3f3f;

const int maxn = 60;

int a[3];

int main()
{
#ifdef matthew99
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	REP(i, 0, 3) scanf("%d", a + i);
	int tmp = __gcd(__gcd(a[0], a[1]), a[2]);
	a[0] /= tmp;
	a[1] /= tmp;
	a[2] /= tmp;
	int n = a[0] + a[1] + a[2];
	static char ans[maxn + 5];
	REP(i, 0, n)
	{
		static bool f[maxn + 5][maxn + 5][maxn + 5][maxn + 5];
		for (int j = 2; j >= 0; --j) if (a[j] > 0)
		{
			ans[i] = 'a' + j;
			--a[j];
			memset(f, 0, sizeof f);
			f[a[0]][a[1]][a[2]][0] = 1;
			for (int x = a[0]; x >= 0; --x) for (int y = a[1]; y >= 0; --y) for (int z = a[2]; z >= 0; --z)
				REP(l, 0, i + 1)
				{
					if (f[x][y][z][l])
					{
						REP(k, 0, 3)
						{
							int b[3] = {x, y, z};
							if (b[k])
							{
								--b[k];
								if (ans[l] <= 'a' + k)
								{
									int nxtl = l;
									if (ans[l] == 'a' + k) nxtl = (nxtl + 1) % (i + 1);
									else nxtl = 0;
									f[b[0]][b[1]][b[2]][nxtl] = 1;
								}
							}
						}
					}
				}
			if (f[0][0][0][0]) break;
			else ++a[j];
		}
	}
	REP(i, 0, tmp) printf("%s", ans);
	return 0;
}


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

int main(){
    int a,b, cnt = 0;
    scanf("%d %d", &a, &b);
    
    for(int i = 1; i < 13; i++)
        if(a > i || (a == i && b >= i)){
            cnt++;
        }

    printf("%d\n", cnt);
    return 0;
}

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

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

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

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

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


int main()
{
  string s; cin >> s;
  int n = s.size();
  int p = n/2;
  int g = n-p;
  int ans = 0;
  rep(i, g) {
    if(s[i] == 'p') --ans;
  }
  rep(i, p) {
    if(s[g+i] == 'g') ++ans;
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
#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<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
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 complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

int prime[55555];
bool is_prime[60000];

void sieve(int n) {
    int p = 0;
    rep(i, n + 1) is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;
    Rep(i, 2, n + 1) {
        if(is_prime[i]) {
            prime[p ++] = i;
            for(int j = 2 * i; j <= n; j += i) is_prime[j] = false;
        }
    }
    return;
}

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

  int N; cin >> N;
  sieve(55555);
  int co = 0;
  vector<int> a;
  int i = 1;
  while(co <= N) {
    if(prime[i] % 5 == 1) {
        co ++;
        a.push_back(prime[i]);
    }
    i ++;
  }
  rep(i, N) {
      cout << a[i];
      if(i != N - 1) cout << " ";
      else cout << endl;
  }

  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  string S(N,'0');
  cin>>S;
  
  int count = 0;
  
  for(int i=0;i<N-2;i++){
    
    if(S.at(i) == 'A' && S.at(i+1) == 'B' && S.at(i+2) == 'C'){
      count++;
    }
    
  }
  
  cout<<count<<endl;
  
  return 0;
  
}

Measured memory_bytes: 256
import numpy as np
n=int(input())
a=input().split()
a=np.array(a,dtype='int32')
k=0
x=0
for i in range(n):
	if a[i]==x+1:
		x+=1
	else:
		k+=1
if k>=n:
	print('-1')
else:
	print(k)

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

signed main(void)
{
	int x;
	long long a, b;

	cin >> x;
	for(int i = -1000; i <= 1000; i++)
	{
		a = pow(i, 5);
		for(int j = -1000; j <= 1000; j++)
		{
			b = pow(j, 5); 
			if (a - b == x)
			{
				cout << i << " " << j << endl;
				return 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 4004
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<vector>
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
template<class T>inline void read(T &res)
{
char c;T flag=1;
while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;res=c-'0';
while((c=getchar())>='0'&&c<='9')res=res*10+c-'0';res*=flag;
}
map<string,int>m;
int main(){
	string tmp,s,t;
	cin>>s>>t;
	int x,y;
	cin>>x>>y;
	m[s]=x;m[t]=y;
	cin>>tmp;
	m[tmp]--;
	printf("%d %d",m[s],m[t]);
	return 0;
}


Measured memory_bytes: 256
void main() {
  problem();
}

void problem() {
  auto N = scan!int;
  auto X = scan!int;
  auto T = scan!int;

  int solve() {
    auto t = N % X == 0 ? N / X : 1 + N / X;
    return t * T;
  }

  solve().writeln;
}

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

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");

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


Measured memory_bytes: 2708
N = int(input())
H = list(map(int, input().split()))

for i in range(N-1):
    if H[i] > H[i-1]:
        H[i] -= 1


for i in range(N-1):
    if H[i] > H[i+1]:
        print("No")
        exit()

print("Yes")


Measured memory_bytes: 14252
{-# LANGUAGE FlexibleInstances    #-}
{-# LANGUAGE TypeSynonymInstances #-}

import           Control.Applicative
import           Control.DeepSeq
import           Control.Monad
import           Control.Monad.ST
import qualified Data.Array                  as A
import qualified Data.Array.IArray           as IA
import qualified Data.Array.IO               as AI
import qualified Data.Array.MArray           as MA
import qualified Data.Array.ST               as STA
import qualified Data.Array.Unboxed          as AU
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import qualified Data.Graph                  as G
import           Data.Int
import qualified Data.IntMap                 as IM
import qualified Data.IntSet                 as IS
import           Data.List
import qualified Data.Map.Strict             as M
import           Data.Maybe
import           Data.Ord
import qualified Data.Sequence               as SQ
import qualified Data.Set                    as S
import           Data.Time
import qualified Data.Tree                   as T
import qualified Data.Vector                 as V
import qualified Data.Vector.Mutable         as VM
import qualified Data.Vector.Unboxed         as VU
import qualified Data.Vector.Unboxed.Mutable as VUM

readInt :: IO [Int]
readInt = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

readInts :: Int -> IO [[Int]]
readInts n = replicateM n readInt

readInteger :: IO [Integer]
readInteger = map (fst . fromJust . BS.readInteger) . BS.words <$> BS.getLine

readIntegers :: Int -> IO [[Integer]]
readIntegers n = replicateM n readInteger

readString :: IO [String]
readString = map BS.unpack . BS.words <$> BS.getLine

readStrings :: Int -> IO [[String]]
readStrings n = replicateM n <$> readString

toPair :: [a] -> (a, a)
toPair [x, y] = (x, y)

count :: Eq a => a -> [a] -> Int
count a as = length $ filter (== a) as

put :: Show a => a -> IO ()
put = putStr . show

putLn :: Show a => a -> IO ()
putLn = print

putList :: Show a => [a] -> IO ()
putList [n] = put n
putList (n:ns) = do
  put n
  putStr " "
  putList ns

putStrList :: [String] -> IO ()
putStrList [n] = putStr n
putStrList (n:ns) = do
  putStr n
  putStr " "
  putStrList ns

main = do
  a <- getLine
  b <- getLine
  if [a, b] == [reverse b, reverse a]
    then putStrLn "YES"
    else putStrLn "NO"


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

int main(void){
    int n;
    scanf("%d", &n);
    vector<ll> a(n);
    for(int i = 0; i < n; ++i){
	scanf("%lld", &a[i]);
	if(a[i] == 0){
	    printf("0\n");
	    return 0;
	}
    }
    ll ans = 1;
    ll max = 1e+18;
    for(int i = 0; i < n; ++i){
	if(ans > max / a[i]){
	    printf("-1\n");
	    return 0;
	}else{
	    ans *= a[i];
	}
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 4068
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        while(true){
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();
            if(m == -1 && f == -1 && r == -1) break; 

            if(m == -1 || f == -1) System.out.println("F");
            else if(80 <= m + f) System.out.println("A");
            else if(65 <= m + f) System.out.println("B");
            else if(50 <= m + f) System.out.println("C");
            else if(30 <= m + f) {
                if(50 <= r) System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        }

        sc.close();
    }
}


Measured memory_bytes: 26184
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;
int main() {
	int n;
	cin >> n;
	
	vector<long long> a(n);
	
	for (auto &&e : a)
		cin >> e;
	
	sort(a.begin(), a.end());
	
	long long half = n / 2;
	long long result = 0;
	for (long long i = 0; i < half; ++i) {
		if (i - 1 < 0)
			result += a[n - 1 - i] - a[n - half - 1];
		else
			result += a[n - 1 - i] - a[i - 1];
		
		if (i == half - 1 && n % 2 == 0)
			break;
		
		result += a[n - 1 - i] - a[i];
	}
	
	if (n % 2 == 1) {
		sort(a.begin(), a.end(), greater<long long>{});
		long long count = 0;
		for (long long i = 0; i < half; ++i) {
			if (i - 1 < 0)
				count += a[n - half - 1] - a[n - 1 - i];
			else
				count += a[i - 1] - a[n - 1 - i];
		
			count += a[i] - a[n - 1 - i];
		}
		
		if (result < count)
			result = count;
	}

	cout << result << endl;
}

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

int main(){
    long long int N;
    cin >> N;
    if(N%2==1){
        cout << 0 << endl;
        return 0;
    }
    long long int i=1;
    long long int count=0;
    while(1){
        long long int a=2*(pow(5,i));
        if(a<=N){
            count += N/a;
        }else{
            break;
        }
        i++;
    }
    cout << count << endl;
}

Measured memory_bytes: 4196
S = raw_input()
n = 1
for i in range(0, len(S)-1):
	n = n * 2
lstlst = []
for i in range(0, n):
	lst = []
	m = i
	for j in range(0, len(S)-1):
		if m%2 == 1: lst.append(True)
		else: lst.append(False)
		m = m/2
	lstlst.append(lst)
sum = 0
for i in range(0, n):
	tmp = S[0]
	a = 0
	for j in range(0, len(S)-1):
		if lstlst[i][j]:
			a += int(tmp)
			tmp = S[j+1]
		else:
			tmp = tmp + S[j+1]
	sum += a + int(tmp)

print sum

Measured memory_bytes: 2696
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back
#define ll long long
using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = (1 << 20);


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    ll n ,a ,sum=0;
    cin>>n>>a;
    ll h[n] ,ans = 0;
    for(int i = 0;i<n;i++)
    {
        cin>>h[i];
    }
    if(a>=n)
    {
        cout<<"0";
    } else {
        sort(h,h+n);
        for(int i = 0;i<n-a;i++)
        {
            ans = ans + h[i];
        }
        cout<<ans<<endl;
    }
	return 0;
}

Measured memory_bytes: 5192
#include <iostream>
#include <string>
using namespace std;
int main (){
    int A[100];
    int N;
    cin >> N;
    for (int i=0;i<N;i++){
        cin >> A[i];
    }
    int S;
    for (int i=1;i<=100;i++){
        for (int j=0;j<N;j++){
            if(A[j]==i){
                S++;
                j=100;
            }
        }
    }
    cout << S;
    return 0;
}


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

struct Card {char suit, value; };

void bubble(struct Card A[], int N) {
    for (int i = 0; i < N; i++){
        for (int j = N-1; j >= i+1; j--) {
            if (A[j].value < A[j-1].value) {
                Card t = A[j]; A[j] = A[j-1]; A[j-1] = t;
            }
        }
    }
}

void selection(struct Card A[], int N) {
    for (int i = 0; i < N; i++) {
        int minj = i;
        for (int j = i; j < N; j++) {
            if (A[j].value < A[minj].value) minj = j;
        }
        Card t = A[i]; A[i] = A[minj]; A[minj] = t;
    }
}

void print(struct Card A[], int N) {
    for (int i = 0; i < N; i++) {
        if (i > 0) cout << " ";
        cout << A[i].suit << A[i].value;
    }
    cout << endl;
}

//バブルソートと選択ソートの結果を比較
bool isStable(struct Card C1[], struct Card C2[], int N) {
    for (int i = 0; i < N; i++) {
        if (C1[i].suit != C2[i].suit) return false;
    }
    return true;
}

int main() {
    Card C1[100], C2[100];
    int N;
    char ch;

    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> C1[i].suit >> C1[i].value;
    }

    for (int i = 0; i < N; i++) C2[i] = C1[i];

    bubble(C1, N);
    selection(C2, N);

    print(C1, N);
    cout << "Stable" << endl;
    print(C2, N);
    if (isStable(C1, C2, N)) {
        cout << "Stable" << endl;
    } else {
        cout << "Not stable" << endl;
    }

    return 0;
}


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

void solve(long long D)
{
    cout << "Christmas";
    for (size_t i = 0; i < 25 - D; i++)
    {
        cout << " Eve";
    }
    cout << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long D;
    scanf("%lld", &D);
    solve(D);
    return 0;
}


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

int main() {
    int K, S;
    cin >> K >> S;
    int x, y;
    int ans = 0;
    for(x = 0; x <= K; ++x) {
        for(y = 0; y <= K; ++y) {
            if(S >= x+y && S-(x+y)<=K){
                ++ans;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
object Main {
  def main(args: Array[String]): Unit = {
    val nums = scala.io.StdIn.readLine.split(" ").map{_.toInt}
    if( nums( 0 )*nums( 1 ) > nums( 2 ) ) println( nums( 2 ) )
    else                                  println( nums( 0 )*nums( 1 ) )
  }
}

Measured memory_bytes: 54724
A, B = map(int, input().split())
if A == 1 or B == 1:
  if A == B:
    print('Draw')
  elif A == 1:
    print('Alice')
  elif B == 1:
    print('Bob')
else:
  if A < B:
    print('Bob')
  elif A == B:
    print('Draw')
  elif A > B:
    print('Alice')

Measured memory_bytes: 3060
import sys
# sys.setrecursionlimit(100000)
from collections import Counter


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    S = input()
    T = input()
    S_cnt = Counter(S).most_common()
    T_cnt = Counter(T).most_common()
    if len(S_cnt) != len(T_cnt):
        print("No")
        return
    for i in range(len(S_cnt)):
        if S_cnt[i][1] == T_cnt[i][1]:
            continue
        else:
            print("No")
            return
    print("Yes")
    return


if __name__ == "__main__":
    main()


Measured memory_bytes: 74404
#include<iostream>
#include<algorithm>
using namespace std;
 
int main(){
  int R;
  cin >> R;
  if(R<1200)
    cout << "ABC" <<endl;
  if((1200<=R) && (R<2800))
    cout << "ARC" <<endl;
  if(2800<=R)
    cout << "AGC" <<endl;
    
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define rep(i,x) for(int i=0;i<(x);++i)
#define rep1(i,x) for(int i=1;i<=(x);++i)
#define rrep(i,x) for(int i=(x)-1;i>=0;--i)
#define rrep1(i,x) for(int i=(x);i>=1;--i)
#define int long long
#define FOR(i,a,x) for(int i=(a);i<(x);++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>istream&operator>>(istream&is,vector<T>&vec){rep(i,vec.size())is>>vec[i];return is;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 1e9;
const ll linf = 3e18;
const double eps = 1e-9;

signed main()
{
    int A, B; cin >> A >> B;
    if (A == 0 or B == 0) {
        cout << "Zero\n";
    } else if (A > 0 && A > 0) {
        cout << "Positive\n";
    } else if (A < 0 && B < 0) {
        cout << (abs(B - A) % 2 == 1 ? "Positive" : "Negative") << endl;
    } else {
        cout << "Zero\n";
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<ll,ll> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-9;
int main(){
    int n;
    while(cin>>n){
        if((n%10000)/1000==(n%1000)/100&&(n%1000)/100==(n%100)/10&&(n%100)/10==n%10){
            if(n%10==0){
                break;
            }
            cout<<"NA"<<endl;
            continue;
        }
    int c=0;
    while(n!=6174){
        int a[4];
        a[0]=(n%10000)/1000;
        a[1]=(n%1000)/100;
        a[2]=(n%100)/10;
        a[3]=n%10;
        int p;
        sort(a,a+4);
        p=1;
        int l=0,s=0;
        for(int i=0;i<4;i++){
            s+=a[i]*p;
            p*=10;
        }
        p=1;
        for(int i=3;i>=0;i--){
            l+=a[i]*p;
            p*=10;
        }
        n=s-l;
        c++;
    }
    cout<<c<<endl;
    }
}



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

using namespace std;

int T, n, k;
int a, b, c, d;

long long calcu(int t);

int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d%d", &a, &b, &c, &d);
    n = a + b, k = (max(a, b) - 1) / (min(a, b) + 1) + 1;
    int l = 0, r = n + 1;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (calcu(mid) <= 0) l = mid + 1;
      else r = mid;
    }
    r = l + calcu(l) + 1;
    for (int i = c; i <= min(d, l); ++i) 
      putchar(i % (k + 1) ? 'A' : 'B');
    for (int i = max(c, l + 1); i <= d; ++i)
      putchar((i - r) % (k + 1) ? 'B' : 'A');
    puts("");
  }
}

long long calcu(int t) {
  int anum = a - t / (k + 1) * k - t % (k + 1),
      bnum = b - t / (k + 1);
  return bnum - 1ll * anum * k;
}


Measured memory_bytes: 384
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

const int N = 500;
int a[N];
int64 dp[N][N], sum[N];
bool visit[N][N];

int64 solve(int L, int R) {
  if (L + 1 == R) return 0;
  int64& ret = dp[L][R];
  if (visit[L][R]) return ret;
  visit[L][R] = true;
  ret = 1LL << 60;
  for (int k = 1; k < R - L; ++k) {
    ret = min(ret, solve(L, L + k) + solve(L + k, R));
  }
  ret += sum[R] - sum[L];
  return ret;
}

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    sum[i + 1] = sum[i] + a[i];
  }
  int64 ret = solve(0, n);
  printf("%lld\n", ret);
  return 0;
}


Measured memory_bytes: 2048
N = int(input())
d_list = [int(s) for s in input().split()]

d_list = sorted(d_list)

if len(d_list) % 2 != 0:
  print(0)
  sys.exit()
  
upper = len(d_list) // 2
lower = upper - 1

print(d_list[upper] - d_list[lower])

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

#define int long long

using namespace std;

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

//  freopen("input.txt", "r", stdin);
//  freopen("output.txt", "w", stdout);

    int n, d, cnt = 0;
    cin >> n >> d;

    for(int i = 0; i < n; i++) {
        int p, q;
        cin >> p >> q;
        if(p*p + q*q <= d*d)
            cnt++;
    }

    cout << cnt;

    return 0;
}


Measured memory_bytes: 3652
n=input()
mini=10000
for i in range(len(n)-2):
    x=int(n[i])
    y=int(n[i+1])
    z=int(n[i+2])
    tmp=x*100+y*10+z
    if mini>abs(753-tmp):
        mini=abs(753-tmp)
        ans=abs(753-tmp)
print(ans)

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

#define all(x) x.begin(),x.end()
#define pb(x) emplace_back(x)
#define forn(i,N) for(int i=0;i<N;i++)

using namespace std;
using ll=long long int;
using ld=long double;
using vi=vector<int>;
using vll=vector<ll>;
using vd=vector<double>;

int main() {
//freopen("input.txt","rt",stdin);
ios::sync_with_stdio(false);
cin.tie(nullptr);

string s;
cin>>s;
int N=s.length(),ans=0;
for(int i=0;i<N/2;i++) {
  if(s[i]!=s[N-i-1]) ans++;
}
cout<<ans<<endl;
return 0;
}


Measured memory_bytes: 3620
void main() {
	auto arr = 5.iota.map!(_ => ri).array;
	int res = int.max;
	do {
		int tmp;
		foreach(v; arr) {
			if(tmp % 10 != 0) tmp += 10 - (tmp % 10);
			tmp += v;
		}
		res = min(res, tmp);
	} while(nextPermutation(arr));
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  int x;
  x= 60*c-11*d;
  
  double cm;
  double pi = 3.141592653589793238462643383279;
  
  cm = sqrt(a*a+b*b-2*a*b*cos(pi*x/360));

  cout << fixed << setprecision(15) << cm << endl;
    
	return 0;
}


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


int main(){
string a;
cin >> a;
int d[4]={};
char data[3]={};
for(int i=0;i<4;i++){
  d[i]=a.at(i)-'0';
}
//cout << d[0]<<endl;
int sum=d[0];
for(int bit=0;bit<(1<<4);bit++){
  for(int i=0;i<3;i++){
    if(bit &(1<<i)){
      sum+=d[i+1];
      data[i]='+';
    }else{
      sum-=d[i+1];
      data[i]='-';
    }
  }
  if(sum==7){
    break;
  }else{
    sum = d[0];
  }
}

cout << a.at(0) << data[0] << d[1] << data[1] << d[2] << data[2]<<d[3]<<"=7"<<endl;;
}

Measured memory_bytes: 256
// Aをソート。小さい順にみる。
// visited[Ai] == falseなら、++res;
// visited[k*Ai] = true (1 <= k)をする
#include <bits/stdc++.h>
using namespace std;

bool visited[1000100];
int dupl[1000100];

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
        ++dupl[A[i]];
    }
    sort(A.begin(), A.end());
    int res = 0;
    for (int p : A) {
        if (dupl[p] <= 1 && visited[p] == false) ++res;
        if (visited[p] == false) {
            for (int k = 1; p * k <= 1000000; ++k) {
                visited[p * k] = true;
            }
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 8804
#include <bits/stdc++.h>
#define sz(arr) (int)arr.size()
#define all(arr) arr.begin(), arr.end()

using namespace std;

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

  puts(x == 3 || x == 5 || x == 7 ? "YES" : "NO");

  return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tl3;



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;

const int MAX = 1e5+5;


double p;


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

	for (int i = 0; i < n; i++) {
		if (e[i] % 2 != 0) {
			cout << "NO" << endl;
			return 0;
		}
	}

	cout << "YES" << endl;

}

Measured memory_bytes: 3780
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long X = scan.nextLong();
        long Y = scan.nextLong();
        if (X % Y == 0) {
            System.out.println(-1);
            return;
        }
        System.out.println(X);
    }
}


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

signed main() {
  int N;
  cin >> N;
  
  vector<int> A(N);
  vector<int> B(N+1);
  for( int i = 0; i < N; i++ ){
    cin >> A.at(i);
    B.at(i+1) = B.at(i) + A.at(i);
  }
  int ans = 1000000000000;
  for( int i = 1; i < N; i++ ){
    if( abs( (B.at(N)-B.at(i))-B.at(i) ) < ans ) ans = abs( (B.at(N)-B.at(i))-B.at(i) );
  }
  cout << ans << endl;
}

Measured memory_bytes: 3328
import java.util.*;

import static java.lang.System.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int[] a = new int[N];
        for (int i = 0; i < N; i++) {
            a[i] = sc.nextInt();
        }

        int aNum = 100003;     // -1〜10^5+1 -> 0〜10^5+2
        int[] nums = new int[aNum];
        for (int i = 0; i < N; i++) {
            // 最小値を-1から0にする
            nums[a[i] + 2]++;
            nums[a[i]]++;
            nums[a[i] + 1]++;
        }

        int maxNum = 0;
        for (int i = 0; i < aNum; i++) {
            if (nums[i] > maxNum) {
                maxNum = nums[i];
            }
        }

        out.println(maxNum);
    }
}

Measured memory_bytes: 52308
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<set>
#include<queue>
#include<string>
#include<sstream>
#include<iostream>
#include<sstream>
#include<stack>
#include<map>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<cstdio>
using namespace std;
int f[200];
char a[100],b[100];
int main()
{
	int k;
	scanf("%s %d", a+1, &k);
	for (int i = 0; i < k; i++)
	{
		getchar();
		char t;
		scanf("%c", &t);
		f[t] = 1;
	}
	a[0] = '0';
	int flag = 0, flag2 = 0, flag3 = 0;
	for (int i = 1; a[i] != '\0'; )
	{
		if (flag == 0)
		{
			while (f[a[i]] == 1)
			{
				flag = 1;
				a[i]++;
				if (a[i] > '9') 
				{ 
					a[i - 1]++;
					flag3=1;
					if (i == 1)flag2++; 
					i --;
					flag = 0;
					continue;
				}
			}
			i++;
		}
		else
		{
			a[i] = '0';
			while (f[a[i]] == 1)
			{
				a[i]++;
			}
			i++;
		}
		if (flag3 == 1)
		{
			flag3 = 0;
			flag = 1;
		}
	}
	if(flag2)printf("%s", a);
	else printf("%s", a+1);
}


Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
 

//result = Math.pow(num1, num3)
//StringBuffer str = new StringBuffer(hoge1);
//String hoge2 = str.reverse().toString();
//map.containsKey(A)

//Map<String, Integer> map = new HashMap<String, Integer>(n);
/*for ( キーのデータ型 key : マップの名前.keySet() ) {
	データのデータ型 data = マップの名前.get( key );
	
	// keyやdataを使った処理;
}*/
//int i = Integer.parseInt(s);
//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
//ArrayList<String> cc = new ArrayList<>(n);
//Collections.sort(list);
//Array.sort(list);
//Arrays.asList(c).contains("a")
//list.set(1,"walk");
public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	static int K;
	public static void main(String[] args) {
		int N=sc.nextInt();
		int A=sc.nextInt();
		int B=sc.nextInt();
		String S=sc.next();
		int countb=0;
		int all=0;
		for(int i=0;i<S.length();i++) {
			if(S.charAt(i)==97) {//a
				all++;
				if(all<=A+B) {
					p("Yes");
				}else {
					p("No");
				}
			}else if(S.charAt(i)==98) {//b
				countb++;
				
				if(countb<=B&&all<A+B) {
					all++;
					p("Yes");
				}else {
					p("No");
				}
			}else if(S.charAt(i)==99){//c
				p("No");
			}
		}
	}
}


Measured memory_bytes: 34904
#include <iostream>

using namespace std;

const int M = 1e9+7;
long long n, k;

struct Matrix {
  long long v[50][50];
  Matrix() {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        v[i][j] = 0;
      }
    }
  }
};

Matrix operator* (Matrix a, Matrix b) {
  Matrix c;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int l = 0; l < n; l++) {
        c.v[i][j] += a.v[i][l] * b.v[l][j];
        c.v[i][j] %= M;
      }
    }
  }
  return c;
}

Matrix a, E;

Matrix Matrix_power(Matrix a, long long n)
{
  if (n % 2) return Matrix_power(a, n-1) * a;
  if (n == 0) return E;
  return Matrix_power(a*a, n/2);
}

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

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a.v[i][j];
    }
  }

  for (int i = 0; i < n; i++) {
    E.v[i][i] = 1;
  }
  
  a = Matrix_power(a, k);
  
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ans += a.v[i][j];
      ans %= M;
    }
  }

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

Measured memory_bytes: 10368
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

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

    vector<int> A(N);
    vector<int> B(N);
    vector<int> C(N-1);

    for (int i = 0; i < N; i++)
    {
        cin >> A.at(i);
    }
    for (int i = 0; i < N; i++)
    {
        cin >> B.at(i);
    }    
    for (int i = 0; i < N-1; i++)
    {
        cin >> C.at(i);
    }

    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        ans += B.at(i);
    }
    for (int i = 1; i < N; i++)
    {
        if (A.at(i-1) + 1 == A.at(i))
        {
            ans += C.at(A.at(i-1)-1);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <string>
#include <cmath>
#include <complex>
#include <functional>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cstdlib>
#include <cctype>
#include <bitset>

#define REP(i,m,n) for(int i=m;i<(int)n;i++)
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rrep(i,n) for(int i = 1; i <= n; i++)
#define drep(i,n) for(int i = n; i >= 0; i--)
#define rp(i,c) rep(i,(int)c.size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(u) (u).rbegin(),(u).rend()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl
#define v_delete(a,b) (a).erase(remove((a).begin(), (a).end(), b), (a).end())
#define v_unique(a) (a).erase(unique((a).begin(), (a).end()), (a).end())
#define VV(T) vector<vector< T > >
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int inf=1<<28;
const double INF=1e10,EPS=1e-9;


template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}

template <class T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
template <class T> void input(T* a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }

int chmax(int& a,int b){
	if(b > a){
		a=b;
	}
	return a;
}
int chmin(int& a,int b){
	if(b < a){
		a=b;
	}
	return a;
}

int X,Y;
int m[18][18];
int dp[20][20];


int main(int argc, char const *argv[])
{
	while(cin >> X >> Y, X){
		memset(m, -1 ,sizeof(m));
		memset(dp, 0 ,sizeof(m));
		rep(i,Y){
			rep(j,X){
				cin >> m[i+1][j+1];
			}
		}
		for(int i=1;i<=X;i++){
			if(m[1][i]==1)
				dp[1][i]=0;
			else
				dp[1][i]=1;
		}
		for(int i=2;i<=Y;i++){
			for(int j=1;j<=X;j++){
				if(m[i][j]==1){
					dp[i][j]=0;
				}else if(m[i][j]== 2){
					if(m[i-1][j]==0)
						dp[i][j] += dp[i-1][j];
					if(m[i-2][j]==2)
						dp[i][j] += dp[i-2][j];
				}else{
					for(int k=-1;k<=1;k++){
						if(m[i-1][j+k]==0){
							dp[i][j] += dp[i-1][j+k];
						}
					}
					if(m[i-2][j]==2)
						dp[i][j] += dp[i-2][j];
				}
			}
		}
		int ans=0;
	//	for(int i=1;i<=Y;i++){
	//		for(int j=1;j<=X;j++){
	//			cout << dp[i][j] << " ";
	//		}
	//		cout << endl;
	//	}

		for(int i=1;i<=X;i++){
			if(m[Y][i]==0 || m[Y][i]==2 ){
				ans += dp[Y][i];
			}
			if(m[Y-1][i]==2){
				ans += dp[Y-1][i];
			}
		}
		cout  << ans << endl;

	}




	return 0;
}

Measured memory_bytes: 1164
"""
B - Some Sums
"""
ans = 0
#入力される数n, a, b
N, a, b = map(int, input().split())

def digitSum(n):
    d = str(n)   #iの数値を文字列に変換 d ←　下記eにおいてitrrableなものが求められるため文字列に変換する
    #print(d)
    e = list(map(int, d))   #1文字ずつ数値化し配列にする
    #print(e)
    f = sum(e)
    return f

#print(a, b, n)
for i in range(N+1):
    digitSum(i)
    if a <= digitSum(i) <= b:
        #print(digitSum(i))
        ans += i

print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "Yes"<<endl
#define no  cout<< "No"<<endl
#define all(v) (v).begin(),(v).end()
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using namespace std;    
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {    
       int n,x=0,s=1000000,sum=0;
       cin>>n;
      int a[n];
      for(int i=0;i<n;i++)
      {
      cin>>a[i];
      sum+=a[i];
      }
      for(int i=0;i<n-1;i++)
      {   
          x+=a[i];
          s=min(s,abs(x-abs(sum-x)));
      }
      cout<<s;
       
    }
}
// 🍪 🍪 🍪

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;
using ll = long long;

int main(){
  ll N;
  cin >> N;
  vector<vector<int>> vec(N, vector<int>(2));
  for( ll i=0; i<N; i++ ) cin >> vec.at(i).at(1) >> vec.at(i).at(0);
  sort( vec.begin(), vec.end() );
  
  ll limit_time = 0, work_time = 0;
  for( ll i=0; i<N; i++ ){
    limit_time = vec.at(i).at(0);
    work_time += vec.at(i).at(1);
    if( limit_time < work_time ){
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}


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

#define fo(i,n)         for(int i=0;i<n;i++)
#define Fo(i,k,n)       for(int i=k;i<n;i++) 
#define endl            "\n"
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define vec(x)          vector<x>
#define matrix(x)       vector<vector<x>>
#define sz(x) 			(int)x.size()
#define mem(a,b)        memset(a, b, sizeof a)
#define vii             vector<pair<int,int>>
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        (a*(b/gcd(a,b)))
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define MOD             998244353
#define deb(x)          cerr <<#x<<" = "<<x<<"\n"
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define rep(i,a,b)      for (int i = a; i<b; ++i)
#define len(s)          s.length()
#define watch(x) 		cout << #x << " = " << x << endl
#define trace(x) 		cerr << #x << " = " << x << endl
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
 
int power(int a,int b,int m=mod)
{int ans=1;while(b>0){if(b&1)ans=(ans*a)%m;a=(a*a)%m;b>>=1;}
return ans;}

void angshuGod()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

const int N = 1e5+1;
const double pi = acos(-1);

void solve(){
    
	int n; cin>>n;
	vi v(n+1);
	int cnt = 0;
	rep(i,1,n+1){
		cin>>v[i];
		if(i&1 and v[i]&1) cnt++;
	}
	cout<<cnt;
}

 
int32_t main()
{
    angshuGod();

    int t;

    t = 1;
    //cin>>t;

    while(t--){
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 3472
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    N = int(input())
    n = int(N**0.5) + 1

    def check(i, N):
        while N%i==0:
            N //= i
            if N%i==1:
                return 1
        return 0

    def yakusuu(N):
        n = int(N**.5)+1
        res1 = []
        res2 = []
        for i in range(1, n):
            if N%i==0:
                res1.append(i)
                if N!=i**2:
                    res2.append(N//i)
        res2.reverse()
        return res1+res2
        
    res = 0

    for i in range(2, n):
        if (N%i)!=1:
            res += check(i, N)
    res += len(yakusuu(N-1))

    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 40684
#include<iostream>
#include<cstdio>
#include<queue>
#define NIL (-1)

using namespace std;

struct node{
    int parent, left, right, key;
}T[500001];
int SIZE, root = NIL;

void preorder(int i){
    if(i == -1)
        return;
    printf(" %d",T[i].key);
    if(T[i].left >= 0)
        preorder(T[i].left);
    if(T[i].right >= 0)
        preorder(T[i].right);
}

void inorder(int i){
    if(i == -1) return;
    if(T[i].left >= 0)
        inorder(T[i].left);
    printf(" %d",T[i].key);
    if(T[i].right >= 0)
        inorder(T[i].right);   
}

void insert(int key){
    int x = root, y = NIL;
    while(x != NIL){
        y = x;
        x = key < T[x].key ? T[x].left : T[x].right;
    }
    T[SIZE].parent = y;

    if(y == NIL)
        root = SIZE;
    else if(key < T[y].key)
        T[y].left = SIZE;
    else
        T[y].right = SIZE;
    T[SIZE].left = NIL;
    T[SIZE].right = NIL;
    T[SIZE].key = key;
    SIZE++;
}

int main(void){
    int m;
    cin >> m;
    while(m--){
        char s[10];
        cin >> s;
        if(s[0] == 'i'){
            int key;
            scanf("%d",&key);
            insert(key);
        }else{
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }
    return 0;
}


Measured memory_bytes: 10924
n=int(input())
ac=0
wa=0
tle=0
re=0
for _ in range(n):
  s=input()
  if s=='AC':
    ac+=1
  elif s=='WA':
    wa+=1
  elif s=='TLE':
    tle+=1
  else:
    re+=1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Measured memory_bytes: 74488
#include <bits/stdc++.h>
#define x first
#define y second
#define int int long long // 2e9 & 9e18
using namespace std; const int inf = numeric_limits<int>::max();
struct __io{__io(){ios_base::Init i; ios_base::sync_with_stdio(0); cin.tie(0);}} __io; // fast I/O
#ifdef LOCAL // setting up print debugging (yes lol)
template<class K, class V>ostream& operator<<(ostream&s,const pair<K,V>&p){s<<'<'<<p.x<<','<<p.y<<'>';return s;}
template<class T, class=typename T::value_type, class=typename enable_if<!is_same<T,string>::value>::type>
ostream& operator<<(ostream&s,const T&v){s<<'[';for(auto&x:v){s<<x<<", ";}if(!v.empty()){s<<"\b\b";}s<<']';return s;}
void __prnt(){cerr<<endl;} template<class T, class...Ts>void __prnt(T&&a,Ts&&...etc){cerr<<a<<' ';__prnt(etc...);}
#define print(...) __prnt(__VA_ARGS__)
#else
#define print(...)
#endif

double pi = 3.14159265358979323846;

signed main() {
    int a, b, h, m;
    cin >> a >> b >> h >> m;

    double ma = m * pi / 30.0;
    double ha = h * pi / 6.0 + ma / 12.0;
    double hx = -a * sin(ha);
    double hy =  a * cos(ha);

    double mx = -b * sin(ma);
    double my =  b * cos(ma);
    print("H", hx, hy);
    print("M", mx, my);

    double d = sqrt(pow(hx - mx, 2) + pow(hy - my, 2));
    cout << fixed << setprecision(9) << d << endl;
}


Measured memory_bytes: 4120
import sys
from bisect import *
from collections import *
from copy import deepcopy
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N = int(input())
    AS = list(map(int, input().split()))
    ans = []
    for i in range(N):
        ans.append((AS[i],i+1))
    ans.sort()
    ans2 = []
    for a,b in ans:
        ans2.append(b)
    print(*ans2)

if __name__ == '__main__':
    main()

Measured memory_bytes: 21532