akhauriyash/Code-Regression huggingface dataset:
let x = require('fs').readFileSync('/dev/stdin', 'UTF-8');
const a = Number(x.split(' ')[0]);
const b = Number(x.split(' ')[1]);
const c = Number(x.split(' ')[2]);
if (a < b && b < c) {
  console.log('Yes');
} else {
  console.log('No');
};



Measured memory_bytes: 15096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n, k;
    cin >> n >> k;
    ll ans = 0;
    
    if (k == 0) {
        ans = n * n;
    }
    else {
        reps(b, k + 1, n + 1) {
            rep(x, (n - k) / b + 1) {
                ll l = x * b + k;
                ll r = min(n, (x + 1) * b - 1);
                
                if (l > r) {
                    break;
                }
                
                ans += r - l + 1;
            }
        }
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys

inf = float('inf')

def solve(N: int, a: "List[int]", b: "List[int]", c: "List[int]", Q: int, K: int, x: "List[int]", y: "List[int]"):
    adj = [[] for i in range(N)]
    for i in range(N-1):
        adj[a[i]].append((b[i], c[i]))
        adj[b[i]].append((a[i], c[i]))

    D = [inf for i in range(N)]
    prev = [None for i in range(N)]
    D[K] = 0
    Queue = [K]
    while len(Queue) > 0:
        u = Queue.pop()
        for v, w in adj[u]:
            if v == prev[u]:
                continue
            prev[v] = u
            D[v] = D[u] + w
            Queue.append(v)
    
    for i in range(Q):
        print(D[x[i]] + D[y[i]])
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    c = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens))-1
        b[i] = int(next(tokens))-1
        c[i] = int(next(tokens))
    Q = int(next(tokens))  # type: int
    K = int(next(tokens))-1  # type: int
    x = [int()] * (Q)  # type: "List[int]" 
    y = [int()] * (Q)  # type: "List[int]" 
    for i in range(Q):
        x[i] = int(next(tokens))-1
        y[i] = int(next(tokens))-1
    solve(N, a, b, c, Q, K, x, y)

if __name__ == '__main__':
    main()


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

using namespace std;

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

    int N, K; cin>>N>>K;
    vector<long> V;
    for (int i = 0; i < N; i++) {
        long v;
        cin>>v;
        V.push_back(v);
    }
    for (int i = 0; i < N; i++) {
        V.push_back(V[i]);
    }

    long ans = 0;
    for (int n = 0; n <= min(N, K); n++) {
        for (int i = N-n; i < N+1; i++) {
            priority_queue<long, vector<long>, greater<long>> pq;
            for (int k = 0; k < n; k++) {
                pq.push(V[i+k]);
            }
            long sum = 0;
            long c = K - n;
            while (not pq.empty()) {
                auto t = pq.top();pq.pop();
                if (c > 0 and t < 0) {
                    c--;
                } else {
                    sum += t;
                }
//                cerr << t << " ";
            }
//            cerr << endl;
            ans = max(ans, sum);
        }
    }
    cout << ans << endl;


    return 0;
}



Measured memory_bytes: 256
#pragma GCC optimize (3)
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<unordered_map>
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#include<ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>*/
//#include<ext/rope>
#define ll long long
#define ull unsigned long long
#define INFI 2147483647
#define INFL 9223372036854775807
#define INFU 18446744073709551615
using namespace std;
//using namespace __gnu_pbds;
//using namespace __gnu_cxx;
const double PI=acos(-1.0);
const double eps=1e-6;
inline int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9'){
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
template<typename T> void debug(T x)
{
    cout<<"value="<<x<<endl;
    return;
}
signed main()
{
	//ios_base::sync_with_stdio(false);
    //cin.tie(0);
    //cout.tie(0);
    int l=read(),r=read(),d=read();
    int cnt=0;
    for(int i=1;i<=1000;i++) if(d*i<=r && d*i>=l) cnt++;
    cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 3556
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        List<Character> list = new ArrayList<Character>() {{
            add('A');
            add('T');
            add('G');
            add('C');
        }};
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int len = 0, max = 0;
        for (char c : s.toCharArray()) {
            len = list.contains(c) ? (len + 1) : 0;
            max = max < len ? len : max;
        }
        System.out.println(max);
    }
}

Measured memory_bytes: 23124
#include<stdio.h>
int main(){
  int h,w,i,j;
  while(1){
  scanf("%d %d", &h, &w);
  if( w == 0 && h == 0) break;
  for(i=0;i < h;i++){
    for(j=0;j < w;j++){
      printf("#");
    }
    printf("\n");
  }
  printf("\n");
  }
  return 0;
}

  
    
    



Measured memory_bytes: 2128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

