akhauriyash/Code-Regression huggingface dataset:
/*
 *
 *
 */

#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vc> vvc;
typedef vector<vll> vvll;

struct Team {
  int correct;
  int penalty;
  int vpenalty[10];
  int id;

  bool operator <(const Team& p) const {
    if (correct == p.correct)
      if (penalty == p.penalty)
        return id < p.id;
      else
        return penalty > p.penalty;
    else
      return correct < p.correct;
  }

  bool operator ==(const Team& p) const {
    if (correct == p.correct)
      return penalty == p.penalty;
    else
      return correct == p.correct;
  }
};

int main() {
  int M, T, P, R;
  while(cin >> M >> T >> P >> R, M | T | P | R) {
    vector<Team> team(T);
    REP(i, T){
      team[i].id = i + 1;
    }

    REP(i, R){
      int m, t, p, j;
      cin >> m >> t >> p >> j;
      t--; p--;

      if (j) {
        team[t].vpenalty[p] += 20;
      }else{
        team[t].correct++;
        team[t].penalty += m + team[t].vpenalty[p];
      }
    }
    RSORT(team);
    cout << team[0].id;
    FOR(i, 1, T){
      if (team[i - 1] == team[i]) cout << '=';
      else cout << ',';
      cout << team[i].id;
    }
    cout << endl;
  }
}

Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
inline int_fast64_t read(){int_fast64_t x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return x*f;}
inline string read_s(){string s="";char c=getchar();while(c<'!'||c>'~'){c=getchar();}while(c>='!'&&c<='~'){s+=c;c=getchar();}return s;}
int ans;
void Main(){
    int H = read(), W = read();
    pair<int, int> grid[H][W], wall = make_pair(-1, -1), space = make_pair(0, 0);
    vector<pair<int, int>> V;
    for (int i = 0; i<H; i++) {
        for (int j = 0; j<W; j++) {
            if (getchar() == '.') {
                grid[i][j] = space;
                V.push_back(make_pair(i, j));
            } else {
                grid[i][j] = wall;
            }
        }
        getchar();
    }
    int l, r, d, u, cnt;
    for (auto v:V) {
        if (grid[v.first][v.second].first == 0) {
            cnt = 1;
            d = -1;
            u = H;
            for (int i = v.first-1; i>=0; i--) {
                if (grid[i][v.second] == wall) {
                    d = i;
                    break;
                }
                cnt++;
            }
            for (int i = v.first+1; i<H; i++) {
                if (grid[i][v.second] == wall) {
                    u = i;
                    break;
                }
                cnt++;
            }
            for (int i = d+1; i<u; i++) {
                grid[i][v.second].first = cnt;
            }
        }
        if (grid[v.first][v.second].second == 0) {
            cnt = 1;
            l = -1;
            r = W;
            for (int i = v.second-1; i>=0; i--) {
                if (grid[v.first][i] == wall) {
                    l = i;
                    break;
                }
                cnt++;
            }
            for (int i = v.second+1; i<W; i++) {
                if (grid[v.first][i] == wall) {
                    r = i;
                    break;
                }
                cnt++;
            }
            for (int i = l+1; i<r; i++) {
                grid[v.first][i].second = cnt;
            }
        }
        ans = max(ans, grid[v.first][v.second].first+grid[v.first][v.second].second-1);
    }
    printf("%d\n", ans);
}
int main(){cin.tie(nullptr);ios::sync_with_stdio(false);Main();return 0;}

Measured memory_bytes: 66020
#include<stdio.h>
int main()
{
	char s[5];
	int c=0;
	scanf("%s",s);
   if(s[0]=='R'&&s[1]=='R'&&s[2]=='R')c=3;
   else if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R'))c=2;
   else if(s[0]=='R'||s[1]=='R'||s[2]=='R')c=1;
   printf("%d\n",c);	
	
}

Measured memory_bytes: 1688
#include <algorithm>
#include <cstdio>
#include <iostream>

using namespace std;

int main() {

	int v, e;
	scanf("%d %d", &v, &e);

	long long INF = (1LL << 32);
	long long G[v][v];
	for (int i = 0; i < v; ++i) {
		for (int j = 0; j < v; ++j) {
			if (i == j)
				G[i][j] = 0;
			else
				G[i][j] = INF;
		}
	}

	for (int i = 0; i < e; ++i) {
		int s, t, d;
		scanf("%d %d %d", &s, &t, &d);
		G[s][t] = d;
	}

	for (int k = 0; k < v; ++k) {
		for (int i = 0; i < v; ++i) {
			if (G[i][k] == INF)
				continue;
			for (int j = 0; j < v; ++j) {
				if (G[k][j] == INF)
					continue;
				G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
			}
		}
	}

	bool negative = false;
	for (int i = 0; i < v; ++i) {
		if (G[i][i] < 0) {
			negative = true;
			break;
		}
	}

	if (negative) {
		cout << "NEGATIVE CYCLE" << endl;
		return 0;
	}

	for (int i = 0; i < v; ++i) {
		for (int j = 0; j < v; ++j) {
			if (j != 0)
				cout << " ";
			if (G[i][j] == INF) {
				cout << "INF";
			} else {
				cout << G[i][j];
			}
		}
		cout << endl;
	}

	return 0;
}

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

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main()
{
    int N,Y;
    int man = 0,gosen = 0,sen = 0;
    cin >> N >> Y;
    rep(i,N+1){
        rep(j,N+1){
            if (i * 10000 + j * 5000 + (N - (i + j)) * 1000 == Y && i + j <= Y && i + j >= 0 && N - (i + j) >= 0){
                man = i;
                gosen = j;
                sen = N - (i + j);
            }
        }
    }
    if (man == 0 && gosen == 0 && sen == 0){
        cout << "-1 -1 -1" << endl;
        return 0;
    }
    cout << man << " " << gosen << " " << sen << endl;
}

