akhauriyash/Code-Regression huggingface dataset:
#C
A, B =map(int,input().split())

import math
price=[]
for i in range(10100):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
         price.append(i)
if len(price)==0:
    print(-1)
else:
    print(sorted(price)[0])

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

namespace ABC087B
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int x = int.Parse(Console.ReadLine());

            int ans = 0;

            for(int s = 0; s <= a; s++)
            {
                if (x == s * 500)
                {
                    ans++;
                }
                else
                {
                    for(int t = 0; t <= b; t++)
                    {
                        if (x == (500 * s + 100 * t))
                        {
                            ans++;
                        }
                        else
                        {
                            for(int u = 0; u <= c; u++)
                            {
                                if (x == (500 * s + 100 * t + 50 * u))
                                {
                                    ans++;
                                }
                            }
                        }
                    }
                }
            }

            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
random_device rnd;
mt19937 mt(rnd());

const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1e9 + 7;
int main()
{
    string s;
    cin >> s;
    if (s == "ABC")
    {
        cout << "ARC" << endl;
    }
    else
    {
        cout << "ABC" << endl;
    }
    return 0;
}

Measured memory_bytes: 3596
#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stdio.h>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define TR(i,x) for(__typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))
#define PB push_back
#define MP make_pair

using namespace std;

const double eps = 1e-8;

typedef map<int,int> MII;
typedef map<string,int> MSI;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long double> VD;
typedef pair<int,int> PII;
typedef long long int64;
typedef long long LL;
typedef unsigned int UI;
typedef long double LD;

const int N = 200005;
struct M {
    LL x;
    LL h;
};
M Mon[N];
LL c[N];
bool cmp(M a, M b) {
    return a.x < b.x;
}
int main() {
    LL n, d, a;
    cin >> n >> d >> a;
    REP(i, n) {
        cin >> Mon[i].x >> Mon[i].h;
    }
    sort(Mon, Mon + n, cmp);
    LL ans = 0;
    for (int i = 0, j = 0; i < n; ++i) {
        while (j < n && Mon[j].x - Mon[i].x <= 2 * d) ++j;
        // j for right most not to be attacked
        LL need = max((Mon[i].h + a - 1 - c[i] * a) / a, 0ll);
        ans += need;
        c[i] += need;
        c[i + 1] += c[i];
        c[j] -= need;
        //cout << "i:" << i << "j:" << j << " ned:" << need << endl;
    }

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



Measured memory_bytes: 4992
#include<cstdio>
const long long inf = 1e17+7;

long long abs(long long u){ return u>0?u:-u; }

long long min(long long a,long long b){ return a>b?b:a; }

long long solve(long long x,long long d,long long time){
    long long res = inf;
    long long dis = abs(x);
    long long need = min(time,dis/d);
    long long have = dis-need*d;
    if(have<res) res = have;
    if(need!=time){
        have = abs(have-d);
        if(have<res) res = have;
    }
    return res;
}

int main(){
    long long x,k,d;
    scanf("%lld%lld%lld",&x,&k,&d);
    long long ans = 1e17+7;
    if(k%2){
        long long dx = x-d;
        long long offer = solve(dx,2*d,(k-1)/2);
        if(offer<ans) ans = offer;
        dx = x+d;
        offer = solve(dx,2*d,(k-1)/2);
        if(offer<ans) ans = offer;
    }
    else ans = solve(x,2*d,k/2);
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 1736
console.log((args=>{
  const [n,c] = args.trim().split`\n`;
  const N = n|0;
  let j = N, count = 0;
  for ( let i = 0; i < j; i++ ) {
    if ( c[i] === 'R' ) continue;
    for (;j > i;) {
      if ( c[j--] === 'R' ) {
        count++;
        break;
      }
    }
  }
  return count;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));


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

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define mod 1000000007
#define INF 100000000
#define fk first
#define sv second

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

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b, c, d;

  cin >> a >> b >> c >> d;
  int res;
  res = min(b, d) - max(a, c);
  if (res < 0) {
    res = 0;
  }
  cout << res << endl;
}

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

string S;

int main(){
  cin >> S;
  int a1 = 0, a2 = 0;
  for(int i=0;i<S.size();i++){
    if(S[i]=='0') a1++;
    else a2++;
  }
  int ans = 1e9;
  ans = min(a1,a2);
  cout << ans*2 << endl;
  return 0;
}


Measured memory_bytes: 512
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
	int N; cin >> N;
	cout << N*N*N << endl;
	
	return 0;
}

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

using namespace std;

int d[10];

bool check(int n){
    int flag=1;
    while(n > 0){
        int r=n%10;
        if(d[r]==0){
            flag*=1;
        }
        else{
            flag=0;
        }
        n=n/10;
    }
    if(flag){
        return true;
    }
    else{
        return false;
    }
}

int main(){
    int n,k; cin>>n>>k;
    for(int i=0; i < k; ++i){
        int t; cin>>t;
        d[t]=1;
    }
    while(1){
        if(check(n)){
            cout<<n<<"\n";
            break;
        }
        n=n+1;
    }
    return 0;
}

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

using namespace std;

#define DPRINTF(...) printf(__VA_ARGS__)
#define FOR0(i, n) for(int i=0;i<n;i++)
#define ALL(c) (begin(c)), (end(c))
#define fst(t) get<0>(t)
#define snd(t) get<1>(t)
#define thd(t) get<2>(t)

typedef tuple<int,int> P;
typedef long long ll;

ll MOD = 1e9 + 7;

ll inv(ll a, ll p){
    ll res = 1ll;
    ll n = p - 2;
    
    while(n > 0){
        if(n & 1ll){
            res = res * a % p;
        }
        a = a * a % p;
        n >>= 1;
    }

    return res;
}

ll fact[300000], inve[300000];

ll nCk(int n, int k){
    if(n < k){return 0;}

    return fact[n] * inve[n-k] % MOD * inve[k] % MOD;
}

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

  fact[0] = 1ll;
  inve[0] = 1ll;
  for(int i=1;i<300000;i++){
      fact[i] = fact[i-1] * i % MOD;
      inve[i] = inv(fact[i], MOD);
  }

  int H, W, A, B;
  cin >> H >> W >> A >> B;

  ll res = nCk(H-1 + W-1, H-1);

  // cout << "all:" << res << endl;
  
  FOR0(i, B){
      // cout << nCk(H-A-1 + i, i) * nCk(A-1 + W-i-1, A-1) << endl;
      res = ((res - nCk(H-A-1 + i, i) * nCk(A-1 + W-i-1, A-1) % MOD) % MOD + MOD) % MOD;
  }

  cout << res << endl;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)

