akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		char[] S = sc.next().toCharArray();
		long K = sc.nextInt();
		List<Integer> sizes = new ArrayList<>();
		int got = 1;
		for (int i = 1; i < S.length; i++) {
			if (S[i] == S[i-1]) got++;
			else {
				sizes.add(got);
				got = 1;
			}
		}
		sizes.add(got);
		long ans = 0;
		if (sizes.size() == 1) {
			long tot = sizes.get(0) * K;
			ans = tot / 2;
		} else if (S[0] == S[S.length - 1]) {
			ans = sizes.get(0) / 2 + sizes.get(sizes.size() - 1) / 2;
			ans += (K - 1) * ((sizes.get(0) + sizes.get(sizes.size() - 1)) / 2);
			for (int i = 1; i + 1 < sizes.size(); i++) {
				ans += K * (sizes.get(i) / 2);
			}
		} else {
			for (Integer size : sizes) {
				ans += K * (size / 2);
			}
		}
		out.println(ans);
		
		out.flush();
	}
	
	
	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;
		
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 22100
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>

#define LL long long
using namespace std;

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

  int cnt=0, max=0;
  for (int i=0; i<n; i++) {
    char c = str[i];
    if (c == 'I') {
      cnt++;
    } else {
      cnt--;
    }
    if (max < cnt) {
      max = cnt;
    }
  }

  cout << max << endl;
}


Measured memory_bytes: 256
#include<iostream>
#define rep(i,n)for(int i=0;i<n;i++)

using namespace std;

int main()
{
    int n,x;
    int count=1,d=0;
    cin>>n>>x;
    rep(i,n)
    {
        int l;
        cin>>l;
        d+=l;
        if(d<=x)count++;
    }
    cout<<count<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int N;
  int i;
  scanf("%d\n", &N);
  if(N >= 1 && N <= 100){
    scanf("%d\n", &i);
    if(i >= 1 && i <= N){
      printf("%d\n", N-i+1);
    }else{
      printf("NONE\n");
    }
  }else{
    printf("NONe\n");
  }
}

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

int dfs(vector<int> G[],int dp[],int n,int i){
    if(dp[i]!=-1)   return dp[i];

    int temp=0;
    for(auto s:G[i]){
        temp=max(temp,dfs(G,dp,n,s)+1);
    }
    dp[i]=temp;
    return temp;
}


int main(){
    int n,m;
    cin>>n>>m;
    vector<int> G[n+1];

    int x,y;
    for(int i=1;i<=m;i++){
        cin>>x>>y;
        G[x].push_back(y);
    }

    int dp[n+1];
    int res=0;
    memset(dp,-1,sizeof(dp));
    for(int i=1;i<=n;i++){
        res=max(res,dfs(G,dp,n,i));
    }
    cout<<res;
    return 0;
}

Measured memory_bytes: 9472
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
// #define INF 9e+18

/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End

/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    long long a,b,N;
    cin >> a >> b >> N;
    cout << a * min(b-1LL,N) / b << nn;
    return 0;
}


Measured memory_bytes: 3164
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <climits>
#define mk make_pair
#define pb push_back
#define scanf scanf_s
#define printf printf_s
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<ll, ll> pos;
const ll N = 200010, MOD = 1000000007;

ll mn(ll a, ll b) {
	if (a == -1)return b;
	if (b == -1)return a;
	return min(a, b);
}

int bb(int v1) {
	if (v1 % 2 == 0)return v1 / 2 - 1;
	else return v1 / 2;
}

ll pw(ll a, ll b) {
	ll v = 1;
	for (; b > 0; b = (b >> 1), a = (a * a) % MOD) {
		if ((b & 1) > 0)v = (v * a) % MOD;
	}
	return v;
}


struct Comb {
public:ll frc[N + 1], rv[N + 1];
	  ll pw(ll v1, ll v2) {
		  ll v3 = 1;
		  for (; v2 > 0; v2 = (v2 >> 1)) {
			  if (v2 & 1)v3 = (v3 * v2) % MOD;
			  v1 = (v1 * v1) % MOD;
		  }
		  return v3;
	  }

	  void set() {
		  frc[0] = 1;
		  rv[0] = 1;
		  for (int i = 1; i < N; i++) {
			  frc[i] = (frc[i - 1] * i) % MOD;
			  rv[i] = pw(frc[i], MOD - 2);
		  }
	  }
	  ll comb(ll a, ll b) {
		  ll v1 = frc[a];
		  v1 = (v1 * rv[b]) % MOD;
		  v1 = (v1 * rv[a - b]) % MOD;
		  return v1;
	  }
};
ll n, k,ans=0;
int main() {
	cin >> n >> k;
	for (ll i = k; i <= n + 1; i++) {
		ll v1 = i * (i - 1) / 2, v2 = (2 * n - i + 1) * i / 2;
		ans += v2 - v1 + 1;
		ans%=MOD;
	}
	cout << ans << endl;
	return 0;
}


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

#define ll long long
#define MOD 1000000007


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

    deque<ll> a;

    ll v;
    for(int i=0;i<n;i++){
        cin>>v;
        if(i==1){
            a.push_back(v);
        }else{
            if(i%2==1)a.push_back(v);
            else a.push_front(v);
        }
    }
    if(n%2==0){
        reverse(a.begin(),a.end());
    }
    for(int i=0;i<n;i++){
        cout<<a.front()<<" ";
        a.pop_front();
    }

}



