akhauriyash/Code-Regression huggingface dataset:
/* 
 Author:N_o_o_B 
 Created:November 26 2019 21:08:24
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    int a,b;
    cin >> a >> b;
    char c;
    if(a+b==15){
        c='+';
    }
    else if(a*b==15){
        c='*';
    }
    else{
        c='x';
    }

    cout << c << endl;

    time_taken();
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <complex>

int main(){
  
  long long int M, D;
  scanf("%lld%lld", &M, &D);

  long long int ans = 0;
  for(long long int i = 20; i <= D; i++){
    if((i+10)%10 >= 2 && (i/10)*(i%10) <= M){
      ans++;
    }
  }

  std::cerr << "Answer: " << std::endl;
  std::cout << ans << std::endl;

  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {

		//input
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 100000;
        for(int i=0;i<N;i++){
        	sum *= 1.05;
        	if(sum%1000 != 0){sum += 1000 - sum % 1000;}
        }
		
         //output
        System.out.println(sum);
	}
}

Measured memory_bytes: 17324
X, Y = input().split()

if (X == "A"):
    if (Y == "A"):
        print("=")
    else:
        print("<")
elif (X == "B"):
    if (Y == "A"):
        print(">")
    elif (Y == "B"):
        print("=")
    else:
        print("<")
elif (X == "C"):
    if (Y == "A"):
        print(">")
    elif (Y == "B"):
        print(">")
    elif (Y == "C"):
        print("=")
    else:
        print("<")
elif (X == "D"):
    if (Y == "E"):
        print("<")
    elif (Y == "F"):
        print("<")
    elif (Y == "D"):
        print("=")
    else:
        print(">")
elif (X == "E"):
    if (Y == "F"):
        print("<")
    elif (Y == "E"):
        print("=")
    else:
        print(">")
else:
    if (Y == "F"):
        print("=")
    else:
        (">")


Measured memory_bytes: 3064
// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predictive-commoning")
// #pragma GCC option("D_GLIBCXX_PARALLEL","openmp")

// #pragma GCC optimize("O3")
// #pragma GCC target("avx2")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000              // 2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define dmp(x) cerr << #x << ": " << x << endl;

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

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.fi << ',' << p.sec;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.fi >> p.sec;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

#define endl "\n"

#include <atcoder/dsu>

void solve() {
  int N, M;
  cin >> N >> M;
  atcoder::dsu uf(N);
  for (int i = 0; i < M; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    uf.merge(u, v);
  }
  cout << uf.groups().size() - 1 << endl;
  return;
}

signed main() {
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();

  // int t; cin >> t;
  // for(int i=1;i<=t;i++){
  //   cout << "Case #" << i << ": ";
  //   solve();
  // }
  return 0;
}


Measured memory_bytes: 8896
#include <bits/stdc++.h>
#include<unordered_map>
#define ll long long
#define BUF 50
using namespace std;
ll MOD = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
ll ans = 0;

int main() {
	string S, T;
	cin >> S >> T;
	bool flag = 0;
	for (int i = 0; i <S.size(); i++) {
		if (S == T) {
			flag = 1;
			break;
		}
		S.push_back(S[0]);
		S.erase(S.begin());
	}
	if (flag)cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
count_4=0
count_2=0
count=0
for i in a:
    if i%4==0:
        count_4+=1
    elif i%2==0:
        count_2+=1
    else:
        count+=1
if count_2==0:
    if count<=count_4+1:
        print("Yes")
    else:
        print("No")
else:
    if count<=count_4:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 14252
import java.util.Scanner;
public class Main {
     public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int ans = 0;
        int max = 0;
    
        for(int i = 0;i < S.length(); i++){        
        if(S.charAt(i)=='R'){
            ans++;
            if(ans > max){
                max = ans;
            }
        }else{
            ans = 0;
        }
        }
        System.out.println(max);
    }    
}

Measured memory_bytes: 26896
import java.util.*;
import java.math.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int K = sc.nextInt();
    int[] A = new int[M];
    int[] B = new int[M];
    for (int i = 0; i < M; i++) {
      A[i] = sc.nextInt();
      B[i] = sc.nextInt();
    }
    int[] C = new int[K];
    int[] D = new int[K];
    for (int i = 0; i < K; i++) {
      C[i] = sc.nextInt();
      D[i] = sc.nextInt();
    }
    sc.close();

    @SuppressWarnings("unchecked")
    Set<Integer>[] g = new Set[N + 1];
    int[] fc = new int[N + 1];
    for (int i = 0; i < M; i++) {
      int a = A[i];
      int b = B[i];
      if (g[a] == null && g[b] == null) {
        Set<Integer> set = new HashSet<>();
        set.add(a);
        set.add(b);
        g[a] = set;
        g[b] = set;
      } else if (g[a] == null) {
        Set<Integer> set = g[b];
        set.add(a);
        g[a] = set;
      } else if (g[b] == null) {
        Set<Integer> set = g[a];
        set.add(b);
        g[b] = set;
      } else if (g[a] != g[b]) {
        Set<Integer> setL = g[a];
        Set<Integer> setS = g[b];
        if (setL.size() < setS.size()) {
          Set<Integer> temp = setL;
          setL = setS;
          setS = temp;
        }
        setL.addAll(setS);
        for (int c : setS) g[c] = setL;
      }
      fc[a]++;
      fc[b]++;
    }

    int[] bc = new int[N + 1];
    for (int i = 0; i < K; i++) {
      int c = C[i];
      int d = D[i];
      if (g[c] == g[d]) {
        bc[c]++;
        bc[d]++;
      }
    }

    int[] ans = new int[N + 1];
    for (int i = 1; i < N + 1; i++)
      if (g[i] != null)
        ans[i] = g[i].size() - 1 - fc[i] - bc[i];

    for (int i = 1; i < N + 1; i++)
      System.out.print(ans[i] + " ");
    System.out.println();
  }
}

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

int main() {
  long long A,B,ans=0;
  cin >> A >> B;
  
  if(B%2==0) ans ^= B;
  else B++;
  B /= 2;
  if(B%2==0) ans ^= 0;
  else ans ^= 1;
  
  A--;
  if(A%2==0) ans ^= A;
  else A++;
  A /= 2;
  if(A%2==0) ans ^= 0;
  else ans ^= 1;
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string str;
        string[] strer;
        var list = new List<int>();

        do
        {
            str = Console.ReadLine();
            strer = str.Split(' ');
            list.Add(int.Parse(strer[0]));
            list.Add(int.Parse(strer[1]));

        } while (!(str == "0 0"));

        for (int i = 0;; i += 2)
        {
            if(list[i] == 0 && list[i+1] == 0)
            {
                break;
            }

            if(list[i] > list[i + 1])
            {
                Console.WriteLine("{0} {1}", list[i+1], list[i]);
            }
            else
            {
                Console.WriteLine("{0} {1}", list[i], list[i+1]);
            }
            
        }
    }
}


Measured memory_bytes: 18012
#include <iostream>

using namespace std;

long long int gcd(long long int a, long long int b) {
	if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a%b);
	}
}

long long int lcm(long long int a, long long int b) {
	return (a / gcd(a, b)) * b;
}

int main() {
	int n;
	cin >> n;
	long long int a = 1;
	long long int t;
	for (int i = 0; i < n; i++) {
		cin >> t;
		a = lcm(a, t);
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 256
s = input()
if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
    print(3)
elif s[0] == 'R' and s[1] == 'R':
    print(2)
elif s[1] == 'R' and s[2] == 'R':
    print(2)
elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R':
    print(1)
else:
    print(0)

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

struct Benri { Benri() { std::cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12);}} benri;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
using ull = unsigned long long;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
constexpr int INF = 1001001001;
//constexpr ll INF = 1001001001001001001ll;
constexpr double EPS = 1e-10;
using number = long long;


long long GCD(long long a, long long b) {
    return b != 0 ? GCD(b, a % b) : a;
}

vector<ll> pFactorization(ll n) {
    vector<ll> ret;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            while (n % i == 0) n /= i;
        }
    }
    if (n != 1) ret.push_back(n);
    return ret;
}

int main() {
    ll A, B; cin >> A >> B;
    ll C = GCD(A, B);
    vll X = pFactorization(C);

    cout << X.size() + 1 << endl;


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i <n; ++i)
using namespace std;
int main() {
	string A, B;
    cin >> A >> B;
    if (A.size() > B.size()) {
        cout << "GREATER" << endl;
        return 0;
    }
    if (A.size() < B.size()) {
        cout << "LESS" << endl;
        return 0;
    }
    string ans = "EQUAL";
    rep(i, A.size()) {
        if (A[i] > B[i]) {
            ans = "GREATER";
            break;
        } else if (A[i] < B[i]) {
            ans = "LESS";
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		String N = sc.nextLine();
		String[] strArray = N.split("");
        int a = Integer.parseInt(strArray[0]);
        int b = Integer.parseInt(strArray[1]);
        int c = Integer.parseInt(strArray[2]);
      
      if((a == b && a < c) || (a < b)){
        a++; 
      }
     System.out.println(a + "" + a + "" + a);

    }
}

Measured memory_bytes: 22612
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>


using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define clear(arr, val) memset(arr, val, sizeof(arr))

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

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

typedef long long ll;
typedef pair<int, int> pint;

const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };


int main()
{
	int n, p;
	while (cin >> n >> p, n)
	{
		int s[64];
		clear(s, 0);
		for (int i = 0, dog = p; ; ++i %= n)
		{
			if (dog == 0)
			{
				dog = s[i];
				s[i] = 0;
			}
			else
			{
				--dog;
				if (++s[i] == p)
				{
					cout << i << endl;
					break;
				}
			}
		}
	}
}

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

int main() {
	string S; cin >> S;
	string x = "A";
	int cnt = 0;
	int ans = 0;
	while (true) {
		string key = "";
		for (int i = cnt; i < S.size(); ++i) {
			key += S[i];
			if (key != x) {
				x = key;
				ans++;
				cnt = i + 1;
				break;
			}
			else {
				cnt++;
			}
			if (cnt >= S.size()) {
				break;
			}
		}
		if (cnt >= S.size())break;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 644
//There was and will always be only one Chester
//RIP legend
#include<bits/stdc++.h>
#define Nilesh ios_base::sync_with_stdio(false)
using namespace std;
int main()
{
    Nilesh;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int cnt1=1,cnt2=0;
    for(int i=1;i<n;i++)
    {
        if(a[i]==a[i-1])
            cnt1++;
        else
        {
            if(cnt1%2)
                cnt2++;
            cnt1=1;
        }
    }
    if(cnt1%2)
        cnt2++;
    cout<<cnt2;



}


Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <list>
#include <iomanip>
#include <queue>
#include <cmath>
#include <numeric>
#define repl(i, l, r) for (ll i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)

using namespace std;
using ll = long long;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
const long long mod = 1e9 + 7;
ll dx[] = { 1,0 };
ll dy[] = { 0,1 };

int main() {

    string S, T;

    cin >> S >> T;

    ll N = S.size(), M = T.size(), cnt, key;
    bool judge = false;

    rep(i, N - M + 1) {
        cnt = 0;
        rep(j, M) {
            if (T[j] == S[i + j] || S[i + j] == '?') {
                cnt++;
            }
        }
        if (cnt == M) {
            judge = true;
            key = i;
        }
    }

    
    if (judge) {
        string ans = "";
        ll i = 0;
        while (ans.size() != N) {
            if (i == key) {
                ans += T;
                i += M;
            }
            else {
                if (S[i] != '?') ans += S[i];
                else ans += 'a';
                i++;
            }
        }
        cout << ans;
    }
    else {
        cout << "UNRESTORABLE";
    }

    return 0;
}

Measured memory_bytes: 3608
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
vector<int> diff;
int solve()
{
	int n;
	cin>>n;
	int l[n];
	forci(0,n)	cin>>l[i];
	sort(l,l+n);
	int ans=0;
	for(int a=n-1;a>=0;a--)
	{
		for(int b=a-1;b>=0;b--){
			int x=lower_bound(l,l+n,l[a]+l[b])-l;
			x=n-x;
		//	cout<<x<<endl;
			ans+=(n-1-a)-x;
		}
	}
	cout<<ans<<endl;
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}






Measured memory_bytes: 3664
A,B,C,X,Y = map(int,input().split())
ans = float('inf')
for c in range(max(X,Y) + 1):
    tmp = c*2*C
    tmp += max(0,X-c)*A
    tmp += max(0,Y-c)*B
    ans = min(ans, tmp)
print(ans)

Measured memory_bytes: 3060
import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.nextLine();
		int[] A = castToInt(sc.nextLine().split(" "));
		int[] B = castToInt(sc.nextLine().split(" "));
		int[] C = castToInt(sc.nextLine().split(" "));
		int total = 0;
		int pre = 999;
		for (int a : A) {
			total += B[a-1];
			if (a - pre == 1) {
				total += C[a-2];
			}
        	pre = a;
		}
      System.out.println(total);
	}
	static int[] castToInt(String[] s) {
		int[] ret = new int[s.length];
		for (int i = 0; i < s.length; i++) {
			ret[i] = Integer.parseInt(s[i]);
		}
		return ret;
	}
}

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

int main(){
    int n, m;
    cin >> n >> m;
    int ans[30];
    for(int i = 0; i < 30; i++){
        ans[i] = 0;
    }
    for(int i = 0; i < n; i++){
        int k;
        cin >> k;
        for(int j = 0; j < k; j++){
            int a;
            cin >> a;
            ans[a-1]++;
        }
    }
    int num = 0;
    for(int i = 0; i < m; i++){
        if(ans[i] == n){
            num++;
        }
    }
    cout << num << endl;
    return 0;
}

Measured memory_bytes: 256
//
//AtCoder Grand Contest 008
//A
//https://atcoder.jp/contests/agc008/tasks/agc008_a
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <functional>
#include <cassert>
#include <bitset>

using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) (int)(x).size()
#define SIZEL(x) (ll)(x).size()
#define MSG(a) cout << #a << " " << a << endl;

using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;

const double PI = 3.14159265358979323846;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }            //最小公倍数

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

    int ans=0;
    if (abs(x)==abs(y)){
        if (x==y) ans=0;
        else ans=1;
    }else if (abs(x)<abs(y)){
        if (x<0) ans++;
        if (y<0) ans++;
        ans = ans + abs(y) - abs(x);
    }else{
        if (x>0) ans++;
        if (y>0) ans++;
        ans = ans + abs(x) - abs(y);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3608
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());

        int[] x = new int[n];
        int[] a = new int[n];
        int s = 0;
        for (int i = 0; i < n; i++) {
            a[i] =  Integer.parseInt(sc.next());
            s += a[i];
        }

        x[0] = s;
        for (int i = 1; i < n; i+=2) {
            x[0] -= 2 * a[i];
        }

        for(int i = 0; i < n - 1; i++) {
            x[i + 1] = 2 * a[i] - x[i];
        }

        for(int i = 0; i < n; i++) {
            System.out.print(x[i]);
            if (i < n - 1) {
                System.out.print(" ");
            }
        }
    }
}

Measured memory_bytes: 48284
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &x){
	x = 0; int f = 1; char ch = getchar();
	while (!isdigit(ch)) {if (ch == '-') f = -1; ch = getchar();}
	while (isdigit(ch)) {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}
inline void write(int x){if (x > 9) write(x/10); putchar(x%10+'0'); }
int n,r;
int main(){
	cin>>n>>r;
	if (n>=10){
		cout<<r<<endl;
		return 0;
	}
	cout << r+100*(10-n) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
const ll M = 1e9 + 7;
using namespace std;  
int main() 
{
	FAST
	ll n;
	cin>>n;
	string s;
	cin>>s;
	if(s.length()%2==1) 
    {
      cout<<"No";
      return 0;
    }
	else
	{
		ll j=0;
		string s1=s.substr(0,(s.length()/2));
		for(ll i=s.length()/2;i<s.length();i++)
		{
			if(s[i]!=s1[j])
			{
				cout<<"No";
				return 0;
			}
			else j++;
		}
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <cstring>
#include <cctype>
#include <ctype.h>

#define INF 100000000

using namespace std;

int main()
{
    string a, b;
    cin >> a >> b;
    if (a.length() > b.length())
    {
        cout << "GREATER\n";
        return 0;
    }
    else if (a.length() == b.length())
    {
        for (int i = 0; i <= a.length(); i++)
        {
            if (a[i] == b[i])
                continue;
            else if (a[i] > b[i])
            {
                cout << "GREATER\n";
                return 0;
            }
            else
            {
                cout << "LESS\n";
                return 0;
            }
        }
        cout << "EQUAL\n";
        return 0;
    }
    else
    {
        cout << "LESS\n";
        return 0;
    }

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main( void ){
    int a,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: 1808
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <stdio.h>
#include <cmath>
#include <limits.h>
using namespace std;

typedef long long ll;

#define min(a, b) (((a) < (b))? (a):(b))
#define max(a, b) (((a) > (b))? (a):(b))
#define REP(i, a, n) for(int i=(a); i<(n); ++i)
#define rep(i, n) REP(i, 0, (n))
#define square(a) (a)*(a)
#define pb push_back

string s;
int n,ans[100],j;
int main(void) {
    string s;
    int ans = 0;
    cin>>s;
    while(s.size()){
        s.pop_back();
        if(s.size()%2!=0) continue;
        string t;
        for(int i=0;i<s.size()/2;i++) t.pb(s[i]);
        if(t+t==s) ans = max(ans, (int)t.size()*2);
    }
    cout<<ans<<endl;
    return 0;
    
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

const int INF = (1<<10);
int pay;
int mon[4] = {10,50,100,500};
struct Ans{int data[4];};
Ans ans;

Ans getchenge(int money){

  Ans now;
  now.data[0] = now.data[1] = now.data[2] = now.data[3] = 0;
  
  for(int i = 0; i < 4; i++){
    now.data[3-i] = money/mon[3-i];
    money %= mon[3-i];
  }

  return now;
}

Ans getans(int a, int b, int c, int d, Ans p){
  p.data[0] -= a;
  p.data[1] -= b;
  p.data[2] -= c;
  p.data[3] -= d;

  
  int A = (a*10 + b*50 + c*100+ d*500);

  if(A < pay){
    for(int i = 0; i < 4; i++)
      p.data[i] = INF;
    return p;
  }

  int che = A-pay;
  Ans tmp = getchenge(che);

  for(int i = 0; i < 4; i++)
    p.data[i] += tmp.data[i];
  return p;
}

void init(){
  for(int i = 0; i < 4; i++)
    ans.data[i] = INF;
}

int main(){

  bool flg = false;

  while(cin >> pay && pay){
    init();
    if(flg) cout << endl;
    flg = true;

    Ans in;
    for(int i = 0; i < 4; i++)
      cin >> in.data[i];
    Ans use;

    for(int i = 0; i <= in.data[0]; i++)
      for(int j = 0; j <= in.data[1]; j++)
	for(int k = 0; k <= in.data[2]; k++)
	  for(int l = 0; l <= in.data[3]; l++){
	    
	    Ans now = getans(i,j,k,l,in);
	    int sum = now.data[0] + now.data[1] + now.data[2] + now.data[3];
	    int sum2 = ans.data[0] + ans.data[1] + ans.data[2] + ans.data[3];
	    if(sum < sum2){
	      ans = now;
	      use.data[0] = i;
	      use.data[1] = j;
	      use.data[2] = k;
	      use.data[3] = l;
	    }
	  }

    for(int i = 0; i < 4; i++)
      if(use.data[i]) cout << mon[i] << " " << use.data[i] << endl;

    
  }
  return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>
#include <vector>
using namespace std;
#define PB push_back
const int N=1e1+10;
const int MAXN=1<<16;
const double INF=1<<30;
int abs(int a){return a>0?a:-a;}
int main(){
    int n,s[N],d[N],v[N],from[MAXN][N],val[MAXN],all,now=0,top;
    vector<int> ans;
    double dp[MAXN][N],temp;
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%d%d%d",&s[i],&d[i],&v[i]);
    all=1<<n;
    for(int i=0;i<all;i++){
        val[i]=0;
        for(int j=0;j<n;j++){
            dp[i][j]=INF;
            if(i&(1<<j))val[i]+=v[j];
        }
        val[i]*=20;
    }
    for(int i=0;i<n;i++){
        from[1<<i][i]=-1;
        dp[1<<i][i]=((double)70/2000)*d[i];
    }
    for(int i=0;i<all;i++)for(int j=0;j<n;j++)if(i&(1<<j)){
        for(int k=0;k<n;k++)if(k!=j&&i&(1<<k)){
            temp=dp[i^(1<<j)][k]+((double)(70+val[i^(1<<j)])/2000)*abs(d[j]-d[k]);
            if(dp[i][j]>temp){
                from[i][j]=k;
                dp[i][j]=temp;
            }
        }
    }
    all--;
    top=dp[all][0];
    for(int i=1;i<n;i++)if(dp[all][i]<top){
        top=dp[all][i];
        now=i;
    }
    while(all>0){
        ans.PB(s[now]);
        top=all;
        all-=1<<now;
        now=from[top][now];
    }
    printf("%d",ans.back());
    for(int i=static_cast<int>(ans.size()-2);i>=0;i--)printf(" %d",ans[i]);
    printf("\n");
}


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

int main()
{
	string s, t, u;
	int a, b;
	cin >> s >> t;
	cin >> a >> b;
	cin >> u;
	if (u == s)
		a--;
	else
		b--;

	cout << a << " " << b << endl;
	return 0;
}

Measured memory_bytes: 256
H1_M1_H2_M2_K = list(map(int, input().split(" ")))

H1 = H1_M1_H2_M2_K[0]
M1 = H1_M1_H2_M2_K[1]
H2 = H1_M1_H2_M2_K[2]
M2 = H1_M1_H2_M2_K[3]
K = H1_M1_H2_M2_K[4]

dif_H = H2 - H1
dif_M = M2 - M1

ans = (dif_H * 60 + dif_M - K)
print(ans)


Measured memory_bytes: 9144
#import sys
#input = sys.stdin.readline
def main():
    N = int( input())
    S = list( input())
    for i in range(len(S)):
        S[i] = chr( (ord(S[i]) - ord('A') + N)%26 + ord('A'))
    print("".join(S))
if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#include<iostream>

using namespace std;  //a b c
					  //d e f
					  //g h i

int main()
{
	int a,b,c,d,e,f,g,h,i;
	cin>>a>>b>>e;
	i=(0-(a-e))+e;  //a,e,i 为等差数列 
	h=(0-(b-e))+e;	//b,e,h 为等差数列
	g=3*e-i-h;		 
	c=3*e-a-b;
	f=3*e-c-i;
	d=3*e-a-g;
	cout<<a<<' '<<b<<' '<<c<<endl<<d<<' '<<e<<' '<<f<<endl<<g<<' '<<h<<' '<<i<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define all(x) (x).begin(),(x).end()

using ll = long long;

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

	vector<int> S(N);
	vector<int> sums(N);
	int sum = 0;
	rep(i, N)
	{
		cin >> S[i];

		sum += S[i];
	}

	sums[0] = S[0];
	rep(i, N - 1)
	{
		sums[i + 1] = sums[i] + S[i + 1];
	}

	int ans = sum - S[0];
	rep(i, N - 1)
	{
		ans = min(ans, abs(sum - sums[i + 1] * 2));
	}

	cout << ans << endl;

	return 0;
}


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

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

    int h, w;
    cin >> h >> w;

    char s[h][w];
    rep(i, h) rep(j, w) cin >> s[i][j];

    rep(i, h){
        rep(j, w){
            if(s[i][j] == '#'){
                bool up = false;
                bool down = false;
                bool left = false;
                bool right = false;

                if(i>=1){
                    if(s[i-1][j] == '.') up = true;
                }
                else up = true;

                if(i<=h-2){
                    if(s[i+1][j] == '.') down = true;
                }
                else down = true;

                if(j>=1){
                    if(s[i][j-1] == '.') left = true;
                }
                else left = true;

                if(j<=w-2){
                    if(s[i][j+1] == '.') right = true;
                }
                else right = true;

                if(up && down && left && right){
                    puts("No");
                    return 0;
                }
            }
        }
    }

    puts("Yes");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define maxn 100005
#define MOD 1000000007
#define INF 1000000000000000000
#define lim 20

using namespace std;

#define ll long long
#define pii pair<ll, ll>
#define piii pair<pii, ll>
#define ft first
#define sd second

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}


void solve(){
    ll n;cin >> n;
    string s;
    cin >> s;

    //ll n = s.length();
    vector<ll> vr, vg, vb;
    map<ll, char>mp;
    for(ll i = 0; i  <n; i++){
        if(s[i] == 'R') vr.push_back(i);
        else if(s[i] == 'G') vg.push_back(i);
        else vb.push_back(i);
        mp[i] = s[i];
    }
    ll ans = vr.size() * vb.size() * vg.size();

    for(auto x: vr){
        for(auto y : vg){
            if((x+y)%2 == 0 && mp[(x+y)/2] == 'B') ans -= 1;
        }
    }
    for(auto x: vr){
        for(auto y : vb){
            if((x+y)%2 == 0 && mp[(x+y)/2] == 'G') ans -= 1;
        }
    }
    for(auto x: vb){
        for(auto y : vg){
            if((x+y)%2 == 0 && mp[(x+y)/2] == 'R') ans -= 1;
        }
    }
    cout << ans;

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


Measured memory_bytes: 3936
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

ll dp[3005][3005];

int main(){
    int n, t;
    cin >> n >> t;
    vector<P> a(n);
    rep(i, n) cin >> a[i].first >> a[i].second;
    sort(a.begin(), a.end());
    rep(i, n) {
        rep(j, t) {
            if (i==0) {
                if (j==a[i].first) dp[i][j] = a[i].second;
                continue;
            }
            dp[i][j] = max(dp[i][j], dp[i-1][j]);
            if (j-a[i].first>=0) {
                dp[i][j] = max(dp[i][j], dp[i-1][j-a[i].first]+a[i].second);
            }
        }
    }
    ll ans = a[0].second;
    rep(i, n-1) {
        ll res = 0;
        rep(j, t) {
            res = max(res, dp[i][j]);
        }
        ans = max(ans, res+a[i+1].second);
    }    
    
    
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 70656
target = int(input())
range_d = [int(i) for i in input().split()]
min_d = range_d[0]
max_d = range_d[1]

flag = False
if max_d < target:
  print("NG")
else:
  for i in range(min_d,max_d+1):
    if i%target == 0:
      flag = True
      break
  print('OK') if flag else print('NG')

Measured memory_bytes: 9184
import { readFileSync } from 'fs'
const input: string = readFileSync("/dev/stdin", "utf8")

const [m, d] = input.split(' ').map(v => parseInt(v))
let count = 0
for (let i = 1; i <= m; i++) {
  for (let j = 1; j <= d; j++) {
    if (j > 21 && j % 10 > 1) {
      const d1 = j % 10
      const d10 = Math.floor(j / 10)
      if (d1 * d10 === i) count++
    }
  }
}
console.log(count)

Measured memory_bytes: 7500
n,k=map(int,input().split())
man=[0]*n
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for i in a:
        man[i-1]+=1
ans=0
for i in man:
    if  i==0:
        ans+=1
print(ans)

Measured memory_bytes: 67536
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define rep(i, n) for(int i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

class UnionFind {
public:
  UnionFind(int n) : par(n, -1), rnk(n, 0), _size(n) {}

  bool same(int x, int y) {
    return root(x) == root(y);
  }
  void unite(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return;

    --_size;

    if (rnk[x] < rnk[y]) {
      par[x] = y;
    } else {
      par[y] = x;
      if (rnk[x] == rnk[y]) { ++rnk[x]; }
    }
  }
  int root(int x) {
    if (par[x] < 0) {
      return x;
    } else {
      return par[x] = root(par[x]);
    }
  }
  int size() {
    return _size;
  }

private:
  vector<int> par;
  vector<int> rnk;
  int _size; // The number of connected components. Decreases by unite.
};

// int main(int argc, char** argv) {
//   int N, M;
//   cin >> N >> M;
//   UnionFind tree(N);
//   rep(i, M) {
//     int p, a, b;
//     cin >> p >> a >> b;
//     if (p == 0) { // Connect
//       tree.unite(a, b);
//     } else { // Judge
//       if (tree.same(a, b)) {
//         cout << "Yes" << endl;
//       } else {
//         cout << "No" << endl;
//       }
//     }
//   }
// }

int main(int argc, char** argv) {
  ll N, M;
  cin >> N >> M;
  vector<P> pairs;
  rep(i, M) {
    ll A, B;
    cin >> A >> B;
    --A; --B;
    pairs.emplace_back(A, B);
  }
  reverse(all(pairs));
  vector<ll> ans;
  UnionFind tree(N);
  ll cost = N * (N-1) / 2; // The initial cost. This is the final state.
  ans.push_back(cost);

  map<ll, ll> mp; // The united count.
  rep(i, M-1) {
    P p = pairs[i];

    // For Debug
    // cout << p.first << ", " << p.second << ": " << tree.same(p.first, p.second) << endl;

    // Now, we unite p.first and p.second.
    // We want to calculate the diff.
    if (tree.same(p.first, p.second)) { // if already united, the cost does not change.
      ans.push_back(cost);
    } else {
      ll x = tree.root(p.first);
      ll y = tree.root(p.second);
      ll c1 = mp[x]; mp.erase(x);
      ll c2 = mp[y]; mp.erase(y);
      if (c1 == 0) { c1 = 1; }
      if (c2 == 0) { c2 = 1; }

      // For Debug
      // cout << x << ": " << c1 << ", " << y << ": " << c2 << endl;

      ll c = c1 + c2; // new size
      ll diff = c*(c-1)/2 - c1*(c1-1)/2 - c2*(c2-1)/2; // cost changes by diff.
      cost -= diff;
      ans.push_back(cost);

      tree.unite(p.first, p.second);
      ll nx = tree.root(p.first);
      mp[nx] = c;
    }
  }

  reverse(all(ans));
  rep(i, M) {
    cout << ans[i] << endl;
  }
}


Measured memory_bytes: 6640
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

#define popcnt32 __builtin_popcount
#define popcnt64 __builtin_popcountll

template <class T, class U>
vector<T> make_v(U size, const T& init){ return vector<T>(static_cast<size_t>(size), init); }

template<class... Ts, class U>
auto make_v(U size, Ts... rest) { return vector<decltype(make_v(rest...))>(static_cast<size_t>(size), make_v(rest...)); }

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

int main() {
    int n;
    cin >> n;
    vector<int> xs(n), ys(n), ps(n);
    for (int i = 0; i < n; ++i) {
        cin >> xs[i] >> ys[i] >> ps[i];
    }
    auto dp = make_v(1 << n, n, INF<ll>), dp2 = dp;
    for (int S = 0; S < (1 << n); ++S) {
        vector<int> xx{0, 20010};
        for (int i = 0; i < n; ++i) {
            if(S & (1 << i)){
                xx.emplace_back(xs[i]);
            }
        }
        sort(xx.begin(), xx.end());
        xx.erase(unique(xx.begin(), xx.end()), xx.end());
        for (int i = 0; i < n; ++i) {
            ll vval = INF<ll>;
            auto x = lower_bound(xx.begin(),xx.end(), xs[i]);
            if(x != xx.end()) vval = min<ll>(vval, abs(*x-xs[i]));
            if(x != xx.begin()) vval = min<ll>(vval, abs(*(x-1)-xs[i]));
            dp[S][i] = vval;
        }
    }
    for (int S = 0; S < (1 << n); ++S) {
        vector<int> yy{0, 20010};
        for (int i = 0; i < n; ++i) {
            if(S & (1 << i)){
                yy.emplace_back(ys[i]);
            }
        }
        sort(yy.begin(), yy.end());
        yy.erase(unique(yy.begin(), yy.end()), yy.end());
        for (int i = 0; i < n; ++i) {
            ll vval = INF<ll>;
            auto x = lower_bound(yy.begin(),yy.end(), ys[i]);
            if(x != yy.end()) vval = min<ll>(vval, abs(*x-ys[i]));
            if(x != yy.begin()) vval = min<ll>(vval, abs(*(x-1)-ys[i]));
            dp2[S][i] = vval;
        }
    }
    vector<ll> ans(n+1, INF<ll>);
    for (int S = 0; S < (1 << n); ++S) {
        for (int T = S; ; T=(T-1)&S) {
            int U = T^S;
            ll val = 0;
            for (int i = 0; i < n; ++i) {
                val += min(dp[T][i], dp2[U][i])*ps[i];
            }
            chmin(ans[popcnt32(S)], val);
            if (T==0) break;
        }
    }
    for (int i = 0; i <= n; ++i) {
        cout << ans[i] << "\n";
    }
    return 0;
}


Measured memory_bytes: 12980
function main(input){
  const N = BigInt(input);

  let keta = 1;
  let st = 0n;
  let ed = 26n;
  while(true){
    if(N <= (ed+st)) break;
    keta++;
    st += ed;
    ed*=26n;
  }

  const arr = 'abcdefghijklmnopqrstuvwxyz';
  let n = N-(st+1n);
  let ret = '';
  for(let i=0; i<keta; i++){
    ret += arr[n%26n];
    n /= 26n;
  }
  console.log(ret.split('').reverse().join(''));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());

Measured memory_bytes: 29476
fun main(args: Array<String>) {
    val (n, k) = readIntList()
    val h = readIntList()
    println(h.count { it >= k })
}

// Tools
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

Measured memory_bytes: 49180
#include <bits/stdc++.h> 
using namespace std;
#define     mod             1e9+7
#define     ll              long long
#define     mp              make_pair
#define     t()             int test;cin>>test;while(test--)
#define     setbits(x)      __builtin_popcountll(x)
#define     si              set<int>
#define     ii              pair<int,int>
#define     vi              vector<int>
#define     que_max         priority_queue <int>
#define     que_min         priority_queue <int, vi, greater<int>>
#define     IOS             ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define     endl            '\n'

/*
	For Debugging we have define TRACE.
*/

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    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...);
    }
