akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define RREP(i, N) for (int i =(int)N-1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

int main(){
  int n,x;
  cin>>n>>x;
  int l[n];
  int count=1;
  int dp[n+1];
  REP(i,n){
    cin>>l[i];
  }
  dp[0]=0;
  dp[1]=0;
  REP(i,n){
    dp[i+2]=dp[i+1]+l[i];
    if(dp[i+2]<=x){
      count++;
    }else{
      break;
    }
  }
  cout<<count<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define mmod 998244353
#define all(v) v.begin(), v.end()
#define INF LLONG_MAX/3
using namespace std;
int mypow(int a, int b, int c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	int z = mypow(a, b / 2, c);
	return z * z%c;
}
int x[100000];
signed main() {
	int a, b;
	double sum = 0;
	cin >> a >> b;
	f(i, a) {
		cin >> x[i];
		sum += x[i];
	}
	sort(x, x + a);
	if (x[a - b] >= sum / 4 / b)puts("Yes");
	else puts("No");
}

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

struct magic{
    int A;
    int B;
    double cp;
};

bool cmp(const magic &a, const magic &b){
    return a.cp < b.cp;
}

int main(){
    int H,N;
    cin >> H >> N;
    magic AB[N];
    for(int i=0; i<N; i++){
        int A,B;
        cin >> A >> B;
        AB[i].A = A;
        AB[i].B = B;
        AB[i].cp= (double) A/B;
    }

    int dp[H+1];
    bool flag=true;

    int Bmin = -1;

    for(int i=0; i<H; i++){
        dp[i] = (int) 1e9;
    }

    dp[0] = 0;

    for(int i=0; i<H; i++){
        for(int j=0; j<N; j++){
            if( i+ AB[j].A >=H ){
                if( ( Bmin > dp[i] + AB[j].B || Bmin == -1) ){
                    Bmin = dp[i]+ AB[j].B;
                }
                continue;
            }
            if( dp[i+AB[j].A] > dp[i]+AB[j].B ){
                dp[i+AB[j].A] = dp[i] + AB[j].B;
                flag = true;
            }
        }
    }

    cout << Bmin << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static boolean used[];
    static int nums[];
    static String fs[];
    static int ws[];
    static int ss[];
    static double g;
    static int[] ans;
    static int total;

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int n = sc.nextInt();
            if (n == 0)
                break;
            nums = new int[n];
            used = new boolean[n];
            fs = new String[n];
            ws = new int[n];
            ss = new int[n];
            ans = new int[n];
            total = 0;
            for (int i = 0; i < n; i++) {
                String f = sc.next();
                int w = sc.nextInt();
                int s = sc.nextInt();
                fs[i] = f;
                ws[i] = w;
                ss[i] = s;
                total += w;
            }
            g = Double.MAX_VALUE;
            permutation(0, n, 0);
            for (int i = n - 1; i >= 0; i--) {
                System.out.println(fs[ans[i]]);
            }
        }
    }

    public static void permutation(int pos, int n, int sum) {
        if (pos == n) {
            int a = 0;
            for (int i = 0; i < n; i++) {
                a += (n - i) * ws[nums[i]];
            }
            double G = 1.0 * a / total;
            if (G < g) {
                for (int i = 0; i < n; i++) {
                    ans[i] = nums[i];
                }
                g = G;
            }
            return;
        }

        for (int i = 0; i < n; i++) {
            if (used[i])
                continue;
            if (ss[i] < sum)
                continue;
            nums[pos] = i;
            used[i] = true;
            permutation(pos + 1, n, sum + ws[i]);
            used[i] = false;
        }
        return;
    }
}