ll ll_gcd(ll a, ll b) {
    if (a < b) return ll_gcd(b, a);
    ll r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll r, g, b;
    cin >> r >> g >> b;
    if ((r * 100 + g * 10 + b) % 4 == 0)cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

#define int long long

int w[101];
int v[101];
int dp[100005][101];

int32_t main() {
	int n, ww;
	cin >> n >> ww;

	for(int i = 1; i <= n; i++)
		cin >> w[i] >> v[i];

	for(int i = 1; i <= ww; i++){
		for(int j = 1; j <= n; j++){
			dp[i][j] = max(dp[i][j-1],
					i < w[j] ? 0 : dp[i - w[j]][j-1] + v[j]);
		}
	}

	cout << dp[ww][n] << endl;

	return 0;
}


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

#define MOD 1000000007
#define SIZE_1 2000005
#define SIZE_2 1000000
#define INT_BITS 32
typedef long long int ll;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<ll> vi;

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

    int m, n;
    double sum = 0;
    cin >> n >> m;
    vi v;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        sum += x;
        v.push_back(x);
    }

    double cnd = (1.0 * sum) / (4 * m);

    int cnt = 0;
    for (int i = 0; i < n; i++)
    {
        if (v[i] >= cnd)
            cnt++;
    }
    if (cnt >= m)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}


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

#define REP(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define REPS(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define RREP(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define RREPS(i, n) for (int i = ((int)(n)); i > 0; i--)
#define IREP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define IREPS(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVISORT(v) sort(v.begin(), v.end(), greater<int>());
#define ALL(v) v.begin(), v.end()

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using ll = long long;

typedef long long ll;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const ll mod=1e9+7;
int main()
{
    cin.tie( 0 );
    ios::sync_with_stdio( false );
	
	ll w,h,x,y;
	cin>>w>>h>>x>>y;

	double ans=1.0*w*h/2.0;
	int canMalti=0;
	if(w/2.0==x&&h/2.0==y)canMalti=1;

	cout <<fixed << setprecision(10) << ans << " " << canMalti << endl;
	
    return 0;
}

Measured memory_bytes: 256
/* 
This code is written by 
	Prateek Mittal	
	# AcFreak
	PDPM IIITDMJ
	Junior
	:)

*/

#include<bits/stdc++.h>
using namespace std;

#define llint long long int
#define lint long int 
#define show(a) for(i=0;i<a.size();i++) cout<<a[i]<<" ";
#define mm 1000000007
#define REP(i,n) for(i=0;i<n;i++)
#define FOR(i,a,b) for(i=a;i<=b;i++)
#define FORD(i,a,b) for(i=a;i>=b;i--)
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) ((a)*((b)/gcd(a,b)))
#define maxm(arr) *max_element(arr.begin(),arr.end())
#define minm(arr) **min_element(arr.begin(),arr.end())


typedef vector<int >vi;
typedef vector<llint> vlli;
typedef map<int ,int >mii;


int main()
{

	string name;
	cin>>name;
	int k;
	cin>>k;

	int i,j;
	std::vector<string > v;

	//string temp;
	int n=name.length();
	for(i=0;i<n;i++)
	{
		
		//cout<<"hah"<<endl;
		for(j=1;j<=5;j++)
		{
			//temp=;
			v.pb(name.substr(i,j));
		}
	}
//	cout<<"hjdf";


	sort(v.begin(),v.end());
	v.erase(std::unique(v.begin(), v.end()),v.end());
	
	
	cout<<v[k-1]<<endl;
	return 0;
}

Measured memory_bytes: 1660
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
#define cases long long t;cin>>t;while(t--)
#define f_io ios::sync_with_stdio(false); cin.tie(0)
#define foi(a,n) for(long long i=a;i<n;i++)
#define foj(a,n) for(long long j=a;j<n;j++)
#define fok(a,n) for(long long k=a;k<n;k++)
#define ll long long
#define MOD 1000000007
#define INF 1000000000
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;

