akhauriyash/Code-Regression huggingface dataset:
using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {

            string s = Console.ReadLine();
            char[] c = s.ToCharArray();

            int counter = 0;
            int max = 0;

            for(int i=0;i<c.Length;i++)
            {
                if("ATGC".IndexOf(c[i]) > -1)
                {
                    counter++;
                }
                else
                {
                    if (counter > max)
                        max = counter;
                    counter = 0;
                }
            }
            if (counter > max)
                max = counter;

            Console.WriteLine(max.ToString());
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
int main(void){
    ll c=0;
    ll n,m; cin>>n>>m;
    ll l=m,r=m+1;
    if(n==4){
        cout<<1<<" "<<2<<endl;
        return 0;
    }
    if(n%2==1){
        for(int i=0;i<m;i++){
            cout<<l<<" "<<r<<endl;
            l=l-1; r=r+1;
        }
    }else{
        l=n/2; l=l/2; r=l+1;
        while(l>=1){
            if(c>=m){
                return 0;
            }
            cout<<l<<" "<<r<<endl;
            l=l-1; r=r+1;
            c++;
            
        }
        l=r; r=n-1;
        while(c<m){
            cout<<l<<" "<<r<<endl;
            l++; r--;
            c++;
        }
    }
    
    
}


Measured memory_bytes: 3676
/* ex 7_1
   Kohei_Suzuki */

#include <stdio.h>

//(x,y)のpointをtypedef宣言
typedef struct point{
    int x_elem;
    int y_elem;
}point;

//正方形の二点の座標から反時計回りに次の一点のお座標を求める関数
point shift_point(point pt1, point pt2){
    point moved_point;

    moved_point.x_elem = pt2.x_elem - (pt2.y_elem - pt1.y_elem);
    moved_point.y_elem = pt2.y_elem + (pt2.x_elem - pt1.x_elem);

    return moved_point;
}


int main (void){
    point pt1, pt2, pt3, pt4;

    //入力受取
    scanf("%d %d %d %d", &pt1.x_elem, &pt1.y_elem, &pt2.x_elem, &pt2.y_elem);

    //pt1,pt2からpt3を求める
    pt3 = shift_point(pt1, pt2);
    //pt2,pt3からpt4を求める
    pt4 = shift_point(pt2, pt3);

    //出力
    printf("%d %d %d %d", pt3.x_elem, pt3.y_elem, pt4.x_elem, pt4.y_elem);
    return 0;
}

Measured memory_bytes: 1700
#include<iostream>
#include<queue>

using namespace std;
static const int N = 100;
static const int INFTY = (1<<21);

int n,M[N][N];
int d[N];
void bfs(int s){
  queue<int> q;
  q.push(s);
  for(int i = 0;i < n;i++) d[i] = INFTY;
  d[s] = 0;
  int u;
  while( !q.empty() ){
    u = q.front(); q.pop();
    for(int v = 0;v < n;v++){
      if(M[u][v] == 0) continue;
      if(d[v] != INFTY) continue;
      d[v] = d[u] + 1;
      q.push(v);
    }
  }
  for(int i = 0;i < n;i++){
    cout << i+1 << " " << ( (d[i] == INFTY) ? (-1) : d[i] ) << endl;
  }
}
int main(){
  int u,k,v;
  cin >> n;
  for(int i = 0;i < n;i++){
    for(int j = 0;j < n;j++) M[i][j] = 0;
  }
  for(int i = 0;i < n;i++){
    cin >> u >> k;
    u--;
    for(int j = 0;j < k;j++){
      cin >> v;
      v--;
      M[u][v] = 1;
    }
  }
  bfs(0);

  return 0;
}



Measured memory_bytes: 3092
#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() {
  int n;
  scanf("%d", &n);
  int l = 0, r = n;
  printf("%d\n", l);
  fflush(stdout);
  string sl;
  cin >> sl;
  while (sl != "Vacant") {
    int m = (l + r) / 2;
    printf("%d\n", m);
    fflush(stdout);
    string sm;
    cin >> sm;
    if (sm == "Vacant" || l % 2 == m % 2 && sl == sm || l % 2 != m % 2 && sl != sm) {
      l = m;
      sl = sm;
    } else {
      r = m;
    }
  }
  printf("%d\n", l);
  fflush(stdout);
  return 0;
}

Measured memory_bytes: 3852
def main():
    n, m = map(int, input().split())
    p = 2**n
    inf = float('inf')
    dp = [inf]*p
    dp[0] = 0
    for _ in range(m):
        a, _ = map(int, input().split())
        c = sum([2**(int(i)-1) for i in input().split()])
        for s in range(p):
                t = s|c
                if dp[t] > dp[s] + a:
                    dp[t] = dp[s] + a
    ans = dp[-1]
    if ans == inf:
        ans = -1
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1000000000;
const long INF64 = 1000000000000000ll;
const int MOD = 1000000007;
int main(){
	int n;
	std::cin >> n;
	std::vector<int> a(n);
	rep(i,n)std::cin >> a[i];
	int m=a[0];
	bool han=true;
	if(n==1){
		std::cout << "Yes" << std::endl;
		exit(0);
	}
	rep(i,n){
		if(m-a[i]>=2)han=false;
		if(a[i]>m)m=a[i];
	}
	if(han)std::cout << "Yes" << std::endl;
	else std::cout << "No" << std::endl;
}

Measured memory_bytes: 640
#include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	string s;
	getline(cin,s);
	
	rep(i,sz(s)){
		if(s[i]>='a' && s[i]<='z')s[i]+='A'-'a';
	}
	cout<<s<<endl;
	
	return 0;
}

