akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
        #pragma comment(linker, "/stack:200000000")
        #pragma GCC optimize("unroll-loops")
         
        #include <algorithm>
        #include <bitset>
        #include <cassert>
        #include <chrono>
        #include <cmath>
        #include <complex>
        #include <cstdio>
        #include <cstdlib>
        #include <cstring>
        #include <ctime>
        #include <deque>
        #include <functional>
        #include <iomanip>
        #include <iostream>
        #include <iterator>
        #include <limits>
        #include <climits>
        #include <list>
        #include <map>
        #include <numeric>
        #include <queue>
        #include <random>
        #include <ratio>
        #include <set>
        #include <sstream>
        #include <stack>
        #include <string>
        #include <unordered_map>
        #include <unordered_set>
        #include <utility>
        #include <vector>
        using namespace std;
         
        typedef long long ll;
        typedef long double LD;
        #define int ll
        #define double LD
        #define pb push_back
        #define mp make_pair
        #define REP(i,n) for (int i = 0; i < n; i++)
        #define loop(i,n) for (int i = 0; i < n; i++)
        #define FOR(i,a,b) for (int i = a; i < b; i++)
        #define REPD(i,n) for (int i = n-1; i >= 0; i--)
        #define FORD(i,a,b) for (int i = a; i >= b; i--)
        #define remax(a,b) a = max(a,b)
        #define remin(a,b) a = min(a,b)
        #define mem(a, b) memset(a, b, sizeof a)
        #define append push_back
        #define all(v) v.begin(),v.end()
        #define F first
        #define S second
        #define print(x) cout << (x) << endl
        #define PRECISION(x) cout << fixed << setprecision(x)
        #define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
         
        const double PI=acos(-1);
        const int MOD = 1000000007;
        const int FMOD = 998244353;
        const double eps = 1e-9;
         
        mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count()); 
      
     
    	signed main()
    	{
    		int n,m;
    		cin>>n>>m;
    		int a[n];
    		loop(i,n)
    		a[i]=-1;
    		loop(i,m)
    		{
    			int idx,num;
    			cin>>idx>>num;
    			idx--;
    			if(a[idx]==-1)
    			{
    				a[idx]=num;
    			}
    			else
    			{
    				if(a[idx]!=num)
    				{
    					cout<<-1;
    					return 0;
    				}
    			}
    		}
    		int cnt=0;
    		loop(i,n)
    		{
    			if(a[i]!=0)
    			break;
    			
    			cnt++;
    		}
    		if(n==1)
    		{
    			if(a[0]==-1)
    			cout<<0;
    			else
    			cout<<a[0];
    		}
    		else
    		{
    			if(cnt)
    			cout<<-1;
    			else
    			{
    				loop(i,n)
    				{
    					if(i==0 && a[i]==-1)
    					cout<<1;
    					else if(a[i]==-1)
    					cout<<0;
    					else
    					cout<<a[i];
    				}
    			}
    		}
    	}

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

int main(){
	
	int n,m,ans;
	int a,b;
	
	cin >> n >> m;
	ans = m ;
	while( n-- ){
		cin >> a >> b ;
		m += a-b ;
		if( m < 0 ) ans = -1;
		else {
			if( ans != -1 && ans < m ) ans = m;
		}
	}
	
	cout << ((ans>=0)?ans:0) << endl ;
	return 0 ;
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}

	Scanner sc = new Scanner(System.in);

	void run() {
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		
		int w = 100;
		int h = 100;
		
		System.out.println(h+" "+ w);
		
		int x = 0;
		int y = 0;
		
		int mode = 0;

		for(int i =0 ; i< h ; i ++){	
			for(int j =0 ; j < w; j++){
				
				if(mode ==0 ){
					
					
					if(i %2 ==0  && j %2 ==0 && x < a -1){
						System.out.print(".");
						x++;
					}else{
						System.out.print("#");
					}
					
					
					
				}else{
					
					if(i %2 ==0 && j %2 == 0 && y < b-1){
						System.out.print("#");
						y++;
					}else{
						System.out.print(".");
					}
					
				}
			}
			System.out.println();
			if(mode==0 && x == a-1){
				mode = 1;
				
				for(int j = 0; j < w; j++){
					System.out.print("#");					
				}
				System.out.println();
				i++;
				for(int j = 0; j < w; j++){
					System.out.print(".");					
				}
				System.out.println();
				i++;
			}
		}
		
	}
}


Measured memory_bytes: 24788
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
# from fractions import gcd
# from math import gcd
import sys


def I(): return int(input())  # '123' -> 123


def Is(): return map(int, input().split())  # '123 456' -> 123, 456


def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]


def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)


