akhauriyash/Code-Regression huggingface dataset:
import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

long[] m = [31,28,31,30,31,30,31,31,30,31,30,31];

void main(){

    while(true){
	auto s = readln().split().to!(long[]);
	if(s[0] < 0 || s[1] < 0 || s[2] <0 || s[3] < 0 || s[4] < 0 || s[5] < 0){
	    break;
	}
	long ans;
	bool lp1 = s[0] % 4 == 0 && (s[0] % 100 != 0 || ( s[0] % 100 == 0 && s[0] % 400 == 0));
	bool lp2 = s[3] % 4 == 0 && (s[3] % 100 != 0 || ( s[3] % 100 == 0 && s[3] % 400 == 0));
	if(s[0] == s[3]){
	    if(s[1] == s[4]){
		ans += s[5] - s[2];
	    }else{
		ans+=m[s[1]-1] - s[2];
		for(long i=s[1]+1;i<=s[4]-1;i++){
		    ans += m[i-1];
		}
		ans+=s[5];
		if(s[1] <= 2 && lp1 && 2 < s[4]) ans++;
	    }
	}else{
	    ans =  (s[3] - s[0] - 1) * 365;
	    for(long i=s[0]+1;i<=s[3]-1;i++){
		if(i%4==0 && ( i%100!=0 || (i%100==0 &&i%400==0))) ans++;
	    }
	    /*
	    ans += (s[3]-1) / 4 - (s[3]-1) / 100 + (s[3]-1) / 400;
	    ans -= (s[0]+1) / 4 - (s[0]+1) /100 + (s[0]+1) / 400;
	    if((s[0]+1) % 4 == 0 && ((s[0]+1) % 100 != 0 || ( (s[0]+1) % 100 == 0 && (s[0]+1) % 400 == 0))) ans--;
	    */
	    for(long i=s[1]+1;i<=12;i++){
		if(lp1 && i == 2) ans += 1;
		ans += m[i-1];
	    }
	    ans += m[s[1]-1] - s[2];
	    for(long i=1;i<s[4];i++){
		if(lp2 && i == 2) ans += 1;
		ans += m[i-1];
	    }
	    ans += s[5];
	}
	ans.writeln();
    }
}

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

vector<P> A;
bool com(P a, P b){return a.second < b.second;}

int main(){
    int n,m; cin >> n >> m;
    A.resize(m);
    rep(i,m) cin >> A[i].first >> A[i].second;
    sort(A.begin(),A.end(),com);
    int end = 0;
    int res = 0;
    rep(i,m){
        if(A[i].first >= end) {
            end = A[i].second;
            res++;
        }
    } 
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int n;
    ll a[100003];
    ll b[100003];

    Scd(n);

    Rep(i,n){
        Scll2(a[i],b[i]);
    }

    ll ans = 0;
    for (int i = n-1; i >= 0; i--){
        ans += ( ( ans + a[i] + b[i] - 1 ) / b[i] * b[i] - a[i] - ans );
    }

    printf ("%llu\n", ans);


    return 0;
}



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

