akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include <string> 
#include <vector>  
#include<math.h>

#define INF 1000000000
using namespace::std;



long Lmax(long x, long y) {
	if (x > y)return x;
	return y;
}

int max(int x, int y) {
	if (x > y)return x;
	return y;
}

long Lmin(long x, long y) {
	if (x < y)return x;
	return y;
}


int min(int x, int y) {
	if (x < y)return x;
	return y;
}

int abs(int a) {
	if (a < 0) {
		return -a;
	}
	return a;
}

long long N, M,wa, K, W, ans,k[5];
string s[100000];

int main() {
	cin >> N >> K;
	if (K > 0){
		for (int i = K + 1; i <= N; i++) {
			ans += (N / i)*(i - K);
			if (N%i >= K) {
				ans += (N%i) - K + 1;
			}
		}
	}
	else {
		ans = N*N;
	}
		cout << ans << endl;
	

	return 0;
}




Measured memory_bytes: 1024
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;


ll N, M;
int A[100001], B[100001];

struct UnionFind {
    vector<int> par, weight;
    UnionFind(int n) : par(n,-1), weight(n) {}
    void unite(int x, int y, int w = 0) {
        x = root(x); y = root(y);
        if (x == y) return;
        if (par[x] > par[y]) swap(x, y), w = -w;
        par[x] += par[y];
        par[y] = x;
        return;
    }
    bool same(int x, int y) { return root(x) == root(y); }
    int root(int x) {
        if(par[x] < 0) return x;
        int r = root(par[x]);
        return par[x] = r;
    }
    ll sizeOf(int x) { return -par[root(x)]; }
};


int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    cin >> N >> M;
    for(int i=0;i<M;++i){
        cin >> A[i] >> B[i];
        --A[i]; --B[i];
    }

    UnionFind uf(N);
    vector<ll> ans;

    ll last = N * (N - 1) / 2;
    ans.push_back(last);
    for(int i = M - 1; i >= 0; --i) {
        if(uf.same(A[i], B[i])) {
            ans.push_back(last);
            continue;
        }

        last -= uf.sizeOf(A[i]) * uf.sizeOf(B[i]);
        ans.push_back(last);
        uf.unite(A[i], B[i]);
    }

    for(int i = M - 1; i >= 0; --i) cout << ans[i] << '\n';
    return 0;
}

Measured memory_bytes: 3828
/*input
6 727202214173249351
6 5 2 5 3 2
*/
 

 
#include <bits/stdc++.h>

using namespace std;
 
 
 
#define int long long int
#define rep(i,n) \
    for(int i = 0; i < n; i++)
#define rep2(i, a, b) \
    for(int i = a; i < b; i++)
#define all(c) \
    c.begin(), c.end()
#define init(arr, num) \
    memset(arr, num, sizeof(arr))

#define fast\
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define inputFile \
    freopen("input.txt", "r", stdin); 
#define outputFile \
    freopen("output.txt", "w", stdout);
#define modM 1000000009
#define PI 3.1415926535897932
#define F first
#define S second  
#define pb push_back  
 
#ifdef gaviria
#define TRACE
#endif
#ifdef TRACE
#define trace(...) _f(#VA_ARGS, __VA_ARGS_)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cout << name << " : " << arg1 << std::endl;
 
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#else
#define trace(...)
#endif
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef pair< int, int > ii;
typedef unordered_set<int> usi;
 
int n,i,j,k,c;
 



void solve() 
{
cin>>n>>k;
int m;
int a[n+1];
for(i=1;i<=n;i++)
    cin>>a[i];

int dp[n+1];
init(dp,-1);
dp[0]=1;
int vis[n+1];
init(vis,0);
c=0;
int ans=0;
for(i=1;i<=n;i++)
{c++;
    if(vis[a[dp[i-1]]]==0)
    {dp[i]=a[dp[i-1]];
        vis[a[dp[i-1]]]=c;

    }
    else {
        ans=vis[a[dp[i-1]]];
        m=(c-ans);
        break;

    }

}

if(k<ans)
{
    cout<<dp[k];
}
else {
    cout<<dp[(k-ans)%m+(ans)];
}



}


    


            












     
 
 
 
 
signed main()
{
 
    // inputFile;
    fast;
    int T = 1;
//cin >> T;
//int h=T;
    while(T--){
//cout<<"Case #"<<(h-T)<<": ";
        
        solve();
        cout<<endl;

     
        
        
 
    }
    
    
    return 0;
 
}

Measured memory_bytes: 8344
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<bitset>
#define DEBUG
using namespace std;
int main(){
  string moji;
  while (cin >> moji && moji != "#") {
    vector<string> words1, words2;
    //words1.push_back("");
    for (int i = 0; i < moji.size(); i++) {
      
	if (i == 0) {
	if (moji[i] == 'a') {
	  words1.push_back("a");
	  words1.push_back("b");
	} else if (moji[i] != 'z'){
	  words1.push_back("");
	  words1.back() += char(moji[i]+1);
	}
      } else {
	for (int j = 0; j < words1.size(); j++) {
	  //moji check
	  int flagf = true, flagb = true; //haittenai
	  for (int k = 0; k < words1[j].size(); k++) {
	    if (words1[j][k] == moji[i]) {
	      flagf = false;
	    }
	    if (words1[j][k] == char(moji[i]+1)) {
	      flagb = false;
	    }
	    if (!flagf && !flagb) {
	      break;
	    }
	  }
	  if (!flagf || moji[i] == 'a') { //sonomama
	    words2.push_back(words1[j]+moji[i]);
	  }
	  if (flagb && moji[i] != 'z') { //+1 ireru
	    words2.push_back(words1[j]+char(moji[i]+1));
	  }
	}
	words1 = words2;
	words2.clear();
	}
    }
    cout << words1.size() << endl;
    for (int i = 0; i < words1.size(); i++) {
      if (words1.size() > 10 && i == 5) {
	i = words1.size()-5;
      }
      cout << words1[i] << endl;
    }
  }




  return 0;
}



