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

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll n;
vector<ll> v;
ll f(ll k){
    ll ki=v[k-1];
    ll now=ki+1;
    ll ret=n;
    rep(i,k,n+1){
        if(v[i]>=now){
            now+=2;
        }
        else{
            ret=i;
            break;
        }
    }
    return ret;
}
int main(){
    cin>>n;
    v.clear();
    v.push_back(0);
    rep(i,0,n){
      ll u;cin>>u;
      v.push_back(u);
    }
    ll now=1;
    ll ans=1;
    ll cnt=0;
    for(;;){
        ll g=f(now);
        if(g==n){
            if(n==cnt)break;
            rrep(i,n-cnt,1){
                ans*=i;
                ans%=mod;
            }
            break;
        }
        ans*=(g-cnt+mod)%mod;
        cnt++;
        now=g+1;
        ans%=mod;
    }
    cout<<ans<<endl;
}


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

int main()
{   int a, b;
    cin>>a>>b;
    if(a>=13){
    cout<<b<<endl;
   } else if (a<13&&a>=6){
      cout<<(b/2)<<endl;
    }else{
    cout<<"0"<<endl;
    }


    return 0;
}

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

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

int main()
{
    int n, A = 0, B = 0;
    cin >> n;

    rep(i, n)
    {
        string a, b;
        cin >> a >> b;
        if (a > b)
        {
            A += 3;
        }
        else if (b > a)
        {
            B += 3;
        }
        else
        {
            A++;
            B++;
        }
    }
    cout << A << " " << B << endl;
}


Measured memory_bytes: 3160
#include<stdio.h>
int main(void){
  int a,b,c,x;
  scanf("%d%d%d%d",&a,&b,&c,&x);
  int i,j,k;
  int cnt=0;
  for(i=0;i<=a;i++){
    for(j=0;j<=b;j++){
      for(k=0;k<=c;k++){
        if(x==500*i+100*j+50*k){
          cnt++;
        }
      }
    }
  }
  printf("%d",cnt);
  return 0;
}


Measured memory_bytes: 128
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// UnionFind（１）
type UnionFind struct {
	par []int
}

/* コンストラクタ */
func newUnionFind(N int) *UnionFind {
	u := new(UnionFind)
	u.par = make([]int, N)
	for i := range u.par {
		u.par[i] = -1
	}
	return u
}

/* xの所属するグループを返す */
func (u UnionFind) root(x int) int {
	if u.par[x] < 0 {
		return x
	}
	u.par[x] = u.root(u.par[x])
	return u.par[x]
}

/* xの所属するグループ と yの所属するグループ を合体する */
func (u UnionFind) unite(x, y int) {
	xr := u.root(x)
	yr := u.root(y)
	if xr == yr {
		return
	}
	u.par[yr] += u.par[xr]
	u.par[xr] = yr
}

/* xとyが同じグループに所属するかどうかを返す */
func (u UnionFind) same(x, y int) bool {
	if u.root(x) == u.root(y) {
		return true
	}
	return false
}

/* xの所属するグループの木の大きさを返す */
func (u UnionFind) size(x int) int {
	return -u.par[u.root(x)]
}

func main() {
	sc.Split(bufio.ScanWords)

	N, M, K := getInt(), getInt(), getInt()
	fr := make([]int, N+1)
	bl := make([]int, N+1)

	u := newUnionFind(N + 1)
	for i := 0; i < M; i++ {
		a, b := getInt(), getInt()
		u.unite(a, b)
		fr[a]++
		fr[b]++
	}

	for i := 0; i < K; i++ {
		c, d := getInt(), getInt()
		if u.same(c, d) {
			bl[c]++
			bl[d]++
		}
	}

	for i := 1; i <= N; i++ {
		max := u.size(i)
		new := max - fr[i] - bl[i] - 1
		fmt.Print(new, " ")
	}
	out()

}


Measured memory_bytes: 13184
#ifdef DAIJOBU
#include "/home/v-o_o-v/deb.h"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif 

using namespace std;

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef long long lint;
typedef double ld;

void a();void b();void c();void d();void e();void f();

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

	// a();
	b();
	// c();
	// d();
	// e();
	// f();
	return 0;
}

void a(){
	int n;
	cin >> n;
	n %= 10;
	if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9)puts("hon");
	else if(n == 3)puts("bon");
	else puts("pon");

}

void b(){
	int n;
	string  s;
	cin >> n >> s;
	if(s.size() > n){
		cout << s.substr(0, n) << "...";
	}else cout << s;
}

void c(){

}

void d(){

}

void e(){

}

void f(){

}

Measured memory_bytes: 3660
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <string.h>
#include <map>
#include <stack>
#include <iomanip>
#include <chrono>
#include <random>
#include <math.h>
#include <time.h>
#include <assert.h>
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define pb push_back 
#define mp make_pair
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define all(x) x.begin(),x.end() 
#define PII pair <ll,ll>
#define N 100005
#define MOD 1000000007
#define INF 1000000000000000000
using namespace std;