Measured memory_bytes: 3840
import sys

def INPUT(): return sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 9)


def main():
    N = INPUT()
    S = 0

    for i in N:
        S += int(i)

    if int(N) % S == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <array>
#include <cmath>
#include <queue>
#include <stack>
#include <numeric>
#include<bits/stdc++.h>

using namespace std;


int main(){
 
int a,b;
string strans = "";
cin>>a>>b;

if(a <= b){
    string stra;
    stra = to_string(a);
    for(int i = 0; i < b; i++){
        strans += stra;}
        cout<<strans<<endl;
    }else{
    string strb;
    strb = to_string(b);
    for(int i = 0; i < a; i++){
        strans += strb;}
        cout<<strans<<endl;
    }
}


Measured memory_bytes: 3652
using System;
using System.Collections.Generic;
using System.Linq;
class Program{
    static void Main(string[] args){
    var vals= Console.ReadLine().Split().Select(x => int.Parse(x)).ToList();
    int N=vals[0];
    int K=vals[1];
    Modulo m=new Modulo(N);
    for(int i=1;i<=K;i++){     
        var ans=m.Mul(m.Ncr(N-K+1,i),m.Ncr(K-1,i-1));
        Console.WriteLine(ans);
    }
    
    
    }
}
class Modulo
{
    private const int M = 1000000007;
    private readonly int[] m_facs;
    public int Mul(int a, int b)
    {
        return (int)(Math.BigMul(a, b) % M);
    }
    public Modulo(int n)
    {
        m_facs = new int[n + 1];
        m_facs[0] = 1;
        for (int i = 1; i <= n; ++i)
        {
            m_facs[i] = Mul(m_facs[i - 1], i);
        }
    }
    //引き算の際は、最終結果が負になった場合に注意
    //階乗（factorial）
        public int Fac(int n) 
    {
        return m_facs[n];
    }
    //累乗（aのm乗）。繰り返し二乗法により高速化
    public int Pow(int a, int m)
    {
        switch (m)
        {
        case 0:
            return 1;
        case 1:
            return a;
        default:
            int p1 = Pow(a, m / 2);
            int p2 = Mul(p1, p1);
            return ((m % 2) == 0) ? p2 : Mul(p2, a);
        }
    }
    //フェルマーの小定理による。modの除算は直観的でない。
        public int Div(int a, int b) 
    {
        return Mul(a, Pow(b, M - 2));
    }
    //繰り返し二乗法により高速化
    public int Ncr(int n, int r)
    {
        if (n < r) { return 0; }
        if (n == r) { return 1; }
        int res = Fac(n);
        res = Div(res, Fac(r));
        res = Div(res, Fac(n - r));
        return res;
    }
}


Measured memory_bytes: 13380
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

using P = pair<int, int>;

class UnionFind
{
public:
    vs32 p, d;

    UnionFind() {}
    UnionFind(int size)
    : p(vs32(size, -1)), d(vs32(size, 0))
    {}

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

    int dist(int x)
    {
        findSet(x);
        return d[x];
    }

    // assume x + dis = y
    bool unite(int x, int y, int dis)
    {
        int rx, ry;
        rx = findSet(x); ry = findSet(y);
        if (rx == ry)
        {
            return d[x] + dis == d[y];
        }

        if (p[rx] > p[ry])
        {
            swap(rx, ry);
            swap(x, y);
            dis = -dis;
        }
        p[rx] += p[ry];
        p[ry] = rx;
        d[ry] = d[x] + dis - d[y];
        return true;
    }

    int findSet(int x)
    {
        int ret;
        if (p[x] < 0)
        {
            ret = x;
        }
        else
        {
            ret = findSet(p[x]);
            d[x] += d[p[x]];
            p[x] = ret;
        }
        return ret;
    }
};

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

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

    UnionFind uf(n);
    int L, R, D;
    rep (i, m)
    {
        cin >> L >> R >> D;
        --L; --R;
        if (!uf.unite(L, R, D))
        {
            cout << "No\n";
            return 0;
        }
    }

    cout << "Yes\n";
    return 0;
}



Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#define INF 100000000
using namespace std;
typedef pair<int,int>P;
int N,M,S,G1,G2,C[105][105],d[105],R,t;
void dij(int f)
{
	
	priority_queue<P,vector<P>,greater<P> >Q;
	fill(d,d+N,INF);
	d[f]=0;
	Q.push(P(0,f));
	for(;!Q.empty();)
	{
		P p=Q.top();Q.pop();
		int v=p.second;
		if(d[v]<p.first)continue;
		for(int i=0;i<N;i++)
			if(C[v][i]&&d[i]>d[v]+C[v][i])
			{
				d[i]=d[v]+C[v][i];
				Q.push(P(d[i],i));
			}
	}
}