Measured memory_bytes: 5476
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#define ll long long
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);
  ll n;
  cin >> n;
  ll ans = (n*(n+1))/2;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

ll A, B, K;

int main(void){
    
    scanf("%lld %lld %lld", &A, &B, &K);
    for(int i = 0; i < K; ++i){
        if(i % 2 == 0){
            if(A % 2 == 1) --A;
            A /= 2;
            B += A;
        }
        else{
            if(B % 2 == 1) --B;
            B /= 2;
            A += B;
        }
    }
    printf("%lld %lld\n", A, B);
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// const ll INF = 1LL <<60;
const int INF = 10000;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}
// ここから開始

int main(){
  int n;
  cin>>n;
  vector<int> v;
  v.push_back(1);
  int tmp = 9;
  while(tmp<=100001){
    v.push_back(tmp);
    tmp*=9;
  }
  tmp = 6;
  while(tmp<=100001){
    v.push_back(tmp);
    tmp*=6;
  }
  sort(v.begin(),v.end());
  // for(int i = 0; i < v.size(); i++){
  //   cout<<v[i]<<endl;
  // }
  int dp[1000001];
  for(int i = 0; i < 1000001; i++){
    dp[i]=INF;
  }
  dp[0]=0;
  for(int i = 0; i <= n; i++){
      for(int j = 0; j < v.size(); j++){
        chmin(dp[i+v[j]],dp[i]+1);
      }
  }
  // for(int i = 0; i <= n; i++){
  //   cout<<dp[i]<<" ";
  //   if(i%10==9){
  //     cout<<endl;
  //   }
  // }
  // cout<<endl;
  cout<<dp[n]<<endl;
}


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

#define rep(i, n)     for(int i = 0;      i < int(n); ++i)
#define rep3(i, a, b) for(int i = int(a); i < int(b); ++i)
#define all(x)        (x).begin(),(x).end()
#define sz(x)         int(x.size())
#define mp            make_pair
#define pb            push_back

using namespace std;

