akhauriyash/Code-Regression huggingface dataset:
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
*/

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*
//#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
ll k,a,b;
void solve(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>k>>a>>b;
  ll res=0;
  if(b-a>2&&k>=a-1){
    ll rest=(k-(a-1));
    res=a+(rest/2)*(b-a)+(rest%2);
  }else{
    res=k+1;
  }
  cout<<res<<endl;

}

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


Measured memory_bytes: 256
using System;

public class hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        Console.WriteLine(getAns(n));
    }
    static int getAns(int n)
    {
        var c = new int[] { 25, 10, 5, 1 };
        var ans = 0;
        foreach (var x in c)
        {
            var cc = n / x;
            ans += cc;
            n -= cc * x;
        }
        return ans;
    }
}



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

int main()
{
    ll n;
    cin >> n;
    ll ans = 1e18;
    for (ll i=1; i*i<=n;i++){
        if(n%i != 0) continue;
        ll j = n/i;
        ans = min(ans,j+i-2);
    }
    cout << ans << endl;
    
    return 0;
}

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

int MOD=1000000007;
int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}
////////////////////////////////////////////////////////////

signed main() {
  int n;
  cin>>n;
  vector<int>b(n+2);
  rep(i,n)cin>>b[i+1];
  int sum=0;
  rep(i,n+1){
    sum+=abs(b[i+1]-b[i]);
  }
  for(int i=1;i<=n;i++){
    int ans=0;
    ans=sum-abs(b[i]-b[i-1])-abs(b[i+1]-b[i])+abs(b[i+1]-b[i-1]);
    cout<<ans<<endl;
  }
}


Measured memory_bytes: 4048
N,K = list(map(int,input().split()))
A = input()
A = list(A)
A = list(map(int,A))
l = [0]
s = []

for i in range(N-1):
    if A[i] != A[i+1]:
        l.append(i+1)
        s.append(l[len(l)-1]-l[len(l)-2])
l.append(N)
s.append(l[len(l)-1]-l[len(l)-2])
a = 0
right = 0
left = 0
g = 0
su = 0
if A[0] == 0:
    for i in range(len(s)):
        su +=s[right]
        if right%2==0:
            g += 1
        right +=1
        if g<=K:
            a = max(a,su)
        else:
            while g>K:
              su -= s[left]
              if left%2==0:
                  g -=1
              left +=1
        a = max(a,su)
else:
    for i in range(len(s)):
        su +=s[right]
        if right%2==1:
            g += 1
        right +=1
        if g<=K:
            a = max(a,su)
        else:
            while g>K:
              su -= s[left]
              if left%2==1:
                  g -=1
              left +=1
        a = max(a,su)

print(a)

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

vector< vector<P> > solve(vector<ll> t){

  for(int i=1;i<(int)t.size();i++){
    t[i]+=t[i-1];
  }
  
  vector< vector<P> > res( t.size() );
  for(int i=1;i<(int)t.size();i++){
    ll x=t[i];
    ll ai=lower_bound(t.begin(),t.end(),x/2)-t.begin();

    

    for(ll j=ai-2;j<=ai+2;j++){
      if(j<0 || j>=i)continue;
      
      res[i].push_back( minmax(t[i]-t[j],t[j] ) );
    }

  }
  return res;
}

int main(){
  ll n;
  cin>>n;
  vector<ll> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }

  vector< vector<P> > la=solve(a);

  reverse(a.begin(),a.end());
  vector< vector<P> > ra=solve(a);
  reverse(ra.begin(),ra.end());

  ll ans=(1LL<<60);
  for(int i=1;i+2<(int)a.size();i++){
    //    cout<<endl;
    for(auto p:la[i]){
      //      cout<<p.first<<' '<<p.second<<endl;
      
      for(auto q:ra[i+1]){

        ll Min=min(p.first, q.first);
        ll Max=max(p.second, q.second);
        ans=min( ans, Max-Min );
      }
    }
  }

  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 69036
#include <bits/stdc++.h>
#include<vector>
using namespace std;
void dfs(int node,vector<int> adj[],bool vis[],int dp[]){
    vis[node] = true;
    int n2=adj[node].size();
    for(int i=0;i<n2;i++){
        if(!vis[adj[node][i]]){
            dfs(adj[node][i],adj,vis,dp);
        }
        dp[node] = max(dp[node],1+dp[adj[node][i]]);
    }
}
int foundlongest(vector<int> adj[],int n){
    int dp[n+1];
     memset(dp, 0, sizeof dp); 
     bool vis[n + 1]; 
    memset(vis, false, sizeof vis);
    for(int i=1;i<=n;i++) {
        if(!vis[i]){
            dfs(i,adj,vis,dp);
        }
    }
    int ans = 0; 
  
    // Traverse and find the maximum of all dp[i] 
    for (int i = 1; i <= n; i++) { 
        ans = max(ans, dp[i]); 
    } 
    return ans;
}


void addedge(vector<int> adj[],int src,int dest){
    adj[src].push_back(dest);
}
int main() {
    int n;cin>>n;
    int m;cin>>m;
    vector<int> adj[n+1];
    for(int i=1;i<=m;i++){
        int d1,d2;cin>>d1>>d2;
        addedge(adj,d1,d2);
    }
    cout<<foundlongest(adj,n);
}


Measured memory_bytes: 9600
def func(u,v):
    f=lambda x,y:(v[0]-u[0])*(y-u[1])-(v[1]-u[1])*(x-u[0])
    return f