int main()
{
	for(;scanf("%d%d%d%d%d",&N,&M,&S,&G1,&G2),N;)
	{
		S--;G1--;G2--;R=INF;
		memset(C,0,sizeof(C));
		for(int i=0;i<M;i++)
		{
			int f,t,c;
			scanf("%d%d%d",&f,&t,&c);
			f--;t--;
			C[f][t]=c;
		}
		for(int i=0;i<N;i++)
		{
			t=0;
			dij(S);
			t+=d[i];
			dij(i);
			t+=d[G1]+d[G2];
			R=min(R,t);
		}
		printf("%d\n",R);
	}
	return 0;
}

Measured memory_bytes: 1088
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

int main(){
  string s;
  cin>>s;
  
  int cnt=0;
  rep(i,4){
    if(s[i]=='+') cnt++;
  }
  cout<<2*cnt-4<<endl;

  return 0;
}

Measured memory_bytes: 3572
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))

s = input()[:-1]
t = input()[:-2]
if s == t:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 68360
import sys
s = int(input())
m = 1000000
D={} #これで辞書を作る
D[s] = 1
for i in range(2,m):
    if s%2 == 0:
        s = s//2
    else:
        s = 3*s+1
    if s in D.keys(): #sが辞書Dにあるのかチェック(これはある場合)
        D[s] += 1 #D[s] += 1 ->{'s':今までに出てきた回数+1}となる
    else:  #sが辞書Dにない場合
        D[s] = 1 #D[s] = 1 ->{'s':1}となる
    if D[s] ==2:
        print(i)
        sys.exit()

Measured memory_bytes: 9140
def show_list(a):
    for x in a:
        print x,
    print

def stable_check(sorted_values,sorted_suits,default_values,default_suits,n):
    for i in xrange(1,10):
        check_ss = []
        check_ds = []
        if i in sorted_values:
            for x in xrange(n):
                if i == sorted_values[x]:
                    check_ss.append(sorted_suits[x])
                if i == default_values[x]:
                    check_ds.append(default_suits[x])
            for x in xrange(len(check_ss)):
                if check_ss[x]!=check_ds[x]:
                    return "Not stable"
    return "Stable"

def bubble_sort(values,suits,n):
    flag = True
    while flag:
        flag = False
        for j in reversed(xrange(1,n)):
            if values[j] < values[j-1]:
                tmp = values[j]
                values[j] = values[j-1]
                values[j-1] = tmp
                tmp = suits[j]
                suits[j] = suits[j-1]
                suits[j-1] = tmp
                flag = True
    show_list(marge_suits_values(values,suits,n))
def selection_sort(values,suits,n):
    for i in xrange(n):
        minj = i
        for j in xrange(i,n):
            if values[j]<values[minj]:
                minj = j
        if minj!=i:
            tmp = values[i]
            values[i]=values[minj]
            values[minj]=tmp
            tmp = suits[i]
            suits[i]=suits[minj]
            suits[minj]=tmp
    show_list(marge_suits_values(values,suits,n))
def marge_suits_values(values,suits,n):
    ans = []
    for x in xrange(n):
        ans.append(suits[x]+str(values[x]))
    return ans

def main():
    n = input()
    a = raw_input().split()
    suits1 = []
    values1 =[]
    for x in xrange(n):
        suits1.append(a[x][0])
        values1.append(int(a[x][1]))
    suits2 = list(suits1)
    values2 = list(values1)
    bubble_sort(values1,suits1,n)
    print stable_check(values1,suits1,values2,suits2,n)

    values1 = list(values2)
    suits1 = list(suits2)
    selection_sort(values2,suits2,n)
    print stable_check(values2,suits2,values1,suits1,n)

if __name__ == '__main__':
    main()

Measured memory_bytes: 6504
#include <bits/stdc++.h>
     
#define pll pair <long long,long long>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define vll vector <ll>
#define NFS ios_base::sync_with_stdio(0); cin.tie(NULL);
#define endl '\n'
#define M 1000000007   
using namespace std;
 
int main()
{
    NFS
 	ll h,n,a,sum=0;
 	cin>>h>>n;
 	for(int i=0;i<n;i++)
 	{
 		cin>>a;	
 		sum+=a;	
 	}
 	if(sum>=h)
 		cout<<"Yes";
 	else
 		cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
using namespace std;

string divide[4] = { "dream","dreamer","erase","eraser" };
int main()
{
	string S;
	cin >> S;

	reverse(S.begin(), S.end());
	for (int i = 0; i < 4; i++)
	{
		reverse(divide[i].begin(), divide[i].end());

	}

	bool can = true;
	for (int i = 0; i < S.size();)
	{
		bool can2 = false;
		for (int j = 0; j < 4; j++)
		{
			string d = divide[j];
			if (S.substr(i, d.size()) == d)
			{
				can2 = true;
				i += d.size();
			}
		}

		if (can2 == false)
		{
			can = false;
			break;
		}
	}

		

		if (can == true)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}

	
}


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

int main() {
	int n;
	cin>>n;
	map<string,int> mp;
	for(int i=0;i<n;i++){
		string s;
		cin>>s;
		mp[s]++;
	}
	cout<<"AC x "<<mp["AC"]<<endl;
	cout<<"WA x "<<mp["WA"]<<endl;
	cout<<"TLE x "<<mp["TLE"]<<endl;
	cout<<"RE x "<<mp["RE"]<<endl;
	return 0;
}

