akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1);
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() {
    int x; cin >> x;
    cout << (x >= 30 ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3584
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int a, b, c, d, x, y;
int main() {
	cin >> a >> b >> c >> d; x = c - a; y = d - b;
	for (int i = 1; i <= x; i++)cout << "R";
	for (int i = 1; i <= y; i++)cout << "U";
	for (int i = 1; i <= x; i++)cout << "L";
	for (int i = 1; i <= y; i++)cout << "D";
	cout << "D";
	for (int i = 1; i <= x; i++)cout << "R";
	cout << "R";
	for (int i = 1; i <= y; i++)cout << "U";
	cout << "U";
	cout << "L";
	cout << "U";
	for (int i = 1; i <= x; i++)cout << "L";
	cout << "L";
	for (int i = 1; i <= y; i++)cout << "D";
	cout << "D";
	cout << "R"; cout << endl;
	return 0;
}

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

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a.at(i);

	int ans = 0;
	bool can = true;
	while(can){
		rep(i, a.size()){
			if(a.at(i)%2 != 0){
				can = false;
				break;
			}
		}

		if(!can) break;

		rep(i, a.size()){
			a.at(i) /= 2;
		}

		ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
int cmp(const void *a, const void *b);
//your code here!

int main(void){
    char N[5];
    scanf("%s", N);
    printf(N[0]==N[2]?"Yes\n":"No\n");
    return 0;
}

int cmp(const void *a, const void *b){
    ll A=*(ll *)a, B=*(ll *)b;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート
}


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


int main()
{
    int N;
    cin >> N;
    vector<int> H(N);
    for(int i = 0; i < N; ++i) cin >> H[i];

    bool ans = true;
    for(int i = 1; i < N; ++i){
        if(H[i-1]-1 > H[i] or (i != 1 and H[i-1]-1 == H[i] and H[i-2] == H[i-1])){
            ans = false;
            break;
        }
        if(i == 1 or (i != 1 and H[i-2] != H[i-1]) ) --H[i-1];
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ll            long long
#define nl            "\n"
#define PB            push_back
#define _SAD()        ios::sync_with_stdio(0),cin.tie(0), cout.tie(0);
#define SZ(s)         s.size()
#define SRT(x,y)      sort(x,x+y)
#define REV(a,b)      reverse(a,a+b)
#define VSRT(x)       sort(x.begin(),x.end())
#define VREV(x)       reverse(x.begin(),x.end())
int main()
{
    _SAD()
    int a,ans=0,cnt=0;
    cin>>a;
    for(int i=1;i<=a;i+=2)
    {
        for(int j=1;j<=i;j++)
        {
            if(i%j==0)
            {
                cnt++;
            }
        }
        if(cnt==8)
        {
            ans++;
        }
        cnt=0;
    }
    cout<<ans<<nl;
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define is(a, b) a == b
#define len(v) ll(v.size())

class UnionFind {
public:
	vector<int> par;//親の番号
    vector<int> rank;//木の深さ
 
	UnionFind(int n){//全ての要素に対して自身が根となるように初期化, 木の深さは0になる
		rep(i,n){
            par.push_back(i);
            rank.push_back(0);
        }
	}
 
	int find(int x) {//木の根を求める
		if(par[x]==x){
            return x;
        }else{
            return par[x]=find(par[x]);
        }
	}
 
	void unite(int x,int y){//xとyの属する集合を併合
        x=find(x);
        y=find(y);
        if(x==y) return;
        if(rank[x]<rank[y]){//木の深さが小さい方を大きい方へ繋げる
            par[x]=y;
        }else{
            par[y]=x;
            if(rank[x]==rank[y]) rank[x]++;
        }
    }

    bool same(int x,int y){//xとyが同じ集合に属するか否か
        return find(x)==find(y);
    }
};
//x以下の要素への最小index, ソートしてから使ってね
template <class T> 
int former(const vector<T> &v, T x){
  return upper_bound(v.begin(), v.end(), x) - v.begin() - 1;
}
//x以上の要素への最小index
template <class T> 
int latter(const vector<T> &v, T x){
  return lower_bound(v.begin(), v.end(), x) - v.begin();
}
//vector書き出し
template <class T>
void cout_vec(const vector<T> &vec1){
  rep(i,len(vec1)){
    cout<<vec1[i]<<' ';
  }
  cout<<'\n';
}
//nCk
template <class T>
T comb(T n,T k){
    T ans=1;
    FOR(i,n-k+1,n+1){
        ans*=i;
    }
    FOR(i,1,k+1){
        ans/=i;
    }
    return ans;
}
//a,bの最大公約数
template <class T>
T gcd(T a,T b) {
	if (b == 0) return a;
	else return gcd(b, a % b);
}
//素因数分解
template <class T>
map<T,T> prime_factor(T x){
    map<T,T> ans;
    for(T i=2;i*i<=x;i++){
        while(x%i==0){
            x/=i;
            ans[i]++;
        }
    }
    if (x!=1){
        ans[x]=1;
    }
    return ans;
}
//約数列挙
template <class T>
vector<T> divisor(T x){
    vector<T> res;
    for(T i=1;i*i<=x;i++){
        if(x%i==0){
            res.push_back(i);
            if(i!=x/i){
                res.push_back(x/i);
            }
        }
    }
    return res;
}
//素数判定
template <class T>
bool is_prime(T x){
    for(T i=2;i*i<=x;i++){
        if(x%i==0){
            return false;
        }
    }
    return x!=1;
}

const ll inf=1e9+7;

ll mult(ll n,ll m){//n^m%infを求める
    if(m==1){
        return n%inf;
    }else if(m%2==0){//オーバーフロー防止のためにn^(m/2)*n^(m/2)を考える
        ll t=mult(n,m/2);
        return (t*t)%inf;
    }else{//奇数の時はn^(m-1)*nを考える
        ll t=mult(n,m-1);
        return (t*n)%inf;
    }
}

typedef pair<int,int> P;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int r,g;
    cin>>r>>g;
    cout<<2*g-r<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,b;
  int c;
  int count=0;
  
  scanf("%d%d",&a,&b);
  
  if(b<10){
    c=a*10+b;
  }else if(b<100){
    c=a*100+b;
  }else{
    c=a*1000+b;
  }
  
  for(int i=1;i<400;i++){
    if(c==i*i){
      count++;
    }
  }
  
  if(count==0){
    printf("No");
  }else{
    printf("Yes");
  }
  
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int n;
int a[40]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}; 
int main(){
	cin>>n;
	cout<<a[n-1];
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<vector<int>> c(3,vector<int>(3));
  for(int i=0;i<3;i++)
    for(int j=0;j<3;j++)
      cin>>c.at(i).at(j);
  bool f=1;
  for(int i=1;i<3;i++)
    for(int j=1;j<3;j++)
      if(c.at(i).at(j)-c.at(0).at(j)!=c.at(i).at(0)-c.at(0).at(0))
        f=0;
  cout<<(f?"Yes":"No")<<endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int N=505;
const int dx[]={-1,1,0,0};
const int dy[]={0,0,1,-1};
int n,a[N][N],dis[N][N],vis[N][N],ans;
pii q[N*N];
int main(){
	scanf("%d",&n);
	For(i,1,n) For(j,1,n) dis[i][j]=min(min(i,j),min(n-i+1,n-j+1));
	For(i,1,n*n){
		int p,px,py;
		scanf("%d",&p);
		px=(p-1)/n+1,py=(p-1)%n+1;
		ans+=--dis[px][py]; vis[px][py]=1;
		int h=0,t=0;
		q[++t]=pii(px,py);
		while (h!=t){
			int x=q[++h].fi,y=q[h].se;
			For(d,0,3){
				int nx=x+dx[d],ny=y+dy[d];
				if (nx<1||nx>n||ny<1||ny>n) continue;
				if (dis[x][y]+1-vis[nx][ny]<dis[nx][ny])
					--dis[nx][ny],q[++t]=pii(nx,ny);
			}
		}
	}
	printf("%d\n",ans);
} 

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

int main(void){
    int n;
    cin>>n;
    bool b=false;
    for(int i=1;i<10;i++){
        for(int j=0;j<10;j++){
            if(i*j==n){
                b=true;
            }
        }
    }
    string s;
    if(b){
        s="Yes";
    }else{
        s="No";
    }
    cout<<s<<endl;
}

Measured memory_bytes: 3124
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    void solve(Scanner sc, PrintWriter pw) {
        int N = sc.nextInt();
        int K = sc.nextInt();
        long[] data = new long[N];
        long left = 1;
        long right = 1;
        for (int i = 0; i < N; i++) {
            data[i] = sc.nextLong();
            right = Math.max(right, data[i]);
        }
        while (left <= right) {
            long mid = left + (right - left) / 2;
            long totatCount = 0;
            for (int i = 0; i < N; i++) {
                totatCount += (data[i] + mid - 1) / (mid);
            }
            //System.out.println(String.format("%d %d %d %d", left, right, mid, totatCount));
            if (totatCount > N + K) {
                left = mid + 1;
            } else {
                right = mid - 1;
            }
        }
        pw.println(left);
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        new Main().solve(sc, pw);
        pw.flush();
        pw.close();
        sc.close();
    }
}


Measured memory_bytes: 62496
#include<iostream>

using namespace std;

int main(){
  int sum=0;
  int min=100;
  int temp;  
for(int i=0;i<4;i++){
    cin >> temp;
    sum+=temp;
    if(temp<min)min=temp;
}
sum-=min;
min=100;
for(int i=0;i<2;i++){
    cin >> temp;
    sum+=temp;
    if(temp<min)min=temp;
}
sum-=min;
cout << sum <<endl;
}

Measured memory_bytes: 3096
#include <iostream>
#include <string>

using namespace std;

inline void reverse(char* dst, const char* rbegin, const char* rend) {
  int i = 0;
  for (const char* p = rbegin; p != rend; --p)
    dst[i++] = *p;
  // null-terminate to get rid of garbage when replacing.
  dst[i] = '\0';
}

int main() {
  string str;
  int q;

  cin >> str;
  cin >> q;

  string op;
  int a;
  int b;
  string p;
  char buf[1024]; // for reverse
  for (int i = 0; i < q; ++i) {
    cin >> op >> a >> b;
    if (op == "replace")
      cin >> p;

    if (op == "print") {
      for (size_t i = a; i <= b; ++i)
        cout << str[i];
      cout << endl;
    } else if (op == "reverse") {
      reverse(buf, str.data() + b, str.data() + a - 1);
      str.replace(a, b - a + 1, buf);
    } else if (op == "replace") {
      str.replace(a, p.length(), p);
    }
  }
  return 0;
}

Measured memory_bytes: 3168
#include"bits/stdc++.h"
#define int long long
#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 itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define gridif(a,x,b) if((a)<=(x)&&(x)<(b))

using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
const int mod=1000000007;

int digitsum(int n,int b){
	if(b<2) return -1;
	if(n<b) return n;
	return digitsum(n/b,b)+n%b;
}
int mpow(int a,int x);
int m_inv(int n);
vector<int> split(int n,int a);
string xal_number(int n,int x);
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}
class Factorial{
private:
	vector<int> fac;
public:
	Factorial(int N){
		fac.push_back(1);
		rep(i,N) fac.push_back(fac[i]*(i+1)%mod);
	}
	int fact(int a){return fac[a];}
	int ifac(int a){return m_inv(fac[a]);}
	int cmb(int n,int r);
};
struct UnionFind {
    vector<int> par; // 親ノード
    UnionFind(int n = 1) { init(n);}
    void init(int n = 1) {
        par.resize(n);
        rep(i,n) par[i] = -1;
    }
    int root(int x) {
        if (par[x] <0) return x;
        else return par[x] = root(par[x]);      
    }
    int size(int x){ return -par[root(x)];}
    bool issame(int x, int y) {return root(x)==root(y);}
    bool connect(int x, int y);
};

signed main(){
	int x,y;
	cin>>x>>y;
	if(x>y) swap(x,y);
	if(y-x<=1) cout<<"Brown"<<endl;
	else cout<<"Alice"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <limits>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

#define M_PI       3.14159265358979323846

using namespace std;

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

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int solve()
{
    std::string s, p;

    std::cin >> s >> p;

    int counter = 0;
    for (int i = 0; i < s.length(); ++i)
        counter += s[i] == p[i];

    return counter;
}

int main()
{
    std::cout << solve() << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long int
#define MOD 1000000007
using namespace std;
void solve() {
        int n;
        cin >> n;
        vector <int> v;
        for(int i=0;i<n;i++) {
                int x;
                cin >> x;
                v.push_back(x);
        }
        sort(v.begin(), v.end());
        double res = v[0];
        for(int i=1;i<n;i++) {
                res += v[i];
                res /= 2;
        }
        cout << res << endl;
        return ;
}

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


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

#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define setbits(x) __builtin_popcount(x)
#define zerobits(x) __builtin_ctz(x)
#define setbitsll(x) __builtin_popcountll(x)
#define zerobitsll(x) __builtin_ctzll(x)
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)<<x

typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef unsigned long long ull;
typedef map<int,int> mii;

const int MOD = 1e9+7;
const int M = 2019;

void solve () {
	string str;
	cin >> str;
	vector<int>vect(M);
	vect[0]++;
	int n = str.length();
	int suf = 0;
	int power = 1;
	ll ans = 0;
	for (int i = n-1;i >= 0;--i) {
		int digit = str[i]-'0';
		suf = (suf+digit*power)%M;
		power = (power*10)%M;
		ans += vect[suf];
		vect[suf]++;
	}
	cout << ans << '\n';
}

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



Measured memory_bytes: 3728
#include<bits/stdc++.h> 
#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vb = vector<bool>;
const int INF = 1e9;
const int MOD = 1e9+7;


signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    ll K, T; cin >> K >> T;
    vl a(T); REP(i, T) cin >> a[i];
    sort(ALL(a), greater<ll>());
    ll sum = 0;
    for(int i = 1; i < T; i++) sum += a[i];
    cout << max((ll)0, a[0] - sum -1) << endl;
}

Measured memory_bytes: 256
def main():
    A, B = map(int, input().split())
    # A = 0
    # B = 100
    if A >= 13:
        print(B)
        return
    if A >= 6:
        print(int(B / 2))
        return
    print(0)
    pass


if __name__ == '__main__':
    main()

Measured memory_bytes: 2940
/*
* @author:  codancer
* @createTime:  2020-09-27, 22:58:36
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9+7;
#define pb push_back
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define fep(i,a,b) for(int i=(a);i>=(b);i--)
#define deb(x) cerr<<#x<<" = "<<(x)<<"\n"
typedef vector<int> VI;
typedef vector<ll> VII;
typedef pair<int,int> pii;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll Rand(ll B) {
	return (ull)rng() % B;
}
int main(){
	string s="ACL";
	int n;
	cin>>n;
	rep(i,1,n) cout<<s;
	cout<<endl;
	return 0;
}

Measured memory_bytes: 3524
// AOJ 1161: Verbal Arithmetic
// 2018.1.9 bal4u@uu

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int m, sz;
char str[13][11];
char tr['Z'+1], assign['Z'+1];
char idx[10], not0[10], used[10];
int ans;

void calc()
{
	int i, a, s;
	char *p;

	s = 0;
	for (i = 0; i < m; i++) {
		a = 0, p = str[i];
		while (*p >= 0) a = (a<<3) + (a<<1) + assign[*p++];
		s += a;
	}

	a = 0, p = str[m];
	while (*p >= 0) a = (a<<3) + (a<<1) + assign[*p++];
	if (a == s) ans++;
}

void rec(int k)
{
	int i;

	if (k == sz) { calc(); return; }
	if (!used[0]) {
		if (!not0[k]) used[0] = 1, assign[idx[k]] = 0, rec(k+1), used[0] = 0;
	}
	for (i = 1; i < 10; i++) {
		if (used[i]) continue;
		used[i] = 1, assign[idx[k]] = i, rec(k+1), used[i] = 0;
	}
}

int main()
{
	int n, i;
	char buf[10], *p;

	while (fgets(buf, 10, stdin) && *buf != '0') {
		sz = 0, memset(tr, -1, sizeof(tr));
		memset(not0, 0, sizeof(not0));
		n = atoi(buf), m = n - 1;
		for (i = 0; i < n; i++) {
			fgets(str[i], 15, stdin);
			for (p = str[i]; *p > ' '; p++) {
				if (tr[*p] < 0) tr[*p] = sz, idx[sz++] = *p;
			}
			*p = -1; if (p-str[i] > 1) not0[tr[*str[i]]] = 1;
		}
		ans = 0;
		memset(used, 0, sizeof(used));
		rec(0);
		printf("%d\n", ans);
	}
	return 0;
}


Measured memory_bytes: 1760
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define MOD 1000000007
#define MAX 510000
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

//cout << fixed << setprecision(10);//
//最小公倍数//
ll gcd(ll x, ll y) {
	if (x == 0) return y;
	return gcd(y%x, x);
}
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

//べき//
ll squ(ll n, ll p, ll m){
	if(p==0) return 1;
	if(p%2==0){
		ll t=squ(n, p/2, m);
		return t*t%m;
	}
	return n*squ(n,p-1,m);
	
}


//逆元mod(mを法とするaの逆元)//
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//Cmonp//
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
ll COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//nが大

ll com(ll n,ll m){
	if(n<=0 || m<=0 || n==m){
		return 1;
	}
	if(n<m){
		return 0;
	}
	ll k=1;
	for(ll i=1;i<=m;i++){
       k*=(n-i+1); 
	   k%=MOD;
	   k*=modinv(i,MOD);
	   k%=MOD;
	}

	return k;
}


//


////////////////////////////////////////////////////////////////////




int main() {
ll n,k;
cin>>n>>k;
double p[n+1];
for(int i=1;i<=n;i++){
    cin>>p[i];
    p[i]=(1.0+p[i])/2.0;
}

p[0]=0.0;
for(int i=1;i<=n;i++){
p[i]=p[i]+p[i-1];
}



double ans=0.0;

for(int i=0;i<=n-k;i++){
ans=max(ans, p[k+i]-p[i]);
}

cout<<fixed<<setprecision(10);
cout<<ans<<endl;


return 0;

}


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

using namespace std;

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

using ll = long long;

const int Inf = 1e9;
const double EPS = 1e-9;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<ll> a(x), b(y), c(z);
    rep (i, x) cin >> a[i];
    rep (i, y) cin >> b[i];
    rep (i, z) cin >> c[i];
    sort(a.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    sort(c.rbegin(), c.rend());
    vector<ll> sum, res;
    int cnt = 0;
    rep (i, x) {
        rep (j, y) {
            sum.push_back(a[i] + b[j]);
            cnt++;
        }
    }
    sort(sum.rbegin(), sum.rend());
    rep (i, sum.size()) {
        if (i >= k) break;
        rep (j, z) {
            res.push_back(sum[i] + c[j]);
        }
    }
    
    sort(res.rbegin(), res.rend());
    rep (i, k) cout << res[i] << endl;
    
    return 0;
}



Measured memory_bytes: 43112
n, x = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)
count = 0
for i in a:
    if x - i >= 0:
        x -= i
        count += 1
    else:
        break
if x != 0:
    count -= 1 if count == n else 0
print(count)

Measured memory_bytes: 8992
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
    vector <int>v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(),v.end(), greater<int>());
    cout << v[0]*10 + v[1] + v[2];
}

Measured memory_bytes: 384
/*Arnab's Code
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define vii vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define take(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define takes(a,n,st) for(ll i=st;i<n+st;i++)cin>>a[i]
ll sum(ll a[],ll n,ll s){ for(ll i=0;i<n;i++)s+=a[i]; return s;}
#define mod 1000000009
ll power(ll x, ll y, ll p)  {  
    ll res = 1;  
    x = x % p;   
    if (x == 0) return 0;  
    while (y > 0){  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1;
        x = (x*x) % p;  
    }  
    return res;  
}
char s[200017];
char t[200017];
void solve(){
	ll i=0,tot=0,n=0;
	cin>>s;
	cin>>t;
	n=strlen(s);
	for(i=0;i<n;i++){
		if(s[i]!=t[i]){
			tot++;
		}
	}
	cout<<tot;
	return;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ll t,T;
//	cin>>T;
	T=1;
	for(t=1;t<=T;t++){
//		cout<<"Case #"<<t<<": ";
		solve();
	}
	return 0;
}

Measured memory_bytes: 4028
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/

#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

string s, t;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> s >> t;
    int res = 1e9;
    FOR(i,0,SZ(s)-1) {
        int l = i, r = i + SZ(t) - 1;
        if (r >= SZ(s)) break;
        int now = 0;
        FOR(j,l,r) now += (s[j] != t[j - i]);
        res = min(res, now);
    }
    cout << res;
    return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=1e16;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
	int n,m;
	cin>>n>>m;
	vp in(n);
	rep(i,n)cin>>in[i].first>>in[i].second;
	vp q(m);
	rep(i,m)cin>>q[i].first>>q[i].second;
	rep(i,n){
		int mi=inf,out;
		rep(j,m){
			int t=abs(q[j].first-in[i].first)+abs(q[j].second-in[i].second);
			if(mi>t){
				mi=t;
				out=j+1;
			}
		}
		cout<<out<<endl;
	}
}









Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define ll long long
ll n,m,k;
ll sum;
int main(void){
	sum = 0;
	cin>>n>>m;
	for(int i = 1;i<=m;++i){
		cin>>k;
		sum+=k; 
	}
	if(sum >= n) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string text;
	cin >> text;
	text += text;
	string ma;
	cin >> ma;
	if (text.find(ma) == string::npos)
		cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int n, a, b, c;
vector<int> l;

int dfs(int m, int aa, int bb, int cc, int t) {
  if (m == n) {
    if (aa == 0 || bb == 0 || cc == 0)
      return 1e9;
    return t + abs(a - aa) + abs(b - bb) + abs(c - cc) - 30;
  }
  int m1 = dfs(m + 1, aa + l[m], bb, cc, t + 10);
  int m2 = dfs(m + 1, aa, bb + l[m], cc, t + 10);
  int m3 = dfs(m + 1, aa, bb, cc + l[m], t + 10);
  int m4 = dfs(m + 1, aa, bb, cc, t);
  return min({m1, m2, m3, m4});
}

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

  cin >> n >> a >> b >> c;
  l.resize(n);
  rep(i, 0, n) cin >> l[i];
  int ans = dfs(0, 0, 0, 0, 0);
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,lc[N],rc[N],fa[N],size[N];
vector<int> e[N];
ll mid,up[N];
typedef pair<ll,ll> pll;
vector<pll> v[N];
bool out;
bool check(int x){
	size[x]=1;v[x].clear();
	if (!lc[x]){
		if (up[x]>mid) return 0;
		v[x].push_back(pll(up[x],up[x]));
		return 1;
	}
	if (!check(lc[x])||!check(rc[x])) return 0;
	size[x]=size[lc[x]]+size[rc[x]]+1;
	if (v[lc[x]].size()>v[rc[x]].size()) swap(lc[x],rc[x]);
	vector<pll> &a=v[lc[x]],&b=v[rc[x]];
	vector<pll>::iterator i=a.begin(),p=b.end();--p;
	static vector<pll> A;
	A.clear();
	for (;i!=a.end();++i){
		while (p!=b.begin()&&i->first+p->first>mid) --p;
		if (i->first+p->first>mid) continue;
		A.push_back(pll(i->second+up[x],p->second+up[x]));
		A.push_back(pll(p->second+up[x],i->second+up[x]));
	}
	sort(A.begin(),A.end());
	ll Min=1e16;
	for (i=A.begin();i!=A.end();++i)
		if (i->second<Min) v[x].push_back(*i),Min=i->second;
	return !v[x].empty();
}
int main()
{
	scanf("%d",&n);
	for (int i=2;i<=n;i++){
		scanf("%d%lld",&fa[i],&up[i]);
		(lc[fa[i]]?rc:lc)[fa[i]]=i;
	}
	up[1]=-1e16;
	ll l=0,r=2e10;
	while (l<r){
		mid=(l+r)>>1;
		if (check(1)) r=mid;else l=mid+1;
	}
	printf("%lld\n",l);
	return 0;
}

Measured memory_bytes: 37620
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <sstream>

using namespace std;

int main(){
	
	long long int N;
	
	cin >> N;
	
	long long int num = 1;
	int ans = 0;
	
	for(int i = 0; i < N; i++){
		if(num >= N){
			break;
		}
		num *= 3;
		ans++;
	}
	
	cout << ans << endl;
	
	return 0;
}

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

int main() {
    long long n, m;
    cin >> n >> m;
    
    priority_queue<long long> q;
    for(long long i = 0; i < n; i++) {
        int a;
        cin >> a;
        q.push(a);
    }

    for(long long i = 1; i <= m; i++) {
        int a = q.top();
        q.pop();
        q.push(a / 2);
    }
    
    long long ans = 0;
    for(long long i = 0; i < n; i++) {
        ans += q.top();
        q.pop();
    }

    cout << ans << endl;
}


Measured memory_bytes: 1400
n = int(input())
s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
while True:
    a = n % 26
    if a == 0:
        n = n//26 - 1
    else:
        n //= 26
    ans = s[a-1] + ans
    if n == 0:
        break
print(ans)

Measured memory_bytes: 61728
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
int main() {
    int n; cin >> n;
    vector<pair<int, int> > x(2*n);
    for (int i = 0; i < 2*n; i++) { int a; cin >> a; x[i] = make_pair(a, i<n?-1:1); }
    sort(x.begin(), x.end());
    int c = 0;
    long long ans = 1;
    const int M = (int)1e9 + 7;
    for (auto p : x) {
        if (c != 0 && ((p.second > 0) != (c > 0))) ans = ans * abs(c) % M;
        c += p.second;
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include<iostream>
using namespace std;
typedef long long ll;
ll calc(ll a){
  if(a%2==1){
    return ((a+1)/2%2);
  }else{
    return (((a+2)/2%2)^(a+1));
  }
}
int main(){
  ll a,b,ans;
  cin >> a >> b;
  ans = calc(b)^calc(a-1);
  cout << ans <<endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
class Main{
	public static void main(String[]args){
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		String str[]=in.nextLine().split(" ");
		int n=Integer.parseInt(str[0]);
		int q=Integer.parseInt(str[1]);
		HashMap<String, Integer> map=new HashMap<>();
		Queue<String> queue=new LinkedList<>();
		for(int i=0;i<n;i++){
			str=in.nextLine().split(" ");
			String pid=str[0];
			int ptime=Integer.parseInt(str[1]);
			map.put(pid, ptime);
			queue.add(pid);
		}
		int time=0;
		ArrayList<String> list=new ArrayList<>();
		HashMap<String, Integer> map_2=new HashMap<>();
		
		while(true){
		       String pid=queue.poll();
		       int ptime=map.get(pid);
		       time+=Math.min(q, ptime);
		       ptime=Math.max(0, ptime-q);
		       map.put(pid, ptime);
		       if(ptime==0){
			       list.add(pid);
			       map_2.put(pid, time);
			       if(list.size()==n)
				       break;
		       }else{
			       queue.add(pid);
		       }
		}
		for(int i=0;i<list.size();i++){
			out.println(list.get(i)+" "+map_2.get(list.get(i)));
		}
	}

}


Measured memory_bytes: 113228
N,K = map(int, input().split())

d=[0]*K
A=[0]*N
for i in range(K):
    d[i]=int(input())
    temp = list(map(int, input().strip().split()))
    for k in range(d[i]):
        A[temp[k]-1]=1
        

print(A.count(0))

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

#define lp(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define ff first
#define ss second

using namespace std;

void boxAndBall(){
    int n;
    cin >> n;
    int numGood = 0;
    int mod2[n + 5];
    for (int i = 1; i <= n; i++){
        cin >> mod2[i];
    }
    for (int i = n; i >= 1; i--){
        for (int j = 2 * i; j <= n; j += i) {
            mod2[i] ^= mod2[j];
        }
        if (mod2[i] == 1)
            numGood++;
    }
    cout << numGood << endl;
    for (int i = 1; i <= n; i++){
        if (mod2[i] == 1)
            cout << i << " ";
    }
}

int main() {
    boxAndBall();
}

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

typedef long long ll;

int main(void){
    ll A,B,C,K;
    cin >> A >> B >> C >> K;
    
    ll ans = 0;
    if(K - A >= 0){
        K -= A;
        ans += A;
        if(K - B >= 0){
            K -= B;
            if(K > 0){
                ans -= K;
            }
        }
    }
    else ans = K;
    cout << ans << endl;
}


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

int main() {
    int N;
    int M;
    int count = 0;
    int sum = 0;//合計

    cin >> N >> M;
    vector<int> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A.at(i);
    }

    for(int i = 0; i < N; i++) {
        sum += A.at(i);
    }

    for (int i = 0; i < N; i++) {
        if (sum <= A.at(i) * 4 * M) {
            count++;
        }
    }
  if (count >= M) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
//fck light 
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
void solve()
{
    ll a, b, sol=0;
    cin >> a >> b;
    ll count = 1;
    while(1)
    {
      if(count >= b)
      {
        cout << sol;
        break;
      }
       count += a-1;
       sol++;
    }

}

int main()
{
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		ll t = 1;
	//	cin >> t
		while(t--)
		{
			solve();
		}
	return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    city=[[] for _ in range(N)]
    s=set()
    for i in range(M):
        P,Y=map(lambda x:int(x)-1,input().split())
        s.add(P)
        city[P].append((Y,i))
    city=list(map(sorted,city))
    ans=[0]*M
    for x in s:
        for i,c in enumerate(city[x]):
            ans[c[1]]=str(x+1).zfill(6)+str(i+1).zfill(6)
    for i in range(M):
        print(ans[i])

if __name__ == '__main__':
    main()


Measured memory_bytes: 87204
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
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; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;


int main(){
    ll R;
    cin >> R;
    double res = R * 2 * PI;
    PRINTD(res, 20);
}


Measured memory_bytes: 3760
s=input()
w=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

for x in s:
    if x in w:
       w.remove(x)
if w==[]:
    print("None")
else:
    print(w[0])

Measured memory_bytes: 3188
#include<stdio.h>

int selectionSort(int A[],int N){
	int i,j,t,sw=0,mini;
	
	for(i=0;i<N-1;i++){
		mini=i;
		for(j=i;j<N;j++){
			if(A[j]<A[mini])mini=j;
		}
		t=A[i];A[i]=A[mini];A[mini]=t;
		if(i!=mini)sw++;
	}
	return sw;
}

int main(){
	int A[100],N,i,sw;
	
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&A[i]);
	
	sw =selectionSort(A,N);
	
	for(i=0;i<N;i++){
		if(i>0)printf(" ");
		printf("%d",A[i]);
	}
	printf("\n");
	printf("%d\n",sw);
	
	return 0;
}

Measured memory_bytes: 604
#include <stdio.h>
#include <math.h>
#include <ctype.h>

#define PI (3.14159265359)

int main(int argc, char *argv[])
{
    int n, s[1001];
    

    for (;;) {
        scanf("%d", &n);
        if (n == 0)
            break;

        double a = 0;
        for (int i = 0; i < n; i++) {
            scanf("%d", &s[i]);
            a += s[i];
        }
        a /= n;
        
        double d = 0;
        for (int i = 0; i < n; i++) {
            d += (s[i] - a) * (s[i] - a);
        }
        printf("%.8f\n", sqrt(d / n));
    }

    return 0;
}



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

#define mp make_pair
#define eb emplace_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#endif


const int MAXN = 100;
//#define int long long
const int INF = 1e9;

void solve(){
  int n;
  ll a, b;
  cin >> n >> a >> b;
  vector<ll> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];

  ll ans = 0;
  for (int i = 0; i < n-1; i++){
    ans += min(b, a * abs(x[i+1] - x[i]));
  }

  cout << ans << '\n';
}

signed main()
{
    #ifdef FILEIO
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    solve();

    return 0;
}


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

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int, V, greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

ll N, X;
VL x, sum;

ll calcE(ll k) {
    ll cost = (N + k) * X;
    ll rem = N;
    cost += 5 * sum[rem];
    rem -= 2 * k;
    while(rem > 0) {
        cost += 2 * sum[rem];
        rem -= k;
    }
    if(cost < 0) {
        return LINF;
    }
    return cost;
}

int main() {
    cin >> N >> X;
    x.resize(N);
    sum.resize(N + 1);
    VECCIN(x);
    REP(i, N) sum[i + 1] = sum[i] + x[i];
    ll ans = LINF;
    FOR(k, 1, N + 1) ans = min(ans, calcE(k));
    cout << ans << "\n";
}


Measured memory_bytes: 3328
/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_4_B
  * ????????¢?????¨?????¨
  * ?????? r ???????????¢?????¨?????¨?????????????±???????????????°?????????????????????????????????
  */
object Main {
  def main(args: Array[String]): Unit = {
    val r = io.StdIn.readDouble()
    val s = math.Pi * math.pow(r, 2)
    val l = 2 * math.Pi * r
    println(f"$s%.6f $l%.6f")
  }
}

Measured memory_bytes: 43940
import sys
N = int(input())
array = list(map(int,input().split()))
sys.exit() if not (1 <= N <= 100) else ''
for I in range(len(array)):
    sys.exit() if not (1 <= array[I] <= 100) else ''

array.sort(reverse=True)
alice = 0
bob = 0
for J in range(len(array)):
    if J == 0 or J % 2 == 0:
        alice += array[J]
    else:
        bob += array[J]

print(alice - bob)

Measured memory_bytes: 9152
/**
                  ▄█▀ ▀█▀ ▄▀▄ █▀ █▄█▄█ ▄▀▄ █▀ ▄█▀
                  <⇋⇋⇋⋛∰≓⊂(⌒,_ゝ⌒)⊃≓∰⋛⇋⇋⇋>

            ♔♕♖♗♘♙ ☜❷☞✪ ィℋ६ ≈ ᗫẵℜℵĬŊĞ ✪☜❷☞ ♚♛♜♝♞♟
            ♔♕♖♗♘♙                             ♚♛♜♝♞♟
                      ˙·٠•●♥ Ƹ̵̡Ӝ̵̨̄Ʒ ♥●•٠·˙
**/

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <time.h>
#include <map>
#include <deque>
#include <string>
#include <set>
#include <math.h>

#define sz(s) s.size()
#define pb push_back
#define fr first
#define sc second
#define mk make_pair
#define int long long
#define all(s) s.begin(), s.end()

using namespace std;

const int N = 1e6 + 5;
const int inf = 1e9 + 7;

int a, b, c, x, y;

main()
{
   cin >> a >> b >> c >> x >> y;
   if( ( a + b ) > c * 2 )
   {
      if( x > y )
      {
         if( a < c * 2 )
            cout << y * 2 * c + ( x - y ) * a;
         else
            cout << y * 2 * c + ( x - y ) * c * 2;
      }
      else
      {
         if( b < c * 2 )
            cout << x * 2 * c + ( y - x ) * b;
         else
            cout << x * 2 * c + ( y - x ) * c * 2;

      }
   }
   else
   {
      cout << x * a + y * b;
   }
}















Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
const ll inf = (ll)1e9 + 7;
int main()
{
    ll i, j, k;
    ll a, b;
    cin >> a >> b;
    ll f = 0;
    for (i = 1; i <= 2000; i++)
    {
        if ((8 * i / 100) == a && (10 * i / 100) == b)
        {
            f = 1;
            break;
        }
    }
    if (f)
    {
        cout << i;
    }
    else
    {
        cout << -1;
    }

    return 0;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vi c(m);
    rep(i, m) {
        cin >> c[i];
    }

    vector<ll> dp(n+1, LINF);
    dp[0] = 0;
    rep(i, m) {
        rep(j, n-c[i]+1) {
            dp[j+c[i]] = min(dp[j+c[i]], dp[j] + 1);
        }
    }

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


Measured memory_bytes: 3324
S = [ord(c)-ord('a') for c in input()]
T = [ord(c)-ord('a') for c in input()]

def check():
    R = [[-1] * 26 for _ in range(2)]

    for i in range(len(S)):
        if R[0][S[i]] < 0:
            R[0][S[i]] = T[i]
        elif R[0][S[i]] != T[i]:
            return False
        
        if R[1][T[i]] < 0:
            R[1][T[i]] = S[i]
        elif R[1][T[i]] != S[i]:
            return False
    
    return True

if check():
    print('Yes')
else :
    print('No')


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

int main() {
  int A, B;
	cin >> A >> B;
	if (A <= 8 && B <= 8){
   		cout << "Yay!" << endl;  
    }else {
		cout << ":(" << endl;
    }
 	return 0;
}


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

int main()
{
  i64 N, M;
  cin >> N >> M;
  vector<i64> s(M), c(M);
  for (i64 i = 0; i < M; i++)
    cin >> s[i] >> c[i];
  vector<i64> ans(N, -1);
  for (i64 i = 0; i < M; i++)
    if (ans[s[i] - 1] == -1)
      ans[s[i] - 1] = c[i];
    else if (ans[s[i] - 1] != c[i])
    {
      cout << -1 << endl;
      return 0;
    }
  if (1 < N && ans[0] == 0)
  {
    cout << -1 << endl;
    return 0;
  }
  if (N == 1 && ans[0] == -1)
    cout << 0 << endl;
  else
  {
    for (i64 i = 0; i < N; i++)
      if (i == 0)
        cout << (ans[i] == -1 ? 1 : ans[i]);
      else
        cout << max(0LL, ans[i]);
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

struct UnionFind {
    UnionFind(int n) : p(n, -1) {}
    int root(int u) {
        return p[u] < 0 ? u : p[u] = root(p[u]);
    }
    int size(int u) {
        return -p[root(u)];
    }
    bool same(int u, int v) {
        return root(u) == root(v);
    }
    void unite(int u, int v) {
        u = root(u);
        v = root(v);
        if (u == v) return;
        if (p[u] > p[v]) swap(u, v);
        p[u] += p[v];
        p[v] = u;
    }
    vector<int> p;
};

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

    int n, m, k;
    cin >> n >> m >> k;

    UnionFind uf(n);

    vector<int> t(n, 1);//自分を含めた友達の数
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;

        t[a]++;
        t[b]++;
        uf.unite(a, b);
    }

    vector<vector<int>> s(n, vector<int>());
    for (int i = 0; i < k; i++) {
        int c, d;
        cin >> c >> d;
        c--; d--;

        s[c].push_back(d);
        s[d].push_back(c);
    }

    for (int i = 0; i < n; i++) {
        int r = uf.size(i) - t[i];
        for (auto &d : s[i]) {
            if (uf.same(i, d)) r--;
        }

        cout << r << " \n"[i == n - 1];
    }

    return 0;
}

Measured memory_bytes: 6784
// All Heil Fire Lord Zuko

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

#define F first
#define S second
#define PB push_back
#define debug(x) cerr << #x << " = " << x << endl

#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()

typedef long long ll;
typedef long double ld;

const int N = 2 * 100 * 1000 + 19;

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int a[30] = {};
    string s;
    cin >> s;
    debug('A' - '0');
    debug('Z' - '0');
    for (auto i : s)
        a[i - '0' - 17] ++;
    int ans = 0;
    for (int i = 0; i < 30; i ++)
        if (a[i] == 2)
            ans ++;
    cout << ((ans == 2) ? "Yes" : "No");
    return 0;
}



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

using namespace std;

typedef long long ll;

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

	int n;
	cin >> n;
	cout << 180 * (n - 2) << endl;

}


Measured memory_bytes: 256