int main()
{
    int N, K;
    string S;
    cin >> N >> K;
    cin >> S;
    for (int i = 0; i < N; i++)
    {
        if (i == K - 1)
        {
            string s;
            s = tolower(S[K-1]);
            cout << s;
            continue;
        }
        cout << S[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <string.h>
#include <vector>
//#include <unordered_map>
//#include <unordered_set>

using namespace std;

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T1, class T2> inline int chkmin(T1& a, const T2& val) {return val < a ? a = val, 1 : 0;}
template<class T1, class T2> inline int chkmax(T1& a, const T2& val) {return a < val ? a = val, 1 : 0;}
template<class T> inline T isqrt(T k) {T r = sqrt(k) + 1; while (r * r > k) r--; return r;}
template<class T> inline T icbrt(T k) {T r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return (int) fpow(a, p - 2, p);}

const int maxn = 100000 + 10;
int n, a, b;
int x[maxn];
long long dp[maxn];

void solve() {
    cin >> n >> a >> b;
    FOR(i, 0, n) cin >> x[i];
    dp[0] = 0;
    FOR(i, 0, n - 1) {
        dp[i + 1] = dp[i] + min((long long) a * (x[i + 1] - x[i]), (long long) b);
    }
    cout << dp[n - 1] << "\n";
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    if (fopen("in.txt", "r")) {
        freopen("in.txt", "r", stdin);
    }
    solve();
    cerr << "\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms\n";
    return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define int long long
#define pii pair<int, int>
#define pb push_back
#define mp make_pair

using namespace std;
const int N=202;
int n, ans, lvl[N];
char mat[N][N];
queue<int> q;
signed main()
{
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		for(int j = 1; j <= n; j++)
		{
			cin >> mat[i][j];
		}
	}
	for(int i = 1; i <= n; i++)
	{
		bool flag=true;
		for(int j = 1; j <= n; j++)
		{
			lvl[j]=N;
		}
		while(q.size()) q.pop();
		lvl[i]=1;
		q.push(i);
		while(q.size())
		{
			int u = q.front();
			for(int j = 1; j <= n; j++)
			{
				if(mat[u][j]=='1')
				{
					if(lvl[j]==N)
					{
						lvl[j]=lvl[u]+1;
						q.push(j);
					}
					else if(lvl[j]!=lvl[u]-1 && lvl[j]!=lvl[u]+1)
					{
				//		cout << i << " - " << u << " " << j << endl;
						flag=false;
						break;
					}
				}
			}
			q.pop();
			if(!flag) break; 
		}
		if(!flag) continue;
		for(int j = 1; j <= n; j++)
		{
			if(lvl[j]==N) break;
			ans=max(ans, lvl[j]);
		}
	//	cout << i << " - " << ans << endl;
	}
	if(ans==0) cout << -1;
	else cout << ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T, class T2> void smin(T& a, T2 val) {if (a > val) a = val;}template<class T, class T2> void smax(T& a, T2 val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N], m;
string s, t;

void yes(){
   cout<<"Yes"<<endl;
   //exit (0);
}
void no(){
   cout<<"No"<<endl;
   //exit (0);   
}


int32_t main(){_
      
   int animals, legs;
   cin >> animals >> legs;
   
   for (int i = 0; i <= 500; ++i)
   {
      for (int j = 0; j <= 500; ++j)
      {
         int a = i + j;
         int b = 2*i + 4*j;
         if (a == animals and b == legs){
            yes();
            exit(0);
         }
      }
   }

   no();

   return 0;
}

Measured memory_bytes: 3648
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
ll dp[100001];
int q(const void *a, const void *b){
    return *(ll*)a-*(ll*)b;
}
int min(int a,int b){
  if(a>b)return b;
  return a;
}
int max(int a,int b){
  if(a>b)return a;
  return b;
}
int gcd(int a,int b){
  if(!b)return a;
  return gcd(b,a%b);
}
int t[1001];
int main(void) {
  int a,b,sum=0;
  scanf("%d %d",&a,&b);
  PRN(a+b+1-gcd(min(a,b),max(a,b)));
  return 0;
}


Measured memory_bytes: 2140
n=int(input())
zahyo=[list(map(int,input().split())) for i in range(n)]

zahyo.sort(key=lambda x:x[2], reverse = 1)
mx,my,mh=zahyo[0]
for Cx in range(101):
    for Cy in range(101):
        H = mh+abs(mx-Cx)+abs(my-Cy)
        if all(h == max(H-abs(x-Cx)-abs(y-Cy),0) for x,y,h in zahyo):
            print(Cx,Cy,H)
            break

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
//#define INF 810114514
#define PI 3.141592653589
typedef long long ll;
typedef pair<ll,ll> PP;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE do { cout << "0" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl
#define debug false
#define debug2 false


signed main(void){
    string S;
    cin >> S;
    REP(i,S.size()){
        if(S[i]=='?'){
            S[i]='D';
        }
    }
    cout << S << endl;
    return 0;
}




Measured memory_bytes: 3724
use proconio::input;
use std::cmp;

fn main() {
    input! {
        n: usize,
        m: usize,
        k: usize,
        a: [usize;n],
        b: [usize;m],
    }

    let mut al = Vec::new();
    al.push(0);
    let mut bl = Vec::new();
    bl.push(0);
    for i in 0..n {
        al.push(al[i]+a[i]);
    }
    for i in 0..m {
        bl.push(bl[i]+b[i]);
    }

    let mut ans = 0;
    let mut j = m;

    for i in 0..n+1 {
        if al[i] > k {
            break
        }
        while bl[j] > k - al[i] {
            j -= 1
        } 
        ans = cmp::max(ans, i+j)
    }
    println!("{}",ans);
}


Measured memory_bytes: 12640
import qualified Data.ByteString.Char8 as B
import Data.Maybe
import Data.List
main = do
  B.getLine
  as <- map (fst. fromJust . B.readInteger) . B.words <$> B.getLine
  bs <- map (fst. fromJust . B.readInteger) . B.words <$> B.getLine
  let cs = zipWith max as bs
      x = length $ filter id $ zipWith (/=) as cs
      d = sum cs - sum as
      y = findIndex (>= d) $ scanl (+) 0 $ reverse $ sort $ zipWith (-) cs bs
  print $ maybe (-1) (x +) y 

Measured memory_bytes: 37244
def main():
    N, x = map(int, input().split())
    a = sorted(map(int, input().split()))
    cnt = 0
    for i in range(N):
      if a[i] <= x:
        cnt += 1
        x -= a[i]
      else:
        break
    if cnt == N and x > 0:
      cnt -= 1
    print(cnt)
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

int main() {
    double a, b, h, m; 
    cin >> a >> b >> h >> m;
    double y = a*a + b*b - 2*a*b*cos(2*M_PI*m/60.0-M_PI/6.0*(h+m/60));
    y = sqrt(y);
    cout << std::fixed << std::setprecision(15) << y << endl;
    return 0;
}

Measured memory_bytes: 4252
#include<iostream>

using namespace std;

int main(void)
{
        long long N,x;
        cin >> N >> x;

        long long a[N];
        for(int i=1;i<=N;i++)
        {
                cin >> a[i-1];
        }

        long long sum;
        long long count=0;

        for(int i=1;i<=N-1;i++)
        {
                sum=a[i-1]+a[i-1+1];
                if(sum>x)
                {
                        a[i-1+1]-=(sum-x);
                        if(a[i-1+1]<0)
                        {
                                a[i-1]+=a[i-1+1];
                                a[i-1+1]=0;
                        }
                        count+=(sum-x);
                }
        }

        cout << count << endl;
}

Measured memory_bytes: 1152
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<deque>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<iomanip>
#include<sstream>
using namespace std;

#define pi acos(-1.0)
#define ms(x,n) memset(x,n,sizeof(x));

typedef long long ll;//string::npos
typedef long long iint;

ll gcd(ll a,ll b) {
	return a%b==0?b:gcd(b,a%b);
}
ll lcm(ll x,ll y) {
	ll z=gcd(x,y);
	return x*y/z;
}

const int MAXX=2e5+5;
const int INF=1e7+5;
const int mod=998244353;

//vector<int> vt;
//pair<int,int> p;
//map<int,int> m;
int main() {
	ios::sync_with_stdio(false);
	char a[10];
	cin>>a;
	int len = strlen(a);
	if(a[2]==a[3]&&a[4]==a[5]&&len==6){
		cout<<"Yes\n";
	} else{
		cout<<"No\n";
	}
	
	
	
	
	
	
	
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    int n;
    cin >> n;
    vector<int> a(26, 0);
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++) {
        a[s[i]-'a']++;
    }
    for(int i = 0; i < n-1; i++) {
        vector<int> b(26, 0);
        string t;
        cin >> t;
        for(int j = 0; j < t.size(); j++) {
            b[t[j]-'a']++;
        }
        for(int j = 0; j < 26; j++) {
            chmin(a[j], b[j]);
        }
    }
    for(int i = 0; i < 26; i++) {
        for(int j = 0; j < a[i]; j++) {
            cout << (char)('a'+i);
        }
    }
    cout << endl;
}

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

using namespace std;

#define ll long long

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

    int n, m;
    cin >> n >> m;
    int res[m][2];
    int l = n / 2, r = n / 2 + 1;
    for (int i = 0; i < m; i++) {
        res[i][0] = l, res[i][1] = r;
        l--, r++;
        if (n % 2 == 0 && (((r - l) == n / 2 + 1) || ((r - l) == n / 2))) l--;
    }
    for (int i = 0; i < m; i++) {
        cout << res[i][0] << " " << res[i][1] << "\n";
    }
    return 0;
}

Measured memory_bytes: 4356
#include <stdio.h>
int main(void)
{
	int a, b;
	scanf("%d", &a);
	scanf("%d", &b);
	if (a < b){
		printf("a < b\n");
		}
	else if (a > b){
		printf("a > b\n");
		}
	else{
	printf("a == b\n");
	}
	return 0;
}

Measured memory_bytes: 580
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive.lib
{

    internal class Solution
    {
        public string S;
        public int K;

        public void Run()
        {
            List<string> lst = new List<string>();

            S = Console.ReadLine();
            K = Input.ReadInt();

            for (int i = 0; i < S.Length; i++)
            {
                for (int k = 1; k <= K; k++)
                {
                    if(i + k <= S.Length) lst.Add(S.Substring(i, k));
                }
            }

            lst = lst.Distinct().ToList();
            lst.Sort();
            Console.WriteLine(lst[K-1]);
        }
    }

    // libs ----------
    

    // common ----------

    internal static class Input
    {
        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 15200
import math
N = int(input())

i = 1
while i <= N:
    a, b, c = map(int, input(). split())
    if a*a == b*b + c*c:
        print("YES")
    elif b*b == a*a + c*c:
        print("YES")
    elif c*c == a*a + b*b:
        print("YES")
    else:
        print("NO")
    i += 1


Measured memory_bytes: 5652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define ALL(c) (c).begin(), (c).end()
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll a,b;
    cin >> a >> b;

    if (0<a)
    {
        cout << "Positive" << endl;
    }
    else if (a<=0 && 0<=b)
    {
        cout << "Zero" << endl;
    }
    else
    {
        if ((b-a)%2==0)
        {
            cout << "Negative" << endl;
        }
        else
        {
            cout << "Positive" << endl;
        }
        
    }
    
    
}




Measured memory_bytes: 256
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {//222
	int a,b,x;
	cin>>a>>b>>x;
	if(a>x||a+b<x) {
		cout<<"NO";
	}else cout<<"YES";
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3660
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U>
inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U>
inline void cmin(T& a, U b) { if (a > b) a = b; }

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cerr << fixed << setprecision(15);
  }
} io_setup;

constexpr char el = '\n';

template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U>& p) {
  os << p.first << " " << p.second;
  return os;
}
template<class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template<class T>
ostream &operator<<(ostream &os, const vector< T > &v) {
  rep(i, v.size())
    os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template<class T>
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}
#line 2 "c.cpp"

int main() {
  ll n;
  cin >> n;
  vl a(n-1);
  cin >> a;

  vl cnt(n);
  for (auto&& i : a) {
    cnt[i-1]++;
  }

  for (auto&& i : cnt) {
    cout << i << el;
  }
}


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

using namespace std;

typedef long long ll;

const int MAXN = 100005;

int a[MAXN], b[MAXN];

int n;

vector<int> v;

ll sum[MAXN], sum1 = 0, sum2 = 0, res;

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d%d", &a[i], &b[i]);
		sum1 += a[i];
		sum2 += b[i];
		v.emplace_back(a[i]);
		v.emplace_back(b[i]);
	}
	res = min(sum1, sum2);
	sort(v.begin(), v.end());
	for (int i = 1; i <= n; i++)
		sum[i] = sum[i - 1] + v[i - 1];
	for (int i = 1; i <= n; i++)
	{
		int x = a[i], y = b[i];
		if (x > y) swap(x, y);
		if (x >= v[n - 1])
			res = min(res, sum[n - 2] + x + y);
		else if (y > v[n - 1])
			res = min(res, sum[n - 1] + y);
		else
			res = min(res, sum[n]);
	}
	printf("%lld\n", res);
	return 0;
}


