akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <queue>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
bool pairCompareSecond(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.second < secondElof.second;
}
#define MAX_N 100100
#define MOD 1000000007
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
// 四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

void  base_num(ll data,ll base){
    if(data==0) return;
    ll next=abs(data)%abs(base);
    if(data<0) next=(abs(base)-next)%abs(base);
    base_num((data-next)/base,base);
    cout << next;
}


int main(){
    ll n,m;
    cin >> n >> m;
    vector<pair<ll,ll>> p;
    for (ll i=0;i<n;i++){
        ll a,b;
        cin >> a >> b;
        p.push_back(make_pair(a,b));
    }
    sort(p.begin(),p.end(),pairCompare);
    ll c=0,ans=0,i=0;
    while(c<m){
        ll x=p[i].first,y=p[i].second;
        if (y+c<m){
            ans+=x*y;
            c+=y;
        }else{
            ans+=x*(m-c);
            c=m;
        }
        i++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2420
#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 <math.h>
using namespace std;
#define int long long

// abどちらが大きくてもいけるよ
signed gcd(int a,int b){
    return b ? gcd(b, a % b) : a;
}

// 使う時はgcdも呼び出してあげよう
signed ngcd(vector<int> a){
    int res = a.at(0);
    for(int i = 1;i < a.size() && res != 1;i ++){
        res = gcd(res,a.at(i));
    }

    return res;
}


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

    int N,X; cin >> N >> X;
    vector<int> x(N);

    for(int i = 0;i < N;i ++){
        cin >> x.at(i);
        x.at(i) -= X;
    }

    int d = abs(ngcd(x));

    cout << d << endl;
}





Measured memory_bytes: 1792
from collections import deque
s = deque(input())
Q = int(input())
count = 0
for i in range(Q):
    q = input().split()
    if int(q[0]) == 1:
        count += 1
    else:
        f, c = int(q[1]), q[2]
        if (count%2==0 and f==1) or (count%2==1 and f==2):
            s.appendleft(c)
        else:
            s.append(c)
if count%2==1:
    s.reverse()
print("".join(s))

Measured memory_bytes: 75224
import sys
read = sys.stdin.buffer.read
input = sys.stdin.readline
#input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')

#2335

def main():
	n = 10**5+10
	primes = set(range(2, n+1))
	for i in range(2, int(n**0.5+1)):
		primes.difference_update(range(i*2, n+1, i))

	li=set()
	for i in primes:
		li.add(i)
		if i*2<n:
			li.add(i*2)
	li=list(li)
	li.sort()
	#print(li)

	li2=[0]*(n)
	for i in range(len(li)-1):
		if li[i]%2==1 and li[i+1]==li[i]+1:
			li2[li[i]]=1
	#print(li2)

	for i in range(n-1):
		li2[i+1]+=li2[i]
	#print(li2)

	q=II()
	for _ in range(q):
		l,r=MI()
		print(li2[r]-li2[l-1])





if __name__ == "__main__":
	main()

Measured memory_bytes: 14404
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='C'){
			for(int j=i+1;j<s.size();j++){
				if(s[j]=='F'){
					cout<<"Yes"<<endl;
					return 0;
				}
			}
		}
	}
	cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std; 