typedef long long ll;
typedef vector<int>::iterator iter;

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

  vector<int> x(N);

  rep(i, N){
    cin >> x[i];
  }

  iter it_zero = x.insert(lower_bound(all(x), 0), 0);

  int mi = 0;
  int ma = sz(x);
  int mid = (ma+mi)/2;
  while(mi < ma){
    if(x[mid] < 0){
      mi = mid + 1;
    }else{
      ma = mid - 1;
    }
    mid = (ma+mi)/2;
  }
 
  int zero_pos = mid;
  
  int ans = 0x7fffffff;
  //int zero_pos = distance(x.begin(), it_zero);
  int start = max(0, zero_pos - K + 1);
  rep3(i, start, zero_pos + 1){
    if(i+K+1 > sz(x)){
      break;
    }

    vector<int> check(x.begin()+i, x.begin()+i+K+1);
    int time = abs(check[0]) + abs(check[K]);
    if(abs(check[0]) < abs(check[K])){
      time += abs(check[0]);
    }else{
      time += abs(check[K]);
    }
    ans = min(ans, time);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
long long int N, a[101], sum, ans;
int main()
{
	scanf("%lld", &N);
	for(int i=1;i<=N;i++)
	{
		scanf("%lld", &a[i]);
		sum += a[i];
	}
	double ave = sum*1.0/(N*1.0);
	double t1 = ave-(int)ave;
	double t2 = 1-t1;
	long long int pos;
	if(t1>=t2)
	    pos = (int)ave+1;
	else pos = (int)ave;
    for(int i=1;i<=N;i++)
        ans += (a[i]-pos)*(a[i]-pos);
    printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 128
n = gets.to_i
nums = gets.split.map(&:to_i)

def minimum_count(nums, next_minus)
  ans = 0
  cumulative = 0
  nums.each do |num|
    cumulative += num
    if next_minus
      if cumulative >= 0
        decrement = cumulative.abs + 1
        ans += decrement
        cumulative -= decrement
      end
    else
      if cumulative <= 0
        increment = cumulative.abs + 1
        ans += increment
        cumulative += increment
      end
    end
    next_minus = !next_minus 
  end
  ans
end
puts [minimum_count(nums, false), minimum_count(nums, true)].min


Measured memory_bytes: 8580
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
//long long…2^64-1 = 9223372036854775807まで

void _main() {
	int N;
	cin >> N;

	ll A[100001];
	rep(i, 0, N+1) cin >> A[i];
	ll B[100000];
	rep(i, 0, N) cin >> B[i];

	ll count = 0;
	rep(i, 0, N) {
		count += B[i];
	}

	rep(i,0,N){
		A[i] -= B[i];
		if (A[i] < 0) A[i + 1] += A[i];

		if (A[i + 1] < 0) {
			count += A[i + 1];
			A[i + 1] = 0;

		}
	}

	cout << count << endl;

}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
#define MP make_pair
#define F first
#define S second
#define sortup(V) sort(V.begin(), V.end())
#define sortdown(V) sort(V.rbegin(), V.rend())
#define MOD 998244353 //1000000007

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

    // solution comes here
    ll a, b, cpy, X=0;
    cin >> a >> b;
    cpy=b;
    while(cpy) {
        cpy /= 10;
        a *= 10;
    }
    X = a+b;
    for(ll i=1; i*i<=X; i++) {
        if(i*i==X) {
            cout << "Yes" << nl;
            return 0;
        }
    }
    cout << "No" << nl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 500030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    998244353;
ll n;
vector<pair<ll,ll> > vp;
ll pre[N],suf[N];
bool comp(pair<ll,ll> p1,pair<ll,ll> p2)
{
	return p1.fi<p2.fi||(p1.fi==p2.fi&&p1.se<p2.se);
}
int main()
{
	ios_base::sync_with_stdio(false);
	    cin.tie(NULL);
   cin>>n;
   for(ll i=0;i<n;i++)
   {
	ll x,y;
	cin>>x>>y;
	vp.emplace_back(x,y);
   }
   sort(vp.begin(),vp.end(),comp);

   ll x1=vp[0].fi;
   ll y1=vp[0].se;
   pre[0]=max(0ll,y1-x1+1);
   for(ll i=1;i<n;i++)
   {
   	x1=max(x1,vp[i].fi);
   	y1=min(y1,vp[i].se);
   	pre[i]=max(0ll,y1-x1+1);
   }
   x1=vp[n-1].fi;
   y1=vp[n-1].se;
   suf[n-1]=max(suf[n-1],y1-x1+1);
   for(ll i=n-2;i>=0;i--)
   {
   	x1=max(x1,vp[i].fi);
   	y1=min(y1,vp[i].se);
   	suf[i]=max(suf[i],y1-x1+1);
   }
   ll ans=0;
   for(ll i=0;i<n-1;i++)
   {
   	if(pre[i]+suf[i+1]>ans)
   	ans=pre[i]+suf[i+1];
  // 	cout<<pre[i]<<" "<<suf[i+1]<<endl;
   }
   ll xx=vp[n-1].fi;

    y1;ll y2;
   ll mn=1e9+6;
   for(int i=0;i<n;i++)
   {
   	if(vp[i].se<mn)
   	{
   		mn=vp[i].se;
   		y1=i;
	   }
   }
   mn=1e9+2;
   for(int i=0;i<n;i++)
   {
   	if(i!=y1)
   	if(vp[i].se<mn)
   	{
   		mn=vp[i].se;
   		y2=i;
	   }
   }
   
	for(ll i=1;i<n-1;i++)
	{
		ll y;
		if(i!=y1)
		y=vp[y1].se;
		else
		y=vp[y2].se;

		ans=max(ans,vp[i].se-vp[i].fi+1+max(0ll,y-xx+1));
	//	cout<<xx<<" "<<y<<endl;
	}
   cout<<ans;
}


Measured memory_bytes: 6896
#include <algorithm>
#include <complex>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::priority_queue;

using std::min;
using std::max;
using std::sort;
using std::abs;

int factorize2(int x){
    int cnt = 0;
    while(x % 2 == 0){
        cnt++;
        x /= 2;
    }
    return cnt;
}

int main(void) {
    int n;
    cin >> n;

    vector<int> a(3);
    for(int i = 0; i < n; i++){
        int x;
        cin >> x;
        int f = factorize2(x);
        if(f == 0){
            a[0]++;
        }else if(f == 1){
            a[1]++;
        }else{
            a[2]++;
        }
    }

    bool ans = a[1] == 0 ? a[0] <= a[2] + 1 : a[0] <= a[2];
    cout << (ans ? "Yes" : "No") << endl;

    return 0;
}


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

int main() {
    string w;
    cin >> w;
    vector<int> s(26);
    
    rep(i, w.size()) {
        s.at(w.at(i) - 'a')++;
    }
    string ans = "Yes";
    rep(i, s.size()) {
        if (s.at(i) % 2 != 0) {
            ans = "No";
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 764
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

int c[6];
const string name[] = {
  "null", "one pair", "two pair", "three card",
  "full house", "straight", "four card"
};

void solve() {
  // count pair
  int cnt = 0;
  rep(i,4) for (int j = i+1; j < 5; ++j) {
    if (c[i] == c[j]) ++cnt;
  }

  // check straight
  bool flag = true;
  for (int i = 1; i <= 4; ++i) if (c[0] != c[i]-i) flag = false;
  if (!flag && c[0] == 1) {
    flag = true;
    for (int i = 1; i <= 4; ++i) if (c[i] != 9+i) flag = false;
  }
  if (flag && cnt < 4) cnt = 5;
  
  // output
  //rep(i,5) printf("%3d", c[i]);
  printf("%s\n", name[cnt].c_str());
}

int main() {
  while (scanf("%d", c) != -1) {
    rep(i,4) scanf(",%d", c+i+1);
    sort(c,c+5);
    solve();
  }
  return 0;
}

Measured memory_bytes: 0
//FIRST THINK THEN CODE.

#include <bits/stdc++.h>


using namespace std;

typedef long long ll;

#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define FOR(i,n)  for(ll i=0;i<n;i++)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vld vector<ld>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define vvld vector<vector<ld>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
#define rev(p) reverse(p.begin(),p.end());
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define popcount(x) __builtin_popcountll(x)
#define sz(x) ((ll)x.size())
const ll M = 1000000007;
const ll MM = 998244353;
ll begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//#define trace(...)
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

template<typename T, typename F>
void chmax( T &a, F b) {
  if (b > a)a = b;
}

template<typename T, typename F>
void chmin( T &a, F b) {
  if (b < a)a = b;
}



ll powM(ll a, ll b, ll m)
{
  if (a <= 0)return 0;
  a %= m;
  ll ans = 1LL;
  while (b)
  {
    if (b & 1)ans = ans * a % m;
    a = a * a % m;
    b >>= 1;
  }

  return ans;
}



ll poww(ll a, ll b)
{

  ll ans = 1;
  while (b)
  {
    if (b & 1)ans = ans * a;
    a = a * a;
    b >>= 1;
  }

  return ans;

}


string tostring(ll x) {
  stringstream sss;
  sss << x;
  string ans = sss.str();
  return ans;
}



const ll N = 1e4 + 5;

ll fac[N], inv[N];


void fill(ll N, ll p) {
  fac[0] = inv[0] = 1;

  for (int i = 1; i < N; i++) {
    fac[i] = fac[i - 1] * i % p;
    inv[i] = powM(fac[i], p - 2, p);
  }
}

ll c(ll a, ll b, ll p) {
  if (a < b)return 0;

  return (fac[a] * inv[a - b] % p) * (inv[b]) % p;
}
int main() {

  IOS;

#ifndef ONLINE_JUDGE

  freopen("input1.txt", "r", stdin);
  freopen("output1.txt", "w", stdout);

#endif

  fill(N, M);

  ll ans = 0;
  ll s; cin >> s;

  for (ll k = 1; 3 * k <= s; k++) {
    ans = (ans + c(s - 2 * k - 1, k - 1, M)) % M;
  }

  cout << ans << endl;


  //end_routine();



  return 0;
}

Measured memory_bytes: 3836
import numpy as np
N =int(input())

X = np.array([int(i) for i in input().split()])

co_min = min(X)
co_max = max(X)

Y =np.ones(co_max-co_min)

for i in range(len(Y)):
    start = co_min + i
    Y[i] = sum((X-start)**2)
if co_min != co_max:    
    ans = int(min(Y))
elif co_min == co_max:
    ans =0
print(ans)

Measured memory_bytes: 22952
import math
I,j=int,input
q=I(j())
for i in[0]*q:
	a,b=map(I,j().split())
	c=I(math.sqrt(a*b))
	if c*(c+1)<a*b:print(2*c-1)
	elif (a*b==c*c)*(a!=b):print(2*c-3)
	else:print(2*c-2)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i=0;i<(n);++i)
#define RANGE(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define dcout cout<<fixed<<setprecision(20)
#define Accepted_MAGIC cin.tie(0);ios::sync_with_stdio(false)

// typedef long long ll;
using Real = long double;
#define int long long

const long long dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;
constexpr Real eps = 1e-11, pi = acos(-1);

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
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;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

signed main(void){
  Accepted_MAGIC;
  
  Real L; cin >> L;
  L /= 3.0;
  dcout << powl(L, 3.0) << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<cmath>
using namespace std;
int main(){
    int N,T,A;
    int H[1100];
    cin>>N>>T>>A;
    for(int i=0;i<N;i++)cin>>H[i];
    double ave_T[1100];
    for(int i=0;i<N;i++){
        ave_T[i]=T-H[i]*0.006;
    }
    double min=11000;
    int ind=1;

    for(int i=0;i<N;i++){
        double sub=abs(ave_T[i]-A);
        if(sub<=min){
            min=sub;
            ind=i+1;
        }
    }
    cout<<ind<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i=0;i<(int)(n);++i)
template <typename T> ll gcd(T a, T b) {return b?gcd(b, a%b):a;}
template <typename T> ll lcm(T a, T b) {return a * b / gcd(a, b);};
template <typename T> inline void chmin(T &a, const T& b){if(a>b)a=b;}
template <typename T> inline void chmax(T &a, const T& b){if(a<b)a=b;}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  double a, b;
  cin >> a >> b;
  double i = 0;
  for (; i <= 1000; ++i) {
    if (floor(i * 0.08) == a && b == floor(i * 0.1)) {
      cout << int(i) << '\n';
      break;
    }
  }
  if (i == 1001) {
    cout << -1 << '\n';
  }
}


Measured memory_bytes: 256
import scala.collection.mutable.{Map => MMap}
object Main extends App {
  val in = new StdinReader
  val N = in.nextInt
  val map = MMap[String, Int]().withDefault(_ => 0)
  (1 to N).foreach{i =>
    val s = in.next
    map.put(s, map(s) + 1)
  }

  val list = map.toList.sortWith((l, r) => if (l._2 == r._2) l._1 < r._1 else l._2 > r._2)
  val max = list.head._2
  println(list.takeWhile(_._2 == max).map(_._1).mkString("\n"))
}

class StdinReader {
  val is = System.in
  val buffer = new Array[Byte](1024 * 1024)
  var size = 0
  var pos = 0

  private def readByte: Byte = {
    if (pos >= size) {
      pos = 0;
      size = is.read(buffer);
    }
    if (size < 0) -1
    else {
      val ret = buffer(pos)
      pos += 1
      ret
    }
  }

  // support single byte char only
  def next: String = {
    @scala.annotation.tailrec
    def r(sb: StringBuilder, reading: Boolean): String = {
      readByte match {
        case b if ('!' <= b && b <= '~') => r(sb.append(b.asInstanceOf[Char]), true)
        case _ => if (reading) sb.toString else r(sb, false)
      }
    }
    r(new StringBuilder, false)
  }

  def nextInt: Int = {
    @scala.annotation.tailrec
    def r(i: Int, reading: Boolean): Int = {
      readByte match {
        case '-' => r(i * -1, true)
        case b if '0' <= b && b <= '9' => r(i * 10 + (b - '0'), true)
        case _ => if (reading) i else r(i, false)
      }
    }
    r(0, false)
  }
}

Measured memory_bytes: 100504
#ifndef YK_INCLUDE
#include <bits/stdc++.h>
#endif //! YK_INCLUDE


int main() {
    std::cin.tie(nullptr); std::ios::sync_with_stdio(false);
   
   int N;
   std::cin >> N;
   std::set<int> s;
   for(int i=0;i<N;++i){
   		int A;
   		std::cin >> A;
   		auto itr = s.find(A);
   		if(itr == s.end())s.insert(A);
   		else s.erase(A);
   }
   std::cout << s.size() << std::endl;
}

Measured memory_bytes: 4992
/*
ID: jerrywcy
LINK:
LANG: C++
STATUS:
*/
#include <bits/stdc++.h>

#define init(array,x) memset(array,x,sizeof(array))

using namespace std;

typedef long long ll;

const int inf=0x3f3f3f3f;

string s,t;
int ans;

int read(){
    int f=1,x=0;
    char ss=getchar();
    while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
    while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
    return f*x;
}

int main()
{
    cin>>s;cin>>t;
    for (int i=0;i<3;i++){
        if (s[i]==t[i])ans++;
    }
    cout<<ans<<endl;

	return 0;
}


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

using namespace std;

#define ll long long
#define vi  vector<int>
#define vvi vector<vi>
#define pi  pair<int,int>
#define mp  make_pair
#define pb  push_back
#define MOD 1e9 + 7
#define PAI  3.1415
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define pr(x) cout << x << endl
#define Endl endl
#define rep(i,n) for(int i = 0 ; i < n; i++)

const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const int ddx[8] = {-1,0,1,-1,1,-1,0,1};
const int ddy[8] = {-1,-1,-1,0,0,1,1,1};
const int inf = 99999999;
const ll linf = 1LL << 62;

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

ll lcm(ll a,ll b){
  if(a < b)swap(a , b);
  return (a/gcd(a , b))*b;
}

int main(){

 int a,b,c,d;
 cin >> a >> b >> c >> d;

 if(abs(a-c) <= d || (abs(b-a)<= d  and abs(c-b) <= d))pr("Yes");
 else pr("No");

  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int int64_t
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define REPP(i, n) for (int i = 1; (i) < (int)(n+1); ++ (i))
#define REPR(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define SORTR(c) sort((c).begin(),(c).end(),greater<int>());
#define BIT(n) (1LL<<(n))
#define PCNT(x) __builtin_popcountll(x)
#define GCD(x,y) __gcd(x,y)
#define LCM(x,y) x/__gcd(x,y)*y
#define PB push_back
#define MP make_pair
#define endl "\n"
#define pa cout << ans << endl
#define p(x) cout << x << endl
#define pall(x) for(auto iter : x) p(iter)
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define yn(x) cout << (x ? "Yes" : "No") << endl
using namespace std;
using Graph = vector<vector<int> >;
using WeightedGraph = vector<vector<pair<int, int> > >;
typedef long double LD;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
const int INF = 2000000000;
const long double PI = acosl(-1);
const int MOD = 1000000007;
void print() {cout << endl;}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " ";print(forward<Tail>(tail)...);}
template <class T> void print(vector<T> &vec) {for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " ";} cout << endl;}
template <class T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec);}}


signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int ans = 0;
    
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    while (1) {
        C -= B;
        if (C <= 0) {
            yes;
            return 0;
        }
        A -= D;
        if (A <= 0) {
            no;
            return 0;
        }
    }
    
    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/abc164/abc164_b && sh shellscripts/test_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc164/abc164_b && sh shellscripts/etest_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc164/abc164_b && sh shellscripts/submit_cpp.sh
*/


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

#define ll long long
#define rep(i,N) for(ll i=0; i<N; i++)
const int mx = 2e5;

int main(void){
  
  ll N, K;
  cin >> N >> K;
  ll su[N];
  rep(i,N) su[i] = 0;
  rep(i,K){
    ll D;
    cin >> D;
    rep(j,D){
      ll A;
      cin >> A;
      su[A-1]++;
    }
  }
  
  ll cnt = 0;
  rep(i,N){
    if(su[i]==0){
      cnt++;
    }
  }
  cout << cnt;
  
  return 0;
}


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

const int MX = 200050;
const int MAXL = 20;

struct RMQ {
	int f[20][MX], n;
	RMQ() {}
	void init(int _n, int *a) {
		n = _n;
		for (int i = 0; i < n; i++) {
			f[0][i] = a[i];
		}
		for (int j = 1; 1<<j <= n; j++) {
			for (int i = 0; i < n; i++) {
				f[j][i] = f[j-1][i];
				if (i + (1<<j-1) < n) {
					f[j][i] = min(f[j][i], f[j-1][i + (1<<j-1)]);
				}
			}
		}
	}
	inline int get(int s, int e) { // Get minimum value between
		// [s, e](both inclusive)
		assert(s <= e && 0 <= s);
		int k = 31-__builtin_clz(e-s+1);
		return min(f[k][s], f[k][e-(1<<k)+1]);
	}
} r0, r1;