while True:
    n=input()
    if n==0:break
    L=[map(float,raw_input().split(",")) for i in range(n)]
    L.sort()
    S=[]
    init=L[0]
    for i in range(n):
        if L[i]!=init:
            f=func(init,L[i])
            for j in range(i+1,n):
                if f(L[j][0],L[j][1])>0:
                    break
            else:
                S.append(L[i])
                init=L[i]
    init=L[0]
    for i in range(n):
        if L[i]!=init:
            f=func(init,L[i])
            for j in range(i+1,n):
                if f(L[j][0],L[j][1])<0:
                    break
            else:
                S.append(L[i])
                init=L[i]
    print n-len(set(map(tuple,S)))-1

Measured memory_bytes: 4308
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

vector<ll> prod(const vector<ll> &a, const vector<ll> &b){
  vector<ll> ret(4);
  ret[0] = a[0]*b[0]-a[1]*b[1]-a[2]*b[2]-a[3]*b[3];
  ret[1] = a[0]*b[1]+a[1]*b[0]+a[2]*b[3]-a[3]*b[2];
  ret[2] = a[0]*b[2]-a[1]*b[3]+a[2]*b[0]+a[3]*b[1];
  ret[3] = a[0]*b[3]+a[1]*b[2]-a[2]*b[1]+a[3]*b[0];
  return ret;
}

int main(){
  int n;
  while(cin >> n, n){
    for(int i = 0; i < n; ++i){
      vector<ll> a(4), b(4);
      for(int i = 0; i < 4; ++i) cin >> a[i];
      for(int i = 0; i < 4; ++i) cin >> b[i];
      vector<ll> ans = prod(a,b);
      cout << ans[0];
      for(int i = 1; i < 4; ++i)  cout << " " << ans[i];
      cout << endl;
    }
  }
}



Measured memory_bytes: 3108
#include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	int H,W;
	while(true){
		scanf("%d %d",&H,&W);
		if(H == 0 && W == 0) break;
		for(int i = 0; i < H; i++){
			for(int j = 0; j < W; j++){
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}
}

Measured memory_bytes: 1000
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    double r=0.0;
    pair<int,int> p;

    for(int i=0;i*a*100<=f;i++){
        for(int j=0;i*a*100+j*b*100<=f;j++){
            if(i==0&&j==0){
                continue;
            }
            int w=i*a*100+j*b*100;
            for(int k=0;w+k*c<=f;k++){
                for(int l=0;w+k*c+l*d<=f;l++){
                    int s=k*c+l*d;
                    double m=(double)s/(w+s);
                    if(m<=(double)e/(100+e)&&m>=r){
                        p.first=w+s;
                        p.second=s;
                        r=m;
                    }
                }
            }
        }
    }
    cout<<p.first<<" "<<p.second<<endl;
}


Measured memory_bytes: 256
def main():
    card_num = int(input())
    cards = list(map(int, input().split()))
    
    res = " ".join([str(n) for n in cards])
    print(res)
    
    for i in range(1, card_num):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j + 1] = cards[j]
            j -= 1
        cards[j + 1] = v
        
        res = " ".join([str(n) for n in cards])
        print(res)

if __name__ == '__main__':
    main()
    


Measured memory_bytes: 5608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll h,w;
    cin >> h >> w;
    if(h == 1 || w == 1)
        cout << "1" << endl;
    else
        cout << (h*w+1)/2 << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int m = sc.nextInt();

      
      System.out.println(comb(n) + comb(m));
  }

  private static long comb(int a) {
    return a * (a-1) / 2;
  }
}

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