ll dp[1005][1005];
char A[1005][1005];
int main()
{
	int h, w;
	cin >> h >> w;
	for (int i = 1; i <= h; ++i)
	{
		for (int j = 1; j <= w; ++j)
		{
			cin >> A[i][j];
		}
	}
	memset(dp, 0, sizeof(dp));
	for (int i = 1; i <= h; ++i)
	{
		if(A[i][1] == '#')
			break;
		dp[i][1] = 1;
	}
	for (int i = 1; i <= w; ++i)
	{
		if(A[1][i] == '#')
			break;
		dp[1][i] = 1;
	}
	for (int i = 2; i <= h; ++i)
	{
		for (int j = 2; j <= w; ++j)
		{
			if(A[i][j] == '.')
			{
				dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
			}
		}
	}
	cout << dp[h][w] << "\n";
}


Measured memory_bytes: 9088
#include<bits/stdc++.h>
using namespace std;
int n,k;
int ans,a[200005];
int main(){
//	freopen("x.txt","r",stdin);
	scanf("%d%d",&n,&k);
	for(int i=1;i<=k;++i)	scanf("%d",&a[i]);
	for(int i=2;i<=k;++i) ans=max(ans,a[i]-a[i-1]);
	ans=max(ans,a[1]+n-a[k]);
	cout<<n-ans<<endl;
} 

Measured memory_bytes: 4436
let query ac = 
  Scanf.scanf " %d %d" (fun l' r' -> (
    let l = l' - 1 in
    let r = r' - 1 in
    Printf.printf "%d\n" (ac.(r) - ac.(l))
  ))
;;

let () = Scanf.scanf "%d %d\n%s" (fun n q s -> (
  let ac = Array.init (n + 1) (fun i -> if i = n || i = 0 || s.[i - 1] <> 'A' || s.[i] <> 'C' then 0 else 1) in (
    Array.iteri (fun i e -> if i > 0 then ac.(i) <- ac.(i - 1) + e) ac;
    for i = 1 to q do
      query ac
    done
  )
))

Measured memory_bytes: 6272
def possible_triangle(x, y, z):
    length_req = (x + y > z) and (y + z > x) and (x + z > y)
    diff_sides = (x != y) and (x != z) and (y != z)
    return length_req and diff_sides


n = int(input())
sticks = [int(i) for i in input().split()]
sticks.sort()
count = 0

for i in range(n - 2):
    for j in range(i, n - 1):
        for k in range(j, n):
            if possible_triangle(sticks[i], sticks[j], sticks[k]):
                count += 1
print(count)


Measured memory_bytes: 9196
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <cstdlib>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
typedef long long int ll;
#define forn for(int i=0;i<n;i++) 
#define form for(int j=0;j<n;j++) 
#define fora(i,a,b) for(int i = a; i < (b); i++)
#define pb push_back 
#define mp make_pair 
#define sc second 
#define f first 
#define kek cout<<"\n" 
#define all(v) ((v).begin()), ((v).end()) 
#define pob pop_back() 
const ll MOD = 1e9 + 7;
const int N = 1005;
const ll INF = 1e9;
using namespace std;
int main()
{
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
  int n,m;
  cin>>n>>m;
  map<int,int> aaa;
  string s;
  int a;
  int ans=0;
  map<int,int> aa;
  while(m--)
  {
            cin>>a>>s;
            if(s=="AC") aaa[a]++;
            else
            {
                      if(aaa[a]) continue;
                      else aa[a]++;
            }
            
  }
  int cnt=0;
  for(int i=1;i<=n;i++) if(aaa[i]) cnt++;
  for(int i=0;i<=n;i++) if(aaa[i]) ans+=aa[i];
  cout<<cnt<<" "<<ans;
  return 0;
}

Measured memory_bytes: 9600
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <tuple>
using namespace std;
using ll=long long;
using R=double;

