akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

vector<int>G;
int cnt;

void insertionSort(int A[], int n, int g) {
  for(int i = g; i < n; i++) {
    int v = A[i];
    int j = i - g;
    while( j >= 0 && A[j] > v) {
      A[j + g] = A[j];
      j -= g;
      cnt++;
    }
    A[j + g] = v;
  }
}

void shellSort(int A[], int n) {
  int h = 1;
  while(true) {
    if(h > n) break;
    G.push_back(h);
    h = 3*h +1;
  }

  for(int i = G.size() - 1; i >=0; i--) {
    insertionSort(A, n, G[i]);
  }
}


int main() {
  int A[1000000], n;
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin>>A[i];
  }

  cnt = 0;

  shellSort(A, n);

  cout<<G.size() <<endl;
  for (int i = G.size() - 1; i >= 0; i--) {
    cout<<G[i];
    if(i) cout<<" ";
  }
  cout<<endl<<cnt<<endl;
  for(int i = 0; i < n; i++) {
    cout<<A[i]<<endl;
  }

  return 0;
}



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

int main(void) {
    int N; cin >> N;
    int ans = 0;
    map<string,int> mp;
    rep(i,N) {
        string s; cin >> s;
        mp[s]++;
    }
    for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
        if(itr->second>0) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 19060
#include<iostream>

using namespace std;

int main(){
	int n;
  
 	cin>>n;
  
  switch(n%10){
    case 0:
    case 1:
    case 6:
    case 8:
      cout<<"pon"<<endl;
      break;
      
    case 2:
    case 4:
    case 5:
    case 7:
    case 9:
      cout<<"hon"<<endl;
      break;
      
    case 3:
      cout<<"bon"<<endl;
      break;
      
  }

}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int n,k;
    long long int mod=1000000007;
   cin>>n>>k;
     int arr[n],str[n];
     long long int sum[n];
      for(int i=0;i<n;i++)
      {
         cin>>arr[i];
          str[i]=arr[i];
      }
    sort(str,str+n);
      long long int total=0;
      for(int i=0;i<n;i++)
      {
          int count=0;
          for(int j=0;j<i;j++)
            {  if(str[j] < str[i])
              count++;}

           sum[i]=count;
      }
         for(int i=0;i<n;i++)
          {
             long long int count=0;
             for(int j=i+1;j<n;j++)
              if(arr[i] > arr[j])
              count++;

               count=count*k;
               total=total+count;
          }

       for(int i=0;i<n;i++)
        {
             long long int r=k*(k-1)/2;
              long long int x=((sum[i]%mod)*(r%mod))%mod;
            total=(total+x)%mod;
        }

    cout<<total;
}


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

int H, W;

int main(){
	while(1){
		scanf("%d %d", &H, &W);
		if(H == 0 && W == 0){
			break;
		}else{
			for(int i=0; i<H; ++i){
				for(int j=0; j<W; ++j){
					if(i%2 ==0 && j%2 == 0){
						printf("#");
					}else if(i%2 == 0 && j%2 == 1){
						printf(".");
					}else if(i%2 == 1 && j%2 == 0){
						printf(".");
					}else if(i%2 == 1 && j%2 == 1){
						printf("#");
					}
				}
				printf("\n");
			}
			printf("\n");
		}
	}
}


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

using namespace std; //ごめんなさい
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define rep(i,N) for(int i=0;i<N;i++)

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

  int H,W;
  cin>>H>>W;
  vector<string>s(H);
  for(int i=0;i<H;i++)cin>>s[i];
  vector<vector<ll>>a(H,vector<ll>(W,0));
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(s[i][j]=='.'){
        if(j-1>=0)a[i][j]=a[i][j-1]+1;
        else a[i][j]=1;
      }
    }
    ll Max=0;
    for(int j=W-1;j>=0;j--){
      if(a[i][j]==0)Max=0;
      else Max=max(a[i][j],Max);
      a[i][j]=Max;
    }
  }
  vector<vector<ll>>ans=a;
  for(int i=0;i<H;i++)for(int j=0;j<W;j++)a[i][j]=0;
  for(int j=0;j<W;j++){
    for(int i=0;i<H;i++){
      if(s[i][j]=='.'){
        if(i-1>=0)a[i][j]=a[i-1][j]+1;
        else a[i][j]=1;
      }
    }
    ll Max=0;
    for(int i=H-1;i>=0;i--){
      if(a[i][j]==0)Max=0;
      else Max=max(a[i][j],Max);
      a[i][j]=Max;
    }
  }
  for(int i=0;i<H;i++)for(int j=0;j<W;j++)ans[i][j]+=a[i][j];
  ll res=0;
  for(auto it:ans){
    for(auto it2:it)res=max(res,it2-1);
  }
  cout<<res<<endl;
  return 0;
}


Measured memory_bytes: 67200
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
int fact[2000003];
int pow(int x,int n){
    int tmp=1;
    while(n){
        if(n&1)
            tmp=tmp*x%mod;
        x=x*x%mod;
        n>>=1;
    }
    return tmp;
}
int f(int r,int c){
    return fact[r+c]*pow(fact[r]*fact[c]%mod,mod-2)%mod;
}
signed main(){
    int r1,c1,r2,c2;
    cin>>r1>>c1>>r2>>c2;
    r2++,c2++;
    fact[0]=1;
    for(int i=1;i<=2000002;i++)
        fact[i]=i*fact[i-1]%mod;
    cout<<(f(r1,c1)-f(r1,c2)-f(r2,c1)+f(r2,c2)+mod*2)%mod<<endl;
}


