akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <string.h>
#include <cstring>
#define   FOR(i,n) for(int i=0;i<n;i++)
#define INF 10000000000
using namespace std;
int int_sort(const void*a,const void *b) {
	return *(  int *) b - *(int *) a;
	//qsort(b, a, sizeof(long long int), int_sort);
}

template<typename T>
istream& operator >>(istream& is, vector<T>& vec){
	for(T& x: vec) is >>x;
	return is;
}
bool solve(const vector<string>&w) {
	const int n = w.size();
	FOR(i, n - 1) {
		if (w[i].back() != w[i + 1].front()) {
			return false;
		}
	}
	FOR(i, n) {
		for (int j = i + 1; j < n; ++j) {
			if (w[i] == w[j]) {
				return false;
			}
		}
	}
}

vector<string> input(){
	int n;cin>>n;
	vector<string> w(n);
	FOR(i,n){
		cin>>w[i];
	}
	return w;
}
int main() {
	const vector<string> w = input();
	if (solve(w)) {
		cout << "Yes";
	}
	else{
			cout << "No";
		}
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
int n;
string s;
int main(){
    cin>>n>>s;
    if(n%2){
        cout<<"No";
        return 0;
    }
    for(int i=0;i<n/2;i++){
        if(s[i]!=s[i+n/2]){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define repr(i, n, m) for (int i = (int)(n) - 1; i >= (int)(m); i--)
using namespace std;
using ll = int64_t;
const int MOD = 1000000007; // 10^9+7

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    swap(a, b);
    swap(a, c);
    cout << a << " " << b << " " << c << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MAX 100002
int N, a[MAX];
map<int, int> mp;
int main(){
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		scanf("%d", a + i);
		mp[a[i]]++;
	}
	int ans = 0;
	for(auto &i : mp){
		int num = i.first;
		int cnt = i.second;
		if(num <= cnt)	ans += cnt - num;
		else ans += cnt;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 5120
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <iomanip>
#define intt long long

int main() {
	intt R, G, B, N; std::cin >> R >> G >> B >> N;
	intt ans = 0;
	for (intt i = 0; i < N / R + 1; ++i) {
		for (intt j = 0; j < N / G + 1; ++j) {
			if (i * R + j * G > N)
				continue;
			intt d = N - i * R - j * G;
			if (d % B != 0)
				continue;
			++ans;
		}
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 3604
n, m, l=map(int, input().split(" "))

A = [ [ int(a) for a in input().split() ] for i in range(n) ]
B = [ [ int(b) for b in input().split() ] for i in range(m) ]
C = [ [ 0 for i in range(l) ] for i in range(n) ]

for i in range(n):
    for j in range(l):
        for jj in range(m):
                 C[i][j] = C[i][j] + A[i][jj] * B[jj][j]

    print(" ".join([str(_) for _ in C[i]]))

Measured memory_bytes: 8804
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <vector>
#include <unordered_map>
#include <queue>

using namespace std;

const int maxN = 2e5 + 10, modP = 1e9 + 7;

#define FORU(i, l, r) for (int i = l; i <= r; ++i)
#define FORD(i, r, l) for (int i = r; i >= l; --i)
#define REPU(i, r) for (int i = 0; i < r; ++i)
#define LL long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define PINT pair < int, int >
#define NUM_SET_BIT __builtin_popcountll
#define BIT(x, i) ((x >> i) & 1)

int n, p1, p2, POW[maxN], INVERSE_POW[maxN], a[maxN], c[maxN];

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

int modulo_inverse(int a) {
    int x, y;
    gcd_extended(a, modP, x, y);
    return ((x % modP + modP) % modP);
}

int nCk(int n, int k) {
    int tmp = (1ll * POW[n] * INVERSE_POW[n - k]) % modP;
    return (1ll * tmp * INVERSE_POW[k]) % modP;
}

int main() {
    cin >> n;
    FORU(i, 1, n + 1) {
        cin >> a[i];
        if (c[a[i]]) p1 = c[a[i]], p2 = i;
        c[a[i]] = i;
    }
    POW[0] = INVERSE_POW[0] = 1;
    FORU(i, 1, n + 1) {
        POW[i] = (1ll * POW[i - 1] * i) % modP;
        INVERSE_POW[i] = modulo_inverse(POW[i]);
    }
    FORU(i, 1, n + 1) {
        int res = nCk(n + 1, i);
        res = (res - nCk(n + 1 - (p2 - p1 + 1), i - 1)) % modP;
        res = (res + modP) % modP;
        cout << res << endl;
    }
}


Measured memory_bytes: 2816
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
typedef pair <char, int> P;

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

    int n;
    cin >> n;

    int white[n][n+1]; // 白iより前に、i+1以上の白とj以上の黒がいくつあるか
    int black[n][n+1]; // 黒iより前に、i+1以上の黒とj以上の白がいくつあるか

    vector <int> white_count(n, 0);
    vector <int> black_count(n, 0);

    for (int i = 0; i < 2 * n; i++) {
        char color; int idx;
        cin >> color >> idx; idx--;

        // 累積和
        vector <int> white_sum(n + 1, 0); // j以上の白がいくつあるか
        vector <int> black_sum(n + 1, 0); // j以上の黒がいくつあるか
        for (int j = n-1; j >= 0; j--) {
            white_sum[j] = white_count[j] + white_sum[j+1];
            black_sum[j] = black_count[j] + black_sum[j+1];
        }

        for (int j = 0; j <= n; j++) {
            if (color == 'W') white[idx][j] = black_sum[j] + white_sum[idx+1];
            if (color == 'B') black[idx][j] = white_sum[j] + black_sum[idx+1];
        }

        if (color == 'W') white_count[idx]++;
        if (color == 'B') black_count[idx]++;
    }

    int dp[n+1][n+1]; // 白をi個黒をj個置いた時の転倒数の最小値
    fill(dp[0], dp[n+1], (1<<30));
    dp[0][0] = 0;
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= n; j++) {
            if (i < n) dp[i+1][j] = min(dp[i+1][j], dp[i][j] + white[i][j]);
            if (j < n) dp[i][j+1] = min(dp[i][j+1], dp[i][j] + black[j][i]);
        }
    }

    cout << dp[n][n] << "\n";
    return 0;
}

Measured memory_bytes: 47232
object Main extends App {
  val amount = Array(500,100,50)
  val in = Iterator.continually(io.StdIn.readLine.toInt)
    .take(4).toArray

  val ans =  for {
    i <- 0 to in(0)
    if amount(0)*i <= in(3)
    j <- 0 to in(1)
    if amount(1)*j <= in(3)
    k <- 0 to in(2)
    if amount(0)*i + amount(1)*j + amount(2)*k == in(3)
    } yield  true

  println(ans.size)
}

Measured memory_bytes: 26936
import sys
import math
import bisect
# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
MOD = 10 ** 9 + 7


# ===CODE===
moto = 100
rishi = 1.01
k = int(input())

cnt = 0
while True:
    cnt += 1
    moto = int(float(moto)*rishi)
    if moto >= k:
        print(cnt)
        exit(0)

Measured memory_bytes: 9188
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	if ((b - 1) % (a - 1) == 0)
		cout << (b - 1) / (a - 1);
	else
		cout << (b - 1) / (a - 1) + 1;
	return 0;
}

Measured memory_bytes: 256
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())

zahyousa = abs(B - A)
sokudo = V - W

if sokudo <= 0:
  print('NO')
elif zahyousa / sokudo <= T:
  print('YES')
else:
  print('NO')

Measured memory_bytes: 9184
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL << 30)
#define LLINF (1LL << 60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

string a[1000];
int d[1000][1000], dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
signed main(void) {
  int h, w, k;
  cin >> h >> w >> k;
  REP(i, h) cin >> a[i];

  int sx, sy;
  queue<PII> que;
  REP(i, h) REP(j, w) {
    d[i][j] = INF;
    if (a[i][j] == 'S') {
      sx = j;
      sy = i;
    }
  }
  que.push({sx, sy});
  d[sy][sx] = 0;

	ll ans = (min({sx, sy, h-sy-1, w-sx-1}) + k - 1) / k + 1;
	//cout << ans << " " << sx << " " << sy << " " << min({sx, sy, h-sy-1, w-sx-1}) << endl;
  while (que.size()) {
    PII p = que.front();
    que.pop();
    // cout << p.first << " " << p.second << " " << d[p.second][p.first] <<
    // endl;
		int x = p.first, y = p.second;
		ans = min(ans, (min({x, y, h-y-1, w-x-1}) + k - 1) / k + 1);
		//cout << x << " " << y << " " << ans << endl;
    REP(i, 4) {
      int nx = x + dx[i], ny = y + dy[i];
      if (0 <= nx && nx < w && 0 <= ny && ny < h && a[ny][nx] != '#' &&
          d[ny][nx] == INF && d[y][x] < k) {
        que.push(PII(nx, ny));
        d[ny][nx] = d[y][x] + 1;
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
int n,s[200010],tot,l[200010],r[200010],a[200010];
int fa[200010][25],mx[200010][25];
int cnt,head[200010],to[400010],nxt[400010];
void add(int x,int y)
{
	cnt++;
	to[cnt]=y;
	nxt[cnt]=head[x];
	head[x]=cnt;
}
void dfs(int x)
{
	tot++;
	l[x]=tot;
	mx[x][0]=x;
	for (int i=head[x];i;i=nxt[i])
	{
		int y=to[i];
		if (y==fa[x][0])
		{
			continue;
		}
		fa[y][0]=x;
		a[y]=max(x,a[x]);
		dfs(y);
	}
	r[x]=tot;
}
void bz()
{
	for (int i=1;i<=20;i++)
	{
		for (int j=1;j<=n;j++)
		{
			fa[j][i]=fa[fa[j][i-1]][i-1];
			mx[j][i]=max(mx[j][i-1],mx[fa[j][i-1]][i-1]);
		}
	}
}
int get(int x)
{
	int now=0;
	for (int i=20;i>=0;i--)
	{
		if (max(now,mx[x][i])<a[fa[x][i]])
		{
			now=max(now,mx[x][i]);
			x=fa[x][i];
		}
	}
	return x;
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<n;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		add(x,y);
		add(y,x);
	}
	dfs(1);
	bz();
	for (int i=2;i<=n;i++)
	{
		int x=get(i);
		s[l[x]]++;
		s[r[x]+1]--;
	}
	for (int i=1;i<=n;i++)
	{
		s[i]+=s[i-1];
	}
	for (int i=2;i<=n;i++)
	{
		printf("%d ",s[l[i]]);
	}
	return 0;
}
//洛阳城里见秋风，
//欲作家书意万重。
//复恐匆匆说不尽，
//行人临发又开封。
//——张籍《秋思》 

Measured memory_bytes: 57088
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

struct Graph {
    struct Vertex { int n, f; };
    struct Edge { int i, n; };
    Graph(int n, int m) : v(n, { -1, 0 }), e(m), n(n), m(0), d(-1) {}
    void add_edge(int i, int j) {
        e[m] = { j, v[i].n };
        v[i].n = m;
        m++;
    }
    void dfs(int i) {
        if (v[i].f) {
            if (v[i].f < 0 && r.empty()) d = i;
            return;
        }
        v[i].f = -1;
        for (int j = v[i].n; j >= 0; j = e[j].n) {
            Edge &o = e[j];
            dfs(o.i);
            if (d >= 0 || !r.empty()) break;
        }
        v[i].f = 1;
        if (d >= 0) {
            r.push_back(i);
            if (i == d) d = -1;
        }
    }
    void solve() {
        reverse(r.begin(), r.end());
        int k = r.size();
        vector<int> y(n);
        for (int z = 0; z < n; z++) {
            for (int i = 0; i < n; i++) {
                y[i] = 0;
            }
            for (int h = 0; h < k; h++) {
                y[r[h]] = 1;
            }
            int b = 1, h0, h1, i3;
            for (int h = 0; h < k; h++) {
                int i = r[h], i1 = r[(h + 1) % k];
                for (int j = v[i].n; j >= 0; j = e[j].n) {
                    Edge &o = e[j];
                    if (o.i != i1 && y[o.i] > 0) {
                        b = 0;
                        h0 = h;
                        i3 = o.i;
                        break;
                    }
                }
                if (b == 0) break;
            }
            if (b) {
                cout << k << '\n';
                for (int h = 0; h < k; h++) {
                    cout << r[h] + 1 << '\n';
                }
                exit(0);
            }
            for (int h = 0; h < k; h++) {
                if (r[h] == i3) {
                    h1 = h;
                    break;
                }
            }
            if (h0 < h1) {
                int t = h1 - h0 - 1;
                for (int h = h1; h < k; h++) {
                    r[h - t] = r[h];
                }
                k -= t;
            } else {
                for (int h = h1; h <= h0; h++) {
                    r[h - h1] = r[h];
                }
                k = h0 - h1 + 1;
            }
        }
    }
    vector<Vertex> v;
    vector<Edge> e;
    int n, m;

    int d;
    vector<int> r;
};

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

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

    Graph g(n, m);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;

        g.add_edge(a, b);
    }

    for (int i = 0; i < n; i++) {
        g.dfs(i);
        if (!g.r.empty()) break;
    }

    if (g.r.empty()) {
        cout << -1 << endl;
        exit(0);
    }

    g.solve();

    return 0;
}

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



int main () {
	vector<string> a,b;
	int aa,bb;

	cin >> aa >> bb;

	for(int i=0;i<aa;i++){
		string j;
		cin >> j;
		a.push_back(j);
	}

	for(int i=0;i<bb;i++){
		string j;
		cin >> j;
		b.push_back(j);
	}



	for(int i=0;i<aa-bb+1;i++){
		for(int j=0;j<aa-bb+1;j++){
			int k=0;
			for(int m=0;m<bb;m++){
				for(int n=0;n<bb;n++){
					if(a[i+m][j+n]!=b[m][n]){
						k = -1;
						break;
					}
				}
			}
			if(k==0){
				cout << "Yes" << endl;
				return 0;
			}	
		}
	}

	cout << "No" << endl;

    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
multiset<int>st;
int main(){
	long long n;
	cin >> n;
	long long now = 1;
	long long sum = 0;
	while(sum < n){
		sum+=now++;
	}
	long long diff = sum-n;
	for(long long i = 1; i < now; ++i){
		if(i != diff)printf("%lld\n", i);
	}
}

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

using namespace std;

using ll = long long;

int main()
{
    int n = 0;
    cin >> n;
    ll ans = 0;
    int count = 0;
    for (int i = 1; i <= n; i++) {
        if (i%3 != 0 && i%5 != 0) {
            ans += i;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3596
def devide_grade(m,f,r):
    if m == -1 or f == -1:
        print("F")
    elif m+f >= 80:
        print("A")
    elif m+f >= 65:
        print("B")
    elif m+f >= 50:
        print("C")
    elif m+f >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")
        
c = 0

while c < 50 :
    c += 1
    m,f,r = map(int,input().split())
    if m == -1 and (f == -1 and r == -1):
        break
    else:
        devide_grade(m,f,r)



Measured memory_bytes: 5600
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pll pair<ll,ll>
#define sll set<ll>
#define msll multiset<ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define vpl vector<pll>
#define gll greater<ll>
#define gpl greater<pll>
#define spl set<pll>
#define mspl multiset<pll>
#define lb lower_bound
#define bp __builtin_popcount
#define ub upper_bound
#define prq priority_queue
#define mp make_pair
#define pb push_back
#define mem(x,y) memset(x, y, sizeof x)
#define endl "\n"
#define sz(x) (ll)x.size()
#define sqr(x) x*x
#define rapido ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
typedef long double ld;
ll mx = INT_MAX;
ll mn = INT_MIN;
ll INF = 1e18+10;
ll MOD = 1e9+7;
const ll maxs = (1<<11);
const ll lg = 22; 
ll fast(ll base , ll expo){ ll res = 1; while(expo>=1){ if(expo%2) res *= base; base *= base; expo /= 2; } return res; }

void init(){
    mx = INT_MIN; mn = INT_MAX; INF = 1e18+10;
}

void code_idhr_h(){
    ll N; cin>>N;
    if(N%1000 == 0) cout<<"0"<<endl;
    else cout<<1000 - N%1000<<endl;
}

int main(){
    rapido;
    ll T=1; //cin>>T;
    //pre();
    while(T--){
        init();
        code_idhr_h();
    }
    return 0;
}

Measured memory_bytes: 3612
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int, A: int, B: int, C: int, D: int, S: str):
    ret = YES
    ##for i in range(A - 1, C - 1):
    ##    if S[i:i + 2] == '##':
    ##        ret = NO
    ##        print(ret)
    ##        return
    ##for i in range(B - 1, D - 1):
    ##    if S[i:i + 2] == '##':
    ##        ret = NO
    ##        print(ret)
    ##        return
    ##if D < C:
    ##    ret = NO
    ##    for i in range(B - 2, D - 1):
    ##        if S[i:i + 3] == '...':
    ##            ret = YES
    ##            break

    if '##' in S[A - 1:C] or '##' in S[B - 1:D]:
        ret = NO
    else:
        if D < C:
            #if S[B - 2:B] == '..' or S[B - 1:B + 1] == '..':
            if not '...' in S[B - 2:D + 1]:
                ret = NO
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, A, B, C, D, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3572
#include <iostream>

using namespace std;

int main(){
  int i,n,m,di,pi,o;
  int p[11];
  for (i=0;i<11;i++)
    p[i] = 0;
  while(true){
    cin >> n >> m;
    if (n == 0)
      break;
    for (i = 0;i<n;i++){
      cin >> di >> pi;
      p[pi] += di;
    }
    i = 10;
    while(i>=0){
      if (p[i] > m){
	p[i] -= m;
	break;
      }
      else{
	m -= p[i];
	p[i] = 0;
      }
      i--;
    }
    o = 0;
    for(i=0;i<=10;i++){
      o += i*p[i];
      p[i] = 0;
    }
    cout << o << endl;
  }
  return 0;
}

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

const int MAX_N = 1010;
int N,M;
ll x[MAX_N], y[MAX_N], z[MAX_N];

// 8方向
int a[] = {-1, 1}, b[] = {-1, 1}, c[] = {-1, 1};


int main()
{
  cin >> N >> M;
  REP(i,0,N) {
    cin >> x[i] >> y[i] >> z[i];
  }

  ll maxs = -1e9;                      // max of sum
  // 8方向全探索
  REP(k1,0,2) {
    REP(k2,0,2) {
      REP(k3,0,2) {
        vector<ll> vec;
        REP(i,0,N) {
          vec.push_back(a[k1] * x[i] + b[k2] * y[i] + c[k3] * z[i]);
        }
        // ソートして大きいものから M 個加える
        sort(vec.begin(), vec.end(), greater<ll>());
        ll s = 0;               // sum
        REP(i,0,M) s += vec[i];
        maxs = max(maxs, s);
      }
    }
  }

  cout << maxs << endl;

  return 0;
}


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

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
pii point[3010];
bool ex[5010][5010];
int main(){
	int n;
	while(cin>>n,n){
		if(n==0)break;
		rep(i,5010){
			rep(j,5010){
				ex[i][j]=false;

			}
		}
		memset(point, 0, sizeof(point));
		for(int i=0;i < n;i++){
			cin>>point[i].first>>point[i].second;
			ex[point[i].second][point[i].first]=true;
		}
		sort(point,point+n);
		/*rep(i,n){
			printf("(x,y) =(%d,%d)\n",point[i].first,point[i].second);
		}*/
			int ans =0;
			for(int i=0;i < n;i++){
				for(int j=i+1;j < n;j++){
					int dx =abs(point[j].first-point[i].first);
					int dy =abs(point[j].second-point[i].second);
					int tmp =dx*dx+dy*dy;
					if(tmp<=ans)continue;
				/*printf("(x1,y1) =(%d,%d)\n",point[i].first,point[i].second);
				printf("(x2,y2) =(%d,%d)\n",point[j].first,point[j].second);
				printf("(dx,dy) = (%d,%d)\n",dx,dy);*/
				int nx1 =point[j].first+dy;
				int ny1 =point[j].second+dx;

				int nx2 =point[i].first+dy;
				int ny2 =point[i].second+dx;
				//
				int mnx1 =(point[j].first-dy);
				int mny1 =(point[j].second-dx);

				int mnx2 =(point[i].first-dy);
				int mny2 =(point[i].second-dx);
				/*printf("(nx1,ny1) =(%d,%d)\n",nx1,ny1);
				printf("(nx2,ny2) =(%d,%d)\n",nx2,ny2);
				printf("(mnx1,mny2) =(%d,%d)\n",mnx1,mny1);
				printf("(mnx1,mny2) =(%d,%d)\n",mnx2,mny2);
				cout <<endl;*/
				if(nx1<=5000&&ny1<=5000&&nx2<=5000&&ny2<=5000&&
				   ex[ny1][nx1]&&ex[ny2][nx2]){
					ans=max(ans,tmp);
				//cout <<ans<<endl;
				continue;
			}
			if(mnx1>=0&&mny1>=0&&mnx2>=0&&mny2>=0&&
			   ex[mny1][mnx1]&&ex[mny2][mnx2]){
				ans=max(ans,tmp);
		}
	}
}
cout <<ans<<endl;
}
return 0;
}

Measured memory_bytes: 25708
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
#include <bitset>
#include <functional>
#include <cassert>
using namespace std;
#define fast_io ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define MOD (long long int)(1e9+7)
#define INF (int)(1e9)
#define LINF (long long int)(1e18)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

ll mpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
  else return mpow(a,b-1) * a % MOD;
}
ll lpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = lpow(a,b/2); return memo*memo;}
  else return lpow(a,b-1) * a;
}
ll gcd(ll a, ll b){
  if(b==0) return a;
  else return gcd(b, a%b);
}
vector<ll> kaijo_memo;
ll kaijo(ll n){
  if(kaijo_memo.size() > n) return kaijo_memo[n];
  if(kaijo_memo.size() == 0) kaijo_memo.push_back(1);
  while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] * kaijo_memo.size() % MOD);
  return kaijo_memo[n];
}
vector<ll> gyaku_kaijo_memo;
ll gyaku_kaijo(ll n){
  if(gyaku_kaijo_memo.size() > n) return gyaku_kaijo_memo[n];
  if(gyaku_kaijo_memo.size() == 0) gyaku_kaijo_memo.push_back(1);
  while(gyaku_kaijo_memo.size() <= n) gyaku_kaijo_memo.push_back(gyaku_kaijo_memo[gyaku_kaijo_memo.size()-1] * mpow(gyaku_kaijo_memo.size(), MOD-2) % MOD);
  return gyaku_kaijo_memo[n];
}

