akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#ifndef bhartiya
    #pragma GCC optimize("Ofast")
    #pragma GCC optimize("unroll-loops")
    // #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif


typedef long long ll;
typedef pair<ll, ll> pll;
typedef gp_hash_table<long long, long long> umap;
typedef tree<int, null_type, less<int>, rb_tree_tag,
		tree_order_statistics_node_update> oset;
// not that imp
typedef pair<pll, ll> plll;
typedef vector<ll> vl;
typedef vector<pll> vll;

#define inf 200000000000000ll
#define mod 1000000007ll
#define eps 1e-7
#define PI 3.1415926535897932385
// #define PI acos(-1)

#define pb push_back
#define bitc  __builtin_popcountll
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()

#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define foreach(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) memset(ar, val, sizeof(ar))

#ifdef bhartiya
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif

mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
inline bool equals(double a, double b) {return fabs(a - b) < 1e-9;}
ll gcd(ll a, ll b){ return b==0 ? a : gcd(b, a%b); }

const ll maxn = 500005;
ll n;

int main() 
{ 
	ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0), cout.precision(10); //cout<<fixed;
    cin.exceptions(cin.failbit);
    #ifdef bhartiya
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int t = 1;
    // cin>>t;
    while(t--){
        ll r,d,x;
        cin>>r>>d>>x;
        rep(i,10){
            x = r*x - d;
            cout<<x<<"\n";
        }

    }
    end_routine();
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define forn(low,high,i) for(i=low;i<high;i++)
#define forrev(high,low,i) for(i = high; i>= low;i--)                                 //g++ template.cpp -o template.exe
#define zeroes(x) memset(x,0,sizeof(x))                                        //all elements to 0  |  \
#define all(x) (x).begin(), (x).end()
typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const ll mod =1e9+7;
const ll maxn=100000;







bool sortbysec(const pair<int,int> &a,                         //sorting of elements wrt second
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 




int main()
{
    string s,t;
    cin>>s;
    cin>>t;
    long long int i,cnt=0;
    for(i=0;s[i]!='\0';i++)
    {
        if(s[i]!=t[i])
            cnt++;

    }
    cout<<cnt;

    return 0;
}

Measured memory_bytes: 3916
from sys import exit
A,B = [int(n) for n in input().split()]
# N = int(input())
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
# exit()
ans = 0
if A < B:
    ans = ans + B
    B-=1
else:
    ans = ans + A
    A-=1

ans+=max(A,B)
print(ans)


Measured memory_bytes: 2940
n=int(input())
a=[];b=[]
for i in range(n):
    A,B=map(int,input().split())
    a.append(A)
    b.append(B)
k=0
ans=0
for i in range(n-1,-1,-1):
    if (a[i]+ans)%b[i]==0:
        continue
    ans += b[i]-((a[i]+ans)%b[i])
print(ans)

Measured memory_bytes: 56796
#include<bits/stdc++.h>
using namespace std;
long long m=998244353;

long long power(long long x,long long y)
{
    long long res = 1; x=x%m;
    while (y > 0)
    {
        if (y & 1) res = (res*x)%m;
        y = y>>1;
        x = (x*x)%m;
    }
    return res%m;
}

int main()
{
    long long a,b,x,y,z;
    cin>>a>>b>>x>>y>>z;
    priority_queue<pair<long long,long long> >p;
    for(long long i=0; i<x; i++)
    {
        long long a;
        cin>>a;
        p.push(make_pair(a,0));
    }
    for(long long i=0; i<y; i++)
    {
        long long a;
        cin>>a;
        p.push(make_pair(a,1));
    }
    for(long long i=0; i<z; i++)
    {
        long long a;
        cin>>a;
        p.push(make_pair(a,2));
    }
    long long ans=0,c=a+b;
    vector<pair<long long,long long> >left;
    while(c>0)
    {
        pair<long long,long long> q=p.top();
        p.pop();
        if(q.second==0 && a>0)
        {
            ans+=q.first;
            a--; c--;
        }
        else if(q.second==1 && b>0)
        {
            ans+=q.first;
            b--; c--;
        }
        else if(q.second==2)
        {
            left.push_back(q);
            c--;
        }
    }
    for(int i=0; i<left.size(); i++)
        ans+=left[i].first;
    cout<<ans<<endl;
    return 0;
}


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

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#define PRINTP(p)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#p<<" = ("<<(p.first)<<", "<<(p.second)<<")"<<endl;
#define PRINTI(a,i)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<#i<<"] = "<<#a<<"["<<(i)<<"] = "<<(a)[i]<<endl;
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#define PRINTP(p)
#define PRINTI(a,i)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

template <class T>
using vec2 = vector<vector<T>>;

template <class T>
using vec3 = vector<vector<vector<T>>>;

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

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

    int N;
    cin >> N;
    vector<int> A(N);
    vector<ll> cnt(N);
    REP(i, N) {
        cin >> A[i];
        --A[i];
        cnt[A[i]]++;
    }

    PRINTA(cnt, 0, cnt.size());
    ll result = 0;
    REP(i, N) {
        result += cnt[i] * (cnt[i] - 1) / 2;
    }
    REP(i, N) {
        cout << (result - (cnt[A[i]] - 1)) << '\n';
    }
    cout << flush;

    return 0;
}


Measured memory_bytes: 4992
// Math = ♥️

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
#define pq priority_queue
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define sz(c) ((ll)c.size())
#define ordered_set                            \
    tree<ll, null_type, less<ll>, rb_tree_tag, \
         tree_order_statistics_node_update>