Measured memory_bytes: 1172
#include<bits/stdc++.h>
#define sz 100002
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define P push
#define PQ priority_queue<double, vector<double>, greater<double> >q
#define _sort(v) sort(v.begin(),v.end())
#define MP map<ll int,ll int>mp
#define MEM(x) memset(x,0,sizeof(x))
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define VEC() vector<ll int>v
#define VEC(n) ll int x; vector<ll int>v;for(int i=0;i<n;i++){cin>>x;v.pb(x);}
#define TEST() int test;cin>>test; while(test--)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
//Upper_bound   auto x=upper_bound(v[a].begin(),v[a].end(),les);les=*x; if(x==v[a].end())break;
//ll int LCM(ll int a,ll int b) { ll int gcd=__gcd(a,b);ll int lcm=a*b/gcd;return lcm;}
//ll int bigmod(ll int b, ll int p, ll int m){if(p==0)return 1;if(p%2!=0) return b%m*fun(b,p-1,m)%m;if(p%2==0){ ll int res=fun(b,p/2,m);return (res%m*res%m)%m;}}
//ll mod_inverse(ll a, ll mod){return bigmod(a,mod-2,mod);}
//void seive() { prime[np++]=2;for(i=3; i<=sz; i+=2){if(mark[i]==0){ prime[np++]=i;for(j=i*i; j<=sz; j+=i) mark[j]=1; } }}
//string add(string s1,string s2) {string s;int j=s1.size()-1,c=0,m; for(int i=s2.size()-1; i>=0; i--) {if(j>=0)m=s2[i]-'0'+s1[j]-'0'+c;else m=s2[i]-'0'+c; if(m>9) { s+=m%10+'0';c=m/10; } else {  c=0;s+=m+'0'; }j--; } if(c!=0) {s+=c+'0'; }reverse(s.begin(),s.end());return s;}
//int pos;strRescan ing mul(int n) {string s;for(int i=0; i<pos; i++) { s+="0"; }pos++;int c=0,m; for(int i=s1.size()-1; i>=0; i--) { m=(s1[i]-'0')*n+c;if(m>9) { s+=m%10+'0';c=m/10;} else { c=0; s+=m+'0';} }while(c!=0) { s+=c%10+'0';c=c/10;}    reverse(s.begin(),s.end());return s;}
//string add(string s,int n){ string res; int c=n,x; for(int i=s.size()-1;i>=0;i--)   { x=s[i]-'0'+c;res+=(x%10+'0'); c=x/10; }    while(c)    { res+=(c%10+'0'); c=c/10;} reverse(res.begin(),res.end()); return res;}

int main()
{
    FAST();
  ll int n,m,res=0,cnt=0,x;
  string s;
  cin>>s;
  for(int i=0;i<s.size();i++)
  {
      cnt+=s[i]-'0';
  }
  if(cnt%9)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;





    return 0;
}



Measured memory_bytes: 3764
h,w,y=map(int,input().split())
c=[input() for _ in range(h)]
black=0
for i in range(h):
    for j in range(w):
        if c[i][j]=="#":
            black+=1
if black<y:
    print("0")
    exit()
hb=[]
wb=[]
for i in range(h):
    hb.append(c[i].count("#"))
for i in range(w):
    count=0
    for j in range(h):
        if c[j][i]=="#":
            count+=1
    wb.append(count)
bit=[]
for i in range(2**(h+w)): #行：[:h]、列：[h+1:]
    bit.append(bin(i)[2:].zfill(h+w))
ans=0
for i in bit:
    x=black
    for j in range(h):
        if i[j]=="1":
            for k in range(w):
                if i[h+k]=="1" and c[j][k]=="#":
                    x+=1
    for j in range(h):
        if i[j]=="1":
            x-=hb[j]
    for j in range(w):
        if i[h+j]=="1":
            x-=wb[j]
    if x==y:
        ans+=1
print(ans)

Measured memory_bytes: 9220
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    int a, b;
    cin >> a >> b;
    int res{};
    for( int i = a; i <= b; ++i )
    {
        string tmp = to_string( i );
        reverse( ALL( tmp ) );
        if( i == stoi( tmp ) )
        {
            ++res;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 256
import sys
from fractions import gcd
input = sys.stdin.readline

def main():
    n=int(input())
    a=list(map(int,input().split()))
    f,b=[0]*(n+2),[0]*(n+2)
    f[1],b[n]=a[0],a[-1]
    for i in range(2,n+1):
        f[i],b[n-i+1]=gcd(a[i-1],f[i-1]),gcd(a[n-i],b[n-i+2])
    ans=0
    for i in range(1,n+1):
      ans=max(ans,gcd(f[i-1],b[i+1]))
    print(ans)
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 16108
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = n, s = 0;
  while(t > 0) {
    s += t % 10;
    t /= 10;
  }
  if (n % s == 0) cout << "Yes\n";
  else cout << "No\n";
  return 0;
}

Measured memory_bytes: 3580
#include<iostream>
using namespace std;
int main()
{
  int a,b,c=0;
  cin >> a;
  int arr[a],arr2[a];
  for(int i = 0;i < a;i++){
    cin >> arr[i];
  }
  for(int i = 0;i < a;i++){
    arr2[arr[i]] = i + 1;
  }
  cout << arr2[1];
  for(int i = 2;i <= a;i++){
    cout << " " << arr2[i];
  }
}

Measured memory_bytes: 1536
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include<ext/rope>
using namespace __gnu_cxx;
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> P;
#define X real()
#define Y imag()
ld restant(P p){return abs(p);}
//polar(x,y) mag=l,arg=y
//typedef unordered_set<ll> usll;
//typedef unordered_multiset<ll> umsll;
typedef multiset<ll> msll;
typedef set<ll> sll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef vector<pair<ll,ll> > vpll;
typedef priority_queue<ll> pqll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
//typedef unordered_multiset<int> umsi;
//typedef unordered_set<int> usi;
typedef pair<int,int> pi;
typedef vector<pair<int,int> > vpi;
typedef vector<pair<double,double> > vpd;
typedef pair<double,double> pd;
typedef priority_queue<int> pqi;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ind_set;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ind_setll;
#define in insert
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define be begin
#define en end
#define itr iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define mo 1000000007
#define inf 1000000000000000001
#define ninf -1000000000000000001
#define ima INT_MAX
#define imi INT_MIN
#define oncnt __builtin_popcount
#define zerobegin __builtin_clz
#define zeroend __builtin_ctz
#define parity __builtin_parity
#define all(x) x.be(),x.en()
#define eps 1e-9
const ld pii=3.14159265359;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return((a-b+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}


int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{	
int n,l;
cin>>n>>l;
string a[n];
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
string s="";
for(int i=0;i<n;i++)
s+=a[i];
cout<<s;

}return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;
int main()
{
    double L;

    double ans ,a ;
    cin >> L;
    a = L/3;
    ans =  a*a*a;
    printf("%.7f",ans);
    return 0;

}

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        BigDecimal a = scanner.nextBigDecimal();
        BigDecimal b = scanner.nextBigDecimal();
        System.out.println(a.multiply(b).setScale(0, RoundingMode.DOWN).toBigInteger());
    }
}


