akhauriyash/Code-Regression huggingface dataset:
#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <vector>
//#include "bits/stdc++.h"
using namespace std;
//using namespace std::vector;
#define rep(i,a,b) for(int i=(a);i<(b);++i)


#define huge 1000000007
typedef long long ll;

int main(void) {

	ll N = 0;
	ll A = 0;
	ll B = 0;
	ll C = 0;
	ll K = 0;
	ll W = 0;
	ll X = 0;
	//ll m[100000] = {};
	ll w[3000] = {};
	ll v[100] = {};
	ll *x, *c, *d;
	string S,T,U;
	ll count = 0;
	ll sum = 0;
	ll min = 1;
	ll max = 0;
	int flag = 0;
	char temp,head;
	//char p;
	cin >>N;
	
	rep(i, 0, N) {
		cin >> w[i];
	}
	
	rep(i, 0, N) {
		sum += (w[i]-1);
	}

		cout << sum << endl;

	return 0;

}



Measured memory_bytes: 256
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N = input_number()
    ans = N % 1000
    if ans != 0:
        ans = 1000 - ans
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9180
N = int(input())
W = list(map(int,input().split()))

sum_W = sum(W)
half_W = sum_W // 2
l_sum = 0
r_sum = sum_W

for i in range(N):
    if l_sum >= r_sum or i == N-1:
        ans_1 = l_sum - r_sum
        ans_2 = r_sum + W[i-1]*2 - l_sum
        print(min(ans_1,ans_2))
        break
    else:
        l_sum += W[i]
        r_sum -= W[i]


Measured memory_bytes: 3060
#include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <cctype>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)

locale l = locale::classic();

int main(){
    string s;
    cin >> s;
    if(s[0]==s[1] || s[1]==s[2] || s[2]==s[3]) cout << "Bad" << endl;
    else cout << "Good" << endl;
}

Measured memory_bytes: 256
//Jacker0031
        //packages
        #if __has_include("C:/Sublime Text 3/debug.h")
            #include "C:/Sublime Text 3/debug.h"
        #else
            #include <bits/stdc++.h>
            using namespace std;
            #define d(...) 11
            #define cerr if(0) cerr
        #endif
        #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

            
        #define ll long long 
        #define ld long double
            
        #define all(a)      (a).begin(),(a).end()
        #define sz(x)       (int)x.size()
            
        #define ff first
        #define ss second
        #define mp make_pair
                 
        #define pb push_back
        #define endl "\n" 
                 
        #define loop(i,l,r) for(ll i=l;i<r;i++)
        #define rf(i,r,l) for(ll i=r;i>=l;i--)    
         
        #define bp __builtin_popcountll
        #define inf LLONG_MAX
            
        const int N=2e5+5; 
        const int M=1e9+7;
        ////////////

        //NOW CODE BEGIN.
        //DHARMSINH DESAI UNIVERSITY.
        #include <ext/pb_ds/assoc_container.hpp> 
        #include <ext/pb_ds/tree_policy.hpp> 
        using namespace __gnu_pbds; 
        #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

        #define ar array
        int main()
        {
            ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
            #ifdef Jenish
            freopen("C:/Sublime Text 3/in.txt","r",stdin);
            freopen("C:/Sublime Text 3/out.txt","w",stdout);
            #endif
            ll a,b,c;
            cin>>a>>b>>c;
            ll p=(ll)ceil(a/(ld)b);
            cout<<p*c<<endl;
           



        }       