Measured memory_bytes: 256
def main():
    N, M, Q, *X = map(int, open(0).read().split())
    L = [0]*M
    R = [0]*M
    p = [0]*Q
    q = [0]*Q
    for i in range(M):
        L[i], R[i] = X[2*i], X[2*i + 1]
    for i in range(Q):
        p[i], q[i] = X[2*M + 2*i], X[2*M + 2*i + 1]
    # print(N, M, Q, L, R, p, q)
    S = [[0]*(N+1) for i in range(N+1)]
    for i in range(M):
        S[L[i]][R[i]] += 1
    # for s in S:
    #     print(s)
    S2 = [[0]*(N+1) for i in range(N+1)]
    for i in range(N+1):
        S2[i][0] = S[i][0]
        for j in range(1, N+1):
            S2[i][j] = S2[i][j-1] + S[i][j]
    # for s in S2:
    #     print(s)
    for i in range(Q):
        pi, qi = p[i], q[i]
        ans = 0
        for j in range(pi, qi + 1):
            ans += (S2[j][qi] - S2[j][pi-1])
        print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 124144
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main()
{
	int N,K,d,inp;
	cin >> N >> K;
	set<int> B;

	rep(i,K){
		cin >> d;
		rep(j,d){
			cin >> inp;
			B.insert(inp);
		}


	}

	cout << N-B.size();

	cin >> K;
	
	return 0;	
}


Measured memory_bytes: 3636
package main

import (
	"fmt"
)

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	ps := make([]int, n)
	for i := range ps {
		fmt.Scan(&ps[i])
	}
	var sum, mx int
	for i := 0; i < k; i++ {
		sum += ps[i]
	}
	mx = sum
	for i := 1; i <= n-k; i++ {
		sum += ps[i+k-1]
		sum -= ps[i-1]
		mx = max(mx, sum)
	}
	fmt.Println(float64(mx+k) / 2.0)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}


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

int main() {
  int a;
  cin >> a;
  int i = 1;
  int ans = 0;
  while(i*i<=a) {
    int x = i;
    for(int j=1; ; j++) {
      if(j!=1) x *= i; 
      if(x<=a && ans<x) ans = x;
      if(x==1) break;
      if(x>a) break;
    }
    i++;
  }
  cout << ans << endl;
}

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

#define ll long long int

typedef pair<ll,ll> pii;

#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define vvl vector<vector<ll,ll> >
#define vvs vector<vector<string> >
#define pb push_back
#define mk make_pair
#define sbit(a)  __builtin_popcount(a)
#define f(i,a,n) for(i=a;i<n;i++)
#define fb(i,a,n) for(i=a;i>=n;i--)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define nextp(s) next_permutation(s.begin(), s.end()); 
#define ignor cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define bsearch(a,x) binary_search(a.begin(),a.end(),x)
#define ini ll i,j,k,l,m,n,x,y,sm=0,cnt=0
const ll mod=1e9+7;
const double pi=acos(-1);