ll nCr(ll n, ll r){
  if(n == r) return 1;//0個の丸と-1個の棒みたいな時に時に効く？不安.
  if(n < r || r < 0) return 0;
  ll ret = 1;
  if(n <= 1e7){
    ret *= kaijo(n); ret %= MOD;
    ret *= gyaku_kaijo(r); ret %= MOD;
    ret *= gyaku_kaijo(n-r); ret %= MOD;
  }else{
    rep(i,r){
      ret *= n-i; ret %= MOD;
      ret *= mpow(r-i, MOD-2); ret %= MOD;
    }
  }
  return ret;
}

/*std::mt19937 mt{ std::random_device{}() };

std::uniform_int_distribution<int> dist(1, 6);
dist(mt);

while(1){
	val;
	cout << val << endl;
	sol1 = solver1();
	sol2 = solver2();
	if(sol1==sol2){
	cout << "OK" << endl;
	}else{
	cout << "NG" << endl;
	cout << sol1 << endl;
	cout << sol2 << endl;
	break;
	}
}
*/

int main(void){
  fast_io
  cout<<fixed<<setprecision(15);
  int d,t,s;
  cin >> d >> t >> s;
  if(d <= t*s){
	  cout << "Yes" << endl;
  }else{
	  cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 3636
import math
import sys
input = sys.stdin.readline


K,S = map(int, input().split())
n = 0
up = math.floor(K)
for i in range(0,K+1):
    for j in range(0, K+1):
        if(0<= S-i-j <=K):
            n +=1
        else:
                n =n

print(n)


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

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;
const ll MOD = 1000000007;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

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

	vector<int> a(q);
	for (int i = 0; i < q; i++) {
		cin >> a[i];
		a[i]--;
	}

	vector<int> points(n);
	for (int i = 0; i < q; i++) {
		points[a[i]]++;
	}

	for (int i = 0; i < n; i++) {
		int score = k - (q - points[i]);

		if (score > 0) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 1408
using System;

namespace Computation
{
    class Simple_Calculator
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var token = Console.ReadLine().Split(' ');
                var a = int.Parse(token[0]);
                var b = int.Parse(token[2]);
                switch (token[1])
                {
                    case "+":
                        Console.WriteLine(a + b);
                        break;
                    case "-":
                        Console.WriteLine(a - b);
                        break;
                    case "*":
                        Console.WriteLine(a * b);
                        break;
                    case "/":
                        Console.WriteLine(a / b);
                        break;
                    case "?":
                        return;
                }
            }

        }
    }
}