Measured memory_bytes: 3564
#include "bits/stdc++.h"
using namespace std;
int main()
{
    int n;
    string inp;
    set<string> a;
    cin >> n;
    cin >> inp;
    a.insert(inp);
    char b = inp[inp.length() - 1];
    for (int i = 1; i < n; ++i)
    {
        cin >> inp;
        if(b != inp[0])
        {
            cout << "No\n";
            return 0;
        }
        a.insert(inp);
        b = inp[inp.length() - 1];
    }
    if(n != a.size())
    {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#define llint long long

using namespace std;

struct Node{
	int left, right;
	llint val;
	Node(){
		left = right = -1;
	}
	Node(int a, int b, llint c){
		left = a, right = b, val = c;
	}
};

int N;
int id[100005];
vector< pair< int, pair<int, int> > > edge;
vector<Node> tree;
int num[200005];
llint ans[100005];

int parent[100005];
void init()
{
	for(int i = 1; i <= N; i++) parent[i] = i;
}
int root(int i)
{
	if(parent[i] == i) return i;
	return parent[i] = root(parent[i]);
}
bool same(int i, int j)
{
	return root(i) == root(j);
}
void unite(int i, int j)
{
	int root_i = root(i), root_j = root(j);
	if(root_i == root_j) return;
	parent[root_i] = root_j;
}

int dfs(int v)
{
	int ret = 0;
	if(tree[v].left != -1){
		ret += dfs(tree[v].left);
		ret += dfs(tree[v].right);
	}
	else ret = 1;
	return num[v] = ret;
}

void dfs2(int v, llint sum)
{
	if(tree[v].left != -1){
		dfs2(tree[v].left, sum + num[tree[v].right] * tree[v].val);
		dfs2(tree[v].right, sum + num[tree[v].left] * tree[v].val);
	}
	else{
		ans[v+1] = sum;
	}
}

int main(void)
{
	cin >> N;
	init();
	
	for(int i = 1; i <= N; i++) id[i] = i-1;
	for(int i = 0; i < N; i++) tree.push_back( Node() );
	
	int a, b;
	llint c;
	for(int i = 0; i < N-1; i++){
		cin >> a >> b >> c;
		edge.push_back(make_pair(c, make_pair(a, b)));
	}
	sort(edge.begin(), edge.end());
	reverse(edge.begin(), edge.end());
	
	for(int i = 0; i < edge.size(); i++){
		a = edge[i].second.first, b = edge[i].second.second, c = edge[i].first;
		tree.push_back(Node());
		tree.back().left = id[root(a)];
		tree.back().right = id[root(b)];
		tree.back().val = c;
		unite(a, b);
		id[root(a)] = tree.size()-1;
	}
	
	int s = id[root(1)];
	dfs(s);
	dfs2(s, 0);
	
	for(int i = 1; i <= N; i++){
		cout << ans[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 13932
#include <bits/stdc++.h>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  ll N, A, B;
  cin >> N >> A >> B;
  if(A > B) {
    cout << 0 << endl;
  }
  else if(N == 2) {
    cout << 1 << endl;
  }
  else if(N == 1) {
    if(A == B) {
      cout << 1 << endl;
    }
    else {
      cout << 0 << endl;
    }
  }
  else {
    cout << (B - A) * (N - 2) + 1 << endl;
  }
}


Measured memory_bytes: 3516
n = int(input())
A = [*map(int, input().split())]
MOD = (10**9)+7
sum_a = sum(A)
ans = 0
for i in range(n-1):
    sum_a -= A[i]
    ans = (ans + A[i] * sum_a) % MOD
print((ans + MOD) % MOD)


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

int main() {
    string s;
    cin >> s;
    set<char> a;
    for (int i = 0; i < s.size(); i++)
    {
        a.insert(s[i]);
    }
    if(a.size()==s.size()) cout << "yes" << endl;
    else cout << "no" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <deque>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>

using namespace std;

string a;

int t,op,f;

char c;

deque<char>de;

int main(void) {
	cin >> a;
	for(int i = 0; i < a.length(); i ++) {
		de.push_back(a[i]);
	}
	scanf("%d",&t);
	int ans = 1;
	while(t --) {
		scanf("%d",&op);
		if(op == 1) {
			ans ++;
		} else {
			scanf("%d",&f);
			getchar();
			scanf("%c",&c);
			if(ans % 2 == 1) {
				if(f == 1) {
					de.push_front(c);
				} else {
					de.push_back(c);
				}
			} else {
				if(f != 1) {
					de.push_front(c);
				} else {
					de.push_back(c);
				}
			}
		}
	}
//	ans = ans - 1;
	if(ans % 2 == 1)
		for(int i = 0; i < de.size(); i ++) {
			printf("%c",de[i]);
		}
	else {
		for(int i = de.size() - 1; i >= 0; i --) {
			printf("%c",de[i]);
		}
	}
	return 0;
}

Measured memory_bytes: 960
#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;

int main() {
    int n;
    const string march = "MARCH";
    cin >> n;

    vector<string> s(n);
    map<char, unsigned long> mp;

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

    for(int i=0; i<n; i++) {
        mp[s[i][0]]++;
    }

    unsigned long long count=0;

    for(int i=0; i<5; i++) {
        for(int j=i+1; j<5; j++) {
            for(int k=j+1; k<5; k++) {
                count += mp[march[i]]*mp[march[j]]*mp[march[k]];
            }
        }
    }

    cout << count << endl;
}

Measured memory_bytes: 6144
// Recursive approach
  #include <iostream>
  #include <stdio.h>
  using namespace std;

bool subsetSum(int arrA[], int n, int sum){

    if(sum == 0)
      return true;

    if(n<0 || sum < 0)
      return false;

    bool include = subsetSum(arrA, n-1, sum - arrA[n]);

    bool exclude = subsetSum(arrA, n-1, sum);

    return include || exclude;
}


int main(){

  int n,q;

  scanf("%d",&n);
  int arrA[n];
  for(int i=0;i<n;i++){scanf("%d",&arrA[i]);}

  scanf("%d",&q);
  int arrM[q];
  for(int i=0;i<q;i++){
    scanf("%d",&arrM[i]);
    if(subsetSum(arrA,n-1,arrM[i]))
      cout << "yes" << endl;
    else
      cout << "no" << endl;
    }

  return 0;
  }



Measured memory_bytes: 3168
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

typedef long long s64;

inline int getint()
{
	static char c;
	while ((c = getchar()) < '0' || c > '9');

	int res = c - '0';
	while ((c = getchar()) >= '0' && c <= '9')
		res = res * 10 + c - '0';
	return res;
}

const int MaxN = 100000;
const int MaxM = 200000;

int n, m;

struct halfEdge
{
	int v;
	halfEdge *next;
};
halfEdge adj_pool[MaxM * 2], *adj_tail = adj_pool;
halfEdge *adj[MaxN + 1];

inline void addEdge(const int &u, const int &v)
{
	adj_tail->v = v, adj_tail->next = adj[u];
	adj[u] = adj_tail++;
}

int num[3];	// num[0]: isolated vertices; num[1]: non-bipartite components; num[2]: bipartite components

int col[MaxN + 1];

bool valid;
int total;

void dfs(const int &u, const int &now)
{
	col[u] = now, ++total;

	for (halfEdge *e = adj[u]; e; e = e->next)
	{
		if (!col[e->v])
			dfs(e->v, now ^ 1);
		else if (col[e->v] != now ^ 1)
			valid = false;
	}
}

int main()
{
	cin >> n >> m;
	for (int i = 0; i < m; ++i)
	{
		int u = getint(), v = getint();
		addEdge(u, v);
		addEdge(v, u);
	}

	for (int u = 1; u <= n; ++u)
		if (!col[u])
		{
			valid = true, total = 0;
			dfs(u, 2);

			num[0] += total == 1;
			num[1] += !valid;
			num[2] += valid && total > 1;
		}

	s64 a = num[0], b = num[1], c = num[2];
	s64 p = n * a * 2ll - a * a;
	s64 q = b * b + 2ll * b * c + 2ll * c * c;
	cout << p + q << endl;

	return 0;
}

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

string f(char c, int n) {
    string ret;
    rep(i,n) ret.push_back(c);
    return ret;
}

int main() {
    int n;
    cin >> n;
    vector<vector<int>> alp(n, vector<int> (26, 0));
    rep(i,n) {
        string s;
        cin >> s;
        rep(j,s.size()) alp[i][s[j]-'a']++;
    }
    string res;
    rep(i,26) {
        int cnt = 1e6;
        rep(j,n) cnt = min(cnt, alp[j][i]);
        string t = f((char)(i+'a'), cnt);
        res += t;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;

const int MAXN=20+1;
const int MAXM=20+1;

int n,m;
char mp[MAXN][MAXM];
int ans[MAXN][MAXM];

struct q_node
{
	int x,y,num;
};

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

void bfs(int x,int y)
{
	int vis[MAXN][MAXM];
	memset(vis,0,sizeof(vis));
	queue<q_node> q;
	
	q_node head;
	head.x=x,head.y=y,head.num=0;
	vis[x][y]=1;
	q.push(head);
	
	while(!q.empty())
	{
		q_node tmp=q.front();
		for(int i=1; i<=4; i++)
		{
			q_node next;
			next.x=tmp.x+dx[i];
			next.y=tmp.y+dy[i];
			next.num=tmp.num+1;
			
			if(next.x<=n && next.x>=1 && next.y<=m && next.y>=1
			&& !vis[next.x][next.y]&& mp[next.x][next.y]=='.')
			{
				vis[next.x][next.y]=1;
				q.push(next);
				ans[next.x][next.y]=max(ans[next.x][next.y],next.num);
			}
		}
		
		q.pop();
	}
}

int main()
{
	cin>>n>>m;
	
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			cin>>mp[i][j];
	
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			if(mp[i][j]=='.')
				bfs(i,j);
				
	int res=0;
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			res=max(res,ans[i][j]);
	
	cout<<res<< endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 1e9 + 7;
const int N = 600000;
int f[N], invf[N], cnt[N], s[N], p[N], s2[N], t[N], s1[N];
int binpow(int x, int y){
    int res = 1;
    while(y){
        if (y % 2) res = res * x % mod;
        x = x * x % mod;
        y /= 2;
    }
    return res;
}
int c(int n, int k){
    if (k > n || k < 0) return 0;
    return f[n] * invf[k] % mod * invf[n - k] % mod;
}
int sum (int r)
{
	int result = 0;
	for (; r >= 0; r = (r & (r+1)) - 1)
		result += t[r];
	return result;
}

void inc (int i, int delta)
{
	for (; i < N; i = (i | (i+1)))
		t[i] += delta;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    f[0] = 1;
    invf[0] = 1;
    for (int i = 1; i < N; i++) f[i] = f[i - 1] * i % mod;
    for (int i = 1; i < N; i++) invf[i] = binpow(f[i], mod - 2);
    int t = 0;
    for (int i = 1; i <= n; i++){
        cin >> p[i];
        if (p[i] != 0) cnt[p[i]]++; else t += i;
    }
    int z = 0;
    for (int i = 1; i <= n; i++) s[i] = s[i - 1] + cnt[i];
    for (int i = 1; i <= n; i++) if (cnt[i] == 0) s1[i] = s1[i - 1] + 1; else s1[i] = s1[i - 1];
    for (int i = 1; i <= n; i++) if (cnt[i] == 0) s2[i] = s2[i - 1] + i; else s2[i] = s2[i - 1];
    for (int i = 1; i <= n; i++) if (cnt[i] == 0) z += (s1[i - 1]);
    int ans = 0;
    int l = 0;
    int q = 0;
    int m = s1[n];
    t = s2[n] % mod;
    //cout << m << " " << t << " " << z << endl;
    for (int i = 1; i <= n; i++){
        if (p[i] == 0){
            l++;
            ans = (ans + f[n - i] * f[m] % mod * binpow(m, mod - 2) % mod * (t - m + mod) % mod) % mod;
           // cout << ans << endl;
            ans = (ans - f[n - i] * (l - 1) % mod * binpow(2, mod - 2) % mod * f[m] % mod + mod) % mod;
            ans = (ans - f[n - i] * f[m - 1] % mod * q % mod + mod) % mod;
           // cout << "ans = " << ans << " " << q << endl;
        } else{
            q = (q + s1[n] - s1[p[i]] + mod) % mod;
            ans = (ans + f[n - i] * f[m] % mod * (p[i] - 1 - sum(p[i]))) % mod;
          //  cout << "ans ==== " << ans << " " << s1[p[i]] << " " << s1[n] << endl;
            int r = s1[p[i]];
         //   cout << "r = " << r << " " << c(m - 1, r - 1) << " " << l << endl;
            ans = (ans - f[n - i] * f[m] % mod * r % mod * l % mod * binpow(m, mod - 2) % mod + mod) % mod;
            inc(p[i], 1);
        }
      //  cout << ans << endl;
    }
    cout << (ans + f[m]) % mod;
}


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

int main(){
    ll n, a, b;
    cin >> n >> a >> b;
    if((b - a) % 2 == 0){
        cout << (b - a) / 2 << endl;
    } else {
        ll cnt1 = (a - 1) + 1 + (b - a - 1) / 2;
        ll cnt2 = (n - b) + 1 + (b - a - 1) / 2;
        cout << min(cnt1, cnt2) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
/* atcoder */
#include "bits/stdc++.h"
using namespace std;

/* typedef */
/* long系 */
typedef long long ll;   // long long
typedef long double ld; // long double
/* vector系 */
typedef vector<int> vi;                    // intのvector
typedef vector<double> vd;                 // doubleのvector
typedef vector<ll> vll;                    // llのvector
typedef vector<ld> vld;                    // ldのvector
typedef vector<vector<int>> vvi;           // intの2次元vector
typedef vector<vector<double>> vvd;        // doubleの2次元vector
typedef vector<vector<ll>> vvll;           // llの2次元vector
typedef vector<vector<ld>> vvld;           // ldの2次元vector
typedef vector<pair<int, int>> vi_i;       // i_iのvector
typedef vector<pair<double, double>> vd_d; // d_dのvector
typedef vector<pair<ll, ll>> vl_l;         // l_lのvector
typedef vector<pair<ld, ld>> vld_ld;       // ld_ldのvector
typedef vector<string> vs;                 // stringのvector
/* pair系 */
typedef pair<int, int> i_i;       // int同士のpair
typedef pair<double, double> d_d; // double同士のpair
typedef pair<ll, ll> l_l;         // ll同士のpair
typedef pair<ld, ld> ld_ld;       // ld同士のpair

/* define */
#define all(v) v.begin(), v.end() // コンテナ全体
#define PI (acos(-1))             // 円周率pi

/* stringstream */
stringstream ss;
stringstream init_ss; // save default formatting

/* upper, lower */
struct ToUpper
{
    char operator()(char c)
    {
        return toupper(c);
    }
};
struct ToLower
{
    char operator()(char c)
    {
        return tolower(c);
    }
};

int divnum(int n)
{
    int divn = 1;
    for (int i = 1; i * 2 <= n; i++)
    {
        if (n % i == 0)
            divn++;
    }
    return divn;
}

/* main */
void Main(void)
{
    int n;
    cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i += 2)
    {
        if (divnum(i) == 8)
            ans++;
    }
    cout << ans << endl;
}

int main(int argc, char const *argv[])
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string S;
    cin >> S;

    int count = 0;

    for(int i=0; i<S.size()/2; i++){
        if( S.at(i) != S.at( S.size() -1-i) ) {
            count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<queue>
#include<assert.h>
#include<tuple>
#include<string>
#include<algorithm>
#include<iostream>
#include<map>
#include<string.h>
#include<vector>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<ctype.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef tuple<int,int,int> t3;

const int MX = 20005;
const int MM = 1000000007;

int P[MX];
int V[MX], A[MX], B[MX];

int main()
{
	int N;
	scanf("%d", &N);
	for(int i = 1; i <= N; i++) scanf("%d", P+i);
	V[P[1]] = 1e9;
	for(int i = 2; i <= N; i++) V[P[i]] = V[P[i-1]] + 1;
	A[1] = B[1] = V[1] / 2;
	if( V[1]%2 == 1 ) A[1]++;
	for(int i = 2; i <= N; i++){
		if( V[i] >= V[i-1] ) A[i] = A[i-1] + V[i] - V[i-1] + 1, B[i] = B[i-1] - 1;
		else A[i] = A[i-1] + 1, B[i] = B[i-1] - 1 + (V[i] - V[i-1]);
	}
	for(int i = 1; i <= N; i++) printf("%d ", A[i]); puts("");
	for(int i = 1; i <= N; i++) printf("%d ", B[i]); puts("");
}


Measured memory_bytes: 896
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<cstdio>
#include<map>
using namespace std;
map<string,int>a;
int main()
{
    int n,choose,temp,l,r;
    string color;
    scanf("%d", &n);
    while (n--)
    {
        scanf("%d ", &choose);
        switch (choose)
        {
        case 0:
            cin >> color >> temp;
            //scanf("%s%d", color, &temp);
            a[color] = temp;
            break;
        case 1:
            cin >> color;
            if (a.find(color) != a.end())printf("%d\n", a[color]);
            else printf("0\n");
            break;
        case 2:
            cin >> color;
            a.erase(color);
            break;
        case 3:
            string p, q;
            cin >> p >> q;
            map<string, int>::iterator begin, end;
            begin = a.lower_bound(p);
            end = a.upper_bound(q);
            for (; begin != end; begin++)
            {
                cout << (*begin).first <<" "<<(*begin).second<< endl;
            }
        }
    }
    
}


Measured memory_bytes: 27916
#include <stdbool.h>
#include <stdio.h>
int main() {
	int h, w, n, ans[100][100] = {0}, x = 0, y = 0;
	bool isReverse = false;
	scanf("%d%d%d", &h, &w, &n);
	for (int i = 0; i < n; i++) {
		int a;
		scanf("%d", &a);
		for (int j = 0; j < a; j++) {
			ans[y][x] = i + 1;
			if (isReverse) {
				x--;
			} else {
				x++;
			}
			if (x < 0 || w <= x) {
				isReverse ^= 1;
				y++;
				if (x < 0)
					x = 0;
				else
					x = w - 1;
			}
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			printf("%d", ans[i][j]);
			if (j != w - 1) {
				printf(" ");
			} else {
				printf("\n");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <limits>
#include <vector>


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

  int n;
  std::cin >> n;
  std::vector<int> as(n);
  for (auto&& a : as) {
    std::cin >> a;
  }

  std::vector<int> bs(n);
  if (as.size() % 2 == 0) {
    for (decltype(as)::size_type i = as.size() - 1, j = 0; i != std::numeric_limits<decltype(i)>::max(); i -= 2, j++) {
      bs[j] = as[i];
      bs[bs.size() - 1 - j] = as[i - 1];
    }
  } else {
    for (decltype(as)::size_type i = as.size() - 1, j = 0; i != 0; i -= 2, j++) {
      bs[j] = as[i];
      bs[bs.size() - 1 - j] = as[i - 1];
    }
    bs[bs.size() / 2] = as[0];
  }

  if (!bs.empty()) {
    std::copy(
      std::cbegin(bs),
      std::prev(std::cend(bs)),
      std::ostream_iterator<const decltype(bs)::value_type&>(std::cout, " "));
    std::cout << *std::crbegin(bs) << "\n";
  }

  return EXIT_SUCCESS;
}


Measured memory_bytes: 3712
#include<cstdio>

int main()
{
    int n;
    while(scanf("%d",&n)==1)
    {
        int num2=0,num4=0;
        for(int i=0;i<n;i++)
        {
            int p;
            scanf("%d",&p);
            if(p%2==0)num2++;
            if(p%4==0)num4++;
        }
        num2-=num4;
        if(n-2*num4-1==0 || num2>=n-2*num4)printf("Yes\n");
        else printf("No\n");
    }

    return 0;
}


Measured memory_bytes: 128
N = int(input())
M = list(map(int, input().split()))
H = list(map(int, input().split()))

sum_m = 0
killed = 0
rest = 0
for i in range(0, N):
  killed = min(H[i]+rest, M[i])
  rest = max(0, min(H[i]+rest-killed, H[i]))
  sum_m += killed
sum_m += min(rest, M[-1])
print(sum_m)


Measured memory_bytes: 18476
#include <iostream>
using namespace std;
#define ll long long

int n;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    while(n){
        int x=n%10;
        if (x==7) return cout<<"Yes",0;
        n/=10;
    }
    
    cout<<"No";
    
    
    
    
    return 0;
}

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

int main(){
	while(true){
	
	int d;
	cin >> d;
	if(cin.eof())
		break;
	int area = 0;
	for (int i = 0; i <600;i+=d){
		area += d * i * i;
	}
	cout << area << endl;
	area = 0;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <bitset>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pi acos(-1.0)
#define pii pair<int,int>
#define sys system("pause")
const int maxn=1e5+10;
using namespace std;
inline ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}
inline ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;}
inline void umax(ll &p,ll q){if(p<q)p=q;}
inline void umin(ll &p,ll q){if(p>q)p=q;}
inline ll read()
{
    ll x=0;int f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,k,t;
int main()
{
    int i,j;
    ll p;
    scanf("%lld",&p);
    printf("%lld\n",p%11==0?p/11*2:(p%11<=6?p/11*2+1:p/11*2+2));
    return 0;
}


Measured memory_bytes: 256
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var n = next();
  var a = nexts(n);
  var ans = 0;
  a.sort((a,b)=>b-a);
  var x = 0;
  for(var i = 0; i < n-1; i++){
    ans += a[x];
    if(i % 2 === 0)x++;
  }
  return ans;
}

Measured memory_bytes: 58236
//#pragma warning(disable:4996)
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>
//#include <stdio.h>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 10000;/// 1e9 + 7;
const long long INF = 1e9;
typedef long long LL;
typedef long double LD;
//typedef boost::multiprecision::cpp_int bigint;
typedef pair<LL, LL> PLL;
typedef pair<int, int> PI;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef unsigned long long ULL;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N;
	cin >> N;
	int red = 0;
	int wr = 0;
	VI arr(N);   //赤->1
	string S;
	cin >> S;
	for (int n = 0; n < N; n++) {
		if (S[n] == 'R')arr[n] = 1;
		else arr[n] = 0;
		if (arr[n] == 1)red++;
	}
	for (int n = 1; n < N; n++)arr[n] += arr[n - 1];
	int ans = red;
	for (int r = 1; r <= red; r++) {
		int temp = r - arr[r-1];
		temp += red - r;
		ans = min(ans, temp);
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 4264
import java.util.Scanner;
public class Main{
	int w,km,a;
	int sm=4280;
	public void input(){
		Scanner sc = new Scanner(System.in);
		w =sc.nextInt();
		while(w!= -1){
			if(w<10){
				km=1150;
			}else if (w<20){
				a=w-10;
				km=1150+a*125;
			}else if (w<30){
				a=w-20;
			km=1150+1250+a*140;
			}else{
				a=w-30;
				km=1150+1250+1400+a*160;
			}
			System.out.println(sm-km);
			w =sc.nextInt();
		}
	}
	public static void main(String[] args){
		Main obj = new Main();
		obj.input();
	}
}

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

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

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

using namespace std;

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

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

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

int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> s(M);
    REP(i, M) {
        int k;
        cin >> k;
        s[i].resize(k);
        REP(j, k) {
            cin >> s[i][j];
            s[i][j]--;
        }
    }
    vector<int> p(M);
    REP(i, M) cin >> p[i];

    vector<int> swi(N);
    int result = 0;
    REP(b, 1 << N) {
        REP(i, N) {
            swi[i] = ((b & (1 << i)) > 0);
        }
        bool ok = true;
        REP(i, M) {
            int on = 0;
            REP(j, s[i].size()) {
                if (swi[s[i][j]] > 0) {
                    on++;
                }
            }
            if (on % 2 != p[i]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            result++;
        }
    }
    cout << result << endl;
    return 0;
}



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

using namespace std;

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<int>> dp(10, vector<int>(10, 0));
  for(int i = 0; i < 10; ++i) {
    for(int j = 0; j < 10; ++j) {
      cin >> dp[i][j];
    }
  }
  vector<int> as;
  int a;
  for(int h = 0; h < H; ++h) {
    for(int w = 0; w < W; ++w) {
      cin >> a;
      if(a >= 0) {
        as.push_back(a);
      }
    }
  }

  for(int k = 0; k < 10; ++k) {
    for(int i = 0; i < 10; ++i) {
      for(int j = 0; j < 10; ++j) {
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      }
    }
  }
  int ans = 0;
  for(auto a : as) {
    ans += dp[a][1];
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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; }



string s;
i64 d[505050];
void solve(){
	cin >> s;
	int n = s.size();
	
	i64 ans = 0, cnt = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '<'){
			d[i] = cnt;
			cnt++;
		}
		else{
			d[i] = cnt;
			cnt = 0;
		}
	}
	d[n] = cnt;
	cnt = 0;
	for(int i = n-1; i >= 0; i--){
		if(s[i] == '>'){
			d[i+1] = cnt;
			cnt++;
		}
		else{
			d[i+1] = max(cnt, d[i+1]);
			cnt = 0;
		}
	}
	d[0] = max(cnt,d[0]);
	for(int i = 0; i <= n; i++){
		ans += d[i];
	}
	cout << ans << endl;
}

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


Measured memory_bytes: 4764
import collections
a=collections.deque()
for _ in range(int(input())):
    b=input()
    if b[0]=='i':a.appendleft(b[7:])
    elif b[6]==' ':
        try:a.remove(b[7:])
        except:pass
    elif len(b)>10:a.popleft()
    elif len(b)>6:a.pop()
print(*a)

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

int main() {

	char s[21];
	char c;
	int n;
	int l;
	cin >> l;
	cin >> s;
	cin >> n;
	c = s[n-1];
	for (int i = 0; i < l; i++) {
		if (c == s[i]) {
		}
		else
		{
			s[i] = '*';
		}
	}
	cout << s;

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(Console.ReadLine());
        var input = Console.ReadLine().Split(' ');
        var T = int.Parse(input[0]);
        var A = int.Parse(input[1]);
        var H = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();

        var minInd = 0;
        double minTmp = Math.Pow(10, 5);
        for (var i = 0; i < N; i++)
        {
            var templ = T - H[i] * 0.006;
            if (Math.Abs(A - templ) < Math.Abs(A - minTmp))
            {
                minInd = i;
                minTmp = templ;
            }
        }
        
        Console.WriteLine(minInd + 1);
    }
}


Measured memory_bytes: 28960
#include <stdio.h>

int main(void){
    int input, h, m, s;
    scanf("%d", &input);
   
    if(input>=0 && input<= 86400){
        h = input / 3600;
        m = (input % 3600) / 60;
        s = (input % 3600) % 60;
        printf("%d:%d:%d\n", h, m, s);
    }
}



Measured memory_bytes: 2044
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int cnt;
//---------------------------------------
void insertionSort(vector<int>& a,int g);
vector<int> shellSort(vector<int>& a);
void Show(const vector<int> a);
vector<int> GInShell(const vector<int>& a);
//---------------------------------------

int main(void)
{
	int n;
	vector<int> a;
	
	cin >> n;
	
	for(int i = 0; i < n; i++){
		int num;
		cin >> num;
		a.push_back(num);
	}
	
	vector<int> G = shellSort(a);
	cout << G.size() << endl;  //1????????´??°m
	Show(G);  //2?????? ??´??°G[m]
	cout << cnt << endl;  //3?????? cnt
	
	for(int i = 0; i < a.size(); i++){
		cout << a[i] << endl;
	}
	
	return 0;
}

//------------------------------------------
void insertionSort(vector<int>& a,int g){
	
	for(int i = g; i < a.size(); i++){
		int v = a[i]; //?????????(g+1)?????¢????????°???
		int j = i - g;  //
		
		while(j >= 0 && a[j] > v){
			a[j+g] = a[j];
			j -= g;
			cnt++;
		}
		a[j+g] = v;
	}
}
//------------------------------------------
vector<int> shellSort(vector<int>& a){

	cnt = 0;
	vector<int> G = GInShell(a);
	int m = G.size();
	for(int i = 0; i < m; i++){
		insertionSort(a, G[i]);
	}
	return G;
}
//--------------------------------------------
void Show(const vector<int> a){
	
	for(int i = 0; i < a.size() - 1; i++){
		cout << a[i] << ' ';
	}
	cout << a[a.size() - 1] << endl;
}
//--------------------------------------------
vector<int> GInShell(const vector<int>& a){
	
	vector<int> G;
	G.push_back(1); 
	int i = 0;
	
	while(true){
		int youso = 3 * G[i] + 1;
		if(youso <= a.size()){
			G.push_back(youso);
			i++;
		}
		else{
			break;
		}
	}
	reverse(G.begin(), G.end());
	return G;
}

Measured memory_bytes: 6984
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

string s;

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  int n;
  cin >> n;
  int sum = 0;
  for(int i=1;i<=n;i++){
    if(i%5==0||i%3==0);
    else sum+=i;
  }
  cout << sum << endl;


return 0;
}
///....


Measured memory_bytes: 3644
import math
N, K = map(int, input().split())
p = 0
if N >= K:
    p += (N - K + 1) / N
    
for i in range(1, min(N + 1, K)):
    n = math.ceil(math.log2(K / i))
    p_i = (1 / N) * (0.5 ** n)
    p += p_i

print(p)

Measured memory_bytes: 3060
import math
import fractions
#import sys
#input = sys.stdin.readline

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

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ZipArray(a):
    aa = [[a[i],i]for i in range(n)]

    aa.sort(key = lambda x : x[0])
    for i in range(n):
        aa[i][0]=i+1
    aa.sort(key = lambda x : x[1])
    b=[aa[i][0] for i in range(len(a))]
    return b

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans

def Zeros(a,b):
    if(b<=-1):
        return [0 for i in range(a)]
    else:
        return [[0 for i in range(b)] for i in range(a)]

class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i
            
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10**9 + 7
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

'''

#a = list(map(int, input().split()))

#################################################
#################################################
#################################################
#################################################



n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))
    
#
if(a[0]!=0):
    print(-1)
    exit()
#
now = 0
ans = 0
for i in range(1,n):
    if(a[i]<=a[i-1]):
        ans+=max(0,a[i]-1)
    if(a[i]>=1):
        ans+=1
    if(a[i]>a[i-1]+1):
        print(-1)
        exit()

print(ans)






































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

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

    vector<pair<int, int>> vec(M);

    for(int i=0; i<M; i++){
        int min, max;
        cin >> min >> max;

        vec[i] = make_pair(max, min);
    }

    sort(vec.begin(), vec.end());

    int ans = 0;
    int just_max;

    for(int i=0; i<M; i++){
        if(vec[i].second >= just_max || i==0){
            just_max = vec[i].first;
            ans++;
        }
    }

    cout << ans << endl;

}

Measured memory_bytes: 1024
n, k = map(int, input().split())

results = []
for i in range(1, n+1):
    if i >= k/2:
        results.extend([0.5 for _ in range(i, k)])
        results.extend([1 for _ in range(k, n+1)])
        break
    for j in range(1,k):
        if i * 2**j >= k:
            break
    results.append((0.5)**j)
print(sum(results)/n)

Measured memory_bytes: 4632
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int n = fs.nextInt();
        //finne antall ulike to tall som sammen kan ganges å bli lavere enn n
        int lowestCube = (int) Math.sqrt(n);
        int c = 0;
        var doubles = new ArrayList<Integer>();
        for (int i = 1; i<=n; i++) {
            for (int q = 1; q<=n; q++) {
                if (i==q) {
                    continue;
                }
                if (i*q<n) {
                    c++;
                } else {
                    break;
                }

            }
        }
        if (lowestCube*lowestCube == n) {
            System.out.println(c+lowestCube-1);
        } else {
            System.out.println(c+lowestCube);
        }

    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }

}



Measured memory_bytes: 32744
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
random_device rnd;
mt19937 mt(rnd());
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1000000007;
int main()
{
    string s;
    cin >> s;
    if (s[0] == '7' || s[1] == '7' || s[2] == '7')
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3600
s=input()
t=input()
ans=0
for i in range(len(s)-len(t)):
    u=0
    for a,b in zip(t,s[i:len(t)+i]):
        if a==b:u+=1
    ans=max(ans,u)  
if len(s)==len(t):
    for a,b in zip(t,s):
        if a==b:ans+=1    
print(len(t)-ans)

Measured memory_bytes: 9068
N = gets.to_i
C = N.times.map { gets.split.map(&:to_i) }

max_z = -Float::INFINITY
min_z = Float::INFINITY
max_w = -Float::INFINITY
min_w = Float::INFINITY

C.each do |x, y|
  z = x + y
  w = x - y

  max_z = z if max_z < z
  min_z = z if min_z > z
  max_w = w if max_w < w
  min_w = w if min_w > w
end

puts [max_z - min_z, max_w - min_w].max


Measured memory_bytes: 28272
fun main() {
    val (x, y) = readLine()!!.split(" ").map(String::toInt)
    val a = (4.0 * x - y) / 2
    val b = (-2.0 * x + y) / 2
    if (a * 10 % 10 == 0.0 && b * 10 % 10 == 0.0 && listOf(a, b).all { it >= 0 } && listOf(a, b).any { it >= 0 }) {
        println("Yes")
    } else {
        println("No")
    }
}


Measured memory_bytes: 38972
S = list(input())
T = list("keyence")
f = 0
b = 0
for i in range(len(S)):
  if S[i] != T[i]:
    f = i
    break
for i in range(len(S)):
  if S[-1*i] != T[-1*i]:
    b = -1*i+1
    break
U = S[:f] + S[b:]
a = -1
for i in range(1, len(U)):
  if U[i] == U[i-1]:
    a = i
if a != -1:
  del U[a]
if U == T:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 3064
n = int(input())
v = list(map(int, input().split()))
even = []
odd = []
for i in range(n):
  if i % 2 == 0: even.append(v[i])
  else: odd.append(v[i])
from collections import Counter
freq_even = sorted(Counter(even).items(), key=lambda x: x[1], reverse=True)
freq_odd = sorted(Counter(odd).items(), key=lambda x: x[1], reverse=True)
ans = 0
if freq_even[0][0] != freq_odd[0][0]:
  ans = n - freq_even[0][1] - freq_odd[0][1]
else:
  if len(freq_even) == 1 and len(freq_odd) == 1:
    ans = n // 2
  elif len(freq_even) == 1:
    ans = n - freq_odd[1][1]
  elif len(freq_odd) == 1:
    ans = n - freq_even[1][1]
  else:
    ans = n - freq_even[0][1] - max(freq_even[1][1], freq_odd[1][1])
print(ans)

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

int main(){
    int n;
    cin >> n;
    int ans = 0;
    int cnt;
    for(int i=n;i>=1;i--){
        cnt = 0;
        if(i%2 == 1){
            for(int j=i;j>=1;j--){
                if(i%j == 0){
                    cnt++;
                }
            }
            if(cnt == 8){
                ans++;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define ces(d) cout<<" "<<endl;

 
int main() {
	
	
	int N,M;
	vector<string> A(50);
	vector<string> B(50);
	cin>>N>>M;
	fx(N){
		cin>>A.at(x);
	}
	fx(M){
		cin>>B.at(x);
	}
	
	bool ans=false;
	
	for(int k=0;k<=N-M;k++){
		for(int i=0;i<=N-M;i++){
			if(A.at(k).at(i)==B.at(0).at(0)){
				bool check=true;
				fx(M){
					fy(M){
						
						if(A.at(k+x).at(i+y)!=B.at(x).at(y)){
							check=false;
							x=M;y=M;
						}
						
					}
				}
				
				if(check){
					ans=true;
					k=N;i=N;
				}
				
			}
		}
	}
	
	
	if(ans){
		ce("Yes")
	}else{
		ce("No")
	}
	
}


Measured memory_bytes: 256
import Control.Monad (replicateM)
import Data.List (partition,delete,(\\))

main = do
    [n,m] <- fmap read . words <$> getLine
    xs <-  fmap (fmap (read :: String -> Int) . words) <$> replicateM m getLine
    print $ length [ () | x <- xs, not $ connected n (delete x xs) ]

connected _ [] = False
connected n (z : zs) = connected' [z] zs [1 .. n]
    where
        connected' _  _ [] = True
        connected' [] _ _  = False
        connected' xs ys ns =
            let f x = any (`elem` x) (concat xs)
                (xs', ys') = partition f ys
            in  connected' xs' ys' (ns \\ concat xs)


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


#define fo(i, n) for(i=0; i<n; i++)
#define Fo(i, k, n) for(i=k; i<n; i++)
#define w(x)  int x; cin>>x; while(x--)
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n"

#define ll  long long
#define all(c) (c).begin(),(c).end()
#define endl "\n"

typedef vector<int> vl;
typedef vector< vl > vvl;
typedef pair< int, int> pll;
typedef map< int, int> mll;
void c_p_c()
{
#ifndef ONLINE_JUDGE
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
void parray(int a[],int n){
    for(int i=0;i<n;i++){
    cout<<a[i]<<" ";
    }
    cout<<endl;
}

int main() {
    int i,n,k;
    c_p_c();

    // cout<<"aa"<<endl;
    cin>>n;
    if(n<30)
    	cout<<"No"<<endl;
    else
    	cout<<"Yes"<<endl;
    return 0;
}


Measured memory_bytes: 3504
#include<iostream>
#include<vector>
using namespace std;
const int N=1e5+1;
int dp[N][3],fun[N][3];
int main(){
	int n,i,j,k;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>fun[i][0]>>fun[i][1]>>fun[i][2];
	}
	for(i=1;i<=n;i++){
		for(j=0;j<3;j++){
			for(k=0;k<3;k++){
				if(j!=k){
					dp[i][j]=max(dp[i][j],dp[i-1][k]+fun[i][j]);
				}
			}
		}
	}
	cout<<max(max(dp[n][0],dp[n][1]),dp[n][2]);
}


Measured memory_bytes: 2560