bool prime[1000000];
void sieve(ll n) 
{ 
    memset(prime, true, sizeof(prime)); 
  
    for (ll p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (ll i=p*2; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
} 

ll primefunc(ll n)
{
    ll i;
    if(n<2)
    return 0;
    f(i,2,sqrt(n)+1)
    {
        if(n%i==0)
        return 0;
    }
    return 1;
}

ll bs(ll arr[], ll l, ll r, ll x)
{
   if (r >= l)
   {
        ll mid = l + (r - l)/2;
        if (arr[mid] == x)  
            return mid;
        if (arr[mid] > x) 
            return bs(arr, l, mid-1, x);
        return bs(arr, mid+1, r, x);
   }
   return -1;
}


ll moex(ll x,ll n,ll mod)

{
    
	if(n==0)
        
       		return 1;
    
	else if(n%2 == 0)   
        	
		return moex((x*x)%mod,n/2,mod);
    
	else 
              return (x*moex((x*x)%mod,(n-1)/2,mod))%mod;

}


ll modi(ll a, ll m) 
{ 
      	ll k=moex(a, m-2, m); 
	return k;
} 

void subString(string s, int n) 
{
    for (int i = 0; i < n; i++) 
        for (int len = 1; len <= n - i; len++)
            cout << s.substr(i, len) << endl;
}


int main(){
    	fast;
        ll t,d;
        cin>>t>>d;
		     d*=2;
		     d++;
		     ll ans=ceil((t*1.0)/d);
		     cout <<ans<<endl;
       
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin >> k;
    cout << a[--k] << endl;
    
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int a,b,kaunto=0;
  cin>>a>>b;
  if(a>0)
    cout<<"Positive"<<endl;
  else if(a==0||b==0||(a<0&&b>0))
    cout<<"Zero"<<endl;
  else if(b<0){
    for(int i=a;i<=b;i++){
      kaunto++;
    }
    if(kaunto%2==0)
      cout<<"Positive"<<endl;
    else
      cout<<"Negative"<<endl;
  }
  
  return 0;
}

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

using namespace std;
#define all(a)a.begin(),a.end()
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod = int(1e9)+7;
using V = vector<ll>;
using P = pair<ll,ll>;

int main()
{
   string s;cin >>s;
   ll ans=0;
   ll k=0;
   rep(i,s.size()){
    if(i==0){
        k=(s[i]=='B')?1:2;
    }
    else {
        if(k==1){
            if(s[i]=='W'){
                    ans++;
                    k=2;
            }
        }
        else if(s[i]=='B'){
            ans++;
            k=1;
        }
    }
   }
   cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
X, Y = map(int, input().split())
a = 2*Y-X
b = 2*X-Y

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

if a%3==0 and b%3==0 and a>=0 and b>=0:
    a //= 3 
    b //= 3
    print(combination(a+b, a))
else:
    print(0)

Measured memory_bytes: 40816
#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>;

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

  ll n, k;
  cin >> n >> k;
  ll count = 0;
  ll tmp = 1;
  while (n >= tmp) {
    tmp *= k;
    count++;
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define db(a) cout << fixed << #a << " = " << a << endl;

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int MAXN = 1e6 + 5;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	multiset<int> A;
	vector<bool> R(MAXN, false);
	
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		A.insert(a);
	}
	int r = 0;
	for (int a: A) {
		
		if (!R[a]) {
			if (A.count(a) == 1) r++;
			for (int i = a; i < MAXN; i+= a) {
				R[i] = true;
			}
		}
	}
	cout << r << endl;
}



Measured memory_bytes: 13144
n,m=map(int,input().split())
if n%2==1 or n==4:
    for i in range(1,m+1):
        print(i,n+1-i)
else:
    b=0
    for i in range(1,m+1):
        if i>=(n//2+1)/2:
            b=1
        print(i+b,n+1-i)

Measured memory_bytes: 69580
//Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define endl '\n'
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
const ll m=1e9+7;
bool sortbysec(const pair<ll,ll>&a,const pair<ll,ll>&b)
{
    return (a.second<b.second);
}

int main()
{
    ios;
    int n;
    cin>>n;
    ll a[n];
    ll sum[n+1]={};
    ll s=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(int i=n-1;i>=0;i--)
        sum[i]+=sum[i+1]+a[i];
    ll cnt=0;
    for(int i=0;i<n;i++)
    {
        a[i]%=m;
        sum[i+1]%=m;
        s+=(a[i]*sum[i+1])%m;
        s%=m;
    }
    cout<<s<<endl;


}




Measured memory_bytes: 6776
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(void){
  string s;
  cin >> s;
  int cz, co;
  cz = co = 0;
  for(int i = 0; i < s.length(); i++){
    if(s[i] == '0') cz++;
    else co++;
  }
  int ans = 2 * min(cz, co);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		dfs("", (char) ('a' - 1), n);
	}

	static void dfs(String s, char mx, int n) {
		if (s.length() == n) {
			System.out.println(s);
			return;
		}

		for (char c = 'a'; c <= mx + 1; c++) {
			String str = s + c;
			dfs(str, (char) Math.max(mx, c), n);
		}
	}
}

Measured memory_bytes: 56688
import bisect,collections,copy,heapq,itertools,math,string
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

C =_S()
#H,N= LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

print(chr(ord(C)+1))

# if ans:
#     print('Yes')
# else:
#     print('No')

Measured memory_bytes: 26948
A,B,K = list(map(int,input().split()))

ans = [A,B]
if A+B <= K:
  ans = [0,0]
elif A<=K:
  ans[0] = 0
  ans[1] = B-(K-A)
else:
  ans[0] = A-K
 
 
print(ans[0],ans[1])

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

class Program
{
    static int N;
    static int[] H;

    static void Main(string[] args)
    {
        var s = new Scanner();
        N = s.ReadInt();
        H = s.ReadIntArray(N);

        Solve();
    }

    static void Solve()
    {
        var max = 0;
        var current = 0;
        for (int i = 0; i < N - 1; i++)
        {
            if (H[i] >= H[i + 1])
            {
                current += 1;
            }
            else
            {
                current = 0;
            }
            max = Math.Max(max, current);
        }
        Console.WriteLine(max);
    }
}

class Scanner
{
    string[] S = new string[0];
    int Index = 0;
    char[] Separators = new char[] { ' ' };

    public string Next()
    {
        if (this.Index < this.S.Length) return this.S[this.Index++];
        var line = "";
        while (line == "") line = Console.ReadLine();
        this.S = line.Split(this.Separators, StringSplitOptions.RemoveEmptyEntries);
        if (this.S.Length == 0) return this.Next();
        this.Index = 0;
        return this.S[this.Index++];
    }

    public string ReadStr()
    {
        return this.Next();
    }

    public char ReadChar()
    {
        return this.Next()[0];
    }

    public int ReadInt()
    {
        return int.Parse(this.Next());
    }

    public uint ReadUInt()
    {
        return uint.Parse(this.Next());
    }

    public long ReadLong()
    {
        return long.Parse(this.Next());
    }

    public int[] ReadIntArray(int n)
    {
        var array = new int[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadInt();
        }
        return array;
    }

    public long[] ReadLongArray(int n)
    {
        var array = new long[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadLong();
        }
        return array;
    }

    public char[] ReadCharArray(int n)
    {
        var array = new char[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadChar();
        }
        return array;
    }

    public string[] ReadStrArray(int n)
    {
        var array = new string[n];
        for (int i = 0; i < array.Length; i++)
        {
            array[i] = this.ReadStr();
        }
        return array;
    }
}



Measured memory_bytes: 23008
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(i64 i = 0; i < N; i++)
#define Rep(i, k, N) for(i64 i = k; i < N; i++)
#define all(v) v.begin(), v.end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}

template<class T, class U>
void chmax(T& x, U y){ x = max<T>(x, y); } 

struct Item {
    i64 v, w;
    Item(const i64& V = 0,const i64& W = 0) : v(V), w(W) {}
};

struct Query {
    int v;
    i64 L;
    Query() = default;
    Query(int& V, i64& l) : v(V), L(l) {}
};

Item item [(1 << 18) + 1];
Query query[100010];
i64 dp[(1 << 10)+2 + 1][100010];

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

    int N;
    cin >> N;

    int Q;
    i64 maxL = 0;
    const int K = log2(N) / 2 + 1;
    
    rep(i, N) cin >> item[i].v >> item[i].w;
    cin >> Q;
    rep(i, Q){
        cin >> query[i].v >> query[i].L;
        chmax(maxL, query[i].L);
    }

    
    for(int w = 0; w <= maxL; w++) {
        if(w < item[0].w) continue;
        dp[0][w] = item[0].v;
    }

    for(int k = 0; k <= (1 << K) - 2; k++){
        for(int w = 0; w <= maxL; w++){
            chmax(dp[2*k + 1][w], dp[k][w]);
            chmax(dp[2*k + 2][w], dp[k][w]);

            if(2*k+1 < N && w + item[2*k+1].w <= maxL)
                chmax(dp[2*k + 1][w + item[2*k + 1].w], dp[k][w] + item[2*k + 1].v);

            if(2*k+2 < N && w + item[2*k+2].w <= maxL)
                chmax(dp[2*k + 2][w + item[2*k + 2].w], dp[k][w] + item[2*k + 2].v);
        }
    }

    for(int i = 0; i < Q; i++){
        const Query& q = query[i];
        const int k = max<int>(log2(q.v) - K, 0);
        i64 ans = (k > 0 ? 0 : dp[q.v-1][q.L]);
        for(int bit = 0; bit < (1 << k); bit++){
            int u = (q.v - 1);
            Item s;
            for(int i = 0; i < k; i++){
                if(bit & (1 << i)){
                    s.v += item[u].v;
                    s.w += item[u].w;
                }
                u = (u-1) / 2;
            }
            if(q.L < s.w) continue;
            chmax(ans, s.v + dp[u][q.L - s.w]);
        }
        cout << ans << '\n';
    }
}


Measured memory_bytes: 808580
from collections import Counter,defaultdict,deque
import sys,bisect,math,itertools,string,queue
from heapq import heappop, heappush
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = input()
acgt = {'A', 'C', 'G', 'T'}
cnt = 0
res = 0
for i,t in enumerate(s):
    if t in acgt:
        cnt += 1
    else:
        cnt = 0
    res = max(res, cnt)
print(res)

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

#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}, dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

template <typename T> using vector2d = vector<vector<T>>;

// clang-format off
template <typename T> void sort(vector<T> &v) { sort(all(v)); }
// ostream &operator<<(ostream &os, __int128_t value) { if (ostream::sentry(os)) { __uint128_t tmp = value < 0 ? -value : value; char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __int128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } if (in[0] == '-') value *= -1; return is; }
// ostream &operator<<(ostream &os, __uint128_t value) { if (ostream::sentry(os)) { char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[value % 10]; value /= 10; } while (value != 0); int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __uint128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } return is; }
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << v[0]; for (int i = 1; i < v.size(); ++i) os << " " << v[i]; return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << p.fs << " " << p.sc; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.fs >> p.sc; return is; }