int main()
{
    f_io;
    ll n,m;
    cin >> n >> m;
    vector<ll> arr(n);
    foi(0,n)
        cin >> arr[i];
    double c = accumulate(arr.begin(),arr.end(),0);
    c/=4*m;
    sort(arr.begin(),arr.end(),greater<ll>());
    bool ck=true;
    foi(0,m)
    {
        if(arr[i]<c)
        {
            ck=false;
            break;
        }
    }
    if(ck)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 9;
const int mod = 998244353;
int fac[maxn];
int inv[maxn];
int power[maxn];

int modpow(int base, int exponent) {
  int var = base;
  int ans = 1;
  while(exponent > 0) {
    if(exponent & 1) {
      ans = (1LL * ans * var) % mod;
    }
    var = (1LL * var * var) % mod;
    exponent >>= 1;
  }
  return ans;
}
int nCr(int n, int r) {
  int num = fac[n];
  int den = (1LL * inv[r] * inv[n - r]) % mod;
  return (1LL * num * den) % mod;
}
int main() {
  int n;
  cin >> n;
  fac[0] = power[0] = 1;
  for(int i = 1; i <= n; i++) {
    fac[i] = (1LL * fac[i - 1] * i) % mod;
    power[i] = (power[i - 1] * 2LL) % mod;
  }
  inv[n] = modpow(fac[n], mod - 2);
  for(int i = n - 1; i >= 0; i--) {
    inv[i] = (1LL * inv[i + 1] * (i + 1)) % mod;
  }
  int ans = modpow(3, n);
  for(int i = (n / 2) + 1; i <= n; i++) {
    ans -= (1LL * power[n - i + 1] * nCr(n, i)) % mod; 
    ans %= mod;
  }
  cout << (ans + mod) % mod << endl;
  return 0;
}


Measured memory_bytes: 120676
s=input()
S=''.join(list(reversed(s)))
a=1
for i in range(len(S)):
    if (len(S)-a)%2==0:
        if S[a:(len(S)+a)//2]==S[(len(S)+a)//2:len(S)]:
            break
        else:
            a+=1
    else:
        a+=1
print(len(S)-a)

Measured memory_bytes: 61544
#include <bits/stdc++.h>
 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, ll> pii;
 
#define REP(a,b,c) for(ll (a)=(b);(a)<(c);(a)++)
#define PER(a,b,c) for(ll (a)=(b);(a)>=(c);(a)--)
 
template <typename T>
void ivec(vector<T> &v, ll N){
    REP(i,0,N){ T x; cin >> x; v.push_back(x); }
}

int main(){
    ll N;
    cin >> N;
    cout << (N+1) / 2 << endl;

    return 0;
}

Measured memory_bytes: 256
a, b, c, x = [int(input()) for i in range(4)] # 500, 100, 50
result = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            result += 1 if (500*i + 100*j + 50*k) == x else 0
print(result)

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

bool is_prime(int64_t x) {
  for(int64_t i = 2; i * i <= x; i++) {
    if(x % i == 0) return false;
  }
  return true;
}


int main(){
  long long n;
  cin>>n;
  if(n==2){cout<<n<<endl;return 0;}
  if(n%2==0){++n;}
  while(1){
    if(is_prime(n)){cout<<n<<endl;return 0;}
    n+=2;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

int     main(void)
{
    int base;
    int exponent;
    int answer;
    
    answer = 1;
    exponent = 3;
    scanf("%d",&base);
    while (exponent != 0)
    {
        answer *= base;
        exponent--;
    }
    printf("%d\n",answer);
    return (0);
}


Measured memory_bytes: 2084
import java.util.*;

public class Main {
	
	
    public static int returnMaxPackage(long p, int n, int k, int[] packages) {
        int i = 0;
        for (int j=0; j < k; j++) {
            long s = 0;
            while (s + packages[i] <= p) {
                s += packages[i];
                i++;
                if (i == n) return n;
            }
        }

        return i;
    }

    public static int searchMinP(int n, int k, int[] packages) {
        long left = 0;
        long right = 100000 * 10000;
        long mid;

        while (right - left > 1) {
            mid = (left + right) / 2;
            int v = returnMaxPackage(mid, n, k, packages);

            if (v >= n) {
                right = mid;
            } else {
                left = mid;
            }
        }

        return (int)right;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] packages = new int[n];
        for (int i=0; i<n; i++) {
            packages[i] = Integer.parseInt(sc.next());
        }


        int ans = searchMinP(n, k, packages);

        System.out.println(ans);
    }
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false); cin.tie(NULL);
  int a, b; cin >> a >> b;
  int cur = 1;
  
  for (int i = 0; ; i++) {
    if (cur >= b) {
      cout << i << endl;
      return 0;
    }
    cur = cur + a - 1;
  }
  return 0;
}



Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {

            //入力読取。
            string strBreak = "0";
            List<int> sumList = new List<int>();
            while(true){
                string strNum = Console.ReadLine();
                if(strBreak == strNum){
                    break;
                }
                
                //計算クラスで処理し、答えをリストに格納。
                Calculation insC = new Calculation(strNum);
                int intSum = insC.getSum();
                sumList.Add(intSum);
            }


            //出力
            foreach(int sum in sumList){
                Console.WriteLine(sum);    
            }
            
        }
    }
    
    class Calculation{
        
        private string strNum;
        private int intSum;
        
        public Calculation(string strNum){
            this.strNum = strNum;
            setSum();
        }
        
        private void setSum(){
            char[] numArray = strNum.ToCharArray();
            for(int suffix = 0; suffix < numArray.Length; suffix++){
                this.intSum += (int) char.GetNumericValue(numArray[suffix]);
            }
        }
        
        public int getSum(){
            return intSum;
        }
    }

}