int p0[MX], p1[MX], p[MX];
int pos[MX];

struct node {
	int st, ed, P0, P1;
	node(int st = 0, int ed = 0) : st(st), ed(ed) {
		if(st & 1) {
			int k = r1.get(st / 2, ed / 2 - 1);
			P0 = pos[k];
			k = r0.get(P0 / 2 + 1, ed / 2);
			P1 = pos[k];
		}
		else {
			int k = r0.get(st / 2, ed / 2);
			P0 = pos[k];
			k = r1.get(P0 / 2, ed / 2);
			P1 = pos[k];
		}
	}
	bool operator < (const node& rhs) const { return p[P0] > p[rhs.P0]; }
};

int main() {
	int n; scanf("%d", &n);
	for(int i = 0; i < n / 2; i++) {
		scanf("%d%d", p0 + i, p1 + i);
		pos[p0[i]] = i * 2; pos[p1[i]] = i * 2 + 1;
		p[i * 2] = p0[i]; p[i * 2 + 1] = p1[i];
	}
	r0.init(n / 2, p0); r1.init(n / 2, p1);
	priority_queue<node> pq;
	pq.push(node(0, n - 1));
	vector<int> res;
	while(pq.size()) {
		node nd = pq.top(); pq.pop();
		if(nd.st < nd.P0) pq.push(node(nd.st, nd.P0 - 1));
		if(nd.P0 + 1 < nd.P1) pq.push(node(nd.P0 + 1, nd.P1 - 1));
		if(nd.P1 < nd.ed) pq.push(node(nd.P1 + 1, nd.ed));
		res.push_back(p[nd.P0]);
		res.push_back(p[nd.P1]);
	}
	for(int i = 0; i < res.size(); i++) printf("%d%c", res[i], i == res.size() - 1 ? '\n' : ' ');
	return 0;
}