struct IoSetup { IoSetup(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); cerr << fixed << setprecision(10); } } iosetup;

inline int64_t in() { int64_t x = 0; cin >> x; return x; }
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

signed main(int argc, char *argv[]) {
  int64_t M = in();
  int rd = in(), rr = in();
  int64_t cd = in(), cr = in();

  int64_t xd = (cd * 100 + rd - 1) / rd;
  int64_t xr = (cr * 100 + rr - 1) / rr;

  if (xd + xr > M) {
    puts("-1");
    return 0;
  }

  int64_t d = M - xr - xd;
  // auto latte = [&](int64_t x, int r) { return 100 * x / r; };

  cout << d << endl;
}



Measured memory_bytes: 3236
import math
A,B,H,M = list(map(int,input().split()))
h = 360 / 720 * M + 30 * H
m = 360 / 60 * M

Cs1 = math.fabs(h - m)
Cs2 = math.fabs(360 - Cs1)
Csl = [Cs1,Cs2]
Cs = min(Csl)

C = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(math.radians(Cs)))
print(C)

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

using namespace std;
#define ll long long

ll INF = 1e9 + 7;
const int N = 1e5 + 7;
ll cnt = 0;

void dfs( vector<vector<int>> &graph, vector<bool> &isVisited, int src)
{
    isVisited[src] = true;
    cnt++;
    for(int i=0;i<graph[src].size();i++)
    {
        int id = graph[src][i];
        if(!isVisited[id])
        {
            dfs(graph, isVisited, id);
        }
    }
}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,m;
    cin>>n>>m;
    vector<vector<int>> graph(n);
    cnt = 0;

    for(int i=0;i<m;i++)
    {
        int a,b;
        cin>>a>>b;
        a--;b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    vector<bool> isVisited(n, false);
    ll maxVal = 0;

    for(int i=0;i<n;i++)
    {
        if(!isVisited[i])
        {
            ll temp = cnt;
            dfs(graph, isVisited, i);
            maxVal = max(maxVal, cnt - temp);
        }
    }

    cout<<maxVal<<endl;
}

Measured memory_bytes: 23508
#include <iostream>
using namespace std;
int main()
{
    int a,b,k;
    int ans,s=0;
    cin >> a >> b >> k;
    ans=a+1;
    while(s!=k){
        ans--;
        if(a%ans==0&&b%ans==0)
            s++;
    }
    cout << ans << endl;
    return 0;
}

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