const ll MOD = 1e9 + 7;

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

void solve(istream& cin, ostream& cout) {
  ll a, b;
  cin >> a >> b;
  ll ans = 0;
  auto ap = prime_factor(a);
  auto bp = prime_factor(b);
  EACH(v, ap) {
    if (bp.find(v.first) != bp.end()) {
      ans++;
    }
  }
  cout << ans + 1 << endl;
}

#ifndef TEST
int main() {
  solve(cin, cout);
}
#endif


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

int main() {
  int q; cin >> q;
  deque<int> A;
  for(int i=0; i<q; i++) {
    int que; cin >> que;
    switch(que) {
    case 0://push
      int d, x;
      cin >> d >> x;
      if(d == 0){
        //先頭
        A.push_front(x);
      } else if(d == 1) {
        //尾末
        A.push_back(x);
      }
      break;
    case 1://randomAccess
      int p; cin >> p;
      cout << A[p] << endl;
      break;
    case 2://pop
      int dd; cin >> dd;
      if(dd == 0) {
        //先頭
        A.pop_front();
      } else if(dd == 1) {
        //尾末
        A.pop_back();
      }
      break;
    }
  }
}



Measured memory_bytes: 4540
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX

#include <bits/stdc++.h>

using namespace std;

#define db(x) cout << (x) << '\n';
#define all(x) x.begin(),x.end()
#define UNIQUE(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define LB(v,x) lower_bound(all(v),x)
#define UB(v,x) upper_bound(all(v),x)
#define endl "\n"
#define F first
#define S second
#define PB push_back
#define PF push_front
#define int long long
#define double long double
#define trick int m = (l+r)>>1,lc=n<<1,rc=lc|1

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

int dy[]={0,1,0,-1};
int dx[]={-1,0,1,0};
const int maxn = 1e5;
const int OO = 1e18;
const int mod = 1e9 + 7;
const double PI = acos(-1);

void maxself(int &a,int b)
{a=max(a,b);}
void minself(int &a,int b)
{a=min(a,b);}
int n,m;
bool ok(int x,int y)
{
    if(x>=0 and x<n and y>=0 and y<m)
        return 1;
    else
        return 0;
}

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

    int N,M,sx,sy,ex,ey;
    cin >> N >> M >> sx >> sy >> ex >> ey;
    n = N , m = M;
    sx--,sy--,ex--,ey--;

    vector <vector <char>> v(N,vector <char> (M));

    for(int i=0;i<N;i++)
        for(int j=0;j<M;j++)
            cin >> v[i][j];

    vector <vector <int>> dist(N,vector <int> (M,OO));
    dist[sx][sy] = 0;

    priority_queue <pair <int,pii>, vector<pair<int,pii>>, greater<pair<int,pii>>> pq;
    pq.push({0,{sx,sy}});

    while(pq.size())
    {
        int cost = pq.top().F;
        int x = pq.top().S.F;
        int y = pq.top().S.S;

        pq.pop();

        if(cost != dist[x][y])
            continue;

        for(int i=0;i<4;i++)
        {
            int nx = x + dx[i];
            int ny = y + dy[i];

            if(ok(nx,ny) and dist[nx][ny] > dist[x][y] and v[nx][ny] == '.')
            {
                dist[nx][ny] = dist[x][y];
                pq.push({dist[nx][ny],{nx,ny}});
            }
        }

        for(int i=-2;i<=2;i++)
            for(int j=-2;j<=2;j++)
            {
                int nx = x + i;
                int ny = y + j;

                if(ok(nx,ny) and dist[nx][ny] > dist[x][y] + 1 and v[nx][ny] == '.')
                {
                    dist[nx][ny] = dist[x][y] + 1;
                    pq.push({dist[nx][ny],{nx,ny}});
                }
            }

    }

    if(dist[ex][ey] != OO)
        cout << dist[ex][ey];
    else
        cout << -1;

	return 0;
}