Measured memory_bytes: 9172
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010

int main(){
  int n,k;
  ll a;
  ll t;
  ll max_a = 0;
  
  scanf("%d%d",&n,&k);

  for(int i=0;i<n;i++){
    scanf("%lld",&a);

    if(i == 0){
      t = a;
    }else{
      t = __gcd(a,t);
    }

    max_a = max(max_a, a);
  }

  if(max_a >= k && (max_a - k)%t == 0){
    puts("POSSIBLE");
  }else{
    puts("IMPOSSIBLE");
  }
  
  
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int main(){
  long long w,h,x,y;
  cin>>w>>h>>x>>y;
  double ans;
  if(w%2==0 && h%2==0 && x == w/2 && y==h/2){
    cout<<w*h/2<<' '<<1<<endl;
  }else{
    ans = (double)w*h;
    ans /= 2.0;
    int j = 0;
    printf("%.10f \t %d",ans,j);
  }
  return 0;
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**10
mod = 10**9 + 7


def f():
    n,l = list(map(int, input().split()))
    a = list(map(int, input().split()))
    g = 0
    for i in range(1,n):
        if a[i] + a[i-1] >= l:
            g = i
            break
    if g == 0:
        print('Impossible')
        return
    print('Possible')
    for i in range(1,g):
        print(i)
    for i in range(n-1,g-1,-1):
        print(i)

f()


Measured memory_bytes: 17196
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,m;
    cin>>n>>m;
    vector <vector<lli> > vect(n+1);
    lli u,v;
    rep(i,m){
    	cin>>u>>v;
    	vect[u].pb(v);
	}
	lli s,t;
	cin>>s>>t;
	lli dis[n+1][3];
	for(lli i=1;i<=n;i++){
		for(lli j=0;j<3;j++)
		dis[i][j]=inf;
	}
	dis[s][0]=0;
	priority_queue <pair<lli,lli>, vector <pair<lli,lli> >,greater<pair<lli,lli> > >q;
	q.push(mp(0,s));
	while(!q.empty()){
		pair <lli,lli> p=q.top();
		q.pop();
		lli t=(p.ft+1)%3;
		for(lli i=0;i<vect[p.sc].size();i++){
			if(dis[vect[p.sc][i]][t]> (p.ft+1)){
				dis[vect[p.sc][i]][t]=p.ft+1;
				q.push(mp(p.ft+1,vect[p.sc][i]));
			}
		}
	}
	if(dis[t][0]==inf)
	cout<<"-1\n";
	else
	cout<<dis[t][0]/3;
    return 0;
}


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

int main(){
    string s, t;
    cin >> s >> t;

    int cnt = 0;
    rep(i, 3){
        if(s[i]==t[i]) cnt++;
    }
    cout << cnt << endl;
    // printf("%d\n", N);
    return 0;
}

Measured memory_bytes: 256
#include<set>
#include<map>
#include<cmath>
#include<ctime>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<algorithm>
#define end "\n"
#define fi first
#define se second
#define db double
#define gcd __gcd
#define pb push_back
#define mp make_pair
#define lowbit(x) x & (-x)
#define PII  pair<int, int> 
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(int i = a; i <= (b); i++)
#define Rep(i, a, b) for(int i = a; i >= (b); i--)
#define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
const db eps = 1e-9;
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 7;
const int maxn = (int)1e4 + 5;
using namespace std;

int main()
{
	int a, b, c; cin >> a >> b >> c;
	if((c >= a && c <= b) || (c >= b && c <= a)) puts("Yes");
	else puts("No");
	return 0;
}

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

using namespace std;


map <int, long long> d, t;
int n, m, a[101], b[101];
long long mx;

int main(){
       scanf("%d %d", &n, &m);

       for(int  i = 1;i <= n;i ++){
              scanf("%d %d", &a[i], &b[i]);
       }
       for(int i = 1;i <= n;i ++)
       {
              t[a[i]] = max(1LL*b[i], t[a[i]]);
              for(auto it = d.begin(); it != d.end(); it ++){
                    int x = it -> first;
                    if(m - a[i] < x) continue;
                    t[a[i] + x] = max(t[a[i] + x], d[x] + b[i]);
              }
              for(auto it = t.begin(); it != t.end(); it ++){
                    int x = it->first;
                    d[x] = t[x];
                    if(x <= m)
                           mx = max(t[x], mx);
              }
       }
       cout << mx;
       return 0;
}


Measured memory_bytes: 640
import bisect

n=int(input())
l=list(map(int,input().split()))
l.sort()

ans=0
for i in range(0,n):
    for j in range(i+1,n):
        p=l[i]+l[j]
        index=bisect.bisect_left(l,p,0,n)
        #print(l[i],l[j],index)
        ans+=index-j-1
print(ans)

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

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

    static class abc167_a {
        public void solve(int testNumber, Scanner fin, PrintWriter fout) {
            String s = fin.next();
            String t = fin.next();


            if (t.substring(0, t.length() - 1).equals(s)) {
                fout.println("Yes");
            } else {
                fout.println("No");
            }
        }

    }
}