#define ll long long
#define ld long double
#define db double
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)
#define tc int tt=1;cin>>tt;while(tt--)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const ld pi=2*acos(0.0);

ll modi(ll a,ll n){
    ll x=1;
    while(n){
        if(n&1)
            x*=a;
        n>>=1;
        a*=a;
    }
    return x;
}

int main(){
    nimble
    ll n;
    cin>>n;
    ll xd=n;
    if(n==1){
        cout<<0;
        return 0;
    }
    vector<ll> div;
    for(ll i=2;i*i<=n;i++){
        int f=0;
        while(n%i==0){
            n/=i;
            f=1;
        }
        if(f)
            div.pb(i);
    }
    if(n>1)div.pb(n);
    int as=0;
    for(int i=0;i<_sz(div);i++){
        ll x=div[i];
        int cnt=0;
        ll g=x;
        while(xd%g==0){
            cnt++;
            if(xd%g==0)
                xd/=g;
            else break;
            if(xd==0)break;
            g*=x;
        }
        as+=cnt;
    }
    cout<<as<<nl;
    return 0;
}



Measured memory_bytes: 3604
#include<iostream>
#include<cmath>
#include <bits/stdc++.h>
#include <iomanip>
 
using namespace std;
 
int main(){
  long int N;
  int kataware;
  double  i,a,b,x;
  cin >> a>>b>>x;
  double ans;
  
  if(x>=a*a*b/2){
    ans = 180*atan((b-(x/a/a))*2/a)/M_PI;
  	printf("%.10f\n",ans);
  }else{
    ans = 90-180*atan(x/a/b*2/b)/M_PI;
    printf("%.10f\n",ans);
  }
  

  
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
#define pvec(vec) {for (auto v: vec) cout << v << ' '; cout << endl;}
#define pivec(vec) {rep(i, 0, vec.size()) cout << i << ':' << vec[i] << ' '; cout << endl;}

using namespace std;
using ll = long long;

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

    ll sum = 0;
    ll maxh = 0;

    rep(i, 0, N)
    {
        ll A;
        cin >> A;

        if (A<=maxh)
            sum += maxh - A;
        else
            maxh = A;
    }
    cout << sum << endl;

    return 0;
}



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

void solve() {
	int n, m;
	multiset<int> s;
	cin >> n >> m;
	ll ss = 0;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		s.insert(-x);
		ss += x;
	}

	while (m > 0) {
		int f = -*s.begin();
		s.erase(s.begin());
		ss -= f - f / 2;
		s.insert(-f / 2);
		m--;
	}
	cout << ss;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t = 1;
	//cin >> t;
	for (int i = 1; i <= t; i++) {
		solve();
	}
}

Measured memory_bytes: 8340
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
typedef long long int ll;

ll min(ll a, ll b){return a>b?b:a;}

int main(void){
    int n;
    scanf("%d", &n);
    ll h[n];
    for(int i=0; i<n; i++){scanf("%lld", &h[i]);}

    ll dp[n];
    for(int i=0; i<n; i++){dp[i] = LLONG_MAX;}

    for(int i=0; i<n; i++){
        if(i == 0){
            dp[i] = 0;
        }
        if(i == 1){
            dp[i] = llabs(h[i]-h[i-1]);
        }
        if(i > 1){
            dp[i] = min(dp[i], dp[i-1]+llabs(h[i]-h[i-1]));
            dp[i] = min(dp[i], dp[i-2]+llabs(h[i]-h[i-2]));
        }
    }

    printf("%lld\n", dp[n-1]);
    return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define iiii tuple<int, int, int, int>
#define iii tuple<int, int, int>
#define ii pair<int, int>
#define dd pair<double, double>
#define fi first
#define vi vector<int>
#define vvi vector<vector<int>>
#define se second

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int M = 1e3;
double e = 1e-8;

double f(vector<ii>& a, double x, double y) {
    double res = 0;
    for (auto& i : a)
        res = max(res, sqrt((i.fi - x) * (i.fi - x) + (i.se - y) * (i.se - y)));
    return res;
}

double dx(vector<ii>& a, double x, double y) {
    return (f(a, x + e, y) - f(a, x - e, y)) / e;
}

double dy(vector<ii>& a, double x, double y) {
    return (f(a, x, y + e) - f(a, x, y - e)) / e;
}

bool test(vector<ii>& a, double L, double x, double y) {
    return f(a, x, y) > f(a, x - dx(a, x, y) * L, y - dy(a, x, y) * L);
}

// double cal_L(vector<ii>& a, double x, double y, double tdx, double tdy) {
//     double lef = 0, rig = 1000;
//     int cnt = 100;
//     while (cnt--) {
//         double l1 = (lef + lef + rig) / 3;
//         double l2 = (lef + rig + rig) / 3;
//         if (f(a, x - tdx * l1, y - tdy * l1) > f(a, x - tdx * l2, y - tdy *
//         l2))
//             lef = l1;
//         else
//             rig = l2;
//     }
//     return lef;
// }

void solve() {
    int n;
    cin >> n;
    vector<ii> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i].fi >> a[i].se;

    int cnt = 20000;
    double L = 100, x = 0, y = 0;
    while (cnt--) {
        // int cnt_test = 1000;
        // while (!test(a, L, x, y) && cnt_test--) L = L * 0.99;
        L = L * 0.999;

        double tdx = dx(a, x, y), tdy = dy(a, x, y);
        // L = cal_L(a, x, y, tdx, tdy);

        x -= tdx * L;
        y -= tdy * L;
    }
    cout << fixed << setprecision(15) << f(a, x, y) << '\n';
}

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    // freopen("in", "r", stdin);

    int t = 1;
    // cin >> t;
    while (t--) solve();

    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int count = 0;
    float total = 0;
    while (input_number > count)
    {
        int input;
        cin >> input;
      
        total += 1.0 / input;
        count++;
    }

    cout << 1 / total;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define show(x) cout<<#x<<"="<<x<<"\n"
