akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

int main(){
    int n;
    cin >> n;
    int a[n+1];
    int b[n];
    REP(i,n+1){
        cin >> a[i];
    }
    REP(i,n){
        cin >> b[i];
    }
    ll count = 0;
    REP(i,n){
        int num = min(b[i],a[i]);
        count += num;
        b[i] -= num;
        if(b[i]>0){
            int num = min(b[i],a[i+1]);
            count += num;
            a[i+1] -= num;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 1024
//----------------------------
#define FOR(i,j,n) for (int i=(j);i<(n);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define REPN(i,n) for (int i=(n);i>=0;i--)
#define I(n) scanf("%d", &(n))
#define LL(n) scanf("%lld", &(n))
#define pb(n) push_back((n))
#define mp(i,j) make_pair((i),(j))
#include <bits/stdc++.h>
using namespace std;

//------------------------------typedef集
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
typedef vector<vpi> vvpi;
typedef vector<vvi> vvvi;
typedef long long ll;

int n,m,cn,c,w;
vi l;
vpi balls;
ll ret;

int main(){
    I(n); I(m); I(cn);
    l.resize(cn);
    REP(i,cn) I(l[i]);
    balls.resize(n);
    REP(i,n){
        I(c); I(w);
        c--;
        balls[i] = mp(w,c);
    }
    sort(balls.begin(),balls.end(),greater<pi>());

    for (auto ball : balls){
        w = ball.first;
        c = ball.second;
        if (l[c]){
            ret += w;
            l[c]--;
            m--;
            if (!m) break;
        }
    }

    cout << ret << endl;
}



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

string name;

int check(string s)
{
    for(int i=1;i < s.length();++i) {
        for(int j=0;j < s.length();++j) {
            string get = "";
            for(int k=j;k < s.length();k += i) {
                get += s[k];
            }
            if (~get.find(name)) return 1;
        }
    }

    return 0;
}

int main()
{
    int n, cnt = 0;
    cin >> n;
    cin >> name;
    for(int i=0;i < n;++i) {
        string s;
        cin >> s;
        cnt += check(s);
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 1224
package main

import (
	"fmt"
)

func main() {
	l := make([]int, 5)
	var k int
	for i := range l {
		fmt.Scan(&l[i])
	}
	fmt.Scan(&k)
	for i := 0; i < 5; i++ {
		if l[i]-l[0] > k {
			fmt.Println(":(")
			return
		}
	}
	fmt.Println("Yay!")

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL mod = 1e9+7;
const int N = 45;
LL dp[N][1<<18];

int main()
{
    int n,x,y,z;
    while(cin >> n >> x >> y >> z)
    {
        memset(dp,0,sizeof(dp));
        dp[0][1] = 1;
        int ok = (1<<z);
        ok |= (1<<(y+z));
        ok |= (1<<(x+y+z));
        int mask = (1<<(x+y+z+1))-1;
        for(int i = 1; i <= n; ++i)
        {
            for(int j = 1; j <= mask; ++j)
            {
                for(int k = 1; k <= 10; ++k)
                {
                    int ns = ((j<<k)&mask)+1;
                    if((ns&ok) == ok) continue;
                    dp[i][ns] = (dp[i][ns]+dp[i-1][j])%mod;
                }
            }
        }
        LL ans = 1;
        for(int i = 1; i <= n; ++i)
            ans = ans*10%mod;
        for(int i = 0; i <= mask; ++i)
        {
            if((i&ok) == ok) continue;
            ans = ((ans-dp[n][i])%mod+mod)%mod;
        }
        cout << ans <<endl;
    }
    return 0;
}


Measured memory_bytes: 92416
#include <iostream>
#include <vector>

using namespace std;

#define M 1000000007

int main() {

	long long int n, m;
	cin >> n >> m;

	vector<long long int> x(n);
	vector<long long int> y(m);

	for (long long int i = 0; i < n; i++) {
		cin >> x[i];
	}

	for (long long int i = 0; i < m; i++) {
		cin >> y[i];
	}

	long long int xx, yy;
	xx = yy = 0;

	for (long long int i = 0; i < n; i++) {
		xx -= x[i] * (n - 1 - i);
		xx += x[i] * i;
		xx %= M;
	}

	for (long long int i = 0; i < m; i++) {
		yy -= y[i] * (m - 1 - i);
		yy += y[i] * i;
		yy %= M;
	}

	cout << (xx*yy) % M << endl;

	return 0;
}

Measured memory_bytes: 1792
import bisect

n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for bi in b:
    upper = bisect.bisect_left(a, bi)
    lower = n - bisect.bisect_right(c, bi)
    ans += upper * lower
print(ans)


Measured memory_bytes: 22720
n,a,b = map(int,input().split())
c = 0
for i in range(1,n+1):
    if i < 10:
        x = str(i)
        xsum = int(x[0])
        if xsum >= a and xsum <= b:
            c += i
    elif i < 100:
        x = str(i)
        xsum = int(x[0]) + int(x[1])
        if xsum >= a and xsum <= b:
            c += i
    elif i < 1000:
        x = str(i)
        xsum = int(x[0]) + int(x[1]) + int(x[2])
        if xsum >= a and xsum <= b:
            c += i
    elif i < 10000:
        x = str(i)
        xsum = int(x[0]) + int(x[1]) + int(x[2]) + int(x[3])
        if xsum >= a and xsum <= b:
            c += i
    else:
        x = str(i)
        xsum = int(x[0]) + int(x[1]) + int(x[2]) + int(x[3]) + int(x[4])
        if xsum >= a and xsum <= b:
            c += i
print(c)

Measured memory_bytes: 9140
#include<iostream>
#define MAX_N 45
int F[MAX_N];

int fib(int n){
   if(F[n]>0) return F[n];
   if(n==0 || n==1) return F[n]=1;
   return F[n]=fib(n-1)+fib(n-2);
}

int main(){
   int n;
   std::cin>> n;
   std::cout<< fib(n) << std::endl;
   return 0;
}

Measured memory_bytes: 3088
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner s = new Scanner(System.in);
	int a = s.nextInt();
	char[] op = s.next().toCharArray();
	int b = s.nextInt();

	while(op[0] != 63){
	    if(op[0] == 43) System.out.println(a+b);
	    else if(op[0] == 45) System.out.println(a-b);
	    else if(op[0] == 42) System.out.println(a*b);
	    else if(op[0] == 47) System.out.println(a/b);

	    a = s.nextInt();
	    op = s.next().toCharArray();
	    b = s.nextInt();
	}
    }
}



Measured memory_bytes: 26076
/*
Cerberus97
Hanit Banga
*/

#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

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

const int N = 2e5 + 10, B = 30;

int a[N], b[N];

int main() {
	fast_cin();
	int n; cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	for (int i = 1; i <= n; ++i) {
		cin >> b[i];
	}
	int ans = 0;
	for (int bit = 0; bit < B; ++bit) {
		vector<int> zero, one;
		int mask = (1 << bit) - 1;
		for (int i = 1; i <= n; ++i) {
			if (b[i] & (1 << bit)) {
				one.pb(b[i] & mask);
			} else {
				zero.pb(b[i] & mask);
			}
		}
		sort(zero.begin(), zero.end());
		sort(one.begin(), one.end());
		int temp = 0;
		for (int i = 1; i <= n; ++i) {
			int s = mask - (a[i] & mask);
			if (a[i] & (1 << bit)) {
				temp += upper_bound(zero.begin(), zero.end(), s) - zero.begin();
				temp += one.end() - upper_bound(one.begin(), one.end(), s);
			} else {
				temp += upper_bound(one.begin(), one.end(), s) - one.begin();
				temp += zero.end() - upper_bound(zero.begin(), zero.end(), s);
			}
		}
		if (temp & 1) {
			ans |= (1 << bit);
		}
	}
	cout << ans;
}

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

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

  string s;
  int ans = 1, lastLength = 1;
  cin >> s;
  for (int i = 1; i < s.size();)
    if (lastLength == 1 && s[i] == s[i - 1])
    {
      if (i == s.size() - 1)
        break;
      ans++;
      lastLength = 2;
      i += 2;
    }
    else
    {
      ans++;
      lastLength = 1;
      i++;
    }
  cout << ans << endl;
}


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

int main() {
  long long N, M;
  cin >> N >> M;
  long long ans = 0;
  ans += min(N, M/2);
  M -= 2*ans;
  if (M > 0) ans += M/4;
  cout << ans << endl;
}


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

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////
const ll inf = 1LL<<60;

int main()
{
  ll n,k; cin>>n>>k;
  vector<ll> a(k);
  rep(i, k) cin>>a[i];
  n--;

  while (true) {
    n++;
    string s = to_string(n);
    bool flg = true;
    for (auto c:s) {
      rep(i, k) if (c-'0' == a[i]) flg = false;
    }
    if (flg) {
      cout << n << endl;
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 3672
#include <cstdio>
#include <vector>
#include <string>
#include <utility>

int main() {
  int H, W;
  scanf("%d %d", &H, &W);

  std::vector<std::string> S(H);
  for (int i=0; i<H; ++i) {
    char buf[64];
    scanf("%s", buf);
    S[i] = std::move(buf);
  }

  for (int i=0; i<H; ++i) {
    for (int j=0; j<W; ++j) {
      if (S[i][j] == '#') continue;

      S[i][j] = '0';
      for (int di=-1; di<=1; ++di) {
        for (int dj=-1; dj<=1; ++dj) {
          int I=i+di, J=j+dj;
          if (!(0 <= I && I < H && 0 <= J && J < W))
            continue;

          if (S[I][J] == '#')
            ++S[i][j];
        }
      }
    }
  }

  for (int i=0; i<H; ++i)
    printf("%s\n", S[i].c_str());

  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<limits.h>
#define N 100
int G[N][N];

int main(){
  int n ,i ,j,k,ver,edg,fff;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d",&ver,&edg);
    for(j=0;j<edg;j++){
      scanf("%d",&fff);
      G[i][fff-1]=1;
    } 
  }
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
	printf("%d",G[i][j]);
      if(j<n-1)
	printf(" ");
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 636
#枚数と金額の取得
n, sum= gets.chomp.split(" ").map(&:to_i)
#合計金額に合う枚数があるか調べる
exit_flag = false
result = []
(0..n).each do |i|
  (0..n - i).each do |j|
    k = n - i - j
    if 10000 * i + 5000 * j + 1000 * k == sum
      result.push(i, j, k)
      exit_flag = true
      break
    end
  end
  if exit_flag
    break
  end
end

if result.size == 0
  puts "-1 -1 -1"
else
  puts result.join(" ")
end

Measured memory_bytes: 1788
#include <iostream>
#include <string>
 
using namespace std;
 
struct node {
    int data;
    struct node *next, *prev;
};
 
class list{
public:
    node *head, *tail;
    list():head(NULL),tail(NULL){};
    void insert(int x) {
        node *c = new node;
        c->data=x;
        c->prev=NULL;
        c->next = head;
        if(head==NULL) {
            head=tail=c;
        } else {
            head->prev=c;
            head=c;
        }
    }
    void deleteFirst() {
        node *c = head;
        head = head->next;
        if(head) head->prev=NULL;
        else tail=NULL;
        delete c;
    }
    void deleteLast() {
        node *c = tail;
        tail = tail->prev;
        if(tail) tail->next=NULL;
        else head=NULL;
        delete c;
    }
    void deletex(int x) {
        node *c;
        for(c=head; c!=NULL && c->data!=x; c=c->next);
        if(c==NULL) return;
        if(c->prev==NULL) deleteFirst();
        else if(c->next==NULL) deleteLast();
        else {
            c->prev->next = c->next;
            c->next->prev = c->prev;
            delete c;
        }
    }
};
 
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    string com;
    int x;
    list li;
    for(int i=0; i<n; i++) {
        cin>>com;
        if(com[0]=='i') {
            cin>>x;
            li.insert(x);
        } else if(com[6]=='F') {
            li.deleteFirst();
        } else if(com[6]=='L') {
            li.deleteLast();
        } else {
            cin>>x;
            li.deletex(x);
        }
    }
    bool first=true;
    for(node *c=li.head; c; c=c->next) {
        if(!first) cout<<' ';
        else first=false;
        cout<<c->data;
    }
    cout<<'\n';
    return 0;
}

Measured memory_bytes: 32464
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)


def main():
    s = S()
    l = len(s)
    a = []
    si = 0
    while si < l:
        if s[si] == 'A':
            a.append(1)
            si += 1
        elif s[si:si+2] == 'BC':
            a.append(2)
            si += 2
        else:
            a.append(0)
            si += 1

    r = 0
    t = 0
    for c in a:
        if c == 0:
            t = 0
        elif c == 1:
            t += 1
        else:
            r += t


    return r


print(main())



Measured memory_bytes: 7736
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.1415926535
#define MOD 1000000007
 
int main(){
  
  ll A,B,C,K;
  cin >> A >> B >> C >> K;
  
  ll ans = 0;
  if(A > K)  ans += K;
  else if(A + B > K)  ans += A;
  else  ans += A - (K -(A + B));
  
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 3632
using System;

class Fact
{
    public long CalcFact(int n)
    {
        long fact;
        if (n == 0)
        {
            fact = 1;
        }
        else
        {
            fact = n * CalcFact(n - 1);
        }

        return fact;
    }
}

class fact01
{
    public static void Main()
    {
        Fact f = new Fact();
        int n = int.Parse(Console.ReadLine());
        Console.WriteLine(f.CalcFact(n));
    }
}


Measured memory_bytes: 8944
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
 
typedef long long ll;
 
 
int main(){
	int n,m;
	cin >> n >> m;
	priority_queue<int> pq;
	for(int i=0;i<n;++i){
		int a;
		cin >> a;
		pq.push(a);
	}
	
	for(int i=0;i<m;++i){
		int tmp = pq.top();pq.pop();
		pq.push(tmp/2);
	}
	
	ll res = 0;
	while(!pq.empty()){
		res += pq.top();pq.pop();
	}
	
	cout <<res <<endl;
	
	return 0;
}



Measured memory_bytes: 892
#include <stdio.h>

int main()
{
	char s[10],t[10];
	int i=0,j=0;
	scanf("%s",s);
	while(s[i]!='\0'){
		if(s[i]=='0'){
			t[j++]='0';
		}else if(s[i]=='1'){
			t[j++]='1';
		}else{ if(j>0)
			j--;
		}
	i++;
	}
	t[j]='\0';	
	printf("%s\n",t);
}

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

using namespace std;

typedef long long ll;

inline ll read(){
    char ch=getchar();ll x=0,f=1;
    while(ch<'0' || ch>'9') {
       if(ch=='-') f=-1;
      	  ch=getchar();
    }
    while(ch<='9' && ch>='0') {
       x=x*10+ch-'0';
       ch=getchar();
    }
    return x*f;
}

const int M=998244353; 

struct node{
	int l,r;
	int add;
	ll sum;
	ll base;
}t[4040404];

ll res=1;

void build(int p,int l,int r){
	t[p].l=l;t[p].r=r;
	if(l==r){
		t[p].base=res;
		t[p].sum=t[p].base;
		res=(res*10)%M;
		return ;
	}
	int mid=l+r>>1;
	build(p*2+1,mid+1,r);
	build(p*2,l,mid);
	t[p].base=(t[p*2].base+t[p*2+1].base)%M;
	t[p].sum=(t[p*2].sum+t[p*2+1].sum)%M;
}

void update(int p){
	if(t[p].add){
		t[p*2].add=t[p].add;
		t[p*2+1].add=t[p].add;
		t[p*2].sum=(t[p*2].base*t[p].add)%M;
		t[p*2+1].sum=(t[p*2+1].base*t[p].add)%M;
		t[p].add=0;
	}
}

void change(int p,int l,int r,int x){
	if(l<=t[p].l && r>=t[p].r){
		t[p].sum=(t[p].base*x)%M;
		t[p].add=x;
		return ;
	}
	update(p);
	int mid=t[p].l+t[p].r>>1;
	if(l<=mid) change(p*2,l,r,x);
	if(r>mid) change(p*2+1,l,r,x);
	t[p].sum=(t[p*2].sum+t[p*2+1].sum)%M;
}

int main(){
	int n=read(),m=read();
	ll res=0;
	build(1,1,n);
	for(int i=1;i<=m;i++){
		int l=read(),r=read(),x=read();
		change(1,l,r,x);
		printf("%lld\n",t[1].sum);
	}
	return 0;
}


Measured memory_bytes: 20128
// answer is number of minimum increasing subsequence or, length of longest non-increasing subsequence
#include<bits/stdc++.h>
using namespace std;
const int MAX=2e5+100;
int main ()
{
    int N;cin >> N;
    multiset<int>S;
    for(int i=0;i<N;i++){
        int x;cin >> x;
        auto it = S.lower_bound(x);
        if(it==S.begin()){
                S.insert(x);
        }
        else{
            it--;
            S.erase(it);
            S.insert(x);
        }
    }
    cout<<S.size()<<endl;
    return 0;
}


Measured memory_bytes: 4992
#include <cstdio>
#include <queue>
using namespace std;

int main() {
    priority_queue<int> pq;
    int i, N, K, t, ans = 0;
    scanf("%d %d", &N, &K);
    for (i = 0; i < K; i++) {
        scanf("%d", &t);
        pq.push(t);
    }
    for (; i < N; i++) {
        scanf("%d", &t);
        if (t < pq.top()) {
            pq.push(t);
            pq.pop();
        }
    }
    while(!pq.empty()) {
        ans+= pq.top();
        pq.pop();
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 3184
{-# LANGUAGE BangPatterns, MultiWayIf #-}

import Control.Applicative
import Control.Monad
import Data.List
import Debug.Trace (traceShow, traceShowM)

import Data.Ord (comparing)

solve :: Int -> Int -> Int -> [Double] -> Int
solve n t a hs = fst . head $ sortBy (comparing snd) $ zip [1..] qs
  where
    ps = fmap (\h -> fromIntegral t - h * 0.006) hs
    qs = fmap (abs . subtract (fromIntegral a)) ps

main :: IO ()
main = do
    n <- readLn :: IO Int
    [t, a] <- fmap read . words <$> getLine
    hs <- fmap read . words <$> getLine
    print $ solve n t a hs

Measured memory_bytes: 1404
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;

public class Main {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        String input;
        while (!(input = br.readLine()).equals("-1 -1 -1")) {
            String[] st = input.split(" ");
            int m = Integer.parseInt(st[0]);
            int f = Integer.parseInt(st[1]);
            int r = Integer.parseInt(st[2]);
            if (m < 0 || f < 0) {
                bw.append("F\n");
                continue;
            }

            int score = (m > 0 ? m : 0);
            score += (f > 0 ? f : 0);

            if (score >= 80) {
                bw.append("A");
            } else if (score >= 65) {
                bw.append("B");
            } else if (score >= 50) {
                bw.append("C");
            } else if (score >= 30) {
                if (r >= 50) {
                    bw.append("C");
                } else {
                    bw.append("D");
                }
            } else {
                bw.append("F");
            }
            bw.newLine();
        }
        bw.flush();
    }


}


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

int main() {
  int n,l;
  cin>>n>>l;
  int x=n*(2*l+n-1)/2;
  if(l>=0){
      cout<<x-l<<endl;
      }else{
          if(l+n-1<=0){
              cout<<x+1-n-l<<endl;
      }else{
        cout<<x<<endl;
        }
    }        
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int64_t,int64_t> pll;
typedef vector<int64_t> vl;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
const long double PI = acos(-1);
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define ALL(a) begin(a),end(a)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

void solve() 
{
    string s;cin>>s;
    REP(i,s.size())cout<<"x";
    cout<<endl;
}

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


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
const int INF = 1e6;
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uld = unsigned long long;
using P = pair<int,int>;
const ll mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}
int main(){
    int a;
    cin >> a;
    cout << a + a*a + a*a*a << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);
 
void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}		

void solve()
{
	ll a, b, k;
	cin >> a >> b >> k;
	for(int i = min(a, b); i >= 1; --i){
		if(a % i == 0 && b % i == 0) --k;
		if(!k) {
			cout << i << '\n';
			return;
		}
	}
}


 
 
int main()
{
    Red;
  	// int T; cin >> T; while(T--)
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int x,r;
	scanf("%d",&x);
	r=x%7;
	switch(r){
	case 1:
		printf("fri\n");
		break;
	case 2:
		printf("sat\n");
		break;
	case 3:
		printf("sun\n");
		break;
	case 4:
		printf("mon\n");
		break;
	case 5:
		printf("tue\n");
		break;
	case 6:
		printf("wed\n");
		break;
	default:
		printf("thu\n");
	}
    return 0;
}

Measured memory_bytes: 1712
#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                           //     #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                    		return x != p.x ? x<p.x: y<p.y;
                                    	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };
int a[60]={0};
           signed main(){
       int ans=inf;
           	int n;
           	cin>>n;
           	for(int i=0;i<n;i++){
           	
           		int k;
           		cin>>k;
           		int c=0;
           		while(k%2==0){
           		k/=2;
           			c++;
           		}
           		ans=min(ans,c);
           	}
           	cout<<ans<<endl;
           	
           }
             

Measured memory_bytes: 256
import os,re,sys,operator
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
setrecursionlimit(10**6)

n=int(input())
x=sorted([[int(i) for i in input().split()] for _ in range(n)],key=itemgetter(2),reverse=True)
cmpr=x[1:]
for cx in range(101):
    for cy in range(101):
        h=x[0][2]+abs(cx-x[0][0])+abs(cy-x[0][1])
        for i in cmpr:
            nh=max(0,h-abs(i[0]-cx)-abs(i[1]-cy))
            if nh!=i[2]:
                break
        else:
            print(cx,cy,h)
            sys.exit()

Measured memory_bytes: 40560
/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *CSP-S 2019 RP++                                          *
 ***********************************************************/
//#pragma GCC optimize(3)
#define ADD_STACK int size = 512 << 20;\
	char *pp = (char*)malloc(size) + size;  \
	__asm__("movl %0, %%esp\n" :: "r"(pp))
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<fstream>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<bitset>
#include<ctime>
#include<vector>
#define ll long long
#define ull unsigned long long
#define mn 200020
#define Max(x,y) (((x)>(y))?(x):(y))
#define Min(x,y) (((x)<(y))?(x):(y))
#define Abs(x) (((x)<(0))?(-(x)):(x))
#define infll (ll)(1e18)
#define infint (1<<30)
#define mod (int)(1e9+7)
#define FOR(a,b,c) for (register int a=b;a<=c;++a)
#define FORD(a,b,c) for (register int a=b;a>=c;--a)
using namespace std;
//char buf[1<<20],*p1=buf,*p2=buf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline ll read(){
	ll x=0,f=1;char c;
	for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
	for(;c>='0'&&c<='9';x=x*10+c-'0',c=getchar());
	return x*f;
}
template<typename T>
inline void write(T a){
	if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
	while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
}
inline void write_(){return;}
template<typename T,typename... Args>
inline void write_(T a,Args... b){write(a);putchar(' ');write_(b...);}
inline void writeln(){putchar('\n');return;}
template<typename T,typename... Args>
inline void writeln(T a,Args... b){write(a);putchar(' ');writeln(b...);}
//need c++11

//inline void write(ll a){
//    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
//    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
//}
//inline void write_(ll a){write(a);putchar(' ');}
//inline void writeln(ll a){write(a);putchar('\n');}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
inline ll lcm(ll a,ll b){return 1ll*a/gcd(a,b)*b;}
inline ll Pow(ll n,ll a){ll b=1;while(a){if(a&1)b=1ll*b*n%mod;n=1ll*n*n%mod;a>>=1;}return b;}
//---------------------Head Files--------------------------//
#define int ll
priority_queue<int>q;
int n,m,a[mn],ans;
signed main(){
#ifdef LOCAL_LIGEN
	// freopen("0.in","r",stdin);
	// freopen("0.out","w",stdout);
	double be=clock();
#endif
	n=read(),m=read();
	FOR(i,1,n)a[i]=read(),q.push(a[i]),ans+=a[i];
	int x;
	FOR(i,1,m){
		x=q.top(),q.pop();
		ans=ans-x+x/2;
		q.push(x/2);
	}
	writeln(ans);
#ifdef LOCAL_LIGEN
	double en=clock();
	printf("Time: %.0lfms\n",en-be);
	fclose(stdin);fclose(stdout);
#endif
	return 0;
}

Measured memory_bytes: 1912
function Main(input){
  var N = input.split("\n")[0];
  var W = input.split("\n")[1].split(" ");
  for(i=0;i<=N-1;i++){
    W[i] = parseInt(W[i],10);
  }
  var sum = function(arr){
    var sum = 0;
    arr.forEach(function(elm){
      sum += elm;
    });
    return sum;
  }
  var halsum = sum(W)/2;
  var val = 0;
  var count = 0;
  for(j=0;val<=halsum;j++){
    val += W[j];
    count += 1
  }
  count -= 1;
  var a = val-halsum;
  var b = val-W[count]-halsum;
  a = Math.abs(a);
  b = Math.abs(b);
  if(a>=b){
    console.log(2*b);
  }else{
    console.log(2*a);
  }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
 
#define pii pair<int, int>
#define endl "\n"
#define int long long
#define F first
#define S second
#define B begin
#define E end
#define RB rbegin
#define RE rend
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const int INF = 1e9 + 1;
const double EPS = 1e-10;
const ll P = 1e9 + 7;
const int Q = 47;
 
using namespace std;
 
void hello()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
}
 
void show(vector<int>& arr)
{
    for (auto i : arr)
        cout << i << " ";
    cout << endl;
}
void show(vector<vector<int>>& arr)
{
    for (auto i : arr)
        show(i);
    cout << endl;
}


signed main()
{
    hello();
    
    string s;
    cin >> s;
    if (s[0] <= 'Z')
        cout << "A" << endl;
    else
        cout << "a" << endl;
}

Measured memory_bytes: 3652
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {

    public static void main(String args[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input[] = br.readLine().split(" ");
        int N = Integer.valueOf(input[0]);
        int K = Integer.valueOf(input[1]);

        long sum = 0;
        long min = 0;
        for (long i = 0; i < K - 1; i ++) {
            min += i;
        }
        long max = 0;
        for (long i = N; i > N - K + 1; i --) {
            max += i;
        }


        for (long i = K - 1; i < N + 1; i ++) {
            min += i;
            max += N - i;
            sum += (max - min + 1);
        }

        System.out.println(sum % ((long)Math.pow(10, 9) + 7));
    }
}

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

using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> x(n + 1);
	x[0] = -1;
	for (int i = 1; i <= n; i++) {
		cin >> x[i];
		x[i]--;
	}

	bool ans = true;
	vector<int> a, idx(n + 1);
	deque<int> b;
	for (int i = 0; i <= n; i++) idx[i] = i;
	sort(idx.begin(), idx.end(), [&](const int& i1, const int& i2) {return x[i1] < x[i2];});

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j < idx[i]; j++) {
			b.push_back(idx[i]);
		}
	}
	
	vector<int> cnt(n + 1, 0);
	for (int i = 1; i <= n; i++) {
		for (int j = x[idx[i - 1]] + 1; j < x[idx[i]]; j++) {
			if (b.empty()) {
				ans = false;
				break;
			}
			a.push_back(b.front());
			cnt[b.front()]++;
			b.pop_front();
		}
		if (!ans) break;
		if (cnt[idx[i]] < idx[i] - 1) {
			ans = false;
			break;
		}
		a.push_back(idx[i]);
		for (int j = 0; j < n - idx[i]; j++) {
			b.push_back(idx[i]);
		}
	}

	if (ans) {
		while (!b.empty()) {
			a.push_back(b.front());
			b.pop_front();
		}
		cout << "Yes" << endl;
		cout << a[0];
		for (int i = 1; i < n * n; i++) {
			cout << " " << a[i];
		}
		cout << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 2932
import java.lang.Math.sqrt

fun main() = Thread(null, ::abc169d, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc169d() {
    val n = readLine()!!.toLong()

    val primes = primeFactorization(n)

    val answer = primes.map {
        var count = it.value
        (1..1000).takeWhile { i ->
            count -= i
            count >= 0
        }.count()
    }.sum()

    println(answer)
}

private fun primeFactorization(n: Long): Map<Long, Long> {
    val factors = mutableMapOf<Long, Long>()
    var temp = n
    var i = 2L
    while (i * i <= temp) {
        while (temp % i == 0L) {
            factors[i] = (factors[i] ?: 0) + 1
            temp /= i
        }
        i++
    }
    if (temp > 1) factors[temp] = 1
    return factors
}


Measured memory_bytes: 35888
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	
        // 入力
        String s = sc.next();
      	int l=s.length();
      	
      if(s.charAt(l-1)=='s'){
      	System.out.println(s+"es");
      }else{
        System.out.println(s+"s");
      }
      

    }
}




Measured memory_bytes: 38444
import math

input_line = input().rstrip().split(' ')

total = 0
N = int(input_line[0])
A = int(input_line[1])
B = int(input_line[2])
result = 0
for value in range(1, N + 1):
	tmp_value = value;
	digit_sum = 0;
	while (tmp_value >= 10):
		digit_sum += tmp_value % 10
		tmp_value = math.floor(tmp_value / 10)

	digit_sum += tmp_value % 10
	if (digit_sum >= A and digit_sum <= B):
		result += value

print(result)

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

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

    for(int a = A; a <= B; a++){
        if(a%K == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }

    cout << "NG" << endl;
}


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

int main(void){
    char s[3];
    cin >> s;
    if(strstr(s,"RRR"))
        cout << "3" <<endl;
    else if(strstr(s,"RR"))
        cout << "2" <<endl;
    else if(strstr(s,"R")) 
        cout << "1" <<endl;
    else
        cout << "0" <<endl;

    return 0;
}

Measured memory_bytes: 3644
#include<algorithm>
#include <iostream>
using namespace std;
int main() {
	string s;
	cin >> s;int cnt = 0;int mx = 0;
	for (int i = 0; i < s.size();i++) {
		if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
			cnt++;
			mx = max(mx, cnt);
		}
		else 
			cnt = 0;
	}
	cout << mx << endl;
}

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

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#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 all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()

#define int long long

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second

template <typename T>
void print(T x)
{
	std::cout << x <<" " ;
}


template <typename T>
void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int N;
	cin >> N;
	vector<int>d;
	d.resize(N);
	int ans = 0;
	rep(i, N) {
		cin >> d[i];
	}
	rep(i,N-1) {
		FOR(j, i+1, N) {
			ans += d[i] * d[j];
		}
	}
	print(ans);
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const int M=1e9+5;
int main() {
	int n;
	cin >> n;
	int a[55] ,b[55];
	for(int i=0;i<n;i++) {
		cin >> a[i] ;
		b[i]=a[i] ;
	}
	sort(a,a+n) ;
	int f=0;
	for(int i=0;i<n;i++) {
		if(a[i]!=b[i]) f++;
 	}
 	if(f<=2) cout <<"YES" <<endl;
 	else cout <<"NO"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#define INF 0x3f3f3f3f
#define lowbit(x) x & -x
#define lson root<<1,l,mid
#define rson root<<1|1,mid+1,r
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int N=3e3+5;
int mp[N][N];
ll dp[N][N][5];
int main(){
#ifdef Mizp
    freopen("in.txt","r",stdin);
#endif
    int n,m,kk;
    scanf("%d%d%d",&n,&m,&kk);
    for(int i=1;i<=kk;i++){
        int x,y,val;
        scanf("%d%d%d",&x,&y,&val);
        mp[x][y]=val;
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            dp[i][j][0]=dp[i][j-1][0];
            for(int k=0;k<=3;k++){
                dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][k]);
                dp[i][j][1]=max(dp[i][j][1],dp[i-1][j][k]+mp[i][j]);
            }
            for(int k=1;k<=3;k++){
                dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k]);
                if(mp[i][j])
                    dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k-1]+mp[i][j]);
                
            }
        }
    }
    
    printf("%lld\n",max(max(dp[n][m][0],dp[n][m][1]),max(dp[n][m][2],dp[n][m][3])));
    return 0;
}