Measured memory_bytes: 2676
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;

int main() {
	long long int a, b, c;
	cin >> a;
	b = 100;
	c = 0;
	while (a > b) {
		b = b * 1.01;
		c = c + 1;
	}
	cout << c;
	return 0;
}

Measured memory_bytes: 3672
#include <stdio.h>

void screen(int[] ,int);

#define N 100
int main()
{
  int i=0,k=0,min=0,minj=0,count=0;
  int n=0,A[N];
  int temp=0;
  int flag=0,cflag=0;
  
  scanf("%d",&n);
  for(i=0;i<n;i++)//scan A[]
    {
      scanf("%d",&A[i]);
    }

  for(i=0;i<n;i++)//bubble sort
    {
      cflag=0;
      min = A[i];
      minj = i;
      for(k=i+1;k<n;k++)
	{
	  if(min>A[k])
	    {
	      min = A[k];
	      minj = k;
	      cflag = 1;
	    }
	}

      temp = A[i];
      A[i] = min;
      A[minj] = temp;
      if(cflag == 1){count++;}
      
      flag=0;
      for(k=1;k<n;k++)//syu u ryo u ha n te i
	{
	  if(A[k-1]>A[k])
	    {
	      flag = 2;
	    }
	}
      if(flag == 0)break;
      //screen(A,n);
    }
  
  screen(A,n);
  printf("%d\n",count);
  return 0;
}