Measured memory_bytes: 35840
module app;

import core.bitop;

import std.algorithm;
import std.array;
import std.bigint;
import std.conv;
import std.stdio;
import std.string;
import std.traits;

struct Input
{
	int n, r;
}

void parseInput(T)(out Input input, T file)
{
	with (file) with (input)
	{
		auto ar = readln().strip().split().map!(to!int).array();
		n = ar[0].to!int;
		r = ar[1].to!int;
	}
}

auto main2(Input* input)
{
	with (input)
	{
        if (n >= 10)
            return r;
        else
            return r + 100 * (10 - n);
	}
}

alias retType = ReturnType!main2;
static if (!is(retType == void))
{
	unittest { writeln("begin unittest"); }
	auto _placeholder_ = ReturnType!main2.init;

	unittest // example1
	{
		string example =
`2 2919`;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == 3719);
	}

	unittest // example2
	{
		string example =
`22 3051`;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == 3051);
	}

	unittest // example3
	{
		string example =
``;
		if (example.empty) return;
		Input input = void;
		parseExample(input, example);
		auto result = main2(&input);
		printResult(result);
		assert(result == _placeholder_);
	}

	unittest { writeln("end unittest"); }

	void parseExample(out Input input, string example)
	{
		struct Adapter
		{
			string[] _lines;
			this(string input) { _lines = input.splitLines(); }
			string readln() { auto line = _lines[0]; _lines = _lines[1..$]; return line; }
		}
		parseInput(input, Adapter(example));
	}
}