Measured memory_bytes: 391156
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <functional>
#include <array>

using namespace std;

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

    vector<int64_t> A(N);
    for(int i = 0; i < N; ++i){
        cin >> A[i];
    }

    int64_t nsum = 0;
    int64_t nxor = 0;
    int64_t ans = 0;
    int l = 0;
    for(int i = 0; i < N; ++i){
        nsum += A[i];
        nxor ^= A[i];
        while(nsum != nxor){
            nsum -= A[l];
            nxor ^= A[l];
            ++l;
        }
        ans += i - l + 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<ll> a(n);
	rep(i, n) cin >> a[i];
	vector<ll> ans(n);
	ll s = 0;
	rep(i, n) s += a[i];
	ll k = 0;
	for (int i = 1; i <= n - 2; i += 2) k += a[i];
	ans[0] = s - 2 * k;
	for (int i = 1; i < n; i++) {
		ans[i] = 2 * a[i - 1] - ans[i - 1];
	}
	rep(i, n) cout << ans[i] << " ";
	cout << endl;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

template<typename F>
static inline constexpr decltype(auto) fix(F&& f) noexcept {
  return [f = std::forward<F>(f)](auto&&... args) {
    return f(f, std::forward<decltype(args)>(args)...);
  };
}
template<typename T>
static inline T fin() { T t; cin >> t; return std::move(t); }

int main() {
  let L= fin<i64>(), R = fin<i64>();
  if(R - L >= 3000) {
    cout << 0 << endl;
    return 0;
  }
  let ans = [L, R]() {
    i64 res = 1e18;
    for(i64 l = L;l <= R;l++) {
      for(i64 r = l + 1; r <= R;r++) {
        res = min(res, l * r % 2019);
      }
    }
    return res;
  }();
  cout << ans << endl;
}


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

void solve() {
    double r;
    cin >> r;
    r /= 3.0;
    cout << setprecision(7) << r*r*r;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

using Weight = int;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int s = 0, int d = 0, Weight w = 0)
    : src(s), dst(d), weight(w) {
  }
};