void screen (int A[], int n)
{
  int i;
  for(i=0;i<n;i++)
    {
      if(i<n-1)
	{
	  printf("%d ",A[i]);
	}
      else if(i==(n-1))
	{
	  printf("%d",A[i]);
	  break;
	}
    }
  printf("\n");
}



Measured memory_bytes: 2104
#include<algorithm>
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()

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

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

    //個数制限なしナップザック問題と同じ

    int N;
    cin >> N;

    //6のべき乗と9のべき乗を配列化
    vll a;
    a.push_back(1);

    {
        ll x = 6;
        while (x <= N)
        {
            a.push_back(x);
            x *= 6;
        }
    }

    {
        ll x = 9;
        while (x <= N)
        {
            a.push_back(x);
            x *= 9;
        }
    }

    sort(all(a));

    vvll dp(a.size() + 1, vll(N + 1, INF));
    dp[0][0] = 0;

    rep(i, a.size())
    {
        reple(j, 0, N)
        {
            dp[i + 1][j] = dp[i][j];

            //ループを1つ減らすため、jの先の結果を再利用
            if (j >= a[i])
            {
                chmin(dp[i + 1][j], dp[i + 1][j - a[i]] + 1);
            }
        }
    }

    cout << dp[a.size()][N] << endl;

    return 0;
}