void printResult(T)(T result)
{
	static if (isFloatingPoint!T) writefln("%f", result);
	else writeln(result);
}

void main()
{
	Input input = void;
	parseInput(input, stdin);
	alias retType = ReturnType!main2;
	static if (is(retType == void))
		main2(&input);
	else
	{
		auto result = main2(&input);
		printResult(result);
	}
}


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

int main() {
  int m[] = {6000,4000,3000,2000};
  int a, b;
  
  for(int i=0; i<4; i++) {
    cin >> a >> b;
    cout << b*m[a-1] << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1160
@1=map$-=$_-2,@0=1..<>+2;--$0[-1];map$\+=$'*($$_[$N=$$_[$`]]-($$_[$P=${1-$_}[$`]]=$N))*($`-$P),/\t/,0for`tr ' ' '\n'|nl|sort -nk2`;print

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  while(1){
    int n;
    cin >> n;
    if(n==0) return 0;
    int ans=0;
    for(int i=n+1;i<=2*n;i++){
      for(int j=2;j<=sqrt(i);j++){
        if(i%j==0) goto next;
      }
      ans++;
      next:
      continue;
    }
    cout << ans << endl;
  }
  return 0;
}



Measured memory_bytes: 3100
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

int main(void){
	string s;
	cin >> s;
	for(int i=0;i<s.length()-1;i++){
		if(s.at(i) == 'A' && s.at(i+1)=='C'){
			cout << "Yes" << endl;
			return 0;
			break;
		}
	}
	cout << "No"  << endl;

}

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

typedef long long ll;

int N;
ll A[1<<18], c[1<<18];
ll pr[1<<18], su[1<<18];
vector<int> S;

ll mn = 1e18;

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

	for (int i = 0; i++ < N; ) {
		scanf("%lld", A+i);
	}

	for (int k : {0, 1}) {
		S.clear();

		S.push_back(0);
		for (int i = 0; i++ < N; ) c[i] = A[i];
		for (int i = 0; i++ < N; ) {
			while (S.back() && c[S.back()] < c[S.back() + 1]) {
				if (S[S.size()-2] + 1 != S.back()) c[S[S.size()-2] + 1] *= 4;
				c[S.back()] *= 4;
				pr[i] += S.back() - S[S.size()-2];
				if (c[S.back()] >= c[S.back() + 1]) S.pop_back();
			}

			pr[i] += pr[i-1];

			S.push_back(i);
		}

		reverse(A + 1, A+N + 1);
		swap(pr, su);
	}

	for (int i = 0; i < N; ++i) {
		mn = min(mn, 2 * pr[i] + i + 2 * su[N-i]);
	}

	printf("%lld\n", mn);
}