Measured memory_bytes: 33652
//??-2015-11-8
# include <cstdio>
# include <algorithm>
# include <cstring>
# include <string>
# include <bitset>
# include <iostream>

using namespace std;

int result,r,c;
bitset<10005>b[20];                                      //bitset其?vector一?，只是它里面存的数字不是0就是1


void Dfs(int level)
{
	if (level == r)                                      //如果已?到了10?了，就到了一个解了
	{
	//	printf("aaa\n");
		int i, j,all_sum = 0;
		for (i = 0; i < c; i++)                           //列不用真的翻
		{
			int sum1 = 0;
			for (j = 0; j < r; j++)
			{
				if (b[j][i])
					sum1++;
			}
			all_sum += max(sum1,r-sum1);
		}
		result = max(result, all_sum);                          //跟新?最大?
		return;                                                 //肯定要返回?
	}
	Dfs(level + 1);                                              //?入左子?
	b[level].flip();                                             //?一?行全?了
	Dfs(level + 1);                                              //?入右子?
}
int main(void)
{
//	freopen("in.txt", "r", stdin);
	int i,j,temp;

	while (scanf("%d%d", &r, &c) != EOF&&r&&c)
	{
		result = 0;                                                    //?一次都要重新?0
		for (i = 0; i < r; i++)
		{
			for (j = 0; j < c; j++)
			{
				scanf("%d", &temp);
				b[i][j] = temp;
			}
		}
		Dfs(0);
		printf("%d\n", result);
	}
	return 0;
}
/*
#include <cstdio>
#include <algorithm>
#include <bitset>
#include<iostream>
using namespace std;
const int MAX_R = 10;
const int MAX_C = 10000;
int R, C;
bitset<MAX_C> a[MAX_R];

int ans;
bool tmp;

void dfs(int k)
{
	//    for(int i = 0;i<R;i++)
	//    {
	//        cout<<a[i][k];
	//    }
	//    cout<<endl;
	if (k == R)
	{
		int result = 0;
		for (int j = 0; j < C; j++)
		{
			int upNum = 0;
			for (int i = 0; i < R; i++)
			{
				if (a[i][j]) upNum++;
			}
			result += max(upNum, R - upNum);
		}
		ans = max(ans, result);
		return;
	}
	dfs(k + 1);
	a[k].flip();
	dfs(k + 1);

}
int main()
{
	freopen("in.txt", "r", stdin);
	while (scanf("%d %d", &R, &C))
	{
		if (R == 0 && C == 0) break;
		for (int i = 0; i < R; i++)
		{
			for (int j = 0; j < C; j++)
			{
				scanf("%d", &tmp);
				a[i][j] = tmp;
			}
		}
		ans = 0;
		dfs(1);
		printf("%d\n", ans);
	}
	return 0;
}
*/

Measured memory_bytes: 1212
N = int(input())
X, Y, H = [], [], []