Measured memory_bytes: 11264
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

typedef long long cat;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

void DFS(int R, int par, vector< vector<int> > &G, vector<int> &cov, string &S) {
	ALL_THE(G[R], it) if(*it != par) {
		DFS(*it, R, G, cov, S);
		if(cov[*it]) cov[R] = 1;
	}
	if(S[R] == 'W') cov[R] = 1;
}

int DFS_maxcost(int R, int par, vector< vector<int> > &G, vector<int> &cost, vector<int> &maxcost) {
	int maxcost_down = 0;
	ALL_THE(G[R], it) if(*it != par) {
		int cost_down = DFS_maxcost(*it, R, G, cost, maxcost);
		maxcost[R] = max(maxcost[R], cost_down + maxcost_down + cost[R]);
		maxcost_down = max(maxcost_down, cost_down);
	}
	return maxcost_down + cost[R];
}

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N;
	cin >> N;
	vector< vector<int> > G(N);
	for(int i = 0; i < N-1; i++) {
		int u, v;
		cin >> u >> v;
		G[--u].push_back(--v);
		G[v].push_back(u);
	}
	string S;
	cin >> S;

	int R = -1;
	for(int i = 0; i < N; i++) if(S[i] == 'W') R = i;
	if(R == -1) {
		cout << "0\n";
		return 0;
	}

	vector<int> cov(N, 0);
	DFS(R, R, G, cov, S);
	vector<int> fail(N, 0);
	for(int i = 0; i < N; i++) if(S[i] == 'W') fail[i] = 1;
	for(int i = 0; i < N; i++) ALL_THE(G[i], it)
		if(cov[i] && cov[*it]) fail[i] = 1-fail[i];

	vector<int> maxcost(N, 0);
	DFS_maxcost(R, R, G, fail, maxcost);

	int ans = 0;
	for(int i = 0; i < N; i++) ALL_THE(G[i], it)
		if(cov[i] && cov[*it]) ans++;
	for(int i = 0; i < N; i++) if(fail[i]) ans++;
	int maxcost_total = 0;
	for(int i = 0; i < N; i++) maxcost_total = max(maxcost_total, maxcost[i]);
	ans -= 2 * maxcost_total;
	if(ans <= 0) ans = 1;
	cout << ans << "\n";
	return 0;}

// look at my code
// my code is amazing


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

int main(){
  string A, B;
  cin >> A >> B;

  string Ans = "EQUAL";

  if (A.size() > B.size()) Ans = "GREATER";
  else if (A.size() < B.size()) Ans = "LESS";
  else {
    rep(i, 0, A.size()) {
      int a = A[i], b = B[i];
      if (a > b) {
        Ans = "GREATER";
        break;
      } else if (a < b) {
        Ans = "LESS";
        break;
      }
    }
  }
  cout << Ans << endl;
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <utility>
#include <tuple>
using AnsType = long long int;
using namespace std;

vector< pair<int, int> > G[1510];
AnsType rec[1510][1510];
const AnsType INF = 1LL << 60;
using Pair = pair<int, AnsType>;
int main() {
  int N, R; cin >> N >> R;
  for(int i=0; i<R; i++) {
    int s, t, d; cin >> s >> t >> d;
    s--; t--;
    G[s].emplace_back(t, d);
    G[t].emplace_back(s, d);
  }

  fill(rec[0], rec[N+1], INF);
  for(int s=0; s<N; s++) {
    priority_queue< Pair, vector<Pair>, greater<Pair> > que;
    que.emplace(s, 0);
    rec[s][s] = 0;

    while(que.size()) {
      int cur; AnsType cost; tie(cur, cost) = que.top(); que.pop();
      if(cost > rec[s][cur]) continue;
      for(auto e : G[cur]) {
        int to, c; tie(to, c) = e;
        if(rec[s][to] > cost + c) {
          rec[s][to] = cost + c;
          que.emplace(to, cost + c);
        }
      }
    }
  }

  vector<int> used(N);
  AnsType max_dist = -1;
  for(int i=0; i<N; i++) {
    for(int j=0; j<N; j++) {
      max_dist = max(max_dist, rec[i][j]);
    }
  }

  vector< pair<int, int> > pairs;
  for(int i=0; i<N; i++) {
    for(int j=0; j<N; j++) {
      if(rec[i][j] == max_dist) {
        pairs.emplace_back(i, j);
      }
    }
  }
    
  for(int i=0; i<N; i++) {
    for(auto st : pairs) {
      int s, t; tie(s, t) = st;
      if(rec[s][i] + rec[i][t] == max_dist) {
        used[i] = true;
        break;
      }
    }
  }

  vector<int> ans;
  for(int i=0; i<N; i++) {
    if(!used[i]) ans.push_back(i+1);
  }

  cout << ans.size() << endl;
  for(auto e : ans) cout << e << endl;
  return 0;
}



Measured memory_bytes: 53604
import java.util.*;
class Main {
    public static void main (String[] args) throws java.lang.Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n];
        for(int i = 0; i < n; i++) a[i] = sc.nextInt();
        for(int i = 0; i < n; i++) {
            if(i != 0) System.out.print(" ");
            System.out.print(a[n - i - 1]);
        }
        System.out.println();
    }
}


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