Measured memory_bytes: 9592
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(n,m):
        a = [int(S(), 2) for _ in range(m)]
        mi = 0
        ma = max(a)
        while 2**mi <= ma:
            mi += 1
        ii = [2**i for i in range(mi+1)]

        fm = {}
        def _f(a):
            k = tuple(a)
            if k in fm:
                return fm[k]

            if len(a) < 2:
                fm[k] = 0
                return 0

            r = inf
            for i in ii:
                a1 = []
                a2 = []
                for c in a:
                    if i & c:
                        a1.append(c)
                    else:
                        a2.append(c)
                if not a1 or not a2:
                    continue
                r1 = _f(a1)
                r2 = _f(a2)
                tr = max(r1, r2) + 1
                if r > tr:
                    r = tr
            fm[k] = r
            return r

        r = _f(a)
        return r

    while 1:
        n,m = LI()
        if n == 0:
            break
        rr.append(f(n,m))

    return '\n'.join(map(str,rr))


print(main())



Measured memory_bytes: 16804
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>

using namespace std;

const double Eps = 1e-8;

int main()
{
	int n, m;
	while (scanf("%d %d", &n, &m), n | m)
	{
		double g[100][100];
		for (int i = 0; i < n; ++i)
			for (int j = 0; j < n; ++j)
				scanf("%lf", &g[i][j]);
		double rates[2][100];
		for (int i = 0; i < n; ++i)
			rates[0][i] = 1;

		for (int c = 1; c < m; ++c)
		{
			for (int i = 0; i < n; ++i)
			{
				rates[c & 1][i] = rates[(c+1) & 1][0] * g[0][i];
				for (int j = 1; j < n; ++j)
					rates[c & 1][i] = max(rates[c & 1][i], rates[(c+1) & 1][j] * g[j][i]);
			}
		}
		double ans = -1;
		for (int i = 0; i < n; ++i)
			ans = max(ans, rates[(m+1) & 1][i]);
		printf("%.2f\n", floor(ans*1e2+0.5+Eps)/100);
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int n;
    while(cin >> n, n) {
        vector<vector<bool>> exists(5001, vector<bool>(5001));
        vector<P> v(n);
        for(int i=0; i<n; ++i) {
            cin >> v[i].first >> v[i].second;
            exists[v[i].first][v[i].second] = true;
        }
        int res = 0;
        for(int i=0; i<n; ++i) {
            for(int j=0; j<n; ++j) {
                if(i == j) {
                    continue;
                }
                int vx = v[i].first - v[j].first;
                int vy = v[i].second - v[j].second;
                int nx1 = v[i].first - vy,
                    ny1 = v[i].second + vx,
                    nx2 = v[j].first - vy,
                    ny2 = v[j].second + vx;
                if(nx1 < 0 || 5000 < nx1 || ny1 < 0 || 5000 < ny1) {
                    continue;
                }
                if(nx2 < 0 || 5000 < nx2 || ny2 < 0 || 5000 < ny2) {
                    continue;
                }
                if(exists[nx1][ny1] && exists[nx2][ny2]) {
                    res = max(res, vx*vx + vy*vy);
                }
            }
        }
        cout << res << endl;
    }
}


Measured memory_bytes: 6308
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

const int mod=998244353;
int pw2[233],dp[233];
map<string,int>rem;
int calc(const string&s)
{
	if(rem.find(s)!=rem.end())return rem[s];
	int cnt=0;for(int i=0;i<(int)s.size();i++)cnt+=(s[i]=='1');
	if(cnt==0)return dp[(int)s.size()];
	int ret=calc(s.substr(1));if(s[0]=='1')ret=(ret+ret)%mod;int sz=(int)s.size();
	for(int l=1;l<=sz/2;l++)
	{
		string now=s.substr(0,l);
		for(int i=2;i*l<=sz;i++)
		{
			for(int j=l*(i-1);j<l*i;j++)if(s[j]=='0')now[j-(i-1)*l]='0';
			ret=(ret+1ll*calc(now)*calc(s.substr(i*l)))%mod;
		}
	}
	rem[s]=ret;
	return ret;
}
int main()
{
	pw2[0]=1;for(int i=1;i<233;i++)pw2[i]=pw2[i-1]*2%mod;
	dp[0]=1;
	for(int i=1;i<233;i++)
	{
		dp[i]=dp[i-1];
		for(int j=2;j<=i;j++)for(int k=j;k<=i;k+=j)
			dp[i]=(dp[i]+1ll*dp[k/j]*dp[i-k])%mod;
	}
	string s;cin>>s;
	cout<<calc(s);
	return 0;
}

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

using namespace std;

#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef unsigned long long ull;

int main() {
    int K, X;
    cin >> K >> X;
    REP(i, X - K + 1, X + K) {
        if ((i >= -K) && (i <= 100+K)) {
            if (i < X + K ) {
                cout << i << " ";
            }
        }
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cmath>
#include<bitset>
typedef long long ll;
#define PB	push_back
#define FOR(n)			for(int i = 0; i < n; ++i)
#define RFOR(n)			for(int i = n; i >= 0; --i)
#define FORR(start,end) for(int i = start; i < end; ++i)
#define COUT(n)			cout << n << " " << flush
#define vi(v)			vector<int> v
#define vii(v)			vector<pair<int,int>> v
#define pii(p)			pair<int,int> p
#define mii(m)			map<int, int> m
#define msi(m)			map<string, int, less<>> m
#define mmsi(m)			multimap<string, int, less<>> m
#define mkp(a,b)		make_pair(a,b)
#define ALL(obj)		obj.begin(), obj.end()
#define PI 3.141592
#define MOD 1e9+7
using namespace std;

void solve() {
	int n, m;
	cin >> n >> m;
	if (n == m) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sz(arr) (int)(arr).size()
#define rng(arr) arr.begin(), arr.end()
#define show(x) cout << #x << " = " << x << endl;
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;
typedef long long int ll;

void _cin() {}
template <class Head, class... Tail>
void _cin(Head&& head, Tail&&... tail) {
  cin >> head;
  _cin(forward<Tail>(tail)...);
}

#define Cin(T, ...) \
  T __VA_ARGS__;    \
  _cin(__VA_ARGS__)

#define Cins(T, n, xs) \
  vector<T> xs(n);     \
  for (int i = 0; i < n; ++i) cin >> xs[i]

void Main();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}

void Main() {
  Cin(int, n, y);

  rep(i, 2001) rep(j, 2001) {
    int k = n - i - j;
    if (0 <= k && k <= 2000 && 10000 * i + 5000 * j + 1000 * k == y) {
      cout << i << " " << j << " " << k << endl;
      return;
    }
  }
  cout << "-1 -1 -1" << endl;
}

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

#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef pair<int,int> pii;

int main(){
	ll n,a,b;
	scanf("%lld%lld%lld",&n,&a,&b);
	if((b-a)&1)printf("%lld\n",min(a-1,n-b)+(b-a+1)/2);
	else printf("%lld\n",(b-a)/2);
	return 0;
}

Measured memory_bytes: 256