Measured memory_bytes: 15872
import java.util.Scanner;
public class Main {
 
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    
	    int A,B,C;
	    
	    A=sc.nextInt();
	    B=sc.nextInt();
	    C=sc.nextInt();
	    
	    if((A<C&&C<B)||(A>C&&C>B)) {
	    	System.out.println("Yes");
	    }else {
	    	System.out.println("No");
	    }
	    
	    
	}
 
}

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

using namespace std;

typedef long double ld;
typedef long long ll;

#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define f first
#define s second

template<typename T, typename U> bool ckmin(T &a, U b){ return b < a ? a = b, true : false; }
template<typename T, typename U> bool ckmax(T &a, U b){ return b > a ? a = b, true : false; }

const ll MOD = 1e9 + 7;

ll n, m, res;
vector<ll> fac;

ll exp(ll a, ll n){
    if(n == 0) return 1;
    ll tmp = exp(a, n/2);
    tmp *= tmp;
    tmp %= MOD;
    if(n%2) tmp *= a;
    tmp %= MOD;
    return tmp;
}

ll inv(ll x){
    return exp(x, MOD - 2);
}

ll cmb(ll c, ll k){
    if(k > c) return 0;
    ll t = inv(fac[c - k]) * inv(fac[k]);
    t %= MOD;
    t *= fac[c];
    t %= MOD;
    return t;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m;
    fac.assign(5e5 + 5, 1);
    for(int i = 1; i < 5e5 + 5; ++i){
        fac[i] = fac[i - 1] * i;
        fac[i] %= MOD;
    }
    ll oth = cmb(m, n) * fac[n]; oth %= MOD;
    for(int i = 1; i <= n; ++i){
        ll tmp = cmb(n, i) * ((cmb(m - i, n - i) * fac[n - i])%MOD);
        tmp %= MOD;
        if(i%2) oth -= tmp;
        else oth += tmp;
        oth = ((oth%MOD) + MOD)%MOD;
    }
    res = (oth * ((cmb(m, n) * fac[n])%MOD))%MOD;
    cout << res;
    return 0;
}

Measured memory_bytes: 7128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int main(){
	while(1){
		int h;
		cin >> h; if(h == 0) return 0;
		vector<int>x[5];
		for(int i=0;i<h;i++){
			for(int j=0;j<5;j++){
				int a; cin >> a; x[j].pb(a);
			}
		}
		rep(i,5) reverse(x[i].begin(),x[i].end());
		int ret = 0;
		while(1){
			bool upd = 0;
			for(int i=0;i<h;i++){
				for(int j=0;j<3;j++){
					if(x[j].size() <= i || x[j+1].size() <= i || x[j+2].size() <= i) continue;
					if(x[j][i] == x[j+1][i] && x[j+1][i] == x[j+2][i]){
					    bool ok = 0;
						if(j+3<5 && x[j+3].size() > i && x[j+3][i] == x[j][i]){
							ret += x[j][i];
							x[j+3][i] = -1;
							ok = 1;
						}
						if(ok && j+4<5 && x[j+4].size() > i && x[j+4][i] == x[j][i]){
							ret += x[j][i];
							x[j+4][i] = -1;
						}
						ret += 3*x[j][i];
						x[j][i] = -1;
						x[j+1][i] = -1;
						x[j+2][i] = -1;
						//ret += 3*x[j][i];
						upd = 1;
						break;
					}
				}
			}
			vector<int>y[5];
			for(int i=0;i<5;i++){
				for(int j=0;j<x[i].size();j++){
					if(x[i][j] != -1) y[i].pb(x[i][j]);
				}
				x[i] = y[i];
			}
			//if(h==5)for(int i=0;i<5;i++) cout << x[i][0] << endl;
			if(!upd) break;
		}
		cout << ret << endl;
	}
}

Measured memory_bytes: 3108
n, k, c = map(int, input().split())
s = list(input())

l = [0 for _ in range(n + 1)]
prev = -c
for i in range(1, n + 1):
    l[i] = l[i - 1]
    if prev + c < i and s[i - 1] == 'o':
        l[i] += 1
        prev = i
r = [0 for _ in range(n + 1)]
prev = n + c
for i in range(n - 1, -1, -1):
    r[i] = r[i + 1]
    if i < prev - c and s[i] == 'o':
        r[i] += 1
        prev = i
cnt = [1 if c == 'o' else 0 for c in s]
for i in range(n):
    if 0 < i - c:
        cnt[i] += l[i - c]
    if i + c + 1 < n + 1:
        cnt[i] += r[i + c + 1]
ans = [s[i] == 'o' and cnt[i] == k for i in range(n)]
prev = -c - 1
for i in range(n):
    if s[i] == 'o' and cnt[i] == k:
        if i <= prev + c:
            ans[i] = False
        prev = i