#else
#define trace(...)
#endif  

const int N = 2e5 + 5;
int a[N];

void solve(){
	int n;
	cin>>n;
	ll z = n + (n*n) + (n*n*n);
	cout<<z;
}
 
int32_t main()
 
{  
    #ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
    #endif

    IOS;

    solve();


}

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

using ll = long long;
template <typename T> constexpr T inf = numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity() : numeric_limits<T>::max() / 4;

#define REP(i, stop) FOR(i, 0, stop)
#define FOR(i, start, stop) for (ll i = start, i##_len = stop; i < i##_len; ++i)
#define RREP(i, n) for (ll i = n; i-- > 0;)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define COMP(key) [](const auto& a, const auto& b) { return a.key < b.key; }

template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& a) { return is >> a.first >> a.second; }
template<typename T> istream& operator>>(istream& is, vector<T>& a) { for (T& x : a) is >> x; return is; }

template<typename T> using pop_max = std::priority_queue<T>;
template<typename T> using pop_min = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T> void LOG(const T& x) { cerr << x << "\n"; }
template<typename T> void LOG(const vector<T>& a) { for (const T& x : a) cerr << x << " "; cerr << "\n"; }
template<typename T> void LOG(const vector<vector<T>>& a) { for (const auto& x : a) LOG(x); }
template<typename T, std::size_t S> void LOG(const T (&a)[S]) { REP(i, S) cerr << a[i] << " "; cerr << "\n"; }
template<typename T, std::size_t S, std::size_t R> void LOG(const T (&a)[S][R]) { REP(i, S) { REP(j, R) cerr << a[i][j] << " "; cerr << "\n"; } }