Measured memory_bytes: 3612
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	N := ReadInt()
	x := N * 800
	y := (N / 15) * 200
	fmt.Println(x - y)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


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

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pb;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
typedef map<int,int> mapii;
typedef map<int,bool> mapib;
typedef priority_queue<int> pq;
typedef priority_queue<int,vector<int>,greater<int> > pqq;

#define small 1e-9
#define big5 1000000005
#define big7 1000000007
#define pi 3.1415926
#define big 10000000

#define inp(arr,n) for(int i=0;i<n;i++)cin>>arr[i];
#define bsdk ios_base::sync_with_stdio(false);cin.tie(NULL);
#define disp(arr) for(auto i:arr)cout<<i<<" ";cout<<"\n"
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define yess cout<<"Yes\n"
#define noo cout<<"No\n"
#define m1 cout<<"-1\n"
#define nl <<endl
#define hs cout<<"#"

#define rep(i,n) for(i=0;i<n;i++)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define sorti(v) sort(v.begin(),v.end())
/*int ncr(int n, int k)
{
    int res = 1;
    if (k > n - k)
        k = n - k;
    for (int i = 0; i < k; ++i) {
        res *= (n - i);
        res /= (i + 1);
    }
    return res;
}
bool isprime[big+1];
vector<int> primes;
void makesieve()
{
    ll i,j;
    rep(i,big+1)
        isprime[i]=false;
    isprime[2]=true;
    for(i=3;i<=big;i+=2)
        isprime[i]=true;
    for(i=3;i<=big;i+=2)
    {
        if(isprime[i])
            for(j=i*i;j<=big;j+=i)
            isprime[j]=false;
    }
    rep(i,big+1)
    {
        if(isprime[i])
            primes.pb(i);
    }
}
vpi fact(ll n)
{
    ll i=0;
    vpi pf;
    ll c;
    while(primes[i]*primes[i]<=n)
    {
        if(n%primes[i]==0)
        {
            c=0;
            while(n%primes[i]==0)
                {
                    n=n/primes[i];
                    c++;
                }
            pf.pb(mp(primes[i],c));
        }
        i++;
    }
    if(n!=1)
        pf.pb(mp(n,1));
    return pf;
}
ll gcd(ll a,ll b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}
ll findlcm(ll arr[], ll n)
{
    // Initialize result
    ll ans = arr[0];

    // ans contains LCM of arr[0], ..arr[i]
    // after i'th iteration,
    for (int i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));
    return ans;
}
ll poww(ll n,ll m){
    if(m==0)return 1;
    if(m==1)return n;
    ll ans = poww(n,m/2);
    if(m%2==1) return (ans*ans)*n;
    else return (ans*ans);
}*/
void solve()
{
    int n;
    cin>>n;
    if(n==0)
        cout<<"1" nl;
    else
        cout<<"0" nl;
}
int main()
{
    bsdk
    int t;
    //cin>>t;
    t=1;
    //makesieve();
    for(int i=1;i<=t;i++)
       {
           //cout<<"Case #"<<i<<": ";
           solve();
       }
    return 0;
}



Measured memory_bytes: 3648
#include <stdio.h>
#include <iostream>
#include <set>
#include <string>
#include <string.h>
using namespace std;

int main()
{
    int sz[2][5];
    int min=0;
    for(int i=0;i<5;i++)
    {
        cin>>sz[0][i];
        sz[1][i]=10-sz[0][i]%10;
        if(sz[1][i]==10)
            sz[1][i]=0;
        if(sz[1][i]>sz[1][min])
        {
            min=i;
        }
    }
/*
    for(int i=0;i<5;i++)
    {
        cout<<sz[0][i]<<" ";
    }
    cout<<endl;
    for(int i=0;i<5;i++)
    {
        cout<<sz[1][i]<<" ";
    }
    cout<<endl;
*/

    int ans=0;
    for(int i=0;i<5;i++)
    {
        if(i!=min)
        ans=ans+sz[0][i]+sz[1][i];
        else
            ans=ans+sz[0][i];
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>

#include <vector>
#include <cmath>
#include <limits>
#include <functional>
using namespace std;

int main()
{
    int N, K;
    int c[3][3];
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cin >> c[i][j];
        }
    }

    int a1 = 1;
    int b[3];
    int a2[3];
    int a3[3];
    bool flag1 = false,flag2=false;

    for (int i = 0; i < 3; i++)
    {
        b[i] = c[0][i] - a1;
    }

    for (int i = 0; i < 3; i++)
    {
        a2[i] = c[1][i] - b[i];
    }

    if (a2[0] == a2[1] && a2[1] == a2[2])
    {
        flag1 = true;
    }
    else
    {
        flag1 = false;
    }

    for (int i = 0; i < 3; i++)
    {
        a3[i] = c[2][i] - b[i];
    }

    if (a3[0] == a3[1] && a3[1] == a3[2])
    {
        flag2 = true;
    }
    else
    {
        flag2 = false;
    }

    if (flag1&&flag2)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

   

    return 0;
}

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

// ---------------------------template starts here-------------------------- 