prev = n + c + 1
for i in range(n - 1, -1, -1):
    if s[i] == 'o' and cnt[i] == k:
        if prev - c <= i:
            ans[i] = False
        prev = i
for i in range(n):
    if ans[i]:
        print(i + 1)

Measured memory_bytes: 71112
#include <iostream>
#include <string>
using namespace std;
int main() {
    string s; cin >> s;
    for (int i=0; i<(int)s.size(); ++i) {
        cout << (s[i]-3 >= 'A' ? (char)(s[i]-3) : (char)(s[i]+23));
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1176
#include <cstdio>

using namespace std;

int main()
{
    int times = 7;
    while( times > 0 )
    {
        int a,b;
        scanf( "%d %d\n", &a, &b );
        printf( "%d\n", a - b );
        times--;
    }
    return 0;
}


Measured memory_bytes: 2736
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT false

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == 1)return;for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(std::vector<T>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}


void solve(void)
{ 
  int H,W;
  cin>>H>>W;
  int N = 10;
  vector<vector<int> > GRAPH(N,vector<int>(N));
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < N; j++)
    {
      cin>>GRAPH[i][j];
    }
  }
  for (int k = 0; k < N; k++)
  {
    for (int i = 0; i < N; i++)
    {
      for (int j = 0; j < N; j++)
      {
        if(GRAPH[i][j] > GRAPH[i][k] + GRAPH[k][j])
        {
          GRAPH[i][j] =  GRAPH[i][k] + GRAPH[k][j];
        }
      }
      
    }
    
  }
  
  vector<vector<int> > DATA(H,vector<int>(H));
  int ANS = 0;
  for (int h = 0; h < H; h++)
  {
    for (int w = 0; w < W; w++)
    {
      int A;
      cin>>A;
      if((A + 1)*(A-1) != 0)
      {
        ANS += GRAPH[A][1];
      }
    }
    
    
  }
  
  cout<<ANS<<endl;
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 640
n = int(input())
t = list(map(float, input().split()))
v = list(map(float, input().split()))

for i in range(n):
    t[i] *= 2.0
    v[i] *= 2.0

v.append(0.0)

for i in range(n - 1, -1, -1):
    v[i] = min(v[i], v[i + 1] + t[i])

for i in range(1, n):
    t[i] += t[i - 1]

ans = 0.0
speed = 0.0
k = 0
st = int(t[n - 1] + 0.1)

for i in range(st):
    if i >= t[k]:
        k += 1
    
    ans += speed

    limit = min(v[k], v[k + 1] + t[k] - i - 1)
    if speed < limit:
        ans += 0.5
        speed += 1.0
    elif speed > limit:
        ans -= 0.5
        speed -= 1.0

ans /= 4.0

print(ans)

Measured memory_bytes: 9188
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in1(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define inN(x, N) rep(i, N) in1(x[i])
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());

    int N;
    in1(N);

    vll h(N);
    inN(h, N);

    ll ans = 0;

    int i = 0;
    while (i < N)
    {
        if (h[i] == 0)
        {
            i++;
            continue;
        }

        ll minh = h[i];
        int j;

        for (j = i + 1; j < N; j++)
        {
            if (h[j] == 0) break;
            chmin(minh, h[j]);
        }

        reps(k, i, j)
        {
            h[k] -= minh;
        }

        ans += minh;
    }

    outl(ans);

    return 0;
}


Measured memory_bytes: 3668
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			s = 500 * i + 100*j + 50*k
			if s == x:
				cnt += 1
print (cnt)


Measured memory_bytes: 2940
def main():
    N = int(input())
    otoshidama_list =  [input() for i in range(N)]

    total_price = 0
    for otoshidama in otoshidama_list:
        amount,currency =  map(str, otoshidama.split())
        amount = float(amount)
        if currency == 'BTC':
            amount = amount * 380000
        total_price += amount
    
    print(total_price)

if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
def main():
  S = str(input())
  
  Hi_S = []
  ex = ''
  for i in range(5):
    ex += 'hi'
    Hi_S.append(ex)

  for i in Hi_S:
    if S == i:
      print('Yes')
      exit()
    else:
      pass

  print('No')

if __name__ == "__main__":
  main()

Measured memory_bytes: 2940
#include <iostream>
#include <cmath>
#include <algorithm>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long int ll; 

ll F(ll a, ll b){
    int ketaa=0, ketab=0;
    while(a){
	a=(a-(a%10))/10;
	ketaa++;
    }
    while(b){
	b=(b-(b%10))/10;
	ketab++;
    }
    return max(ketaa, ketab);
}