int main() {
  int n;
  cin >> n;
  rep(i,n) {
    char c;
    cin >> c;
    if (c == 'Y') {
      cout << "Four" << endl;
      return 0;
    }
  }
  cout << "Three" << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int maxn = 1005;
int main()
{
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n,a[25],b[25],c[25],ans=0;
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=1;i<=n;i++) cin>>b[i];
	for(int i=1;i<=n-1;i++) cin>>c[i];
	for(int i=0;i<n;i++)
	{
		if(i==0) ans+=b[a[i]];
		else
		{
			ans+=b[a[i]];
			if(a[i]==a[i-1]+1) ans+=c[a[i]-1];
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;

const int N = 300004;
int cnth[N], cntw[N], x[N], y[N];
map <int, bool> mp[N];

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int h, w, m;
    cin >> h >> w >> m;
    for (int i = 0; i < m; i++) {
        cin >> x[i] >> y[i];
        mp[x[i]][y[i]] = true;
        cnth[x[i]]++, cntw[y[i]]++;
    }
    int mxh = 0, mxw = 0;
    for (int i = 0; i < N; i++) {
        mxh = max(mxh, cnth[i]);
        mxw = max(mxw, cntw[i]);
    }
    vector <int> hall, wall;
    for (int i = 0; i < N; i++) {
        if (cnth[i] == mxh) {
            hall.push_back(i);
        }
        if (cntw[i] == mxw) {
            wall.push_back(i);
        }
    }
    int cnt = 0, mx = 0;
    for (int i = 0; i < hall.size(); i++) {
        for (int j = 0; j < wall.size(); j++) {
            cnt++;
            if (cnt > N * 2)
                break;
            mx = max(mx, mxh + mxw - mp[hall[i]][wall[j]]);
        }
        if (cnt > N * 2)
            break;
    }
    cout << mx;
}


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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n,x,y;
	cin >> n >> x >> y;
	x--,y--;
	vector<vector<int>> ad(n);
	for(int i=1;i<n;i++){
		int a,b;
		cin >> a >> b;
		a--,b--;
		ad[a].push_back(b);
		ad[b].push_back(a);
	}
	
	vector<int> dist(n);
	function<void(int,int,int)> dfs=[&](int cur,int par,int di){
		for(int ch:ad[cur]){
			if(ch==par) continue;
			dfs(ch,cur,di+1);
		}
		dist[cur]=di;
	};
	dfs(y,-1,0);
	
	vector<int> dist2(n);
	function<void(int,int,int)> dfs2=[&](int cur,int par,int di){
		for(int ch:ad[cur]){
			if(ch==par) continue;
			dfs2(ch,cur,di+1);
		}
		dist2[cur]=di;
	};
	dfs2(x,-1,0);
	int res=0;
	for(int i=0;i<n;i++){
		if(dist[i]<dist2[i]) continue;
		res=max(res,dist[i]);
	}
	cout << (res-1) << "\n";
	return 0;
}

Measured memory_bytes: 14208
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		List<Integer> answers = new ArrayList<Integer>();
		for(;;){
			String line = scan.nextLine();
			String[] div = line.split("\\s");
			int a = Integer.parseInt(div[0]);
			String op = div[1];
			int b = Integer.parseInt(div[2]);
			if(op.equals("?")){
				break;
			}
			int ans = 0;
			switch(op){
				case "+" :
					ans = a + b;
					answers.add(ans);
					break;
				case "-" :
					ans = a - b;
					answers.add(ans);
					break;
				case "*" :
					ans = a * b;
					answers.add(ans);
					break;
				case "/" :
					ans = a / b;
					answers.add(ans);
					break;
				default :
					break;
			}
		}

		for(int n : answers){
			System.out.println(n);
		}
		
	}
}

Measured memory_bytes: 26224
const Main = (input) => {
var dataArray = input.split(' ');
  var a = Number(dataArray[0]);
  var b = Number(dataArray[1]);
  if( a == b ){
  	console.log('Yes');
  } else {
    console.log('No');
}
}


Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;



int binary_search(int* A,int key,int n) {
	int left = 0;
	int right = n;
	int mid;
	while (left < right) {
		mid = (left + right) / 2;
		if (A[mid] == key) return 1;
		else if (A[mid] > key) {
			right = mid;
		}
		else {
			left = mid + 1;
		}
	}



	return 0;
}

int main() {

	//int a[] = { 1,2,3 };
	//cout << *a  << endl;

	int n;
	int A[100000 + 1];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	int q,key;
	int sum = 0;
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> key;
		if (binary_search(A, key,n)) {
			sum++;
		}
	}
	cout << sum << endl;
	//cout<<binary_search()
	return 0;
}


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

int main(){
	int n;
	string s;
	
	int cnt = 0;
	cin >> n >> s;
	for (int i = 0; i < n-2; i++){
		if(s.at(i) == 'A' && s.at(i+1) == 'B' && s.at(i+2) == 'C')
			cnt++;
	}
	cout << cnt << endl;
}

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

using namespace std;

int main() {

  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;

  if (sx >= tx && sy >= ty) {
    for (int i = 0; i < sx - tx; ++i)
      printf("L");
    for (int i = 0; i < sy - ty; ++i)
      printf("D");
    for (int i = 0; i < sx - tx; ++i)
      printf("R");
    for (int i = 0; i < sy - ty + 1; ++i)
      printf("U");
    for (int i = 0; i < sx - tx + 1; ++i)
      printf("L");
    for (int i = 0; i < sy - ty + 1; ++i)
      printf("D");
    printf("R");
    printf("D");
    for (int i = 0; i < sx - tx + 1; ++i)
      printf("R");
    for (int i = 0; i < sy - ty + 1; ++i)
      printf("U");
    printf("L");
  }
  if (sx < tx && sy >= ty) {
    for (int i = 0; i < -(sx - ty); ++i)
      printf("R");
    for (int i = 0; i < sy - ty; ++i)
      printf("D");
    for (int i = 0; i < -(sx - tx); ++i)
      printf("L");
    for (int i = 0; i < sy - ty + 1; ++i)
      printf("U");
    for (int i = 0; i < -(sx - tx) + 1; ++i)
      printf("R");
    for (int i = 0; i < sy - ty + 1; ++i)
      printf("D");
    printf("L");
    printf("D");
    for (int i = 0; i < -(sx - tx) + 1; ++i)
      printf("L");
    for (int i = 0; i < sy - ty + 1; ++i)
      printf("U");
    printf("R");
  }
  if (sx >= tx && sy < ty) {
    for (int i = 0; i < sx - tx; ++i)
      printf("L");
    for (int i = 0; i < -(sy - ty); ++i)
      printf("U");
    for (int i = 0; i < sx - tx; ++i)
      printf("R");
    for (int i = 0; i < -(sy - ty) + 1; ++i)
      printf("D");
    for (int i = 0; i < sx - tx + 1; ++i)
      printf("L");
    for (int i = 0; i < -(sy - ty) + 1; ++i)
      printf("U");
    printf("R");
    printf("U");
    for (int i = 0; i < sx - tx + 1; ++i)
      printf("R");
    for (int i = 0; i < -(sy - ty) + 1; ++i)
      printf("D");
    printf("L");
  }
  if (sx < tx && sy < ty) {
    for (int i = 0; i < -(sx - tx); ++i)
      printf("R");
    for (int i = 0; i < -(sy - ty); ++i)
      printf("U");
    for (int i = 0; i < -(sx - tx); ++i)
      printf("L");
    for (int i = 0; i < -(sy - ty) + 1; ++i)
      printf("D");
    for (int i = 0; i < -(sx - tx) + 1; ++i)
      printf("R");
    for (int i = 0; i < -(sy - ty) + 1; ++i)
      printf("U");
    printf("L");
    printf("U");
    for (int i = 0; i < -(sx - tx) + 1; ++i)
      printf("L");
    for (int i = 0; i < -(sy - ty) + 1; ++i)
      printf("D");
    printf("R");
  }
  return 0;
}