def IR(n): return [I() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def TIR(n): return [TI() for _ in range(n)]


def S(): return input()


def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']


def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']


def SR(n): return [S() for _ in range(n)]


def SsR(n): return [Ss() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

N = I()
A = []
XY = []
for i in range(N):
    A.append(int(input()))
    XY.append([])
    for _ in range(A[i]):
        x, y = map(int, input().split())
        x -= 1
        XY[i].append((x, y))

ans = 0

for bit in range(1, 1 << N):
    contradiction = False
    for i in range(N):
        if bit & (1 << i):
            for x, y in XY[i]:
                if ((bit >> x) & 1) ^ y:
                    contradiction = True
    if not contradiction:
        ans = max(ans, bin(bit).count("1"))

print(ans)


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

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

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

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 50);

void solve(long long N, std::vector<std::string> S) {

    map<string, int> mp;
    rep(i, S.size()) mp[S[i]]++;

    vector<pair<int, string>> vs;
    for (auto p : mp) {
        vs.emplace_back(-p.second, p.first);
    }
    sort(all(vs));

    int m = vs[0].first;
    rep(i, vs.size()) {
        // debug(vs[i].first);
        // debug(vs[i].second);
        if (m != vs[i].first) break;
        cout << vs[i].second << endl;
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    long long N;
    cin >> 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: 29680
#include <bits/stdc++.h>
using namespace std;

#define fo1(i, n) for (int i = 0; i < n; i++)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int((x).size())
using ll = long long; using vi = vector<int>; using ii = pair<int,int>;
const int oo = 0x3f3f3f3f; const ll OO = ll(oo)*oo; const int N = 100005;
#ifndef DEBUG
#define endl '\n'
#define debugf(...)
#else
#define debugf(...) printf(__VA_ARGS__)
#endif

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

    int n; cin >> n;

    vector<ii> v(n);
    rep(i, 1, n+1) {
        int x; cin >> x;
        v[i-1] = { x, i };
    }

    sort(all(v));
    for(auto& p : v)
        cout << p.second << ' ';
    cout << endl;

    return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define rep(i,a,n) for(int _tmp=n,i=a;i<=_tmp;++i)
#define dep(i,a,n) for(int _tmp=n,i=a;i>=_tmp;--i)
#define fec(i,a) for(__typeof a.begin() i=a.begin();i!=a.end();++i)
#define For(i,u) for(int i=H[u];i;i=nxt[i])
#define re(i,a,b) for (int i=a;i<b;++i)
#define si(x) (int)x.size()
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
template<class T> inline void read(T&x){char c;bool fu=0;for(c=getchar();c<=32;c=getchar());if(c=='-')fu=1,c=getchar();for(x=0;c>32;c=getchar())x=x*10+c-'0';if(fu)x*=-1;}
template<class T> inline void read(T&x,T&y){read(x);read(y);}
template<class T> inline void read(T&x,T&y,T&z) {read(x,y);read(z);}
typedef long long ll;
typedef pair<int,int> pii;
const int N=111111;
//head
ll ans=0;
int n;
char s[15];
int a[15];
void dfs(int x,ll y,ll an){
	if(x>n){if(y==0)ans+=an;return;}
	dfs(x+1,y*10+a[x+1],an);
	dfs(x+1,a[x+1],an+y);
}
int main() {
	scanf("%s",s+1);n=strlen(s+1);
	rep(i,1,n)a[i]=s[i]-'0';
	dfs(1,a[1],0);
	cout<<ans;
	return 0;
}

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


ll mod = 1e9+7;

ll gcd(ll a,ll b){
	if(b==0)return a;return gcd(b,a%b);
}
ll expo(ll base,ll pow){
    ll ans = 1;
    while(pow!=0){
        if(pow&1==1){ans = ans*base;}
        base *= base;pow/=2;}return ans;
}
ll inv(ll x){return expo(x,mod-2);}

int pre[123456];
ll A[301][301], B[301][301];

int main(){
    //freopen("ip.txt", "rt", stdin);
    //freopen("op.txt", "wt", stdout);
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            cin >> A[i][j];
            B[i][j] = A[i][j];
        }
    }

    for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            for(int j = i+1; j <= n; j++){
                if(A[i][j] > A[i][k]+A[k][j]){
                   cout << -1;
                   return 0;
                }
                if(A[i][j] == A[i][k]+A[k][j] && i != k && j != k){
                   B[i][j] = INT_MAX;
                }
            }
        }
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i+1; j <= n; j++){
            if(B[i][j] != INT_MAX) ans += B[i][j];
        }
    }
    cout << ans;
}


Measured memory_bytes: 1664
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iterator>
#include <utility>
#include <iomanip>
#include <cmath>
#include <climits>
#include <cassert>
#include <stdio.h>
#include <string.h>

using namespace std;

void solve() {
  int n, k;
  cin >> n >> k;
  
  bool ret = n >= 2*k-1;
  
  std::cout << (ret ? "YES" : "NO") << std::endl;
}