int main(){
    ll n;   cin >> n;
    ll ans=10000000000;
    for(ll b = 1; b <= sqrt(n); b++){
	if(n%b==0){
	    ll a = n/b;
	    ans = min(ans, F(a, b));
	}
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Remoting.Contexts;
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;

namespace Contest
{
    class Program
    {
        private Scanner sc;
        private int N;
        private int[] A;
        public void Solve()
        {
            sc = new Scanner();
            N = sc.NextInt();
            A = sc.IntArray();
            var s = 0L;
            for (int i = 0; i < N - 1; i++)
            {
                s += (i % 2 == 0 ? 1 : -1) * A[i];
            }

            // A[N-1] = (ans[0] + ans[N-1])/2
            // s = (ans[0] - ans[N-1])/2

            var ans = new long[N];
            ans[0] = s + A[N - 1];
            for (int i = 1; i < N; i++)
            {
                ans[i] = A[i - 1] * 2 - ans[i - 1];
            }
            Console.WriteLine(string.Join(" ", ans));
        }

        static void Main() => new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _stream = new StreamReader(Console.OpenStandardInput());
        _pos = 0;
        _line = new string[0];
        _separator = ' ';
    }
    private readonly char _separator;
    private readonly StreamReader _stream;
    private int _pos;
    private string[] _line;
    #region get a element
    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = _stream.ReadLine().Split(_separator);
            _pos = 0;
        }
        return _line[_pos++];
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    #endregion
    #region convert array
    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }
    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }
    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }
    #endregion
    #region get array
    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = _stream.ReadLine().Split(_separator);
        _pos = _line.Length;
        return _line;
    }
    public int[] IntArray()
    {
        return ToIntArray(Array());
    }
    public long[] LongArray()
    {
        return ToLongArray(Array());
    }
    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }
    #endregion
}

Measured memory_bytes: 29668
D,G=map(int,input().split())
G=G//100
p=[]
c=[]
for i in range(D):
    pp,cc=map(int,input().split())
    p.append(pp)
    c.append(cc//100)

ans=float("INF")
for i in range(1<<D):
    cnt=0
    toku=0
    for j in range(D):
        if 1&i>>j:
            toku+=p[j]*(j+1)+c[j]
            cnt+=p[j]
    #print(i,toku,cnt)
    if toku>=G:
        ans=min(ans,cnt)
        #sprint(i,toku,cnt)
    else:
        for j in range(D-1,-1,-1):
            if 1&i>>j:
                continue
            for k in range(p[j]-1):
                toku+=j+1
                cnt+=1
                if toku>=G:
                    ans=min(ans,cnt)
print(ans)


Measured memory_bytes: 42096
#include<stdio.h>
#include<stdlib.h>

int main(){
  int n,i,vv;
  scanf("%d",&n);
  int v[n],c[n];
  for(i=0;i<n;i++){
    scanf("%d",&v[i]);
  }
  for(i=0;i<n;i++){
    scanf("%d",&c[i]);
  }
  vv=0;
  for(i=0;i<n;i++){
    if(v[i]-c[i]>=0){
      vv+=(v[i]-c[i]);
    }
  }
 printf("%d\n",abs(vv));
 return 0;
}

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

typedef long long ll;
const long long LINF = 1LL << 60;
const long long LMINF = 1LL << 63;
const int INF = 1 << 30;

#define REP(i,n) for(int i = 0;i < n;++i)
#define REPS(i,x) for(int i = 1;i <= (int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i >= 0;i--)
#define RREPS(i,x) for(int i=((int)(x));i > 0;i--)
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << ": " << x << "\n"

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}



int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int n;
    cin >> n;
    int mans = -1;
    int max = -1;
    REPS(i,n){
        int cnt = 0;
        for(int j = i;j != 1;){
            if(j % 2 == 0){
                j /= 2;
                cnt++;
            }else{
                break;
            }
        }
        if(mans <= cnt){
            mans = cnt;
            max = i;
        }
    }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e8;

signed
main(){
		int a,b,c;
		cin >> a >> b >> c;
		int ans = MAX;

		for(int k=0;k<a+b;k++)
		{
				for(int t=0;t<c;t++)
				{
						if(k*(a+b) <= c+60*t && c+60*t <= k*(a+b) + a)
						{
								ans = min(ans, c+60*t);
						}
				}
		}
		if(ans == MAX)
		{
				cout << -1 << endl;
		}else
		{
				cout << ans << endl;
		}
}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define db double
#define pint pair<int,ll>
#define mk make_pair
#define pb push_back
#define eb emplace_back
#define ins insert
#define fi first
#define se second
#define Rep(x,y,z) for(int x=y;x<=z;x++)
#define Red(x,y,z) for(int x=y;x>=z;x--)
using namespace std;
char buf[1<<12],*pp1=buf,*pp2=buf,nc;int ny;
inline char gc() {return pp1==pp2&&(pp2=(pp1=buf)+fread(buf,1,1<<12,stdin),pp1==pp2)?EOF:*pp1++;}
//inline char gc(){return getchar();}
inline int read(){
	int x=0;for(ny=1;nc=gc(),(nc<48||nc>57)&&nc!=EOF;)if(nc==45)ny=-1;if(nc<0)return nc;
	for(x=nc-48;nc=gc(),47<nc&&nc<58&&nc!=EOF;x=(x<<3)+(x<<1)+(nc^48));return x*ny;
}
int a,b;
int main(){
//	freopen("std.in","r",stdin);
//	freopen("std.out","w",stdout);
	a=read(),b=read();
	if(a>0)puts("Positive");
	else if(a<=0){
		if(b<0)puts(((b-a)&1?"Positive":"Negative"));
		else puts("Zero");
	}
	return 0;
}




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