Measured memory_bytes: 888
#pragma GCC optimize("Ofast")   //Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  foo(i,a,n)     for(ll i = (a); i <= n; i++)
#define  frr(i,a,n)     for(ll i = (a); i >= n; i--)
#define  fo(i,n)        for(ll i = 0; i < n; i++)
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  newl           cout<<"\n"
#define  pb             push_back
#define  mp             make_pair
#define  s              second
#define  f              first
#define  dline          cerr<<"///REACHED///\n";
#define  deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define  deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define  deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   MAXN  =  1e+5+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

//<<-----Declare Variable Here------->>//
int t=1;
ll n;
ll a[MAXN];
//<<-----Implement Functions Here---->>//


//<<-----Start of Main--------------->>//
void MAIN(){
		cin>>n;
		for(ll i=1;i*i<=n;i++)
		{
			for(ll j=1;j*j<=n;j++)
			{
				for(ll k=1;k*k<=n;k++)
				{
					ll val = i*i+j*j+k*k+i*j+j*k+k*i;
					a[val]++;
				}
			}
		}
		for(ll i=1;i<=n;i++)cout<<a[i]<<endl;
}

int main(){
	fastio;randomINIT;

	//cin>>t;
	while(t--){
		MAIN();
	}

    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}

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

int main()
 {  ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
	//int t; 
      //  cin>>t;
        //while(t--){
          int n,max=0;
          cin>>n;
          string s[n];
  
		unordered_map<string,int>m;
          for(int i=0;i<n;i++){
              cin>>s[i];
              m[s[i]]++;
              int f = m[s[i]];
              if(max<f) max = f;
          }
          sort(s,s+n);
          for(int i=0;i<n;i++){
              if(max==m[s[i]]){
                  cout<<s[i]<<"\n";
                  m[s[i]] = 0;
              }
          }
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)

using namespace std;
using ll = long long;

constexpr int MOD = 1000000007;

class mint {
  int n;
public:
  mint(int n_ = 0) : n(n_) {}
  explicit operator int() { return n; }
  friend mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
  friend mint operator+(mint a, mint b) { int x = a.n + b.n; return x - (x >= MOD) * MOD; }
  friend mint operator-(mint a, mint b) { int x = a.n - b.n; return x + (x < 0) * MOD; }
  friend mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
  friend mint &operator+=(mint &a, mint b) { return a = a + b; }
  friend mint &operator-=(mint &a, mint b) { return a = a - b; }
  friend mint &operator*=(mint &a, mint b) { return a = a * b; }
  friend bool operator==(mint a, mint b) { return a.n == b.n; }
  friend bool operator!=(mint a, mint b) { return a.n != b.n; }
  friend istream &operator>>(istream &i, mint &a) { return i >> a.n; }
  friend ostream &operator<<(ostream &o, mint a) { return o << a.n; }
};
mint operator "" _m(unsigned long long n) { return n; }

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int N; cin >> N;
  string S; cin >> S;
  int c = 0;
  mint ans = 1;
  int cnt = 0;
  for (char x : S) {
    if ((x == 'B') != (c % 2)) {
      c++;
      cnt++;
    } else {
      ans *= c--;
    }
  }
  if (cnt != N) ans = 0;
  rep(i, N) ans *= i+1;
  cout << ans << endl;
}

Measured memory_bytes: 720
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N, A, B, C, D = list(map(int, sys.stdin.readline().split()))


ok = False
# 何回前回より小さい数を書くか
for k in range(N):
    top = D * (N - 1 - k) - C * k
    bottom = C * (N - 1 - k) - D * k
    ok |= bottom <= B - A <= top
if ok:
    print('YES')
else:
    print('NO')



Measured memory_bytes: 13608
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll n;
  string s;
  cin >> n >> s;
  ll ans = 0;
  for(ll i = 0; i < n; i++) {
  	ans++;
  	char x = s[i];
  	ll j = i;
  	while(j < n and s[j] == x) j++;
  	i = j-1;
  }
  cout << ans << endl;
  return 0;
} //good night.

Measured memory_bytes: 512
#include<iostream>