Measured memory_bytes: 37560
#include <cstdlib>
#include <iostream>
#include <stack>
#include <string>
using namespace std;

int main() {
  int a, b;
  stack<int> s;
  string t;

  while (cin >> t) {
    if (t[0] == ' ') {
      cout << "[*] space!" << endl;
    }

    if (t[0] >= '0' && t[0] <= '9') {
      a = atoi(t.c_str());
      s.push(a);
      continue;
    }

    b = s.top();
    s.pop();
    a = s.top();
    s.pop();

    switch (t[0]) {
      case '+': s.push(a + b); break;
      case '-': s.push(a - b); break;
      case '*': s.push(a * b); break;
    }
  }

  cout << s.top() << endl;

  return 0;
}

Measured memory_bytes: 1200
#include <stdio.h>
#include <string.h>

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

int min(int a,int b){
  if(a < b){
    return a;
  }
  return b;
}

int main(void){
  char S[100000];
  scanf("%s",S);

  char past = S[0];
  int ans = 0;
  int cnt = 0;
  for(int i = 1;i < strlen(S);i++){
    if(past != S[i]){
      ans = max(ans,min(i,strlen(S)-i+cnt));
      cnt = 1;
    }else{
      cnt++;
    }
    past = S[i];
  }

  if(ans == 0) ans = strlen(S);
  ans = max(ans,cnt);
  printf("%d\n",ans);

  return 0;
}

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

int check (int [],int []);
int diceC (int [],int []);
void diceS(int []);
void diceE(int []);
void diceW(int []);
void diceN(int []);
void diceR(int []);

int main(){
	int d[100][6],n,na;
	bool flag=true;
	cin >> n;
	na=n;
	while(--na){
		for(int i=0;i<n;i++){
			for(int j=0;j<6;j++){
				cin >> d[i][j];
			}
			for(int k=i-1;k>=0 && flag;k--){
				if(check(d[i],d[k])) flag=false;
			}
		}
	}
	if(flag) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

int check(int a[6],int b[6]){
		for(int k=0;k<4;k++){
		for(int i=0;i<4;i++){
			for(int j=0;j<4;j++){
				if(diceC(a,b)){
					return 1;
				}
				diceS(a);
			}
			diceE(a);
		}
		diceR(a);
		}
		return 0;	//false

}
void diceS(int a[6]){
	int w;
	w=a[0];
	a[0]=a[4];
	a[4]=a[5];
	a[5]=a[1];
	a[1]=w;
}


void diceE(int a[6]){
	int w;
	w=a[0];
	a[0]=a[3];
	a[3]=a[5];
	a[5]=a[2];
	a[2]=w;
}

void diceW(int a[6]){
	int w;
	w=a[0];
	a[0]=a[2];
	a[2]=a[5];
	a[5]=a[3];
	a[3]=w;
}

void diceN(int a[6]){
	int w;
	w=a[0];
	a[0]=a[1];
	a[1]=a[5];
	a[5]=a[4];
	a[4]=w;
}

void diceR(int a[6]){
	int w;
	w=a[1];
	a[1]=a[2];
	a[2]=a[4];
	a[4]=a[3];
	a[3]=w;
}

int diceC(int a[6],int b[6]){
	for(int i=0;i<6;i++){
		if(a[i]!=b[i]) return 0;
	}
	return 1;
}

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

#define fa(x,v) for(auto x:v)
#define f(i,a,b) for(ll i=(ll)a;i<=(ll)b;i++)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i--)
#define spc " "
#define endl '\n'
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(s) (ll)int(s.length())
#define sz(v) (ll)int(v.size())
#define MOD 1000000007

void Fast_IO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifdef rsd511
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
    #endif
    #ifndef rsd511
    #define trace(...) {}
    #define cotra(...) {}
    #endif
} 

// Code Here

#define MAX 1000000

ll gcd(ll a, ll b) { if (a == 0) return b; return gcd(b % a, a); }

ll spf[MAX+1];

void buildSPF()
{
	f(i,0,MAX) spf[i] = 0;
	f(i,2,MAX) {
		if(spf[i] == 0) {
			spf[i] = i;
			for(ll j = i + i; j <= MAX; j += i)
				if(spf[j] == 0)
					spf[j] = i;
		}
	}
}

vector <ll> primeFactorsOf(ll n)
{
	 vector <ll> ret;
	 while(n > 1) {
	 	ll currentFactor = spf[n];
	 	ret.pb(currentFactor);
	 	while(n % currentFactor == 0) n /= currentFactor;
	 }
	 return ret;
}