def main():
    for i in range(N):
        x, y, h = map(int, input().split())
        X.append(x)
        Y.append(y)
        H.append(h)

    for posY in range(101):
        for posX in range(101):

            # 頂点の高さを求める
            # -1はよく分かってないない時、だけど0より上は決まってる
            # -2はだめだとわかった時
            needH = -1
            
            for i in range(N):

                # H[i]==0 は、平地の可能性もあるので、高さの確認から省く
                if H[i] > 0:
                    
                    # 各座標の情報から、現在のposX、posYが頂点だとした時、
                    # 頂点の高さはどのくらい必要かを求める
                    tmp = H[i] + abs(posY - Y[i]) + abs(posX - X[i])

                    #最初、-1だったらtmpを保存する
                    if needH == -1:
                        needH = tmp
                    #2回め以降、与えられた座標から得たtmpがneedHと違っていたら間違ってる
                    elif needH != tmp:
                        needH = -2
                        break

            # 省いた H[i]==0　に矛盾がないか調べる
            for i in range(N):
                if H[i] == 0:

                    # 頂上との距離が高さより大きければH[i]==0の情報は正しい
                    dist = abs(posY - Y[i]) + abs(posX - X[i])
                    if needH > dist:
                        needH = -2
                        break
            #だめだったら別の場所を探す
            if needH == -2:
                continue
            
            #見つけたらそのまま出力する
            print(posX, posY, needH)
            return 0

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<ld> vld;

#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()

