akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
 
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
 
using namespace std;
 
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
 
template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif
 
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
 
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N;
    cin >> N;
    vector<ll> A(N);
    vector<ll> cumsum_A(N);
    ll ans = 0;
    REP(i, N) {
        cin >> A[i];
        if (i == 0) {
            cumsum_A[i] = A[i];
        } else {
            cumsum_A[i] = A[i] + cumsum_A[i - 1];
        }
    }
 
    map<ll, ll> m;
    m[0]++;
    REP(i, N) { m[cumsum_A[i]]++; }
    debug(A, cumsum_A, m);
    auto begin = m.begin(), end = m.end();
    for (auto iter = begin; iter != end; iter++) {
        // first: key, second: value
        ans += ((iter->second) * (iter->second - 1)) / 2;
    }
    cout << ans << endl;
 
    return 0;
}

Measured memory_bytes: 15872
def main():
    n = int(input())
    count = 0
    for _ in range(n):
        a, b = [int(x) for x in input().split()]
        if a == b:
            count += 1
        else:
            count = 0

        if count >= 3:
            return 'Yes'
    return 'No'


if __name__ == '__main__':
    print(main())


Measured memory_bytes: 9104
#include<iostream>
using namespace std;
#define HMAX 500000

int parent(int i){
    return i/2;
}

int left(int i){
    return i*2;
}

int right(int i){
    return i*2+1;
}

void maxHeapify(int h[],int H,int i){
    int l,r,largest=i;
    l=left(i);
    r=right(i);
    if(l<=H&&h[l]>h[i]) largest=l;
    if(r<=H&&h[r]>h[largest]) largest=r;
    if(largest!=i){
        swap(h[i],h[largest]);
        maxHeapify(h,H,largest);
    }
}

int main(){
    int H,h[HMAX+1];
    cin>>H;
    for(int i=1;i<=H;i++) cin>>h[i];

    for(int i=H/2;i>=1;i--){
        maxHeapify(h,H,i);
    }
    for(int i=1;i<=H;i++){
        cout<<" "<<h[i];
    }
    cout<<endl;
}