int main(){
  int x , max = 0,h,c = 0;
  cin >> x;
  for(int i = 0;i < x;i++){
    cin >> h;
    if (max <= h){
      c++;
      max = h;
    }
  }
  cout << c << endl;
  
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();

        int ans = 0;
        for (int i = 0; i < s.length(); ++i) {
            int tmp = 0;
            for (int j = i; j < s.length(); ++j) {
                if (s.charAt(j) == 'A' || s.charAt(j) == 'C'
                || s.charAt(j) == 'G' || s.charAt(j) == 'T') {
                    ++tmp;
                }
                else break;
            }
            ans = Math.max(ans, tmp);
        }

        System.out.println(ans);
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}

    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }

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




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

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

void print(){ std::cout << std::endl; }
template <typename H> void print(H head) { std::cout << head << std::endl; }
template <typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll N;
  std::cin >> N;
  std::vector< ll > va(N, 0LL);
  for (ll i = 0; i < N; i++) {
    std::cin >> va[i];
  }

  std::map<ll, ll> mcnt;
  for (ll i = 0; i < N; i++) {
    if (mcnt[va[i]] == 0) {
      mcnt[va[i]]++;
    } else {
      mcnt[va[i]] = 0;
    }
  }

  ll ans = 0LL;
  std::map<ll, ll>::iterator it;
  for (it = mcnt.begin(); it != mcnt.end(); it++) {
    if (it->second > 0) ans++;
  }

  print(ans);
  return 0;
}


Measured memory_bytes: 7296
/* 
**
**   author:  Blue Fire
**   created:  19/09/2020
**
*/
 
#include <iostream>
#include <iomanip>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <chrono>
#include <cmath>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <unistd.h>
#include <queue>
#include <list>
#include <random>
#include <bitset>
#include <fstream>
#include <limits>
using namespace std;
typedef long long llong;
#define rep(i, n) for(int i = 0, _##i = n; i < _##i; ++i)

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, x, y, t = 0;
	cin >> n;
	while(n--) {
		cin >> x >> y;
		if(x == y) {
			t++;
			if(t == 3) {
				cout << "Yes";
				return 0;
			}
		} else {
			t = 0;
		}
	}
	cout << "No";

}

Measured memory_bytes: 3060
N = int(input())
src = [tuple(map(int,input().split())) for i in range(N-1)]

for i in range(N-1):
    time = 0
    for c,s,f in src[i:]:
        if time <= s:
            time = s+c
        else:
            time += (f-(time-s)) % f + c
    print(time)
print(0)


Measured memory_bytes: 3188
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)


Measured memory_bytes: 19460
#include<stdio.h>
int main(void){
   int N,a[4000],i,cou;
   scanf("%d",&N);
   for(i=0;i<N;i++){
      scanf("%d",&a[i]);
   }
  for(i=0;i<N;i++){
      cou+=a[i]-1;
   }
   printf("%d",cou);

   return 0;
}


Measured memory_bytes: 128
nk = input().split()
n = int(nk[0])
k = int(nk[1])
s = [input().split() for i in range(k*2)]
o = []
 
for  j in range(len(s)):
    if j % 2 == 0:
        pass
    else:
        o[len(o):len(o)] = s[j]
 
l =list(set(o))
ans = n - len(l) 
print(ans)

Measured memory_bytes: 9352
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int a,b;
  cin >> a >> b;
  int ans=1;
  int a2=a;
  if(b==1) ans=0;
  while(a2<b){
    a2--;
    a2+=a;
    ans++;
  }
  cout << ans << endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if(abs(a-c)<=d){
  cout << "Yes" << endl; 
  }
  
  else if(b!=min({a,b,c}) && b!=max({a,b,c})){
                if(abs(b-a)<=d && abs(b-c)<=d){
                cout << "Yes" << endl;
                }
                else{ 
                cout << "No" << endl;
                }
  }
  else{
  cout << "No" << endl;
  }
}
  