int main(int argc, char *argv[])
{
  solve();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
int main(void){
    string s;
    cin>>s;
    int n=s.size();
    if(s[0]==s[1]){
        cout<<"1 2"<<endl;
        return 0;
    }
    for(int i=2;i<n;i++){
        if(s[i-1]==s[i]){
            cout<<i<<' '<<(i+1)<<endl;
            return 0;
        }
        if(s[i-2]==s[i]){
            cout<<(i-1)<<' '<<(i+1)<<endl;
            return 0;
        }
    }
    cout<<"-1 -1"<<endl;
    return 0;
}

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

using ll = long long;
using boost::irange;

int main(){

    int N, K;
    cin >> N >> K;

    int ans = 0;
    int h;
    for (int i: irange(0,N)){
        cin >> h;
        if (h >= K) ans++;     
    }

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main {
 
    public static final int BIG_NUM  = 2000000000;
    public static final int MOD  = 1000000007;
 
    public static void main(String[] args) {
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
 
        try {
 
            String str[] = br.readLine().split("\\s+");
            int array[] = new int[str.length];
 
            for(int i = 0; i < str.length; i++){
                array[i] = Integer.parseInt(str[i]);
            }
 
            Dice dice = new Dice();
            dice.setNumber(array[0], array[1], array[2], array[3], array[4], array[5]);
 
            int Q = Integer.parseInt(br.readLine());
 
            String tmp_str[] = new String[2];
            int top_num,front_num;
 
            for(int loop = 0; loop < Q; loop++){
 
                tmp_str = br.readLine().split("\\s+");
                top_num = Integer.parseInt(tmp_str[0]);
                front_num = Integer.parseInt(tmp_str[1]);
 
                System.out.println(dice.query(top_num, front_num));
            }
 
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 
class Dice{
 
    private int number[];
    private int work[];
    private final String order = "NNNNWNNNWNNNENNNENNNWNNN";
 
    Dice(){
        number = new int[6];
        work = new int[6];
    }
 
 
    public void roll(char dst){
        for(int i = 0; i < 6; i++) work[i] = number[i];
        switch(dst){
        case 'E':
            setNumber(work[3],work[1],work[0],work[5],work[4],work[2]);
            break;
        case 'N':
            setNumber(work[1],work[5],work[2],work[3],work[0],work[4]);
            break;
        case 'S':
            setNumber(work[4],work[0],work[2],work[3],work[5],work[1]);
            break;
        case 'W':
            setNumber(work[2],work[1],work[5],work[0],work[4],work[3]);
            break;
        }
    };
 
    public int query(int top_num,int front_num){
 
        int save_data[] = new int[6];
        for(int i = 0; i < number.length; i++){
            save_data[i] = number[i];
        }
 
        int ret = -1;
 
        for(int i = 0; i < order.length(); i++){
            roll(order.charAt(i));
            if(number[0] == top_num && number[1] == front_num){
                ret = number[2];
                break;
            }
        }
 
        for(int i = 0; i < save_data.length; i++){
            number[i] = save_data[i];
        }
 
        return ret;
    }
 
    public int getTop(){
        return number[0];
    }
 
    public void setNumber(int n0,int n1,int n2,int n3,int n4,int n5){
        number[0] = n0;
        number[1] = n1;
        number[2] = n2;
        number[3] = n3;
        number[4] = n4;
        number[5] = n5;
    }
};


Measured memory_bytes: 24656
n=int(input())
def dfs(tmp,num):
    if tmp > n:
        return
    if num == 0b111:
        cnt[0]+=1
    dfs(tmp*10+7, num | 0b001)
    dfs(tmp*10+5,num | 0b010)
    dfs(tmp*10+3,num | 0b100)
    
cnt=[0]
dfs(0,0)
print(cnt[0])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define FOR(NAME, START, NUM) for (ll NAME = START; NAME < (NUM); NAME++)
#define REP(NAME, NUM) for (ll NAME = 0; NAME < (NUM); NAME++)
#define BREP(NAME, NUM) for (ll NAME = (NUM)-1; NAME >= 0; NAME--)
#define ALL(NAME) (NAME).begin(), (NAME).end()
const ll INF = 1000000000000000;

int main(){
  int n,cnt = 1;
  cin >> n;
  std::vector<char> v(n);
  REP(i, n){
    std::cin >> v[i];

    if(i != 0){
      if(v[i] != v[i-1]){
        cnt++;
      }
    }
  }

  std::cout << cnt << '\n';

  return 0;
}


Measured memory_bytes: 384
#include<algorithm>
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define S second
#define F first
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,n) for(ll i=1;i<=n;i++)
#define fb(i,n) for(ll i=n-1;i>=0;i--)
#define fb1(i,n) for(ll i=n;i>0;i--)
#define endd cout<<'\n';
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define fr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define fastii ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define CASES  ll t;cin>>t;while(t--)
typedef long long ll;
int main()
{
fastii;
    ll x,n;
    cin>>x>>n;
    ll arr[n];
    map<ll,ll>m;
    f(i,n)
    {
        cin>>arr[i];
        m[arr[i]]++;
    }
    sort(arr,arr+n);
    ll c1,c2;
    if(m[x]==0)
        cout<<x;
    else
    {
        ll y=x;
        while(m[y]!=0)
        {
            y--;
        }
        c1=y;
        y=x;
        while(m[y]!=0)
        {
            y++;
        }
        c2=y;
        if(abs(c1-x)<=abs(c2-x))
        {
            cout<<c1;
        }
        else
        {
            cout<<c2;
        }
    }
    return 0;
}

Measured memory_bytes: 3652
from sys import stdin, maxsize


def insertion_sort(A, n, g):
    cnt = 0
    for i in range(n):
        j = i
        tmp = A[j]
        while j - g >= 0 and A[j - g] > tmp:
            A[j] = A[j - g]
            j -= g
            cnt += 1
        A[j] = tmp
    return cnt


n = int(input())
A = [int(stdin.readline()) for i in range(n)]

G = [1]
for j in range(maxsize):
    k = 2**j + 1
    if k > n: break
    G += [k]

G.reverse()
m = len(G)

cnt = 0
for g in G:
    cnt += insertion_sort(A, n, g)

print(m)
print(*G)
print(cnt)
print("\n".join(map(str, A)))



Measured memory_bytes: 125984
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    int n[4];
    cin>>n[0]>>n[1]>>n[2]>>n[3];
    sort(n,n+4);
    //cout<<n[0]<<n[1]<<n[2]<<n[3];
    if (n[0]==1 && n[1]==4 && n[2]==7 && n[3]==9){
        cout<<"YES";
    }
    else{
        cout<<"NO";
    }
    
}


Measured memory_bytes: 3640
#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 INF = 1001001001;
int main(){
  string N;
  cin>>N;
  if(N.at(0)=='7'){cout<<"Yes"<<endl;}
  else if(N.at(1)=='7'){cout<<"Yes"<<endl;}
  else if(N.at(2)=='7'){cout<<"Yes"<<endl;}
  else {cout<<"No"<<endl;}
  return 0;
}

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

using LL = long long;

int main() {
#ifdef LOCAL_EXEC
	freopen("sample.in", "r", stdin);
//	freopen("sample.out", "w", stdout);
#else
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#endif

	int n, m; cin >> n >> m;
	string s; cin >> s;
	vector<int> dis(n + 1, 0), par(n + 1, -1);
	using pii = pair<int, int>;
	set<pii> vals;
	vals.emplace(0, n);
	for (int i = n - 1, j = n; i >= 0; i--) {
		if (s[i] == '1') continue;
		while (i + m < j) {
			auto it = vals.find({dis[j], j});
			if (it != vals.end()) {
				vals.erase(it);
			}
			j--;
		}
		if (vals.empty()) {
			cout << "-1\n";
			return 0;
		}
		tie(dis[i], par[i]) = *vals.begin();
		dis[i]++;
		vals.emplace(dis[i], i);
	}

	for (int i = 0; i != n; i = par[i]) {
		cout << (par[i] - i) << ' ';
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 3712
#include<iostream>
using namespace std;
typedef long long int ll;
int cnt[26][100009];
int l[26];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    for(int i=0;i<26;i++) {l[i]=0; cnt[i][0]=0;}
    cin>>s;
    int n=s.length();
    s=" "+s;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<26;j++) cnt[j][i]=cnt[j][i-1];
        cnt[s[i]-'a'][i]++;
        if(l[s[i]-'a']>=1 and 2*(-1*cnt[s[i]-'a'][l[s[i]-'a']-1]+cnt[s[i]-'a'][i])>(i-l[s[i]-'a']+1)){cout<<l[s[i]-'a']<<" "<<i; return 0 ;}
        l[s[i]-'a']=i;
    }
    cout<<-1<<" "<<-1;
}


Measured memory_bytes: 13832
#include <iostream>
#include<string>
#include<time.h>
#include<math.h>
#include<stdlib.h>
#include<map>
using namespace std;

int main() {
	int K,i,ans=0;
	cin >> K;
	
	if (K ==1 ) cout <<1 << endl;
	else if (K == 2) cout << 1<< endl;
	else if (K == 3) cout << 1<< endl;
	else if (K == 4) cout << 2<< endl;
	else if (K == 5) cout << 1<< endl;
	else if (K == 6) cout << 2<< endl;
	else if (K == 7) cout << 1<< endl;
	else if (K == 8) cout << 5<< endl;
	else if (K == 9) cout << 2<< endl;
	else if (K == 10) cout <<2 << endl;
	else if (K == 11) cout << 1<< endl;
	else if (K == 12) cout << 5<< endl;
	else if (K == 13) cout << 1<< endl;
	else if (K == 14) cout << 2<< endl;
	else if (K == 15) cout << 1<< endl;
	else if (K == 16) cout << 14<< endl;
	else if (K == 17) cout << 1<< endl;
	else if (K == 18) cout << 5<< endl;
	else if (K == 19) cout << 1<< endl;
	else if (K == 20) cout << 5<< endl;
	else if (K == 21) cout << 2<< endl;
	else if (K == 22) cout << 2<< endl;
	else if (K == 23) cout << 1<< endl;
	else if (K ==24 ) cout << 15<< endl;
	else if (K ==25 ) cout << 2<< endl;
	else if (K == 26) cout << 2<< endl;
	else if (K == 27) cout << 5<< endl;
	else if (K ==28 ) cout << 4<< endl;
	else if (K ==29 ) cout << 1<< endl;
	else if (K ==30 ) cout << 4<< endl;
	else if (K ==31 ) cout << 1<< endl;
	else if (K == 32) cout << 51<< endl;
	
	

	return 0;
}

Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"
#define int ll

using namespace std;
typedef string::const_iterator State;
#define eps 1e-8L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()
void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(20);
}
int grids[100][100];
void solve() {
	int d, w;
	while (cin >> d >> w) {
		if (d == 0) return;
		REP(i, d) {
			REP(q, w) {
				cin >> grids[i][q];
			}
		}
		int ans = 0;
		REP(l_h,d) {
			for (int l_r = l_h+2; l_r < d; ++l_r) {
				REP(w_l, w) {
					for (int w_r = w_l+2; w_r < w; ++w_r) {
						int kakomi = 1e9;
						int cnter = 0;
						int naka_max = 0;
						for (int x = l_h; x <= l_r; ++x) {
							for (int y = w_l; y <= w_r; ++y) {
								if (x == l_h or x == l_r or y == w_l or y == w_r) {
									kakomi = min(kakomi, grids[x][y]);
								}
								else {
									naka_max = max(naka_max, grids[x][y]);
									cnter += grids[x][y];
								}
							}
						}
						if (naka_max < kakomi) {
							ans = max(ans, (l_r - l_h - 1) * (w_r - w_l - 1) * kakomi - cnter);
						}
					}
				}
			}
		}
		cout << ans << endl;
	}
}
#undef int
int main() {
	init();
	solve();
}


Measured memory_bytes: 3108
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int i;
	int flag=0;
	for(i=1;i<=9;i++)
	{
		if(n%i==0)
		{
			if(n/i<=9)
			flag=1;
		}
	}
	if(flag==0) cout<<"No";
	else cout<<"Yes";
}