int main() {
    string a; cin >> a;
    int ans=0;
    if (a.size()%2==0){
        for (int i=0;i<a.size()/2;i++){
            if (a[i]!=a[a.size()/2+a.size()/2-i-1]) ans++;
        }
    }
    else{
        for (int i=0;i<a.size()/2;i++){
            if (a[i]!=a[(a.size()/2+1)+((a.size()/2+1)-i)-2]) ans++;
        }

    }
    cout << ans << "\n";
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int main() {
    int N, L[2000];
    cin >> N;
    REP(i, N) cin >> L[i];
    sort(L, L + N);
    ll ans = 0;
    RFOR(i, N - 1, 1) RFOR(j, i - 1, 0) {
        int rest = L[i] - L[j] + 1;
        auto it = lower_bound(L, L + j, rest);
        int ind = it - L;
        ans += j - ind;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n,d = map(int,input().split())
x = [list(map(int,input().split())) for hoge in range(n)]
y = x
count = 0
tmp = 0
for i in range(n):
         for j in range(n):
                  for k in range(d):
                           tmp += (x[i][k] - y[j][k]) ** 2
                  if (tmp ** (1/2)).is_integer():
                           count += 1
                           tmp = 0
                  else:
                           tmp = 0
print((count-n)//2)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
 
using namespace std;
 
#define REP(i, a, b) for(int i = (a), i##end = (b); i <= i##end; ++ i)
#define CLR(i, a) memset(i, a, sizeof(i))
#define REPD(i, a, b) for(int i = (a), i##end = (b); i >= i##end; -- i)
#define REPG(i, x) for(int i = head[x], v; i; i = edge[i].next)

typedef long long LL;
typedef double DB;
 
#define pc putchar
#define gc getchar
#define endl '\n'
inline LL rd() {	
	char ch = gc(); LL ret = 0, sgn = 1;
	while(ch < '0' || ch >'9') {
		if(ch == '-') sgn = -1;
		ch = gc();
	}
	while(ch >= '0' && ch <= '9')
		ret = ret * 10 + ch - '0', ch = gc();
	return ret * sgn;
}
 
inline void out(LL x) {
	static int buf[50], btp;
	if(x < 0) x = -x, pc('-');
	if(!x) pc('0');
	else {
		btp = 0;
		for(; x; x /= 10) buf[++ btp] = x % 10;
		while(btp) pc('0' + buf[btp --]);
	}
}
 
DB _BEGIN;
#define LOG(x) cerr << #x << ":" << x << endl
#define DBG(...) fprintf(stderr, __VA_ARGS__)
#define OK DBG("Passing [%s] in LINE %d...\n", __FUNCTION__, __LINE__)
#define _TIME (int((clock() - _BEGIN) / (DB)CLOCKS_PER_SEC * 1000))

/**************************************/

const int N = 400 + 3;

int head[N], cnt;
struct qwq { int v, next; } edge[(210 * 210) << 1];
inline void add(int x, int y) {
	edge[++ cnt] = (qwq) { y, head[x] }, head[x] = cnt;
}
int lft[N], rt[N], lsz, rsz;
const int M = 1e7 + 2;
bool isnotp[M + 1];
int tot, p[700000], vis[N], tim, opn[N], n, a[N];
inline void Sieve() {
	isnotp[1] = 1;
	REP(i, 2, M) {
		if(!isnotp[i]) p[++ tot] = i;
		REP(j, 1, tot) {
			if((LL)i * p[j] > M) break;
			isnotp[i * p[j]] = 1;
			if(i % p[j] == 0) break;
		}
	}
}

int Aug(int x) {
	// LOG(x);
	REPG(i, x) if(vis[(v = edge[i].v)] != tim) { 
		vis[v] = tim;
		if(!opn[v] || Aug(opn[v])) {
			opn[x] = v, opn[v] = x;
			return 1;
		}
	}
	return 0;
}

int main() {
#ifdef LOCAL
	freopen("light_example_2.in", "r", stdin);
#endif
	Sieve();
	// for(int T = rd(); T; -- T) {
		// cout<<T<<endl;
		n = rd();
		cnt = 0;
		
		lsz = rsz = 0;
		REP(i, 1, n) a[i] = rd();
		
		if(a[1] & 1) rt[++ rsz] = a[1];
		else lft[++ lsz] = a[1];
		REP(i, 2, n) {
			if(a[i - 1] != a[i] - 1) {
				if(a[i] & 1) rt[++ rsz] = a[i];
				else lft[++ lsz] = a[i];
			} 
			if(a[i - 1] + 1 != a[i]) {
				if((a[i - 1] + 1) & 1) rt[++ rsz] = a[i - 1] + 1;
				else lft[++ lsz] = a[i - 1] + 1;
			}
		}
		if((a[n] + 1) & 1) rt[++ rsz] = a[n] + 1;
		else lft[++ lsz] = a[n] + 1;

		REP(i, 1, lsz) {
			REP(j, 1, rsz) {
				int x = lft[i], y = rt[j];
				if(isnotp[abs(x - y)]) continue;
				if(abs(x - y) & 1) add(i, lsz + j), add(lsz + j, i);
			}
		}

		fill(vis + 1, vis + lsz + rsz + 1, 0);
		fill(opn + 1, opn + lsz + rsz + 1, 0);
		tim = 0;
		int ret = 0;
		REP(i, 1, lsz) if(!opn[i]) {
			++ tim;
			ret += Aug(i);
		}

		int ans = ret;
		ans += ((lsz - ret) / 2 + (rsz - ret) / 2) * 2;
		ans += ((rsz - ret) % 2) * 3;
		out(ans), pc(endl);
		fflush(stdout);

		fill(head + 1, head + lsz + rsz + 1, 0);
	// }

#ifdef LOCAL
	LOG(_TIME);
#endif	
	return 0;
}

Measured memory_bytes: 12800
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N, A, B = MAP()

ans = 0
for _ in range(N):
	t = INT()
	if t < A or B <= t:
		ans += 1

print(ans)


Measured memory_bytes: 10476
//解説　なんでこれが通って私のが弾かれるのかが分からない

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
  int n;
  cin >> n;
  int zero = 0;
  map<pair<ll,ll>,P> mp;
  rep(i,n) {
    ll x, y;
    cin >> x >> y;
    if (x == 0 && y == 0) {
      zero++;
      continue;
    }
    ll g = gcd(x,y);
    x /= g;
    y /= g;
    if (y < 0) x = -x, y = -y;
    if (y == 0 && x < 0) x = -x, y = -y;
    bool rot90 = (x <= 0);
    if (rot90) {
      ll tmp = x;
      x = y; y = -tmp;
    }
    if (rot90) mp[{x,y}].first++;
    else mp[{x,y}].second++;
  }

  mint ans = 1;
  for (auto p : mp) {
    int s = p.second.first;
    int t = p.second.second;
    mint now = 1;
    now += mint(2).pow(s) - 1;
    now += mint(2).pow(t) - 1;
    ans *= now;
  }
  ans -= 1;

  ans += zero;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 15944
from queue import Queue

N = int(input())

BLACK = -1
GRAY = 0
WHITE = 1
nodes = [GRAY] * N
nodes[0] = BLACK
neighbors = [[] for _ in range(N)]

for n in range(N-1):
    u, v, w = [int(i) for i in input().split()]
    neighbors[u-1].append((v-1, w))
    neighbors[v-1].append((u-1, w))


def bfs():
    q = Queue()
    q.put(0)
    while not q.empty():
        u = q.get()

        neiss = neighbors[u]
        for neis in neiss:
            v, w = neis
            if nodes[v] == GRAY:
                if w % 2 == 0:
                    nodes[v] = nodes[u]
                else:
                    nodes[v] = -nodes[u]
                q.put(v)


bfs()

for n in nodes:
    if n == BLACK:
        print(0)
    else:
        print(1)


Measured memory_bytes: 87708
#include<iostream>
#include<queue>
#include<vector>
using namespace std;

class Input {
public:
	int w, h;
	int data;
	vector<int> et[10000];	//i???j???????????????i*w + j??§??¨???
	
	bool input() {
		cin >> w >> h;
		if (!w) {
			return false;
		}
		
		for (int i = 0; i < 2 * h -1; i++) {
			for (int j = 0; j < w - (i%2==0); j++) {
				cin >> data;
				if (data != 0) {
					continue;
				}
				if (i%2 == 0) {
					et[i/2*w + j].push_back(i/2*w + j + 1);
					et[i/2*w + j + 1].push_back(i/2*w + j);
				}
				else {
					et[i/2*w + j].push_back(i/2*w + w + j);
					et[i/2*w + w + j].push_back(i/2*w + j);
				}
			}
		}
		return true;
	}
	void clear() {
		for (int i = 0; i < (w+1)*(h+1); i++) {
			et[i].clear();
		}
	}
};

class Solver : public Input {
public:
	int bfs(int st, int ed) {
		typedef pair<int, int> P;
		queue<P> que;
		int mincost[10000], INF = 100000;
		for (int i = 0; i < h * w; i++) {
			mincost[i] = INF;
		}
		
		que.push(P(0, st) );
		while(!que.empty() ) {
			P now = que.front();
			que.pop();
			int sc = now.first;
			int v = now.second;
			
			if (mincost[v] <= sc)
				continue;
			mincost[v] = sc;
			
			for (int i = 0; i < et[v].size(); i++) {
				if (mincost[et[v][i]] > sc + 1) {
					que.push(P(sc + 1, et[v][i]) );
				}
			}
		}
		
		/*for (int i = 0; i < h*w; i++) {
			cout << "mincost[" << i << "] = " << mincost[i ]<< endl;
		}*/
		return mincost[ed];
	}
	int solve() {
		int res = bfs(0, h*w-1);
		if (res >= 100000) {
			return 0;
		}
		return res + 1;
	}
}solver;

signed main() {
	while (solver.input() ) {
		int res = solver.solve();
		cout << res << endl;
		solver.clear();
	}
	return 0;
}

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

const int M=2e5+5;
char s[15];
int nn=1;
int vis[M*10];
map<int,int> nxt[M*10];


int main()
{
	int n; scanf("%d",&n);
	int ans=0;
	for(int i=0;i<n;i++)
	{
		scanf("%s",s);
		int m=strlen(s);
		int p=0;
		for(int i=0;i<m;i++)
		{
			if(!nxt[p].count(s[i]-'a'))
				nxt[p][s[i]-'a']=nn++;
			p=nxt[p][s[i]-'a'];
		}
		if(!vis[p])
			vis[p]=1,ans++;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 167104
while a = gets
  hit = 0; blow = 0
  a = a.split; b = gets.split
  4.times do |i|
    if a.include?(b[i])
      if a[i] == b[i]
        hit = hit + 1
      else blow = blow + 1
      end
    end
  end
  puts "#{hit} #{blow}"
end

Measured memory_bytes: 8664
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second

int main(){
    int N, K;
    cin >> N >> K;
    int num = 1;
    for(int i = 0; i < N; i++){
        if(num * 2 >= num + K) num += K;
        else num *= 2;
    }
    cout << num << endl;
}


Measured memory_bytes: 3644
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {
    int n,zah,x[100000],i,d,da,ans;
    scanf("%d %d",&n,&zah);
    for (i = 0;i < n;i++) {
        scanf("%d",&x[i]);
    }
    d = fabs(zah - x[0]);
    for (i = 1;i < n;i++) {
        da = fabs(zah - x[i]);
        if (d > da) d = da;
    }
    for (;;d--) {
        ans = 1;
        for (i = 0;i < n;i++) {
            if(zah % d != x[i] % d) {
                ans = 0;
                break;
            }
        }
        if (ans == 1) {
            printf("%d\n",d);
            exit(0);
        }
    }
    return 0;
}


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

int main() {
  char c,ans;
  cin >> c;
  ans = c+1;
  cout << ans << endl;
  return 0;
}

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

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int count[10][10];
    memset(count, 0, sizeof(count));
    for (int i = 1; i <= n; i++) {
        int last = i % 10;
        if (last == 0) {
            continue;
        }
        int first = to_string(i)[0] - '0';
        count[first][last]++;
    }
    int ans = 0;
    for (int i = 0; i < 10; i++) {
        for (int k = 0; k < 10; k++) {
            ans += count[i][k] * count[k][i];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<ctype.h>
#include<string>
using namespace std;
int main(){
	int N, a, s = 0;
	cin >> N;
	int L[N];
	for(int i = 0; i < N; i++){
		cin >> L[i];
	}
	int m = L[0];
	for(int i = 1; i < N; i++){
		if(L[i] > m){
			m = L[i];
		}
	}
	for(int i = 0; i < N; i++){
		if(L[i] == m){
			a = i;
		}
	}
	for(int i = 0; i < N; i++){
		if(i == a){
			continue;
		}
		else{
			s += L[i];
		}
	}
	if(m < s){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}

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

int N, H;
int max_a;
vector<int> B;

int main(void) {
	cin >> N >> H;
	B.resize(N);
	max_a = -1;
	for (int i = 0; i < N; ++i) {
		int a;
		cin >> a >> B[i];
		max_a = max(a, max_a);
	}
	sort(B.begin(), B.end(), greater<int>());

	int ans = 0;
	int rest = H;
	for (int i = 0; i < N; ++i) {
		if (B[i] <= max_a)
			break;
		rest -= B[i];
		++ans;
		if (rest <= 0)
			break;
	}
	if (rest > 0) {
		ans += rest / max_a;
		if (rest % max_a != 0)
			++ans;
	}

	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define INF 2147483647
#define INF_LL 9223372036854775807
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

int main() {
	vector<int> A(3);
	cin >> A[0] >> A[1] >> A[2];
	sort(A.begin(), A.end());
	cout << A[0] + A[1] << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
template<class T> static inline void chmax(T& a, T b) {if (a < b) { a = b; }}
int main() {
    int X; cin >> X;
    unsigned long long int ans = 1;
    bool t = false;
    for (int i = 2; i <= X; i++) {
        for (int j = 2; ; j++) {
            unsigned long long int tmp = pow(i, j);
            if (tmp > X) {
                t = true; break;
            }
            else chmax(ans, tmp);
        }
        if (t == true) {
            t = false; continue;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3972
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <cstdio>
using namespace std;
typedef long long ll;

int gcd(int a,int b){
    int t;
    while(b>0){
        t=b;
        b=a%b;
        a=t;
    }
    return a;
}

int lcm(int a,int b){
    return a*b/gcd(a,b);
}

int main(){
    ll a,b,c,d,e,k,l,m,n,o=0,p,q,r,x,y,z,max1=0,ans=0;
    string s,t,u;
    priority_queue<ll> pque;
    cin>>a>>s;
    
    
    if(a>=3200)cout<<s<<endl;
    else cout<<"red"<<endl;
}



Measured memory_bytes: 256
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define DEBUG(vec) for (auto v : vec) { cout << v << " "; } cout << endl;

using namespace std;

ull v[51] = {};

template <typename T>
ull comb(T n, T k) {
  assert(n >= k);
  ull r = 1;
  for (ull d = 1; d <= static_cast<ull>(k); ++d) {
    r *= n--;
    r /= d;
  }
  return r;
}

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

  ll N, A, B;
  cin >> N >> A >> B;
  REP(i, N) {
    cin >> v[i];
  }
  sort(v, v + N, greater<ull>());

  ull total = 0;
  REP(i, A) {
    total += v[i];
  }
  printf("%.10lf\n", (double)total / A);

  ll ln = 0;
  ll lc = 0;
  REP(i, N) {
    if (v[i] == v[A - 1]) {
      ln++;
      if (i < A) lc++;
    }
  }
  if (v[0] == v[A - 1]) {
    ull c = 0;
    for (ll i = A; i <= min(ln, B); i++) {
      c += comb(ln, i);
    }
    printf("%lu\n", c);
  } else {
    printf("%lu\n", comb(ln, lc));
  }
  return 0;
}


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

using namespace std;
using ll = long long;

#define rep(i, a) for (int (i) = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int (i) = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int (i) = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int (i) = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__ "Yes"
#define FALSE__ "No"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x

#ifdef LOCAL
	#define lcout(a) cout << a;
	#define lcoutln(a) cout << a << endl;
	#define lcerr(a) cerr << a;
	#define lcerrln(a) cerr << a << endl;
#else
	#define lcout(a) 
	#define lcoutln(a) 
	#define lcerr(a) 
	#define lcerrln(a) 
#endif

bool nin[10010];

int main()
{
	int N, K, T, U, V, L;
	cin >> N >> K >> T >> U >> V >> L;
	int Pend = 0;
	int ninjin = 0;
	int Vnow = U;
	double Tnow = 0;
	rep(i, N) {
		CIN(int, t);
		nin[t] = true;
	}
	rep(i, L) {
		if (Pend <= i) {
			Vnow = U;
		}
		if (nin[i]) {
			if (Vnow == U) {
				Vnow = V;
				Pend = i + V * T;
			} else if (ninjin < K) {
				ninjin++;
			} else {
				Pend = i + V * T;
			}
		} else if (ninjin && Vnow == U) {
			ninjin--;
			Vnow = V;
			Pend = i + V * T;
		}
		Tnow += (double) 1 / Vnow;
	}
	cout << fixed << setprecision(15) << Tnow << endl;
}


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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> pipii;
typedef pair<pii, int> piipi;
typedef pair<pii, pii> piipii;

#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define eb emplace_back

struct p{
    int p[200005];
    int root(int a){
        return p[a] == a?a:(p[a]=root(p[a]));
    }
    void merge(int a, int b){
        a = root(a), b = root(b);
        if(a != b) p[a] = b;
    }
}p1,p2;

map<pii, int> dp;
int main(){
    int n, k, l;
    scanf("%d%d%d", &n, &k, &l);
    for(int i=1;i<=n;i++){
        p1.p[i] = i;
        p2.p[i] = i;
    }
    for(int i=1;i<=k;i++){
        int p, q;
        scanf("%d%d", &p, &q);
        p1.merge(p, q);
    }
    for(int i=1;i<=l;i++){
        int p, q;
        scanf("%d%d", &p, &q);
        p2.merge(p, q);
    }
    for(int i=1;i<=n;i++){
        int r1 = p1.root(i);
        int r2 = p2.root(i);
        dp[mp(r1, r2)]++;
    }
    for(int i=1;i<=n;i++){
        int r1 = p1.root(i);
        int r2 = p2.root(i);
        printf("%lld ", dp[mp(r1, r2)]);
    }
}

Measured memory_bytes: 16736
import java.util.*;
import java.io.*;

public class Main {
    public static boolean isPalindrome(String s){
        int L = s.length();
        boolean ans = true;
        for(int l=0;l<L/2;l++){
        	if(s.charAt(l)!=s.charAt(L-1-l)) ans = false;
        }
        return ans;
    }
    public static int calculate(String given){
        int L = given.length();
        if(L<=1) return 0;
        int i=0;
        int j=L-1;
        int ans = 0;
        while(i<j){
        	if(given.charAt(i)==given.charAt(j)){
        	    i++;
        	    j--;
        	}
        	else if(given.charAt(i)=='x'){
                i++;
                ans++;
        	}
        	else{
        	    j--;
        	    ans++;
        	}
        	
        }
        return ans;
    }
    public static int solve(String given){
    	String copy = new String(given);
    	if(!isPalindrome(copy.replaceAll("x",""))) return -1;
    	return calculate(given);
    	
    }	
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String given = sc.next();
        System.out.println(solve(given));
    }
}

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

int main() {
  string s;
  cin >> s;
  ll dis=1, cnt=0;
  rep(i,s.size()) {
    if(s.at(i)=='W') {
      cnt += i+1-dis;
      dis++;
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 640
#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() {
   	string s;	
  	cin >> s;
  	for(int i = 1; i <= s.length(); i++){
    	if(i % 2 == 1){
        	cout << s[i-1];
        }
    }
  	cout << endl;
    return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  int a, b;
  cin >> a >> b;
  int c = a + b;
  if(c < 10){
    cout << c << endl;
  } else {
    cout << "error" << endl;
  }

  return 0;
}


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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;

  string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  string ans = "";
  rep(i, 0, sz(S)) { ans += s[((S[i] - 'A') + N) % sz(s)]; }
  put(ans);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

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

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

template <class A, size_t N, class T> void Fill(A (&arr)[N], const T& val) {
  std::fill((T*)arr, (T*)(arr + N), val);
}

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


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

int m, want_find[212][2], n, stars[1123][2];
bool found_flag = false;
int memo[2], ans[2];

int main(void) {
	while (true) {
		scanf("%d", &m);
		if (m == 0) { break; }
		for (int i = 0; i < m; ++i) { scanf("%d%d", &want_find[i][0], &want_find[i][1]); }
		scanf("%d", &n);
		for (int i = 0; i < n; ++i) { scanf("%d%d", &stars[i][0], &stars[i][1]); }

		for (int i = 1; i < m; ++i) {
			want_find[i][0] -= want_find[0][0];
			want_find[i][1] -= want_find[0][1];
		}
		memo[0] = want_find[0][0], memo[1] = want_find[0][1];
		want_find[0][0] = want_find[0][1] = 0;
		for (int i = 0; i < n; ++i) {
			for (int j = 1; j < m; ++j) {
				found_flag = false;
				for (int k = 0; k < n; ++k) {
					if (stars[i][0] + want_find[j][0] == stars[k][0] ||
						stars[i][1] + want_find[j][1] == stars[k][1]) {
						found_flag = true;
						break;
					}
				}
				if (found_flag == false) { break; }
			}
			if (found_flag == true) {
				ans[0] = stars[i][0] - memo[0];
				ans[1] = stars[i][1] - memo[1];
				break;
			}
		}
		printf("%d %d\n", ans[0], ans[1]);
	}
	return 0;
}

Measured memory_bytes: 2572
#include <iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
long long N;
  cin>>N;
  long long X[110];
  for (long long i=0; i<N; i++) cin>>X[i];
    long long dis=100000000000;
    for(long long i=-30; i<150; i++){
      long long t=0;
      for(long long j=0; j<N; j++){
         t+=pow(X[j]-i,2);
      }
      dis=min(t,dis);}
  cout<<dis<<endl;
}
        

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  cout << a.at(N-1)-a.at(0) << endl;
}

Measured memory_bytes: 256
import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

W, H, N = map(int, input().split())

grid = np.zeros((H, W), dtype=int)
for _ in range(N):
    x, y, a = map(int, input().split())

    if a == 1:
        grid[:, :x] = 1
    elif a == 2:
        grid[:, x:] = 1
    elif a == 3:
        grid[:y, :] = 1
    else:
        grid[y:, :] = 1

ans = H * W - np.count_nonzero(grid)
print(ans)


Measured memory_bytes: 12520
<?php

main();

function main() {
	while ($n = trim(fgets(STDIN))) {
		if (!$n) {
			break;
		}
		$count = partition4($n);
		echo "$count\n";
	}
}
function partition4($n) {
	$count = 0;
	for ($a = 0; $a <= 9; $a++) {
		for ($b = 0; $b <= 9; $b++) {
			for ($c = 0; $c <= 9; $c++) {
				for ($d = 0; $d <= 9; $d++) {
					$sum = $a + $b + $c + $d;
					if ($sum == $n ){
						$count++;
					}
					if ($sum > $n) {
						continue;
					}
				}
			}
		}
	}
	return $count;
}

Measured memory_bytes: 6612
using System;

class Program
{
    static void Main(string[] args)
    {
        int a = int.Parse(Console.ReadLine());
        int b = int.Parse(Console.ReadLine());
        int h = int.Parse(Console.ReadLine());
        int ans = (a + b) * h / 2;

        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 11092
#include <stdio.h>

int main(void)
{
	int n, m, x=0;
    scanf("%d%d", &n, &m);

    x += n * (n-1) / 2;
    x += m * (m-1) / 2;
  
	printf("%d\n", x);
  
	return 0;
}

Measured memory_bytes: 128
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        h: [i64; n],
    }

    let mut ans = 0;
    let mut cur = 0;

    for hi in h {
        if hi > cur {
            ans += hi - cur;
        }
        cur = hi;
    }

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


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair




int main() {
  int n;
  cin >> n;
  ll a, b;
  cin >> a >> b;
  vi p(n);
  vi i2x(n);
  rep (i, n) {
    cin >> p[i];
    i2x[p[i] - 1] = i;
    p[i] = 2 * p[i];
  }
 
  vll dp(n + 1, vl(2 * n + 2, INF));
  rep (i, 2 * n + 2) dp[0][i] = 0;
  rep (i, n) {
    int x = i2x[i];
    x = (x + 1) * 2;
    //DEBUG(x);
    rep (j, 2*n + 2) {
      if (dp[i][j] == INF) continue;
      if (j < x) {
        chmin(dp[i + 1][x], dp[i][j]);
        if (j % 2 == 1) {
          chmin(dp[i + 1][j], dp[i][j] + b);
        }
        else {
          chmin(dp[i + 1][j + 1], dp[i][j] + b);
        }
      }
      else {
        if (j % 2 == 1) {
          chmin(dp[i + 1][j], dp[i][j] + a);
        }
        else {
          chmin(dp[i + 1][j + 1], dp[i][j] + a);
        }
      }
    }
  }

  
  //DEBUG_MAT(dp);
  ll ans = INF;
  rep (i, 2 * n + 2) {
    chmin(ans, dp[n][i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 391296
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#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=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

// int main(){
// 	ll x,y;cin>>x>>y;
// 	ll ans;
// 	if (x <= y){
// 		ans = abs(y - x);
// 		if (x < 0 && abs(x) <= y){
// 			ans = min(ans,1 + y - abs(x));
// 		}
// 		else if (x < 0 && abs(x) > y){
// 			ans = min(ans,1 + abs(abs(y) - abs(x)));

// 		}
// 	}
// 	else{
// 			ans = 1 + abs(abs(y) -  abs(x));
// 			if(x * y > 0){
// 			ans = 2 + abs(abs(y) - abs(x));
// 		}
// 	}
// 	cout << ans << endl;
// 	return 0;
// }
ll copy(const ll x){return x;}
int main(){
	ll x,y;cin>>x>>y;
	ll ans = LINF;
	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < 2; j++) {
			ll a = copy(x);
			ll b = copy(y);
			if (i == 1)a *= -1;
			if (j == 1)b *= -1;
			if (a <= b)ans = min(ans,b - a + i + j);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
MOD = 10 ** 9 + 7
ans = 0

A = list(0 for _ in range(K + 1))
B = list(0 for _ in range(K + 1))

for i in range(1, K + 1):
    A[i] = pow((K // i), N, MOD)

for i in range(K, 0, -1):
    a = 0
    for j in range(i * 2, K + 1, i):
        a += B[j]
    B[i] = A[i] - a
    B[i] %= MOD

for i in range(K + 1):
    ans += B[i] * i % MOD
    ans %= MOD
                       
print(ans)

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

#define ll long long 

int main() {
    ios::sync_with_stdio(0); 

    double l; cin >> l;
    cout << fixed << setprecision(10) << (l/3) * (l/3) * (l/3) << endl;


    return 0; 
}



Measured memory_bytes: 3760
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <string.h>

using namespace std;
typedef pair<int, int> P;

void solve()
{
	int N, M, R;
	cin >> N >> M >> R;
	vector<int> r(R);
	for (int i = 0; i < R; ++i)
	{
		cin >> r[i];
	}
	vector< vector<int> > D(N, vector<int>(N));
	for (int i = 0; i < N; ++i)
	{
		for (int j = 0; j < N; ++j)
		{
			D[i][j] = 1e9;
		}
	}
	for (int i = 0; i < M; ++i)
	{
		int A, B, C;
		cin >> A >> B >> C;
		--A;
		--B;
		D[A][B] = min(D[A][B], C);
		D[B][A] = D[A][B];
	}
 	for (int k = 0; k < N; ++k)
	{
		for (int i = 0; i < N; ++i)
		{
			if (D[i][k] == 1e9)
			{
				continue;
			}
			for (int j = 0; j < N; ++j)
			{
				if (D[k][j] == 1e9)
				{
					continue;
				}
				D[i][j] = min(D[i][j], D[i][k] + D[k][j]);
			}
		}
	}
	int ans = 1e9;
	sort(r.begin(), r.end());
	do 
	{
		int temp = 0;
		int pos = r[0];
		for (int i = 1; i < R; ++i)
		{
			temp += D[pos - 1][r[i] - 1];
			pos = r[i];
		}
		ans = min(ans, temp);
	} while (next_permutation(r.begin(), r.end()));
	cout << ans << endl;
}

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

Measured memory_bytes: 384
using System;

namespace ABC046RockPaper
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int pcount = 0;
            foreach(char c in s)
            {
                if (c == 'p')
                    pcount++;
            }
            Console.WriteLine(s.Length / 2 - pcount);
        }
    }
}

Measured memory_bytes: 13280
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
ll fac(ll a) { return a > 1 ? fac(a - 1) * a : 1; }
bool echeck(ll a) { return a % 2 == 0 ? 1 : 0; }
ll comb(ll n, ll m){
  ll tmp = 1;
  for(int i = n; i >= n - m + 1; i--){
    tmp *= i;
  }
  ll temp = 1;
  for(int i = 1; i <= m; i++){
    temp *= i;
  }
  return tmp / temp;
}
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int>v(n);
  rep(i,n)cin >> v[i];
  int ans = INF;
  rep(i,n)ans = min(ans,v[i]);
  rep(i,n)if(ans == v[i]){
    cout << i + 1 << endl;
    return 0;
  }
  return 0;
} 


Measured memory_bytes: 3088
#include<bits/stdc++.h>
#define MIN -1000000
using namespace std;
typedef long long ll;
typedef pair <int,int> pii;
typedef pair<ll,ll> pll;
bool visited[100005];
const int max_N=1e5+10;
ll N,K,ans=0;
ll h[100005];
int main(void)
{
  cin >> N >> K;
  for(int i=0; i<N; i++){
    cin >> h[i];
  }
  sort(h,h+N);
  ll minimum=2e9;
  for(int i=0; i<N-K+1; i++){
    minimum = min(minimum, h[i+K-1]-h[i]);
  }
  cout << minimum << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, x;
    cin >> n >> x;
    vector<ll> A(n + 1);
    for(int i = 0; i < n; i++) cin >> A[i];
    vector<ll> B = A;
    for(int i = 0; i < n; i++) if(B[i] > x) B[i] = x;
    for(int i = 1; i < n; i++)
    {
        ll add = B[i] + B[i - 1];
        if(add > x)
        {
            ll d = add - x;
            B[i] -= d;
        }
    }
    ll ans = 0;
    for(int i = 0; i < n; i++)
    {
        ans += A[i] - B[i];
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 1792
n=int(input())
s=input()
x_list=[0]
for i in range(n):
	if s[i]=='I':
		x_list.append(x_list[i]+1)
	elif s[i] == 'D':
		x_list.append(x_list[i]-1)
x_list.sort()
print(x_list[-1])

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

using namespace std;

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

  double ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += (double)1 / a[i];
  }

  ans = (double)1 / ans;
  printf("%.6lf\n", ans);
  return 0;
}



Measured memory_bytes: 256
use std::cmp::*;
use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let a: Vec<u128> = (0..n)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();

    for i in 0..n {
        if a[i] == 0 {
            println!("0");
            return;
        }
    }

    let mut ans = 1;
    for i in 0..n {
        if ans * a[i] > 1000000000000000000 {
            println!("-1");
            return;
        }
        ans *= a[i];
    }
    println!("{}", ans);
}


Measured memory_bytes: 5508
import sys
raw_input = sys.stdin.readline
N,M = map(int,raw_input().split())
paths = [[] for x in range(N)]
inc = [0 for x in range(N)]
for i in range(M):
    a,b = map(int,raw_input().split())
    paths[a-1].append(b-1)
    inc[b-1] += 1
q = []
for i in range(N):
    if not inc[i]:
        q.append(i)
dp = [0 for x in range(N)]
while q:
    c = q.pop(0)
    for i in paths[c]:
        dp[i] = max(dp[i],dp[c]+1)
        inc[i] -= 1
        if not inc[i]:
            q.append(i)
print max(dp)

Measured memory_bytes: 45980
import heapq
n = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = 0
q = []
heapq.heappush(q, A[0]*-1)
for i in range(1, n):
    tmp = heapq.heappop(q)
    ans += tmp
    heapq.heappush(q, A[i] * -1)
    heapq.heappush(q, A[i] * -1)

print(ans*-1)

Measured memory_bytes: 105288
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <memory.h>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace std;

#define REP(i,n) for(int (i)=0; i<(int)(n); i++)

const int MAXN = 0;

int main(void) {
	int N;
	queue <long long> q;
	cin >> N;
	for(int i=1; i<10; i++) q.push(i);
	for(int i=1; i<N; i++) {
		long long tmp = q.front();
        q.pop();
        if (tmp%10 != 0) q.push(tmp*10+tmp%10-1);
		q.push(tmp*10+tmp%10);
        if (tmp%10 != 9) q.push(tmp*10+tmp%10+1);
	}
	cout << q.front() << endl;
	return 0;
}




Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include<functional>
#include <tuple>
#include <map>
#include<set>
#include <cmath>
#include <stack>
#include<cstdio>
#include<stdio.h>
using namespace std;

int main() {
	int a, b;
	string ans;
	cin >> a >> b;
	if (a > 0)ans = "Positive";
	else if (b < 0) {
		if ((abs(b - a) + 1) % 2 == 0)ans = "Positive";
		else ans = "Negative";
	}
	else ans = "Zero";
	cout << ans << endl;
}

Measured memory_bytes: 384