Measured memory_bytes: 12644
var a,b,i:longint;
    s:string;
begin
  read(s);a:=0;b:=0;
  for i:=1 to length(s)do
  if s[i]='C'then a:=1 else
  if(s[i]='F')and(a=1)then b:=1;
  if b=1 then write('Yes')else write('No');
end.

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#define pb push_back
#define mod (ll)((1e9)+7)
using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;

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


int main(){
  ll n,t;
  vector<ll> a;
  cin>>n;

  ll res=0;
  for(int i=0;i<n;i++){
    cin>>t;
    res+=t-1;
  }
  
  cout<<res<<endl;
  return 0;
}


Measured memory_bytes: 256
n_list = [i for i in input()]
cnt = 1
prev = n_list[0]

for n in range(1,len(n_list)):
    if cnt == 3:
        break
    else:
        if prev == n_list[n]:
            cnt += 1
        else:
            prev = n_list[n]
            cnt  = 1
if cnt >= 3:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt(),d=sc.nextInt(),f=0;
    for(int i=0;i<n;i++){
      long x=sc.nextInt(),y=sc.nextInt();
        if(d>=Math.sqrt(x*x+y*y)) f++;
    }
    System.out.println(f);
  }
}

Measured memory_bytes: 58988
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), ", ", cout) << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, string sep = " ", ostream &os = cout)
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), ", ", os) << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, n);
    IN(ll, m);
    IN(ll, d);
    double ans = (1.0 + (d != 0)) * (m - 1) * (n - d) / pow(n, 2);
    FOUT(ans);
}

Measured memory_bytes: 3780
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
int cnt=0;
int ask(int i){
  if(++cnt>20) exit(0);
  cout<<i<<endl<<flush;
  string s;
  cin>>s;
  if(s=="Vacant") exit(0);
  return s=="Male";
}
signed main(){
  int n;
  cin>>n;
  int l=0,r=n/2;
  int k=ask(0);
  ask(n-1);
  while(l+1<r){
    int m=(l+r)>>1;
    if(k==ask(m*2)) l=m;
    else r=m;
  }
  ask(l*2+1);
  return 0;
}


Measured memory_bytes: 852
#include<iostream>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
int main()
{
	string x, y;
	cin >> x >> y;
	
	if (x == "A") {
		x = 1;
	}
	else if (x == "B") {
		x = 2;
	}
	else if (x == "C") {
		x = 3;
	}
	else if (x == "D") {
		x = 4;
	}
	else if(x == "E") {
		x = 5;
	}
	else if (x == "F") {
		x = 6;
	}

	if (y == "A") {
		y = 1;
	}
	else if (y == "B") {
		y = 2;
	}
	else if (y == "C") {
		y = 3;
	}
	else if (y == "D") {
		y = 4;
	}
	else if (y == "E") {
		y = 5;
	}
	else if (y == "F") {
		y = 6;
	}
	
	if (x <y) {
		cout << "<\n";
	}
	else if (x > y) {
		cout << ">\n";
	}
	else {
		cout << "=\n";
	}

	return 0;
}
/*

.　　許せん！
　　　∧＿＿∧
　|| （＃｀Д´ ） ||
　|| ( |　 　| | |||
　从| |　 　| |从从
￣) ⊂ノ￣￣!_つ￣て
　フヘ(　　　　ヽヘ(＼

*/

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

int main(){
  string s;
  while(1){
    int ans = 0;
    cin >> s;
    if(s=="0")break;
    rep(i,s.size()){
      ans += s.at(i) - '0';
    }
    cout << ans << endl;
  }
  
}




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

#define ll long long int
#define MOD 1000000007
#define N 100001
#define pii pair<int,int>
#define MAX 1e18
#define _mp make_pair
#define pb push_back
#define _sort(v) sort(v.begin(),v.end())
#define _rsort(v) sort(v.rbegin(),v.rend())
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;



int32_t main(){
SPEED
int n,z,x;
cin>>n;

vector<int> v(n);
cin>>z;
v[0]=z;
for(int i=1;i<n;i++){
    cin>>x;
    v[i]=x;
    z=z^x;
}
for(int i:v){
    int p=z^i;
cout<<p<<" ";
}

    // end_timer = std::chrono::high_resolution_clock::now();
    // ll elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(end_timer - start_timer).count();

return 0;
}