Measured memory_bytes: 4952
#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)
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
????????????????????????????????? ??§?????§  
??????????????? ??§?????§ ???????´<_??? ?????? Welcome to My Coding Space!
???????????? ??? ?´_???`??????/??? ???i     
?????????????????????????????? ???  |???|     
????????? /?????? /??£??£??£??£/??????|  
??? ???_(__??????/???    ???/ .| .|????????????  
??? ????????????/????????????/??????u??????  
---------------------------------------------------------------------------------------------------*/




int N;
vector<int> E[5010];
int f[5010][5010];
int ma[5010];
//--------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;

    int ans = 0;
    rep(i, 1, N + 1) {
        int P; cin >> P;
        E[i].push_back(P);
        E[P].push_back(i);

        queue < tuple<int, int, vector<int>>> que;
        que.push(make_tuple( i, -1, vector<int>{i} ));
        vector<int> zouka = {i};
        while (!que.empty()) {
            int cu, pa; vector<int> v;
            tie(cu, pa, v) = que.front(); que.pop();

            if (0 < v.size() && v.size() % 2 == 0 && !ma[v.front()] && !ma[v.back()]) {
                zouka = v;
                break;
            }

            int type = 0;
            if (pa < 0) type = 1;
            else type = f[cu][pa];

            fore(to, E[cu]) if (pa != to && f[cu][to] != type) {
                v.push_back(to);
                que.push(make_tuple( to, cu, v ));
                v.pop_back();
            }
        }

        if (zouka.size() % 2 == 0 && !ma[zouka.front()] && !ma[zouka.back()]) {
            ans++;
            int n = zouka.size();
            rep(i, 0, n - 1) {
                int a = zouka[i], b = zouka[i + 1];
                //printf("%d -> ", f[a][b]);
                f[a][b] = 1 - f[a][b];
                f[b][a] = 1 - f[b][a];
            } //printf("\n");
            ma[zouka.front()] = 1;
            ma[zouka.back()] = 1;
        }

        printf("%d\n", ans);
    }
}

Measured memory_bytes: 26228
import java.util.*;

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

        result = A - (2 * B);
        if(result <= 0){
            result = 0;
        }
        System.out.println(result);
    }
}

Measured memory_bytes: 23636
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;

#define rep(i,x) for(ll i = 0 ; i < x ; i ++)
#define rep1(i,x) for(ll i = 1 ; i <= x ; i ++)
#define rrep(i,x) for(ll i = x-1 ; i >= 0 ; i --)
#define rrep1(i,x) for(ll i = x ; i > 0 ; i --)
#define sor(vec) sort(vec.begin(),vec.end())
#define rev(vec) reverse(vec.begin(),vec.end())
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define min_3(a,b,c) min(min(a,b),c)
#define max_3(a,b,c) max(max(a,b),c)
#define mp1(a,b,c) P1(a,P(b,c))
#define fr first
#define sc second
#define pb push_back

const int INF = 1000000000;
const int dir_4[4][2] = { {1,0} , {0,1} , {-1,0} , {0,-1} };

ll n;
vector<P> bio;

int f(int x){
	if(x > bio.size())return false;
	priority_queue<ll> que;
	ll sum = 0;
	rep(i,x){
		que.push( bio[i].sc );
		sum += bio[i].sc;
	}
	if(sum <= bio[x-1].fr * x)return true;
	for(int i = x; i < bio.size() ; i ++){
		que.push( bio[i].sc );
		sum += bio[i].sc;
		sum -= que.top();
		que.pop();
		if(sum <= bio[i].fr * x)return true;
	}
	return false;
}

int main(){
	scanf("%lld",&n);
	rep(i,n){
		ll a,b;
		scanf("%lld%lld",&a,&b);
		bio.pb ( P ( b , a ) );
	}
	sor(bio);
	rev(bio);
	
	ll l = 0,r = n;
	while(l < r){
		ll m = (l+r+1)/2;
		if(f(m))l = m;
		else r = m-1;
	}
	
	printf("%lld\n",l);
}

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

using namespace std;

int n,dem=0;
long long d;

void nhap()
{
    scanf("%d %lld",&n,&d);
    d=d*d;
    for (int i=1;i<=n;++i)
    {
        long long x,y;
        scanf("%lld %lld",&x,&y);
        long long k=x*x+y*y;
        dem+=(k<=d);
    }
    cout<<dem;
}

int main()
{
    nhap();
    return 0;
}


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

#define MOD 1000000007

using namespace std;
typedef unsigned long long ull;
typedef long long ll;


template <class T>
ostream &operator<<(ostream &o, const vector<T>&obj) {
    o << "["; for (int i = 0; i < (int)obj.size(); ++i) o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<vector<T>>&obj) {
    o << "[" << endl; for (int i = 0; i < (int)obj.size(); ++i) o << "  " << obj[i] << endl; o << "]"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U>&obj) {
    o << "(" << obj.first << ", " << obj.second << ")"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const multiset<T>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const queue<T>&obj) {
    queue<T> obj_cp = obj;
    bool first = true;
    o << "{";
    while (!obj_cp.empty()) { o << (!first ? ", " : "") << obj_cp.front(); obj_cp.pop(); first = false; }
    o << "}"; return o;
}

void print() {
    cout << "\n";
}
template<class Head, class... Body>
void print(Head head, Body... body) {
    cout << head << " ";
    print(body...);
}

int main(int argc, char const *argv[]) {
    ll N;
    cin >> N;

    ll n = N, i = 0;
    while (true) {
        ll r = n - pow(26, i);
        if (r < 0) break;
        n = r;
        i += 1;
    }

    // print(n, i);

    vector<int> v(i, 0);
    ll n_ = n;
    ll j = 0;
    while(n_ > 0) {
        v[j] = (n_ % 26);
        n_ /= 26;
        j += 1;
    }
    // print(v);

    string ans = "";
    for (int i = v.size()-1; i >= 0; --i) {
        ans += (v[i] + 'a');
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4076
#include <iostream>
#include <vector>
using namespace std;
int main(){
	int A, B, C, D;
    cin>> A >> B >> C >> D;
	int taka = 0;
  	int aoki = 0;
  	taka = C/B;
  	if(C%B != 0){
    	taka += 1;
    }
  	aoki = A/D;
  	if(A%D != 0){
    	aoki += 1;
    }
  	
  	if(taka<=aoki){
    	cout << "Yes";
    }else{
    	cout << "No";
    }
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
char enl = '\n';
#define rep(i, from, to) for (int i = from; i < (to); ++i)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<pair<int, int>> vii;

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

    int H, W, h, w;
    cin >> H >> W >> h >> w;

    if (W % w == 0 && H % h == 0) {
        cout << "No" << endl;
        return 0;
    }

    bool transpose = false;
    if (W % w == 0) {
        swap(h, w);
        swap(H, W);
        transpose = true;
    }

    vector<vi> grid(H, vi(W));

    int oo = 1e9-1;
    int noo = -1e9;
    int md = W % w;

    rep(i,0,H) {
        rep(j,0,W) {
            if (j % w == 0) {
                grid[i][j] = oo;
            }
            if (j % w == w-1) {
                grid[i][j] = noo;
            }
        }
    }

    cout << "Yes" << endl;

    if (!transpose) {
        rep(i,0,H) {
            rep(j,0,W) {
                cout << grid[i][j];
                if (j != W-1) cout << " ";
            }
            cout << endl;
        }
    } else {
        rep(j,0,W) {
            rep(i,0,H) {
                cout << grid[i][j];
                if (i != H-1) cout << " ";
            }
            cout << endl;
        }
    }
            


    return 0;
}


Measured memory_bytes: 3968
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void) {
	int num, i, sum = 0, buf, len;
	cin >> num;
	vector<int> d(num + 2, 0);
	for (i = 1; i < num + 1; i++)
		scanf("%d", &d[i]);
	for (i = 0; i < num + 1; i++)
		sum += abs(d[i] - d[i + 1]);
	buf = abs(d[0] - d[1]);
	for (i = 1; i < num + 1; i++) {
		len = abs(d[i] - d[i + 1]);
		printf("%d\n", sum - buf - len + abs(d[i - 1] - d[i + 1]));
		buf = len;
	}
	return 0;
}

Measured memory_bytes: 2172
#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main() {
	long h, w;
	cin >> h >> w;
	if (h == 1 || w == 1) {
		cout << 1;
		return 0;
	}
	else cout << (h * w + 1) / 2;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>
#include <set>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, pair<ll, ll>> PP;

const ll MOD = 1e9 + 7;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
#define ALL(x) (x).begin(),(x).end()
#define pb push_back
#define fr first
#define sc second



int main() {
	ll sum = 0;
	string s;
	cin >> s;
	for (int i = 0;i < s.size();i++) {
		sum += s[i] - '0';
	}
	cout << max(sum, (ll)(s[0] - '0' - 1 + (s.size() - 1) * 9)) << endl;
	return 0;
}


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

int main(void){
    long long int n, d, x, y, cnt=0;
    cin >> n >> d;
    for (int i=0; i<n; i++){
        cin >> x >> y;
        if (sqrt(x*x + y*y) <= d) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3676
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
using namespace std;
#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
const int inf = 0x3f3f3f3f;
typedef long long ll;
const int maxn = 100500;
const ll mod = 1e9 + 7;

int main() {
    IO;
    int n,m;
    cin>>n>>m;
    //miao a 
    vector<vector<int>> a(n+1);
    vector<int> in(n+1),dp(n+1);
    for(int i=1;i<=m;i++) {
        int u,v;
        cin>>u>>v;
        a[u].push_back(v);
        in[v]++;
    }
    queue<int> q;
    for(int i=1;i<=n;i++) {
        if(!in[i]) q.push(i);
    }
    while(!q.empty()) {
        int l=q.front();
        q.pop();
        for(int i=0;i<a[l].size();i++) {
            int dao=a[l][i];
            in[dao]--;
            if(!in[dao]) {
                dp[dao]=dp[l]+1;
                q.push(dao);
            }
        }
    }
    int ans=0;
    for(int i=1;i<=n;i++){
        ans=max(ans,dp[i]);
    }
    cout<<ans<<endl;
    
    return 0;
}


Measured memory_bytes: 9532
#include <stdio.h>

int aaa[101];
int bbb[101][101];

int main(){
  int i,j,k,atai,l,o;
  int www;
  
  scanf("%d",&atai);
   
  for(i=1;i<=atai;i++){
    scanf("%d %d",&aaa[i-1],&aaa[i]);
  }
  
  for(i=1;i<=atai;i++){
    bbb[i][i]=0;
  }
  
  for(k=2;k<=atai;k++){
    for(l=1;l<=atai-k+1;l++){
      j=k+l-1;
      bbb[l][j]=(1<<19);
      for(o=l;o<j;o++){
        www=bbb[l][o]+bbb[o+1][j]+ (aaa[l-1]*aaa[j]*aaa[o]);
	if(www<bbb[l][j]){
          bbb[l][j]=www;
        }
      }
    }
  }
  printf("%d",bbb[1][atai]);
  printf("\n");
  
  return 0;
}



Measured memory_bytes: 2112
while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)
    elif op == "?":
        break



Measured memory_bytes: 5596
#include<bits/stdc++.h>
using namespace std;
int t=0, i=0, ans=0, j=0, k=0, m=0, n=0, x=0, y=0, tn=0, ans1=0, min1=0;
int a[1000];
int main()
{
	cin>>x>>n;
	ans1=0;
	min1=10000;
	for(i=1;i<=100;i++)
	{
		a[i]=0;
	}
	for(i=0;i<n;i++)
	{
		cin>>tn;
		a[tn]=1;
	}
	for(i=0;i<=101;i++)
	{
		if(a[i]==0)
		{
			if(abs(i-x)<min1)
			{
				min1=abs(i-x);
				ans1=i;
			}
		}				
	}
	cout<<ans1;
}


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

const int N = 2e5 + 5;

int n, k;
long long a[N], fw[N];
vector<long long> vec;

void upd(int p,int v) {
	for (; p <= vec.size(); p += p & -p) fw[p] += v;
}

int get(int p) {
	int ret = 0;
	for (; p > 0; p -= p & -p) ret += fw[p];
	return ret;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin >> n >> k;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
		a[i] -= k;
	}
	int sum = 0;
	vec.push_back(0);
	for (int i = 1; i <= n; ++i) {
		a[i] += a[i - 1];
		vec.push_back(a[i]);
	}
	sort(vec.begin(), vec.end());
	vec.resize(unique(vec.begin(), vec.end()) - vec.begin());
	for (int i = 0; i <= n; ++i) {
		a[i] = lower_bound(vec.begin(), vec.end(), a[i]) - vec.begin() + 1;
	} 
	long long ans = 0;
	for (int i = 0; i <= n; ++i) {
		ans += get(a[i]);
		upd(a[i], 1);
	}
	cout << ans << '\n';
}

Measured memory_bytes: 5104
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
using namespace std;

int main(){
    int n;
    double sum = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        double x;
        string u;
        cin >> x >> u;
        if(u=="JPY")sum += x;
        else sum += x*380000;
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
// i_m_arin

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef priority_queue<ll> pqll;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef map<ll,ll> mpll;
typedef set<ll> stll;

#define f(i, a, n) 	for(ll i=a; i<(ll)n; i++)
#define f2(i, a, b) for(ll i=a; i<=(ll)b; i++)
#define pb 			push_back
#define ff 			first
#define ss 			second
#define pf			push_front
#define mp			make_pair
#define all(a)		(a).begin(),(a).end()
#define decimal(x)	fixed<<setprecision(x)
#define fsort(a)	sort(all(a))
#define rsort(a)	sort(all(a),greater<>())
#define fast_io		ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define mem0(a)		memset(a,0,sizeof(a))
#define mem1(a)		memset(a,-1,sizeof(a))
#define lcm(a,b)	(a*b)/__gcd(a,b)
#define ub(v,x)		upper_bound(all(v),x)-v.begin()
#define lb(v,x)		lower_bound(all(v),x)-v.begin()

const ld PI  = acos(-1);
const ll MOD = 1e9+7;
const ll INF = LLONG_MAX;
const ll SIZE= 100000;


void solve(){

ll n,x,t;
cin>>n>>x>>t;
ll div=n/(x);
ll rem= n%(x);
if(rem==0) {
	cout<<div*t<<endl;
}
else{
	cout<<div*t + t<<endl;
}

}


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

Measured memory_bytes: 3644
N, L = map(int, input().split())
arr = []
min = N+abs(L)
for i in range(1, N+1):
  if abs(L+i-1) < abs(min):
    min = L+i-1
  arr.append(L+i-1)

arr.remove(min)

print("{}".format(sum(arr)))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main() {
  int h, w; cin >> h >> w;
   for(int i = 1; i < h + 1; i++) {
    for(char c = 'A'; c < 'A' + w; c++) {
      string s; cin >> s;
      if(s == "snuke") cout << (char)c << i << endl;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using vs=vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define LINF    	((ll)1ll<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.141592653589793

template<class S,class T>ostream& operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	int a,b,d;
	cin>>a>>b;
	d=pow(100,a);
	if(b==100)cout<<101*d<<endl;
	else cout<<b*d<<endl;
	return 0;
}


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

using namespace std;

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

    int d1, d2;
    int count = 0;
    for(int i = 0; i < n; i++) {
        cin >> d1 >> d2;
        if(d1 == d2) {
            count++;
            if(count >= 3) {
                cout << "Yes" << endl;
                return 0;
            }
        }else {
            count = 0;
        }
    }

    cout << "No" << endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define mem(s,t) memset(s,t,sizeof(s))
#define pb(s) push_back(s)
#define inf 0x3f3f3f3f
#define mn 100010
typedef long long ll;
using namespace std;
char s[100];
int main()
{
	scanf("%s",s);
	int p=0;
	int l=strlen(s);
	bool ok=1;
	for(int i=0;i<l&&ok;++i){
		if(s[i]!='A'&&(p==0||p==4||p==6||p==8))++p;
		switch(s[i]){
			case 'A':
				if(p==0||p==4||p==6||p==8)++p;
				else ok=0;
				break;
			case 'K':
				if(p==1)++p;
				else ok=0;
				break;
			case 'I':
				if(p==2)++p;
				else ok=0;
				break;
			case 'H':
				if(p==3)++p;
				else ok=0;
				break;
			case 'B':
				if(p==5)++p;
				else ok=0;
				break;
			case 'R':
				if(p==7)++p;
				else ok=0;
				break;
			default:
				ok=0;
		}
	}
	if(p<8)ok=0;
	if(ok)printf("YES\n");
	else printf("NO\n");

    return 0;
}
//AKIHABARA

Measured memory_bytes: 256
N, M = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
E = [None] * M
for i in range(M):
    E[i] = [int(x) - 1 for x in input().split()]

Vbad = [0] * N
for i in range(M):
    # E[i][0]とE[i][1]をつなぐ道
    if H[E[i][0]] > H[E[i][1]]:
        Vbad[E[i][1]] += 1
    elif H[E[i][0]] < H[E[i][1]]:
        Vbad[E[i][0]] += 1
    else:
        Vbad[E[i][0]] += 1
        Vbad[E[i][1]] += 1

ans = 0
for j in range(N):
    if Vbad[j] == 0:
        ans += 1

print(ans)

Measured memory_bytes: 30492
#include <iostream>
#include <algorithm>

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

int main() {
    int n;
    std::string s[7] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    std::string a;
    std::cin >> a;
    REP(i, 7) {
        if (a == s[i]) n = i;
    }
        std::cout << 7 - n << std::endl;
    return 0;
}


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

int main(){

  string s;
  cin >> s;
  
  if(s[0] == s[1] && s[1] == s[2])
    cout << "Yes" << endl;
  else if(s[1] == s[2] && s[2] == s[3])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

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

using namespace std;
char sh[202000];
int n,i,j,c=0;
int main()
{
    scanf("%d",&n);
    scanf("%s",sh);
    for(i=0;sh[i]=='R'&&i<n;i++);
    for(j=n-1;sh[j]=='W'&&j>=0;j--);
    while(i<j)
    {
        i=i+1;
        for(;sh[i]=='R'&&i<n;i++);
        j=j-1;
        for(;sh[j]=='W'&&j>=0;j--);
        //printf("aaa%d %d\n",i,j);
        c++;
    }
    printf("%d",c);
    return 0;
}


Measured memory_bytes: 4004
def check(a, b):
  return((a+b)%2==0)
n, m = map(int, input().split())
x=sorted(list(range(1, 2*m+1, 2)) + list(range(2, 2*n+1, 2)))
c=0
for i in range(len(x)):
  for j in range(i+1, len(x)):
    if check(x[i], x[j]):
      c+=1
print(c)

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()
#define INF 1e9

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
	int r, g;
	cin >> r >> g;
	int ans = g * 2 - r;
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;

template<typename Mono,typename Ope>
struct LazySegmentTree{
    using F = function<Mono(Mono,Mono)>;
    using G = function<Mono(Mono,Ope)>;
    using H = function<Ope(Ope,Ope)>;
    int n,height;
    F f; G g; H h; Mono tu; Ope eu;
    vector<Mono> node;
    vector<Ope> lazy;

    LazySegmentTree(F f,G g,H h,Mono tu,Ope eu):f(f),g(g),h(h),tu(tu),eu(eu){}

    void init(vector<Mono> v){
        int n_ = (int)(v.size());
        n = 1;height = 0;
        while(n < n_) n <<= 1,++ height;
        node.assign(2*n,tu);
        lazy.assign(2*n,eu);
        for(int i=0;i<n_;i++) node[i+n] = v[i];
        for(int i=n-1;i>0;i--) node[i] = f(node[i<<1],node[i<<1|1]);
    }

    Mono eval(int k){
        return (lazy[k]==eu)?node[k]:g(node[k],lazy[k]);
    }

    void prop(int k){
        if(lazy[k]==eu) return;
        lazy[k<<1] = h(lazy[k<<1],lazy[k]);
        lazy[k<<1|1] = h(lazy[k<<1|1],lazy[k]);
        node[k] = eval(k);
        lazy[k] = eu;
    }

    void prop_above(int k){
        for(int i=height;i>0;i--) prop(k>>i);
    }

    void recalc_above(int k){
        while(k>0){
            k >>= 1;
            node[k] = f(eval(k<<1),eval(k<<1|1));
        }
    }

    void set_val(int k,Mono x){
        k += n;
        prop_above(k);
        node[k] = x;
        lazy[k] = eu;
        recalc_above(k);
    }

    void update(int l,int r,Ope x){
        if(l >= r) return;
        l += n;r += n-1;
        prop_above(l);
        prop_above(r);
        int a = l,b = r;
        ++ r;
        while(l < r){
            if(l&1) lazy[l] = h(lazy[l],x), ++l;
            if(r&1) --r, lazy[r] = h(lazy[r],x);
            l >>= 1;r >>= 1;
        }
        recalc_above(a);
        recalc_above(b);
    }

    Mono query(int l,int r){
        if(l >= r) return tu;
        l += n;r += n-1;
        prop_above(l);
        prop_above(r);++r;
        Mono vl = tu,vr = tu;
        while(l < r){
            if(l&1) vl = f(vl,eval(l)), ++l;
            if(r&1) --r, vr = f(eval(r),vr);
            l >>= 1;r >>= 1;
        }
        return f(vl,vr);
    }
};

int main(){
    auto f = [](pll a,pll b){return pll(a.first+b.first,a.second+b.second);};
    auto g = [](pll a,ll y){return pll(a.first+a.second*y,a.second);};
    auto h = [](ll x,ll y){return x+y;};
    LazySegmentTree<pll,ll> seg(f,g,h,pll(0,1),0);

    int n;
    cin >> n;
    vector<pll> a(n,pll(0,1));
    seg.init(a);

    int q;
    cin >> q;
    while(q--){
        int t;
        cin >> t;
        if(t==0){
            int l,r;
            ll x;
            cin >> l >> r >> x;
            --l;--r;
            seg.update(l,r+1,x);
        }else{
            int l,r;
            cin >> l >> r;
            --l;--r;
            cout << seg.query(l,r+1).first << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 12028
N, K, Q = map(int, input().split())
A = [int(a) for a in input().split()]

minSub = 10**10
for a in A:
    start = False
    end = 0
    subarray, newarray = [], []
    for i in range(N):
        if A[i] >= a:
            newarray.append(A[i])
            start = True
        else:
            if start:
                start = False
                if len(newarray) >= K:
                    newarray.sort()
                    for j in range(len(newarray) - K + 1):
                        subarray.append(newarray[j])
                newarray = []
    if len(newarray) >= K:
        newarray.sort()
        for j in range(len(newarray) - K + 1):
            subarray.append(newarray[j])
    if len(subarray) >= Q: 
        subarray.sort()
        minSub = min(minSub, subarray[Q-1] - a)
print(minSub)

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

int main(){
  bool  prime[100000];
  for(int i=0;i<100000;i++){
    prime[i]=true;
  }
  prime[0]=prime[1]=false;
  for(int i=2;i<=1000;i++){
    for(int j=i*2;j<100000;j+=i){
      prime[j]=false;
    }
  }
  int n;
  int cnt1,cnt2;
  while(cin>>n){
    for(int i=0;i<n;i++){
      if(prime[i])cnt1=i;
    }
    for(int i=n+1;;i++){
      if(prime[i]){
	cnt2=i;
	break;
      }
    }
    cout<<cnt1<<" "<<cnt2<<endl;
  }
  return 0;
}

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

typedef long long ll;
typedef std::pair <int, int> pr;
typedef std::map <int, int> map;
const int N = 100054;

int n, m, T;
ll x[N], f[N];
pr seg[N];
bool directed[N];

inline void down(ll &x, const ll y) {x > y ? x = y : 0;}
inline int reduced(ll x) {return x %= T, x += x >> 63 & T;}

namespace CTree {
	map C;

	void init() {C.emplace(0, -1), C.emplace(T, -1);}

	map::iterator split(int pos) {
		map::iterator it = C.lower_bound(pos), jt = it;
		return it->first == pos ? it : C.emplace_hint(it, pos, (--jt)->second);
	}

	void modify(int l, int r, int v) {
		map::iterator it = split(l), jt = split(r);
		C.erase(it, jt), C.emplace(l, v);
	}

	inline int query(int h) {return (--C.upper_bound(h))->second;}
}

int main() {
	int i, j, L, R; ll ans = LLONG_MAX;
	scanf("%d%d", &n, &T);
	for (i = 1; i <= n; ++i)
		if (scanf("%lld%d", x + i, &j), directed[i] = j & 1) {
			if (2 * x[i] > T) return puts("-1"), 0;
			x[i] += x[i - 1], seg[m++] = pr(L = reduced(-2 * x[i - 1]), R = reduced(-2 * x[i]));
		} else x[i] += x[i - 1];
	CTree::init();
	for (i = 0; i < m; ++i)
		std::tie(L, R) = seg[i], j = CTree::query(R),
		f[i] = (~j ? f[j] + reduced(R - seg[j].second) : 0),
		L <= R ? (CTree::modify(0, L, i), CTree::modify(R + 1, T, i)) : (CTree::modify(R + 1, L, i));
	for (const pr &e : CTree::C) {
		if (e.first >= T) continue;
		if (!~e.second) {ans = 0; break;}
		down(ans, f[e.second] + reduced(e.first - seg[e.second].second));
	}
	printf("%lld\n", ans + 2 * x[n]);
	return 0;
}

Measured memory_bytes: 11904
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>

using namespace std;

using P = pair<int, int>;

class UnionFind {
private:
    vector<int> par; // plus: parent node, minus: node size
    int group; // group count
public:
    UnionFind(int n) : par(n, -1), group(n) {}

    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if(x == y) return;
        if(-par[x] < -par[y]) std::swap(x, y);

        par[x] += par[y];
        par[y] = x;

        group--;
    }

    bool same(int x, int y)  {
        return find(x) == find(y);
    }

    int find(int x) {
        return par[x] < 0 ? x : par[x] = find(par[x]);
    }

    int size(int x){
        return -par[find(x)];
    }

    int count() {
        return group;
    }
};

struct edge {
    int from, to, cost;
};

int kruskal(int v, vector<edge> es) {
    std::sort(es.begin(), es.end(), [](edge& a, edge& b){
        return a.cost < b.cost;
    });

    UnionFind uf(v);

    int res = 0;
    for(auto& e : es) {
        if(uf.same(e.from, e.to)) continue;

        uf.unite(e.from, e.to);
        res += e.cost;
    }

    return res;
}


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

    vector<P> pos(N);
    for(auto& it : pos) {
        cin >> it.first >> it.second;
    }

    vector<int> cityx(N);
    vector<int> cityy(N);
    for(int i=0; i<N;i++){
        cityx[i] = i;
        cityy[i] = i;
    }    

    vector<edge> e;

    sort(cityx.begin(), cityx.end(), [&](int a, int b){
        return pos[a].first < pos[b].first;
    });

    for(int i=0; i<N-1; i++) e.push_back(edge{cityx[i], cityx[i+1], pos[cityx[i+1]].first - pos[cityx[i]].first});

    sort(cityy.begin(), cityy.end(), [&](int a, int b){
        return pos[a].second < pos[b].second;
    });

    for(int i=0; i<N-1; i++) e.push_back(edge{cityy[i], cityy[i+1], pos[cityy[i+1]].second - pos[cityy[i]].second});

    cout << kruskal(N, e) << endl;

    return 0;
}

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

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define RREP(i, n ,N) for(ll i = (N-1); i >= 0; i--)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
ll inf = 1e18;

ll a, b, N;
int main(){
	cin >> N;
	p(N/2-(N%2==0));
	return 0;
}

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

char getGrade(int m, int f, int r){
	int sum = m + f;
	char grade;
	if ( m == -1 || f == -1 ) {
		grade = 'F';
	} else if ( 80 <= sum ) {
		grade = 'A';
	} else if ( 65 <= sum && sum < 80 ){
		grade = 'B';
	} else if ( 50 <= sum && sum < 65 ){
		grade = 'C';
	} else if ( 30 <= sum && sum < 50 ){
		if( 50 <= r ) grade = 'C';
		else grade = 'D';
	} else if ( sum < 30 ){
		grade = 'F';
	}
	return grade;
}

int main(){
 int m, f, r;
 while(1){
	cin >> m >> f >> r;
	if ( m == -1 && f == -1 && r == -1 ) break;
	cout << getGrade(m, f,r) << endl;
	}

	return 0;
}


Measured memory_bytes: 3096
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CHalfAndHalf solver = new CHalfAndHalf();
        solver.solve(1, in, out);
        out.close();
    }

    static class CHalfAndHalf {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());
            int C = Integer.parseInt(in.next());
            int X = Integer.parseInt(in.next());
            int Y = Integer.parseInt(in.next());

            long ans = 1L << 60;
            for (int i = 0; i < 100001; i++) {
                ans = Math.min(ans, 2 * C * i + A * Math.max(0, X - i) + B * Math.max(0, Y - i));
            }
            out.println(ans);
        }

    }
}



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

int main() {
  int64_t A, B, m;
  cin >> A >> B >> m;
  vector<int64_t> as(A), bs(B);
  for (auto &&a : as) {
    cin >> a;
  }
  for (auto &&b : bs) {
    cin >> b;
  }
  vector<int64_t> xs(m), ys(m), cs(m);
  for (int64_t i = 0; i < m; i++) {
    cin >> xs[i] >> ys[i] >> cs[i];
    xs[i]--;
    ys[i]--;
  }
  
  int64_t ans = *min_element(as.begin(), as.end()) + *min_element(bs.begin(), bs.end());
  for (int64_t i = 0; i < m; i++) {
    ans = min(ans, as[xs[i]] + bs[ys[i]] - cs[i]);
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 4224
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

bool is_prime(int x) {
  auto n = static_cast<int>(sqrt(x)) + 1;
  if (x % 2 == 0 && x != 2) {
    return false;
  }
  for (int i = 3; i < n; i += 2) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

int main(int ac, char **av) {
  int n;
  while (cin >> n, n) {
    vector<int> a;
    for (int i = 0; i < n; i++) {
      int t;
      cin >> t;
      a.push_back(t);
    }
    auto count = 0;
    for (auto it = begin(a); it != end(a); it++) {
      count += is_prime(*it) ? 1 : 0;
    }
    cout << count << endl;
    n = 0;
  }
  return 0;
}

Measured memory_bytes: 3124
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef complex<double> xy_t;
const lint mod = 1e9 + 7;

int main(){
    string s;
    cin >> s;
    if(s == "atcoderregularcontest"){
        cout << "b" << endl;
        return 0;
    }
    int n = s.size();
    int Next[n+1][26], dp[n+1];
    rep(j, 26) Next[n][j] = n;
    rrep(i, n)rep(j, 26){
        Next[i][j] = Next[i+1][j];
        if(j == s[i]-'a') Next[i][j] = i;
    }
    dp[n] = 1;
    pair<char, int> p[n];
    rrep(i, n){
        dp[i] = n+1;
        rep(j, 26)if(dp[Next[i][j] + 1] + 1 < dp[i]){
            dp[i] = dp[Next[i][j] + 1] + 1;
            p[i] = make_pair('a'+j, Next[i][j] + 1);
        }
    }
    string ans = "";
    int cur = 0;
    while(cur < n){
        ans += p[cur].fi;
        cur = p[cur].se;
    }
    cout << ans << endl;
}

Measured memory_bytes: 23172
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // fixed, setprecision 
#include <math.h> // double sqrt
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
int main(){
    int n;
    int k;
    cin>>n>>k;
    vector<int>p(n);
    rep(i,n)cin>>p[i];
    sort(p.begin(), p.end());
    int sum=0;
    rep(i,k)sum+=p[i];
    cout<<sum;
    return 0;

}

Measured memory_bytes: 3160
#include<bits/stdc++.h>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ri(x) scanf("%d",&(x))
#define ri2(x,y) scanf("%d %d",&(x),&(y))
#define ri3(x,y,z) scanf("%d %d %d",&(x),&(y),&(z))
#define rll(x) scanf("%lld",&(x))
#define rll2(x,y) scanf("%lld %lld",&(x),&(y))
#define rll3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z))
#define gc(x) ((x) = getchar())
using namespace::std;

const long double PI = acos(-1);
const long long MOD = 1000000000 +7;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> tll;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<tll> vtll;
typedef vector<string> vs;
typedef set<int> si;
typedef set<ii> sii;
typedef set<iii> siii;

ll gcd(ll a, ll b){ return b==0?a:gcd(b,a%b);}

ll add(ll a, ll b, ll m = MOD){
	if(a >= m) a %= m;
	if(b >= m) b %= m;
	if(a < 0) a += m;
	if(b < 0) b += m;
	ll res = a+b;
	if(res >= m or res <= -m) res %= m;
	if(res < 0) res += m;
	return res;
}

ll mul(ll a, ll b, ll m = MOD){
	if(a >= m) a %= m;
	if(b >= m) b %= m;
	if(a < 0) a += m;
	if(b < 0) b += m;
	ll res = a*b;
	if(res >= m or res <= -m) res %= m;
	if(res < 0) res += m;
	return res;
}

ll pow_mod(ll a, ll b, ll m = MOD){
	ll res = 1LL;
	a = a%m;
	while(b){
		if(b&1) res = mul(res,a,m);
		b >>= 1;
		a = mul(a,a,m);
	}
	return res;
}

ll fastexp(ll a, ll b){
	ll res = 1LL;
	while(b){
		if(b&1) res = res*a;
		b >>= 1;
		a *= a;
	}
	return res;
}

int gcdExtendido(int a, int b, int *x, int *y){
	if(a == 0){
		*x = 0;
		*y = 1;
		return b;
	}
	int x1, y1;
	int gcd = gcdExtendido(b%a,a,&x1,&y1);
	
	*x = y1-(b/a)*x1;
	*y = x1;
	return gcd;
}

int modInverso(int a, int m){
	int x, y;
	int g = gcdExtendido(a,m,&x,&y);
	if(g!=1) return -1;
	else return (x%m + m)%m;
}

/****************************************
*************P*L*A*N*T*I*L*L*A************
*****************************************/

const int N = 50+5;

ll k;
int n = 50;
ll a[N];

int main(){
	rll(k);
	int r = k % n;
	for(int i=0; i<n; i++){
		a[i] += i;
	}
	for(int i=0; i<r; i++){
		a[n-1-i] = n;
	}
	for(int i=0; i<n; i++){
		a[i] += (k / n);
	}
	printf("%d\n",n);
	for(int i=0; i<n; i++){
		printf("%lld%c",a[i]," \n"[i+1==n]);
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma warning(disable:4996)
#ifdef _MSC_VER
#  define __builtin_popcount __builtin_popcountll
#  define __builtin_popcountll __popcnt
#endif
#define int long long
using namespace std;
using ll = long long;
using ld = long double;
const long double PI = acos(-1.0);
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
inline void my_io() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::cout << fixed << setprecision(10);
}
int n, m, c;
vector<int>b(m);
int myfunction(vector<int>a) {
	int m = a.size();
	int value = c;
	for (int i = 0; i < m; i++) {
		value += b[i] * a[i];
	}
	return value;
}
signed main() {
	my_io();
	
	cin >> n >> m >> c;
	b.resize(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}
	vector<vector<int>>a(n, vector<int>(m));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}
	int count = 0;
	for (int i = 0; i < n; i++) {
		if (myfunction(a[i]) > 0) {
			count++;
		}
	}
	cout << count << endl;
}

Measured memory_bytes: 256
N=int(input())
lst=[0 for f in range(N)]
for i in range(N):
 lst[i]= list(map(int,input().split()))
lst.sort(key=lambda x: x[2], reverse=True)
for i in range(101):
 for j in range(101):
  h=abs(i-lst[0][0])+abs(j-lst[0][1])+lst[0][2]
  if h==10**9 and N==1:
   ans=[lst[0][0],lst[0][1],lst[0][2]]
  else:
   t=0
   for k in range(N-1):
    if max(h-abs(i-lst[k+1][0])-abs(j-lst[k+1][1]),0)==lst[k+1][2]:
     t+=1
   if t==N-1:
    ans=[i,j,h]
print(*ans)


Measured memory_bytes: 3064
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

int W, H;
vector<string> field;
vector<vector<string>> memo;

int dh[] = {0, 1};
int dw[] = {1, 0};

inline bool is_digit(char &c){
    return '0'<=c && c<='9';
}

bool less_as_int(string &l, string &r){
    if(l.length() != r.length())
        return l.length() < r.length();
    return l < r;
}

string dfs(int h, int w){
    if(memo[h][w] != "")
        return memo[h][w];
    
    string ret = "";
    
    for(int di=0; di<2; di++){
        int nh = h + dh[di];
        int nw = w + dw[di];
        if(0<=nh && nh<H && 0<=nw && nw<W && is_digit(field[nh][nw])){
            string t = dfs(nh, nw);
            if(less_as_int(ret, t))
                ret = t;
        }
    }
    return memo[h][w] = field[h][w] + ret;
}

void solve(){
    string ans = "";
    
    for(int h=0; h<H; h++)
        for(int w=0; w<W; w++)
            if(is_digit(field[h][w]) && field[h][w]!='0'){
                string t = dfs(h, w);
                if(less_as_int(ans, t))
                    ans = t;
            }
    cout << ans << endl;
}

//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    while(cin>>W>>H, W|H){
        field = vector<string>(H);
        memo = vector<vector<string>>(H, vector<string>(W, ""));
        for(auto &r: field)
            cin >> r;
        
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 1356
import sys
import numpy as np
from collections import defaultdict

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
A = np.array([1] + lr())
A = (A-1) % K
N += 1
Acum = A.cumsum() % K
d = defaultdict(int)
answer = 0
for i, x in enumerate(Acum):
    answer += d[x]
    d[x] += 1
    if i >= K-1:
        d[Acum[i-(K-1)]] -= 1

print(answer)


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

int main()
{
	set<string> s;
	string str;
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>str;
	    s.insert(str);
    }
    cout<<s.size()<<endl;
	
	return 0;
}

Measured memory_bytes: 19184
while True:
    a,b = map(int,input().split())
    if a==0 and b==0:
        break
    for i in range(a):
        for j in range(b):
            if (i+j)%2 == 0:
                print("#",end="")
            else:
                print(".",end="")
        print()
    print()


Measured memory_bytes: 7000
#include <iostream>
using namespace std;
long long dp[11][1010];

int main(){
    dp[0][0] = 1;
    for(int i = 0;i <= 100;i++)
        for(int j = 9;j >= 0;j--)
            for(int k = 0;k <= 1000-i;k++)
                dp[j+1][k+i] += dp[j][k];
    int n, s;
    while(cin >> n >> s, n | s)cout << dp[n][s] << endl;
    return 0;
}

Measured memory_bytes: 3204
S = input()

MOD = 10 ** 9 + 7

dp = [0] * 13
dp[0] = 1
for i in range(len(S)):
    new_dp = [0] * 13
    if S[i] == '?':
        for j in range(10):
            for k in range(13):
                new_dp[(k * 10 + j) % 13] += dp[k]
                new_dp[(k * 10 + j) % 13] %= MOD
    else:
        j = int(S[i])
        for k in range(13):
            new_dp[(k * 10 + j) % 13] += dp[k]
            new_dp[(k * 10 + j) % 13] %= MOD
    dp = new_dp[:]
print(dp[5])


Measured memory_bytes: 43116
#include<stdio.h>
int main(void){
  int bingo[3][3],i,j,k,l;
  for(i=0;i<3;i++){
    for(j=0;j<3;j++){
      scanf("%d",&bingo[i][j]);
    }
  }
  scanf("%d",&l);
  int num[l];
  for(i=0;i<l;i++){
    scanf("%d",&num[i]);
  }
  for(i=0;i<3;i++){
    for(j=0;j<3;j++){
      for(k=0;k<l;k++){
        if(bingo[i][j]==num[k]){
          bingo[i][j]=-1;
        }
      }
    }
  }
  for(i=0;i<3;i++){
    if(bingo[0][i]==-1){
      if(bingo[1][i]==-1&&bingo[2][i]==-1){
        printf("Yes");
        return 0;
      }
    }
    if(bingo[i][0]==-1){
      if(bingo[i][1]==-1&&bingo[i][2]==-1){
        printf("Yes");
        return 0;
      }
    }
  }
  if(bingo[1][1]==-1){
    if(bingo[0][0]==-1&&bingo[2][2]==-1){
      printf("Yes");
      return 0;
    }else if(bingo[0][2]==-1&&bingo[2][0]==-1){
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}

Measured memory_bytes: 128