using Edges  = vector<Edge>;
using Graph  = vector<Edges>;
using Array  = vector<Weight>;
using Matrix = vector<Array>;

void addArc(Graph &g, const int &a, const int &b, const Weight &w = 1) {
  g[a].emplace_back(a, b, w);
}

void addEdge(Graph &g, const int &a, const int &b, const Weight &w = 1) {
  addArc(g, a, b, w);
  addArc(g, b, a, w);
}

class UFT {
private:
  vi data, rnk;

public:
  UFT(const int &size)
    : data(size), rnk(size) {
    iota(all(data), 0);
  }

  int root(const int &x) {
    return data[x] == x ? x : data[x] = root(data[x]);
  }

  bool same(const int &a, const int &b) {
    return root(a) == root(b);
  }

  void unite(int a, int b) {
    a = root(a), b = root(b);
    if (a == b) return;
    if (rnk[a] < rnk[b]) swap(a, b);
    data[b] = a;
    if (rnk[a] == rnk[b]) rnk[a]++;
  }
};

// deps: graph-basic, UFT
pair<Weight, Edges> kruskal(const Graph &g) {
  UFT uf(g.size());
  Edges es;
  for (auto &adj : g) {
    for (auto &e : adj) es.emplace_back(e);
  }
  sort(all(es), [](const Edge &e, const Edge &f) { return e.weight < f.weight; });
  Weight total = 0;
  Edges T;
  for (auto &e : es) {
    if (!uf.same(e.src, e.dst)) {
      T.pb(e);
      total += e.weight;
      uf.unite(e.src, e.dst);
    }
  }
  return mp(total, T);
}