Measured memory_bytes: 888
/*
  AtCoder Beginner COntest 104
  D - We Love ABC
*/

#include<iostream>
using namespace std;

const int mod = 1000000007;

int main() {
  string S;
  cin >> S;
  int N = S.size();

  // dp[i][j]
  //   i: 先頭からi文字目
  //   j: i-1文字目までについている〇の数
  long long dp[100001][4] = {};
  for (int i = N; i >= 0; --i) {
    for (int j = 3; j >= 0; --j) {
      if (i == N) dp[i][j] = (j == 3) ? 1 : 0;
      else {
        // 〇を付けないパターン
        dp[i][j] = dp[i+1][j] * (S[i] == '?' ? 3 : 1);

        // 〇を付けるパターン
        if (j < 3 && (S[i] == '?' || S[i] == "ABC"[j])) {
          dp[i][j] += dp[i + 1][j + 1];
        }

        dp[i][j] %= mod;
      }
    }
  }

  printf("%d\n", dp[0][0]);
  return 0;
}

Measured memory_bytes: 3584
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

int main() {
    
    ll ans = 2019;
    ll l,r;
    cin >> l >> r;
    ll last = min(l+2019,r);
    for (ll i=l;i<=last;i++){
        for(ll j=i+1;j<=last;j++){
            ll tmp = i*j%2019;
            if(ans > tmp){
                ans = tmp;
            }
        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <algorithm>
#include <functional>

#include <map>

using namespace std;

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

	string S;
	cin >> S;

	map<char, int> info;

	for (char ch : S)
	{
		info[ch]++;
	}

	if (info['A'] == 3 || info['B'] == 3)
	{
		cout << "No";
		return 0;
	}

	cout << "Yes";

	return 0;
}

Measured memory_bytes: 256
s = input()
n = len(s)
i = 0
j = n-1
ans = 0
while j - i > 0:
    #print(s[i],s[j])
    if s[i] == s[j]:
        i += 1
        j -= 1
        continue
    if s[i] == 'x':
        ans += 1
        i += 1
        continue
    if s[j] == 'x':
        ans += 1
        j -= 1
        continue

    print(-1)
    exit()

print(ans)

Measured memory_bytes: 39664
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    int N;
    cin>>N;
    int A[N];
    int ans=0;
    rep(i,N){
        cin>>A[i];
        if(A[i]%2==1)ans++;
    }
    if(ans%2==1) cout << "NO"<<endl;
    else cout << "YES" << endl;

    



}


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

int ans = 0;
int n, m;
int state[10];
int p[10];
vector<int> pos[10];

void check()
{
    for (int i = 0; i != m; ++i)
    {
        int tmp = 0;
        for (int index : pos[i])
            tmp ^= state[index];
        if (tmp != p[i])
            return;
    }
    
    ++ans;
}

void rec(int pos)
{
    if (pos == n)
    {
        check();
        return;
    }
    
    for (int i = 0; i != 2; ++i)
    {
        state[pos] = i;
        rec(pos + 1);
    }
}

void take_input()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    cin >> n >> m;
    for (int i = 0; i != m; ++i)
    {
        int k;
        cin >> k;
        pos[i].resize(k);
        for (int j = 0; j != k; ++j)
        {
            cin >> pos[i][j];
            pos[i][j]--;
        }
    }
    for (int i = 0; i != m; ++i)
        cin >> p[i];
}