int main(){
	ll N, A, B;
	cin >> N >> A >> B;

	if(N == 1){
		if(A==B){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
		return 0;
	}
	if(A > B){
		cout << 0 << endl;
		return 0;
	}

	ll mini, maxi;

	mini = A*(N-1) + B;
	maxi = A + B*(N-1);

	cout << maxi-mini+1 << endl;
	return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
const ll inf = 1LL << 50;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
///////////////////////////////////////
int N, M;
vector<bool>visited;
vector<vector<int>>G;
void dfs(int n) {
	visited[n] = true;
	for (auto i : G[n]) {
		if (!visited[i]) {
			dfs(i);
		}
	}
}
int main() {
	cin >> N >> M;
	G.resize(N);
	visited.resize(N);
	for (int i = 0; i < N; ++i)visited[i] = false;
	for (int i = 0; i < M; ++i) {
		int x, y, z;
		cin >> x >> y >> z;
		x--, y--;
		G[x].push_back(y);
		G[y].push_back(x);
	}
	int ans = 0;
	for (int i= 0; i < N; ++i) {
		if (!visited[i]) {
			ans++;
			dfs(i);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 8832
// #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <set>
#include <queue>
#include <cstdio>
#include <stack>
#include <list>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define irep(i, n) for(int i=n-1;i>=0;i--)
#define lrep(i, n) for(long long i=0;i<n;i++)
typedef long long ll;
typedef vector<long long> llv;
typedef vector<vector<long long> > llvv;
template <class T> T gcd(T n, T m){return m ? gcd(m, n%m):n;}

int main(){
    int n;
    cin>>n;
    int d[n];
    rep(i,n) cin >> d[i];
    ll sum=0;
    rep(i,n){
        for(int j=i+1;j<n;j++){
            sum+=d[i]*d[j];
        }
    }
    cout<< sum << endl;
}

Measured memory_bytes: 256
N,K=list(map(int,input().split()))
A=list(map(int,input().split()))
mod=10**9+7
b=0
f=0
for i in range(N):
    for j in range(i+1,N):
        if A[i]>A[j]:
            #print(i,",",j)
            f+=1
           
            
for i in range(N):
    for j in range(N):
        if i==j:
            continue
        if A[i]>A[j]:
            b+=1

#ans=f*K
#tmp=((K-1)*K)%mod
#ans+=((b*tmp)//2)%mod
ans = K * f + (b * K * (K - 1)) // 2
ans%=mod

print(ans)

Measured memory_bytes: 3188
// Problem : C - Tsundoku
// Contest : AtCoder - AtCoder Beginner Contest 172
// URL : https://atcoder.jp/contests/abc172/tasks/abc172_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memset
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
using namespace std;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;

int n,m;
ll k;
ll a[N],b[N];
int ans;

int main() {
    ios::sync_with_stdio(false);cin.tie(0);
	cin>>n>>m>>k;
	 for(int i=1;i<=n;++i){
	 	cin>>a[i];
	 }
	 for(int i=1;i<=m;++i){
	 	cin>>b[i];
	 }
	 for(int i=1;i<=m;++i){
	 	b[i]+=b[i-1];
	 	if(k>=b[i]) ans=i;
	 }
	 for(int i=1;i<=n;++i){
	 	a[i]+=a[i-1];
	 	if(a[i]<=k){
	 		int rest=k-a[i];
	 		int pos=upper_bound(b+1,b+1+m,rest)-b-1;
	 		ans=max(ans,i+pos);
	 	}
	 }
	 cout<<ans<<endl;
    return 0;
}


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

using namespace std;

#define IOS ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL);

#define endl "\n";


#define mod 1000000007
#define loop(i,s,n)  for(ll i=s;i<n;i++)
#define test  ll t; cin>>t; while(t--)
#define p push_back
typedef long long ll;
int main()
{IOS

ll  n,i,j,k,count=0,f=0,sum=0;
string s;
cin>>s;
for(i=0;i<s.length();i++)
{if(s[i]=='R')
{sum++;
count=max(sum,count);}
else{count=max(sum,count);
sum=0;}}

cout<<count;





return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int count = 0;
				
		for (int i = 0; i < s.length() - 1; i++) {
			if (s.charAt(i) == s.charAt(i + 1)) {
				count++;
			}
		}
		
		System.out.println(count == 0 ? "Good" : "Bad");
	}	
}

Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define INF 999999999
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define Vecpr vector<pair<lli,lli>>
int main() {
  lli A,B,C,D;
  cin >>A>>B>>C;
  if(A==B)Out(C);
  else if(A==C)Out(B);
  else Out(A);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    ll ans=0;
    vector<ll> cnt(n+1,0);
    FOR(i,1,n+1){
        for(int j=i;j<=n;j+=i){
            cnt[j]++;
        }
    }
    FOR(k,1,n+1){
        ans+=k*cnt[k];
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 81344
n, m = map(int, input().split(' '))
sayi = []
for i in range(n):
    sayi.append('*')

for i in range(m):
    s, t = map(int, input().split(' '))
    if n >= 2 and s == 1 and t == 0:
        print(-1)
        exit()
    if sayi[s-1] == "*" or sayi[s-1] == str(t):
        sayi[s-1] = str(t)
    else:
        print(-1)
        exit()
for i in range(len(sayi)):
    if sayi[i] == '*':
        if n>=2 and i == 0:
            sayi[i] = '1'
        else:
            sayi[i] = '0'
print(''.join(sayi))

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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

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

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

  int N;
  cin >> N;

  vector<ll> A(N);
  for(int i = 0; i < N; i++){
    cin >> A[i];
  }

  ll ans = 1e9;

  ll tmp;
  ll tmp_ans = 0;
  for(int i = 0; i < N; i++){
    tmp_ans = 0;
    tmp = A[i];
    while(tmp % 2 == 0){
      tmp = tmp/2;
      tmp_ans++;
    }

    chmin(ans, tmp_ans);
  }

  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		Dice d = new Dice(scan.nextInt(), scan.nextInt(), scan.nextInt(), scan.nextInt(), scan.nextInt(),
				scan.nextInt());
		String op = scan.next();
		for (int i = 0; i < op.length(); i++)
			d.operate(op.charAt(i));
		System.out.println(d.getUpp());

		scan.close();
		System.exit(0);
	}

}

class Dice {
	int Upp, Sou, Est, Wst, Nor, Bot;

	public Dice(int upp, int sou, int est, int wst, int nor, int bot) {
		Upp = upp;
		Sou = sou;
		Est = est;
		Wst = wst;
		Nor = nor;
		Bot = bot;
	}

	public void operate(char op) {
		int tmp;
		switch (op) {
		case 'S':
			tmp = Upp;
			Upp = Nor;
			Nor = Bot;
			Bot = Sou;
			Sou = tmp;
			break;
		case 'E':
			tmp = Upp;
			Upp = Wst;
			Wst = Bot;
			Bot = Est;
			Est = tmp;
			break;
		case 'W':
			tmp = Upp;
			Upp = Est;
			Est = Bot;
			Bot = Wst;
			Wst = tmp;
			break;
		case 'N':
			tmp = Upp;
			Upp = Sou;
			Sou = Bot;
			Bot = Nor;
			Nor = tmp;
			break;
		}
	}

	public int getUpp() {
		return Upp;
	}

}

Measured memory_bytes: 26340
#include <bits/stdc++.h>
using namespace std;
int main(){

  int h1,h2,k1,k2,a,b,c,d,hs,ks;
  cin>>h1>>h2>>k1>>k2>>a>>b>>c>>d;
  hs=h1*a+h1/10*c+h2*b+h2/20*d;
  ks=k1*a+k1/10*c+k2*b+k2/20*d;
  if(hs>ks) cout<<"hiroshi"<<endl;
  else if(hs<ks) cout<<"kenjiro"<<endl;
  else cout<<"even"<<endl;

  return 0;

}

Measured memory_bytes: 3100
#include<stdio.h>
int main(vooid){
	char str1[21];
	int i;
	scanf("%s", str1);

	for (i = 0; str1[i] != '\0'; i++)
		;
	i--;
	for (; i >= 0; i--){
		printf("%c",str1[i]);
	}
	printf("\n");
	return 0;

	}

Measured memory_bytes: 524
def main():
    S=input()
    a=0 
    b=[0]*2019
    l=[0]*2019
    for i in S:
        k=int(i)
        for j in range(2019):
            l[(j*10+k)%2019]=b[j]
        l[k]+=1
        a+=l[0]
        b=l.copy()
    print(a)
main()


Measured memory_bytes: 68280
n = int(input())
f = []
p = []
ans = []
for i in range(n):
    f.append(list(map(int, input().split())))
for i in range(n):
    p.append(list(map(int, input().split())))
for i in range(1, 2**10):
    b = format(i, '#012b')[2:]
    s = 0
    for j in range(n):
        s2 = 0
        for k in range(10):
            s2 += int(b[k])*f[j][k]
        s += p[j][s2]
    ans.append(s)
print(max(ans))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
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; }
const long long INF = 1LL << 60;
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

    int ans = 0;
    rep(bit, 1 << n)
    {
        int x = 0, y = 0;
        rep(i, n)
        {
            if (bit >> i & 1)
            {
                x += v[i];
                y += c[i];
            }
            chmax(ans, x - y);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define loop(n) for(int i=0;i<n;i++)
using namespace std;
void leftrotate(int arr[], int n, int d) 
{ 
    int g_c_d = gcd(d, n); 
    for (int i = 0; i < g_c_d; i++) { 
        /* move i-th values of blocks */
        int temp = arr[i]; 
        int j = i; 
  
        while (1) { 
            int k = j + d; 
            if (k >= n) 
                k = k - n; 
  
            if (k == i) 
                break; 
  
            arr[j] = arr[k]; 
            j = k; 
        } 
        arr[j] = temp; 
    } 
} 
void reverseArray(int arr[], int start, 
                            int end) 
{ 
    while (start < end) 
    { 
        std::swap(arr[start], arr[end]); 
        start++; 
        end--; 
    } 
} 
  
/* Function to right rotate arr[] 
of size n by d */
void rightrotate(int arr[], int n, int d)
{ 
    reverseArray(arr, 0, n-1); 
    reverseArray(arr, 0, d-1); 
    reverseArray(arr, d, n-1); 
} 
  
int main()
{
  set<string> st;
  int n;cin>>n;
  for(int i=0;i<n;i++)
  {
    string tmp;
    cin>>tmp;
    st.insert(tmp);
  }
  cout<<st.size()<<"\n";

}

Measured memory_bytes: 19264
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int nn,n;
int a[202020];
bool jud(int x)
{
	int p1=1,p2=1;
	for(int i=2;i<=n;i++)
		if((a[i]<=x)==(a[i-1]<=x))
			p1=i;
	for(int i=nn-1;i>nn-n;i--)
		if((a[i]<=x)==(a[i+1]<=x))
			p2=nn+1-i;
	if(p1>=p2)
		return a[p1]<=x;
	return a[nn+1-p2]<=x;
}
int main()
{
	scanf("%d",&n);
	nn=n*2-1;
	for(int i=1;i<=nn;i++)
		scanf("%d",&a[i]);
	int l=1,r=nn,mid;
	while(l<r)
	{
		mid=(l+r)>>1;
		if(jud(mid))
			r=mid;
		else
			l=mid+1;
	}
	printf("%d",l);
	return 0;
}

Measured memory_bytes: 1024
open Batteries
let () =
  let n = Scanf.scanf "%d " (fun a -> a) in
  let a_lst = Array.to_list @@ Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in

  let rec aux res cnt = function
      [] -> res
    | hd::tl -> 
      if hd mod 2 = 0 then
        let t = hd/2 in
        aux res (cnt+1) (t::tl)
      else
        aux (cnt::res) 0 tl 
  in

  Printf.printf "%d\n" @@
  List.min (aux [] 0 a_lst)


Measured memory_bytes: 1280
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define rep2(i, a)for(auto i : a)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x, std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll co(ll n, ll k) { ll a = 1; rep(i, 1ll, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }

int main(void) {
	int x;
	cin >> x;
	printf("%d\n", !x);
	return 0;
}


Measured memory_bytes: 3744
def main():
    import heapq

    x, y, z, k, *abc = map(int, open(0).read().split())
    a = abc[:x]
    b = abc[x:x + y]
    c = abc[x + y:]
    s = set()

    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)

    h = [(-(a[0] + b[0] + c[0]), 0, 0, 0)]
    heapq.heapify(h)
    ans = []
    for _ in range(k):
        p, i, j, k = heapq.heappop(h)
        ans.append(-p)
        for p, q, r in [(1, 0, 0), (0, 1, 0), (0, 0, 1)]:
            if i + p < x and j + q < y and k + r < z:
                if (i + p, j + q, k + r) not in s:
                    s.add((i + p, j + q, k + r))
                    v = - (a[i + p] + b[j + q] + c[k + r])
                    heapq.heappush(h, (v, i + p, j + q, k + r))

    print(*ans, sep='\n')


if __name__ == '__main__':
    main()


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

int main() {
		
	string w; cin >> w;
	const int p = 26;
	vector<int> num(p, 0);
	for (int i = 0; i < w.size(); i++) {
		num[(int)(w[i] - 'a')]++;
	}
	bool beautiful = true;
	for (int i = 0; i < p; i++) {
		if (num[i] % 2 != 0) {
			beautiful = false;
		}
	}
	if (beautiful) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

int dp[100004][3];
int main(){
    int n;
    cin>>n;
    int ar[n][3];
    for(int i=0;i<n;i++){
        cin>>ar[i][0]>>ar[i][1]>>ar[i][2];
    }
    dp[0][0]=ar[0][0];
    dp[0][1]=ar[0][1];
    dp[0][2]=ar[0][2];
    for(int i=1;i<n;i++){
        dp[i][0]=max(dp[i-1][1],dp[i-1][2])+ar[i][0];
        dp[i][1]=max(dp[i-1][0],dp[i-1][2])+ar[i][1];
        dp[i][2]=max(dp[i-1][0],dp[i-1][1])+ar[i][2];
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<endl;
    return 0;
}


Measured memory_bytes: 2560
using System;
using System.Linq;

class Project
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int X = int.Parse(input[0]);
        int N = int.Parse(input[1]);

        if(N == 0)
        {
            Console.WriteLine(X);
            return;
        }

        int[] A = Console.ReadLine().Split(' ').Select(s => Int32.Parse(s)).ToArray();

        if (!A.Contains(X))
        {
            Console.WriteLine(X);
            return;
        }
        else
        {
            int max = X; //max <= X
            int min = X; //min >= X

            while (true)
            {
                max--;
                min++;

                if (!A.Contains(max))
                {
                    Console.WriteLine(max);
                    return;
                }
                else if (!A.Contains(min))
                {
                    Console.WriteLine(min);
                    return;
                }
            }
        }
    }
}

Measured memory_bytes: 28256
#include <iostream>

int main() {
	int a, b, c;
	std::cin >> a >> b >> c;
	int mx = std::max(a, std::max(b, c));
	int cost = 3 * mx - a - b - c;
	if(cost % 2 == 0) {
		std::cout << cost / 2 << '\n';
	} else {
		std::cout << (cost + 3) / 2 << '\n';
	}
}

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

int main()
{
    long n, fx, x;
    cin >> n;
    fx = 0;
    x = n;
    
    while (n >= 1){
        fx += n%10;
        n = n/10;
    }
    
    if (x % fx == 0) cout << "Yes";
    else cout << "No";
}



Measured memory_bytes: 256
S = input()

ans = 'AC'

if not (S[0] == 'A' and S[2:-1].count('C') == 1):
    ans = 'WA'
for s in S:
    if (not (s == 'A' or s == 'C')) and not s.islower():
        ans = 'WA'

print(ans)

Measured memory_bytes: 2940
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    xy = {i+1:[] for i in range(N)}
    
    for i in range(N):
        for j in range(int(input())):
            xy[i+1].append(tuple(map(int, input().split())))
            
    ans = 0
    nums = [2**i for i in range(N)]
    for i in range(1, 2**N):
        num = [idx+1 for idx, n in enumerate(nums) if i & n != 0]
        visited = [False] * (N+1)
        A = [None] * (N+1)
        
        f = True
        for i in num: A[i] = True
        
        while num:
            n = num.pop(0)
            if visited[n]: continue
            visited[n] = True
            
            for x, y in xy[n]:
                if A[x] is None: 
                    A[x] = y
                    if y and not visited[x]: num.append(x)
                    
                elif A[x] == y: continue
                else: f = False; break
            if not f: break
        if f: 
            ans = max(ans, sum([a for a in A if not a is None]))
            
    print(ans)

if __name__ == '__main__':
    main()



Measured memory_bytes: 3064
#include <iostream>
#include <math.h>
using namespace std;

int main(void)
{
    long double a, b, c;
    long double eps = 1.0E-14;

    cin >> a >> b >> c;

    if (sqrt(a) + sqrt(b) + eps < sqrt(c))
    {
        cout << "Yes" << endl;
    }else
    {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
//package com.company;

import java.io.*;
import java.util.*;

public class Main {
//public class Betweenaandb {

    public static void main(String[] args) {

        out = new PrintWriter(new BufferedOutputStream(System.out));
        MyScanner sc = new MyScanner();//start
        long a=sc.nextLong();
        long b=sc.nextLong();
        long n=sc.nextLong();
        if(a%n==0){
        out.println(((b/n-a/n))+1);
        }else
        {
        out.println(((b/n-a/n)));
        }
        out.close();
    }


    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
    //--------------------------------------------------------

}


Measured memory_bytes: 32864
from collections import Counter
n = int(input())
string_list=["".join(sorted(input())) for i in range(n)]

ans = 0
cnt = Counter(string_list)
for i in cnt.most_common():
    if i[1] != 1:
        ans += (i[1] * (i[1]-1) ) // 2
print(ans)

Measured memory_bytes: 24488
#include<bits/stdc++.h>
     
    using namespace std;
     
    int _count[500];
     
    int main(){
     
    string str;
     
    cin >> str;
     
    for(int i=0; i<str.length();i++){
     
    _count[str[i]]++;
     
    }
     
    bool No = false;
     
    for(int i='a'; i<='z'; i++){
    if(_count[i] %2 != 0)
     No = true;
    }
     
    if(No) cout << "No"<<endl;
    else cout <<"Yes"<<endl;
     
     
    return 0;
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;
 
#define rep(i, n) for(int i = 0; i < (int)(n);    i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }

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

  int ans[2] = {0}, t[2] = {0};
  std::string s; std::cin >> s;

	for(int i=sz(s)-1; i>=0; i--){
	  int n = s[i]-'0';
		t[0] = std::min(ans[0], ans[1]+1) + n;
		if(i < sz(s)-1) t[1] = std::min(ans[0]+(10-n), ans[1]+(10-n-1));
		else t[1] = ans[0]+(10-n);
		ans[0] = t[0];
		ans[1] = t[1];
	}
  std::cout << std::min(ans[0],ans[1]+1) << std::endl;
  return 0;
}


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

using namespace std;
typedef long long ll;
//typedef unsigned long long ll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
//const ll INF = LONG_LONG_MAX;
const ll MINF = LONG_LONG_MIN;
const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;


int main() {
    string s;
    cin >> s;

    for (int i = 0; i < s.size() - 1; i++) {
        if (s[i] == s[i + 1]) {
            cout << i + 1 << ' ' << i + 2 << endl;
            return 0;
        }
    }

    for (int i = 0; i < s.size() - 2; i++) {
        if (s[i] == s[i + 2]) {
            cout << i + 1 << ' ' << i + 3 << endl;
            return 0;
        }
    }

    printf("-1 -1\n");
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N; cin >>N;
  bool hantei=false;
  int amari,kazu;
  amari=N%100;
  kazu=N/100;
  if(5*kazu>=amari){
    hantei=true;
  }
  if(hantei){
    cout<<1<<endl;
  }else{
    cout<<0<<endl;
  }
  return 0;
}

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

signed main() {
	string S;
	cin >> S;
	rep(i,5)
	{
		cout << S[i];
	}
	cout << " ";
	rep(i,7)
	{
		cout << S[i + 6];
	}
	cout << " ";
	rep(i,5)
	{
		cout << S[i + 14];
	}
	cout << endl;
}


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

using namespace std;

int main() {
    
priority_queue <pair<long long ,long long > > a;


    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        long long  a1,a2;
        cin>>a1>>a2;
        a.push(make_pair(-a2,a1));
    }
long long t=0;
int flag=0;

while(!a.empty())
{
    if(t+a.top().second>-a.top().first)
    {
        flag=1;
        break;
        
    }
    else 
    {

        t+=a.top().second;
        a.pop();
    }
    
    
    
}

if(flag==1)
{
    cout<<"No";

}

else
cout<<"Yes";

    
    
    return 0;
}

Measured memory_bytes: 6384
#include <iostream>
using namespace std;
int main(void){
    int X,Y;
    cin >> X >> Y;
    bool ans = false;
    
    if(Y > X*4 || Y % 2 == 1){
        ans = false;
    }
    else if(Y == X * 4 || Y >= X * 2){
        ans = true;
    }
    else {
        ans = false;
    }
    
    if(ans){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 3596
n = int(input())
p = list(map(int, input().split()))
count = 0

for i in range(1,n-1):
    if p[i]!=p[i-1] and p[i]!=p[i+1] and p[i-1]!=p[i+1] and p[i]!= max(p[i-1],p[i], p[i+1]) and p[i]!= min(p[i-1],p[i], p[i+1]):
        count = count + 1
    if (p[i]==p[i-1] or p[i]==p[i+1] or p[i-1]==p[i+1])  and p[i] == max(p[i-1],p[i], p[i+1]):
        count = count + 1

print(count)  

Measured memory_bytes: 3064
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = Integer.parseInt(sc.next());
        int n = Integer.parseInt(sc.next());
        int[] a = new int[n];
        int[] b = new int[n];
        int[][] dp = new int[n + 1][h + 1];
        int max = 0;
        for (int i = 0; i < n; i++) {
            int aa = Integer.parseInt(sc.next());
            max = Math.max(max, aa);
            a[i] = aa;
            b[i] = Integer.parseInt(sc.next());
        }
        for (int i = 0; i <= n; i++) {
            Arrays.fill(dp[i], 1_000_000_000);
        }
        dp[0][0] = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= h; j++) {
                dp[i + 1][j] = Math.min(dp[i + 1][j], dp[i][j]);
                dp[i + 1][Math.min(j + a[i], h)] = Math.min(dp[i + 1][Math.min(j + a[i], h)], dp[i + 1][j] + b[i]);
            }
        }
        System.out.println(dp[n][h]);
    }
}


Measured memory_bytes: 87364
using System.Collections.Generic;
using System.Linq;
using static System.Console;
class K
{
	static void Main()
	{
		var I = ReadLine().Split().Select(int.Parse).ToArray();
		int N = I[0], A = I[1], B = I[2];
		if (C(A ^ B) % 2 < 1) { WriteLine("NO"); return; }
		WriteLine("YES");
		WriteLine(string.Join(" ", G(N, A, B)));
	}
	static IEnumerable<int> G(int N, int A, int B)
	{
		if (N == 1) return new[] { A, B };
		var p = new int[N];
		int c = C(B ^= A), o = N - 1, z = 0;
		for (var i = 0; i < N; i++) p[i] = (B & (1 << i)) > 0 ? o-- : z++;
		B = ((1 << c) - 1) << (N - c);
		var l = new List<int>();
		var M = 1 << (N - 1);
		for (var i = 0; i < M; i++) l.Add(i ^ (i >> 1));
		foreach (var i in G(N - 1, 1 << (N - 2), B ^ M)) l.Add(i ^ M);
		return l.Select(x =>
		{
			var s = A;
			for (var j = 0; j < N; j++) s ^= ((x >> p[j]) & 1) << j;
			return s;
		});
	}
	static int C(int n)
	{
		n = (n & 0x55555555) + ((n >> 1) & 0x55555555);
		n = (n & 858993459) + ((n >> 2) & 858993459);
		n = (n & 252645135) + ((n >> 4) & 252645135);
		n = (n & 16711935) + ((n >> 8) & 16711935);
		return (n & 65535) + ((n >> 16) & 65535);
	}
}


Measured memory_bytes: 24924
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    a, b = LI()
    for i in range(10 ** 5):
        if int(i * 0.08) == a and int(i * 0.1) == b:
            print(i)
            return
    print(-1)
    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 39024
h,w,a,b=map(int,input().split())
N=h+w
mod=10**9+7
fac=[1]*(N+2)
inv=[1]*(N+2)
t=1
for i in range(1,N+2):
    t*=i
    t%=mod
    fac[i]=t
t=pow(fac[N+1],mod-2,mod)
for i in range(N+1,0,-1):
    inv[i]=t
    t*=i
    t%=mod
def comb(n,r):
    return fac[n]*inv[n-r]*inv[r]%mod
c=[0]
for i in range(h-a):
    c.append(comb(b+i,i))
ans=0
for i in range(h-a):
    ans+=(c[i+1]-c[i])*comb(w-b+h-i-2,w-b-1)%mod
    ans%=mod
print(ans)

Measured memory_bytes: 54876
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest119-A
#  TODO https://atcoder.jp/contests/abc119/tasks/abc119_a

def solveProblem(HeiseiOrTBD):
	if(HeiseiOrTBD <= "2019/04/30"):
		answer="Heisei"
	else:
		answer="TBD"
	return answer


if __name__ == '__main__':
	S = str(input().strip())
	solution = solveProblem(S)
	print("{}".format(solution))


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

const int INF = 1 << 25;
typedef pair<int, int> P;
typedef pair<P, int> PP;
int N, M;
int minId[3] = { INF, INF, INF };
int S[3];
P dist[3][20000];
int group[20000];
vector<int> G[20000];

void bfs(int s){
	priority_queue<PP, vector<PP>, greater<PP>> q;
	for(int i = 0; i < N + 3; i++){
		dist[s][i] = { INF, INF };
	}
	dist[s][S[s]] = { 0, minId[s] };
	q.push({ { 0, minId[s] }, S[s] });

	while(q.size()){
		PP p = q.top();
		q.pop();
		int v = p.second;
		if(dist[s][v] != p.first) continue;
		int d = p.first.first, id = p.first.second;
		for(auto u : G[v]){
			P nd = { d + 1, min(u, id) };
			if(u >= N || v >= N){
				nd.first--;
			}
			if(dist[s][u] > nd){
				dist[s][u] = nd;
				q.push({ nd, u });
			}
		}
	}
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	memset(group, -1, sizeof group);
	int A[3];
	cin >> N >> A[0] >> A[1] >> A[2];
	S[0] = N, S[1] = N + 1, S[2] = N + 2;
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < A[i]; j++){
			int a;
			cin >> a;
			a--;
			group[a] = i;
			minId[i] = min(minId[i], a);
			G[S[i]].push_back(a);
			G[a].push_back(S[i]);
		}
	}
	cin >> M;
	for(int i = 0; i < M; i++){
		int x, y;
		cin >> x >> y;
		x--, y--;
		G[x].push_back(y);
		G[y].push_back(x);
	}

	for(int i = 0; i < 3; i++){
		bfs(i);
	}

	P ans = { INF, INF };
	for(int i = 0; i < N; i++){
		int sum = 0, id = INF;
		for(int j = 0; j < 3; j++){
			sum += dist[j][i].first;
			id = min(id, dist[j][i].second);
		}
		ans = min(ans, { sum, id });
	}
	cout << ans.first << " " << ans.second + 1 << endl;
}

Measured memory_bytes: 10020
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin,(obj).end()
#define SORT(list) sort(ALL((list)));
using namespace std;
using ll = long long;
int main(){
    int x,y;
    cin >> x >> y;
    cout  << x+(y/2) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <climits>
#include <numeric>
#include <cassert>
#include <algorithm>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <vector>
#include <array>
#include <memory>

#define IN(a,b) (a.find(b) != a.end())
#define p(a,b) make_pair(a,b)
#define readVec(a) for (int __i = 0; __i<(int)a.size();__i++){cin>>a[__i];}

// jimjam

template<typename T>
void pMin(T &a, T b) {if (b<a){a=b;}}
template<typename T>
void pMax(T &a, T b) {if (b>a){a=b;}}
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& c);
template<typename A, typename B>
std::ostream& operator<<(std::ostream& os, const std::pair<A,B>& c) {std::cout << "(" << c.first << ", " << c.second << ")";return os;}
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& c) {
	if (c.size() == 0) {os << "{}"; return os;}
	os << "{" << c[0];
	for (int64_t i = 1; i < (int)c.size(); i++) {os <<", "<<c[i];}
	os << "}";
	return os;
}

using namespace std;

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

	int n; cin >> n;
	cout << (n%1000 ? 1000-(n%1000) : 0)<< endl;
	return 0;
}




Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 998244353;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }
template<class itr, class itr2> bool next_sequence2(itr first, itr last, itr2 first2, itr2 last2){ itr now = last; itr2 now2 = last2; while(now != first){ now--, now2--; (*now)++; if((*now) == (*now2)){ (*now) = 0; }else{ return true; } } return false; }

int main(){
    int N;
    cin >> N;
    int ans = 1;
    lint back;
    cin >> back;
    for(int i = 1; i < N; i++){
        lint A;
        cin >> A;
        if(back >= A){
            ans++;
        }
        back = A;
    }
    cout << ans << endl;
    cout << N << endl;
}



Measured memory_bytes: 3100