int main()
{
    Fast_IO();
	buildSPF();
    ll n; cin >> n;
    ll a[n]; f(i,0,n-1) cin >> a[i];
    ll GCDALL = a[0];
    f(i,1,n-1) GCDALL = gcd(GCDALL, a[i]);
    if(GCDALL != 1) {
    	cout << "not coprime";
    	return 0;
    }
    ll frq[1000001]; f(i,0,1000000) frq[i] = 0;
    f(i,0,n-1) {
    	vector <ll> pf = primeFactorsOf(a[i]);
    	fa(x,pf) frq[x]++;
    }
    bool pairwise = true;
    f(i,0,1000000) if(frq[i] >= 2) pairwise = false;
    if(pairwise) cout << "pairwise coprime";
    else cout << "setwise coprime";
    return 0;
}

Measured memory_bytes: 27080
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
signed main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    put(*max_element(all(a)) - *min_element(all(a)))
    return 0;
}

Measured memory_bytes: 3632
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	int p, q, r;
	final int DIV = 1000000;
	double s, t;
	void run() {
		Scanner sc = new Scanner(System.in);
		for(;;) {
			p = sc.nextInt();
			q = sc.nextInt();
			r = sc.nextInt();
			if( (p|q|r) == 0 ) break;
			s = p - q;
			t = (double)( q-p ) / q; 
			if( r == 0 ) System.out.println((double)2 * ( p - q ) * PI );
			else {
				double sum = 0;
				int loop = q / lcm(q, p-q);
				double theta = 2 * PI * loop;
				
				for(int i=0;i<DIV;i++) {
					double t1 = theta / DIV * i;
					double t2 = theta / DIV * ( i + 1 );
					P p = hypotroid( (t1+t2) / 2 ) ;
					sum += sqrt(p.x * p.x + p.y * p.y) * (t2-t1);
				}
				System.out.println(sum);
			}
		}
	}
	
	int lcm( int a, int b ) {
		if( b == 0 ) return a;
		else return lcm(b, a%b);
	}
	
	P hypotroid( double theta ) {
		double x = s * cos(theta) + (double) t * r * cos( theta * t );
		double y = s * sin(theta) + (double) t * r * sin( theta * t );
		return new P(x, y);
	}
	
	class P {
		double x, y;
		P(double x, double y) {
			this.x = x;
			this.y = y;
		}
	}

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

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

Measured memory_bytes: 12000
n, m = map(int, input().split())
h = list(map(int, input().split()))
lst = [0] * n

for i in range(m):
  a, b = map(int, input().split())
  
  lst[a - 1] = max(lst[a - 1], h[b - 1])
  lst[b - 1] = max(lst[b - 1], h[a - 1])
  
ans = 0

for i in range(n):
  if lst[i] < h[i]:
    ans += 1

print(ans)

Measured memory_bytes: 20096
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 1e5 + 5;
int n, k, a[N];
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> k;
    int idx = -1;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(a[i] == 1) idx = i;
    }
    ll l = idx, r = idx + k - 1, ans = 1e9;
    while(r >= n) l--, r--;
    while(idx >= l && idx <= r && l > -1){
        ll L = l, R = n - r - 1;
        ans = min(ans, 1 + (ll)ceil((ld)L / (k - 1)) + (ll)ceil((ld)R / (k - 1)));
        l--, r--;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
   string A,S,C,Ans;cin>>A>>S>>C;
   Ans="KMC";
   Ans[0]='A';
   Ans[1]=S[0];
   Ans[2]='C';
   cout<<Ans<<endl;

}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define INF 999999999
typedef long long int Int;
using ll = long long;
using VI = vector<int>;

int main(){
  int a,b,k;cin >> a >> b >> k;
  int n = min(a,b);
  int count = 0;
  int i;
  int ans = 0;
  vector<int> s;
  for(i=1;i<=n;i++){
    if(a%i==0&&b%i==0){
      count++;
      s.push_back(i);
    }
  }
  sort(s.begin(),s.end());
  reverse(s.begin(),s.end());
  cout << s[k-1] << endl;
  return 0;
}


Measured memory_bytes: 256
import math
A, B, C = map(int, open(0).read().split())
S = 0.5 * A * B * math.sin(math.radians(C))
L = A + B + math.sqrt(A**2 + B**2 - (2 * A * B * math.cos(math.radians(C))))
h = B * math.sin(math.radians(C))
print(S)
print(L)
print(h)


