akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define ld long double
#define vi vector<vector<ll> >
using namespace std;
const int MOD=1000000007;
const int MOD2=998244353;
const ll MAX=9187201950435737471;
const int N=100005;
const int INF=1e9+7;
const long double PI=acos(-1);



void solve(int T){
    int n,h;
    cin>>n>>h;
    int ans=0;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        if(x>=h)ans++;
    }
    cout<<ans<<"\n";
}

int main() {
    fastio

    int T=1;
    //cin>>T;
    for(int i=1;i<=T;i++){
        solve(i);
        //if(i<T)cout<<"\n";
    }
    return 0;
}


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

#define ll long long
#define ar array

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

	int n, k;
	cin >> n >> k;
	int ans=0;
	while(n) {
		++ans;
		n/=k;
	}
	cout << ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,m;
	cin>>n>>m;
	long long ans;
	for(int i=1;i<=3;i++)
	{
		if(i!=m&&i!=n)
		ans=i;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
a, b = [0]*m, [0]*m
for i in range(m):
    a[i], b[i] = map(int, input().split())
ans = [0]*n
c = a + b
for i in range(1,n+1):
    ans[i-1] = c.count(i)

for i in range(n):
    print(ans[i])

Measured memory_bytes: 3064
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

void inp_str(long int*);

int main(void) {

long int input1[150];
inp_str(input1);

long int N,L;

N=input1[0];
L=input1[1];

int i;
int sum=0;

int min;
int minn;

min=abs((L+0+1-1));
minn=(L+0+1-1);


for(i=0;i<N;i=i+1){

sum=sum+(L+i+1-1);

//printf("%ld",(L+i+1-1));

if(abs((L+i+1-1))<min){
	min=abs((L+i+1-1));
	minn=(L+i+1-1);
}


}



printf("%d\n",sum-minn);


    return 0;

}


void inp_str(long int instr[]){
char *ptr;
long int z,i,count;
char str[20000]={'\0'};
char *ln;

fgets(str, 20000, stdin); // 入力："123456\n"
ln = strchr(str, '\n'); /* 改行文字を検索 */
if (ln != NULL) { /* 改行が読み取られていたかどうか */
   *ln = '\0';    /* 改行文字を終端文字に置き換える */
}
else {            /* 入力ストリーム上に文字が残ってる場合 */
   while (1) {    /* 改行文字が読み取られるまで空読みする */
       z = getchar();
      if (z == '\n' || z == EOF) break;
   }
}
	count=0;
    ptr = strtok(str, " ");
    i = atol(ptr);
    instr[count]=i;
    count=count+1;
    // 2回目以降
    while(ptr != NULL) {
        // strtok関数により変更されたNULLのポインタが先頭
        ptr = strtok(NULL, " ");
        // ptrがNULLの場合エラーが発生するので対処
        if(ptr != NULL) {
		    i = atol(ptr);
    instr[count]=i;
    		count=count+1;
        }
    }
}



Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;

public static partial class Program
{
    public static void Main()
    {
        var ab = CRL().ArrayInts();
        if (ab.Any(x => x > 8))
        {
            Console.WriteLine(":(");
        }
        else
        {
            Console.WriteLine("Yay!");
        }
    }
}

public static partial class Program
{
    //テンプレここから
    public static int Sigma(int n, int next = 1, int val = 0) => next > n ? val : Sigma(n, next + 1, val + next);  
    public static long GCD(long a, long b) => b == 0 ? a : GCD(b, a % b);
    public static int GCD(int a, int b) => b == 0 ? a : GCD(b, a % b);
    public static long LCM(long a, long b) => a * b / GCD(a, b);
    public static int LCM(int a, int b) => a * b / GCD(a, b);
    public static string CRL() => Console.ReadLine();
    public static int ToInt(this double d) => (int) d;
    public static long ToLong(this double d) => (long) d;
    public static int ToInt(this string str) => int.Parse(str);
    public static long ToLong(this string str) => long.Parse(str);
    public static long[] ToLong(this IEnumerable<string> strs) => strs.Select(x => x.ToLong()).ToArray();
    public static int[] ToInt(this IEnumerable<string> strs) => strs.Select(x => x.ToInt()).ToArray();
    public static long[] ArrayLongs(this string str, char opr = ' ') => str.Split(opr).ToLong();
    public static int[] ArrayInts(this string str, char opr = ' ') => str.Split(opr).ToInt();
    public static long Diff(long a, long b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static int Diff(int a, int b) => Math.Abs(Math.Max(a, b) - Math.Min(a, b));
    public static long Sign(this long i) => Math.Sign(i);
    public static bool IsEven(this long i) => i % 2 == 0;
    public static bool IsEven(this int i) => i % 2 == 0;
    public static readonly int[] Dx = new[] {0, -1, 0, 1};
    public static readonly int[] Dy = new[] {-1, 0, 1, 0};
    public const int Mod = 1000000007;
    public static string alphabet = "abcdefghijklmnopqrstuvwxyz";
    public static long ToLong(this char c) => c.ToString().ToInt();
    public static long[] Sort(this long[] array) => array.OrderBy(x => x).ToArray();
    public static int[] Sort(this int[] array) => array.OrderBy(x => x).ToArray();
    public static long[] DSort(this long[] array) => array.OrderByDescending(x => x).ToArray();
    public static int[] DSort(this int[] array) => array.OrderByDescending(x => x).ToArray();
    public static string Join(this IEnumerable<string> array, string sep = "") => string.Join(sep, array);
    public static string Join(this IEnumerable<char> array, string sep = "") => string.Join(sep, array);

    public static string JoinToStr(this IEnumerable<int> array, string sep = "")
        => array.Select(x => x.ToString()).Join(sep);

    //テンプレここまで
}

Measured memory_bytes: 13396
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
	for j in range(i+1,n):
		for k in range(j+1,n):
			if l[i]+l[j]>l[k] and l[i]!=l[j] and l[j]!=l[k] and l[i]!=l[k]:
				ans+=1
print(ans)



Measured memory_bytes: 9184
import java.io.*;

class Main{
    public static void main(String[] args)throws IOException{
	int []data=new int[5];
	BufferedReader br=
	    new BufferedReader(new InputStreamReader(System.in));
	String[] buf=br.readLine().split(" ");
	for(int i=0;i<5;i++){
	    data[i]=Integer.parseInt(buf[i]);
	}
	java.util.Arrays.sort(data);
	for(int i=4;i>=0;i--){
	    System.out.print(data[i]);
	    if(i!=0)
		System.out.print(" ");
	    else
		System.out.println();
	}
    }
}

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

l = []
r = []

res = []


def fun(string, pos):
    counter = 0
    consec_counter = c + 1
    res = []
    while pos < n:
        # print(pos)
        if counter == k:
            break
        if consec_counter >= c and string[pos] == 'o':
            counter += 1
            consec_counter = 0
            res.append(pos)
        else:
            consec_counter += 1
        pos += 1;
    # print(res)
    return res


def invfun(string, pos):
    counter = 0
    consec_counter = c + 1
    res = []
    while pos >= 0:
        if counter == k:
            break
        # print(pos)
        if consec_counter >= c and string[pos] == 'o':
            counter += 1
            consec_counter = 0
            res.append(pos)
        else:
            consec_counter += 1
        pos -= 1;
    # print(res)
    return res


little_res = fun(s, 0)
lres = []
if len(little_res) == k:
    lres = little_res
else:
    exit()

little_res = invfun(s, n - 1)
rres = []
if len(little_res) == k:
    rres = little_res
else:
    exit()
# print(lres)
# print(rres)
for i in range(k):
    if lres[i] == rres[k - 1 - i]:
        print(lres[i] + 1)


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

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(ll (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define opf(i) cout<<fixed<<setprecision(10)<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;

//
void solve(std::string S){
  if(S=="SUN"){
    cout<<7<<endl;
    return;
  }if(S=="MON"){
    cout<<6<<endl;
    return;
  }if(S=="TUE"){
    cout<<5<<endl;
    return;
  }if(S=="WED"){
    cout<<4<<endl;
    return;
  }if(S=="THU"){
    cout<<3<<endl;
    return;
  }if(S=="FRI"){
    cout<<2<<endl;
    return;
  }if(S=="SAT"){
    cout<<1<<endl;
    return;
  }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <map>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
void abc117a()
{
  double t, x;
  cin >> t >> x;
  cout << t / x;
}
void abc117b()
{
  int n;
  cin >> n;
  int sum = 0;
  int max = 0;
  for (int i = 0; i < n; i++)
  {
    int temp;
    cin >> temp;
    sum += temp;
    if (temp > max)
      max = temp;
  }
  if (max < sum - max)
    cout << "Yes";
  else
  {
    cout << "No";
  }
}
int main(void)
{
  abc117b();
  //abc117a();
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

using namespace std;
using ll = long long;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  vector<int> a(3); rep(i, 3) cin >> a[i];
  int k; cin >> k;
  sort(a);
  outl(a[0] + a[1] + a[2] * int(pow(2, k)));
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 888
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<bool> ac_check(n, false);
    vector<int> wa_count(n, 0);
    int ac = 0;
    int wa = 0;
    for (int i=0; i<m; i++) {
        int p;
        string s;
        cin >> p >> s;
        if (!ac_check[p-1]) {
            if (s == "AC") {
                ac++;
                ac_check[p-1] = true;
            }
            else
                wa_count[p-1]++;
        }
    }

    for (int i=0; i<n; i++) {
        if (ac_check[i]) wa += wa_count[i];
    }
    cout << ac << " " << wa << endl;
}


Measured memory_bytes: 640
import fractions
a,b,c,d=map(int,input().split())
ans=0
ca=[]
da=[]
cda=[]
minimunc=-(-a//c)
minimund=-(-a//d)
minimuncd=-(-a//((c*d)//fractions.gcd(c,d)))
maximunc=b//c
maximund=b//d
maximuncd=b//((c*d)//fractions.gcd(c,d))
totalc=maximunc-minimunc+1
totald=maximund-minimund+1
totalcd=maximuncd-minimuncd+1

print((b-a+1)-(totalc+totald-totalcd))

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

void solve(){
    int n,m;cin>>n>>m;
    double p=pow(0.5,m);
    cout << (1900*m+100*(n-m))/p<<endl;
}

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


Measured memory_bytes: 512
#define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }

typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fr<<','<<a.sc<<')';
    return out;
  }
}

//const int INF=5e8;
int h,w;
char buf[10][10];
int main(){
  cin>>h>>w;
  REP(i,h) scanf("%s",buf[i]);

  int cnt=0;
  REP(i,h) REP(j,w) if(buf[i][j]=='#') ++cnt;
  puts(cnt==h+w-1?"Possible":"Impossible");
  return 0;
}





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

const int maxn = 510;

const int inf = 1 << 29;

typedef pair<int,int> II;

int f[maxn][maxn];

int a[maxn * maxn];

int t[maxn][maxn];

bool mark[maxn][maxn];


const int hi[4] = {1, -1, 0, 0};
const int hj[4] = {0, 0, 1, -1};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n = 0;
	cin >> n;
	
	for(int i = 0; i < n * n; i++) {
		cin >> a[i];
		a[i] --;
		mark[i / n][i % n] = true;
	}
	
	for(int i = 0 ; i < n; i++) {
		for(int j = 0; j < n; j++) {
			f[i][j] = min(i, min(j, min(n - i - 1, n - j - 1)));
		}
	}
	
	
	int res = 0;
	
	for(int i = 0 ; i < n ; i ++) {
		for(int j =0 ;j<n;j ++) {
			t[i][j] = inf;
		}
	}
	for(int i = 0; i < n * n; i++) {
		int v = a[i];
		int x = v / n;
		int y = v % n;
		res += f[x][y];
		queue<II> q;
		q.push(II(x, y));
		vector<II> vt;
		vt.push_back(II(x, y));
		mark[x][y] = 0;
		t[x][y] = 0;
		while (!q.empty()) {
			II u = q.front();
			q.pop();
			for(int i = 0; i < 4; i++) {
				int x1 = u.first + hi[i];
				int y1 = u.second + hj[i];
				if (x1 >= 0 && y1 >= 0 && x1 < n && y1 < n) {
					if (f[x1][y1] > f[x][y] + t[u.first][u.second]) {
						q.push(II(x1, y1));
						vt.push_back(II(x1, y1));
						f[x1][y1] = f[x][y] + t[u.first][u.second];
						t[x1][y1] = min(t[x1][y1], t[u.first][u.second] + mark[x1][y1]);
					} 
				}
			}
		}
		for(auto p:vt) t[p.first][p.second] = inf;
	}
	
	cout << res;
	return 0;
}

Measured memory_bytes: 10280
#include<stdio.h>
#include<string.h> 

char x[1100], y[1100];
int count[1100][1100] = {0};

int lcs(char x[], char y[])
{
    int i, j;
    int lenx = strlen(x);
    int leny = strlen(y);


    for(i = 0; i <= lenx; i++){
        for(j = 0; j <= leny; j++){
            if(x[i] == y[j]){
                count[i + 1][j + 1] = count[i][j] + 1;
            }
            else if(count[i + 1][j] > count[i][j + 1]){
                count[i + 1][j + 1] = count[i + 1][j];
            }
            else{
                count[i + 1][j + 1] = count[i][j + 1];
            }
        }
    }
    return count[i - 1][j - 1];
}
int main(void)
{
    int q, i;

    scanf("%d", &q);

    for(i = 0; i < q; i++){

        scanf("%s", x);
        scanf("%s", y);
        printf("%d\n",lcs(x, y));
    }

    return 0;
}


Measured memory_bytes: 6084
N, M = map(int, input().split())
H = []
for _ in range(N):
    H.append(list(map(int, input().split())))

P = []
for _ in range(M):
    P.append(list(map(int, input().split())))

def check(i):
    min_d = 10 ** 9
    x = H[i][0]
    y = H[i][1]
    idx = -1
    for i, p in enumerate(P):
        d = abs(x - p[0]) + abs(y - p[1])
        if d < min_d:
            min_d = d
            idx = i
    return idx

for i in range(N):
    near = check(i)
    print(near + 1)


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

int main(){
	int n[1000000]={0};
	int x, s, l;
	
	for(int i=1; i<=999999; i++){
		if(i==1) n[i]=-1;
		else if(n[i]==0){
			for(int k=2; k*i<=999999; k++){
				n[k*i]=-1;
			}
		}
	}
	
	while(cin>>x){
		for(int j=x-1;; j--){
			if(n[j]==0){s=j; break;}
		}

		for(int o=x+1;; o++){
			if(n[o]==0) {l=o; break;}
		}
		cout << s << " " << l << endl;
	}
	
	return 0;
}

Measured memory_bytes: 5072
#include <stdio.h>

int h[10];

void sort(void)
{
  int i, j, temp;

  for (i = 0; i < 10 - 1; i++) {
    for (j = 10 - 1; j > i; j--) {
      if (h[j - 1] > h[j]) {
        temp = h[j]; 
        h[j] = h[j - 1];
        h[j - 1]= temp;
      }
    }	
  }
}

int main(void)
{
  int i;

  for (i = 0; i < 10; i++){
    scanf("%d", &h[i]);
  }
  
  sort();
  for (i = 9; i > 6; i--){
    printf("%d\n", h[i]);
  }

  return (0);
}

Measured memory_bytes: 600
#include<stdio.h>

int main(void) {
	int r, c;
	int i, j;
	int a[100][100], m[100] = { 0 }, n[100] = { 0 };
	scanf("%d %d", &r, &c);
	for (i = 0; i < r; i++) {
		for (j = 0; j < c; j++) {
			scanf("%d", &a[i][j]);
			m[i] += a[i][j];
			n[j] += a[i][j];
		}
	}
	for (i = 0; i < r; i++) {
		for (j = 0; j < c; j++) {
			printf("%d ", a[i][j]);
		}
		printf("%d", m[i]);
		n[c] += m[i];
		puts("");
	}
	for (j = 0; j <= c; j++) {
		if (j != 0) printf(" ");
		printf("%d", n[j]);
	}
	puts("");
	return 0;
}


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

using namespace std;

int main(int argc, char const *argv[]) {
	int n;
	std::vector<int> a;
	std::cin >> n;
	for (size_t i = 0; i < n; i++) {
		int temp;
		std::cin >> temp;
		a.push_back(temp);
	}

	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());

	int alice,bob;
	alice = bob = 0;
	int i = 0;
	while (i < a.size()) {
		alice += a[i];
		i += 2;
	}
	i = 1;
	while (i < a.size()) {
		bob += a[i];
		i += 2;
	}

	std::cout << alice - bob << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e10;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 




////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

signed main(){
  int a,b;cin>>a>>b;
  cout << a*b/(__gcd(a,b)) << endl;
}


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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  int n, x; std::cin >> n >> x;
  vi vec(n);
  rep(i, n) std::cin >> vec[i];
  vec.pb(x), n++;
  sort(rng(vec));
  int ans;
  srep(i, 1, n) {
    if (i == 1) ans = vec[i] - vec[i-1];
    else ans = gcd(ans, vec[i]-vec[i-1]);
  }
  std::cout << ans << "\n";
}


Measured memory_bytes: 1024
import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

NUM = 20005

table = [""]*NUM


while True:

    T = str(input())
    if T == '-':
        break

    left = 0
    right = 0
    #長い配列にパターン文字列を転記
    for i in range(len(T)):
        # print(T[right])
        table[left+right] = T[right]
        right += 1

    num_suffle = int(input())

    for loop in range(num_suffle):
        pick_num = int(input())
        #先頭からpick_num文字を末尾に転記し、論理削除
        for i in range(pick_num):
            table[right+i] = table[left+i]
        left += pick_num
        right += pick_num

    for i in range(left,right):
        print("%s"%(table[i]),end = "")
    print()



Measured memory_bytes: 5732
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll MOD = 1e9+7; ll LLINF = 1LL << 60; int INF = INT_MAX;

//

int main(){
    int a,b; cin>>a>>b;
    cout<<ceil((a+b)/2.0)<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

const int INF = 1001001001;

int main(){
    int N, W; 
    cin >> N >> W;
    vector<int> w(N), v(N);
    rep(i,N) cin >> w[i] >> v[i];
    vector<vector<int>> dp(N+1,vector<int>(100005,INF));
    dp[0][0] = 0;
    for(int i = 0; i < N; ++i){
        for(int j = 0; j < 100001; ++j){
            if(j-v[i] < 0) dp[i+1][j] = dp[i][j];
            else dp[i+1][j] = min(dp[i][j], dp[i][j-v[i]]+w[i]);
        }
    }
    int ans = 0;
    for(int i = 0; i < 100001; ++i) {
        if(dp[N][i] <= W) ans = i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 40192
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back

int main(){
	int N, K;
	cin >> N >> K;
	int ans = 0;
	rep(i, N) {
		int h; cin >> h;
		if(h >= K) ans++;
	}

	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)
#define int long long 

signed main(){
    int N,Q;
    cin >> N >> Q;
    vector<int> A(N);
    rep(i,N) cin >> A[i];

    rep(i,Q){
        int x; cin >> x;
        int sum = 0,ans = 0,left = 0;
        rep(right,N){
            sum += A[right];
            while(sum > x) sum -= A[left],++left;
            ans += right - left + 1;
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
 

int main(){
  int n,d; cin >> n >> d;
  int x[n][d];
  rep(i,n)rep(j,d) cin >> x[i][j];
  int ans=0;
  double g=0;
  rep(i,n-1){
    for(int j=i+1; j<n; j++){
      g=0;
      rep(k,d){
        g+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
        //cout << g << endl;
      }
      g=sqrt(g);
      //cout << g << endl;
      rep(i,sqrt(16000)+1) if(g==i) ans++;
    }
  }

  cout << ans << endl;
return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;

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

  long long large, small;
  large = x / 500;
  small = (x - large * 500) / 5;

  cout << large * 1000 + small * 5 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;
#define MAXN 200000
#define MOD 1000000007
#define Trav(p) for(rint u = first[p], v; ~u; u = e[u].nex)
#define rint register int
#define gc() getchar()
inline int read(rint ans = 0, rint sgn = ' ', rint ch = gc())
{
	for(; ch < '0' || ch > '9'; sgn = ch, ch = gc());
	for(; ch >='0' && ch <='9';(ans*=10)+=ch-'0', ch = gc());
	return sgn-'-'?ans:-ans;
}
#define BUF_SIZE 1000000
#define _END fwrite(_Ob,1,_O-_Ob,stdout), _O = _Ob
#define Outc(a) (*_O++ = a)
char _Ob[BUF_SIZE+5], *_O = _Ob, _Os[25], *_Ot;
template <typename T> inline void Out(T x)
{
	if(!x){Outc('0'); return;} if(x < 0) Outc('-'), x = -x;
	for(_Ot = _Os; x; *_Ot++ = x%10+'0', x /= 10);
	for(; _Ot != _Os; Outc(*--_Ot)); if(_O-_Ob >= BUF_SIZE-50) _END;
}
int first[MAXN+5], fa[MAXN+5], dep[MAXN+5], c[MAXN+5], b[MAXN+5], hi[MAXN+5], se[MAXN+5], son[MAXN+5], pos[MAXN+5], dfn, tot, ans, n;
int _f[MAXN+5], *f[MAXN+5], _g[MAXN+5], *g[MAXN+5], _sz[MAXN+5], *sz[MAXN+5];
struct Edge{int to,nex; Edge(){} Edge(int _to, int _nex){to=_to,nex=_nex;}}e[MAXN+5];
inline void Add(int a, int b){e[tot] = Edge(b,first[a]), first[a] = tot++;}
void DFS_h(int p){++c[dep[p]=dep[fa[p]]+1], hi[p] = 1; Trav(p) DFS_h(v=e[u].to), hi[p]<hi[v]+1?se[p]=hi[p],hi[p]=hi[v]+1,son[p]=v:se[p]=max(se[p],hi[v]+1);}
void DFS_f(int p)
{
	pos[p] = ++dfn, f[p] = _f+dfn, g[p] = _g+dfn, sz[p] = _sz+dfn, f[p][0] = g[p][0] = sz[p][0] = 1;
	if(son[p]){int v = son[p]; DFS_f(v); for(rint i = 0; i < se[p]-1; g[v][i] = b[sz[v][i]]-f[v][i], i++);}
	for(rint u = first[p], v, i; ~u; u = e[u].nex)
		if((v=e[u].to)-son[p])
			for(DFS_f(v), i = 0; i < hi[v]; sz[p][i+1] += sz[v][i], i++)
				g[v][i] = b[sz[v][i]]-f[v][i], f[p][i+1] = (1ll*f[p][i+1]*g[v][i]+1ll*g[p][i+1]*f[v][i])%MOD, g[p][i+1] = 1ll*g[p][i+1]*g[v][i]%MOD;
}
int main()
{
	n = read(), memset(first,-1,-~n<<2); for(rint i = 1; i <= n; Add(fa[i]=read(),i), i++);
	b[0] = 1; for(rint i = 1; i <= n+1; b[i] = b[i-1]<<1, b[i]<MOD?:b[i]-=MOD, i++); DFS_h(0), DFS_f(0);
	for(rint i = 0; i < hi[0]; ans = (ans+1ll*f[0][i]*b[n+1-c[i+1]])%MOD, i++); printf("%d\n",ans); return 0;
}

Measured memory_bytes: 29056
#include <stdio.h>
#pragma warning(disable : 4996)
int n;
int main() {
	while (true) {
		scanf("%d", &n);
		if (n == 0) break;
		int ret = n > 1 ? 1 : 0;
		for (int i = 2; i * i <= n; i++) {
			if (n % i == 0) {
				if (i * i != n) {
					ret += i + n / i;
				}
				else {
					ret += i;
				}
			}
		}
		if (n > ret) {
			printf("deficient number\n");
		}
		else if (n == ret) {
			printf("perfect number\n");
		}
		else {
			printf("abundant number\n");
		}
	}
	return 0;
}

Measured memory_bytes: 2576
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A,B;
    cin >> A >> B;
    if(A==B){
        cout << 1 << endl;
        return 0;
    }
    ll t = 0,t2 = -1;
    for(int i=0;i<60;i++){
        if((B^A)&(1LL<<i)) t = i;
    }
    for(int i=0;i<t;i++){
        if(B&(1LL<<i)) t2 = i;
    }
    A %= (1LL<<(t+1));
    B %= (1LL<<(t+1));
    ll l1 = A,r1 = (1LL<<t)+(1LL<<(t2+1));
    ll l2 = (1LL<<t)+A,r2 = (1LL<<(t+1));
    ll ans = r1-l1+max(r2-l2,0LL);
    if(r2>l2 && r1>l2) ans -= r1-l2;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,b[200000],i,max,min;
  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",&b[i]);
  }
  min=b[0];
  max=b[1]-b[0];
  for(i=1;i<a;i++){
    if(max<b[i]-min){
      max=b[i]-min;
    }
    if(min>b[i]){
      min=b[i];
    }
  }
  
  printf("%d\n",max);
  return 0;
}

Measured memory_bytes: 1380
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

const int MOD = 1000000007;

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

signed main() {
    SS(int,n);
    ll sum=0,dif=0;
    SV(int,a,n);
    SV(int,b,n);
    rep(i,n)sum+=b[i]-a[i];
    for(int i = 0;i < n;i++)if(b[i] > a[i])dif+=(1 + b[i] - a[i])/2;
    Yes(sum>=dif);
}

Measured memory_bytes: 384
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m = map(int, input().split())

def factor(n, m=None):
    # mを与えると、高々その素因数まで見て、残りは分解せずにそのまま出力する
    arr = {}
    temp = n
    M = int(-(-n**0.5//1))+1
    if m is not None:
        M = min(m+1, M)
    for i in range(2, M):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr[i] = cnt

    if temp!=1:
        arr[temp] = 1

    if not arr:
        arr[n] = 1

    return arr

d = factor(m)

M = 10**9+7 # 出力の制限
N = max(d.values())+10+n # 必要なテーブルサイズ

g1 = [None] * (N+1) # 元テーブル
g2 = [None] * (N+1) #逆元テーブル
inverse = [None] * (N+1) #逆元テーブル計算用テーブル
g1[0] = g1[1] = g2[0] = g2[1] = 1
inverse[0], inverse[1] = [0, 1] 

for i in range( 2, N + 1 ):
    g1[i] = ( g1[i-1] * i ) % M 
    inverse[i] = ( -inverse[M % i] * (M//i) ) % M # ai+b==0 mod M <=> i==-b*a^(-1) <=> i^(-1)==-b^(-1)*aより
    g2[i] = (g2[i-1] * inverse[i]) % M 

def cmb(n, r, M):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return (g1[n] * g2[r] * g2[n-r]) % M

if m!=1:
    ans = 1
    for v in d.values():
        ans *= cmb(v+n-1, n-1, M)
        ans %= M
else:
    ans = 1
print(ans%M)

Measured memory_bytes: 72856
N, D = map(int, input().split())
x = [None for k in range(N)]
for k in range(N):
  a = list(map(int, input().split()))
  x[k] = a
ans = 0
for n in range(N):
  for p in range(n):
    wa = 0
    for d in range(D):
      wa += (x[n][d] - x[p][d])**2
    t = wa ** 0.5
    if wa == int(t) **2:
      ans += 1
print(ans)

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



int main(){
	cin.tie(0)->sync_with_stdio(0);
	string s, t;
	cin >> s >> t;
	int res = 0;
	for(auto i = 0; i < int(s.size()); ++ i){
		res += s[i] != t[i];
	}
	cout << res;
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

Measured memory_bytes: 3824
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)

#define endl "\n"
#define pb push_back
#define elif else if
#define cout_db cout << fixed

#define MOD 1000000007
 
const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};

typedef long long ll;

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

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

	int n;
	cin >> n;

	int ans = 0, k[3] = {3, 5, 7};
	for (int i = 2; i < 9; i++) {
		for (int j = 0; j < pow(3, i+1); j++) {
			int keta = i;
			int a = 0, p = j;
			for (int l = 0; l < i+2; l++) {
				if(p % 3 == 0) a += k[0]*pow(10, keta);
				if(p % 3 == 1) a += k[1]*pow(10, keta);
				if(p % 3 == 2) a += k[2]*pow(10, keta);
				p /= 3;
				keta--;
			}
			// cout << a << endl;
			if(a > n) continue;
			string s = to_string(a);
			bool check[3] = {0, 0, 0};
			bool yes = 1;
			for (int l = 0; l < s.size(); l++) {
				if(s[l] == '3') check[0] = 1;
				elif(s[l] == '5') check[1] = 1;
				elif(s[l] == '7') check[2] = 1;
				else yes = 0;
			}
			if(yes && check[0] && check[1] && check[2]){
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 384
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;
class Program
{
    public static Scanner cin;
    static void Main()
    {
        cin = new Scanner();
        
        int[] nk = cin.arrayInt(2);
        int n = nk[0];
        int k = nk[1];
        string s = ReadLine();
        List<int> nums = new List<int>();
        int count = 0;
        int now = 1;
        if (s[0] == "0"[0]) {
            nums.Add(0);
            now = 0;
        }
        for (int a = 0; a < n; a++)
        {
            if (now == int.Parse(s[a].ToString())) count++;
            else
            {
                now ^= 1;
                nums.Add(count);
                count = 0;
                count++;
            }
            
        }
        nums.Add(count);
        if (s[s.Length-1] == "0"[0])
        {
            nums.Add(0);
        }
        
        


        int max = 0;
        int left = 0;
        int right = 0;
        int tmp = 0;
        for(int a = 0; a < nums.Count; a+=2)
        {
            int nextleft = a;
            int nextright = Math.Min(a + k * 2 + 1, nums.Count);
            while (nextleft>left)
            {
                tmp -= nums[left];
                left++;
            }
            while (nextright>right)
            {
                tmp += nums[right];
                right++;
            }
            max = Math.Max(max,tmp);
        }

        WriteLine(max);
        Console.ReadLine();

    }
}





class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string input()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return input();
        i = 0;
        return s[i++];
    }

    public int inputInt()
    {
        return int.Parse(input());
    }
    public int[] arrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = inputInt() + add;
        }
        return Array;
    }

    public long inputLong()
    {
        return long.Parse(input());
    }

    public long[] arrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = inputLong() + add;
        }
        return Array;
    }

    public double inputDouble()
    {
        return double.Parse(input());
    }


    public double[] arrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = inputDouble() + add;
        }
        return Array;
    }
}

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

int main(void){
  int m, f, r;
  char s;
  for (int a=0; a<50; a++) {
    cin >> m >> f >> r;
    if (m==-1 && f==-1 && r==-1) {
      break;
    } else {
      //処理開始
      if (m==-1 or f==-1) {
        s = 'F';
      } else if (m+f>=80) {
        s = 'A';
      } else if (m+f>=65) {
        s = 'B';
      } else if (m+f>=50 or (m+f>=30 && r>=50)) {
        s = 'C';
      } else if (m+f>=30) {
        s = 'D';
      } else if (m+f<30) {
        s = 'F';
      }
      //処理終了
      cout << s << endl; //出力
    }
  }
}



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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

class Dice {
public:
    vector<int> eye;
    int t, e, w, s, n, d;
    Dice(vector<int> v) {
        eye = v;
        t = eye[0];
        s = eye[1];
        e = eye[2];
        w = eye[3];
        n = eye[4];
        d = eye[5];
    }
    void rotate(char dist);
};

void Dice::rotate(char dist) {
    char temp;
    switch (dist) {
    case 'E':
        temp = t;
        t = w; w = d; d = e; e = temp;
        break;
    case 'N':
        temp = t;
        t = s; s = d; d = n; n = temp;
        break;
    case 'S':
        temp = t;
        t = n; n = d; d = s; s = temp;
        break;
    case 'W':
        temp = t;
        t = e; e = d; d = w; w = temp;
        break;
    case 'L':
        temp = e;
        e = n; n = w; w = s; s = temp;
        break;
    case 'R':
        temp = e;
        e = s; s = w; w = n; n = temp;
        break;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vi d(6); for (int i = 0; i < 6; i++) cin >> d[i];
    auto dice = Dice(d);
    int n; cin >> n;
    for (int i = 0; i < n; i++) {
        int t, s; cin >> t >> s;
        int ans = 0;
        for (int j = 0; j < 4; j++) {
            dice.rotate('E');
            for (int k = 0; k < 4; k++) {
                dice.rotate('R');
                if (t == dice.t && s == dice.s) ans = dice.e;
            }
        }
        dice.rotate('N');
        for (int k = 0; k < 4; k++) {
            dice.rotate('R');
            if (t == dice.t && s == dice.s) ans = dice.e;
        }
        dice.rotate('N');
        dice.rotate('N');
        for (int k = 0; k < 4; k++) {
            dice.rotate('R');
            if (t == dice.t && s == dice.s) ans = dice.e;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3156
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <limits.h>

using namespace std;

int main(int argc, char const* argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int D, N;
    cin >>D>>N;
    if (N == 100) ++N;
    cout << N * (int)pow(100, D) << '\n';
    return 0;
}


Measured memory_bytes: 888
#include<cstdio>
#include<algorithm>
#include<vector>
#include<bitset>
#define N_ 710
using namespace std;
int n, m, Col[N_], w[N_][N_], cc[3];
bitset<1024>Set;
vector<int>E[N_];
void DFS(int a, int col) {
	cc[col]++;
	Col[a] = col;
	for (auto &x : E[a]) {
		if (!Col[x]) DFS(x, 3 - col);
	}
}
int main() {
	int i, j, a, b;
	scanf("%d%d", &n, &m);
	for (i = 0; i < m; i++) {
		scanf("%d%d", &a, &b);
		w[a][b] = w[b][a] = 1;
	}
	for (i = 1; i <= n; i++)for (j = i + 1; j <= n; j++) {
		if (w[i][j] == 0) {
			E[i].push_back(j);
			E[j].push_back(i);
		}
	}
	Set[0] = 1;
	for (i = 1; i <= n; i++) {
		if (!Col[i]) {
			cc[1] = cc[2] = 0;
			DFS(i,1);
			Set = (Set << cc[1]) | (Set << cc[2]);
		}
	}
	for (i = 1; i <= n; i++)for (auto &x : E[i]) {
		if (Col[i] == Col[x]) {
			puts("-1");
			return 0;
		}
	}
	int res = 1e9;
	for (i = 0; i <= n; i++) {
		if (Set[i]) {
			res = min(res, i*(i - 1) / 2 + (n - i)*(n - i - 1) / 2);
		}
	}
	printf("%d\n", res);
}

Measured memory_bytes: 3200
module IntSet = Set.Make (struct
  type t = int
  let compare = (-)
end)

let read_ns () = Scanf.scanf "%d %d " (fun x y -> (x, y))

let () =
  let (n, m) = read_ns () in
  let g = Array.make n IntSet.empty in
  for _ = 1 to m do
    let (a, b) = read_ns () in
    let (a, b) = (a - 1, b - 1) in
    g.(a) <- IntSet.add b g.(a);
    g.(b) <- IntSet.add a g.(b);
  done;
  print_endline
    (if IntSet.is_empty (IntSet.inter g.(0) g.(n - 1)) then "IMPOSSIBLE"
     else "POSSIBLE")

Measured memory_bytes: 31744
#include<bits/stdc++.h>
using namespace std;
using p = pair<int,int>;
using pp = pair<p,int>;
using ll = long long;
const auto INF =(ll)1e9;
int main(){
  int n;
  cin >> n;
  auto ans = 0;
  for (int i = 1; i <= n; i++)
  {
    if(i%2==1) ans++;
  }
  
  cout << fixed <<setprecision(6)<< (double)ans/n;
  return 0;
}

Measured memory_bytes: 256
# AtCoder Beginner Contest 109 20180908
# Question:A

def main(nums):
	
	if nums[0]*nums[1] %2:
		return "Yes"
	else:
		return "No"
	
	
	
	
nums = input().split(" ")
nums = [int(c) for c in nums]

print(main(nums))

Measured memory_bytes: 2940
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<list>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
using namespace std;

const int MAX = 500001;
const int NIL = -1;
struct Node {
	int key;
	Node* parent, * left, * right;
};
struct Node T[MAX];
Node* head = NULL;

bool find(Node* x, int k)
{
	while (x != NULL && k != x->key) {
		if (k < x->key)
			x = x->left;
		else
			x = x->right;
	}
	if (x == NULL)
		return false;
	else
		return true;
}

void preParse(Node* u)
{
	if (u == NULL)
		return;
	cout << " " << u->key;
	preParse(u->left);
	preParse(u->right);
}

void inParse(Node* u)
{
	if (u == NULL)
		return;
	inParse(u->left);
	cout << " " << u->key;
	inParse(u->right);
}

int main(void)
{
	int n, key;
	char ss[10];
	cin >> n;
	memset(ss, 0, sizeof(ss));
	for (int i = 0; i < n; i++) {
		scanf("%s", ss);
		if (ss[0] == 'i') {
			cin >> key;
			Node* y = NULL, * x = head, * z = new(Node);
			z->key = key;
			z->left = z->parent = z->right = NULL;
			while (x != NULL) {
				y = x;
				if (z->key < x->key)
					x = x->left;
				else
					x = x->right;
			}
			z->parent = y;
			if (y == NULL)
				head = z;
			else if (z->key < y->key)
				y->left = z;
			else
				y->right = z;
		}
		else if (ss[0] == 'f') {
			cin >> key;
			if (find(head, key))
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
		else {
			inParse(head);
			cout << endl;
			preParse(head);
			cout << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 21900
#include <iostream>

int main() {
  int a, b;
  std::cin >> a >> b;
  if (a > 0)
    std::cout << "Positive" << std::endl;
  else if (b >= 0)
    std::cout << "Zero" << std::endl;
  else if ((b-a)%2==0)
    std::cout << "Negative" << std::endl;
  else
    std::cout << "Positive" << std::endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stdlib.h>
#include <cmath>
#include <math.h>
#include <fstream>
#include <bitset>
#include <time.h>
#include <queue>
#include <cassert>
#include <cstdio>
#define int long long
using namespace std;
signed main()
{
    int n, m, k;
    cin >> n >> m >> k;
    if (k == 0){
        cout << "Yes" << endl;
        return 0;
    }
    for (int i=1;i <=n; i++){
        for (int j=1; j <= m;j++){
            int var = i*j + (n-i)*(m-j);
            if (var == k){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


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

int dp[100];

//最大公約数
int gcd(int x, int y){
  if(x % y == 0) return y;
  return gcd(y, x % y);
}
//最小公倍数
int lcm(int x, int y){
  return x * y / gcd(x, y);
}
//フィボナッチ数列
//配列dpを-1で初期化する
int fib(int n){
  if(n == 0 || n == 1) return dp[n] = 1;
  if(dp[n] != -1) return dp[n];
  return dp[n] = fib(n - 1) + fib(n - 2);
}
//階乗計算(factorial)
int fact(int n){
  if(n = 1) return 1;
  return n * fact(n - 1);
}
//累乗計算(Exponentiation)
//x**y
ll expo(int x, int y){
  ll ans = 1;
  rep(i, y){
    ans *= x;
  }
  return ans;
}
//桁数
int keta(ll x){
  if(x == 0) return 1;
  int res = 0;
  while(x){
    x /= 10;
    res++;
  }
  return res;
}


int main(){
  int a, b, k;
  cin >> a >> b >> k;
  int n = min(a,b);
  vector<int> can(n);
  int cnt = 0;
  for(int i = n; i > 0; i--){
    if(a % i == 0 && b % i == 0) {
      can[cnt] = i;
      cnt++;
    }
  }
  cout << can[k-1] << endl;
}




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

int main(){

    int N;
    cin >> N;
    vector<int> B(N-1);
    rep(i,N-1) cin >> B[i];

    int max = B[0] + B[N-2];
    rep(i, N-2){
        if(B[i] > B[i+1]){
            max += B[i+1];
        }
        else{
            max += B[i];
        }
    }

    cout << max << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner stdIn = new Scanner(System.in);
		
		while(true)
		{
			int H = stdIn.nextInt();
			int W = stdIn.nextInt();
			
			if(H==0 && W==0)
			{
				break;
			}
			
			for(int i=0;i<H;i++)
			{
				for(int j=0;j<W;j++)
				{
					if(i==0 || i==H-1 || j==0 || j==W-1)
					{
						System.out.print('#');
					}
					else
					{
						System.out.print('.');
					}
				}
				System.out.println();
			}
			System.out.println();
		}
	}

}

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

using namespace std;

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

    int n;
    cin >> n;
    int sm = 0;
    int x[n];
    for (int i = 0; i < n; i++) {
        cin >> x[i];
        sm += x[i];
    }
    int p1 = sm / n, p2 = (sm + n - 1) / n;
    int s1 = 0, s2 = 0;
    for (int i = 0; i < n; i++) {
        s1 += (x[i] - p1) * (x[i] - p1);
    }
    for (int i = 0; i < n; i++) {
        s2 += (x[i] - p2) * (x[i] - p2);
    }
    cout << min(s1, s2) << '\n';
}

Measured memory_bytes: 256
s = input()
if(len(s) != 26):
    for c in range(ord('a'), ord('z')+1):
        c = chr(c)
        if(not c in s):
            print(s+c)
            exit()
s = list(s)
t = []
while(s):
    for c in t:
        if(c > s[-1]):
            print(''.join(s[:-1]) + c)
            exit()
    t.append(s.pop())
print(-1)


Measured memory_bytes: 3064