using namespace std;

int n;
map<int,int> mp;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
   cout.precision(10);
  cout<<fixed;
#ifdef LOCAL_DEFINE
    freopen("in", "r", stdin); 
    freopen("out","w",stdout);
#endif
    cin>>n;
    for(int i=0;i<n;i++){
    	int a;cin>>a;
    	if(mp[a]==0){
    		mp[a]=1;
    	}else mp[a]=0;
    }
    int ans=0;
    for(auto ite=mp.begin();ite!=mp.end();ite++){
    	if(ite->se==1)ans++;
    }
    cout<<ans<<"\n";
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}


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

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

  int sumd= 0;
  for(int i=0; i<N.size(); i++){
    sumd+= N.at(i)- '0';
  }

  string ans= (sumd%9==0) ? "Yes"
                          : "No";
  
  cout << ans << endl;
}

Measured memory_bytes: 3748
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int num = scan.nextInt();
		int ans = 0;
		
		for(int i = 1; i < num; i++) {
			for(int j = 0; j < num; j++) {
				int temp = (i+1) + 2*j;
				if(temp <= num) {
					ans++;
				}
			}
		}
		System.out.println(ans);
	}
}


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

int main(void) {
    int A,B;
    cin>>A>>B;
    if (B == 1) {
        cout << 0 << endl;
        return 0;
    }
    int a = 1;
    while ((a - 1) * (A - 1) + A < B) {
        a++;
    }
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

S = str(input())
T = str(input())
ans = 0
for i in range(3):
    if S[i]==T[i]:
        ans += 1
print(ans)

Measured memory_bytes: 61920
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  char c;
  cin >> c;
  
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
    cout << "vowel";  
  }
  
  else {
    cout << "consonant"; 
  }
   
}

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

int main(){
    int N, A;
    cin >> N >> A;
    while(true){
        N -= 500;
        if(N < 0){
            N += 500;
            break;
        }
    }
    if(N <= A){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <list>
#include <ctime>
#include <complex>
#include <bitset>
#include <tuple>

#define ff first
#define ss second

using namespace std;
using pii=pair<int,int>;
using ll=long long;

int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);
    
    ll n;
    cin>>n;
    n-=1;
    string answer;
    if(n==0) answer='a';
    while(n!=0){
        answer=(char)('a'+(n%26))+answer;
        n/=26;
        if(n==0) break;
        n-=1;
        if(n==0) answer='a'+answer;
    }
    cout<<answer;
    return 0;
}


Measured memory_bytes: 3660
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define INF	123456789

int N, A[11234];
int memo_A[11234];
int bound[11234][3][2];
int ans = INF;

int how_same(int num, int color) {
	int s1 = 0, s2 = 0;
	for (int i = num + 1; i < N; ++i) {
		if (A[i] == color) { ++s1; }
		else if (A[i] != -1) {
			bound[num][color][0] = i - 1;
			break;
		}
	}
	for (int i = num - 1; i >= 0; --i) {
		if (A[i] == color) { ++s2; }
		else if (A[i] != -1) {
			bound[num][color][1] = i + 1;
			break;
		}
	}
	return s1 + s2 + 1;
}

int solve(int num, int color) {
	int res = 0;
	res += how_same(num, color);
	if (res >= 4) {
		for (int i = bound[num][color][1]; i <= bound[num][color][0]; ++i) { A[i] = -1; }
		if (A[bound[num][color][1] - 1] == A[bound[num][color][0] + 1]) {
			res += solve(bound[num][color][0] + 1, A[bound[num][color][0] + 1]);
		}
		else {
			int tmp = 0;
			tmp += how_same(bound[num][color][0] + 1, A[bound[num][color][0] + 1]);
			if (tmp < 4) { tmp = 0; }
			tmp += how_same(bound[num][color][1] - 1, A[bound[num][color][1] - 1]);
			if (tmp < 4) { tmp = 0; }
		}
	}
	if (res < 4) { res = 0; }
	return res;
}

int main(void) {
	while (true) {
		scanf("%d", &N);
		if (N == 0) { break; }
		memset(bound, 0, sizeof(bound));
		ans = INF;
		for (int i = 0; i < N; ++i) { scanf("%d", &A[i]); }

		for (int i = 0; i < N; ++i) { memo_A[i] = A[i]; }
		for (int i = 1; i < N - 1; ++i) {
				for (int j = 1; j <= 3; ++j) {
					ans = std::min(ans, N - solve(i, j));
					// printf("%d", ans);
					// printf("(%d,%d)\n", i + 1, j);
					for (int k = 0; k < N; ++k) {
						// printf("%d", A[k]);
						A[k] = memo_A[k];
					}
					// printf("\n----------\n");
				}
		}
		printf("%d\n", ans);
	}
	return 0;
}

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

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i,n) for(auto i=0;i<(n);i++)
#define rep1(i,n) for(auto i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()

using namespace std;