int main() {
  int N, P;
  string S;
  cin >> N >> P >> S;
  reverse(S.begin(), S.end());
  
  if (10 % P == 0) {
    long ans = 0;
    for (int i = 0; i < N; i++) {
      if ((S.at(i) - '0') % P == 0) ans += N - i;
    }
    return cout << ans << "\n", 0;
  }
  
  int dig = 1, sum = 0;
  map<int, int> MA;
  MA[0]++;
  for (int i = 0; i < N; i++) {
    (sum += (S.at(i) - '0') * dig) %= P;
    (dig *= 10) %= P;
    MA[sum]++;
  }
  long ans = 0;
  for (auto ma : MA) ans += (long) ma.second * (ma.second - 1) / 2;
  cout << ans << "\n";
}

Measured memory_bytes: 900
import java.util.Scanner;

public class Main {
    private static final int MOD = 1_000_000_007;
    private static final String YES = "Yes";
    private static final String NO = "No";

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();

        System.out.println(solve(a, b));
    }

    private static String solve(int a, int b) {
        String ans = "";

        if (a < b) {
            for (int i=0; i<b; i++) {
                ans += a;
            }
        } else {
            for (int i=0; i<a; i++) {
                ans += b;
            }
        }

        return ans;
    }
}

Measured memory_bytes: 21716
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var h1 = int.Parse(line[0]);
        var m1 = int.Parse(line[1]);
        var h2 = int.Parse(line[2]);
        var m2 = int.Parse(line[3]);
        var k = int.Parse(line[4]);
        Console.WriteLine(h2 * 60 + m2 - h1 * 60 - m1 - k);
    }
}

Measured memory_bytes: 27436
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long t = sc.nextLong();
        long[] tt = new long[n];
        long sum = 0l;
        for (int i = 0; i < tt.length; i++) {
            tt[i] = sc.nextLong();
        }
        for (int i = 1; i < tt.length; i++) {
            if(tt[i] - tt[i - 1] < t) {
                sum += tt[i] - tt[i - 1];
            } else {
                sum += t;
            }
        }
        System.out.println(sum + t);
    }
}


Measured memory_bytes: 60144
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int64_t> A(N);
  vector<int64_t> B(N);
  auto cmp = [](pair<int64_t, int64_t> &a, pair<int64_t, int64_t> &b) {
               if (a.second == b.second) {
                 return a.first < b.first;
               }
               return a.second > b.second;
             };
  vector<pair<int64_t, int64_t>> pairs(N);
  int64_t max_end = INT64_MIN;
  for (int i = 0; i < N; i++) {
    int64_t a, b;
    cin >> a >> b;
    max_end = max(max_end, b);
    pairs[i] = make_pair(a, b);
  }
  sort(pairs.begin(), pairs.end(), cmp);
  int64_t cur_end = max_end;
  for (auto p : pairs) {
    cur_end = min(cur_end, p.second);
    if (cur_end < 0) {
      cout << "No" << endl;
      return 0;
    }
    cur_end -= p.first;
  }
  if (cur_end < 0) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 6528
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

int h[(int)1e5], dp[(int)1e5], K, N;


int main()
{
	K = N = 0;
	for(int j = 1;j <= 1e5;j++)
	{
		dp[j] = 1e9;
	}
	scanf("%d %d", &N, &K);
	for(int i = 1;i <= N;i++)
	{
		scanf("%d", &h[i]);		
	}
	dp[1] = 0;
	dp[2] = dp[1] + abs(h[1] - h[2]);
	for(int i = 1;i <= N;i++)
	{
		for(int j = 1;j <= K;j++)		
		{
			dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
		}
	}
	printf("%d\n", dp[N]);
	return 0;	
}


Measured memory_bytes: 896
N=int(input())
s={}
maxs=0
for i in range(N):
  S=input()
  if S not in s:
    s[S]=0
  else:
    s[S]+=1
    maxs=max(maxs,s[S])
s=sorted(s.items(), key=lambda x:x[0])

ans= [S for S, i in s if i == maxs]
for A in ans:
  print(A)

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