int main()
{
    take_input();
    
    rec(0);
    
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pr printf
#define sc scanf

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef long double ld;
int a, b, n;
int main () {
    sc("%d", &n);
    int err = 0;
    for(int i = 1; i <= n; i++) {
        sc("%d", &a);
        if(a != i) err++;
    }
    if(err <= 2) pr("YES\n");
    else pr("NO\n");
    return 0;
}


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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
const int MOD = 1000000007;

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

  vector<ll> dp(n + 1, 0);
  rep (i, m) {
    int a;
    cin >> a;
    dp[a] = -1;
  }

  dp[0] = 1;
  rep (i, n) {
    if (dp[i] == -1) continue;
    if (i + 1 <= n && dp[i + 1] != -1) dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
    if (i + 2 <= n && dp[i + 2] != -1) dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;
  }

  cout << dp[n] << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
using namespace std;
#define MM 1000000000
#define MOD MM+7
#define pi pair<int32,int32>
#define pl pair<int64,int64>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

long long pow_mod(long long n,long long k,long long m){
    if (k == 0){
        return 1;
    } else if (k % 2 == 1){
        return pow_mod(n,k-1,m)*n % m;
    } else {
        long long t = pow_mod(n,k/2,m);
        return t*t % m;
    }
}


int main(){
    while(true){
    int n; cin >> n;
    if (n == 0) break;
    int a[n];
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        sum += a[i];
    }
    sum /= n;
    int ans = 0;
    for(int i = 0; i < n; i++){
        if (sum >= a[i]) ans++;
    }
    cout << ans << endl;
    }
}
  




Measured memory_bytes: 3124
#include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
static const ll MAX_L = (ll)1 << 62;

ll x[50] = {};
ll y[50] = {};