ld dist(ll x1, ll y1, ll x2, ll y2, ll r1, ll r2) {
    ld d = 0;
    d -= r1 + r2;
    d += sqrtl(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
    return max((ld)0, d);
}

int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll sx, sy, ex, ey;
    cin >> sx >> sy >> ex >> ey;

    ll n;
    cin >> n;
    ld g[n + 2][n + 2];

    vector<pair<ii, ll>> edge(n);
    for (int i = 0; i < n; i++) {
        cin >> edge[i].ff.ff >> edge[i].ff.ss >> edge[i].ss;
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            ld c = dist(edge[i].ff.ff, edge[i].ff.ss, edge[j].ff.ff,
                        edge[j].ff.ss, edge[i].ss, edge[j].ss);
            g[i + 1][j + 1] = c;
            g[j + 1][i + 1] = c;
        }
    }

    for (int i = 0; i < n; i++) {
        ld c = dist(sx, sy, edge[i].ff.ff, edge[i].ff.ss, 0, edge[i].ss);
        g[0][i + 1] = c;
        g[i + 1][0] = c;

        c = dist(ex, ey, edge[i].ff.ff, edge[i].ff.ss, 0, edge[i].ss);
        g[n + 1][i + 1] = c;
        g[i + 1][n + 1] = c;
    }

    ld fin = dist(sx, sy, ex, ey, 0, 0);
    g[0][n + 1] = fin;
    g[n + 1][0] = fin;

    pq<pair<ld, ll>, vector<pair<ld, ll>>, greater<pair<ld, ll>>> q;
    q.push({0, 0});

    ld dist[n + 2];
    for (int i = 0; i < n + 2; i++) {
        dist[i] = 1e16;
    }
    vector<bool> marked(n + 2, false);
    dist[0] = 0;

    for (int i = 0; i < n + 2; i++) {
        ll u = -1;
        for (int j = 0; j < n + 2; j++) {
            if (!marked[j] && (u == -1 || dist[j] < dist[u])) {
                u = j;
            }
        }

        if (u == -1 || dist[u] == 1e16) {
            break;
        }

        marked[u] = true;
        for (int i = 0; i < n + 2; i++) {
            if (dist[i] > dist[u] + g[u][i]) {
                dist[i] = dist[u] + g[u][i];
            }
        }
    }

    cout << fixed << setprecision(9) << dist[n + 1] << "\n";
}


Measured memory_bytes: 16000
#include <stdio.h>