Measured memory_bytes: 5708
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  
  
  int a= N%10;
  if (a==2 || a==4 || a==5 || a==7 || a==9)cout << "hon" << endl;
  if (a==0||a==1||a==6||a==8)cout << "pon" << endl;
  if (a==3)cout << "bon" << endl;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define FOR0(i,n) for(int i=0, _##i=(n); i<_##i; ++i)
#define FOR(i,l,r) for(int i=(l), _##i=(r); i<_##i; ++i)
#define FORD(i,l,r) for(int i=(r), _##i=(l); --i>=_##i; )
#define repi(i,a) for(__typeof((a).begin()) i=(a).begin(), _##i=(a).end(); i!=_##i; ++i)
#define dwni(i,a) for(__typeof((a).rbegin()) i=(a).rbegin(), _##i=(a).rend(); i!=_##i; ++i)
#define printCase() "Case #" << caseNum << ": "
#define pb push_back
#define mp make_pair
#define INF (int)1e9
#define EPS 1e-9
#define SYNC std::ios::sync_with_stdio(false)
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main() {
	SYNC;
	ll h, w; cin >> h >> w;
	if(h*w % 3 == 0) cout << 0 << endl;
	else if(h==2 || w==2) cout << 1 << endl;
	else {
		ll ans = 100000000000000;
		FOR(i, 1, w) {
			ll a = h*(ll)i, b = (w-i)*((h)/2), c = h*w-a-b;
			ll smax = max(max(a,b), c), smin = min(min(a,b), c); 
			ans = min(ans, smax - smin);
		}
		FOR(i, 1, w-1) {
			ll a = h*(ll)i, b = ((w-i)/2)*(h), c = h*w-a-b;
			ll smax = max(max(a,b), c), smin = min(min(a,b), c); 
			ans = min(ans, smax - smin);
		}
		swap(h, w);
		FOR(i, 1, w) {
			ll a = h*(ll)i, b = (w-i)*((h)/2), c = h*w-a-b;
			ll smax = max(max(a,b), c), smin = min(min(a,b), c); 
			ans = min(ans, smax - smin);
		}
		FOR(i, 1, w-1) {
			ll a = h*(ll)i, b = ((w-i)/2)*(h), c = h*w-a-b;
			ll smax = max(max(a,b), c), smin = min(min(a,b), c); 
			ans = min(ans, smax - smin);
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String S = scanner.next();
        String T = scanner.next();
        int A = scanner.nextInt();
        int B = scanner.nextInt();
        String U = scanner.next();

        if (U.equals(S)) A -= 1;
        if (U.equals(T)) B -= 1;

        System.out.printf("%d %d%n", A, B);
    }
}


Measured memory_bytes: 35692
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
int main(){
    ll x;
    cin >> x;
    ll ans = 0;

    ans += (x / 500 * 1000);
    ans += (x % 500) / 5 * 5;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;




int main(){
    int a,b;cin >> a >> b;
    if(a==b) cout << 2*a << endl;
    else cout << max(a,b)*2 - 1 << endl;
    return 0;
}



Measured memory_bytes: 256
//参考：https://qiita.com/DaikiSuyama/items/9dba963ba74396b9b7fd
//インクルード(アルファベット順)
#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;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define FIR first    //pairの一つ目の要素
#define SEC second   //pairの二つ目の要素

ll gcd(ll x, ll y)
{
    if (y > x)
        swap(x, y);

    ll r = x % y;
    if (r == 0)
        return y;
    else
        return gcd(y, r);
}

ll lcm(ll x, ll y)
{
    return x * y / gcd(x, y);
}

ll count_mul(ll min_num, ll max_num, ll div)
{
    if (max_num < div)
        return 0;

    ll min_r = min_num % div;
    ll min_q = min_num / div;

    if (min_r == 0)
        min_q--;

    ll max_q = max_num / div;

    return max_q - min_q;
}

signed main()
{
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll A, B, C, D;
    cin >> A >> B >> C >> D;

    ll mul_c = count_mul(A, B, C);
    ll mul_d = count_mul(A, B, D);
    ll mul_lcm_cd = count_mul(A, B, lcm(C, D));

    ll ans = B - A + 1 - mul_c - mul_d + mul_lcm_cd;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3136
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <numeric>
#include <math.h>

using namespace std;
double condition = 0.0;

void func()
{
	int X;
	cin >> X;
	int Y, Z;
	Y = X / 500;
	Z = (X % 500) / 5;

	cout << 1000 * Y + Z * 5 << endl;
}

int main() {
//	while(1)
	func();
	return 0;
}


Measured memory_bytes: 3140
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)
#define complete_unique(a) a.erase(unique(a.begin(),a.end()),a.end())
#define mst(x,a) memset(x,a,sizeof(x))
#define all(a) a.begin(),a.end()
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-(x)))
#define lson (ind<<1)
#define rson (ind<<1|1)
#define se second
#define fi first
#define sz(x) ((int)x.size())
#define EX0 exit(0);

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;
typedef vector<ll> VLL;
typedef vector<int> VI;
const int block_size = 320;
typedef complex<ll> point;
const ll mod = 1e9 + 7;
const ll inf = 1e9 + 7;
const ld eps = 1e-9;
const db PI = atan(1) * 4;

template<typename T, typename S>inline bool upmin(T&a, const S&b) { return a > b ? a = b, 1 : 0; }
template<typename T, typename S>inline bool upmax(T&a, const S&b) { return a < b ? a = b, 1 : 0; }

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a%b); }
ll pow(ll a, ll b) {
	if (b == 0) {
		return 1;
	}
	if (b == 1) {
		return a;
	}
	ll ans = pow(a, b / 2);
	ans *= ans;
	ans *= b % 2 == 1 ? a : 1;
	return ans;
}

namespace SOLVE {
	struct edge {
		ll from, to, weight;
	};

	struct vertex {
		ll distance = 1e15, no;
	};

	struct compareVertex {
		bool operator() (vertex const& p1, vertex const& p2) {
			return p1.distance > p2.distance;
		}
	};



	void main() {
		ll V, E, s, t1, t2, t3;
		cin >> V >> E >> s;

		vector<vector<edge> > edges(V + 5);
		REP(i, 0, E) {
			cin >> t1 >> t2 >> t3;
			edge e;
			e.from = t1;
			e.to = t2;
			e.weight = t3;
			edges[t1].push_back(e);
		}

		VLL ans(V + 5, 1e15);
		VLL finalised(V + 5, 0);

		priority_queue<vertex, vector<vertex>, compareVertex> pq;
		vertex start;
		start.distance = 0;
		start.no = s;
		pq.push(start);
		

		while (sz(pq)) {
			vertex top = pq.top();
			//cout << top.no << endl;
			pq.pop();

			if (finalised[top.no] == 1) {
				continue;
			}
			ans[top.no] = top.distance;
			finalised[top.no] = 1;

			for (edge e : edges[top.no]) {
				if (top.distance + e.weight < ans[e.to]) {
					vertex v;
					v.distance = top.distance + e.weight;
					v.no = e.to;
					pq.push(v);
				}
			}
		}

		REP(i, 0, V) {
			if (ans[i] == 1e15) {
				cout << "INF\n";
			}
			else {
				cout << ans[i] << endl;
			}
		}




	}
}


signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int t;
	//    in(t);
	t = 1;
	while (t--) {
		SOLVE::main();

	}

	return 0;
}