int main(){
    int K, A, B;
    cin >> K >> A >> B;
    bool flag = false;

    for(int i = A; i < B+1; i++){
        if(i % K == 0){
            flag = true;
            break;
        }
    }

    if(flag == true){
        cout << "OK" << endl;
    }else{
        cout << "NG" << endl;
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL mod=1e9+7;
const int maxn=2e5+10;
const LL inf=1e18;
typedef pair<LL,int> P;
int main()
{
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
        if(s[i]=='7'){
            printf("Yes\n");
            return 0;
        }
    }
    printf("No\n");
    return 0;
}


Measured memory_bytes: 3624
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>

using namespace std;

typedef long long LL;

int main(int argc, char* argv[]) {
#ifdef _MSC_VER
	while (true)
#endif
	{
		LL x = -1, y, a, b, c;
		cin >> x >> y >> a >> b >> c;
		if (x < 0) return 0;
		vector<LL> p(a), q(b), r(c);
		for (int i = 0; i < a; ++i) {
			cin >> p[i];
		}
		for (int i = 0; i < b; ++i) {
			cin >> q[i];
		}
		for (int i = 0; i < c; ++i) {
			cin >> r[i];
		}
		sort(p.rbegin(), p.rend());
		sort(q.rbegin(), q.rend());
		sort(r.rbegin(), r.rend());
		p.resize(x);
		q.resize(y);
		r.resize(x + y);
		for (auto z : q) p.emplace_back(z);
		for (auto z : r) p.emplace_back(z);
		sort(p.rbegin(), p.rend());
		LL ans = accumulate(p.begin(), p.begin() + x + y, 0LL);
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 6880
function main()
  n = parse(Int, readline())
  a = map(x -> parse(Int, x), split(readline(), " "))
  
  minusCount = 0
  minAbs = 1000000000
  sumAbs = 0
  for i in 1:n
    an = a[i]
    if an < 0
      minusCount += 1
    end
    hoge = abs(an)
    minAbs = minimum([minAbs, hoge])
    sumAbs += hoge
  end
  if minusCount % 2 == 1
    sumAbs -= (minAbs * 2)
  end
  println(sumAbs)
end

main()

Measured memory_bytes: 136568
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
string allreplace (string str,string str_from, string str_to) {
    string::size_type pos = 0;
    while (pos = str.find(str_from, pos), pos != string::npos) {
        str.replace(pos, str_from.length(), str_to);
        pos += str_to.length();
    }
    return str;
}

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

    string s; cin >> s;
    string news = allreplace(s, "BC", "D");
    int n = news.size();
    ll cnta = 0; ll ans = 0;
    rep(i,n) {
        if(news[i] == 'A') cnta++;
        else if(news[i] == 'D') ans += cnta;
        else cnta = 0;
    }
    cout << ans << endl;
    return 0;
}



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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

template<int mod>
struct ModInt{
	int x;
	ModInt () : x(0) {}
	ModInt (int64_t x) : x(x >= 0 ? x % mod : (mod - -x % mod) % mod) {}
	ModInt &operator += (const ModInt &p){
		if ((x += p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator -= (const ModInt &p) {
		if ((x += mod - p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator *= (const ModInt &p) {
		x = (int64_t) x * p.x % mod;
		return *this;
	}
	ModInt &operator /= (const ModInt &p) {
		*this *= p.inverse();
		return *this;
	}
	ModInt &operator ^= (int64_t p) {
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator - () const { return ModInt(-x); }
	ModInt operator + (const ModInt &p) const { return ModInt(*this) += p; }
	ModInt operator - (const ModInt &p) const { return ModInt(*this) -= p; }
	ModInt operator * (const ModInt &p) const { return ModInt(*this) *= p; }
	ModInt operator / (const ModInt &p) const { return ModInt(*this) /= p; }
	ModInt operator ^ (int64_t p) const { return ModInt(*this) ^= p; }
	bool operator == (const ModInt &p) const { return x == p.x; }
	bool operator != (const ModInt &p) const { return x != p.x; }
	explicit operator int() const { return x; }
	ModInt &operator = (const int p) { x = p; return *this;}
	ModInt inverse() const {
		int a = x, b = mod, u = 1, v = 0, t;
		while (b > 0) {
			t = a / b;
			a -= t * b;
			std::swap(a, b);
			u -= t * v;
			std::swap(u, v);
		}
		return ModInt(u);
	}
	friend std::ostream & operator << (std::ostream &stream, const ModInt<mod> &p) {
		return stream << p.x;
	}
	friend std::istream & operator >> (std::istream &stream, ModInt<mod> &a) {
		int64_t x;
		stream >> x;
		a = ModInt<mod>(x);
		return stream;
	}
};

template<int mod> struct MComb {
	using mint = ModInt<mod>;
	std::vector<mint> fact;
	std::vector<mint> inv;
	MComb (int n) { // O(n + log(mod))
		fact = std::vector<mint>(n + 1, 1);
		for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * mint(i);
		inv.resize(n + 1);
		inv[n] = fact[n] ^ (mod - 2);
		for (int i = n; i--; ) inv[i] = inv[i + 1] * mint(i + 1);
	}
	mint ncr(int n, int r) {
		return fact[n] * inv[r] * inv[n - r];
	}
	mint npr(int n, int r) {
		return fact[n] * inv[n - r];
	}
	mint nhr(int n, int r) {
		assert(n + r - 1 < (int) fact.size());
		return ncr(n + r - 1, r);
	}
};

typedef ModInt<1000000007> mint;


int main() {
	int n = ri();
	int64_t a[n];
	for (auto &i : a) scanf("%" SCNd64, &i);
	int64_t xored = 0;
	for (int i = 2; i < n; i++) xored ^= a[i];
	int64_t sum = a[0] + a[1];
	if (xored > sum || ((sum - xored) & 1)) {
		puts("-1");
		return 0;
	}
	int64_t anded = (sum - xored) >> 1;
	int64_t r0 = 0;
	for (int i = 40; i--; ) {
		if (anded >> i & 1) r0 |= 1LL << i;
	}
	if (r0 > a[0]) {
		puts("-1");
		return 0;
	}
	for (int i = 40; i--; ) {
		if (anded >> i & 1) continue;
		if (!(xored >> i & 1)) continue;
		if (r0 + (1LL << i) <= a[0]) r0 |= 1LL << i;
	}
	if (!r0 || (r0 ^ (sum - r0)) != xored) {
		puts("-1");
		return 0;
	}
	printf("%" PRId64 "\n", a[0] - r0);
	return 0;
}


Measured memory_bytes: 3824
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;

int main(){
    int a, b;
    cin >> a >> b;
    if(a*b%2==0) out("Even");
    else out("Odd");

}


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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

int main(){
   int d;
   cin>>d;
   int c[26];
   rep(i, 26) cin>>c[i];
   int s[365][26];
   rep(i, d) rep(j, 26) cin>>s[i][j];

   int t[365];
   rep(i, d){cin>>t[i]; t[i]--;}

   ll sc=0;
   int las[26];
   rep(i, 26) las[i]=-1;

   rep(i, d){
      sc+=s[i][t[i]];
      las[t[i]]=i;
      rep(j, 26) sc -= c[j]*(i-las[j]);

      cout << sc << endl;
   }

   return 0;
}


Measured memory_bytes: 3712
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <vector>
#include <time.h>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <iostream>
#include <bitset>
#include <algorithm>
using namespace std;
#define MP make_pair
#define PB push_back
#define ms(a,b) memset((a),(b),sizeof(a))
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int, int> Pii;
typedef vector<int> Vi;
typedef vector<Pii> Vii;
const int inf = 0x3f3f3f3f;
const LL INF = (1uLL << 63) - 1;
const LL mod = 1000000007;
const int N = 150 + 5;
const double Pi = acos(-1.0);
const int maxn = 200005;
using namespace std;
int n;
int num[maxn];
int pos[maxn];
LL suff[maxn];
char op[5];
int main() {
#ifdef local
    freopen("in","r",stdin);
#endif
    scanf("%d%d",&n,&num[0]);
    for(int i = 1; i < n; i++){
        scanf("%s%d",op,&num[i]);
        if(op[0] == '-')num[i] *= -1;
    }
    for(int i = n - 1; i >= 0; i--){
        suff[i] = suff[i+1] + abs(num[i]);
    }
    LL ans = -INF;
    LL res = 0;
    num[n] = -1;
    for(int i = 0; i < n; i++){
        if(num[i] < 0){
            int j = i + 1;
            LL ff = num[i];
            while(j <= n && num[j] >= 0)ff -= num[j++];
            res += ff;
            ans = max(res + suff[j],ans);
            res -= ff;
            res += num[i];
        }
        else res += num[i];
    }
    ans = max(res,ans);
    cout<<ans<<endl;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include <chrono>
 
using namespace std;
using namespace __gnu_pbds;
 
#define endl '\n'
 
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<int, null_type,less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
template<typename T>
static T randint(T lo, T hi){
	return uniform_int_distribution<T>(lo, hi)(rng);
}

const ll mod = 998244353;

struct segment_tree
{
	vector<ll> st, lazy;

	segment_tree(int n) : st(4 * n), lazy(4 * n){ }

	void add_lazy(int node, int b, int e, ll x){
		st[node] = (st[node] + 1ll * (e - b + 1) * x % mod) % mod;
		lazy[node] = (lazy[node] + x) % mod;
	}

	void push(int node, int b, int e){
		if(b == e)
			return;

		int m = (b + e) >> 1;
		int l = node << 1;
		int r = l | 1;

		add_lazy(l, b, m, lazy[node]);
		add_lazy(r, m + 1, e, lazy[node]);

		lazy[node] = 0;
	}

	void update(int node, int b, int e, int i, int j, ll x){
		if(b >= i && e <= j){
			add_lazy(node, b, e, x);
			return;
		}

		if(b > j || e < i)
			return;

		int m = (b + e) >> 1;
		int l = node << 1;
		int r = l | 1;

		push(node, b, e);

		update(l, b, m, i, j, x);
		update(r, m + 1, e, i, j, x);

		st[node] = (st[l] + st[r]);
	}

	ll query(int node, int b, int e, int i, int j){
		if(b >= i && e <= j)
			return st[node];

		if(b > j || e < i)
			return 0ll;

		int m = (b + e) >> 1;
		int l = node << 1;
		int r = l | 1;

		push(node, b, e);

		ll L = query(l, b, m, i, j);
		ll R = query(r, m + 1, e, i, j);

		return (L + R) % mod;
	}
};

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 
	// freopen("settling.in", "r", stdin);
	// freopen("settling.out", "w", stdout);

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

	segment_tree st(n);

	vector<int> l(k), r(k);
	for(int i = 0; i < k; i++)
		cin >> l[i] >> r[i];

	st.update(1, 1, n, 1, 1, +1);

	for(int i = 1; i <= n; i++){
		for(int j = 0; j < k; j++){
			int lo = i + l[j];
			int hi = i + r[j];
			int L = max(1, lo);
			int R = min(n, hi);
			// cerr << i << " " << lo << " " << hi << " " << st.query(1, 1, n, i, i) << endl;
			if(L <= R)
				st.update(1, 1, n, L, R, st.query(1, 1, n, i, i));
		}
	}


	cout << st.query(1, 1, n, n, n) << endl;	
	
	return 0;
}


Measured memory_bytes: 15948
import std.stdio;
import std.conv;
import std.algorithm;
import std.range;
import std.string;
import std.math;
import std.format;
import std.datetime;
import std.typecons;

void main() {
  foreach (string line; stdin.lines) {
    int n = line.chomp.to!int;

    int i = 0;
    int[] ans;
    while (n != 0) {
      if (n % 2 == 1) {
        ans ~= pow(2, i);
      }
      n = n >> 1;
      i++;
    }

    ans.map!(to!string).join(" ").writeln;
  }
}

Measured memory_bytes: 1196
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define ushi int
#define tapu main
#define nichia (
#define kunn void
#define wara )

using ll = long long;

const int INF = 1073741823;
const int MINF = -1073741823;
const ll LINF = ll(4661686018427387903);
const ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main(){

	string s;
	scans(s);
	prints(s.substr(0, s.length() - 8));
	Please AC;
}


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();i++){
        if(s.at(i) == 'o')count++;
    }
    cout << 700 + 100 * count << endl;
}

Measured memory_bytes: 3568
N, Q = map(int, input().split())
tree = [[] for i in range(N+1)]
counter = [0] * (N+1)

for i in range(N-1):
    a, b = map(int, input().split())
    tree[b].append(a)

for i in range(Q):
    p, x = map(int, input().split())
    counter[p] += x
for i in range(1, N+1):
    for pn in tree[i]:
        counter[i] += counter[pn]

print(' '.join(map(str, counter[1:])))

Measured memory_bytes: 122956
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define ff first
#define ss second
#define all(v) (v).begin(), (v).end()
#define mod (int)(998244353)
#define PI 3.14159265358979323846264338327950L
#define debug(vec) cout<<(#vec)<<": "; for (auto& i: vec) cout<<i<<" "; cout<<endl
#define trace(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout << endl; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << "[ " << *it << " = " << a << " ] ";
    err(++it, args...);
}

signed main(){

    fastIO

    int t = 1;
    while (t--){
   		int x, y;
   		cin >> x >> y;
   		int ans = y/2;
   		if (y&1) {
   			cout << "No\n";
   		} else {
   			int l = x*2, r = x*4;
   			if (l <= y && y <= r) {
   				cout << "Yes\n";
   			}else {
   				cout << "No\n";
   			}
   		}
    }
    
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
vector <int> a[1000];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int nq,cm,n,x,y;
    cin>>n>>nq;
    for (int i=0;i<nq;i++){
        cin>>cm;
        switch (cm){
            case 0: 
                cin>>x>>y;
                a[x].push_back(y);
                break;
            case 1:
                cin>>x;
                if (a[x].size()==0){
                    cout<<"\n";    
                }
                else {
                    for(int j = 0; j < (int)a[x].size(); j++) {
                        cout << a[x][j];
                        if(j < (int)a[x].size() - 1) {
                            cout << ' ';
                        }
                    }
                    cout << '\n';
                }
                break;
            case 2:
                cin>>x;
                a[x].clear();
                break;
        }
    }
}



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

int main(){
  vector<int> A(6);
  
  for(int &i:A)
    cin >> i;
  
  if(A.at(4) - A.at(0) > A.at(5))
    cout << ":(" << endl;
  else
    cout << "Yay!" << endl;
}

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


using namespace std;
typedef long long ll;
#define REP(i,n) for (int i = 0; i < n; ++i)

int R, G, B, N;

int main() {
    cin >> R >> G >> B >> N;
    ll ans = 0;
    REP (r, N/R+1) REP (g, (N-r*R)/G+1)
        if ((N - r*R - g*G)%B == 0) {
            ans++;
        }
    cout << ans << endl;
}

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

ll powll(ll a,ll n){
  if(n==0)
  {
    return 1;
  }
  return powll(a,n-1)*a;
}

int main() {
   ll i,j,k;
    ll n,a[10][10],num,x[5],y[5],right=0,left=0;
    for(i=0; i<3; i++)
    {
      x[i]=0;
      y[i]=0;
      for(j=0; j<3; j++)
      {
        cin>>a[i][j];
      }
    }
    cin >> n;
    for(k=0; k<n; k++)
    {
      cin>>num;
        for(i=0; i<3; i++)
      {
        for(j=0; j<3; j++)
        {
          if(num==a[i][j])
          {
            x[i]+=1;
            y[j]+=1;
            if(i-j==0)
            {
              left+=1;
            }
            if(i+j==2)
            {
              right+=1;
            }
          }
        }
      }
    }

  for(i=0; i<3; i++)
  {
   
    if(x[i]==3 || y[i]==3 || right==3 || left==3)
    {
    cout <<"Yes"<< endl;
    return 0;
    }
  }  
  cout <<  "No"<< endl;
}


Measured memory_bytes: 256
using System;
using System.Numerics;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace debug
{
    class ProgramD
    {
        static void Main(string[] args)
        {

            //入力
            string[] s1 = Console.ReadLine().Split(' ');
            int n = int.Parse(s1[0]);
            int k = int.Parse(s1[1]);
            string[] s = Console.ReadLine().Split(' ');
            
            Console.WriteLine(((n - 1) + (k - 2)) / (k -1));
            
        }

        //繰り返し二乗法で求める
        static long modpow(long a, long n, long MOD)
        {
            if (n == 0)
                return 1;
            if (n % 2 == 0)
            {
                long temp = modpow(a, n / 2, MOD);
                return temp * temp % MOD;
            }

            return a * modpow(a, n - 1, MOD) % MOD;
        }
    }

}


Measured memory_bytes: 16480