Measured memory_bytes: 384
#include <bits/stdc++.h>
 
using namespace std;
#define ll long long
 
void init();
void solve();
 
#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
 
#ifdef LOCAL
#define lcout(a) cout << a;
#define lcoutln(a) cout << a << endl;
#define lcerr(a) cerr << a;
#define lcerrln(a) cerr << a << endl;
#else
#define lcout(a) 
#define lcoutln(a) 
#define lcerr(a) 
#define lcerrln(a) 
#endif
 
#define MOD 1000000007
 
signed main()
{
	init();
	solve();
}

string s;

void init()
{
  cin >> s;
}
 
void solve()
{
  rep(i, 4) cout << s[i];
  cout << " ";
  reps(i, 4, 12) cout << s[i];
  cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define PI 3.14159265359
#define sz(c) (int)c.size()
#define len(c) (int)c.length()
#define hcf(a, b) __gcd(a, b)
#define all(c) c.begin(), c.end()
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define fr(it, a, b) \
    for (int it = (a); it < (b); it++)
#define tr(con, it) \
    for (auto it = con.begin(); it != con.end(); it++)
#define present(con, ele) (con.find(ele) != con.end())
#define cpresent(con, ele) (find(all(con), ele) != con.end())
#define maximum(a, b, c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
#define minimum(a, b, c) (a < b ? (a < c ? a : c) : (b < c ? b : c))
typedef long long ll;
typedef long double lf;
typedef unsigned long long lu;
const ll mod = 1e9 + 7;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a, b, k, c;
    cin >> a >> b >> k;
    c = a;
    a = max(a - k, 0ll);
    k -= c - a;
    b = max(b - k, 0ll);
    cout << a << " " << b << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int A,B,C,D,E,a,b,c,d,e;
  cin>>A>>B>>C>>D>>E;
  a=(A+9)/10;b=(B+9)/10;
  c=(C+9)/10;d=(D+9)/10;
  e=(E+9)/10;
  a*=10;b*=10;c*=10;d*=10;e*=10;
  cout<<a+b+c+d+e-max({a-A,b-B,c-C,d-D,e-E})<<endl;
}

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

using namespace std;

using ll = long long;

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

    string s;
    for (int i = 0; i < 3; ++i) {
        cin >> s;
        cout << (char)toupper(s.front());
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
n = int(input())

balls = []

for _ in range(n):
    a, b = map(int, input().split())
    balls.append((a,b))

costmax = n
costmin = 0
ans = costmax

if n == 1:
    ans = 1
elif n == 2:
    ans = 1
else:
    c_divs = []
    for i in range(n):
        x = balls[i][0]
        y = balls[i][1]

        for j in range(n):
            c_divs.append((balls[j][0] - x, balls[j][1] - y))
            #print(i, j+1)


    import collections
    c = collections.Counter(c_divs)

    if c.most_common()[0][0] == (0,0):
        save = c.most_common()[1][1]
    else:
        save = c.most_common()[0][1]
    ans = ans - save


print(ans)
#print(balls)
#print(c_divs)
#print(c.most_common())
#print(c.most_common()[0][0])

Measured memory_bytes: 3956
function Main(input) {
    input = input.split("\n")
    var N = input[0];
    var A = input[1].split(" ");
    var ans = [];
    for(var i = 0; i < N; i++){
        ans.push(1 / A[i]);
    }
    var res = 1 / ans.reduce((a,x) => a+=x,0);
    console.log(res);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define fi first
#define se second
#define pii pair<int, int>

const int W = 1e5 + 10, N = 101;
int dp[N][W] = {0}, w[N], v[N];
signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, tot;
    cin >> n >> tot;
    for (int i = 0; i < n; i++) {
        cin >> w[i] >> v[i];
    }
    for (int i = w[0]; i <= tot; i++) {
        dp[0][i] = v[0];
    }
    for (int i = 1; i < n; i++) {
        for(int j = 0; j <= tot; j++) {
            dp[i][j] = dp[i - 1][j];
        }
        for (int j = w[i]; j <= tot; j++) {
            dp[i][j] = max(dp[i][j], dp[i - 1][j - w[i]] + v[i]);
        }
    }
    int ans = 0;
    for (int i = 0; i <= tot; i++) {
        ans = max(ans, dp[n - 1][i]);
    }
    cout << ans << "\n";
}

Measured memory_bytes: 78336
#include<bits/stdc++.h>
#define ll long long int
#define ss second
#define ff first
#define Mem(x,val) memset(x,val,sizeof x)
#define pb push_back
#define all(v) v.begin(),v.end()
#define unik(v)  v.erase(unique(v.begin(),v.end()),v.end())
#define cerr(x) cerr << __LINE__ << " th Line : " << #x << " = " << x << "\n"
using namespace std;
typedef pair<int, int> pi32;
typedef pair<ll, ll> pi64;
typedef vector<int> vi32;
typedef vector<ll> vi64;
const ll mod = 1e9 + 7;
const ll sz = 1e3 + 10, inf = 1e9 + 7;
const double pi = acos(-1.0);

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

	ll n, k;
	cin >> n >> k;
	ll sum = 1;
	for (ll i = k; i <= n; i++) {
		sum = (sum + i * (n - i + 1) + 1) % mod;
	}
	cout << sum << '\n';

	return 0;

}