int main() {
  int a;
  int b;
  scanf("%d %d", &a, &b);
  if (a < b) {
    printf("a < b\n");
  } else if (a > b) {
    printf("a > b\n");
  } else {
    printf("a == b\n");
  }
  return 0;
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll a,k,tim,las,n;

int main(){
	cin>>k;
	n=50;
	cout<<n<<endl;
	tim=k/n;
	las=k-tim*n;
	for (int i=1;i<=50;i++){
		if (i<=las){
			cout<<(tim+50)<<' ';
		}else{
			cout<<(tim+49-las)<<' ';
		}
	}
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    X = int(input())

    for a in range(0, 1000):
        for b in range(-1000, 1000):
            if (a ** 5 - (b ** 5)) == X:
                print(a, b)
                return


if __name__ == '__main__':
    main()

Measured memory_bytes: 63576
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vll wh(n+1);
    REP(i,n){
        ll a;
        cin >> a;
        wh[a] = i;
    }
    set<ll> p;
    set<ll> m;
    ll ans = 0;
    for(ll i = 1;i<=n;i++){
        ll now = wh[i];
        ll r,l;
        auto ri = p.upper_bound(now);
        if(ri==p.end()){
            r=n;
        }else{
            r=(*ri);
        }
        auto li = m.upper_bound(-now);
        if(li==m.end()){
            l=-1;
        }else{
            l=-(*li);
        }
        ans+= i*(r-now)*(now-l);
        p.insert(now);
        m.insert(-now);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 20608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main(){
    int n;
    cin>>n;
    int a[n],cnt=0;
    map<int,int>m;
    for(int i=0;i<n;i++){
        cin>>a[i];m[a[i]]++;
    }
    for(int i=0;i<n;i++){
        int flag=1;
        if(a[i]==1 && m[1]==1) {cnt++;continue;}
        for(int j=1;j<=sqrt(a[i]);j++){
            if(a[i]%j==0){
                if(m[j]) {flag=0;break;}
                if(a[i]/j!=a[i]&&m[a[i]/j]) {flag=0;break;}
                if(a[i]/j==a[i]&&m[a[i]/j]>1) {flag=0;break;}
            }
        }
        if(flag) cnt++;
    }
    cout<<cnt;
}


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

int main(){
  int n;
  while(1){
    cin >> n;
    if(n == 0) break;

    int y;
    int b[50],r[50],t[50];
    cin >> y;
    for(int i = 0;i < n;i++) cin >> b[i] >> r[i] >> t[i];

    int ansg;
    double ansm = 0;
    double k;
    for(int i = 0;i < n;i++){
      if(t[i] == 1){
        k = 1 + y * (r[i] / 100.0);
      }else{
        k = pow(1 + (r[i] / 100.0),y);
      }
      if(ansm < k){
        ansm = k;
        ansg = b[i];
      }
    }

    cout << ansg << endl;
  }

  return 0;
}




Measured memory_bytes: 3092
#include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll> 
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++) 
#define forr1(i, n) for(ll i=1; i<=n; i++)
using namespace std;
const ld PI =3.1415926535897923846;
const ll MOD = 1e9+7;
void solve()
{
    double r;
    cin>>r;
    std::cout<<setprecision(20)<<2*PI*r;
}
int main()
{
    ll test=1;
    //cin>>test;
    while(test--)
        solve();
}

Measured memory_bytes: 3752
#include <stdio.h>

int main(void) {
	int A, B;

	scanf("%d%d",&A,&B);

	if (A > 12) {
		printf("%d", B);
	}
	else if(A>5){
		printf("%d", B / 2);
	}
	else {
		printf("0");
	}

	return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

constexpr ll infl = 10000000000000007LL;
constexpr int inf = 1000000007;

int main() {
    ll s;
    cin >> s;
    if (s == 1000000000000000000LL) {
        cout << 0 << " ";
        cout << 0 << " ";
        cout << 0 << " ";
        cout << 1000000000 << " ";
        cout << 1000000000 << " ";
        cout << 0 << " ";
    } else {
        ll a = (ll)(sqrt(s)) + 1;
        ll b = a * a - s;
        cout << 0 << " ";
        cout << 0 << " ";
        cout << a << " ";
        cout << b << " ";
        cout << 1 << " ";
        cout << a << " ";
    }
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

// BEGIN NO SAD
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef vector<int> vi;
// END NO SAD

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<vector<ll>> matrix;

ll l[200005];
int n;
void solve() {
  cin >> n;
  for(int i = 0; i < n; i++) cin >> l[i];
  for(int i = 0; i < n; i++) {
    if(l[i] % 2 == 0) {
      if(l[i] % 3 != 0 && l[i] % 5 != 0) {
        cout << "DENIED\n";
        return;
      }
    }
  }
  cout << "APPROVED\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
typedef unsigned int ui;
int main(){
	string s;
	cin >> s;
	int i; int n = s.length();
	int count[3] = {};
	for (i = 0; i < n; i++) {
		count[(s[i] - 'a')]++;
	}
	sort(count, count + 3);
	if (count[2] - count[0] <= 1)cout << "YES" << endl;
	else cout << "NO" << endl;
	char nyaa;
	std::cin >> nyaa;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
using P = pair<int, int>;

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

    int n; cin >> n;
    map<int, int> m1, m2;
    for (int i = 0; i < n; i+=2) {
        int v1, v2; cin >> v1 >> v2;
        m1[v1]++;
        m2[v2]++;
    }

    vector<P> a1, a2;
    a1.push_back(make_pair(0, 0));
    a2.push_back(make_pair(0, 0));
    for (P p : m1) a1.push_back(p);
    for (P p : m2) a2.push_back(p);
    sort(a1.begin(), a1.end(), [](P p1, P p2) {
        return p1.second > p2.second;
    });
    sort(a2.begin(), a2.end(), [](P p1, P p2) {
        return p1.second > p2.second;
    });

    int ans;
    if (a1[0].first != a2[0].first)
        ans = n - (a1[0].second + a2[0].second);
    else
        ans = n - max(a1[0].second + a2[1].second,
                      a1[1].second + a2[0].second);
    cout << ans << "\n";
}

Measured memory_bytes: 6140
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <unordered_map>

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

using namespace std;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main(){
    ll n; cin >> n;
    if(n%2 != 0) {
        cout << 0 << endl;
        return 0;
    }
    ll count = 0;
    for(int i=1;i<30; i++) {
        // cout << pow(10,i) << endl;
        count += n/ll(pow(5,i))/2;
    }
    cout << count << endl;
}


Measured memory_bytes: 640
import java.util.Arrays;
import java.util.Scanner;
 
public class Main {
  
	public static class Binary{
		Binary left, right;

		public Binary(Binary left, Binary right) {
			super();
			this.left = left;
			this.right = right;
		}
		
		@Override
		public String toString(){
			return "(" + (left == null ? "" : left) + "," + (right == null ? "" : right) + ")";
		}
		
		public static Binary add(Binary fst, Binary snd){
			if(fst == null && snd == null){
				return null;
			}else if(fst == null){
				return new Binary(Binary.add(null, snd.left), Binary.add(null, snd.right));
			}else if(snd == null){
				return new Binary(Binary.add(fst.left, null), Binary.add(fst.right, null));
			}else{
				return new Binary(Binary.add(fst.left, snd.left), Binary.add(fst.right, snd.right));
			}
		}
		
		public static Binary mul(Binary fst, Binary snd){
			if(fst == null || snd == null){
				return null;
			}else{
				return new Binary(Binary.mul(fst.left, snd.left), Binary.mul(fst.right, snd.right));
			}
		}
	}
	
	public static Binary parse(char[] input, int start, int end){
		if(start > end){
			return null;
		}
		
		if(input[start] == '('){
			int c_lv = 1;
			int t_pos = -1;
			int c_end = -1;
			for(int pos = start + 1; pos <= end; pos++){
				if(input[pos] == '('){
					c_lv++;
				}else if(input[pos] == ')'){
					c_lv--;
					if(c_lv == 0){
						c_end = pos;
						break;
					}
				}else if(c_lv == 1 && input[pos] == ','){
					t_pos = pos;
				}
			}
			
			return new Binary(parse(input, start + 1, t_pos - 1), parse(input, t_pos + 1, c_end - 1));
		}
		
		return null;
	}
	
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
         
        while(sc.hasNext()){
        	String ops = sc.next();
        	String fst = sc.next();
        	String snd = sc.next();
        	
        	//System.out.println(fst + " " + snd);
        	
        	Binary fst_b = parse(fst.toCharArray(), 0, fst.length() - 1);
        	Binary snd_b = parse(snd.toCharArray(), 0, snd.length() - 1);
        	
        	//System.out.println(fst_b + " " + snd_b);
        	
        	System.out.println(ops.equals("u") ? Binary.add(fst_b, snd_b) : Binary.mul(fst_b, snd_b));
        }
    }
}

Measured memory_bytes: 18008
N = int(input())
CSF = [list(map(int, input().split())) for i in range(N-1)]
time ={}
time[N] = 0

def timecal(i, now=0):
    if i == N:
        return now
    else:
        if now <= CSF[i-1][1]:
            return timecal(i+1, CSF[i-1][1] + CSF[i-1][0])
        else:
            return timecal(i+1, now + CSF[i-1][0] + (CSF[i-1][2] - now % CSF[i-1][2]) % CSF[i-1][2])

for i in range(1,N+1):
    print(timecal(i,0))


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

/*
貪欲法.
株は安いときにたくさん買って, 高いときにたくさん売れば利益が最大化される.
せっかく未来が分かるのだから, 今日の株価と明日の株価を比べて,
今日の方が安かったら買える分全て買い, 明日全て売れば良い.
*/

int main() {
  long long N;
  cin >> N;
  
  long long A[85] = {0};
  for (int i = 1; i <= N; i++) cin >> A[i];
  
  long long money = 1000;
  for (int i = 1; i < N; i++) {
    long long stock = 0;
    // 今日の方が明日より安かったら買える分だけ買う
    if (A[i] < A[i+1]) stock = money / A[i];
    // 今日買ったということは明日の方が高い. 明日と今日の差額 * 今日買った株数が利益になる.
    // 今日買わなかったならstockは0なので所持金は変わらない.
    money += (A[i+1] - A[i]) * stock;
  }
  
  cout << money << endl;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define lp(i, x, n) for (int i = x; i < (int)n; ++i)
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
#define ll long long
#define N 123451


int main(){
        int x1, y1, x2, y2;
        scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
        int x3 = x2 - x1, y3 = y2 - y1;
        int s1 = (x2 - y3), s2 = (y2 + x3);
        printf("%d %d %d %d", s1, s2, (s1 - x3), (s2 - y3));
        return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x;
  cin >> n >> x;
  int L, D = 0, count = 1;
  for (int i = 1; i <= n; i++) {
    cin >> L;
    D += L;
    if (D <= x) {
      count++;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>

using namespace std;
using i64 = long long int;
using P = pair<i64, i64>;

i64 gcd(i64 a, i64 b){
    //
    // Euclidean Algorithm (かっこいい) O(logN)
    // i64 a, b: GCDを求める数 a > b を仮定している
    //
    if(a % b == 0) return b;
    else return gcd(b, a % b);
}

i64 modpow(i64 x, i64 n){
    //
    // 繰り返し二乗法 O(logN)
    // i64 x, n: x^n mod 1e9+7 を求める modの値の変え忘れに注意(modを渡すべき?)
    //
    const i64 mod = 1000000007;
    i64 res = 1;
    while(n > 0){
        if(n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

map<i64, i64> prime_factorize(i64 n){
    map<i64, i64> mp;
    for(i64 i = 2;  i * i <= n; ++i){
        while(n % i == 0){
            mp[i]++;
            n /= i;
        }
    }
    if(n != 1) mp[n] = 1;
    return mp;
}

void NTL_1_A(){
    i64 n;
    cin >> n;
    auto factors = prime_factorize(n);
    cout << n << ':';
    for(auto f : factors){
        for(int i = 0; i < f.second; ++ i){
            cout << ' ' << f.first;
        }
    }
    cout << endl;
}

void NTL_1_B(){
    i64 m, n;
    cin >> m >> n;
    cout << modpow(m, n) << endl;
}

int main(){
    NTL_1_A();
    /* NTL_1_B(); /* https://onlinejudge.u-aizu.ac.jp/status/users/kobaryo222/submissions/1/NTL_1_B/judge/3892552/C++14 */
}


Measured memory_bytes: 3084
#include <stdio.h>
#include <stdlib.h>
#define n 100001

int main(){
  int a,i,j = 0,*A,temp;

  scanf("%d",&a);

  A = malloc(sizeof(int) * a + 1);

  for(i = 0; i < a; i++) scanf("%d",&A[i]);

  for(i = 0; i < a; i++){
    if(A[i] <= A[a-1]){
      temp = A[j];
      A[j] = A[i];
      A[i] = temp;
      j++;
    }
  }
  for(i = 0; i < a; i++) {
    if(j-1 == i){
      printf("[%d]",A[i]);
    }
    else printf("%d",A[i]);
    if(a-1 != i) printf(" ");
  }
  printf("\n");
  return 0;
}

Measured memory_bytes: 992
#include<bits/stdc++.h>
#define int long long
using namespace std;
int iti[12345678], cnt[12345678], cost[4321][4321];
signed main() {
	int n, a, d, z = 0, un = 0, ans = 1; cin >> n;
	for (int h = 1; h <= n; h++) { cin >> iti[h]; }
	d = 1; cnt[1] = 1;
	while (true) {
		d = iti[d]; if (d == 2) { cout << ans << endl; return 0; }
		if (cnt[d] == 1) { cout << -1 << endl; return 0; }
		ans++; cnt[d] = 1;
	}
	return 0;
}

Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>
#include <list>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define reps(x,c) for(auto x:c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a) 
#define mp(a,b) make_pair((a),(b))
#define pl pair<ll,ll>
#define INF 2147483600
#define MOD 1000000007
#define fi first
#define se second
#define dbg(x) cout << #x"="<< (x) << endl
#define dbgv(x) cout<<#x<<endl;reps(y,x){cout<<y<<" ";}cout<<endl

int main(){
  ll n;cin>>n;
  ll ans=0,temp;
  rep(i,n){
    cin>>temp;
    ans+=temp-1;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x, i = 1;
        while(true) {
            x = i;
            if (x % 3 == 0) System.out.printf(" %d", i);
            else{
                while (true){
                    if (x % 10 == 3) {
                        System.out.printf(" %d", i);
                        break;
                    }else{
                        x /= 10;
                        if (x == 0) break;
                    }
                }
            }
            if (++i <= n) continue;
            else break;
        }
        System.out.println("");
    }
}

Measured memory_bytes: 38600
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>


#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

//using namespace std;

/*
int main(void) {
	string str;
	cin >> str;
	string f = str.substr(0, 2);
	string b = str.substr(2, 2);
	int fi = stoi(f);
	int bi = stoi(b);
	bool fM = true, fY = true, bM = true, bY = true;
	if()
}
*/

//126A
int main(void) {
	std::string s;
	ll n, k;
	std::cin >> n >> k >> s;
	char c = s[k - 1];
	std::string str{ c };
	std::transform(str.begin(), str.end(), str.begin(), tolower);
	s.replace(k-1,1, str);
	std::cout << s << std::endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

typedef long long ll;

constexpr int INF = 1e8;
constexpr int MOD = 1e9+7;

int main(void) {
    int i, t;
    int a[3];
    cin >> t;
    while (t--) {
        REP (i,3) cin >> a[i];
        sort(a,a+3);
        if (a[0]*a[0] + a[1]*a[1] == a[2]*a[2])
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 3124
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
vector<string> v={"MON", "TUE", "WED", "THU", "FRI","SAT","SUN"};
int main(){

ll n,m,a,b,r=0,c,k;
string s;
cin>>s;
for (ll i=0;i<7;i++)
{
    if(s==v[i])
    {
        if(i==6)
        {
            cout<<7;
        }
        else
        {
            cout<<6-i;
        }
    }
}

    return 0;

    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
vector<vector<int> > dp(2005,vector<int>(2005,-1));
 
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t,s;
    cin>>t>>s;
    
    vector<pair<int,int> > vec;
    for(int i=0;i<t;i++){
        int a,b;
        cin>>a>>b;
        vec.push_back(make_pair(a,b));
    }
    vector<long long> dp(s+1,0);
    dp[0]=1;
    
    for(int i=0;i<vec.size();i++){
        for(int j=dp.size()-1;j>=0;j--){
            if(dp[j] && j+vec[i].first <=s)
                dp[j+vec[i].first]=max(dp[j+vec[i].first],dp[j]+vec[i].second);
        }
    }
    long long ans=0;
    for(int i=0;i<dp.size();i++){
        ans=max(ans,dp[i]);
    }
    cout<<ans-1;
    
    
	return 0;
}

Measured memory_bytes: 16768
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

int main(){
 string str; cin >> str;
 bool pos=false;
 for(int i=0;i<str.size()-1;i++){
   if(str[i]=='A' && str[i+1]=='C'){
     pos=true;
     break;
   }
 }
 if(pos) cout << "Yes" << endl;
 else cout << "No" << endl;
}

Measured memory_bytes: 256
<?php
$s = trim(fgets(STDIN));
$ans = 0;
$max = 0;
for ($i = 0;$i < strlen($s);++$i) {
    if($s[$i] == "R") {
        ++$max;
    } else {
        $max = 0;
    }
    $ans = max($ans,$max);
}
echo $ans.PHP_EOL;

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

using namespace std;

void solve()
{
	string S;
	cin >> S;
	int l = S.size(), z = 0;
	for (char c : S)
	{
		z += c == '0';
	}
	z = min(z, l-z);
	cout << z * 2 << endl;
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e9;

int main() {
    string S; cin >> S;
    int ans = 0;
    for(int i =0; i < S.size(); i++) if(S[i] == '1') ans++;
    cout << ans << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input())
    b, c = [str(i) for i in input().split()]

    ans = ""
    for i in range(N):
        ans += b[i]
        ans += c[i]
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 28012
#include<iostream>
#include<string>
#include<algorithm>
#include<boost/algorithm/string/predicate.hpp>

using namespace std;

int main(int argc, char* argv[])
{
  string target,word;
  int count=0;
  cin >> target;
  while(1)
  {
    cin >> word;
    if(word=="END_OF_TEXT") break;
    if(boost::iequals(word,target)) count++;
  }
  cout << count << endl;
}

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

#define endl '\n'
#define ll long long
#define rint register int

#define re register
#define pb(x) push_back(x);
#define ce(x) cout << x << '\n';

using db = long double;
using pll = pair < ll, ll >;
#define scan(a, n) 		for(int i = 0; i < n; i++)cin >> a[i];

#define rep(i,x,n,inc) for(i=x ; i<n ; i+=inc)
#define repr(i,x,n,inc) for( i=x ; i>n ; i+=inc)
#define all(a)      (a).begin(),(a).end()
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))

#define mp(a,b) make_pair(a,b)
#define ff first
#define ss second
#define hell 1000000007
#define infl LLONG_MAX

#define Foxen(i,s) for (i=s.begin(); i!=s.end(); i++)
#define Fill(s,v) memset(s,v,sizeof(s))
#define cout_p(x, p) cout << fixed << setprecision((p)) << x << endl     //print with precision

#define tc(tt) \
    ll tt;    \
    cin >> tt; \
    for (ll _tt = 0; _tt < tt; _tt++) // testcase 

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll t, i, x, j, y, 	z, k, n;
	cin >> n >> k;
	ll a[n], b[n];
	scan(a, n);

	rep(j, 0, min(51LL,k), 1) {
		memset(b, 0, sizeof(b));
		rep(i, 0, n, 1) {
			ll mi = max(0LL, i - a[i]), mx = min(n - 1, i + a[i]);
			b[mi]++;
			b[mx + 1]--;
		}
		bool br = a[0] == b[0];
		rep(i, 1, n, 1) {
			b[i] += b[i - 1];
			br = br && (a[i] == b[i]);
		}

		if (br)	break;

		rep(i, 0, n, 1)
		a[i] = b[i];

	}

	rep(i, 0, n, 1)	cout << a[i] << " ";
}


Measured memory_bytes: 6712
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ll long long
#define M 1000000007
#define sz(a) (ll)a.size()
#define pll pair<ll,ll>
#define rep(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define sep(i,a,b) for(ll i=(ll)a;i>=(ll)b;i--)
#define mll map<ll,ll>
#define vl vector<ll>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(),a.end()
#define F first
#define S second
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
ll n,u,v,ans;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    ans=n*(n+1)*(n+2)/6;
    rep(i,0,n-1)
    {
        cin>>u>>v;
        if(u>v)
            swap(u,v);
        ans-=(u*(n-v+1));
    }
    cout<<ans;
}


Measured memory_bytes: 3644
/*
*/

#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-11
#define M_PI 3.141592653589793
#define BS 12345678891
#define bsize 256

#define ldouble long double

using namespace std;

long long INF = 1e9;
const int N = 500031;

int n,ar[N];
vector<int> g[N];
int used[N];
int win[N];
vector<int> ans;

void solve(int v)
{
	used[v]=1;
	win[v]=0;
	for (int i=0;i<g[v].size();i++)
	{
		int to=g[v][i];
		if (used[to])
			continue;
		if (ar[to]>=ar[v])
			continue;
		solve(to);
		if (win[to]==0)
			win[v]=1;
	}
}

int main(){
	//freopen("tree.in","r",stdin);
	//freopen("tree.out","w",stdout);
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	cin>>n;
	for (int i=1;i<=n;i++)
	{
		cin>>ar[i];
	}

	for (int i=1;i<n;i++)
	{
		int a,b;
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	for (int root=1;root<=n;root++)
	{
		for (int i=1;i<=n;i++)
		{
			used[i]=0;
		}
		solve(root);
		if (win[root])
			ans.push_back(root);
	}

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

	cin.get(); cin.get();
	return 0;
}


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

int main()
{
	ll a,b,c;
	cin>>a>>b>>c;
	for(int i=0;i<c;i++)
	{
		if(i%2==0){
			if(a%2!=0){
			a--;
			b=b+a/2;
			a=a/2;
		}
		else{
			b=b+a/2;
			a=a/2;
		}
		}
		else{
			if(b%2!=0){
			b--;
			a=a+b/2;
			b=b/2;
		}
		else{
   			a=a+b/2;
			b=b/2;
		}
		}
		
	}
	cout<<a<<" "<<b<<endl;
return 0;
}

Measured memory_bytes: 256
n = int(input())
h = list(map(int, input().split()))

dp = [0]*n
dp[1] = abs(h[1]-h[0])
for i in range(2, n):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))

print(dp[n-1])

Measured memory_bytes: 13980
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
//const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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 (a>b) { a=b; return 1; } return 0; }

vector<vector<int>> G;

vector<int> topsort(int n, vector<vector<int>> G) {
  vector<int> vs, indeg(n, 0);
  rep(v, n) for (int u: G[v]) indeg[u]++;
  queue<int> q;
  vector<bool> visited(n, false);
  rep(i, n) {
    if (indeg[i] || visited[i]) continue;
    q.push(i);
    while (q.size()) {
      int v = q.front();
      q.pop();
      if (visited[v]) continue;
      vs.push_back(v);
      visited[v] = true;
      for (int u: G[v]) {
        if (visited[u]) continue;
        if (--indeg[u] == 0 && !visited[u]) q.push(u);
      }
    }
  }
  return vs;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(25);

  int n, m;
  cin >> n >> m;
  G.resize(n);
  rep(i, m) {
    int s, t;
    cin >> s >> t;
    G[s].push_back(t);
  }

  vector<int> ans = topsort(n, G);
  rep(i, n) cout << ans[i] << '\n';

  
  return 0;
}


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

using namespace std;

int main(){
  
  int A, B, C;
  cin >> A >> B >> C;
  
  if((A < C && B > C) || (A > C && B < C)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int sum[5];
	int s1,s2;
	while(cin >> s1 >> s2){
		if(s1==0 && s2==0) break;
		sum[0]=s1+s2;
		for(int i=1; i<5; i++){
			cin >> s1 >> s2;
			sum[i]=s1+s2;
		}
		int max=sum[0];
		char flag = 'A';
		for(int i=1; i<5; i++){
			if(sum[i] > max){
				max = sum[i];
				flag='A'+i;
			}
		}
		cout << flag << " ";
		cout << max << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1LL<<59)

#define int ll

signed main(){
    int h,w,d;
    cin>>h>>w>>d;
    
    vector<string> fie(h);
    rep(i,h)cin>>fie[i];
    
    int dp_x[101][101]={};
    int dp_y[101][101]={};
    
    rep(i,h)if(fie[i][w-1]=='.')dp_x[i][w-1]=1;
    rep(j,w)if(fie[h-1][j]=='.')dp_y[h-1][j]=1;
    
    rep(i,h){
        for(int j=w-2;j>=0;j--){
            if(fie[i][j] == '#')continue;
            dp_x[i][j] = dp_x[i][j+1]+1;
        }
    }
    rep(j,w){
        for(int i=h-2;i>=0;i--){
            if(fie[i][j]=='#')continue;
            dp_y[i][j] = dp_y[i+1][j]+1;
        }
    }
    
    int sum=0;
    rep(i,h){
        rep(j,w){
            if(dp_x[i][j]>=d)sum++;
            if(dp_y[i][j]>=d)sum++;
        }
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 3320
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
ll mod=1e9+7;

int main(){
  int n,k;
  cin>>n>>k;
  P a[n];
  ll b[n];
  ll c[n];
  rep(i,0,n){
    ll x,y;
    cin>>x>>y;
    a[i]=P(x,y);
    b[i]=x;
    c[i]=y;
  }
  sort(b,b+n);
  sort(c,c+n);
  ll ans=4e19;
  rep(i,0,n-1){
    rep(j,i+1,n){
      rep(h,0,n-1){
        rep(l,h+1,n){
          int cnt=0;
          rep(m,0,n){
            if(b[i]<=a[m].first && a[m].first<=b[j] && c[h]<=a[m].second && a[m].second<=c[l]){
              cnt++;
            }
          }
          if(cnt>=k){
            ans=min(ans,(b[j]-b[i])*(c[l]-c[h]));
          }
        }
      }
    }
  }
  cout<<ans<<endl;
}

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

int n;
int main() {
	cin >> n;
	switch (n % 10) {
	case 3:
		cout << "bon" << endl;
		return 0;
	case 0:
	case 1:
	case 6:
	case 8:
		cout << "pon" << endl;
		return 0;
	default:
		cout << "hon" << endl;
	}
}


Measured memory_bytes: 3648
#include<stdio.h>
#include<iostream>

using namespace std;
string s;
int main(){
    cin >> s;
    int n = s.length();
    int p = 0;
    int score = 0;
    for(int i=0; i<n; i++) {
        if( p ) {
            if( s[i] == 'g') score++;
            p--;
        } else {
            if( s[i] == 'g') p++;
            else {
                score--;
                p++;
            }
        }
    }
    cout << score << endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
 
using namespace std;
#define ll long long
#define ld long double
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<ll>
#define vii vector<pii>
#define pb push_back
#define mp  make_pair
#define all(v) (v).begin(), (v).end()

#define pb push_back
#define mp make_pair
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
ll INF = 1e6;

void solve()
{
    string s;
    cin>>s;
    if(s[0]!=s[1] || s[1]!=s[2])
    {
        cout<<"Yes";
    }
    else
        cout<<"No";
}

 
int main()
{
    SPEED;
    ll t = 1;
    //cin>>t;
    while(t--) solve();
    return 0;
}


Measured memory_bytes: 3620
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
using namespace std;
int tx[4]={0,0,-1,1},ty[4]={1,-1,0,0};
const int Q=1<<10;
char s[Q][Q];
int mini[Q][Q];
queue<int> qx,qy;
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%s",s[i]+1);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            if(s[i][j]=='#')mini[i][j]=0,qx.push(i),qy.push(j);
            else mini[i][j]=998244353;
    int als=0;
    while(qx.size()){
        int x0=qx.front(),y0=qy.front();
        qx.pop();qy.pop();
        for(int t=0;t<4;t++){
            int x1=x0+tx[t],y1=y0+ty[t];
            if(x1<1||x1>n||y1<1||y1>m)continue;
            if(mini[x1][y1]>9982443){
                mini[x1][y1]=mini[x0][y0]+1;
                qx.push(x1),qy.push(y1);
                als=max(als,mini[x1][y1]);
            }
        }
    }
    printf("%d",als);
    return 0;
}

Measured memory_bytes: 13568
#include<stdio.h>
static int N = 101;

int main(){
  int n, i, j, k, l;
  int R[N], C[N], M[N][N];
  int minx;

  scanf("%d",&n);

  for(i = 1 ; i <= n ; i++){
    scanf("%d%d",&R[i],&C[i]);
  }

  for(i = 1 ; i <= n ; i++) M[i][i] = 0;

  for(l = 2 ; l <= n ; l++){
    for(i = 1 ; i <= n - l +1 ; i++){
      j = i + l - 1;


      M[i][j] = 10000000;


      for(k = i ; k <=  j - 1 ; k++){
	minx = M[i][k] + M[k+1][j] + R[i] * C[k] * C[j];
	if(M[i][j] > minx) M[i][j] = minx;
      }
    }
  }

  printf("%d\n",M[1][n]);



  return 0;
}



Measured memory_bytes: 2148
#include<bits/stdc++.h>
using namespace std;
int a[15][15];
int main(){
	int n,d;
	scanf("%d%d",&n,&d);
	for(int i=1;i<=n;++i)
		for(int j=1;j<=d;++j)scanf("%d",&a[i][j]);
	int ans=0;
	for(int i=1;i<=n;++i)
		for(int j=i+1;j<=n;++j){
			int w=0;
			for(int k=1;k<=d;++k)w+=(a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
			int v=sqrt(w);
			if(v*v==w)ans++;
		}
	printf("%d",ans);
}

Measured memory_bytes: 256
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

int main()
{
	int e[101][101];
	int R, C, r, c;
	int s, total;

	scanf("%d%d", &R, &C);
	for (r = 1; r <= R; r++) {
		for (c= 1; c <= C; c++) scanf("%d", &e[r][c]);
	}
	
	for (r = 1; r <= R; r++) {
		s = 0;
		for (c = 1; c <= C; c++) s += e[r][c];
		e[r][0] = s;
	}
	total = 0;
	for (c = 1; c <= C; c++) {
		s = 0;
		for (r = 1; r <= R; r++) s += e[r][c];
		e[0][c] = s;
		total += s;
	}
	for (r = 1; r <= R; r++) {
		for (c = 1; c <= C; c++) printf("%d ", e[r][c]);
		printf("%d\n", e[r][0]);
	}
	for (c = 1; c <= C; c++) printf("%d ", e[0][c]);
	printf("%d\n", total);
	return 0;
}


Measured memory_bytes: 2108
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal, ROUND_CEILING
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

R, C, K = MAP()

dp1 = [[0]*4 for _ in range(C+1)]
dp2 = [[0]*4 for _ in range(C+1)]

field = [[0]*(C+1)] + [[0]*(C+1) for _ in range(R)]

for _ in range(K):
    r, c, v = MAP()
    field[r][c] = v

for i in range(1, R+1):
    for j in range(1, C+1):
        if i%2 == 0:       
            up_max = max(dp1[j])
            p = field[i][j]
            dp2[j][0] = max(up_max, dp1[j-1][0])
            dp2[j][1] = max(up_max+p, dp2[j-1][1], dp2[j-1][0]+p)
            dp2[j][2] = max(dp2[j-1][2], dp2[j-1][1]+p)
            dp2[j][3] = max(dp2[j-1][3], dp2[j-1][2]+p)
        else:
            up_max = max(dp2[j])
            p = field[i][j]
            dp1[j][0] = max(up_max, dp2[j-1][0])
            dp1[j][1] = max(up_max+p, dp1[j-1][1], dp1[j-1][0]+p)
            dp1[j][2] = max(dp1[j-1][2], dp1[j-1][1]+p)
            dp1[j][3] = max(dp1[j-1][3], dp1[j-1][2]+p)

a = max(dp1[-1])
b = max(dp2[-1])
print(max(a, b))


Measured memory_bytes: 152276
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
const ll mod = 1e9 + 7;

int main()
{
    ll n, sum = 0;
    cin >> n;
    vector<ll> a(n);
    rep(i, n)
    {
        cin >> a[i];
        sum += a[i];
    }
    ll m = LLONG_MAX;
    ll sunuke = 0;
    rep(i, n - 1)
    {
        sum -= a[i];
        sunuke += a[i];
        m = min(m, abs(sum - sunuke));
    }
    cout << m << endl;
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define mk make_pair
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MAXN = 1e5 + 5;
const int MAXM = 5e5 + 5;
const int MOD = 998244353;
const int INF = 0x3f3f3f3f;
char s[MAXN];
queue<int> vL, vR;
int pos[MAXN], ans[MAXN];

void init(){
    while(!vL.empty()) vL.pop();
    while(!vR.empty()) vR.pop();
    memset(ans, 0, sizeof(ans));
}

int main(){
    init();
    scanf("%s", s+1);
    int len = strlen(s+1);
//    cout << s + 1 << endl;
    for(int i = 1; i <= len; ++i){
        if(s[i] == 'L'){
            vL.push(i);
        }
    }
    for(int i = len; i >= 1; --i){
        if(s[i] == 'R') vR.push(i);
    }
//    cout << "vlfront: " << vL.front() << endl;
    for(int i = 1; i <= len; ++i){
        if(s[i] == 'R'){
            while(!vL.empty()&&i>vL.front()){
                vL.pop();
            }
            pos[i] = vL.front();
        }
    }
    for(int i = len; i >= 1; --i){
        if(s[i] == 'L'){
            while(!vR.empty()&&i<vR.front()) vR.pop();
            pos[i] = vR.front();
        }
    }
//    for(int i = 1; i <= len; ++i){
//        cout << pos[i] << "  ";
//    }
//    cout << endl;
    for(int i = 1; i <= len; ++i){
        if(s[i] == 'R'){
            if((pos[i]-i)&1){
                ++ans[pos[i]-1];
            }else{
                ++ans[pos[i]];
            }
        }else{
            if((i-pos[i])&1){
                ++ans[pos[i]+1];
            }else{
                ++ans[pos[i]];
            }
        }
    }
    for(int i = 1; i <= len; ++i){
        if(i != 1)  printf(" ");
        printf("%d", ans[i]);
    }
    return 0;
}
/*

*/

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

int main(){
    int x, y, z;
    cin >> x;
    if(x == 1){
        cout << "Hello World" << endl; 
    }else{
        cin >> y;
        cin >> z;
        cout << y + z << endl;
    }

    return 0;
}


Measured memory_bytes: 256