Measured memory_bytes: 27328
#include <algorithm>
#include <iostream>
#include <sstream>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <fstream>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <stack>
#include <map>
#include <set>
#if __cplusplus > 199711L
#include <unordered_set>
#include <unordered_map>
#include <tuple>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
//	tree<key, mapped = null_type, cmp = less<key>, rb_tree_tag, tree_order_statistics_node_update> name;
//	order_of_key
//	find_by_order
#endif

using namespace std;

#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fs first
#define sc second
#define abs(a) ((a) < 0 ? -(a) : (a))
#define sqr(a) ((a) * (a))

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

inline pair<pair<bool, bool>, string> useinout();

void init() {
#ifdef SOL
	if (useinout().fs.fs)
		freopen("input.txt", "r", stdin);
	if (useinout().fs.sc)
		freopen("output.txt", "w", stdout);
#else
	srand(time(0));
	const string file = useinout().sc;
	if (!file.empty()) {
		freopen((file + ".in").c_str(), "r", stdin);
		freopen((file + ".out").c_str(), "w", stdout);
	}
#endif
}

int solve();

void finish(int exitval) {
	fflush(stdout);
#ifdef SOL
	fprintf(stderr, "\nexit value: %d\ntime: %.3lf ms\n", exitval, 1000. * clock() / CLOCKS_PER_SEC);
#endif
}

int main() {
	init();
	int exitval = solve();
	finish(exitval);
	return (0);
}

const double eps = 1e-9;
const int mod = (int) 1e+9 + 7;
const double pi = acos(-1.);
const int maxn = 200100;

inline pair<pair<bool, bool>, string> useinout() {
	return (mp(mp(0, 0), ""));
}

set<int> st;
set<int>::iterator it, it1, it2;
pair<int, int> a[maxn];

int solve() {

	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i].fs);
		a[i].sc = i;
	}

	sort(&a[0], &a[n]);
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		st.insert(a[i].sc);
		it = st.lower_bound(a[i].sc);
		it1 = it;
		it2 = it;
		int lf = -1;
		if (it1 != st.begin()) {
			it1--;
			lf = *it1;
		}
		int rg = n;
		it2++;
		if (it2 != st.end()) {
			rg = *it2;
		}
		ans += a[i].fs * 1ll * (a[i].sc - lf) * (rg - a[i].sc);
	}

	printf("%lld", ans);

	return (0);
}

// by Andrey Kim


Measured memory_bytes: 11136
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::io::Write;

macro_rules! eprintln (
    ($($arg:tt)*) => { {
        let r = writeln!(&mut ::std::io::stderr(), $($arg)*);
        r.expect("failed printing to stderr");
    } }
);

fn main() {
    let n: usize = read();

    let mut d = vec![0; n];
    for i in 0..n {
        let e: u32 = read();
        d[i] = e;
    }

    d.sort();
    d.reverse();

    eprintln!("{:?}", d);

    let mut prev = 101;
    let ans = d.iter().fold(0, |sum, &x| {
        if prev > x {
            prev = x;
            sum + 1
        } else {
            prev = x;
            sum
        }
    });

    println!("{}", ans);
}



Measured memory_bytes: 4352
n, k = map(int, input().split())
a = {}
for i in [int(j) for j in input().split()]:
    if i in a:
        a[i] += 1
    else:
        a[i] = 1
if len(a) <= k:
    print(0)
else:
    print(sum(sorted(a.values())[:len(a) - k]))

Measured memory_bytes: 32264
#include <iostream>

using lint = long long;

int main() {
    lint N, A, B, C, D;
    std::cin >> N >> A >> B >> C >> D;

    lint diff = B - A;
    for (lint p = 0; p < N; ++p) {
        // p個を正に固定する
        lint min = C * p - D * (N - p - 1);
        lint max = D * p - C * (N - p - 1);
        if (min <= diff && diff <= max) {
            std::cout << "YES" << std::endl;
            return 0;
        }
    }

    std::cout << "NO" << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <bitset>
using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;

const double PI=3.14159265358979323846;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REP1(i, n) for(int i = 1; i <= (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())
#define ZERO(a) memset(a, 0, sizeof(a))

#define RAD(d) (PI * (d) / 180)
#define DEG(r) (180.0 * (r) / PI)

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

template<class T> void dump(const vector<T> &v)
{
	REP(i, SZ(v)-1){ cout << v[i] << " "; }
	cout << v[SZ(v)-1] << endl;
}

template<class T> void dump(int w, int h, const vector<T> &v)
{
	REP(j, h){
		REP(i, w-1){ cout << v[j * w + i] << " "; }
		cout << v[j * w + w-1] << endl;
	}
}

template<class T> T accumulate(const vector<T> &v)
{
	T sum = 0;
	REP(i, SZ(v)){ sum += v[i]; }
	return sum;
}

template<class T> struct Matrix
{
	T w, h;
	vector<T> A;
	Matrix(T w_, T h_) : w(w_), h(h_), A(w * h) {}
	T get(T x, T y) const { return A[y * w + x]; }
};

template<class T> void input(Matrix<T> &m)
{
	REP(j, m.h){
		REP(i, m.w){
			cin >> m.A[j * m.w + i];
		}
	}
}

template<class T> Matrix<T> prod(const Matrix<T> &a, const Matrix<T> &b)
{
	Matrix<T> m(b.w, a.h);

	REP(j, m.h){
		REP(i, m.w){
			ll c = 0;
			REP(k, a.w){
				c += a.A[j * a.w + k] * b.A[k * b.w + i];
			}
			m.A[j * m.w + i] = c;
		}
	}

	return m;
}

void dump(const Matrix<ll> &m)
{
	REP(j, m.h){
		REP(i, m.w-1){ printf("%lld ", m.A[j * m.w + i]); }
		printf("%lld\n", m.A[j * m.w + m.w-1]);
	}
}

void dump(const Matrix<double> &m)
{
	REP(j, m.h){
		REP(i, m.w-1){ printf("%f ", m.A[j * m.w + i]); }
		printf("%f\n", m.A[j * m.w + m.w-1]);
	}
}

string &to_upper(string &s)
{
	REP(i, s.length()){
		if('a' <= s[i] && s[i] <= 'z'){
			s[i] -= 32;
		}
	}

	return s;
}

string &to_lower(string &s)
{
	REP(i, s.length()){
		if('A' <= s[i] && s[i] <= 'Z'){
			s[i] += 32;
		}
	}

	return s;
}

int getACGT(const string &s, int offset)
{
	for(int i = offset; i < LEN(s); i++){
		char c = s[i];
		if(c != 'A' && c != 'C' && c != 'G' && c != 'T')
			return i - offset;
	}

	return LEN(s) - offset;
}

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

	int cnt = 0;
	REP1(i, N){
		if(LEN(to_string(i)) % 2 != 0)
			cnt++;
	}

	cout << cnt << endl;

	return 0;
}


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

l = [0] * (n)

for i in range(1, 101):
  for j in range(1, 101):
    for k in range(1, 101):
      t = (i ** 2) + (j ** 2) + (k ** 2) + (i * j) + (j * k) + (i * k)
      if t > n:
        break
      l[t-1] += 1
for i in range(n):
  print(l[i])

Measured memory_bytes: 69380
#include <bits/stdc++.h>
#define sz(c)      int(c.size())
#define rep(i,a,b) for (int i=a; i<(b); ++i)
#define per(i,a,b) for (int i=(b)-1; i>=(a); --i)
using namespace std;
using ll = long long;

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cout<<fixed<<setprecision(10);

	int N;
	cin>>N;
	vector<int> S(N);
	rep(i,0,N) cin>>S[i];
	
	ll res=0;
	for (int d=1; d*d<=N; ++d) {
		ll sum=0;
		for (int k=1; k*d<N-1; k++) {
			sum+=S[k*d]+S[N-1-k*d];
			int A=N-1-k*d;
			if (A>d && (A%d!=0 || k<A/d)) res=max(res,sum);
		}
	}

	cout<<res<<"\n";
}