#define int long long int
#define pb push_back
#define MAX INT_MAX
#define endl "\n"
#define precise std::cout << std::fixed;std::cout << std::setprecision(6); 
#define zerobits(x) __builtin_ctzll(z)
#define F first
#define S second  
#define mp make_pair
#define MIN INT_MIN
#define MOD 1000000007
#define FO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

set <int> s;
bool ar[100001];
void seive() {
    ar[0] = ar[1] = true;

    for(int p=2; p*p<=100001; p++) {
        if(ar[p] == false) {
            for(int i=p*p;i<=100001;i+=p)
                ar[i] = true ;
        }
    }

    for(int p=2;p<=100001;p++) {
        if(ar[p] == false)
            s.insert(p);
    }
}

bool is_palindrome(string str) {
    int len = str.length();
    for(int i=0;i<=len/2;i++) {
        if(str[i] != str[len-1-i])
            return false;
    }
    return true;
}

int binexpo(int x, int y, int p) {    
    int res = 1;     // Initialize result  
    x = x % p; // Update x if it is more than or  
                // equal to p  

    while (y > 0)  {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;
}

int add(int a, int b) {
    return (a % MOD + b % MOD) % MOD;
}

int mul(int a, int b) {
    return (a % MOD * b % MOD) % MOD;
}

// --------------------------template ends here------------------------------

void solve() {
    int n, k;
    cin >> n >> k;

    vector <int> dp(k+1, 0);

    for(int gd=k;gd>=1;gd--) {
        int total_multiples = k/gd;
        int temp = binexpo(total_multiples, n, MOD);
        temp = temp % MOD;
        int extra = 0;
        for(int j=gd;j<=k;j+=gd) {
            extra = (extra + dp[j]) % MOD;
        }
        dp[gd] = (temp - extra) % MOD;
    }      

    int ans = 0;

    for(int i=1;i<=k;i++) {
        ans = add(ans, mul(dp[i], i));
        ans = ans % MOD;
    }

    cout << ans << endl;
    return;
}

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

Measured memory_bytes: 3960
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <tuple>

using namespace std;
int main(){
    int a,b,c;
    cin >> a>>b>>c ;
    if(a==b & b==c){cout << "Yes" << endl;}else{cout << "No" << endl;}
    return 0;
}


Measured memory_bytes: 888
#include <iostream>

using namespace std;

int main () {
        int a;
        int b;
        cin >> a;
        cin >> b;
        if ( a > b ) {
            cout << "a > b" << endl;
        } else if ( a == b ) {
            cout << "a == b" << endl;
       } else {
            cout << "a < b" << endl;
       }
       return 0;
}


Measured memory_bytes: 3080
#include<bits/stdc++.h>
#define ll 	 long long
#define pb push_back
#define ull unsigned long long
#define mp make_pair
using namespace std;

#define mmm    ios_base::sync_with_stdio(false);cin.tie(NULL);

int main() {
mmm
ll n,sum=0; cin>>n;

for(ll i=1; i<=(n-1); i++)
{
	sum+=(n-1)/i;
}
cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <string>
#define llint long long

using namespace std;

string s;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> s;
	if(s.size() % 2){
		cout << "No" << endl;
		return 0;
	}
	for(int i = 0; i < s.size(); i++){
		if(i % 2 == 0 && s[i] != 'h'){
			cout << "No" << endl;
			return 0;
		}
		if(i % 2 && s[i] != 'i'){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	
	return 0;
}


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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int a; string s;
  cin >> a;
  cin >> s;
  if(a >= 3200) cout << s << endl;
  else cout << "red" << endl;
  return 0;
}


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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  bool b = false;
  for(int i = 1; i < 200; i++) {
    if((A*i)%B == C) {
      b = true;
      break;
    }
  }
  if(b) {
    cout << "YES";
  }
  else {
    cout << "NO";
  }
}



Measured memory_bytes: 256
// Tested On: http://agc017.contest.atcoder.jp/tasks/agc017_a
#include <iostream>
#include <vector>
using namespace std;
template<typename T, typename S> T expo(T b, S e){if(e <= 1)return e == 0?1: b;\
	return (e&1) == 0?expo((b*b), e>>1): (b*expo((b*b), e>>1));}

const int MAXN = 100;

//Begin
template<typename T>
vector<vector<T> > CreateNcrTable(int Size) {
  vector<vector<T> > res(Size, vector<T>(Size, 0));
  res[0][0] = 1;
  res[1][0] = res[1][1] = 1;
  for(int n = 2; n < Size; n++) {
    res[n][0] = 1;
    for(int r = 1; r <= n; r++) {
      res[n][r] = res[n - 1][r - 1] + res[n - 1][r];
    }
  }
  return res;
}
template<typename T, typename S>
vector<vector<T> > CreateNcrTable(int Size, S mod) {
  vector<vector<T> > res(Size, vector<T>(Size, 0));
  res[0][0] = 1;
  res[1][0] = res[1][1] = 1;
  for(int n = 2; n < Size; n++) {
    res[n][0] = 1;
    for(int r = 1; r <= n; r++) {
      res[n][r] = res[n - 1][r - 1] + res[n - 1][r];
      if(res[n][r] >= mod) res[n][r] -= mod;
    }
  }
  return res;
}
//End
#define F first
#define S second
#define LL long long
LL fact[MAXN] = {0}, ifact[MAXN] = {0};
vector<vector<LL> > ncr;

pair<LL, LL> sum(LL n) {
	pair<LL, LL> res = {0, 0};
	for(int i = 0; i <= n; i++) {
		if(i % 2 == 0)
			res.F += ncr[n][i];
		else
			res.S += ncr[n][i];
	}
	return res;
}

int main() {
  ios_base::sync_with_stdio(false);
  ncr = CreateNcrTable<long long>(MAXN);
	LL a;
	LL odd = 0, even = 0;
	LL n, p;
	cin >> n >> p;
	for(int i = 0; i < n; i++) {
		cin >> a;
		if(a % 2) odd++;
		else even++;
	}
	LL res = 0;
	LL A = expo(2ll, even);
	auto temp = sum(odd);
	A *= temp.F;
	LL B = expo(2ll, even);
	B *= temp.S;
	if(p == 0)
		res = A;
	else
		res = B;
	cout << res << endl;
  return 0;
}


Measured memory_bytes: 384
from sys import *
N = int(input())
things = []

def giveNext(first, left_n):
    if left_n < 0:
        return
    if first[-1] +1 < 10:
        things.append(first+ [first[-1]+1])
        giveNext(first+ [first[-1]+1],left_n-1)
    if first[-1] -1 > -1:
        things.append(first+ [first[-1]-1])
        giveNext(first+ [first[-1]-1],left_n-1)

    things.append(first+ [first[-1]])
    giveNext(first+ [first[-1]],left_n-1)

for i in range(1, 10):
    giveNext([i], 8)
things = [int("".join(str(y) for y in x)) for x in things]

things += [1,2,3,4,5,6,7,8,9]
things.sort()
print(things[N-1])


Measured memory_bytes: 44568
#include<iostream>
#include<stdio.h>
#include<string>
#include <algorithm>
#include<cstring>
#include <math.h>
#include <iomanip>
using namespace std;

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}



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

  while(1){
    if(IsPrime(x))
      break;
    else
      x++;
  }
  cout<<x<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