int main() {
	ll n, k; cin >> n >> k;
	rep(i, 0, n)cin >> x[i] >> y[i];

	ll minV = MAX_L;
	rep(x1, 0, n)rep(x2, 0, n) {
		//if (x[x2] < x[x1]) {
		//	ll t = x[x2];
		//	x[x2] = x[x1];
		//	x[x1] = t;
		//}
		rep(y1, 0, n)rep(y2, 0, n) {
			//if (y[y2] < y[y1]) {
			//	ll t = y[y2];
			//	y[y2] = y[y1];
			//	y[y1] = t;
			//}

			ll cnt = 0;
			rep(p, 0, n) {
				//if (x[x1] == 1 && x[x2] == 8 && y[y1] == 1 && y[y2] == 4) {
				//	cout << endl;
				//}
				if (x[x1] <= x[p] && x[p] <= x[x2] && y[y1] <= y[p] && y[p] <= y[y2]) {
					cnt++;
				}
			}
			if (cnt >= k) {
				minV = min(abs((x[x2] - x[x1])*(y[y1] - y[y2])), minV);
			}
		}
	}
	cout << minV << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  vs s(3);
  rep(i, 3) cin >> s[i];
  sort(all(s));
  bool ok[3][3][4008];
  rep(i, 3) rep(j, 3) rep(k, 4008) ok[i][j][k] = true;
  rep(i, 3) rep(j, 3) {
    if(i == j) continue;
    int m = s[i].size();
    int n = s[j].size();
    rep(a, m) {
      bool same = true;
      rep(b, min(n, m - a)) {
        char x = s[i][a + b];
        char y = s[j][b];
        if(x != y && x != '?' && y != '?') same = false;
      }
      ok[i][j][a] = same;
    }
  }
  int ans = 1e9;
  vi v = {0, 1, 2};
  do {
    int l = s[v[0]].size();
    int m = s[v[1]].size();
    int n = s[v[2]].size();
    rep(i, l + 1) rep(j, max(m + 1, l - i + 1)) {
      bool ac = ok[v[0]][v[1]][i] && ok[v[1]][v[2]][j] && ok[v[0]][v[2]][i + j];
      int d = max(l, max(i + m, i + j + n));
      if(ac) ans = min(ans, d);
    }
  } while(next_permutation(all(v)));
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  int N;
  string S="ARC";
  cin>>N;
  if(N<1200) S="ABC";
  else if(N>=2800) S="AGC";
  cout<<S;
return 0;}

Measured memory_bytes: 3588
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;
use std::iter::*;
use itertools::Itertools;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
  }

  pub struct UnionFind {
    n: usize,
    root: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}
 
impl UnionFind {
    pub fn new(n: usize) -> Self {
        let root = (0..n).collect();
        let rank = vec![0;n];
        let size = vec![1;n];
        Self {
            n,
            root,
            rank,
            size,
        }
    }
 
    pub fn find(&mut self, x: usize) -> usize {
        if x >= self.n {
            panic!();
        } else if self.root[x] == x {
            x
        } else {
            let root = self.find(self.root[x]);
            self.root[x] = root;
            root
        }
    }
 
    pub fn unite(&mut self, x: usize, y: usize) {
        if x >= self.n || y >= self.n {
            panic!();
        }
        let x_root = self.find(x);
        let y_root = self.find(y);
        if x_root == y_root {
            return;
        }
 
        //yに所属が移る
        if self.rank[x_root] < self.rank[y_root] {
            self.root[x_root] = y_root;
            self.size[y_root] += self.size[x_root];
        } else {
            //xに所属が移る
            self.root[y_root] = x_root;
            self.size[x_root] += self.size[y_root];
            //木の高さが同じとき，片方がもう片方のroot直下につながるので1だけ高くなる
            if self.rank[x_root] == self.rank[y_root] {
                self.rank[x_root] += 1;
            }
        }
    }
 
    pub fn size(&mut self, x: usize) -> usize {
        if x >= self.n {
            panic!();
        }
        let x_root = self.find(x);
        self.size[x_root]
    }
 
    pub fn is_same(&mut self, x: usize, y: usize) -> bool{
        if x >= self.n || y >= self.n {
            panic!();
        }
        self.find(x) == self.find(y)
    }
 
}

#[fastout]
fn main() {
    input!{
        n: usize,
        m: usize,
        ab: [[usize; 2]; m],
    }

    let mut friend_relation = UnionFind::new(n);
    let mut friends = vec![0;n];
    for i in ab {
        friend_relation.unite(i[0]-1, i[1]-1);
        friends[i[0] - 1] += 1;
        friends[i[1] - 1] += 1;
    }

    let mut ans = 0;
    for i in 0..n {
        ans = max(ans, friend_relation.size(i));
    }

    println!("{}", ans);

}


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

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF

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

template<typename T>
void maxs(T& x, T&& y) {
  x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
  x=std::max(x,y);
}

template<typename T>
void mins(T& x, T&& y) {
  x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
  x=std::min(x,y);
}

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

  int N;
  cin >> N;
  std::map<string, int> mp;
  rep(i, N) {
    string S;
    cin >> S;
    ++mp[S];
  }

  cout << "AC x " << mp["AC"] << '\n';
  cout << "WA x " << mp["WA"] << '\n';
  cout << "TLE x " << mp["TLE"] << '\n';
  cout << "RE x " << mp["RE"] << '\n';
}