Measured memory_bytes: 640
#include <iostream>

using namespace std;

int main() {
	int N, A[100],count=0;
	cin >> N;
	for (int i = 0;i < N;i++) { cin >> A[i]; }
	for (int i = 0;i < N;i++) {
		int minj = i;
		for (int j = i;j < N;j++) {
			if (A[j] < A[minj])
				minj = j;
		}
		if (minj != i) {
			int x = A[i];
			A[i] = A[minj];
			A[minj] = x;
			count++;
		}
	}

	for (int i = 0;i < N-1;i++) { cout << A[i] << " "; }
	cout << A[N - 1] << endl;
	cout << count << endl;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<long long> act[3];
  act[0].resize(n);
  act[1].resize(n);
  act[2].resize(n);
  for (int i = 0; i < n; i++)
    cin >> act[0][i] >> act[1][i] >> act[2][i];

  long long dp[n + 1][3];
  dp[0][0] = dp[0][1] = dp[0][2] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 3; j++) {
      dp[i][j] = 0;
      for (int k = 0; k < 3; k++) {
        if (j == k)
          continue;
        dp[i][j] = max(dp[i][j], dp[i - 1][k] + act[j][i - 1]);
      }
    }
  }
  cout << max(dp[n][0], max(dp[n][1], dp[n][2])) << endl;
  return 0;
}


Measured memory_bytes: 4992
def main():
    n, k = map(int, input().split())
    *x, = map(int, input().split())

    ans = 10 ** 9
    for i in range(n-k+1):
        if 0 <= x[i]:
            d = x[i+k-1]
        elif 0 <= x[i+k-1]:
            d = min(x[i+k-1] - 2 * x[i], 2 * x[i+k-1] - x[i])
        else:
            d = -x[i]
        ans = min(ans, d)
    print(ans)


main()


Measured memory_bytes: 14224
using System;
using System.Linq;

namespace A___Diagonal_String
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Enumerable.Repeat(0, 3).Select(_ => Console.ReadLine()).Aggregate((n, e) => n + e).ToArray();

            Console.WriteLine(str[0].ToString() + str[4].ToString() + str[8].ToString());
        }
    }
}


Measured memory_bytes: 13396
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll a,b;
	scanf("%lld%lld",&a,&b);
	printf("%lld",max(a*b,max(a+b,a-b)));
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define pii pair<ll,ll>
using namespace std;
typedef long long ll;
const ll modd=1000000007;
ll n,cnt_o,ans=1;
map<pii,ll> cnt_vec,vis;
vector<pii> v;
ll qpow(ll a,ll b) {
	ll ans=1,base=a;
	while(b) {
		if(b&1) ans=ans*base%modd;
		b>>=1,base=base*base%modd;
	}
	return ans;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1; i<=n; i++) {
		ll x,y;
		cin>>x>>y;
		ll gcd=__gcd(x,y);
		if(!gcd) cnt_o++;
		else {
			x/=gcd,y/=gcd;
			if(x<0) x*=-1,y*=-1;
			if(x==0&&y<0) y*=-1;
			cnt_vec[make_pair(x,y)]++;
			if(!vis[make_pair(x,y)])
				v.push_back(make_pair(x,y)),
							vis[make_pair(x,y)]=1;
		}
	}
	for(int i=0; i<v.size(); i++) {
		ll tx=v[i].first,ty=v[i].second;
		ll cur=qpow(2,cnt_vec[v[i]]);
		swap(tx,ty),ty=-ty;
		if(tx<0) tx*=-1,ty*=-1;
		if(tx==0&&ty<0) ty*=-1;
		if(cnt_vec[make_pair(tx,ty)]) {
			cur=(qpow(2,cnt_vec[v[i]])+qpow(2,cnt_vec[make_pair(tx,ty)])-1)%modd;
			cnt_vec[make_pair(tx,ty)]=cnt_vec[v[i]]=0;
		}
		ans=ans*cur%modd;
	}
	ans=(ans+cnt_o-1)%modd+modd;
	cout<<ans%modd;
	return 0;
}