//#include<iomanip>
using namespace std;
int main()
{
    string n;
    int i;
    cin>>n;
    for(i=0;i<n.size();i++)
    {
    	if(n[i]==',')
    	{
    		n[i]=' ';
		}
	}
    cout<<n<<endl;
	return 0;
}

Measured memory_bytes: 256
def f(A, i, N, reqs, M, Q):
    if i == N:
        res = 0
        # print(A)
        for i in range(Q):
            a,b,c,d = reqs[i]
            if A[b] - A[a] == c:
                res += d
        # print(res)
        return res
    b = 0
    for n in range(A[i-1],M+1):
        A[i] = n
        b = max(b, f(A,i+1,N,reqs,M,Q))
    return b

def main():
    N,M,Q = [int(_n) for _n in input().split()]
    reqs = []
    for i in range(Q):
        a,b,c,d = [int(_n) for _n in input().split()]
        a-=1
        b-=1
        reqs.append((a,b,c,d))
    print(f([1]*N,1,N,reqs,M,Q))
main()

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

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

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c;
  cin >> a >> b >> c;
  cout << max(c - (a-b),0) << endl;
  return 0;
}


Measured memory_bytes: 256
/* HARE KRSNA HARE KRSNA KRSNA KRSNA HARE HARE
    HARE RAMA HARE RAMA RAMA RAMA HARE HARE  */

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

#define nl "\n"
#define ff first
#define ss second
#define pp pop_back
#define pf pop_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define b_s binary_search
#define all(x) x.begin(),x.end()
#define test ll t; cin>>t; while(t--)
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define rloop(i,s,n) for(ll i=s;i>=n;i--)
#define fill(a,value) memset(a,value,sizeof(a))

#define debug2(a)  for(auto x : a)  cout<<x<<" ";  cout<<nl;
#define debug4(a)  for(auto x : a)  cout<<x.ff<<" "<<x.ss<<nl;
#define debug1(a,n) loop(i,0,n)  cout<<a[i]<<" ";  cout<<nl;
#define debug3(a,n,m)  loop(i,0,n){ loop(j,0,m)	cout<<a[i][j]<<" ";	cout<<nl; }

typedef long long ll;
typedef long double ld;

typedef stack<ll> sll;
typedef queue<ll> qll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef pair<ll, pll> ppll;
typedef vector<vector<ll>> vvll;
typedef priority_queue<ll> pqll;

const ll mod = 1000000007;  //998244353;
const ld pi =  acos((ld) - 1);  //3.1415926535;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll num_generator() 	{ return rand() % 1000; }
void array_generator(ll a[], ll n) { loop(i, 0, n)	a[i] = rand() % 100; }