Measured memory_bytes: 16024
a,b=map(int,input().split())
s=0
for i in range(a,b+1):
	j=str(i)
	l=len(j)
	m=0
	for k in range(l//2+1):
		if(j[k]!=j[l-k-1]):
			m=1
			break
			
	if(m==0):
		s+=1
print(s)		

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

int n;
char s[105];

bool chk1() {
    for (int i = 1; i <= n; i += 2) {
        if (s[i] == 'L') return 0;
    } return 1;
}

bool chk2() {
    for (int i = 2; i <= n; i += 2) {
        if (s[i] == 'R') return 0;
    } return 1;
}

int main() {
    scanf("%s", s + 1);
    n = strlen(s + 1);
    if (!chk1() || !chk2()) puts("No");
    else puts("Yes");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main() {
  std::string s;
  std::cin >> s;
  for (unsigned i = 1; i < s.size(); ++i) {
    if (s[i-1] == 'A' && s[i] == 'C') {
      std::cout << "Yes" << std::endl;
      return 0;
    }
  }
  std::cout << "No" << std::endl;
  return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:26:12 2020

@author: Kanaru Sato
"""

a,b,c = list(map(int, input().split()))

if c < a+b:
    print("No")
else:
    A = a**2
    B = b**2
    C = c**2
    l = a*c
    m = b*c
    n = a*b
    if 0 < A+B+C-2*l-2*m-2*n:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;


int main(){

  int a, b;
  int sum = 0;
  int num = 0;
  int n = 0;
  while( scanf("%d,%d", &a, &b) != EOF ){
    if( a == 0 && b == 0 ) break;
    sum += a * b;
    num += b;
    n++;
  }
  double ave = num * 1.0 / n;
  ave += 0.5;

  cout << sum << endl;
  cout << (int)(ave) << endl;

  return 0;
}

Measured memory_bytes: 3144
w=int(input())
num=[i+1 for i in range(w)]
n=int(input())
for i in range(n):
	data=list(map(int,input().split(",")))
	a=num[data[0]-1]
	num[data[0]-1]=num[data[1]-1]
	num[data[1]-1]=a
for i in range(w):
	if i==w-1:
		print(num[i],end="\n")
	else:
		print(num[i])


Measured memory_bytes: 5608
from collections import defaultdict
from bisect import bisect_left

n, m = map(int, input().split())

city_list = []
city_list_by_pref = defaultdict(list)
for i in range(m):
    p, y = map(int, input().split())
    city_list.append((p, y))
    city_list_by_pref[p].append(y)

for v in city_list_by_pref.values():
    v.sort()

for p, y in city_list:
    x = bisect_left(city_list_by_pref[p], y)
    print('{:06}{:06}'.format(p, x+1))


Measured memory_bytes: 79748
n,m = map(int,input().split())
p=[]
for i in range(n):
    p.append(list(map(int,input().split())))

o=0
for af,bf,cf in [[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]]:
    l=[]
    for a,b,c in p:
        a*=af
        b*=bf
        c*=cf
        l.append(a+b+c)
    l.sort(reverse=True)
    s = sum(l[0:m])
    o = s if s>o else o
print(o)


Measured memory_bytes: 3316
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void log(A...)(A arg) {
    stderr.writeln(arg);
}
int size(T)(in T s) {
    return cast(int)s.length;
}

const int INF = 1<<28;

void main() {
    int N, M, K, S; scanf("%d %d %d %d\n", &N, &M, &K, &S);
    long P, Q; scanf("%d %d\n", &P, &Q);
    auto C = new int[K];
    foreach (i; 0 .. K) {
        scanf("%d\n", &C[i]);
        C[i]--;
    }
    auto G = new int[][N];
    foreach (i; 0 .. M) {
        int A, B; scanf("%d %d\n", &A, &B);
        A--; B--;
        G[A] ~= B;
        G[B] ~= A;
    }
    auto D = new int[N]; D[] = INF;
    DList!(Tuple!(int, int)) q;
    foreach (c; C) {
        q.insert(tuple(c, 0));
        D[c] = 0;
    }
    while (! q.empty) {
        auto c = q.front; q.removeFront;
        foreach (next; G[c[0]]) {
            if (D[next] > c[1] + 1) {
                D[next] = c[1] + 1;
                q.insert(tuple(next, c[1] + 1));
            }
        }
    }

    auto X = new long[N]; X[] = 1L<<56; X[0] = 0;
    alias T = Tuple!(int, "v", long, "cost");
    BinaryHeap!(Array!T, "a.cost > b.cost") PQ;
    PQ.insert(T(0, 0));
    while (! PQ.empty) {
        auto c = PQ.front; PQ.removeFront;
        foreach (next; G[c.v]) {
            if (D[next] == 0) continue;
            long cost = (D[next] <= S ? Q : P);
            long ncost = cost + c.cost;
            if (X[next] > ncost) {
                X[next] = ncost;
                PQ.insert(T(next, ncost));
            }
        }
    }

    writeln(X[N - 1] - (D[N - 1] <= S ? Q : P));
}

Measured memory_bytes: 12748
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	bs := make([]int, n-1)
	for i := range bs {
		fmt.Scan(&bs[i])
	}
	as := make([]int, n)
	for i := 0; i < n; i++ {
		as[i] = 1e10
	}

	for i := 0; i < n-1; i++ {
		as[i] = min(as[i], bs[i])
		as[i+1] = min(as[i+1], bs[i])
	}

	fmt.Println(sum(as...))
}

func sum(slice ...int) int {
	sum := 0
	for _, v := range slice {
		sum += v
	}
	return sum
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}


Measured memory_bytes: 1776
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
namespace mp = boost::multiprecision;
// 任意長整数型
using bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using real1024 = mp::number<mp::cpp_dec_float<1024>>;
// ついでに有理数型
using rat = boost::rational<bint>;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()

void solve(long long N, std::vector<long long> A){
	ll ans = 0;
	ll memo = A[0];
	for (int i = 1; i < N; i++) {
		if(A[i] - memo < 0)ans += memo-A[i];
		else memo = A[i];
	}
	cout << ans << endl;
}

int main(){
    long long N;
  scanf("%lld",&N);
  std::vector<long long> A(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&A[i]);
  }
    solve(N, std::move(A));
    return 0;
}


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

// edit by  (xcode)

using namespace std;

#define int         long long
#define ll          long long
#define double      long double
#define pb          push_back
#define in          insert
#define mp          make_pair
#define f           first
#define s           second
//#define x           first
//#define y           second
#define all(el)     el.begin(), el.end()
#define allr(el)    el.rbegin(), el.rend()
#define sz(el)      (int)el.size()
#define endl        "\n"

inline int chkmax(int &x, int y) {
    if (y > x) {
        x = y;
        return true;
    }
    return false;
}

inline int chkmin(int &x, int y) {
    if (y < x) {
        x = y;
        return true;
    }
    return false;
}

signed main() {
    
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int h, w, k;
    cin >> h >> w >> k;
    vector<vector<int>> a(h, vector<int> (w));
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            char x;
            cin >> x;
            a[i][j] = x - '0';
        }
    }
    
    int ans = 1e18;
    
    for (int mask = 0; mask < (1LL << (h - 1)); mask++) {
        vector<int> hv = {0};
        for (int j = 0; j < (h - 1); j++) {
            if (((1LL << j) & mask)) {
                hv.pb(j + 1);
            }
        }
        hv.pb(h);
        int ans_now = 0;
        vector<vector<int>> now(sz(hv) - 1, vector<int> (w));
        for (int i = 0; i < sz(hv) - 1; i++) {
            for (int j = hv[i]; j < hv[i + 1]; j++) {
                for (int k = 0; k < w; k++) {
                    now[i][k] += a[j][k];
                }
            }
        }
        for (int i = 0; i < sz(hv) - 1; i++) {
            if (*max_element(all(now[i])) > k) {
                ans_now = 1e18;
                break;
            }
        }
        vector<int> res(sz(hv) - 1);
        for (int j = 0; j < w; j++) {
            int edit = 0;
            for (int i = 0; i < sz(hv) - 1; i++) {
                res[i] += now[i][j];
                if (res[i] > k) {
                    edit = 1;
                }
            }
            if (edit) {
                for (int i = 0; i < sz(hv) - 1; i++) {
                    res[i] = now[i][j];
                }
                ans_now++;
            }
        }
        chkmin(ans, ans_now + __builtin_popcount(mask));
        //cout << ans << endl;
    }
    
    cout << ans;
    
    return 0;
}



Measured memory_bytes: 384
#include <cstdio>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
using namespace std;

char a[10005], b[10005];
int main()
{
	int lena, lenb, flag = 1;
	scanf("%s",a);
	getchar();
	scanf("%s",b);
	lena = strlen(a);
	lenb = strlen(b);
	if(lena == lenb)
	{
		for(int i = 0; i != max(lena, lenb); i++)
		{
			if(a[i] > b[i])
			{
				printf("GREATER\n");
				break;
			}
			else if(a[i] < b[i])
			{
				printf("LESS\n");
				break;
			}
			else
			{
				flag = 0;
				continue;
			}
		}
		if(flag == 0)
		{
			printf("EQUAL\n");
		}
	}
	if(lena > lenb)
	{
		printf("GREATER\n");
	}
	if(lena < lenb)
	{
		printf("LESS\n");
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

typedef long long ll;

using namespace std;

int main(int argc, const char * argv[]) {
  ll N;
  cin >> N;
  ll A,B;
  for(A=1;A<10;A++){
    if(N%A==0){
      B = N/A;
      if(B<10){
        cout << "Yes";
        return 0;
      }
    }
  }
  cout << "No";
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#define INF 100000000
using namespace std;

int main(){
  int n,m,p;


  while( cin >> n >> m >> p,n+m+p ){

    int sum = 0;
    int a[101] = {0};

    for(int i = 0 ; i < n ; i++ ){
      cin >> a[i];
      sum += a[i];
    }
    if(a[m-1] == 0){
      cout << 0 << endl;
      continue;
    }
    sum =sum*(100-p);
    int ans = sum/a[m-1];
    printf("%d\n",ans);
  }
  return 0;
}

Measured memory_bytes: 1192
N,M=map(int,input().split())
if 2*N-M>=0:
    ans=M//2
else:
    if M%2==0:
        x=(M-2*N)//2
        ans=min(N+x//2,(M-x)//2)
    else:
        x=(M-2*N-1)//2
        ans=min(N+x//2,(M-x)//2)

        x=(M-2*N+1)//2
        ans=max(min(N+x//2,(M-x)//2),ans)
print(ans)


Measured memory_bytes: 3060
package main

import (
    "fmt"
)

const MOD = 1000000007

func comb(x, y int) int {
    var ret, i int
    ret = 1
    for i = y - 1; i >= 0; i-- {
        ret = ret * (x - i) % MOD
    }
    ret = ret * inverse(fact(y)) % MOD
    return ret
}

func fact(y int) int  {
    var ret, i int
    ret = 1
    for i = 1;i <= y; i++ {
        ret = ret * i % MOD
    }
    return ret
}

func pow(x, y int) int {
    if y == 0 {
        return 1
    }
    if y % 2 == 0 {
        return pow(x * x % MOD, y / 2)
    } else {
        return x * pow(x, y - 1) % MOD
    }
}

func inverse(f int) int {
    return pow(f, MOD - 2)
}



func main() {
    var n, m int
    var ans, i, cnt int
    fmt.Scan(&n)
    fmt.Scan(&m)
    ans = 1
    for i = 2; i * i <= m; i++ {
        if m < i {
            break
        }
        cnt = 0
        for m % i == 0 {
            cnt++
            m /= i
        }
        ans = ans * comb(n + cnt - 1, cnt) % MOD
    }
    if m != 1 {
        ans = ans * comb(n, 1) % MOD
    }
    fmt.Println(ans)
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int n, q, t;
    string name;
    queue<pair<string, int> > Q;

    cin >> n >> q;

    rep(i, n) {
        cin >> name >> t;
        Q.push(make_pair(name, t));
    }

    pair<string, int> u;
    int elaps = 0, a;

    while( !Q.empty()) {
        u = Q.front();
        Q.pop();
        a = min(u.second, q);
        u.second -= a;
        elaps += a;
        if(u.second > 0) {
            Q.push(u);
        }
        else {
            cout << u.first << " " << elaps << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 6364
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const int INF = 10101010;

int main(){
    int n;
    while(cin >>n,n){
        int s,t;
        cin >>s >>t;
        --s;
        --t;

        vector<vector<int>> G(n),rG(n);

        auto add_edge = [&](int u, int v){
            G[u].pb(v);
            rG[v].pb(u);
        };

        int m;
        cin >>m;
        vector<int> a(m),b(m);
        rep(i,m){
            cin >>a[i] >>b[i];
            --a[i];
            --b[i];
            add_edge(a[i],b[i]);
        }

        auto BFS = [&](int start, vector<vector<int>>g){
            vector<int> d(n,INF);
            d[start] = 0;
            queue<int> que({start});
            while(!que.empty()){
                int v = que.front();
                que.pop();
                for(int e:g[v]){
                    if(d[e] > d[v]+1){
                        d[e] = d[v]+1;
                        que.push(e);
                    }
                }
            }
            return d;
        };

        vector<int> ds = BFS(s,G), dt = BFS(t,rG);

        int eidx = -1;
        int ans = ds[t];
        rep(i,m){
            int dd = ds[b[i]] + 1 + dt[a[i]];
            if(ans > dd){
                ans = dd;
                eidx = i;
            }
        }

        cout << ans << " " << eidx+1 << "\n";
    }
    return 0;
}



Measured memory_bytes: 3304
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
using ll = long long;
using P = pair<int, int>;
 
int main() {
  ll a,b,k;
  cin >> a >> b >> k;
  if(k <= a) a = a-k;
  else if(k <= a + b){
    b = b - k + a;
    a = 0;
  }
  else{
    a = 0;
    b = 0;
  }
  cout << a << " " << b << endl;
}

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

int main()
{
  int A,B;
  int res=0;
  cin >> A >>B;
  for (int i=A; i<=B; ++i){
  int num=i;
  int rev=0;
  while(num){ 
  rev = rev *10+num % 10;
  num= num/10;
  if (rev==i){
    ++res;
    }
  }
  }
  cout << res<<endl;
  }
      


Measured memory_bytes: 256
def build_stairs(N: int, H: list)->bool:
    for i in range(N-1, 0, -1):
        if H[i-1] <= H[i]:
            continue
        H[i-1] -= 1
        if H[i-1] > H[i]:
            return False
    return True


if __name__ == "__main__":
    N = int(input())
    H = list(map(int, input().split()))

    yes = build_stairs(N, H)
    print('Yes' if yes else 'No')


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

using namespace std;

int a[100001];
int b[100001];
int r[100001];
int p[100001];

int main () {
	int n;
	cin >> n;
	for (int i = 1;i <= n;i ++) {
		cin >> p[i];
		r[p[i]] = i;
	}             
	for (int i = 1;i <= n;i ++) {
		a[i] = i * 30000;
		b[i] = (n - i) * 30000 + r[i];
	}
	for (int i = 1;i <= n;i ++) cout << a[i] << ' ';
	cout << endl;
	for (int i = 1;i <= n;i ++) cout << b[i] << ' ';
	return 0;
}

Measured memory_bytes: 896
n, m = map(int, input().split())

aa = []
bb = []

for _ in range(m):
    a, b = map(int, input().split())
    if a == 1:
        aa.append(b)

    if b == n:
        bb.append(a)

aa = set(aa)
bb = set(bb)

ret = aa & bb

if len(ret) == 0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")


Measured memory_bytes: 21052
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;

ll f(ll x) {
  ll res = 0;
  ll loop = 2;
  x++;
  rep(i, 41) {
    ll remaincnt = max(0LL, x % loop - loop / 2);
    ll sumcnt = x / loop * (loop / 2);
    ll cnt = sumcnt + remaincnt;

    if (cnt % 2) res += 1LL << i;
    loop *= 2;
  }

  return res;
}

int main() {
  ll a, b;
  cin >> a >> b;
  a--;
  if (a < 0) a = 0;
  ll ans = f(b) ^ f(a);
  // cout << f(a) << " " << f(b) << endl;
  cout << ans << endl;
}

Measured memory_bytes: 3524
#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

int main(void)
{
  string s;
  cin >> s;
  LL answer = 0ll;
  REP(i, s.size()) {
    if(s[i]=='0'+i%2) ++ answer;
  }
  cout << min(answer,(LL)s.size()-answer) << endl;
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define F first
#define S second
//1 åñëè n * (n / 2) % 2 == 0 - > îäíî èç ÷èñåë 2 
//
void bst(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

vector<vector<int> > g;
vector<vector<int> > gt;
vector<bool> used;
int dp[(int)1e5 + 100];
void dfs(int v){
	used[v] = 1;
	dp[v] = 0;
	for(int i = 0;i < g[v].size();i++){
		int to = g[v][i];
		if(!used[to])dfs(to);
		dp[v] = max(dp[v], dp[to] + 1);
	}
}
int main() {
	bst();
	int n,m;
	cin>>n>>m;
	g.resize(n + 1);
	gt.resize(n + 1);
	used.resize(n + 1);
	for(int i = 0;i < m;i++){
		int a,b;
		cin>>a>>b;
		a--,b--;
		g[a].push_back(b);
		gt[b].push_back(a);
	}
	for(int i = 0;i<n;i++){
		if(gt[i].size() == 0){
			dfs(i);
		}
	}
	int mx = -1;
	for(int i = 0;i<n;i++){
		mx = max(dp[i], mx);
	}
	cout<<mx;
	return 0;
}

Measured memory_bytes: 16256
#coding:utf-8                                                                   

N = int(raw_input())
As = map(int, raw_input().split())

count = 0
flag = 0

while True:
    for i in range(N):
        if As[i] % 2 == 0:
            As[i] = As[i] / 2
        else:
            flag = 1
            break
    if flag == 1:
        break
    else:
        count += 1

print count

Measured memory_bytes: 2568
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	int N;
	cin>>N;
	int a[N];
	int count=0;
	for(int i=1;i<=N;i++)
	{
		cin>>a[i];
		if((a[i]%2!=0)and(i%2!=0))
		{
			count++;
		}
	}
	cout<<count<<'\n';
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
#include <iomanip>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;

#define mem(a, b) memset(a, b, sizeof(a))
#define REP(i, a) for (int i = 0; i < a; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(a) a.begin(), a.end()

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

inline void print_vector(vector<int> &A){
    for (auto&& x : A){
        cout << x << " ";
    }
    cout << endl;
}

inline void print_array(const int A[], int n) {
    REP(i, n) {
        cout << A[i] << " ";
    }
    cout << endl;
}

bool is_prime(int n) {
    if (n == 2) return true;
    for (int i = 2; i < sqrt(n) + 1; ++i) {
        if (n % i == 0) {
            return false;
        }
    }

    return true;
}

inline void solve() {
    int n;
    cin >> n;

    if (n >= 30) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

}


int main() {
    // freopen("input.txt", "r", stdin);
    quickread();
    int t;
    t = 1;
    // cin >> t;

    for (int _ = 0; _ < t; _++) {
        solve();
    }

    return 0;
}


Measured memory_bytes: 3656
def output_2d_array(array, separater="")
  array.each do |line|
    puts line.join(separater)
  end
end

def horizontal_compress(array)
  new_array = []
  array.each do |line|
    if line.count("#") >= 1 # #が一つでもある
      new_array << line
    end
  end
  return new_array
end

def vertical_compress(array)
  temp_array = array.transpose
  new_array = []
  temp_array.each do |line|
    if line.count("#") >= 1 # #が一つでもある
      new_array << line
    end
  end
  return new_array.transpose
end

field = []
H, _W = gets.split.map(&:to_i)
H.times do
  field << gets.split("")
end

field = horizontal_compress(field)
field = vertical_compress(field)
output_2d_array(field, "")


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

using namespace std;

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

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

  vi a(N);
  for (ll i = 0; i < N; i++) {
    cin >> a[i];
  }

  pii ma = make_pair(0, a[0]);
  pii mi = make_pair(0, a[0]);

  for (ll i = 0; i < N; i++) {
    if (a[i] > ma.second) {
      ma = make_pair(i, a[i]);
    }
    if (a[i] < mi.second) {
      mi = make_pair(i, a[i]);
    }
  }

  vpii ans;

  if (ma.second + mi.second >= 0) {
    for (ll i = 0; i < N; i++) {
      if (i != ma.first) {
        ans.push_back(make_pair(ma.first, i));
      }
    }
    for (ll i = 0; i < N - 1; i++) {
      ans.push_back(make_pair(i, i + 1));
    }
  } else {
    for (ll i = 0; i < N; i++) {
      if (i != mi.first) {
        ans.push_back(make_pair(mi.first, i));
      }
    }
    for (ll i = N - 2; i >= 0; i--) {
      ans.push_back(make_pair(i + 1, i));
    }
  }

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

  for (auto p: ans) {
    cout << p.first + 1 << ' ' << p.second + 1 << endl;
  }
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	var counter [10]int
	counter[a]++
	counter[b]++
	counter[c]++

	if counter[5] == 2 && counter[7] == 1 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


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

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define all(x) (x).begin(),(x).end()
#define in(type,a) type a;cin >> a
using ll = long long;

int main() {
    in(int, x);
    in(int, a);
    if (x<a) {
        cout << 0 << endl;
    } else {
        cout << 10 << endl;
    }
    return 0;
}


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

//template
#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(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; }
template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; }
//end

bool nCr(int n,int k){return (n&k)==k;}
bool calc(string s){
   bool f=0; int n=s.size();
   rep(i,0,n)if(s[i]=='1')f^=nCr(n-1,i);
   return f;
}

int main(){
   int n; scanf("%d",&n);
   string s; cin>>s;
   for(auto& c:s)c--;
   string t=s; for(auto& c:t)if(c=='2')c='0';
   if(calc(t))puts("1");
   else{
      for(auto& c:s){
         if(c=='1'){puts("0"); return 0;}
         if(c=='2')c='1';
      }
      if(calc(s))puts("2"); else puts("0");
   }
   return 0;
}

Measured memory_bytes: 3332
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
#include <queue>
using namespace std;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define print(x) cout<<(x)<<'\n'
#define print_vec(v) rep(i,v.size()){if(i!=0)cout<<" ";cout<<v[i];}cout<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<'\n'
#define pb push_back
#define mp make_pair
#define MOD 1000000007 //10^9+7
#define fi first
#define sc second
using ll=long long;
using pl=pair<ll,ll>;
using vi=vector<int>;
using vl=vector<ll>;
using vvi=vector<vi>;
using vvl=vector<vl>;
using vs=vector<string>;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

template <typename T>
struct PrimeFact {
    vector<T> spf;
    PrimeFact(T N) { init(N); }
    void init(T N) { // 前処理。spf を求める
        spf.assign(N + 1, 0);
        for (T i = 0; i <= N; i++) spf[i] = i;
        for (T i = 2; i * i <= N; i++) {
            if (spf[i] == i) {
                for (T j = i * i; j <= N; j += i) {
                    if (spf[j] == j) {
                        spf[j] = i;
                    }
                }
            }
        }
    }
    map<T, T> get(T n) { // nの素因数分解を求める
        map<T, T> m;
        while (n != 1) {
            m[spf[n]]++;
            n /= spf[n];
        }
        return m;
    }
};

// template <typename T>
// map<T, T> prime_factor(T n) {
//     map<T, T> ret;
//     for (T i = 2; i * i <= n; i++) {
//         T tmp = 0;
//         while (n % i == 0) {
//             tmp++;
//             n /= i;
//         }
//         ret[i] = tmp;
//     }
//     if (n != 1) ret[n] = 1;
//     return ret;
// }

template <typename T>
T divisor_num(map<T, T> pf) {
    // map<T, T> pf = prime_factor(N);
    // map<T, T> pf = T;

    T ret = 1;
    for (auto p : pf) {
        ret *= (p.second + 1);
    }
    return ret;
}

void solve() {
    ll N;
    cin >> N;
    PrimeFact<ll> p(N);
    // p.init(N);
    
    ll ans = 0;
    rng(i,1,N){
        ans += divisor_num(p.get(i));
    }
    // rng(a,1,m+1) {
    //     rng(b,1,m+1) {
    //         ll tmp = a*b;
    //         DEBUG(tmp);
    //         // if(a*b >= N) continue;
    //         // ans++;
    //         if(a*b < N) {
    //             ans++;
    //         }
    //         DEBUG(ans);
    //     }
    // }

    print(ans);
}   

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(20);
    //int q; cin >> q;
	//while (q--)
		solve();
    return 0;
}


Measured memory_bytes: 11108
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
class Program
{
    static int x;
    static List<int> s = new List<int>();
    static string result;
    static void Main()
    {
        string tmp = Console.ReadLine();
        x=int.Parse(tmp);
        int results=0;
        for (int i = 1; i <=x; i++) { if (i / 100000 >0) { } else { if (i / 10000 > 0) { results++; } else { if (i / 1000 > 0) { } else { if (i / 100 > 0) { results++; } else { if (i / 10 > 0) { } else { results++; } } } } } }
        result =results.ToString();
            Console.WriteLine(result);
            Console.Out.Flush();
        
    }

 


}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i<(n);i++)
#define fore(i,a) for(auto &i:a)
#define debug(a,b) cout << "debug : " << a << " , "<< b << endl
using ll=long long;
const ll INF=1LL<<60;
const ll mod=1E9+7;


int main(){
  ll n,m;
  cin >> n >> m;
  vector<ll>h(n+1),s(n+1,0);
  rep(i,n)cin >> h[i+1];
  ll a,b;
  rep(i,m){
    cin >> a >> b;
    s[a]=max(s[a],h[b]);
    s[b]=max(s[b],h[a]);
  }
  ll cnt=0;
  rrep(i,1,n+1){
    if(s[i]<h[i])cnt++;
  }
  cout <<cnt;
}
    



  


Measured memory_bytes: 4840
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i,m,n) for(int i = m - 1; i >= n; i--)
#define ALL(v) v.begin(), v.end()
#define itn int
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define YES() cout << "YES" << endl
#define NO() cout << "NO" << endl
#define println(x) cout << x << endl
#define print(x) cout << x << " "
template<typename T, typename U>
inline bool CMAX(T &m, U x) { if (m < x) { m = x; return true; } return false; }
template<typename T, typename U>
inline bool CMIN(T &m, U x) { if (m > x) { m = x; return true; } return false; }

typedef long long lint;
typedef long double ldouble;
const int INF = 1e9;
const lint LINF = 1e18;
const int MOD = 1e9+7;
int main(){
    string s;
    cin >> s;
    REP(i,3){
        cout << s[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3620