Measured memory_bytes: 3668
#define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define rep(i, n) for(int i=0;i<(n);i++)
#define REP(i, n) for(int i=1;i<=(n);i++)
#define all(V) V.begin(),V.end()
typedef long long lint;
typedef std::pair<lint, lint> P;
constexpr int INF = INT_MAX;
constexpr lint LINF = LLONG_MAX;
constexpr double eps = 1e-9;
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
inline lint gcd(lint a, lint b) {
	while (b) {
		lint c = a;
		a = b; b = c % b;
	}
	return a;
}
inline lint lcm(lint a, lint b) {
	return a / gcd(a, b) * b;
}
bool isprime(lint n) {
	if (n == 1)return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)return false;
	}
	return true;
}
lint mypow(lint a, lint b) {
	if (!b)return 1;
	if (b & 1)return mypow(a, b - 1) * a;
	lint memo = mypow(a, b >> 1);
	return memo * memo;
}
lint modpow(lint a, lint b, lint m) {
	if (!b)return 1;
	if (b & 1)return modpow(a, b - 1, m) * a % m;
	lint memo = modpow(a, b >> 1, m);
	return memo * memo % m;
}
void printArray(std::vector<int>& vec) {
	rep(i, vec.size() - 1)std::cout << vec[i] << " ";
	std::cout << vec.back() << std::endl;
}
template<typename T>
void printArray(T l, T r) {
	T rprev = r;
	rprev--;
	for (T i = l; i != rprev; i++) {
		std::cout << *i << " ";
	}
	std::cout << *rprev << std::endl;
}
std::string to_string(std::vector<int>& vec) {
	std::string res = "[";
	rep(i, vec.size() - 1)res += std::to_string(vec[i]) + ", ";
	res += std::to_string(vec.back()) + "]";
	return res;
}
signed main() {
	int n;
	lint ans = 0;
	std::cin >> n;
	REP(i, n) {
		if (i % 3 && i % 5)ans += i;
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#include<stdlib.h>
#include<set>
#include<map>
#include<bitset>
#define rep(i,a,b)  for(i=a;i<b;i++)
#define itrep(at)	for(auto it=at.begin();it!=at.end();it++)
#define lli long long int
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define db double
#define M 1000000007
#define INF 1e17
#define pi 3.1415926535897932384626433832795028841971

#define MAX 2005

using namespace std;
lli min(lli a,lli b){return a<b?a:b;}
lli min(lli a,lli b,lli c){a=min(a,b);a=min(a,c);return a;}
lli max(lli a,lli b){return a>b?a:b;}
lli max(lli a,lli b,lli c){a=max(a,b);a=max(a,c);return a;}
lli dsum(lli n){lli ans=0;while(n){ans+=(n%10);n/=10;}return ans;}
lli power(lli a,lli b){lli res=1;while(b){if(b&1) res=res*a;a=a*a;b>>=1;}return res;}

struct pll{
	lli x,y;
};
bool comp(pll a,pll b){
	if(a.x==b.x)	return a.y<b.y;
	else	return a.x<b.x;
}
vector<vector<lli> >adj(MAX);
bool vis[MAX];
vector<lli>dist(MAX);
vector<vector<lli> >v(MAX);
void init(){
	for(lli i=0;i<MAX;i++){
		vis[i]=false;
		dist[i]=0;
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	char ch;
	db aa,bb,cc;
	string s1,s2,s3,str;
    lli i,j,k,a,b,c,m,n,sum=0,ans=0,temp,t;
    cin >> n >> a >> b;
    adj[a].pb(b);
    adj[b].pb(a);
    for(i=1;i<n;i++){
    	adj[i].pb(i+1);
    	adj[i+1].pb(i);
	}
	lli x;
	map<lli,lli>ma;
    for(i=1;i<=n;i++){
    	init();
    	queue<lli>qe;
    	x=i;
    	qe.push(x);
    	dist[x]=0;vis[x]=true;
    	while(!qe.empty()){
    		x=qe.front();
    		qe.pop();
    		for(j=0;j<adj[x].size();j++){
    			k=adj[x][j];
    			if(!vis[k]){
    				vis[k]=true;
    				qe.push(k);
    				dist[k]=dist[x]+1;
				}
			}
		}
		//for(j=1;j<=n;j++)	cout<<dist[j]<<" ";cout<<endl;
    	for(j=1;j<=n;j++){
    		ma[dist[j]]++;
		}
	}
//	for(i=1;i<=n;i++){
//		for(j=1;j<=n;j++){
//			ma[v[i][j]]++;
//		}
//	}
	for(i=1;i<n;i++){
		cout << ma[i]/2 << endl;
	}
    
    
    return 0;
}

















/* UJJWAL KESHRI */

Measured memory_bytes: 512
#include <iostream>
#include <numeric>
#include <algorithm>
using namespace std;

int main() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  
  int x[n + 1] = {};
  int xi = 0;
  int count = 0;
  char preC = '1';
  for (char c: s) {
    if (c == preC) {
      count++;
    } else {
      x[xi] = count;
      count = 1;
      preC = c;
      xi++;
    }
  }
  x[xi] = count;
  
  int maxL = 0;
  for (int i = 0; i <= xi; i += 2) {
    int sum = accumulate(x + i, x + min(i + 2 * k + 1, n), 0);
    maxL = max(maxL, sum);
  }
  
  cout << maxL << endl;
  return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define MOD  1000000007
#define ll long long
#define int long long 
# define INF 2e5+5
#define ar array
# define fr first
# define sc second
#define wt(x) int x;cin>>x;while(x--)
#define watch(x) cerr << "\n" << (#x) << " is " << (x) << endl
//#define cerr if(false)cerr
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> pbds;

void  c_p_c(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
 
#ifndef ONLINE_JUDGE
  freopen("input1.txt","r",stdin);
  freopen("output1.txt","w",stdout);
#endif
 }
 
int power(int a,int b,int mod){
    a=a%mod;
    if(a==0){
        return 1;
    }
    int res=1;
    while(b){
        if(b&1){
            res=(res*a)%mod;
        }
        b>>=1;
        a=(a*a)%mod;
    }
    return res;
 }
 
int  MMI(int p){
    return power(p,MOD-2,MOD);
}
const int mxN=1e7;
int  c[mxN+1];
int32_t main()
{
    c_p_c();
    
    int n;
    cin>>n;
    
    for(int i=1; i<=n; ++i)
        for(int j=0; (j+=i)<=n; )
            ++c[j];
    ll ans=0;
    for(int i=1; i<=n; ++i)
        ans+=(ll)i*c[i];
    cout << ans;
  


        



         
 
 
    
      return 0;
       
        }
        
        
 
        
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
        

        


























//abcdef-abcdef
//factorial vs power
//multiplication table
//salary changing
//Obtain a Permutation
//Shift and Replace

Measured memory_bytes: 81752
def main():
    h,w=map(int,input().split())
    a=[list(input()) for i in range(h)]
    for i in range(h):
        for j in range(w):
            if a[i][j]==".":
                a[i][j]=99999
    ans=0
    import collections
    from copy import deepcopy
    direction=[[0,1],[0,-1],[1,0],[-1,0]]
    for sh in range(h):
        for sw in range(w):
            if a[sh][sw]==99999:
                field=deepcopy(a)
                field[sh][sw]=0
                next_list=collections.deque([[sh,sw]])
                while next_list:
                    n=next_list.popleft()
                    for dx,dy in direction:
                        ny,nx=n[0]+dy,n[1]+dx
                        if 0<=ny<=h-1 and 0<=nx<=w-1 and field[ny][nx]!="#" and field[ny][nx]==99999:
                            field[ny][nx]=field[n[0]][n[1]]+1
                            ans=max(ans,field[ny][nx])
                            next_list.append([ny,nx])
    print(ans)
if __name__ == '__main__':
    main()

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

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

using ll  = long long int;
using vl  = vector<ll>;
using vvl = vector<vl>;

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

const int inf = (1<<28);

int toBlack(char s, char t) { return s == '.' && t == '#'; }
int toWhite(char s, char t) { return s == '#' && t == '.'; }

int main() {
    int h, w; cin >> h >> w;
    vector<string> s(h);
    rep(i,h) cin >> s[i];
    vvl dp(h, vl(w, inf));
    dp[0][0] = (s[0][0] == '.') ? 0 : 1;
    rep(i,h-1) dp[i+1][0] = dp[i][0] + toBlack(s[i][0], s[i+1][0]);
    rep(j,w-1) dp[0][j+1] = dp[0][j] + toBlack(s[0][j], s[0][j+1]);
    rng(i,1,h) rng(j,1,w) {
        chmin(dp[i][j], dp[i-1][j] + toWhite(s[i][j], s[i-1][j]));
        chmin(dp[i][j], dp[i][j-1] + toWhite(s[i][j], s[i][j-1]));
    }
    cout << dp[h-1][w-1] << endl;
    return 0;
}


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

int main() {
  char alpha;
  cin >> alpha;
  if (alpha == 'a' || alpha == 'b' || alpha == 'c' || alpha == 'd' || 
      alpha == 'e' || alpha == 'f' || alpha == 'g' || alpha == 'h' ||
      alpha == 'i' || alpha == 'j' || alpha == 'k' || alpha == 'l' || 
      alpha == 'm' || alpha == 'n' || alpha == 'o' || alpha == 'p' || 
      alpha == 'q' || alpha == 'r' || alpha == 's' || alpha == 't' || 
      alpha == 'u' || alpha == 'v' || alpha == 'w' || alpha == 'x' ||
      alpha == 'y' || alpha == 'z')
    cout << 'a' << endl;
  else if (alpha == 'A' || alpha == 'B' || alpha == 'C' || alpha == 'D' || 
      alpha == 'E' || alpha == 'F' || alpha == 'G' || alpha == 'H' ||
      alpha == 'I' || alpha == 'J' || alpha == 'K' || alpha == 'L' || 
      alpha == 'M' || alpha == 'N' || alpha == 'O' || alpha == 'P' || 
      alpha == 'Q' || alpha == 'R' || alpha == 'S' || alpha == 'T' || 
      alpha == 'U' || alpha == 'V' || alpha == 'W' || alpha == 'X' ||
      alpha == 'Y' || alpha == 'Z')
    cout << 'A' << endl;
}


Measured memory_bytes: 3616
# AOJ 0526: Boat Travel
# Python3 2018.7.1 bal4u

INF = 0x7fffffff
while True:
	n, k = map(int, input().split())
	if n == 0: break
	fee = [[INF for j in range(101)] for i in range(101)]
	for i in range(n+1): fee[i][i] = 0
	for i in range(k):
		v = list(map(int, input().split()))
		a, b = v[1], v[2]
		if v[0] == 1:
			e = v[3]
			if fee[a][b] > e:
				fee[a][b], fee[b][a] = e, e
				for c in range(1, n+1):
					for d in range(c+1, n+1):
						t = fee[c][a] + e + fee[b][d]
						if t < fee[c][d]: fee[c][d], fee[d][c] = t, t
						t = fee[c][b] + e + fee[a][d]
						if t < fee[c][d]: fee[c][d], fee[d][c] = t, t;
		else:
			e = fee[a][b]
			if e >= INF: e = -1
			print(e)


Measured memory_bytes: 5776