void solve()
{
	ll n;	cin >> n;
	ll ans;
	if (n >= 400 && n <= 599)	ans = 8;
	else if (n >= 600 && n <= 799)	ans = 7;
	else if (n >= 800 && n <= 999)	ans = 6;
	else if (n >= 1000 && n <= 1199)	ans = 5;
	else if (n >= 1200 && n <= 1399)	ans = 4;
	else if (n >= 1400 && n <= 1599)	ans = 3;
	else if (n >= 1600 && n <= 1799)	ans = 2;
	else	ans = 1;

	cout << ans;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// test
	solve();

	return 0;
}

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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 62;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  int r, g, b, n;
  cin >> r >> g >> b >> n;
  int ans = 0;
  for(int i = 0; i*r <= n; ++i) {
    for(int j = 0; j*g+i*r <= n; ++j) {
      if((n-j*g-i*r)%b == 0) ++ans;
    }
  }
  cout << ans << endl;
}

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<ll> VI; typedef pair<ll,ll> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T> void amin(T& a,T b){ a=min(a,b);}
template <class T> void amax(T& a,T b){ a=max(a,b);}

vector<vector<int>> cmb;
void mkcmb(const int MX){
	cmb.resize(MX+2, vector<int>(MX+2));
	rep(i,MX+1)  cmb[i][0] = 1;
	rep2(i,1,MX+1) rep2(j,1,i+1)
		cmb[i][j] = (cmb[i-1][j] + cmb[i-1][j-1]) % mod;
}

ll ncr(int n, int r){
	if (n < r) return 0;
	if (n == r) return 1;
	if (r < 1) return 0;
	return cmb[n-1][r-1] ;
}

int main()
{
	//cin.tie(0); ios_base::sync_with_stdio(false);
	
	int n, k;
	cin >>n >>k;
	
	mkcmb(n+100);
	rep2(i, 1, k+1){
		ll blu = ncr(k, i);
		ll red =0;
		red += ncr(n-k, i-1) + ncr(n-k, i) *2 + ncr(n-k, i+1);
		cout << blu * red % mod <<"\n";
		//dbg(blu, red);
	}
}


Measured memory_bytes: 17536
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#if defined(DAIJOBU)
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}



int main(){
	FIO
	
	int n;
	cin >> n;
	int k;
	cin >> k;
	int b[n];
	for(int i = 0; i < k; i++)cin >> b[i];
	sort(b, b + k);
	for(int i = 0; i < (1 << n); i++){
		set<int> now;
		int rep = 0;
		for(int j = 0; j < n; j++){
			if(i & (1 << j))now.insert(j), rep += pow(2, j);
		}
		bool ok = true;
		for(int j = 0; j < k; j++)if(now.count(b[j]) == 0){ok = false;}
		if(ok){
			cout << rep << ':';
			for(auto j:now)cout << ' ' << j;
			cout << '\n';
		}
	}
	return 0;
}



Measured memory_bytes: 3352
function Main(input) {
    input = input.split(" ");
    n = parseInt(input[0], 10);
    y = parseInt(input[1], 10);

    var ok = false;
    for (var i = 0; i <= n; i++) {
        for (var j = 0; j <= n; j++) {
            var k = n - i - j;
            if (k < 0) continue;
            if (10000 * i + 5000 * j + 1000 * k == y) {
                console.log("%d %d %d\n", i, j, k);
                ok = true;
                break;
            }
        }
        if (ok) break;
    }
    
    if (!ok) console.log("-1 -1 -1\n");
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 23092
//#define anjn
//      Anjan Agarwala - anjn98

//#define opti
#ifdef opti
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#endif

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

typedef long long ll;
typedef unsigned long long int ull;
ll power(ll x,ll y,ll p){ll r=1; x=x%p; while(y){ if(y&1) r= r*x%p; y=y>>1; x=x*x%p; } return r; }
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
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());
int csrand(int l=0, int r=1e9){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}

#define PR(x) cout<<#x<<" : "<<x<<"\n";
#define PR1(x,y) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"\n";
#define PR2(x,y,z) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"  |  "<<#z<<" : "<<z<<"\n";
#define ED cout<<'\n';

#define IO              ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FILEIO          freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define all(v)          v.begin(),v.end()
#define endl            '\n'
#define fr1(j,n)        for(int j=0;j<n;j++)
#define fr(n)           for(int i=0;i<n;i++)
#define trav(x,s)       for(auto x:s)
#define PB              emplace_back
#define pii             pair<int,int>
#define pll             pair<long long int,long long int>
#define F               first
#define S               second 
#define binf            2000000000000000001

const int N=5e6+99;



int main() 
{


    int n;
    cin>>n;
    ll a[n],b[n];

    fr(n) a[i]=INT_MAX;

    fr(n-1) cin>>b[i];
    ll ans=0;
    for(int i=n-2;i>=0;i--)
    {
        a[i+1]=min(a[i+1],b[i]);
        a[i]=min(a[i],b[i]);
    }
    fr(n) ans+=a[i];

    cout<<ans<<endl;


}
    

    





 
    
     


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char   a,b;
    cin>>a>>b;
    string s1="",s2="";
    for(int i=0; i<a-'0'; i++)
        s1+=b;
    for(int i=0; i<b-'0'; i++)
        s2+=a;
        if(s1<=s2) cout<<s1<<endl;
        else cout<<s2<<endl;
}



Measured memory_bytes: 256
from itertools import*
n=int(input())
a=[list(map(int,input().split()))for _ in range(n)]
for k in range(n):
 b=a[k];b[3],b[4]=b[4],b[3]