Measured memory_bytes: 3964
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,a="es",b="s";
int l;
cin>>s;
l=s.length();
    if(s[l-1]=='s')
        cout<<s+a<<endl;
    else
        cout<<s+b<<endl;
    return 0;

}


Measured memory_bytes: 3604
def IL(): return list(map(int, input().split()))
d, g = IL()
p = [0] * d
c = [0] * d
cpl = [False] * d
ans = 10000
for i in range(d):
    p[i], c[i] = IL()
for i in range(2 ** d):
    cnt = 0
    score = 0
    cpl = [False] * d
    for j in range(d):
        if i >> j & 1:
            cpl[j] = True
    for j in range(d): #コンプ
        if cpl[j]:
            cnt += p[j]
            score += 100 * (j + 1) * p[j] + c[j]
    if score >= g:
        if cnt < ans:
            ans = cnt
        continue
    for j in reversed(range(d)): #非コンプ
        if not cpl[j]:
            for k in range(p[j] - 1):
                cnt += 1
                score += 100 * (j + 1)
                if score >= g:
                    if cnt < ans:
                        ans = cnt
                    break
            else:
                continue
            break
print(ans)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Text;

class AizuOnlineJudge {
    static void Main() {
        BF(">>>+++++[<+<<++>>>>+<-]>[<++++++++++>-]<[>++>+<<-]<[>++++>+++<<-]>>[<<+<+>>>-]<<<.--.++++.>>[<<->>-]<<.>-.<++++.>>>>-.-..+.<<<<<.");
    }

    static void BF(string s) {
        var b = new Stack<int>();
        var m = new List<int>(new[] { 0 });
        var p = 0;
        var o = new StringBuilder();

        for (var i = 0; i < s.Length; i++) {
            switch (s[i]) {
                case '+':
                    m[p]++;
                    break;
                case '-':
                    m[p] = Math.Max(m[p] - 1, 0);
                    break;
                case '.':
                    o.Append((char)m[p]);
                    break;
                case '>':
                    if (++p >= m.Count) {
                        m.Add(0);
                    }
                    break;
                case '<':
                    if (--p < 0) {
                        p = 0;
                        m.Insert(0, 0);
                    }
                    break;
                case '[':
                    if (m[p] == 0) {
                        var t = 0;
                        do {
                            if (s[i] == '[') {
                                t++;
                            }
                            else if (s[i] == ']') {
                                t--;
                            }
                        } while (!(s[++i] == ']' && t == 1));
                        break;
                    }
                    b.Push(i);
                    break;
                case ']':
                    i = b.Pop() - 1;
                    continue;

                default:
                    break;
            }
        }

        if (o.Length != 0) {
            Console.Write(o.ToString());
        }
    }
}



Measured memory_bytes: 16204
let () = Scanf.scanf "%d %d\n" @@ fun n k ->
  let xys = Array.init n @@ fun _ ->
    Scanf.scanf "%d %d\n" @@ fun x y -> x, y in
  Array.sort (fun (v, w) (x, y) -> compare (v, ~- w) (x, ~- y)) xys;
  Printf.printf "%d\n" @@ Array.fold_left (Array.fold_left min) max_int @@
    Array.init (n - k + 1) @@ fun i ->
      Array.init (n - i - k + 1) @@ fun j ->
        let xys' = Array.init (j + k) (fun k -> snd xys.(i + k)) in
        Array.sort compare xys';
        (fst xys.(i + j + k - 1) - fst xys.(i)) * 
        Array.fold_left min max_int (Array.init (j + 1) (fun j -> xys'.(j + k - 1) - xys'.(j)))


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();

		int a = s[0] - '0';
		int b = s[1] - '0';
		int c = s[2] - '0';
		int d = s[3] - '0';

		if (a + b + c + d == 7) {
			System.out.println(a + "+" + b + "+" + c + "+" + d + "=7");
			return;
		}
		if (a + b + c - d == 7) {
			System.out.println(a + "+" + b + "+" + c + "-" + d + "=7");
			return;
		}
		if (a + b - c + d == 7) {
			System.out.println(a + "+" + b + "-" + c + "+" + d + "=7");
			return;
		}
		if (a + b - c - d == 7) {
			System.out.println(a + "+" + b + "-" + c + "-" + d + "=7");
			return;
		}
		if (a - b + c + d == 7) {
			System.out.println(a + "-" + b + "+" + c + "+" + d + "=7");
			return;
		}
		if (a - b + c - d == 7) {
			System.out.println(a + "-" + b + "+" + c + "-" + d + "=7");
			return;
		}
		if (a - b - c + d == 7) {
			System.out.println(a + "-" + b + "-" + c + "+" + d + "=7");
			return;
		}
		if (a - b - c - d == 7) {
			System.out.println(a + "-" + b + "-" + c + "-" + d + "=7");
			return;
		}
	}
}