using namespace std;

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

	for (int i = 1; i < 10;i++) {
		for (int j = 1;j < 10;j++) {
			if (i * j == N) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}

	cout << "No" << endl;
}

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


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

    bool exist[1000001] = {};

    int ai = s, ans = 1;
    while (exist[ai] == false) {
        exist[ai] = true;
        if (ai % 2 == 0) {
            ai = ai / 2;
        } else {
            ai = 3 * ai + 1;
        }
        ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4572
{-# LANGUAGE BangPatterns #-}

import Control.Monad
import Data.List
import Data.Bits
import Debug.Trace
import Data.Maybe
import qualified Data.ByteString.Char8 as C

main :: IO ()
main = do
  [a, b] <- readInts
  print $ solve a b

solve a b = if a < 10 && b < 10 then a * b else -1

-- 以下ライブラリ

readInts :: IO [Int]
readInts = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

readNInts :: Int -> IO [[Int]]
readNInts = flip replicateM readInts

readIntegers :: IO [Integer]
readIntegers = map (fst . fromJust . C.readInteger) . C.words <$> C.getLine

readNIntegers :: Int -> IO [[Integer]]
readNIntegers = flip replicateM readIntegers

getNLns :: Int -> IO [String]
getNLns = flip replicateM getLine

Measured memory_bytes: 380
#include<bits/stdc++.h> 
typedef double ll;
#define pb push_back
#define MP make_pair

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    int x=0;
     for(int i=0;i<n-1;i++)
    {
        if(a[i]==a[i+1])
        {
            x=1;
            break;
        }
    }
    if(x==1)
    cout<<"NO";
    else
    cout<<"YES";
   
    

    
     
    
     return 0;
}


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

constexpr int inf = 0x3f3f3f3f;
constexpr ll linf = 0x3f3f3f3f3f3f3f3fLL;

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

    int a, b, c; cin >> a >> b >> c;
    cout << a + b + c - max({a, b, c}) << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))

A1sum = [0]
for a in A1:
    A1sum.append(A1sum[-1]+a)
A1sum = A1sum[1:]

A2.reverse()
A2sum = [0]
for a in A2:
    A2sum.append(A2sum[-1]+a)
A2sum = A2sum[1:]

ans = 0
for i in range(N):
    ans = max(ans, A1sum[i] + A2sum[N-i-1])

print(ans)


Measured memory_bytes: 3064
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <iomanip>       // fixed, setprecision
using namespace std;

int main()
{
  int N;
  string S, T, out = "";
  cin >> N >> S >> T;
  for (int i = 0; i < S.length(); i++)
  {
    out += S[i];
    out += T[i];
  }
  cout << out << endl;
}


Measured memory_bytes: 3104
#include <iostream>
using namespace std;
int zyou(int a,int b){
    int c=1;
    for(int i=0;i<b;i++){
        c*=a;
      }
      return c;
}
int main(void){
    int a=1;
    int x;
    cin>>x;
    for(int i=1;i<31;i++){
        for(int j=1;j<9;j++){
            int y=zyou(i+1,j+1);
            if(y<=x){
                a=max(a,y);
            }
        }
    }
    cout<<a<<endl;
}


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

#define REP(i,n) for(ll i = 0;i < n;++i)
#define PB(s) push_back(s)
#define ST(n) sort(n.begin(),n.end())

using namespace std;
typedef long long ll;

int main(){
  int N,L;
  ll ans=0;
  cin >> N >> L;
  int L2 = L;
  bool zeroflag = 0;
  
  REP(i,N){
    ans+=L;
    L++;
  }
  int X = 1000;
  int sign=1;
  REP(i,N){
    L=L2;
    int ANS2=0;
    REP(j,N){
      if(i==j){L++;continue;}
        ANS2+=L;
        L++;
    }
    if( X > abs(ans-ANS2) )
      X = abs(ans-ANS2);
      if(0 > ans-ANS2)
        sign = 1;
        else sign = -1;
  }
      
  cout << ans + (sign*X) << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fr(i, n) for (ll i = 0; i < n; i++)
#define frab(i, a, b) for (ll i = a; i < b; i++)
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef long double ld;

const ll INF = 2e9 + 10;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-9;
const ll N = 4e6 + 1;

int a[N];

int main() {
    //freopen("a.in", "r", stdin);
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    bitset <N> b;
    b[0] = 1;
    fr(i, n) {
        cin >> a[i];
        b |= (b << a[i]);
    }
    ll s = accumulate(a, a + n, 0);
    for (int i = (s + 1) / 2; i <= s; i++)
        if (b[i]) {
            cout << i;
            return 0;
        }
}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<map>
#include<iomanip>
#include<tuple>
#include<bitset>


using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define printfloat(x) cout << fixed << setprecision(7) << (x) << endl;
#define printbit(x) cout << bitset<15>(x) << endl;
using ll = long long int;



long double pi = 3.14159265359;

int k;
int ans,an,cnt;

int f(int an){
    return an*10 + 7;
}

int main(){
    cin >> k;
    an = 7;
    if(an%k == 0){
        cout << 1 << endl;
        return 0;
    }
    while(an!=0 && cnt<10000000){
        cnt ++;
        an = f(an)%k;
        // cout << an << endl;
    }
    if(cnt == 10000000){
        ans = -1;
    }
    else ans = cnt+1 ;
    cout << ans << endl;
return 0;
}

Measured memory_bytes: 3636
using System;

namespace AGC010A
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            var target = Console.ReadLine().Split(' ');
            int[] x = new int[N];
            int count = 0; 
            for(int i=0;i<N;i++) {
                x[i] = int.Parse(target[i]);
                if(x[i] % 2 == 1) count++;
            }
            if(count % 2 == 0){
               Console.WriteLine("YES");
            } else {
               Console.WriteLine("NO");
            }
        }
    }
}