t=0
for d,e in list(combinations(a,2)):
 for i in range(6):
  m=('012345','152043','215304','302541','410352','514320')[i]
  f=[d[int(k)]for k in m]
  if f[0]==e[0]and f[5]==e[5]:
   f=f[1:5]*2
   for j in range(4):
    if f[j:j+4]==e[1:5]:t=1
print(('Yes','No')[t==1])

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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define out(S) cout<<(S)<<endl;
#define ShowAll(collection) for(auto i:collection){out(i);}
#define beginend(v) v.begin(),v.end()
#define Foreach(item,collection) for(auto item : collection)

using pii=pair<int,int>;
using vb=vector<bool>;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vvc=vector<vector<char>>;
using ti3=tuple<int,int,int>;
using ulong=unsigned long;
template<typename T> void removeAt(vector<T>& v, int index) { v.erase(v.begin() + index); }
#define OCB(c) (c&1)|(c&2)<<2|(c&4)<<4|(c&8)<<6|(c&16)<<8|(c&32)<<10|(c&64)<<12|(c&128)<<14

int main(){
    ll a,b,c;
    cin >>a>>b>>c;
    if(a%2==0||b%2==0||c%2==0){
        out(0)
    }
    else{
        auto ans=a*b;
        ans=min(ans,b*c);
        ans=min(ans,a*c);
        out(ans)
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>

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

using namespace std;
typedef complex<double> vec;

double const pi = acos(-1);
double const eps = 1e-6;

int main(){
    int n;
    while (cin >> n && n){
        vector<vec> v(n);
        rep(i, n){
            double x, y; cin >> x >> y;
            vec p(x, y);
            v[i] = p;
        }

        int ans = 1;
        rep(i, n)rep(j, n)if (i != j){
            vec dir = v[i] - v[j];
            double d = abs(dir);
            if (d > 2) continue;
            ans = max(ans, 2);
            double h = sqrt(1 - d*d / 4);
            vec med = v[i] + v[j];
            med /= 2;
            vec c1 = polar(h, arg(dir) + pi / 2) + med;
            vec c2 = polar(h, arg(dir) - pi / 2) + med;
            int a1 = 0, a2 = 0;
            rep(k, n){
                if (abs(c1 - v[k]) <= 1) a1++;
                if (abs(c2 - v[k]) <= 1) a2++;
            }
            ans = max(ans, a1);
            ans = max(ans, a2);
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 1344
#include <bits/stdc++.h>
using namespace std;
#define rep(i,e) for(int i= 0; i< (int)(e); i++)
#define reps(i,s,e) for(int i = s; i < (int)(e); i++)
#define repr(i,s,e) for(int i = s; i > (int)(e); i--)
typedef long long ll;
long bigp = 1000000007;


int main(){
  ll n,m;
  cin >> n >> m;
  set<ll> a;
  rep(i,m){
    ll ai;
    cin >> ai;
    a.insert(ai);
  }
  vector<ll> ans(n+1);
  ans[0] = 1;
  ll ana = *a.begin();
  reps(i,1,n+1){
    if(i==ana){
      ans[i] = 0;
      a.erase(ana);
      ana = *a.begin();
    }else{
      if(i==1){
        ans[i] = ans[i-1];
      }else{
        ans[i] = (ans[i-1]+ans[i-2])%bigp;
      }
    }
  }
  cout << ans[n];
}

Measured memory_bytes: 5760
package main

import(
	"bufio"
	"os"
	"strings"
	"fmt"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	cards := strings.Split(sc.Text(), " ")
	alice, _ := strconv.Atoi(cards[0])
	bob, _ := strconv.Atoi(cards[1])
	if alice == bob {
		fmt.Printf("Draw")
	} else if (alice > bob && bob != 1) || alice == 1  {
		fmt.Printf("Alice")
	} else {
		fmt.Printf("Bob")
	}

}


Measured memory_bytes: 640
// In the Name of Allah. Ya Ali!
#include<bits/stdc++.h>
#define bp __builtin_popcount
typedef long long ll;
const ll MAX_N = 1e4+10;
const ll MAX_K = 105;
const ll MOD = 1e9+7;
using namespace std;

ll dp[MAX_N][MAX_K];
int a[MAX_N];
int m,n;

int main()
{
    string k;
    cin >> k >> m;
    n = k.length();
    reverse(k.begin(),k.end());
    for(int i = 1;i<=n;++i)
        a[i] = (k[i-1]-'0');
    dp[0][0] = 1;
    for(int i = 1;i<=n;++i)
    {
        for(int j = 0;j<m;++j)
        {
            for(int t = 0;t<=9;++t)
            {
                dp[i][j] += dp[i-1][(j-(t%m)+m)%m];
                dp[i][j] %= MOD;
            }
        }
    }
    ll ans = 0;
    int now = 0;
    for(int i = n;i>=1;--i)
    {
        for(int j = 0;j<a[i];++j)
            ans += dp[i-1][(m-((now+j)%m))%m],ans %= MOD;
        now += a[i];
        now %= m;
    }
    if (!now)
        ans++;
    ans += MOD-1;
    ans %= MOD;
    cout << ans;
    return 0;
}


Measured memory_bytes: 8576