Measured memory_bytes: 23764
N,K = map(int, input().split())
trees = [int(input()) for _ in range(N)]

def solve(N,K,trees):
    trees.sort()
    
    print(min([max_h-min_h for min_h,max_h in zip(trees,trees[K-1:])]))
    return

solve(N,K,trees)

Measured memory_bytes: 11980
h,w,z = map(int,input().split())
import copy
c = [list(input()) for _ in range(h)]
ans = 0
for i in range(2**h):
    for j in range(2**w):
        mat = copy.deepcopy(c)
        count = 0
        for k in range(w):
            if j>>k &1:
                for u in range(h):
                    mat[u][k] = "red"
        for l in range(h):
            if i>>l & 1:
                for g in range(w):
                    mat[l][g] = "red"
        for k in range(h):
            for l in range(w):
                if mat[k][l] == "#":
                    count += 1
        if count == z:
            ans += 1
print(ans)

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

fn main() {
    let mut h: i64 = read();

    let mut n = 0;

    h /= 2;

    while(h > 0) {
        n+=1;
        h /= 2;
    }

    let mut result = 0;
    for i in 0..n+1 {
        result += 2i64.pow(i);
    }

    println!("{}", result);
}

/// Example
/// ```
///
///  let n: i32 = read();
///
///  let mut xs = Vec::new();
///  for _ in 0..n {
///      xs.push(read::<i32>() + 1000);
///  }
/// ```
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


Measured memory_bytes: 4352
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans = 0

for i in range(n-2):
    if x[i] == y[i]:
        if x[i+1] == y[i+1]:
            if x[i+2] == y[i+2]:
                ans += 1

print('Yes' if ans > 0 else 'No')

Measured memory_bytes: 9192
#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); 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 FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)                                                            \
  for (auto v : (V)) {                                                         \
    cerr << v << " ";                                                          \
  }                                                                            \
  cerr << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
using namespace std;
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;
}
template < class T > using vec = std::vector< T >;
template < class T > void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vec< int > a(N), b(N), c(N - 1);
  vec< int > d;
  int prevK = -10;
  REP(i, N) {
    cin >> a[i];
    a[i]--;
    if (prevK + 1 == a[i]) {
      d.pb(prevK);
    }
    prevK = a[i];
  }
  REP(i, N) { cin >> b[i]; }
  REP(i, N - 1) { cin >> c[i]; }
  int ans = 0;
  REP(i, N) { ans += b[a[i]]; }
  REP(i, (int)d.size()) { ans += c[d[i]]; }
  print(ans);
}

Measured memory_bytes: 256
import java.util.*;

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

        if(A >= 13){
            System.out.println(B);
        }else if(A >= 6){
            System.out.println(B/2);
        }else{
            System.out.println(0);
        }
    }
}


Measured memory_bytes: 21844
//Code by Mukul Totla
#include<bits/stdc++.h>
using namespace std;
#define ll long long

bool check(ll mid, ll k , ll *arr, ll n)
{
  for(ll i=0; i<n; i++)
  {
    if(arr[i]>mid)
    {
        ll val= ((arr[i]+mid-1)/mid) -1;
        if(k-val>=0)
            k-=val;
        else
            return false;
    }
  }
  return true;
}
int main()
{   
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll n,k,i,lo=0,hi=0;
    cin>>n>>k;
    ll arr[n];
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        hi=max(arr[i], hi);
    }

    ll ans=hi;
    hi=1e9 + 100;
    while(lo <= hi)
    {
      ll mid= (lo + hi)/2;
      bool chk;
      if(mid>0)
       chk=check(mid,k, arr, n);
      else
        chk=false;
      if(chk==true)
      {
        hi=mid-1;
        ans=min(ans,mid);
      }
      else
        lo=mid+1;
    }
    cout<<ans;
    return 0;
}

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

const int N = 55555;
int n;
vector<int> v;

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	cin >> n;
	for (int i = 11; i <= N; i += 5)
		if(ip(i))
			v.push_back(i);
	
	for (int i = 0; i < n; i++)
		cout << v[i] << ' ';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()		//sort(all(vi S)) sort(all(string S))

typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

const int MOD = 1e9+7;
const int INF = 1e9;

int main() {
	ll N;
	cin>>N;
	ll l = N % 11;
	ll ans;
	if (l==0)ans = N/11 * 2;
	else if(l<=6) ans = N/11 * 2 + 1;
	else ans = N/11 * 2 + 2;
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }


ll choose(ll n, ll r){
    ll res = 1;
    for(int i = 1; i <= r; i++){
        res *= n--;
        res /= i;
    }
    return res;
}

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

    int even = 0, odd = 0;
    rep(i,n){
        if (a[i] % 2 == 0) even++;
        else odd++;
    }
    ll ans;
    if (even == n){
        if (p == 0) ans = 1LL << even;
        else ans = 0;
    }else if (odd == n){
        ans = 0;
        if (p == 1) for(int i = 1; i <= odd; i += 2) ans += choose(odd, i);
        else for(int i = 0; i <= odd; i+=2 ) ans += choose(odd, i);
    }else{
        ll numE;
        numE = 1LL << even;
        if (p == 1) for(int i = 1; i <= odd; i += 2) ans += choose(odd, i);
        else for(int i = 0; i <= odd; i+=2 ) ans += choose(odd, i);
        ans *= numE;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
 
using namespace std;
 
int main() {
        int w;
    while(1){
        cin>>w;
        if(w == -1)break;
        
        if(w <= 10){
            cout<<4280-1150<<endl;
        }else if(w <= 20){
            cout<<4280-1150-(w-10)*125<<endl;
        }else if(w <= 30){
            cout<<4280-1150-1250-(w-20)*140<<endl;
        }else{
            cout<<4280-1150-1250-1400-(w-30)*160<<endl;
        }
    }
        return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>
#include <deque>
#include <complex>

using namespace std;

/*
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
*/

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

typedef long double ld;
typedef vector<ld> vld;

typedef vector<bool> vb;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, n) for (ll i = 1; i <= (n); i++)
#define rrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rreps(i, n) for (ll i = (n); i >= 1; i--)
#define all(v) (v).begin(), (v).end()

template <class T> void chmin(T& a, T b) { a = min(a, b);}
template <class T> void chmax(T& a, T b) { a = max(a, b);}

constexpr int INF = 1 << 30;
constexpr ll INFL = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr ld EPS = 1e-12;
ld PI = acos(-1.0);

void solve() {
    ll n;
    cin >> n;
    vll a(n+1), sa(n+1), c(n+1);
    rep(i, n+1) cin >> a[i];
    if(n == 0 && a[0] == 0) {
        cout << -1 << endl;
        return;
    }
    sa[n] = a[n];
    for(ll i = n - 1; i >= 0 ; i--) sa[i] = sa[i+1] + a[i];
    c[0] = 1;
    for(ll i = 1; i <= n; i++) {
        if(c[i-1] < a[i-1]) {
            cout << -1 << endl;
            return;
        }
        else {
            c[i] = min(2*(c[i-1]-a[i-1]), sa[i]);
        }
    }
    if(c[n] < a[n]) {
        cout << -1 << endl;
        return;
    }
    ll ans = 0;
    for(ll i = 0; i <= n; i++) ans += c[i];
    cout << ans << endl;
    return;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}

Measured memory_bytes: 5576
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>

using namespace std;
typedef long long ll;

int main()
{
    ll N, x;
    cin >> N >> x;
 
    ll A[N];
    ll ans = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        if (i == 0)
        {
            if (A[0] > x)
            {
                ans = A[0] - x;
                A[0] = x;
            }
        }
        else
        {
            if (A[i - 1] + A[i] > x)
            {
                ans += A[i - 1] + A[i] - x;
                A[i] -= A[i - 1] + A[i] - x;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
# Aizu Problem 0066: Tic-Tac-Toe
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def check_triple(triple):
    # check whether a triple of values is a winning position:
    return len(set(triple)) == 1 and triple[0] != 's'

    
def isSolved(board):
    # first check if there's a winner:
    # check rows:
    for row in board:
        if check_triple(row):
            return row[0]
    # check columns:
    for col in range(3):
        column = [board[row][col] for row in range(3)]
        if check_triple(column):
            return column[0]
    # check diagonals:
    if check_triple([board[i][i] for i in range(3)]):
        return board[0][0]
    if check_triple([board[i][2-i] for i in range(3)]):
        return board[2][0]
    #
    # no winner:
    return 'd'


for line in sys.stdin:
    string = line.strip()
    board = [string[3*i:3*i+3] for i in range(3)]
    print(isSolved(board))

Measured memory_bytes: 7524
s = int(input())
if s <= 2:
  print(2)
  exit()
elif s <= 3:
  print(3)
  exit()
elif s <= 5:
  print(5)
  exit()

while True:
  for i in range(2,s // 2):
    if s % i == 0:
      break
  if i == s //2 -1:
    print(s)
    exit()
  s += 1

"""
prime_data = [2,3,5]

for i in range(3,10**5):
  tmp = int(i//2)
  for j in range(2,tmp):
    if i % j == 0:
      break
    if j == tmp-1:
      prime_data.append(i)
print(prime_data)
"""

Measured memory_bytes: 3064
/*!enjoy karo yaar!*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

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

#define     int             long long int
#define     fast()          ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)          begin(x),end(x)
#define     rz(x)           resize(x)
#define     asn(x,y)        assign(x,y)
#define     mem(a,b)        memset(a,b,sizeof(a))
#define     sz(x)           ((int)(x.size()))
#define     eb              emplace_back
#define     pb              push_back
#define     pf              push_front
#define     pob             pop_back
#define     pof             pop_front
#define     ins             insert
#define     vi              vector<int>
#define     pii             pair<int,int>
#define     mii             map<int,int>
#define     F               first
#define     S               second
#define     remax(a,b)      a=max(a,b)
#define     remin(a,b)      a=min(a,b)
#define     bitcount(x)     __builtin_popcountll(x)
#define     iceil(n,x)      (((n)-1)/(x)+1)
#define     dbug(x)         cout<<#x<<": "<<(x)<<"\n"
#define     flush           fflush(stdout)
#define     show(x)         for(auto zz:x)cout<<zz<<" ";cout<<"\n";
#define     show2(x)        for(auto zz:x)cout<<zz.F<<" "<<zz.S<<"\n";

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const ld pi=acos(-1);
const ll inf=1e18,M=1e9+7;
const int N=1;

void solve()
{
    int n,k;
    cin>>n>>k;

    if(k>((n-1)*(n-2)/2))
    {
        cout<<-1;
        return;
    }

    vector<pii> v;
    for(int i=1;i<=n;++i)
    {
        for(int j=i+1;j<=n;++j)
            v.pb({i,j});
    }

    int len=sz(v);
    cout<<len-k<<"\n";
    for(int i=0;i<len-k;++i)
        cout<<v[i].F<<" "<<v[i].S<<"\n";
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    for(int z=1;z<=t;++z)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}



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

using namespace std;

#define ff first
#define ss second
#define pb push_back
#define quicker ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;

vector<vector<int>> adj;

int main()
{
    quicker
    #ifdef HALO
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ll a, b, c, x, y;
    cin >> x >> y >> a >> b >> c;
    vector<int> A(a), B(b), C(c);
    for (int i = 0; i < a; i++){
      cin >> A[i];
    }
    for (int i = 0; i < b; i++){
      cin >> B[i];
    }
    for (int i = 0; i < c; i++){
      cin >> C[i];
    }
    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    sort(C.rbegin(), C.rend());
    ll amax = 0, bmax = 0;
    ll p = min(x - 1, a - 1);
    ll q = min(y - 1, b - 1);
    for (int i = 0; i <= p; i++)
      amax += A[i];
    for (int i = 0; i <= q; i++)
      bmax += B[i];
    ll last = 0;
    for (int i = last; i < c; i++)
    {
      // if (p >= 0 && C[i] > A[p])
      // {
      //   amax -= A[p--];
      //   amax += C[i];
      //   last = i;
      // }
      // if (p < 0 || C[i] <= A[p])
      //   break;
      // if (p < 0 && q < 0)
      //   break;
      if (p < 0)
      {
        if (C[i] > B[q])
        {
          bmax -= B[q--];
          bmax += C[i];
          continue; 
        }
        else break;         
      }
      if (q < 0)
      {
        if (C[i] > A[p])
        {
          amax -= A[p--];
          amax += C[i];
          continue;
        }
        else break;         
      }
      if (C[i] > A[p] && C[i] > B[q])
      {
        if (A[p] > B[q])
        {
          bmax -= B[q--];
          bmax += C[i];
        }
        else
        {
          amax -= A[p--];
          amax += C[i]; 
        }
      }
      else if (C[i] > A[p])
      {
          amax -= A[p--];
          amax += C[i];
      }
      else if (C[i] > B[q])
      {
          bmax -= B[q--];
          bmax += C[i];
      }
      else break;
    }
    // int tot = 0;
    // for (int i = 0; i < c; i++)
    //   tot += C[i];
    // cout << tot;
    //cout << p << q;
    ll ans = amax + bmax;
    cout << ans;
    return 0;
  }

Measured memory_bytes: 1408
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

X1, Y1, X2, Y2 = get_ints

vector = [X2 - X1, Y2 - Y1]

first_vector = [-vector[1], vector[0]]
X3, Y3 = [X2 + first_vector[0], Y2 + first_vector[1]]

second_vector = [X3 - X2, Y3 - Y2]

third_vector = [-second_vector[1], second_vector[0]]
X4, Y4 = [X3 + third_vector[0], Y3 + third_vector[1]]

puts "#{X3} #{Y3} #{X4} #{Y4}"


Measured memory_bytes: 14448
#include<iostream>
#include<stack>
#include<vector>
#include<cstdlib>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;

int main()
{
	string C;
	while (1)
	{
		stack<char>S;
		getline(cin, C);
		if (C[0] == '.')
			break;
		else
		{
			int ant = 0;
			for (int i = 0; i < C.length(); ++i)
			{
				if (C[i] == '(' || C[i] == '[')
					S.push(C[i]);
				else if (C[i] == ')')
				{
					if (!S.empty() && S.top() == '(')
						S.pop();
					else 
						ant = 1;
				}
				else if (C[i] == ']')
				{
					if (!S.empty() && S.top() == '[')
						S.pop();
					else
						ant = 1;
				}
				if (ant)
					break;
			}
			if (!ant && S.empty())
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3144
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>

int main(void) {
	int H, W, i, j;
	while (1){
		scanf("%d %d", &H, &W);
		if (H == 0 && W == 0) break;
		for (i = 0; i < H; ++i){
			for (j = 0; j < W; ++j){
				if ( (i+j)%2==0) printf("#");
				else printf(".");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 572
#import sys
#input = sys.stdin.readline

n = int(input())

for i in range(n):
    if i == 0:
        dp = [int(i) for i in input().split()]
    else:
        abc = [int(i) for i in input().split()]
        dp[0], dp[1], dp[2] = abc[0] + max(dp[1], dp[2]), abc[1] + max(dp[0], dp[2]), abc[2] + max(dp[0], dp[1])
    
print(max(dp))



Measured memory_bytes: 3060
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	ll ans = 0;
	vector<ll> a(n+1);
	rep(i,n+1) cin >> a[i];
	rep(i,n){
		ll b;
		cin >> b;
		if(b >= a[i]){
			ans += a[i];
			b -= a[i];
		}
		else{
			ans += b;
			b = 0;
		}
		ans += min(a[i+1], b);
		a[i+1] = max(a[i+1]-b, 0LL);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
using namespace std;


int main(){
	int n;
	int a[100];
	int b[100];
	int suma[100];
	int sumb[100];
	int max;
	max = 0;
	cin >> n;
	suma[0] = 0;
	sumb[0] = 0;
	
	cin >> a[0];
	suma[0] = a[0];
	for(int i = 1 ; i < n ; i++ ){
		cin >> a[i];
		suma[i] = suma[i-1] + a[i];
	}
	cin >> b[0];
	sumb[0] = b[0];
	for(int i = 1 ; i < n ; i++ ){
		cin >> b[i];
		sumb[i] = sumb[i-1] + b[i];
	}
	
	max = suma[0] + sumb[n-1];
	for(int i = 1 ; i < n ; i++ ){
		if ( max < suma[i] + sumb[n-1] - sumb[i-1] ) max = suma[i] + sumb[n-1] - sumb[i-1];
	}
	cout << max;
	
	return 0;
}

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

using namespace std;

int main(){
	
	string s;
	
	cin >> s ;
	
	
	int ans=0;
	for(int i=0;i<4;i++){
		if(s[i]=='+') ans++;
		else ans--;
	}
	
	cout << ans << endl;
	
	
	return 0;
}

Measured memory_bytes: 256
/*  Sourav Verma IPG_2013  ABV_IIITMG 
        Task @ Codeforces & Atcoder  */

#include<bits/stdc++.h>

#define ll                    long long int
#define loop(i,a,b)           for(int i=(int)a;i<(int)b;++i)
#define rloop(i,a,b)          for(int i=(int)a;i<=(int)b;++i)
#define loopr(i,a,b)          for(int i=(int)a;i>=(int)b;--i)
#define count_1(n)            __builtin_popcountll(n)
#define pb                    push_back
#define mset(a,b,c)           loop(i,0,b) a[i]=c
#define F                     first
#define S                     second
#define mp                    make_pair
#define clr(x)                x.clear()
#define MOD                   1000000007
#define MAX                   1e9
#define MIN                   -1e9
#define itoc(c)               ((char)(((int)'0')+c))
#define vi                    vector<int>
#define vvi                   vector<vi>
#define pll                   pair<ll,ll>
#define pii                   pair<int,int>
#define all(p)                p.begin(),p.end()
#define mid(s,e)              (s+(e-s)/2)
#define mini                  INT_MIN
#define sv()                  int t; scanf("%d",&t); while(t--)
using namespace std;
ll extgcd(ll a,ll b,ll& x,ll& y){if(b==0){x=1;y=0;return a;}else{int g=extgcd(b,a%b,y,x);y-=a/b*x;return g;}}
ll lcm(int x, int y) { return x * 1ll * y / (int)__gcd(x, y); }
ll hcf(ll a, ll b) {if(b>a) return (hcf(b, a)); if(a%b==0) return b; return (hcf(b, a%b));} 
ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}

void solve(std::istream &in, std::ostream &out){
    int a,b; char op; in>>a>>op>>b;
    if(op=='+') out<<a+b<<"\n";
    else out<<a-b<<"\n";
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    #ifdef debug
        freopen("in.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
	#endif
    
    solve(std::cin, std::cout);
    
    #ifdef debug
        fprintf(stdout,"\nTIME: %.3lf sec\n", (double)clock()/(CLOCKS_PER_SEC));
    #endif
    
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    ll n = s.size();

    vector<ll> v(26);  // v[i] : sに現れるアルファベットのi番目の文字の個数

    int j = 0;
    for(char c = 'a'; c <= 'z'; c++) {
        rep(i, n) {
            if(s[i] == c) {
                v[j]++;
            }
        }
        j++;
    }

    ll cnt = 0;
    rep(i, 26) {
        cnt += v[i]*(v[i] - 1)/2;
    }

    ll ans = n*(n-1)/2 - cnt + 1;

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

Measured memory_bytes: 640