struct init{ init(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20); }; }aaaaaaa;



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


  ll sum = 0;
  for(auto c : s){
    if(c == 'o') sum++;
  }

  if(8 <= sum + 15-s.size()) cout << "YES" << endl;
  else                       cout << "NO" << endl;


  return 0;
}


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

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

    vector<string> T(n,"");
    vector<string> H(n,"");

    for(int i=0; i<n; ++i){
        cin >> T[i] >> H[i];
    }
    int t_score{0}, h_score{0};
    for(int i=0; i<n; ++i){
        if(T[i] < H[i]){
            h_score+=3;
        }
        else if(T[i] > H[i]){
            t_score+=3;
        }
        else{
            t_score+=1;
            h_score+=1;
        }
    }
    cout << t_score << ' ' << h_score << endl;
    return 0;
}


Measured memory_bytes: 3228
#include<iostream>
#include<string>
#include<cctype>
#include<set>
#include<algorithm>

using namespace std;



int main(void){
    int N;
    double X,T;
    string U;
    cin>>N;
    T=0;
    for(int i=1;i<=N;i++){
        cin>>X;
        cin>>U;
        if(U=="JPY"){
            T=T+X;
        }else{
            T=T+X*380000.0;
        }
    }
    cout<<T<<endl;
          
    return 0;
}

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

int main()
{
	int c[3][3];
	for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) cin >> c[i][j];
	int a[3], b[3];
	a[0] = 0;
	for (int i = 0; i < 3; i++) b[i] = c[i][0];
	
	a[1] = c[0][1] - b[0];
	a[2] = c[0][2] - b[0];

	bool flag = 1;
	for (int i = 0; i < 3; i++){
		for (int j = 0; j < 3; j++){
			if (a[j] + b[i] != c[i][j]) flag = 0;
		}
	}

	cout << (flag ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    int n;cin>>n;
    ll arr[n];
    for(int i=0;i<n;i++)cin>>arr[i];
    ll dp[100002];memset(dp,0,sizeof(dp));
    dp[0]=0;
    dp[1]=abs(arr[1]-arr[0]);
    for(int i=2;i<n;i++)
    {
        dp[i]=min(dp[i-1]+abs(arr[i]-arr[i-1]),dp[i-2]+abs(arr[i]-arr[i-2]));
    }
    cout<<dp[n-1]<<endl;
return 0;
}

Measured memory_bytes: 5136
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cassert>
#include<cassert>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<random>
#include<chrono>
#include<bitset>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define xx first
#define yy second
#define sz(x) (int)(x).size()
#define gc getchar
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mp make_pair

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) ((void)0)
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI=acos(-1);
const ll INF = 1LL<<62;
const ll MINF = -(1LL<<62);