Measured memory_bytes: 20448
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    //入力・初期化
    int A,B,K;
    cin >> A>>B>>K;

    //処理
    //出力
    for(int i=A;i<=B;i++){
        if(A+K<=i && i<=B-K){
            continue;
        }
        else{
            cout<<i<<"\n";
        }
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	long n;
	long long c, k;
	cin >> n >> c >> k;
	vector<long long>l;
	for (long i = 0; i < n; i++){
		long long a; cin >> a;
		l.push_back(a);
	}
	sort(l.begin(), l.end());
	long long num = 1; //bus need
	long long v = l[0];//
	long long y = 1;   //people in bus
	for (long i = 1; i < n; i++){
		if (l[i] > v + k || y == c) {
			num++;
			v = l[i];
			y = 1;
		}
		else y++;
	}
	cout << num << endl;
} 

Measured memory_bytes: 1400
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	cc := make([]int, n)

	for i := 0; i < n; i++ {
		a := getNextInt(scanner)
		cc[a]++
	}
	ans := 1
	for i := 0; i < n; i++ {
		if cc[i] > 2 {
			ans = 0
			break
		}
		if i == 0 && cc[i] >= 2 {
			ans = 0
			break
		}
		if cc[i] > 0 && i%2 == n%2 {
			ans = 0
			break
		}
		if i%2 == n%2 {
			continue
		}
		ans *= cc[i]
		ans %= int(1e9 + 7)
	}
	fmt.Fprintln(writer, ans)
	writer.Flush()
}


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

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

    int n;
    cin >> n;

    int ac = 0, wa = 0, tle = 0, re = 0;

    for(int i = 0; i < n; i++)
    {
        string s;
        cin >> s;

        if(s == "AC")
        {
            ac++;
        }

        if(s == "WA")
        {
            wa++;
        }

        if(s == "TLE")
        {
            tle++;
        }

        if(s == "RE")
        {
            re++;
        }
    }

    cout << "AC x " << ac << "\nWA x " << wa << "\nTLE x " << tle << "\nRE x " << re << endl;
}



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

using namespace std;

const uint64_t MOD = 1e+9 + 7;

class ModuloOps
{
private:
  std::vector<uint64_t> _fact, _fact_inv;

  void _calc_fact(uint64_t n)
  {
    for (uint64_t i = 2; i <= n; ++i) {
      _fact[i] = (_fact[i - 1] * i) % MOD;
      _fact_inv[i] = inv(_fact[i]);
    }
  }

public:
  ModuloOps(uint64_t n)
  {
    _fact = std::vector<uint64_t>(n + 1);
    _fact_inv = std::vector<uint64_t>(n + 1);

    _fact[0] = 1;
    _fact[1] = 1;
    _fact_inv[0] = 1;
    _fact_inv[1] = 1;

    _calc_fact(n);
  }

  uint64_t power(uint64_t x, uint64_t y) const
  {
    if (y <= 1) {
      return (y == 0) ? 1 : (x % MOD);
    }

    uint64_t w = power(x, y >> 1);
    uint64_t z = (w * w) % MOD;

    if (y % 2 == 1) {
      z = (x * z) % MOD;
    }

    return z;
  }

  uint64_t inv(uint64_t n) const { return power(n, MOD - 2); } 

  uint64_t fact(uint64_t n) const { return _fact[n]; }
  uint64_t fact_inv(uint64_t n) const { return _fact_inv[n]; }

  uint64_t perm(uint64_t n, uint64_t k) const {
    return (_fact[n] * _fact_inv[n - k]) % MOD;
  }

  uint64_t comb(uint64_t n, uint64_t k) const {
    return (perm(n, k) * _fact_inv[k]) % MOD;
  }

  uint64_t prem_rep(uint64_t k, uint64_t l) const
  {
    uint64_t x = _fact[k + l];
    x = (x * _fact_inv[k]) % MOD;
    x = (x * _fact_inv[l]) % MOD;
    return x;
  }

  uint64_t prem_rep(const std::vector<uint64_t> &a) const
  {
    uint64_t n = std::accumulate(a.begin(), a.end(), 0);
    uint64_t x = _fact[n];
    for (uint64_t y : a) {
      x = (x * _fact_inv[y]) % MOD;
    }
    return x;
  }

  uint64_t comb_rep(uint64_t n, uint64_t k) const {
    return comb(n + k - 1, k);
  }
};

int main()
{
  uint64_t N, K;
  cin >> N >> K;
  
  ModuloOps mod_ops((N + K) << 1);
  
  for (uint64_t i = 1; i <= K; ++i) {
    if (i <= (N - K + 1)) {
      cout << ((mod_ops.comb(K - 1, i - 1) * mod_ops.comb(N - K + 1, i)) % MOD) << endl;
    } else {
      cout << 0 << endl;
    }
  }
  
  return 0;
}

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

int N;

int w[110];

int sum1,sum2;

int ans;


int inf=10000000;

int main()
{
    cin >> N;

    rep(i,N)cin >> w[i];


    rep(i,N-1)
    {
        for(int j=0;j<=i;j++)
        {
            sum1+=w[j];
        }
        for(int j=i+1;j<N;j++)
        {
            sum2+=w[j];
        }

        ans=abs(sum1-sum2);

        if(inf>ans)
        {
            inf=ans;
        }

        sum1=sum2=0;

    }

    cout << inf << endl;

    return 0;    
}

Measured memory_bytes: 256
/* ex3_3
   urah  */

#include <stdio.h>