Measured memory_bytes: 3608
#include "bits/stdc++.h"
using namespace std;
typedef long long LL;

int main(){
    LL n, m, k; cin>>n>>m>>k;
    LL Ai, pref_a[n+1] = {}, Bi, pref_b[m+1] = {};
    for(int i=0; i<n; i++){
        cin>>Ai;
        pref_a[i+1] = pref_a[i] + Ai;
    }
    for(int i=0; i<m; i++){
        cin>>Bi;
        pref_b[i+1] = pref_b[i] + Bi;
    }

    LL tot = 0, ans = 0;
    for(LL i=0; i<=n; i++){
        LL r = m, l = 0, target = k - pref_a[i];
        while(l <= r){
            LL mid = (r+l)/2;

            if(pref_b[mid] <= target)
                ans = max(ans, i+mid), l = mid + 1;
            else
                r = mid - 1;
        }
    }
    cout<<ans<<"\n";
}

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

int main()
{
    int n;
    while(1)
    {
        int sell_num[10] = {};
        cin >> n;
        if(n == 0)
        {
            break;
        }
        for(int i=0; i<n; i++)
        {
            int id;
            cin >> id;
            sell_num[id]++;
        }
        for(int i=0; i<10; i++)
        {
            if(sell_num[i] == 0)
            {
                cout << "-" << endl;
            }
            else
            {
                string str;
                for(int j=0; j<sell_num[i]; j++)
                {
                    str += "*";
                }
                cout << str << endl;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3084
# coding: utf-8
# Your code here!

import math


if __name__ == '__main__':
    
    A, B, H, M = list(map(float, input().split()));
    
    angle = ((30*H)+(0.5*M))-6*M;
    cosine = math.cos(math.radians(angle));
    
    answer = math.sqrt(pow(A,2)+pow(B,2)-2*A*B*cosine);
    print(answer);

Measured memory_bytes: 9344
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

int n, k;
vector<int> h;

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

	for (int i = 0;i < n;i++) {
		int temp;
		cin >> temp;
		h.push_back(temp);
	}

	sort(h.begin(), h.end());

	int ans = h[n-1];

	for (int i = 0;i < n;i++) {
		if (i + k - 1 < n) {
			ans = std::min(ans, h[i + k - 1] - h[i]);
		}
	}

	cout << ans << endl;

	return 0;
}


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

const int MAX_N = 1e5 + 5; // 100,005
const int MAX_VALUE = 105;
const int INF = 1e9 + 5;

int dp[MAX_N][MAX_VALUE];

// memory O(N * MAX_VALUE)
// time O(N * MAX_VALUE^2)

void min_self(int& a, int b) {
    a = min(a, b);
}

int main() {
    int n;
    cin >> n; // scanf("%d", &n);
    vector<int> a(n);
    for(int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for(int first_value = 1; first_value < MAX_VALUE; ++first_value) {
        dp[0][first_value] = first_value == a[0] ? 0 : 1;
    }
    for(int i = 1; i < n; ++i) {
        for(int x = 1; x < MAX_VALUE; ++x) {
            dp[i][x] = INF;
        }
        for(int previous_value = 1; previous_value < MAX_VALUE; ++previous_value) {
            for(int new_value = 1; new_value < MAX_VALUE; ++new_value) {
                if(previous_value == new_value) {
                    continue;
                }
                min_self(dp[i][new_value], dp[i-1][previous_value] + (new_value != a[i]));
            }
        }
    }
    int answer = INF;
    for(int last_value = 1; last_value < MAX_VALUE; ++last_value) {
        min_self(answer, dp[n-1][last_value]);
    }
    cout << answer << endl;
}
    


Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int d,t,s;
void input(){
    fast_io();
    cin >> d >> t >> s;
}

int solve(){
    if(s*t>=d) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}   

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

Measured memory_bytes: 3664