Measured memory_bytes: 12000
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

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

  int n;
  cin>>n;
  std::vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  std::sort(a.begin(), a.end());
  int result=0;
  std::vector<int> x;
  std::vector<int> y;

  if(0<=a.front()){
    x.push_back(a.front());
    y.push_back(a.back());
    int temp=a.front()-a.back();
    std::vector<int> new_a;
    new_a.push_back(temp);
    for(int i=1;i<n-1;i++){
      new_a.push_back(a[i]);
    }
    a=new_a;
  }else if(a.back()<=0){
    x.push_back(a.back());
    y.push_back(a.front());
    int temp=a.back()-a.front();
    std::vector<int> new_a;
    for(int i=1;i<n-1;i++){
      new_a.push_back(a[i]);
    }
    new_a.push_back(temp);
    a=new_a;
  }

  int left=a.back(),right=a.front();
  for(int i=1;i<a.size()-1;i++){
    if(a[i]<0){
      x.push_back(left);
      y.push_back(a[i]);
      left-=a[i];
    }else{
      x.push_back(right);
      y.push_back(a[i]);
      right-=a[i];
    }
  }

  x.push_back(left);
  y.push_back(right);
  cout<<left-right<<endl;
  for(int i=0;i<n-1;i++){
    cout<<x[i]<<" "<<y[i]<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 3440
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (int)(n); i++)
#define int long long
#define ll long long
using namespace std;
signed main(){
    int a,v,b,w,t;
    cin>>a>>v>>b>>w>>t;
    if(abs(a-b)>(v-w)*t){
        cout<<"NO"<<endl;
    }
    else{
        cout<<"YES"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(long long i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const int INF=1e18;
const int MOD=1e9+7;
const int MAX_M=5000;
const int MAX_V=2500;

struct edge { int from,to,cost;};
edge es[MAX_M];
int d[MAX_V];
bool eused[MAX_M];
int v,e,p;
int co=0;

void dfs(int x){
    REP(i,e){
      	if(eused[i])continue;
        if(es[i].to==x){
            eused[i]=true;
            dfs(es[i].from);
        }
    }
}

void shortest_path(){
    REP(i,v)d[i]=INF;
    d[0]=0;
    while(true){
        bool update = false;
      	co++;
      	if(co>2*v)break;
        REP(i,e){
            if(!eused[i])continue;
            edge z = es[i];
            if(d[z.from]!=INF && d[z.to]>d[z.from]+z.cost){
                d[z.to]=d[z.from]+z.cost;
                update = true;
            }
        }
        if(!update) break;
    }
}

void solve(){
    cin>>v>>e>>p;
    REP(i,e)eused[i]=false;
    REP(i,e){
        int a,b,c;cin>>a>>b>>c;a--;b--;c=p-c;
        es[i]={a,b,c};
    }
    dfs(v-1);
    shortest_path();
  	if(co>2*v){
      	cout<<-1<<endl;
      	return;
    }
    cout<<(d[v-1]!=INF?max(0ll,d[v-1]*(-1)):-1)<<endl;
}

signed main(){
    solve();
}

Measured memory_bytes: 512
(setq n(read))
(setq s(loop for i from 1 to n collect(read-line)))
(setq f 0)
(loop for i from 1 to(1- n)do
	  (if(char/=(char(nth(1- i)s)(1-(length(nth(1- i)s))))(char(nth i s)0))(incf f)))
(princ(if(or(> f 0)(<(length(remove-duplicates s :test #'equal))n))"No""Yes"))


Measured memory_bytes: 16096
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;

int main(void)
{
    IOS
    ll n,p;
    cin >> n >> p;

    ll ans = 1;
    if (n == 1) {
        ans = p;
    } else {
        ll x = pow(p,1.0/n);
        while(x > 1) {
            ll y = pow(x,n);
            if (p % y == 0) {
                p /= y;
                ans *= x;
            } else {
                x--;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-


if __name__ == '__main__':

    n = int(input())
    F = [None]*(n+1)

    def fibonacci(n):
        if n == 0 or n == 1:
            F[n] = 1
            return F[n]
        if F[n] is not None:
            return F[n]
        
        F[n] = fibonacci(n-2) + fibonacci(n-1)
        return F[n]

    print(fibonacci(n))




Measured memory_bytes: 5604
#include<stdio.h>
#include<iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define pb          push_back
#define pii         pair<long,long>
#define vi          vector<long>
#define vii         vector<pii>
#define mi          map<long,long>
#define mii         map<pii,long>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define fIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

ll sub(ll a, ll b){return (a-b+hell)%hell;}
ll add(ll a, ll b){return (a+b)%hell;}
ll mul(ll a, ll b){return (a*b)%hell;}



int main()
{
fIO;


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


long long n,sum=0,t=1,m=0;
//cin >> t;
while(t--){
cin>>n;
string s,s1="ABC";
cin>>s;
ll count=0;
rep(i,0,n-2){
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')count++;
}
cout<<count;



}
	
}

Measured memory_bytes: 256
# coding: utf-8

N = int(input())
a = [[0 for i in range(N)] for j in range(2)]
l = input().split(" ")
a[0] = [int(l[i]) for i in range(N)]
l = input().split(" ")
a[1] = [int(l[i]) for i in range(N)]

max = 0
for i in range(N):
    sum = 0
    for j in range(i+1):
        sum = sum + a[0][j]
    
    for j in range(N-i):
        sum = sum + a[1][i+j]
    
    if sum > max:
        max = sum
print(max)
#print(a)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <random>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
#define mod 1e9 + 7;

int main()
{
	ios_base::sync_with_stdio(false); 
	cin.tie(nullptr); 
	cout.tie(nullptr); 
	cout.setf(ios::fixed); 
	cout.precision(20);

	ll n,ans=0;
	cin >> n;
	vi v(n);
	rep(i, n) {
		cin >> v[i];
		while (v[i] % 2 == 0 && v[i] != 0) {
			v[i] /= 2;
			ans++;
		}
	}
	cout << ans << endl;
	/*ll n, ans=0,a,b;
	string s;
	cin >> a >> b;
	if (a == 0) cout << b;
	else {
		cout << (int) pow(100, a) * b << endl;
	}*/

	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {

		// 入力
		Scanner sc = new Scanner(System.in);
		int inputA = sc.nextInt();
		int inputB = sc.nextInt();
		sc.close();
		
		int c = inputB - inputA;
		int sum = 0;
		for (int i = c; i>0; i--) {
			sum += i;
		}
		
		System.out.println(sum - c - inputA);
	}
}

Measured memory_bytes: 22868
def prime_table_boolean(n):
    list1 = [True for _ in xrange(n + 1)]
    i = 2
    while i * i <= n:
        if list1[i]:
            j = i + i
        while j <= n:
            list1[j] = False
            j += i
        i += 1
    list1[1] = False
    del list1[0]

    #table = [i for i in xrange(n + 1) if list1[i] and i >= 2]
    #return table
    return list1

table = prime_table_boolean(10001)
while True:
    try:
        n = int(raw_input())
    except EOFError:
        break
    
    l = table[:n]
    r = l[::-1]
    ans = 0
    for j,k in zip(l,r):
        if j and k:
            ans += 1
    print ans

Measured memory_bytes: 5268
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define _GLIBCXX_DEBUG
#define INF 100000010
 #define PI 3.14159265359

using namespace std;
const int64_t mod = 1000000007;
const int64_t tmpMod = 998244353;

int main() {
 
  int64_t N;
  cin>>N;
  vector<int64_t> A(N,0);
  // for(int i=0; i<N; i++){cin>>A[i];}
  //vector<vector<int> > A(N,vector<int>(M));
  for(int i=1; i<100; i++){
    for(int j=1; j<100; j++){
      for(int k=1; k<100; k++){
       if((i*i) +( j*j )+ k*k + i*j + j*k + k*i - 1<N) A[(i*i) +( j*j )+ k*k + i*j + j*k + k*i - 1]++;
      }
    }
  }
  //sort(A.begin(),A.end());
  //for (int i = 0; i < N; i++) { maximum = max(maximum , A[i]);}
  for (int i = 0; i < N; i++) {cout << A[i] << endl; }
  
}

Measured memory_bytes: 3600
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<map>
#include<algorithm>

using namespace std;

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

    if (N == 1) {
        cout << "Hello World" << endl;
    } else {
        int A, B;
        cin >> A >> B;
        cout << A + B << endl;
    }


    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.__q = l
        heapq.heapify(self.__q)
        return

    def push(self, n):
        heapq.heappush(self.__q, n)
        return

    def pop(self):
        return heapq.heappop(self.__q)


MOD = int(1e09) + 7
INF = int(1e15)


def main():
    # sys.stdin = open("sample.txt")
    N, K = Scanner.map_int()
    A = Scanner.map_int()
    g = A[0]
    for i in range(1, N):
        g = Math.gcd(g, A[i])
    if K % g == 0 and max(A) >= K:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
    return


if __name__ == "__main__":
    main()


Measured memory_bytes: 63084
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define l1 long
#define ld long double
#define lld long long double
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define debug(x) cout<<"$ "<<x<<" $"<<endl
#define bug(x) cout<<"& "<<x<<" &"<<endl
#define all(v) v.begin(),v.end()
#define lop1(i,j,n) for(int i=j; i<n; ++i)
#define lop2(i,j,n) for(int i=j; i<=n; ++i)
#define lop3(i,n,j) for(int i=n; i>j; --i)
#define lop4(i,n,j) for(int i=n; i>=j; --i)
#define view(v) for(auto i: v) cout<<i<<" "
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
const ll M=1e9+7;
const ld PI=3.1415926536;
//int p[N];
//int find(int k){ return p[k]==k ? k : p[k]=find(p[k]); }
using namespace std;

void solve()
{
    int n;
    cin>>n;
    int ans=n/1000;
    if(n%1000) cout<<(ans+1)*1000-n;
    else cout<<0;
    return;
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    fast
    ll t=1;
	//cin>>t;
    while(t--) solve();
	return 0;
}


Measured memory_bytes: 3616
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
X=[0]*(m-1)
for i in range(m-1):
  X[i]=x[i+1]-x[i]
X.sort(reverse=True)
if n>=m:
  print(0)
else:
  print(max(x)-min(x)-sum(X[:n-1]))

Measured memory_bytes: 13968
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<int, int>;
vector<ii> dirs = {
  {1, 0}, {0, 1}, {-1, 0}, {0, -1},  // 4方向
  {1, 1}, {-1, 1}, {-1, -1}, {1, -1},  // 斜め
  {0, 0},  // 自身
};
template <class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template <class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }

// debug
template <class T> ostream& operator<<(ostream& s, vector<T>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : " "); return s; }
template <class T> ostream& operator<<(ostream& s, vector<vector<T>>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : "\n"); return s; }
template <class T, class S> ostream& operator<<(ostream& s, pair<T, S>& p) { s << "{" << p.first << ", " << p.second << "}"; return s; }
template <class T, class S> ostream& operator<<(ostream& s, map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
#ifdef _MY_DEBUG
  #define dump(...) cerr << "/* " << #__VA_ARGS__ << " :[" << __LINE__ << ":" << __FUNCTION__ << "]" << endl, dump_func(__VA_ARGS__), cerr << "*/\n\n";
#else
  #define dump(...)
  #define endl "\n"
#endif
void dump_func() { cerr << endl; }
template <class Head, class... Tail> void dump_func(Head&& h, Tail&&... t) { cerr << h << (sizeof...(Tail) == 0 ? "" : ", "), dump_func(forward<Tail>(t)...); }

struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = 1000000007;
// *************** TEMPLATE END *************** 

using S = bitset<500>;
const S ZERO;

void solve() {
  int n, m; cin >> n >> m;
  if (n == 0) exit(0);

  vector<unordered_map<S, int>> dp(2);
  dp[0][ZERO] = 0;
  REP (i, n) {
    string s; cin >> s;
    S b(s);
    for (auto& p: dp[0]) {
      chmax(dp[1][p.fi], p.se);
      chmax(dp[1][p.fi ^ b], p.se + 1);
    }
    swap(dp[0], dp[1]);
  }
  cout << dp[0][ZERO] << endl;
}

signed main() {
  while (1) solve();
}


Measured memory_bytes: 166800
#include <iostream>
#include <limits.h>
using namespace std;

#define MAX_DATA 200000

int GetMProfit(int[],int);

int main(){

	int i,n,data[MAX_DATA];
	
	cin>>n;
	for(i=0; i<n; i++){
		cin>>data[i];
	}
	
	cout<<GetMProfit(data,n)<<endl;

	return 0;
	
}

int GetMProfit(int data[],int n){

	int i,suspend,maxP=INT_MIN;
	
	suspend=data[0];
	
	for(i=1; i<n; i++){
		if(data[i]-suspend>maxP){
			maxP=data[i]-suspend;
		}
		if(suspend>data[i]){
			suspend=data[i];
		}
	}

	return maxP;

}

Measured memory_bytes: 1940
import bisect

N = int(input())
L = [int(i) for i in input().split()]
L.sort()
ans = 0

for ind_a, a in enumerate(L):
    for ind_b, b in enumerate(L[ind_a+1:]):
        x = bisect.bisect_left(L[ind_b+ind_a+2:], a+b)
        ans += x

print(ans)

Measured memory_bytes: 63184
#include<bits/stdc++.h>
using namespace std;
#define int long long int
// #include"Template.cpp"

int32_t main(){
	int n,a, b;
	cin >> n >> a >> b;
	int diff = abs(a-b);
	if(diff&1){
		if(a>b)
			swap(a, b);
		int ans = min(b-1, n-a);
		ans = min(ans, (a-1)+(b-(a-1))/2);
		ans = min(ans, (n-b)+(n-(a+n-b))/2+1);
		cout << ans << endl;
	}
	else{
		cout << diff/2 << endl;
	}
	return 0;
}

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

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

	int n, k;
	cin >> n >> k;
	long long a = 0, b = 0;
	for(int i = 1; i <= n; i++) {
		if(i % k == 0) a++;
		if(i % k == k / 2) b++;
	}
	if(k % 2 == 1) {
		cout << a * a * a << endl;
	} else {
		cout << a * a * a + b * b * b << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin>>n;
    long long x = 0, t = 0;
    for (long long i = 1; i <= n; i++)
    {
    	if (i % 3 == 0 || i % 5 == 0) x+=i;
    	t+=i;
	}
	printf("%lld", t - x);
	return 0;
}

Measured memory_bytes: 3752
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long ch[] = new long[4];
		String str = sc.next();
		for(int i = 0; i < 4; i ++) {
			ch[i] = str.charAt(i);
		}
		Arrays.sort(ch);
		System.out.println(ch[0] == ch[1] && ch[2] == ch[3] && ch[1] != ch[2] ? "Yes" : "No");
	}
}

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

int main(){
	string s; cin>>s;
	if(s[0] != 'A'){
		puts("WA");
		return 0;
	}
	else{
		int cnt = 0;
		int ind = -1;
		for(int i =2; i < int(s.size()) - 1; i++){
			if(s[i] == 'C'){
				cnt++;
				ind = i;
			}
		}
		if(cnt != 1){
			puts("WA");
			return 0;
		}
		else{
			for(int i = 1; i < int(s.size()); i++){
				if(s[i] == toupper(s[i]) && i != ind){
					puts("WA");
					return 0;
				}
			}
		}
	}
	puts("AC");
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

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

  vector<int> b(m);
  REP(i,m){
    cin >> b[i];
  }

  int ans = 0;
  REP(i,n){
    int sum = c;
    REP(j,m){
      int a;
      cin >> a;
      sum += a * b[j];
    }
    if(sum > 0) ans++;
  }

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



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

#define ull unsigned long long
#define ll long long
#define ld long double
#define endl << "\n"
#define sp << " "
#define spp << " " <<
#define allv(v) v.begin(),v.end()
#define lmax 9223372036854775807
#define lmin -9223372036854775807
#define lopi() for(i=0;i<n;++i)
#define loi(a,b) for(i=a;i<b;++i)
#define lopj() for(j=0;j<n;++j)
#define loj(a,b) for(j=a;j<b;++j)
#define ft first
#define sd second
#define pb push_back
#define pf push_pront
#define mod 1000000007
#define lower(str) transform(str.begin(), str.end(), str.begin(), ::tolower);
#define upper(str) transform(str.begin(), str.end(), str.begin(), ::toupper);
#define mset(a,b) memset(a,b,sizeof(a))
#define crap ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define PI acos(-1)

int main(){
//	crap ;
    int timer;
    // cin >>timer;
    timer=1 ;
    while(timer--){
    	ll n,m,i,j,k,a,b ;
    	cin >>a>>b ;
    	if( 2*a <= b && b <= 4*a && b%2 == 0 )
    		cout << "Yes" endl ;
    	else
    		cout << "No" endl ;
    }
}

Measured memory_bytes: 3604
#include "bits/stdc++.h"
using namespace std;
#define fst first
#define scd second
int ans[2000];
signed main()
{
	int n, x, y;
	scanf("%d%d%d", &n, &x, &y);
	for(int i = 1; i <= n; ++i)
	{
		for(int j = i + 1; j <= n; ++j)
		{
			++ans[min(j - i, abs(x - i) + 1 + abs(j - y))];
		}
	}
	for(int i = 1; i < n; ++i)
	{
		printf("%d\n", ans[i]);
	}
}


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

int main(){
  string s;
  cin >> s;
  bool ok=false;
  int stlength=0;
  for(int i=2,l=s.size();i<l;i+=2){
    string s2="";
    for(int j=0;j<l-i;j++)
      s2+=s.at(j);
    ok=true;
    for(int j=0;j<s2.size()/2;j++){
      if(s2.at(j)!=s2.at(j+s2.size()/2)){
        ok=false;
        break;
      }
      stlength=s2.size();
    }
    if(ok)
     break; 
  }
  cout << stlength << endl;
}
 

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

string suffle(string s,int len,int num);

int main(){
        int m;
        string s ;
        string haki;
        int count = 0;
        int h[100] = {0};
        bool q = false;
        int l = 0;
        while(1){
                getline(cin,s);
                if(s == "-") break;
                cin >> m;
                getline(cin,haki);
                int s_num = s.length();
                for(int i = 0; i < m;i++){
                        cin >>h[i];
                        getline(cin,haki);
                }
                for(int i = 0; i < m; i++){
                        s = suffle(s,s_num,h[i]);
                }
                cout << s << endl;
        }
        return 0;
}
string suffle(string s,int len,int num){
        char k[200] ={""};
        for(int i = 0; i < num; i++){
                k[i] = s[i];
        }
        for(int i = 0; i < len - num; i++){
                s[i] =  s[i+ num];
        }
        for(int i = len - num; i <len; i++ ){
                s[i] = k[i - len + num];
        }
        return s;
}


Measured memory_bytes: 3144
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        n: Chars
    };
    let sum = n.iter().map(|&c| c.to_digit(10).unwrap()).sum::<u32>();
    println!("{}", ["No", "Yes"][(sum % 9 == 0) as usize]);
}


Measured memory_bytes: 3028
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7


H,W=rl()
S=[]
for i in range(H):
    S.append(input())
#M = [[0 for w in range(W)] for h in range(H)]
wM = [[0 for w in range(W)] for h in range(H)]
hM = [[0 for w in range(W)] for h in range(H)]

for h in range(H):
    cnt = 0
    for w in range(W):
        if S[h][w] == '#':
            #M[h][w] = 1
            wM[h][w-1] = cnt
            cnt = 0
        else:
            wM[h][w] = -1
            cnt += 1
    if cnt != 0:
        wM[h][W-1] = cnt

for h in range(H):
    cnt = 0
    for w in range(W-1,-1,-1):
        if wM[h][w] > 0:
            cnt = wM[h][w]
        elif wM[h][w] == -1:
            wM[h][w] = cnt

for w in range(W):
    cnt = 0
    for h in range(H):
        if S[h][w] == "#":
        #if M[h][w] == 1:
            hM[h-1][w] = cnt 
            cnt = 0
        else:
            hM[h][w] = -1
            cnt += 1
    if cnt != 0:
        hM[H-1][w] = cnt

for w in range(W):
    cnt = 0
    for h in range(H-1,-1,-1):
        if hM[h][w] > 0:
            cnt = hM[h][w]
        elif hM[h][w] == -1:
            hM[h][w] = cnt

ans = 0
for h in range(H):
    for w in range(W):
        ret1 = wM[h][w]
        ret2 = hM[h][w]
        ret = ret1 + ret2
        if ret1 != 0 and ret2 != 0:
            ret -= 1
        ans = max(ans,ret)
print(ans)

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

const int N = 5005;

int n;
string s;

int dp[N][N];

int main() {
  cin >> n >> s;
  for (int i = n-1; i >= 0; i--) {
    for (int j = n-1; j >= 0; j--) {
      if (s[i] != s[j]) dp[i][j] = 0;
      else if (i == n-1 || j == n-1) dp[i][j] = 1;
      else dp[i][j] = dp[i+1][j+1] + 1;
    }
  }
  int mal = 0;
  rep(i, n) rep(j, n) {
    mal = max(mal, min(dp[i][j], abs(i-j)));
  }
  cout << mal << endl;
  return 0;
}

Measured memory_bytes: 101336
#include <iostream>
#include <map>
#include <string>

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

    int n;
    char ch;
    std::string type;

    std::map<std::string, int> type2cnt;
    std::map<int, int> n_cnt;
    
    while (std::cin >> n >> ch >> type) {
        if (n_cnt[n]++ == 0) {
            ++type2cnt[type];
        }
    }

    std::cout << type2cnt["A"] << std::endl;
    std::cout << type2cnt["B"] << std::endl;
    std::cout << type2cnt["AB"] << std::endl;
    std::cout << type2cnt["O"] << std::endl;

    return 0;
}

Measured memory_bytes: 1220
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class AKyuInAtCoder {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int x = in.nextInt();
            x /= 200;
            x = 10 - x;
            out.println(x);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 25652
#include <bits/stdc++.h>
using namespace std;
int main(){
	char str[110];
	scanf("%s", str);
	char st, last;
	int len = strlen(str)-2;
	st = str[0];
	last = str[strlen(str)-1];
	printf("%c%d%c\n", st, len, last);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
template <class T> int size(const T &x) { return x.size(); }
const int INF = 2147483647;
#define rep(i,a,b) for (__typeof(a) i=(a); i<(b); ++i)
#define iter(it,c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)

char arr[1000];
ll mem[1000][1000];
ll mod = 1000000007;
int n;
ll dp(int at, int open) {
    if (at == n) {
        return open == 0 ? 1 : 0;
    }
    if (mem[at][open] != -1)
        return mem[at][open];
    if (arr[at] == '-') {
        return mem[at][open] = dp(at+1,open);
    }
    if (arr[at] == 'U') {
        return mem[at][open] = (dp(at+1, open+1) + dp(at+1,open) * open % mod) % mod;
    }
    if (arr[at] == 'D') {
        return mem[at][open] = (dp(at+1,open) * open % mod + dp(at+1,open-1) * open % mod * open % mod) % mod;
    }
    assert(false);
}

int main() {
    memset(mem,-1,sizeof(mem));
    cin >> n;
    rep(i,0,n) {
        cin >> arr[i];
    }
    cout << dp(0,0) << endl;
    return 0;
}

Measured memory_bytes: 8984
#include<bits/stdc++.h>
#define int long long 
#define rao(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main(){
  	int n,a,b,c[100000],d[1000000],z=0;
  cin>>n>>a>>b;
  for(int i=0;i<n;i++){
    cin>>c[i]>>d[i];
  }
  for(int i=0;i<n;i++){
	if(a<=c[i] && b<=d[i]){
      z++;
    }
  }
  cout<<z<<"\n";
}

Measured memory_bytes: 2304
#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>

int main() {
  size_t N;
  scanf("%zu", &N);

  std::vector<intmax_t> a(N);
  intmax_t sum=0;
  for (size_t i=0; i<N; ++i) {
    scanf("%jd", &a[i]);
    sum += a[i];
    a[i] *= N;
  }
  
  intmax_t res=0;
  intmax_t diff=1000000;
  for (size_t i=0; i<N; ++i) {
    intmax_t cur=abs(a[i]-sum);
    if (cur < diff) {
      diff = cur;
      res = i;
    }
  }
  printf("%jd\n", res);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
long long s[100010],j[100010],w[100010] = {},n;
int a[100010],b[100010];
vector<pair<int,int>> G[100010];
int dfs(int a,int p){
	int res = 1;
	for(auto v:G[a]){
		if(v.first!=p) res += dfs(v.first,a);
	}
	return j[a] = res;
}

void solve(int x,int p){
	for(auto v: G[x]){
		if(v.first!=p){
			if(2*j[v.first]!=n) w[v.second] = (s[v.first] - s[x])/(n - 2*j[v.first]);
			solve(v.first,x);
		}
	}
}

long long solve2(int x,int p){
	long long res = 0;
	for(auto v: G[x]){
		if(v.first!=p){
			res += w[v.second]*j[v.first];
			res += solve2(v.first,x);
		}
	}
	return res;
}

int main(){
	int i;
	cin >> n;
	for(i=0;i<n-1;i++){
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
		G[a[i]].push_back({b[i],i}); G[b[i]].push_back({a[i],i});
	}
	for(i=0;i<n;i++) cin >> s[i];
	dfs(0,-1); solve(0,-1);
	for(i=0;i<n-1;i++){
		if(w[i]==0){
			dfs(a[i],-1);
			long long x = solve2(a[i],-1);
			w[i] = 2*(s[a[i]] - x)/n;
		}
		cout << w[i] << endl;
	}
}

Measured memory_bytes: 15616
import java.util.*;
import java.io.*;

public class Main {
	static FastReader f = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		solve();
		out.close();
	}

	static void solve() {
		long d = f.nextInt(), t = f.nextInt(), s = f.nextInt();
		out.println(d <= s*t ? "Yes" : "No");

	}

	static class FastReader {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;

		String next() {
			while(st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch(IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		String nextLine() {
			String str = "";

			try {
				str = br.readLine();
			} catch(IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}
	}
}

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


void solve(long long n, std::vector<std::string> S){
    vector<vll> record(n, vll(26, 0));
    for(ll i=0; i< n; i++){
        for(ll j=0; j < S[i].length(); j++){
            record[i][S[i].at(j)-'a']++;
        }
    }
    vll ans(26, 10000);
    for(ll j=0; j<26; j++){
        for(ll i=0; i< n; i++){
            ans[j] = min(ans[j], record[i][j]);
        }
    }
    for(ll j=0; j< 26; j++){
        if (ans[j]>0){
            for(ll k=0; k< ans[j]; k++){
                cout<<(char)(j+'a') ;
            }
        }
    }
    cout << endl;

}

int main(){
    long long n;
    scanf("%lld",&n);
    std::vector<std::string> S(n);
    for(int i = 0 ; i < n ; i++){
        std::cin >> S[i];
    }
    solve(n, std::move(S));
    return 0;
}


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

const int DIM = 1e3 + 5;
const int MOD = 1e9 + 7;

int cmb[DIM][DIM], dp1[DIM][DIM], dp2[DIM][DIM];

int lgput(int x, int n) {
    if (!n)
        return 1;
    
    int y = lgput(x, n >> 1);
    y = (1LL * y * y) % MOD;
    
    if (n & 1)
        y = (1LL * y * x) % MOD;
    
    return y;
}

int main(void) {
    int n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    
    for (int i = 0; i <= n; ++i) {
        cmb[i][0] = 1;
        
        for (int j = 1; j <= i; ++j)
            cmb[i][j] = (cmb[i - 1][j - 1] + cmb[i - 1][j]) % MOD;
    }
    
    for (int i = 1; i <= n; ++i) {
        dp2[i][1] = 1;
        
        for (int j = 2; i * j <= n; ++j)
            dp2[i][j] = 1LL * dp2[i][j - 1] * cmb[i * j][i] % MOD * lgput(j, MOD - 2) % MOD;
    }

    for (int i = a; i <= b + 1; ++i)
        dp1[0][i] = 1;
    
    for (int i = 1; i <= n; ++i) {
        for (int j = b; j >= a; --j) {
            dp1[i][j] = dp1[i][j + 1];
            
            for (int k = c; k <= d and k * j <= i; ++k)
                dp1[i][j] = (1LL * dp1[i - k * j][j + 1] * cmb[i][k * j] % MOD * dp2[j][k] % MOD + dp1[i][j]) % MOD;
        }
    }
    
    cout << dp1[n][a] << endl;
    return 0;
}

Measured memory_bytes: 12032
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

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


	int N;
	cin >> N;

	co(N >= 30 ? "Yes" : "No");



	Would you please return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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

typedef long long ll;
typedef pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, m;
  cin >> n >> m;

  ll maxv = 1;
  if(n == 1 && m == 1000000000){
    cout << m << endl;
    return 0;
  }
  for (ll i = 2; ; ++i) {
    ll tmp = (n-1) * i;
    ll rem = m - tmp;
    if(rem < i) break;
    if(rem % i == 0) chmax(maxv, i);
  }
  cout << maxv << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;



// 以下 幾何部分
template<class T> bool operator==(T a, T b){return abs(a-b)< eps;}
template<class T> int sig(T r) {return (r==0||r==-0) ? 0 : r > 0 ? 1 : -1;}
#define X real()
#define Y imag()

typedef bool B;
typedef long double D;
typedef complex <D> P;
typedef vector <P> Pol;

// ソートのキー
bool cmp_x(const P &a,const P &b){ return (abs(a.X-b.X)<eps ) ?  a.Y<b.Y : a.X<b.X;}
bool cmp_y(const P &a,const P &b){ return (abs(a.Y-b.Y)<eps ) ?  a.X<b.X : a.Y<b.Y;}
bool cmp_a(const P &a,const P &b){ return (abs(a.X-b.X)<eps ) ?  norm(a) < norm(b) : a.X<b.X;}


// 
D ip(P a, P b) {return a.X * b.X + a.Y * b.Y;}
D ep(P a, P b) {return a.X * b.Y - a.Y * b.X;}
D sr(D a) {return sqrt(max(a, (D)0));}

Pol convex_hull(Pol pol){
	int n=pol.size();
	sort(pol.begin(),pol.end(),cmp_x);
	Pol res(2*n);
	int k=0;
	
	// down
	rep(i,n){
		while( k>1 && ep(res[k-1]-res[k-2],pol[i]-res[k-1])<=0) k--;
		res[k++]=pol[i];
	}
	// up
	for(int i=n-2,t=k;i>=0;i--){
		while( k>t && ep(res[k-1]-res[k-2],pol[i]-res[k-1])<=0) k--;
		res[k++]=pol[i];
	}
	res.resize(k-1);
	return res;
}

int main(void){
	int n;
	while(cin >> n, n){
		Pol a(n);
		rep(i,n){
			P tmp;
			char buf;
			cin >> tmp.X >> buf >> tmp.Y;
			a[i]=tmp;
		}
		Pol b=convex_hull(a);
	//	dump(a.size())
	//	dump(b.size())
		cout << a.size()-b.size() << endl;
	}
	return 0;
}

Measured memory_bytes: 1248
def solve(n):
    if n <= 1:
        print(1)
        return

    a, b = 1, 1
    for _ in range(2, n + 1):
        c = a + b
        b = a
        a = c
    print(c)

if __name__ == "__main__":
    n = int(input())
    solve(n)


Measured memory_bytes: 5600
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <numeric>
#include <limits>
#include <cmath>
#include <iomanip>
#include <sstream>
 
#define ALL(a)  (a).begin(),(a).end()
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

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

    ll ans = 0;
    double a, b;
    cin >> a >> b;

    int al = ceil(a * 100 / 8);
    int ar = floor(((a+1) * 100 / 8 - 0.0001));
    int bl = ceil(b * 100 / 10);
    int br = floor(((b+1) * 100 / 10 - 0.0001));

    if (ar < bl || br < al) ans = -1;
    else if (al < bl) ans = bl;
    else ans = al;

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for (int i=(n)-1;i>=0;i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define REPS(i,f,n) for (int i=(f)-1;i>=(n);i--)
int dx[4] = {1, 0, 0, -1};
int dy[4] = {0, 1, -1, 0};

void slove(int s){
	vint v(s);
	rep(i, s) scanf("%d", &v[i]);

	sort(all(v));
	ll sum = 0;
	for (int i = 1; i < s - 1; ++i)
	{
		sum += v[i];
	}
	
	printf("%lld\n", sum / (s - 2));
	return;
}

int main(void){

	int s;
	cin >> s;
	while(s != 0){
		slove(s);//???????????°
		cin >> s;
	}

	return 0;
}

Measured memory_bytes: 3248
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
/* Coding space */
int main(){
  ll k; cin >> k;
  cout << 50 << endl;
  vector<ll> ans(50);
  rep(i,50) ans[i] = (49-i) + (k / 50);
  rep(i,k%50) ans[i]++;
  
  rep(i,50){
    cout << ans[i] << (i == 49?"\n":" ");
  }
}

Measured memory_bytes: 256
type UF
	n::Int
	pr::Array{Int}
	sz::Array{Int}
	UF(n)=new(n,1:n,ones(Int,n))
end
function find(UF,a)
	if UF.pr[a]==a
		a
	else
		UF.pr[a]=find(UF,UF.pr[a])
	end
end
same(UF,a,b)=find(UF,a)==find(UF,b)
function unite(UF,a,b)
	ap=find(UF,a)
	bp=find(UF,b)
	if ap==bp
		false
	else
		if UF.sz[ap]<UF.sz[bp]
			UF.pr[ap]=bp
			UF.sz[bp]+=UF.sz[ap]
		else
			UF.pr[bp]=ap
			UF.sz[ap]+=UF.sz[bp]
		end
		true
	end
end
size(UF,a)=UF.sz[find(UF,a)]
function main()
	N,M=map(x->parse(Int,x),split(readline()))
	pr=-ones(Int,M)
	uf=UF(N)
	for i=1:N
		L=map(x->parse(Int,x),split(readline()))
		shift!(L)
		for l=L
			if pr[l]<0
				pr[l]=i
			else
				unite(uf,pr[l],i)
			end
		end
	end
	for i=1:N
		if !same(uf,1,i)
			println("NO")
			exit()
		end
	end
	println("YES")
end
main()


Measured memory_bytes: 153404