ll ceil(ll a, ll b) { return a > 0 ? (a - 1) / b + 1 : a / b; }
ll gcd(ll a, ll b) { while (b != 0) { ll t = b; b = a % b; a = t; } return a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll gcd(const vector<ll>& v) { return accumulate(v.begin(), v.end(), 1LL, static_cast<ll(*)(ll, ll)>(gcd)); }
ll lcm(const vector<ll>& v) { return v.empty() ? 0LL : accumulate(v.begin() + 1, v.end(), v[0], static_cast<ll(*)(ll, ll)>(lcm)); }
ll pow(ll x, ll y, ll z) { ll a = 1; while (y > 0) { if (y & 1) a = a * x % z; x = x * x % z; y /= 2; } return a; }
ll inv(ll x, ll m) { return pow(x, m - 2, m); }

template<typename T> bool chmax(T& x, const T& y) { return x < y ? x = y, true : false; }
template<typename T> bool chmin(T& x, const T& y) { return x > y ? x = y, true : false; }

struct InitCpp { InitCpp() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } init_cpp;

const ll INF = inf<ll>;
using P = pair<ll, ll>;
const ll M = 1000000007;
signed main() {
  ll n;
  cin>>n;
  vector<char> s(n);
  auto f = [&](auto f, ll i, char m)->void{
    if(i==n){
      REP(i,n)cout<<s[i];
      cout<<"\n";
      return;
    }
    for(char c='a';c<=m;c++){
      s[i]=c;
      f(f,i+1,max((char)(c+1),m));
    }
  };
  f(f, 0, 'a');
}


Measured memory_bytes: 1536