int main(void){
    int N, K;
    int count = 1;   // 何桁かを数えていく変数

    // 入力の受け取り
    scanf("%d\t%d", &N, &K);

    // ループを利用して数えていく
    while (N >= K){
        N = N/K;
        count++;
    }

    // 結果の出力
    printf("%d\n", count);

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <utility>
#include <tuple>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <functional>
#include <climits>
#include <numeric>
#include <queue>
#include <cmath>
#include <iomanip>
#include <array>
#include <string>
#include <stack>
#include <cassert>
#include <memory>
#include <random>
#include <fstream>
#include <cfloat>
#include <complex>


struct Range {
	int from, to;
	bool operator<(const Range other) const {
		return to == other.to ? from < other.from : to < other.to;
	}
};
int main() {
	int height, width; std::cin >> height >> width;
	std::vector<Range> block(height);
	for (auto& b : block) {
		std::cin >> b.from >> b.to;
	}
	const auto comparator = [](const std::pair<int, Range> a, const std::pair<int, Range> b) {return a.first > b.first; };
	std::priority_queue<std::pair<int, Range>, std::vector<std::pair<int, Range>>, decltype(comparator)> queue(comparator);
	std::set<Range> cell;
	for (auto i = 1; i <= width; ++i) {
		cell.insert(Range{ i, i });
		queue.emplace(0, Range{ i, i });
	}
	for (auto h = 0; h < height; ++h) {
		int last = 0;
		for (auto iter = cell.lower_bound(Range{ 0, block[h].from }); iter != cell.end() && iter->to <= block[h].to;) {
			last = iter->from;
			iter = cell.erase(iter);
		}
		if (last != 0 && block[h].to < width) {
			cell.insert(Range{ last, block[h].to + 1 });
			queue.emplace(block[h].to + 1 - last, Range{ last, block[h].to + 1 });
		}
		while (!queue.empty() && cell.find(queue.top().second) == cell.end()) {
			queue.pop();
		}
		if (queue.empty()) {
			std::cout << "-1\n";
		}
		else {
			std::cout << (h + 1 + queue.top().first) << '\n';
		}
	}
}

Measured memory_bytes: 20252
#include <iostream>
#include <string>
#include <algorithm>
#include <cassert>
#include <set>
#include <vector>
#include <cmath>
#include <bitset>
#include <functional>
#include <limits>
#include <map>
using namespace std;

typedef long long ll;
#define rep1(i, n) for(ll i = 1; i <=(ll)(n); i++)
#define rep0(i, n) for(ll i = 0; i <=(ll)(n); i++)
#define mul_mod(multiplicand, multiplier, mod) ((multiplicand*(multiplier % mod)) % mod)

void mul1(ll *product, ll *idx, ll a, ll *taken){
    ll mod = 1e9 + 7;
    *product = mul_mod(*product, a, mod);
    *idx -= 1;
    *taken += 1;
}

void mul2(ll *product,ll *idx,ll a,ll b,ll *taken){
    ll mod = 1e9 + 7;
    *product = mul_mod(*product, a*b, mod);
    *idx -= 2;
    *taken += 2;
}

int main(){
    ll n,k;
    ll mod = 1e9 + 7;
    cin >> n >> k;
    vector<ll> pos;
    vector<ll> neg;
    rep1(i,n){
        ll tmp;
        cin >> tmp;
        if(tmp >= 0) pos.push_back(tmp);
        else neg.push_back(abs(tmp));
    }
    int pos_len = pos.size();
    int neg_len = neg.size();
    sort(pos.begin(), pos.end());
    sort(neg.begin(), neg.end());
    ll product = 1;

    //obvious case
    if(neg_len == n){ //minus case
        if(k%2 == 1){
            rep0(i,k-1) product = mul_mod(product,neg[i],mod);
            product = (-product + mod) % mod;
            cout << product << endl;
            return 0;
        }
    }
    if(n == k){
        rep0(i, pos_len-1) product = mul_mod(product,pos[i],mod);
        rep0(i, neg_len-1) product = mul_mod(product,neg[i],mod);
        if(neg_len%2 == 1){
            product = (-product + mod) % mod;
        } 
        cout << product << endl;
        return 0;
    }

    //not obvious case
    ll pos_idx = pos_len - 1;
    ll neg_idx = neg_len - 1;
    ll taken = 0;
    while(taken < k){
        if(taken == 0 && (k % 2 == 1)){
            mul1(&product, &pos_idx, pos[pos_idx], &taken);
            continue;
        }
        if(pos_idx < 0){
            mul2(&product, &neg_idx, neg[neg_idx],neg[neg_idx-1], &taken);
        }else if(neg_idx <= 0){
            mul1(&product, &pos_idx, pos[pos_idx],&taken);
        }else if(pos_idx == 0){
            if(taken == k-1) mul1(&product, &pos_idx, pos[pos_idx], &taken);    
            else mul2(&product, &neg_idx, neg[neg_idx],neg[neg_idx-1], &taken);
        }else{
            if(taken == k-1){
                mul1(&product, &pos_idx, pos[pos_idx], &taken);
                continue;
            }
            ll pos_product = pos[pos_idx]*pos[pos_idx-1];
            ll neg_product = neg[neg_idx]*neg[neg_idx-1];
            if(pos_product > neg_product){
                mul2(&product, &pos_idx, pos[pos_idx],pos[pos_idx-1], &taken);
            }else{
                mul2(&product, &neg_idx, neg[neg_idx],neg[neg_idx-1], &taken);
            }
        }    
    }
    cout << product << endl;
    return 0;
}

/*
7 3
-1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000 -1000000000
5 3
0 0 0 0 0

955784937
*/

Measured memory_bytes: 5052
#include<stdio.h>
int main()
{
  int a,b,c;

  scanf("%d %d %d",&a,&b,&c);

  if(a < b && b < c)
    {
      printf("Yes\n");
    }
  else
    {
      printf("No\n");
    }
  
      return 0;
}

Measured memory_bytes: 1740
n = int(input())
Taro = 0
Hanako = 0
for i in range(n):
    t,h = input().split()
    if t < h:
        Hanako += 3
    elif t == h:
        Taro += 1
        Hanako += 1
    else:
        Taro += 3
print(Taro,Hanako)




Measured memory_bytes: 5596
import java.util.*;

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n;
		n = scan.nextInt();
		
		//?????????????????¨??????
		List<Integer> list = new ArrayList<Integer>();
		//n??????????????????n?????????????????\??????
		for(int count = 0; count<n;count++){
			list.add(scan.nextInt());
		}
		//??\??????????????????????????????????????????
		for(;0<=(n-1);n--){
			sb.append(list.get(n-1));
			if((n-1) != 0){
			sb.append(" ");
			}
		}
		System.out.println(new String(sb));		
		
		
		
		
	}
}

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