Measured memory_bytes: 43848
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	while(a&&c)
	{
		a=max(0,a-d);
		c=max(0,c-b);
	}
	if(c)
		printf("No");
	else
		printf("Yes");
}

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

void getMaxHappy(int i,vector<vector<int>> &happy, vector<vector<int>> &dp){

    if(i == happy.size()){
        dp[i][0] = 0;
        dp[i][1] = 0;
        dp[i][2] = 0;
        return;
    }

    if(dp[i+1][0] == -1){
        getMaxHappy(i+1, happy, dp);
    }
    dp[i][0] = happy[i][0] + max(dp[i+1][1], dp[i+1][2]);
    dp[i][1] = happy[i][1] + max(dp[i+1][0], dp[i+1][2]);
    dp[i][2] = happy[i][2] + max(dp[i+1][0], dp[i+1][1]);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin >> n;
    vector<vector<int>> happy(n, {0,0,0});
    
    for (int i = 0; i < n; i++)
    {
        cin >> happy[i][0] >> happy[i][1] >> happy[i][2];
    }
    
    vector<vector<int>> dp(n+1, {-1,-1,-1});

    getMaxHappy(0, happy, dp);

    cout << max(max(dp[0][0], dp[0][1]), dp[0][2]) << endl;

    return 0;
}

Measured memory_bytes: 14336
#include<bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, d;
  cin >> n >> d;
  int store = 2*d+1;
  if(n%store==0) {
      cout<<n/store<<'\n';
  } else {
      cout<<n/store+1<<'\n';
  }
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<sstream>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<vector>
#include<string>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define mp make_pair
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define MOD 1000000007

int main(){
  int n;
  string s;
  cin >> s;
  n = s.size();
  int ans = 0;
  if(s[0]=='0'){
    for(int i = 0; i < n; i++){
      if(i%2==0&&s[i]=='1') ans++;
      if(i%2==1&&s[i]=='0') ans++;
    }
  }
  else if(s[0]=='1'){
    for(int i = 0; i < n; i++){
      if(i%2==0&&s[i]=='0') ans++;
      if(i%2==1&&s[i]=='1') ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1001001001
#define LINF 1001001001001001001
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

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

int main() {

    int N;
    cin >> N;
    vector<int> p(N);
    rep(i,N) {
        cin >> p[i];
        p[i]--;
    }
    
    vector<int> a(N, 0), b(N, 0);
    rep(i,N) {
        a[i] = 1 + i;
        b[i] = N - i;
    }
    rep(i,N) {
        rep(j,N) {
            if (j <= p[i]) b[j] += i;
            if (j >= p[i]) a[j] += i;
        }
    }
    rep(i,N) cout << a[i] << (i == N - 1 ? "\n" : " ");
    rep(i,N) cout << b[i] << (i == N - 1 ? "\n" : " ");

    return 0;
}

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

using namespace std;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")

#define fastIO               \
    ios::sync_with_stdio(0); \
    cin.tie(NULL);              \
    cout.tie(NULL);

#define int long long

#define el "\n"
#define sz(a) ((int)(a).size())
#define lh(a) ((int)(a).length())
#define all(v) (v).begin(), (v).end()
#define tr(c, it) for ((it) = (c).begin(); (it) != (c).end(); it++)
#define pt(v, val) ((v).find(val) != (v).end())      
#define vpt(v, val) (find(all(v), val) != (v).end()) 
#define lb(v,val) lower_bound(all(v),val)
#define ub(v,val) upper_bound(all(v),val)
#define fr(i,n) for (int i = 0; i < n; i++)
#define fr1(j,a,b) for(int j = a; j<b; j++) 
#define fb(i, a, b) for (int i = (b); i >= (a); i--)
#define fri(n) for(int i=0;i<n;) 

#define pb push_back
#define mp make_pair
#define in insert
#define ft first
#define sd second
#define lmi LLONG_MIN
#define lma LLONG_MAX
#define ulma ULLONG_MAX
#define rsort(v) (sort(all(v), greater<int>()))

#define cn \
    int n; \
    cin >> n
#define ii(a) \
   int a; \
   cin >> a
#define get(v) \
   vector<int> v; \
   fr(i,n){ \
   ii(x); \
   v.pb(x); \
   }

#define fia cin >> a[i]
#define foa cout << a[i] << " "
#define sg string

typedef vector<int>::iterator vit;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpii;
typedef set<int> si;
typedef set<char> sc;
typedef map<int,int> mii;
typedef map<char,int> mci;
typedef map<string,int> msi;
typedef pair<int, int> pii;
typedef stack<int> sti;
typedef stack<char> stc;

void solve()
{
    char c;
    cin>>c;
    if(c>=65 && c<=90)cout<<"A";
    else cout<<"a";
}
int32_t main(int32_t argc, char **argv)
{

fastIO;

int t=1;
//cin>>t;
while(t--) {
solve();
cout<<el;
}

cerr << "Time : " << ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";

return 0;
}

Measured memory_bytes: 3708
s = input()

flag=[0,0]

if 1<=int(s[0:2])<=12:
    flag[0]=1
if 1<=int(s[2:4])<=12:
    flag[1]=1

if flag==[0,0]:
    print("NA")
if flag==[1,0]:
    print("MMYY")
if flag==[0,1]:
    print("YYMM")
if flag==[1,1]:
    print("AMBIGUOUS")


Measured memory_bytes: 9100