template<typename T> T getint() {
	T val=0;
	char c;
	
	bool neg=false;
	while((c=gc()) && !(c>='0' && c<='9')) {
		neg|=c=='-';
	}

	do {
		val=(val*10)+c-'0';
	} while((c=gc()) && (c>='0' && c<='9'));

	return val*(neg?-1:1);
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<int>(0, n-1)(rng)


int main() {
	IO;
	int n;
	cin>>n;
	vector<int> ans(n+1);
	for(int i=1;i*i<=n;++i) {
		for(int j=1;i*i+j*j+i*j<=n;++j) {
			for(int k=1;i*i+j*j+k*k+i*j+i*k+j*k<=n;++k) {
				ans[i*i+j*j+k*k+i*j+i*k+j*k]++;
			}
		}
	}
	
	for(int i=1;i<=n;++i) cout<<ans[i]<<"\n";
	return 0;
}


Measured memory_bytes: 3616
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Tenka1._2019Beginner
{
    class A
    {
        static void Solve()
        {
            int[] inputs = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            string output = "No";

            if (inputs[0] <= inputs[2] && inputs[2] <= inputs[1])
                output = "Yes";
            else if (inputs[1] <= inputs[2] && inputs[2] <= inputs[0])
                output = "Yes";

            Console.WriteLine(output);
        }

        static void Main(string[] args)
        {
            Solve();
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,int> pii;
#define x first
#define y second
#define mp make_pair
#define pb push_back
template <typename TYPE> inline void chkmax(TYPE &x,TYPE y){x<y?x=y:0;}
template <typename TYPE> inline void chkmin(TYPE &x,TYPE y){y<x?x=y:0;}
template <typename TYPE> void readint(TYPE &x)
{
    x=0;int f=1;char c;
    for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-1;
    for(;isdigit(c);c=getchar())x=x*10+c-'0';
    x*=f;
}
const int MAXN=5005,MOD=1000000007;
inline int dmy(int x){return x>=MOD?x-MOD:x;}
int qmi(int x,int y)
{
	int ans=1;
	for(;y;y>>=1,x=1ll*x*x%MOD)
		if(y&1)ans=1ll*ans*x%MOD;
	return ans;
}

int n,A,B,g[MAXN],f[MAXN][MAXN][2];

int main()
{
	readint(n),readint(A),readint(B);
	if(A>B)swap(A,B);
	if(A==1)return 0*printf("%d\n",qmi(2,n));
	g[1]=g[2]=1;
	for(int i=3;i<=n+2;++i)
	{
		g[i]=g[i-1];
		for(int j=A+1;j<i;++j)
			g[i]=dmy(g[i]+g[i-j]);
	}
	f[1][1][0]=f[1][1][1]=1;
	for(int i=2;i<=n;++i)
	{
		for(int j=1;j<=i;++j)
		{
			if(j>=A)f[i][j][0]=0;
			else if(j>1)f[i][j][0]=f[i-1][j-1][0];
			else for(int k=1;k<i;++k)f[i][j][0]=(f[i][j][0]+1ll*f[i-1][k][1]*(i-1==k?g[k+1]:g[k]))%MOD;
			if(j>=B)f[i][j][1]=0;
			else if(j>1)f[i][j][1]=f[i-1][j-1][1];
			else for(int k=1;k<i;++k)f[i][j][1]=dmy(f[i][j][1]+f[i-1][k][0]);
		}
	}
	int ans=0;
	for(int j=1;j<=n+1;++j)ans=(ans+f[n][j][0]+1ll*f[n][j][1]*(n==j?g[j+2]:g[j+1]))%MOD;
	printf("%d\n",dmy(qmi(2,n)-ans+MOD));
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    int test[n];
    for ( int i = 0; i < n; i++ ) {
        int a;
        cin >> a;
        test[i] = a;
    }
    for ( int t = n - 1; t >= 0; t-- ){
        if ( t < n - 1 ) cout << " ";
        cout << test[t];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3092
//Priority Queue
#include <iostream>

using namespace std;

const int MAX = 2000000;
int H = 0;
int A[MAX + 1];

int parent(int i) {return i/2;}
int left(int i) {return 2*i;}
int right(int i) {return 2*i+1;}

void maxHeapify(int i) {
    int l = left(i), r = right(i);

    int largest = i;
    if(l <= H && A[largest] < A[l]) largest = l;
    if(r <= H && A[largest] < A[r]) largest = r;

    if(largest != i) {
        swap(A[i], A[largest]);
        maxHeapify(largest);
    }
}

void insert(int k) {
    H++;
    A[H] = k;
    int i = H;
    while(parent(i) > 0 && A[parent(i)] < A[i]) {
        swap(A[i], A[parent(i)]);
        i = parent(i);
    }
}

int extract() {
    int k = A[1];
    A[1] = A[H];
    H--;
    maxHeapify(1);
    return k;
}

int main() {
    int k;
    string opr;
    while(1) {
        cin >> opr;
        if(opr == "insert") {
            cin >> k;
            insert(k);
        }
        else if(opr == "extract") cout << extract() << endl;
        else if(opr == "end") break;
    }
}


Measured memory_bytes: 7060
#include <cstdio>
#include <iostream>

using namespace std;

typedef unsigned long long ullong;

ullong power(ullong x, ullong n) {
	ullong num = 1000000007;
	ullong res = 1;
	if (n > 0) {
		res = power(x * x % num, n / 2);
		if (n % 2 != 0)
			res = res * x % num;
	}
	return res;
}

int main() {

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

	ullong p = power(m, n);

	cout << p << endl;

	return 0;
}

Measured memory_bytes: 3152
#include<bits/stdc++.h>
#define endl              "\n"
#define fast               ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
    fast;
    long long i,j,c=0,d=0,n,k,sum=0;
    cin>>n>>k;
    long long  a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    for(i=0;i<(n-k);i++)
    {
        sum+=a[i];
    }
    cout<<sum;




}


Measured memory_bytes: 1792
/* kadai4_2
   reo012 */

#include<stdio.h>
#include<math.h>

int main(void){
    // 定義と入力
    double length_a, length_b, hour, minute, angle, radian, ans;
    scanf("%lf %lf %lf %lf", &length_a, &length_b, &hour, &minute);
    // ２つの針の成す角度を計算（マイナスでもOK）
    angle = 360*minute/60 - 360*(hour+minute/60)/12;
    // ラジアンに直す
    radian = 2*M_PI*angle/360;
    // 余弦定理を用いて長さの計算
    ans = sqrt( pow(length_a,2)+pow(length_b,2)-2*length_a*length_b*cos(radian) );
    // %.10fとすることで小数点以下10位まで表示
    printf("%.10f\n", ans);
    return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

int main() {
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0;i < n;++i) cin >> a[i];
    int ng = 0,ok = 1e9+10;
    while (ok-ng > 1) {
        int mid = (ok+ng)/2;
        ll cnt = 0;
        for (int i = 0;i < n;++i) {
            cnt += (a[i]-1)/mid;
        }
        (cnt > k ? ng : ok) = mid;
    }
    // if (k == 0) ok = *max_element(a.begin(),a.end());
    cout << ok << endl;
}

Measured memory_bytes: 3988
#include<stdio.h>

int main(void){
	int i;
	char str[1000];
	
	for(i = 0 ;; i ++){
		str[i] = getchar();
		if(str[i] == '\n'){
			str[i] = '\0';
			break;
		}
	}

	for(i = 0;;i ++){
		if(str[i] >= 'a' && str[i] <= 'z'){
			str[i] -= 32;
		}
		if(str[i + 1] == '\0'){
			break;
		}
	}
	printf("%s\n",str);

	return 0;
}

Measured memory_bytes: 524
#include<stdio.h>

int F[45];


int fib(int n){

  if(n==0||n==1)return F[n]=1;
  if(F[n]!=-4)return F[n];
  return F[n]=fib(n-2)+fib(n-1);

}

int main(){

  int a,A,i;
  for(i=0;i<45;i++)F[i]=-4;
  
  scanf("%d",&a);
  A=fib(a);
printf("%d\n",A);
  return 0;
}



Measured memory_bytes: 2112
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    long long n,a;
    std::cin >> n >>a;
    for (long long int i = 0; i*10000LL <= a && i<=n;i++) {
        for (long long int j = 0; i*10000LL+j*5000LL <= a && i+j<=n;j++) {
            int k=n-i-j;
            if(i*10000LL+j*5000LL+k*1000LL==a){
                std::cout << i <<" "<<j <<" "<<k << std::endl;
                return 0;
                
            }
        }
    }
    
    std::cout << "-1 -1 -1" << std::endl;
    return 0;
}


Measured memory_bytes: 256