using namespace std;

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

		for (int i = 10; i <= 1000; i++) {
				int tax8 = i * 0.08;
				int tax10 = i * 0.10;
				if (tax8 == A && tax10 == B) {
						cout << i << endl;
						return 0;
				}
		}
		cout << -1 << endl;
}


Measured memory_bytes: 768
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-12;
const LL INF = 1e18;


int main(){
	double v;
	while(cin>>v){
		if(v<=0.0+EPS){
			cout<<1<<endl;
			continue;
		}
		double t=v/9.8;
		double y=4.9*t*t;
		int N=(int)ceil(y)/5+1+(((int)ceil(y)%5!=0)?1:0);
		cout<<N<<endl;
	}
	return 0;
}
/*

*/

Measured memory_bytes: 1228
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
	int a,b,c;
	int sum=0;
	for(int i=0;i<3;i++)
	{
		scanf("%d",&a);
		sum=sum*10+a;
	}
	if(sum%4==0)
	printf("YES\n");
	else
	printf("NO\n");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define boost ios_base::sync_with_stdio(false), cin.tie(NULL);

using namespace std;
const int N = 4e5 + 44;
const int X[] = {1,0,-1,0,1,-1,1,-1};
const int Y[] = {0,1,0,-1,1,1,-1,-1};
const int mod = 1e9 + 7;
const long long INF = 1e18;
const int inf = 1e9;

int main () {
	boost;
	int n, a = 0;
	cin >> n;
	for (int i = 1 ; i <= n ; i += 2) {
		++a;
	}
	double ans = a;
	ans /= n;
	cout << fixed << setprecision (6);
	cout << ans;
}

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

using namespace std;

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

	int ans = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] != t[i]) {
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3916
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
    int x, n; cin >> x >> n;
    if(n==0){
        cout << x << endl;
        return 0;
    }   
    vector<int> p(n);
    rep(i, n) cin >> p.at(i);


    sort(p.begin(), p.end());
    rep(i, n){
        if(x==p.at(i)){
            break;
        }
        
        if(i==n-1){
            cout << x << endl;
            return 0;
        }
    }

    int ans = 100000;
    int id = -1;
    for(int i=0; i<=101; i++){
        bool ng = false;
        rep(j, n){
            if(p.at(j)==i){
                ng = true;
                break;
            }
        }
        if(ng) continue;

        if(ans>abs(x-i)){
            ans = min(ans, abs(x-i)); 
            id = i;
        }
    }

    cout << id << endl;
    return 0;
}


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

int64_t gcd(int64_t a, int64_t b)
{
  return b == 0 ? a : gcd(b, a % b);
}

int main()
{
  int64_t a, b;
  cin >> a >> b;
  int64_t d = gcd(a, b);
  int64_t ans = 1;
  int64_t i = 2;
  while (i * i <= d) {
    if (d % i == 0) {
      ans++;
      while (d % i == 0) {
        d /= i;
      }
    }
    i++;
  }
  if (d > 1) ans++;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <iomanip>
 
#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>
 
#include <algorithm>
#include <numeric>
#include <random>
 
#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
 
using namespace std;
 
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define sz(a) static_cast<int>((a).size())
#define endl '\n'
 
using ll = long long;
 
const ll INF = static_cast<ll>(1e9) + 7;
const int MAXN = static_cast<int>(1e5) + 17;
 
int n, k;
 
bool read() {
    if (!(cin >> n))
        return false;
 
    return true;
}
 
void solve() {
    string s;
 
    while (n != 0) {
        if (abs(n) % 2 == 1) {
            if (sz(s) % 2 == 0)
                --n;
            else
                ++n;
 
            s += "1";
        } else {
            s += "0";
        }
 
        n /= 2;
    }
 
    reverse(s.begin(), s.end());
  
    if (s.empty())
        cout << "0\n";
    else
        cout << s << endl;
}
 
int main() {
    cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::mt19937 rand('S' + 'E' + 'R' + 'E' + 'Z' + 'H' + 'K' + 'A');
 
    while (read())
        solve();
 
    return 0;
}

Measured memory_bytes: 256