void solve() {
  int v, e;
  cin >> v >> e;
  Graph g(v);
  while (e--) {
    int s, t, w;
    cin >> s >> t >> w;
    addEdge(g, s, t, w);
  }
  cout << kruskal(g).first << endl;
}

Measured memory_bytes: 17116
n = int(input())
t = list(map(int, input().split()))
m = int(input())
pxlist = []
for i in range(m):
    px = list(map(int, input().split()))
    pxlist.append(px)
sumlist = []
for i in range(m):
    sum = 0
    for j in range(n):
        if j == pxlist[i][0]-1:
            sum += pxlist[i][1]
        else:
            sum += int(t[j])
    sumlist.append(sum)
    print(sumlist[i])

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main() {
    int N, M;
    cin >> N >> M;
    
    int ans = 100*(N + 18*M);
    rep(i, M) {
        ans *= 2;
    }
    cout << ans;
    
    cout << endl;
    return 0;
}

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

ll N;
// 8こ
ll cnt = 0;
bool flg[10];

int main() {
   fill(flg, flg+10, false);
   cin >> N;
   rep (i, N) {
      ll a; cin >> a;
      bool ok = false;
      for (int i = 1; i <= 8; i++) {
         if (a < 400 * i) {
            ok = true;
            flg[i-1] = true;
            break;
         }
      }
      if (!ok) cnt++;
   }

   // rep (i, 8) {
   //    cout << flg[i] << ", ";
   // }
   // cout << endl;

   cout << max(1LL, (ll)count(flg, flg+8, true)) << " ";
   cout << count(flg, flg+8, true) + cnt << endl;

   return 0;
}

Measured memory_bytes: 256