int main()
{
	fastIO;
	int n; cin >> n;
	vi a(n);
	for(int i = 0; i < n; i++) cin >> a[i];

	int max = a[0];
	ll ans = 0;
	for(int i = 1; i < n; i++)
	{
		if(max < a[i]) max = a[i];
		else ans += max - a[i], a[i] = max;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3936
#include<stdio.h>
int main(){
  int n;
  int i;
  scanf("%d",&n);
  int res[n];
  double sum=0;
  for(i=0;i<n;i++){
    scanf("%d",&res[i]);
  }
  for(i=0;i<n;i++){
    sum=sum+(double)1/res[i];
  }
  printf("%f",1/sum);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main()
{
	int a, b;
	int comp;
	ostringstream oss;
	string result;

	cin >> a >> b;

	if (a <= b)
	{
		oss << a;
		for (int i = 0; i < b; i++)
			result += oss.str();
	}
	else
	{
		oss << b;
		for (int i = 0; i < a; i++)
			result += oss.str();
	}

	cout << result << endl;

	return 0;
}

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

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;

int main() {

    ll N;
    cin >> N;

    ll mn = INF;
    vector<ll > mnn;
    for(ll i = 0; i < N; i++){
        ll t; cin >> t;
        vec.push_back(t);
        if(mn > t){
            mn = t;
        }
        mnn.push_back(mn);
        
    }

    ll ans = 0;
    ll idx = N - 1;
    //後ろから見ていく
    for(ll j = 0; j < N; j++){
        //cout << mnn[j] << " " << vec[j] << endl;
        if(mnn[j] < vec[j]){
            ans++;
        }
    }

    cout << N - ans << endl;



}

Measured memory_bytes: 3564
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<queue>
#include<utility>
#include<vector>
#include<map>
#include<functional>
#include<math.h>
#include<algorithm>
typedef long long ll;
using namespace std;

int main(){
  int a,b,c,d,e;
  cin >> a >> b >> c;
  printf("%s\n",((a < c && c < b) || (b < c && c < a)) ? "Yes" : "No");
  return 0;
}


Measured memory_bytes: 256
inp=list(map(int,input().split()))
n=inp[0]
k=inp[1]
q=inp[2]
arr=[k-q]*n
for i in range(q):
        x=int(input())
        arr[x-1]+=1
if q<k:
    for i in range(n):
        print ('Yes')
else:
    z=[]
    for i in range(len(arr)):
        if arr[i]>0:
            print ('Yes')
        else:
            print ('No')

Measured memory_bytes: 11616
function main(input) {
  const args = input.split(' ');
  const a = parseInt(args[0],10);
  const b = parseInt(args[1],10);
  
  if((a * b) % 2 === 0) {
    console.log('Even');
  } else {
    console.log('Odd');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
#include<bits/stdc++.h>
#define int long long
#define vi vector<long long>
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAX 500 
#define FORN(start,end) for(int i=start; i<=end; i++)

using namespace std;

void printVector(vi a) {
    cout<<"\n*********DEBUG**********\n";
    FORN(i,a.size()-1) {
        cout<<a[i]<<" ";
    }
    cout<<endl;
}

void printArray(int a[], int n) {
    cout<<"\n*********DEBUG**********\n";
    FORN(i,n-1) {
        cout<<a[i]<<" ";
    }
    cout<<endl;
}

vi power5;


void solve() {

    int n,k;
    int temp;
    int a,b,c,d;

    string str;
    vector<string> strs;
    vi vec;

    int m;

    cin>>n;//>>m;

    int ans=0;

    int sec=-1; int i=0;


    for(i=0; i<power5.size(); i++) {
        sec=power5[i]-n;
    //    cout<<power5[i]<<" "<<sec<<endl;
        if(binary_search(power5.begin(),power5.end(),sec)) {
            i-=((power5.size())/2);
            sec=(lower_bound(power5.begin(), power5.end(), sec)-power5.begin());
            sec-=((power5.size())/2);
            break;
        }
    }

    cout<<i<<" "<<sec<<endl;


    // FORN(0,n-1) {
    //     cin>>temp;
    //     vec.push_back(temp);
    // }

    // FORN(0,n-1) {
    //     cin>>arr[i];
    // }

    // START HERE //


}

void putToPower5() {

    int i;
    int maxx;
    maxx=200;
    i=maxx;

    for(; i>0; i--) {
        power5.push_back(-1*pow(i,5));
    }

    for(i=0; i<=maxx; i++) {
        power5.push_back(pow(i,5));
    }
    
}

int32_t main() {
    fastio;

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


Measured memory_bytes: 4068
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m];

		for (int i = 0; i < n; i++) {
			int tmp = sc.nextInt();
			for (int j = 0; j < tmp; j++) {
				a[sc.nextInt() - 1]++;
			}
		}

		int count = 0;
		for (int i = 0; i < m; i++) {
			if (a[i] == n) {
				count++;
			}
		}

		System.out.print(count);
	}
}

Measured memory_bytes: 22228
#include <stdio.h>

#define my_min(x, y) ((x) < (y) ? (x) : (y))
#define my_max(x, y) ((x) < (y) ? (y) : (x))

int main(void) {
  int A, B;
  if (2 == scanf("%d %d", &A, &B)) {
    int lower = my_max(25 * A, 20 * B);
    int upper = my_min(25 * (A + 1), 20 * (B + 1));
    printf("%d\n", lower < upper ? (lower + 1) / 2 : -1);
  }
  return 0;
}



Measured memory_bytes: 128
// "include" {{{
#include <deque>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
// }}}
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;

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

vector<int> h(100050);
signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	n--;
	cout << n * n - ((n-1) * n) / 2 << '\n';
	return 0;
}


Measured memory_bytes: 1024
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long ans = n - 1;
    for(long i = 2; (i * i) <= n; i++) {
      if((n % i) == 0) {
        long j = n / i;
        ans = Math.min(ans, i + j - 2);
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 35848
/*
    NEVER GIVE UP!
    THE EXPERT IN ANYTHING WAS ONCE A BEGINNER
*/

#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")

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;


void solve()
{
    ll h,a;
    cin >> h >> a;
    if(h%a==0)
        cout << h/a;
    else 
        cout << h/a +1 ;

}

int32_t main()
{
    FIO
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>

using namespace std;

int main() {
	int N, M, m;
	cin >> N;
	int* a = new int[N];

	M = -1; m = 1000000;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		M = max(a[i], M);
		m = min(a[i], m);
	}
	if (M == m) {
		if (M == N - 1 || M * 2 <= N) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	else if (m < M - 1) {
		cout << "No" << endl;
	}
	else {
		int count = 0;
		for (int i = 0; i < N; i++) {
			if (a[i] == m) { count++; }
		}
		if (count + 1 <= M && M <= count + (N - count) / 2) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 640
n,a,b=gets.split.map(&:to_i)
s = gets.chomp.split('')
count = 0
count_b = 0
result = []
n.times do |i|
  x = s[i]
  case x
  when 'c'
    result.push 'No'
  when 'a'
    if count < a + b
      count += 1
      result.push 'Yes'
    else
      result.push 'No'
    end
  when 'b'
    if count < a + b && count_b < b
      result.push 'Yes'
      count += 1
      count_b += 1
    else
      result.push 'No'
    end
  end
end
puts result


Measured memory_bytes: 16508
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = True

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

n, m = MAP()
a = make_divisors(m)
for i in a:
    if i >= n:
        print(m // i)
        exit()

Measured memory_bytes: 59884
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

void bubbleSort(vector<int>& a, int n){
    int count = 0;
    for(int i = 0; i < n; i++){
        for(int j = n-1; j > i; j--){
            if(a[j] < a[j-1]){
                swap(a[j], a[j-1]);
                count++;
            }
        }
    }

    for(int i = 0; i < n; i++){
        if(i > 0) cout << " ";
        cout << a[i];
    }
    cout << endl;
    cout << count << endl;
}


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

    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    bubbleSort(a, n);

    return 0;
}




Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

int32_t main(){
    IOS;
    int n;
    cin>>n;
    map<string,int> m;
    int x=0;
    for(int i=0;i<n;i++){
        string s; cin>>s;
        m[s]++;
        if(m[s]>x) x=m[s];
    }
    vector<string> v;
    for(auto it:m){
        if(it.ss==x){
            v.pb(it.ff);
        }
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++) cout<<v[i]<<endl;
}

Measured memory_bytes: 25712
def gcd(a,b):
    if(a<b):
        tmp=b
        b=a
        a=tmp
    while(a%b!=0):
        tmp_1=b
        tmp_2=a%b
        a=tmp_1
        b=tmp_2
    return b
    
def lcm(x,y):
    return int(x*y/gcd(x,y))

A,B,C,D=map(int,input().split())

S=B-A+1
if(A%C==0):
    n_C=B//C-A//C+1
else:
     n_C=B//C-A//C

if(A%D==0):
    n_D=B//D-A//D+1
else:
    n_D=B//D-A//D

if(A%lcm(C,D)==0):
    n_CD=B//lcm(C,D)-A//lcm(C,D)+1
else:
    n_CD=B//lcm(C,D)-A//lcm(C,D)
    
print(S-n_C-n_D+n_CD)

Measured memory_bytes: 3064