akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std ;
const int MAXN = 1e5 + 5 ;
long long ans ;
int n , m ;
int a , t[ MAXN ] ;
inline int read () {
	int tot = 0 , f = 1 ;
	char c = getchar () ;
	while ( c < '0' || c > '9' ) {
		if ( c == '-' ) f = -1 ;
		c = getchar () ;
	}
	while ( c >= '0' && c <= '9' ) {
		tot = ( tot << 1 ) + ( tot << 3 ) + ( c ^ 48 ) ;
		c = getchar () ;
	}
	return tot * f ;
}
signed main () {
	n = read () ;
	for ( int i = 1 ; i <= n ; i ++ ) {
		a = read () ;
		t[ a ] ++ ; ans += a ;
	}
	m = read () ;
	for ( int i = 1 ; i <= m ; i ++ ) {
		int x = read () , y = read () ;
		ans += ( y - x ) * t[ x ] ;
		t[ y ] += t[ x ] ; t[ x ] = 0 ;
		cout << ans << endl ;
	}
	return 0 ;
}

Measured memory_bytes: 3912
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>

int gcd(int a,int b){
	return b ? gcd(b, a % b) : a; 
}

using namespace std;

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

	int ans = 100000;
	int even = 0;
	int odd = 0;

	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '0')
			if (i % 2 == 0)
				even++;
			else
				odd++;
		else
			if (i % 2 == 0)
				odd++;
			else
				even++;
	}

	cout << min(even, odd) << endl;

	return 0;
}

Measured memory_bytes: 512
/*

*/
#include<iostream>
#include<iomanip>
#include<ios>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<utility>
#include<math.h>
#include<cstdlib>
#define rep(i, n) for(int i=0;i<n;i++)
#define repb(i, a, b) for(int i=a;i<b;i++)
#define MAX_N 10000

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

const int INF = 1<<30;
const ll MOD = ll(1e9+7);

int main(){
  ll n;cin>>n;cout<<(n-1)*n/2<<endl;
  // system("read -n 1 -s -p \"Press any key to continue...\"");
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    int width, height, x, y, radius;
    int distance;
    cin >> width >> height >> x >> y >> radius;
   
    if((height - y) >= (width - x))
    {
        distance = width - x;
    }
    else
    {
        distance = height - y;
    }

    if(x >= width or y >= height)
    {
        cout << "No" << endl;
    }
    else if(radius > width/2 or radius > height/2 or x <= 0 or y<=0)
    {
        cout << "No" << endl;
    }
    else
    {
        if(distance >= radius)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" <<endl;
        }
    }
}

Measured memory_bytes: 3088
import java.util.Scanner;

class Main {
	static int mod = 1000000007;
	private static long[] fact;
	private static long[] inv_fact;

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

		String s = sc.next();


		char[] c = s.toCharArray();

		int count = 0;
		for (int i = 0; i < c.length; i++) {

			char l = c[i];
			char r = c[c.length - i - 1];


			if(l != r) {
				count++;
			}

		}

		System.out.println(count / 2);



	}

}

Measured memory_bytes: 23764
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;
// vector<int> v;
int n, ans, k, v[10];

bool valid() {
  int va = ans;
  while (va != 0) {
    for (int i = 0; i < n; i++) {
      int r = va % 10;
      if (r == v[i]) {
        return false;
      }
    }
    va /= 10;
  }
  return true;
}

int main() {
  cin >> k >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  ans = k;
  while (1) {
    if (valid()) {
      break;
    } else {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    double v, y, t;
    int N, i;
    while(scanf("%lf", &v) != EOF) {
        t = v / 9.8;
        y = 4.9 * t * t;
        N=1;
        for(i=1;i<10000000; i++) {
            if(y <= N*5-5) break;
            N++;
        }
        printf("%d\n", N);
    }
    return 0;
}


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

int main() {
  int A,B,T;
  cin >> A >> B >> T;
  int Biscuit=0;
  for (int t=1;A*t<T+0.5;t++){
    Biscuit+=B;
  }
  
  cout << Biscuit << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
   int n,m,i,j,jp;
   long long int area;
   scanf("%d %d",&n,&m);
   if(n==1||m==1)
   {
   if(n==1&&m==1) printf("1");
   else printf("%d",n+m-3);
   }
   else
   {
   area=n-2;
   area=area*(m-2);
   printf("%lld",area);
   }
   return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void fuk() { puts("NO"); exit(0); }

const int MAXN = 100055;

ll A[MAXN], B[MAXN];

ll Sum, T;
int N;

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

	cin >> N;
	for(int i = 1; i <= N; i++) {
		cin >> A[i];
		Sum += A[i];
	}
	T = ll(N) * (N+1) / 2;
	if(Sum % T) fuk();
	T = Sum / T;
	A[0] = A[N];
	for(int i = 1; i <= N; i++)
		B[i] = A[i] - A[i-1];
	for(int i = 1; i <= N; i++) B[i] -= T;
	Sum = 0;
	for(int i = 1; i <= N; i++) {
		if(0 < B[i]) fuk();
		B[i] = -B[i];
		if(B[i] % N) fuk();
		Sum += B[i] / N;
	}
	if(Sum != T) fuk();
	puts("YES");
	return 0;
}

Measured memory_bytes: 1792
n=int(input())
l=list(input())
lw=[0]
countw=0
counte=0
le=[0 for i in range(n)]

for i in range(1,n):
  if l[i-1]=="W":
    countw+=1
  lw.append(countw)
  if l[-i]=="E":
    counte+=1
  le[-i-1]=counte
m=n
for i in range(n):
  if m>lw[i]+le[i]:
    m=lw[i]+le[i]
print(m)

Measured memory_bytes: 20172
// template version 1.15
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define int long long
const int INF=1e18;

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define divceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

void sputs(){}
template <class Head, class... Tail>
void sputs(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(Tail) == 0) { cout << endl; }
  else { cout << " "; }
  sputs(std::move(tail)...);
}

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

signed main() {
  int n;cin>>n;
  vector<int> a(n);
  rep(i, n) {
    cin>>a[i];
  }
  dump(a);

  int pre = 0;
  int ans = 0;
  rrep(i, n){
    if (i<a[i]) {
      cout << -1 << endl;
      return 0;
    }

    if (a[i]>=pre){
      ans += a[i];
    }
    else if (a[i]==pre-1){;}
    else{
      dump(i);
      cout << -1 << endl;
      return 0;
    }
    pre = a[i];
  }
  cout << ans << endl;
  
  return 0;
}


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

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

    int count = 0;
    for (int i = 1; i <= n; i+=2) {
        int div = 0;
        for (int j = 1; j <= i; ++j) {
            if (i % j == 0)
                div++;
        }
        if (div == 8)
            count++;
    }

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

Measured memory_bytes: 256
#include <string>
#include <algorithm>
#include <vector> 
#include <math.h>
#include <iostream>
using namespace std;

int main()
{
	string s;
	cin >> s;
	int r = 0;
	int b = 0;
	int out = 0;

	
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '0') {
			r++;
		}
		else {
			b++;
		}
	}

	out = (min(r, b)) * 2;
	cout << out << endl;

	return 0;

}

Measured memory_bytes: 512
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Vishal Burman
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            if (a < b && b < c)
                out.println("Yes");
            else
                out.println("No");
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}




Measured memory_bytes: 24468
#ifndef Local
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse4,sse4.2,popcnt,abm,mmx,avx")
#endif
#include <bits/stdc++.h>

using namespace std;

#define popCnt(x) (__builtin_popcountll(x))
#define sz(x) ((int)(x.size()))
#define all(v) begin(v), end(v)
#define rall(v) rbegin(v), rend(v)
typedef long long Long;
typedef double Double;

template <class U, class V>
istream& operator>>(istream& is, pair<U, V>& p) {
  is >> p.first >> p.second;
  return is;
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& x : v) {
    is >> x;
  }
  return is;
}

template <class T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto& x : v) {
    os << x << " ";
  }
  return os;
}

const int MOD = round(1e9 + 7);
const int N = 2001;

int power(int base, int p) {
  if (p == 0) return 1;
  int res = power(base, p / 2);
  res = 1LL * res * res % MOD;
  if (p & 1) {
    res = 1LL * res * base % MOD;
  }
  return res;
}
int modInverse(int x) { return power(x, MOD - 2); }

int fact[N];
int inv_fact[N];
void buildFactorial() {
  fact[0] = 1;
  inv_fact[0] = 1;
  for (int i = 1; i < N; ++i) {
    fact[i] = 1LL * i * fact[i - 1] % MOD;
    inv_fact[i] = modInverse(fact[i]);
  }
}

int nCr(int n, int r) {
  if (r > n) return 0;
  int res = 1LL * fact[n] * inv_fact[r] % MOD;
  res = 1LL * res * inv_fact[n - r] % MOD;
  return res;
}

int starsAndBars(int stars, int bars) { return nCr(stars - 1, bars); }

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifdef Local
  freopen("test.in", "r", stdin);
#else
#define endl '\n'
#endif
  buildFactorial();
  int s;
  cin >> s;
  int res = 0;
  for (int i = 1; 2 * i < s; ++i) {
    int stars = s - 2 * i;
    res = (res + starsAndBars(stars, i - 1)) % MOD;
  }
  cout << res << endl;

  return 0;
}

Measured memory_bytes: 3648
#define _GLIBCXX_DEBUG
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  char a, b, c;
  scanf("%c %c %c", &a, &b, &c);
  if(a == '7' || b == '7'|| c == '7'){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
}

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(a<c&&c<b){
    cout << "Yes" << endl;
  }
  else if(a>c&&c>b){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

int main() {
  int N; cin >> N;
  int D = N % 10;
  N = ( N - D ) / 10;
  int C = N % 10;
  N = ( N - C ) / 10;
  int B = N % 10;
  int A = N / 10;
  
  if( A + B + C + D == 7 ) 
    cout << A << "+" << B << "+" << C << "+" << D << "=7" << endl;
  else if( A + B + C - D == 7 )
    cout << A << "+" << B << "+" << C << "-" << D << "=7" << endl;
  else if( A + B - C + D == 7 ) 
    cout << A << "+" << B << "-" << C << "+" << D << "=7" << endl;
  else if( A + B - C - D == 7 ) 
    cout << A << "+" << B << "-" << C << "-" << D << "=7" << endl;
  else if( A - B + C + D == 7 ) 
    cout << A << "-" << B << "+" << C << "+" << D << "=7" << endl;
  else if( A - B + C - D == 7 ) 
    cout << A << "-" << B << "+" << C << "-" << D << "=7" << endl;
  else if( A - B - C + D == 7 ) 
    cout << A << "-" << B << "-" << C << "+" << D << "=7" << endl;
  else if( A - B - C - D == 7 ) 
    cout << A << "-" << B << "-" << C << "-" << D << "=7" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;
typedef long long ll;
const int INF=1000000000;
const int MOD=1000000007;

int main()
{
 int h, a;
 cin >> h >> a;
 cout << (h+a-1)/a;
 return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
#include <stack>
#include <set>
#include <queue>
#include <list>
using namespace std;
typedef long long ll;

void solve() {
	ll n; cin >> n;
	ll ans = 0;
	for (ll i = 1; i <= n; i++) {
		ll cur = n / i;
		ans += i * cur * (cur + 1) / 2;
	}
	cout << ans;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

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

}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>

#define X first
#define Y second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())


//INT_MAX
//INT_MIN
//LLONG_MAX
//LLONG_MIN
//DBL_MIN
//DBL_MAX
//LDBL_MIN
//LDBL_MAX

// A-Z: 65~90
// a-z: 97~122
// |a-z| = 26

using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    int n;
    cin >> n;
    vector<int> x(n), y(n), h(n);
    int idx = -1;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i] >> h[i];
        if (h[i] != 0) {
            idx = i;
        }
    }
    
    for (int px = 0; px <= 100; px++) {
        for (int py = 0; py <= 100; py++) {
            bool flag = true;
            int h_top = h[idx] + abs(px - x[idx]) + abs(py - y[idx]);
            
            for (int i = 0; i < n; i++) {
                if (h[i] != max(h_top - abs(px - x[i]) - abs(py - y[i]), 0)) {
                    flag = false;
                    break;
                }
            }

            if (flag) {
                cout << px << ' ' << py << ' ' << h_top << endl;
                return 0;
            }
        }
    }
    
}


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

using namespace std;

int main(){
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    int ans=a[2]-a[1];
    a[0]+=ans,a[1]+=ans;
    if(a[0]%2==a[2]%2){
        cout<<ans+(a[2]-a[0])/2<<endl;
    }
    else{
        cout<<ans+(a[2]-a[0])/2+2<<endl;
    }
    return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdio>
using namespace std;

#define int long long

signed main() {
    string s; cin >> s;
    string t = "abcdefghijklmnopqrstuvwxyz";
    vector<int> cnt(t.size(), 0);

    for(int i = 0; i < s.size(); i++) {
        if(cnt[t.find(s[i])] == 1) {
            cout << "no" << endl;
            return 0;
        } else {
            cnt[t.find(s[i])]++;
        }
    }
    cout << "yes" << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <iostream>
#include <queue>
#include <vector>
#include <cmath>

#define int long long

using namespace std;

const int MOD = 1e9 + 7;

int N, K;

void experiment() {
    static int digits[100001] = { };
    for (int i = 0; i < N; i++) {
        digits[i] = 1;
    }

    static int histogram[100001] = { };

    while (true) {
        // Histogram.
        int gcd = digits[0];
        for (int i = 1; i < N; i++) {
            gcd = __gcd(gcd, digits[i]);
        }
        histogram[gcd]++;
 
        // Exit condition.
        bool flag = true;
        for (int i = 0; i < N; i++) {
            if (digits[i] != K) {
                flag = false;
                break;
            }
        }
        if (flag) {
            break;
        }
 
        // Add one.
        digits[0] += 1;
        for (int i = 0; i < N; i++) {
            if (digits[i] == K + 1) {
                digits[i] = 1;
                digits[i + 1]++;
            }
        }
    }

    int ans = 0;
    for (int i = 1; i <= K; i++) {
        cerr << i << ": " << histogram[i] << endl;
        ans += i * histogram[i];
    }
    cerr << "ans: " << ans << endl;
}

int power(int x, int y) {
    if (y == 1) {
        return x;
    }

    int t = power(x, y / 2);
    if (y % 2 == 0) {
        return (t * t) % MOD;
    } else {
        return (((t * t) % MOD) * x) % MOD;
    }
}

signed main() {
    cin >> N >> K;

    // experiment();

    int ans = 0;
    static int f[100001] = { };
    for (int i = K; i >= 1; i--) {
        f[i] = power(K / i, N);
        for (int j = 2; i * j <= K; j++) {
            f[i] = (f[i] + MOD - f[i * j]) % MOD;
        }       
        ans = (ans + (i * f[i]) % MOD) % MOD;
    }

    cout << ans << endl;

    return 0;
}

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

int H, W;
vector<string> fi;
int Left[2100][2100], Right[2100][2100], Up[2100][2100], Down[2100][2100];

int main() {
    // 入力
    cin >> H >> W;
    fi.resize(H);
    for (int i = 0; i < H; ++i) cin >> fi[i];

    // 前処理
    for (int i = 0; i < H; ++i) {
        int cur = 0;
        for (int j = 0; j < W; ++j) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Left[i][j] = cur;
        }
    }
    for (int i = 0; i < H; ++i) {
        int cur = 0;
        for (int j = W-1; j >= 0; --j) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Right[i][j] = cur;
        }
    }
    for (int j = 0; j < W; ++j) {
        int cur = 0;
        for (int i = 0; i < H; ++i) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Up[i][j] = cur;
        }
    }
    for (int j = 0; j < W; ++j) {
        int cur = 0;
        for (int i = H-1; i >= 0; --i) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Down[i][j] = cur;
        }
    }

    // 集計
    int res = 0;
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            if (fi[i][j] == '#') continue;
            res = max(res, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3);
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 72448
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

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

int main(){
    double ans;
    double t, x;
    cin >> t >> x;
    ans = t / x;
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <queue>
#include <sstream>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), a + n
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)

using namespace std;

typedef long long ll;

const double EPS = 1e-10;
const double PI = acos(-1.0);

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main() {
	char s[101];
	scanf("%s", s);
	for(int i = 0; s[i] != '\0'; i++) {
		if(i % 2 == 0) {
			if(!(s[i] == 'R' || s[i] == 'U' || s[i] == 'D')) {
				puts("No");
				return 0;
			}
		} else {
			if(!(s[i] == 'L' || s[i] == 'U' || s[i] == 'D')) {
				puts("No");
				return 0;
			}
		}
	}

	puts("Yes");
	return 0;
}


Measured memory_bytes: 128
def main():
    N, Q = map(int, input().split())
    S = input()

    list = [0] * (N + 1)

    for i in range(N):
        list[i + 1] = list[i] + (1 if S[i:i + 2] == "AC" else 0)

    for i in range(Q):
        a, b = map(int, input().split())
        output = list[b - 1] - list[a - 1]
        print(output)


if __name__ == '__main__':
    main()


Measured memory_bytes: 7748
#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define mp make_pair
#define pii pair<int,int>
using namespace std;

void solve()
{
    int n;
    cin>>n;
    double e=1;
    int res=1;
    while(n--)
    {
        int x;
        cin>>x;
        e=1.0*e*x;
        res*=x;
    }
    int lim=1e18;
    if(e>1.0*lim||res>lim) cout<<-1;
    else cout<<res;
}


main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //int t;
    //cin>>t;
    //while(t--)
        solve();
}


Measured memory_bytes: 3640
import * as fs from "fs"

function solve() {
  const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n') as string;
  const a = +input[0];
  const s = input[1];
  if (a >= 3200) {
    console.log(s);
  } else {
    console.log('red');
  }
}

solve();


Measured memory_bytes: 7372
x,y,a,b,c=gets.split.map &:to_i
ps=gets.split.map(&:to_i).sort
qs=gets.split.map(&:to_i).sort
rs=gets.split.map(&:to_i).sort
pqs=[*ps[a-x...a],*qs[b-y...b]].sort
t=0
i=0
while i<x+y && !rs.empty? && pqs[i]<rs[-1]
  t+=rs[-1]
  rs.pop
  i+=1
end
puts (i...x+y).reduce(t){|s,j| s+pqs[j] }




Measured memory_bytes: 28512
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] L = new int[N];
        for(int i=0;i<N;i++) L[i]=sc.nextInt();
        Arrays.sort(L);
        int ans = 0;
        for(int i=N-1;i>=N-K;i--) ans += L[i];
        System.out.println(ans);
    }
}


Measured memory_bytes: 20948
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=5000+5;
int n,k;
int a[maxn];
bool dp[maxn];
bool cal(int mid)
{
    if(a[mid]>=k) return false;
    memset(dp,0,sizeof(dp));
    dp[0]=true;
    for(int i=1;i<=n;i++)
    {
        if(i==mid) continue;
        for(int j=k;j>=0;j--){
            if(!dp[j]) continue;
            if(j+a[i]<=k) dp[j+a[i]]=true;
        }
    }
    for(int i=max(k-a[mid],0);i<k;i++)
        if(dp[i]) return false;
    return true;
}
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    sort(a+1,a+1+n);
    int l=0,r=n;
    while(r-l>0){
        int mid=l+(r-l+1)/2;
        if(cal(mid)) l=mid;
        else r=mid-1;
    }
    printf("%d\n",l);
    return 0;
}


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

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << ": " << x << '\n'

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

const long long INF = 3e18 + 12;
const int inf = 1e9;

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

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

  ll a, b, k;
  cin >> a >> b >> k;

  if ((b - a + 1) <= k * 2) {
    repi(i, a, b + 1) {
      cout << i << endl;
    }
  } else {
    repi(i, a, a + k) {
      cout << i << endl;
    }

    repi(i, b - k + 1, b + 1) {
      cout << i << endl;
    }
  }

  return 0;
}

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

using namespace std;
int main(){
    long long int n,m;
    cin>>n>>m;
    if(n==1){
        if(m==1){
            cout<<1;
        }else{
            cout<<m-2;
        }
    }else if(m==1){
        cout<<n-2;
    }else{
        cout<<(m-2)*(n-2);
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000000;
constexpr ll INF= 1e18;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

int main() {
    int N;
    cin >> N;
    vector<int> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }   
    int cnt = 0;
    for(int i = 0;i < N;i++) {
        cnt += vec.at(i);
    }
    if(cnt % 10 != 0) {
        cout << cnt << endl;
    }
    else {
        sort(vec.begin(),vec.end());
        for(int i = 0;i < N;i++) {
            if(vec.at(i) % 10 != 0) {
                cout << cnt - vec.at(i) << endl;
                return 0;
            }
        }
        cout << 0 << endl;
    }
}

Measured memory_bytes: 256
/*** akshaykumar99 ***/
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
template<typename T> using id_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update> ;
  
const long long MOD = 1e9+7;
const long double PI = acos(-1);
const long long N = 1e5+1;
 
typedef long long ll;
typedef long double ld;

void test_case()
{
    ll n,ans = 0;
    cin >> n;
    ll a[n];
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        if(i%2 == 0 && a[i]&1)
            ans++;
    }
    cout << ans <<'\n';
}
 
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL); 
    ll tc=1;
    // cin>>tc;
    while(tc--)
        test_case();
    return 0;
}

Measured memory_bytes: 3632
(let* ((h (read))
    (w (read))
    (c (make-array h)))
    (loop for i below h do
        (setf (aref c i) (read-line))
    )
    (loop for i below h do
        (format t "~A~%~A~%" (aref c i) (aref c i))
    )
)

Measured memory_bytes: 24616
#include <cstdio> 
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std; 
const int N = 2100;
struct Edge {
	int to;
	Edge *next;
}*h[N], e[N<<1];
int _;
int u[N], v[N];
int tmp = 0;
void add(int u, int v) {
	Edge *tmp = &e[++_];
	tmp->to=v;
	tmp->next = h[u];
	h[u]=tmp;

	tmp = &e[++_];
	tmp->to=u;
	tmp->next = h[v];
	h[v]=tmp;
}
void dfs(int p, int fa, int dep) {
	tmp++;
	if(!dep) return;
	for(Edge *i=h[p];i;i=i->next) {
		if(i->to!=fa)dfs(i->to,p,dep-1);
	}
}
int main() {
	int n, k;
	scanf("%d%d", &n, &k);
	for(int i=2;i<=n;i++) {
		scanf("%d%d", &u[i], &v[i]);
		add(u[i], v[i]);
	}
	int ans = 0;
	if(k&1) {
		for(int i=2;i<=n;i++) {
			tmp = 0;
			dfs(u[i], v[i], k/2);
			dfs(v[i], u[i], k/2);
			ans = max(ans, tmp);
		}
	}
	else {
		for(int i=1;i<=n;i++) {
			tmp = 0;
			dfs(i, 0, k/2);
			ans = max(ans, tmp);
		}
	}
	printf("%d\n", n-ans);
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
long long a[100000+10];
int main()
{
	int n;
	cin>>n;
	long long flag=0,flag1=0,sum=1000000000,k,sum1;
	for(long long i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]%2==0)
		{
			flag=1;
			sum=min(sum,a[i]);
		}
		else
		{
			flag1=1;
			sum1=min(sum1,a[i]);
		}
	}
		long long aa=0;
		while(aa!=n)
		{
			aa=0;
			for(int i=0;i<n;i++)
			{
				if(a[i]%sum!=0)
				{
					k=a[i]%sum;
					sum=k;
				}
				else
				aa++;
			}
		}
		cout<<sum<<endl;
}

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

int main(){
    int N,X,L;
    cin >> N >> X;
    int D = 0,sum = 0,ans = 1;

    while(cin >> L){
        if(D + L > X) break;
        sum += D + L;
        D += L;
        ans++;
    }
    cout << ans << "\n";
}

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

signed main()
{
    int n, k;
    cin >> n >> k;

    vector<int> h(n);
    for(int i = 0; i < n; ++i)
        cin >> h[i];

    vector<int> dp(n);
    dp[n-1] = 0;
    for(int i = n-2; i >= 0; --i)
    {
        dp[i] = INT_MAX;
        for(int j = 1; j <= k && i+j < n; ++j)
            dp[i] = min(dp[i], abs(h[i] - h[i+j]) + dp[i+j]);
    }

    cout << dp[0] << endl;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <climits>
#include <algorithm>
using namespace std;

const int MAXN = 100005;

int N;
int a[MAXN];

void load() {
	scanf("%d", &N); 
	for (int i = 0; i < N; i++)
		scanf("%d", a + i);
}

bool check(int x) {
	long long curr = 0;
	for (int i = 0; i <= x; i++)
		curr += a[i];
	for (int i = x + 1; i < N; i++) {
		if (a[i] > 2 * curr)
			return false;
		curr += a[i];
	}
	return true;
}
			
int solve() {
	sort(a, a + N);
	a[N] = INT_MAX;
	
	int lo = 0, hi = N;
	while (lo < hi) {
		int mid = (lo + hi) / 2;
		if (check(mid))
			hi = mid;
		else
			lo = mid + 1;
	}
	
	return N - lo;
}

int main() {
	load();
	printf("%d\n", solve());
	return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

ll N;
vector<ll> A;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  A.resize(N);
  vector<ll> cum(N + 1, 0);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    cum[i + 1] = cum[i] + A[i];
  }

  ll ans = LL_INF;
  for (int i = 1; i < N; i++) {
    ll h1 = cum[i] - cum[0];
    ll h2 = cum[N] - cum[i];
    ans = min(ans, abs(h2 - h1));
  }

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

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

using namespace std;

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

    cout << (buf ^ a[0]);
    for(int i=1;i<n;i++){
        cout << " " << (buf ^ a[i]);
    }
    cout << endl;
}

Measured memory_bytes: 4024
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

int deg[100001];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n,m; cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int u, v; cin>>u>>v;
		u--; v--;
		deg[u]++; deg[v]++;
	}
	for(int i=0;i<n;i++)
	{
		if(deg[i]&1)
		{
			cout<<"NO\n";
			return 0;
		}
	}
	cout<<"YES\n";
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <functional>
#define MOD 1000000007


struct edge {
    int to;
    int cost;
};

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

bool compare_by_b(pair<int,pair<string,int>> a, pair<int,pair<string,int>> b) {
    if(a.second.first != b.second.first){
        return a.second.first < b.second.first;
    }else{
    return a.second.second > b.second.second;
    }
}

int main(void) {
    ll i=0,j=0,k=0;
    ll n;
    vector<int> v;
    cin >> n;
    for(i=0;i<n;i++){
        int a;
        cin >> a;
        v.push_back(a);
    }
    sort(v.begin(),v.end());
    int ans = 0;
    if(v[n/2]-v[n/2-1]){
        ans = v[n/2]-v[n/2-1];
    }else{
        ans = 0;
    }
    cout << ans << endl;
    return 0;
    
}


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

public class Main {

	int INF = 1 << 28;
	int mem[][];
	
	void run() {
		Scanner sc = new Scanner(System.in);
		mem = new int[11][46];
		dfs(0, 0, 0);
		for(;;) {
			int n = sc.nextInt(), s = sc.nextInt();
			if( (n|s) == 0 ) break;
			if( s > 45 ) System.out.println(0);
			else System.out.println(mem[n][s]);
		}
	}
	
	void dfs(int i, int s, int c) {
		mem[c][s]++;
		if( i == 10 || c == 11 ) return;
		for(int j=i;j<10;j++) dfs(j+1, s+j, c+1);
	}

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

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

Measured memory_bytes: 12000
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main()
{
    int N, K;
    cin >> N >> K;
    int num = ((N - 1) + (K - 2)) / (K - 1);
    cout << num << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#define int long long
using namespace std;
signed main() {
	int n, x, a = 0, b = 0;
	cin >> n >> x;
	for (int i = x; i <= n; i += x)a++;
	if (x % 2 == 0)for (int i = x / 2; i <= n; i += x)b++;
	cout << a * a*a + b * b*b << endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include<chrono>
#include<climits>
#include<numeric>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<random>
#include<set>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include<cassert>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
using namespace std;
 
#define rep(i, a, b) for(auto i = (a); i < (b); i++)
#define rrep(i, a, b) for(auto i = (a); i > (b); i--)
#define all(v) (v).begin(), (v).end()
#define print(v) {for(auto x : v) cout << x << ' '; cout << endl;}
#define printn(v, n) {for(int _i = 0; _i < n; _i++) cout << *(v + _i) << ' '; cout << endl;}
 
typedef unsigned long long ull;
typedef long long ll;
 
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
 
const int MAXN = 500 + 20;
int n;
int a[MAXN][MAXN];

void assign(int i, int j, int k) {
	if(i >= j) return;
	int mid = i + (j - i) / 2;
	for(int ii = i; ii <= mid; ii++)
		for(int jj = mid + 1; jj <= j; jj++)
			a[ii][jj] = k;
	assign(i, mid, k + 1);
	assign(mid + 1, j, k + 1);
}

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

    cin >> n;
    assign(1, n, 1);
    for(int i = 1; i < n; i++) {
    	for(int j = i + 1; j <= n; j++) {
    		cout << a[i][j] << ' ';
    	}
    	cout << endl;
    }

    return 0;
}











Measured memory_bytes: 1536
import java.util.*;

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

    public void main() {
        Scanner scanner = new Scanner(System.in);
        String[] xy = scanner.nextLine().split(" ", 2);
        int x = Integer.parseInt(xy[0]);
        int y = Integer.parseInt(xy[1]);
        if (this.group(x) == this.group(y)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }

    public int group(int n) {
        switch (n) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                return 1;
            case 4:
            case 6:
            case 9:
            case 11:
                return 2;
            case 2:
                return 3;
            default:
                return 0;
        }
    }
}


Measured memory_bytes: 23636
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

int main() {
  std::string x;
  std::cin >> x;
  rep(i, x.length()) {
    if (i % 2 == 1) {
      if (x[i] != 'L' && x[i] != 'U' && x[i] != 'D') {
        printf("No");
        return 0;
      }
    } else if (i % 2 == 0) {
      if (x[i] != 'R' && x[i] != 'U' && x[i] != 'D') {
        printf("No");
        return 0;
      }
    }
  }
  printf("Yes");
}


Measured memory_bytes: 256
MARCH = list("MARCH")
check = set(MARCH)
cand = [0] * 5
N = int(input())
for i in range(N):
    n = list(input())[0]
    for j in range(5):
        if n == MARCH[j]:
            cand[j] += 1

ans = 0
for i in range(5):
    for j in range(i+1, 5):
        for k in range(j+1, 5):
            ans += cand[i] * cand[j] * cand[k]
print(ans)


Measured memory_bytes: 45912
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    string s;
    cin >> s;
    int cnt = 0;
    int max1 = 0;
    for(int i = 0;i<s.size();i++){
        if(s[i] == 'R') {cnt++;max1=max(max1,cnt);}
        else cnt = 0;
    }
    cout << max1 << endl;
    
    return 0;
}

Measured memory_bytes: 3624
/*
                            Author: Ankit Kaul
*******Code Belongs to Respective Author Only*************
*/
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/
/*freopen("input.txt", "rt", stdin);
freopen("output.txt", "wt", stdout);
*/
#include <bits/stdc++.h>
#define endl       '\n'
#define PI          3.141592653589
#define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           1000000007
#define int         long long int
#define inf         INT_MAX
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
using namespace std;
int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
    int result=1;
    while(n>0)
        {   if(n % 2 ==1)
            result=(result * x)%M;
            x=(x*x)%M;
            n=n/2;
        }
    return result%M;
}
bool isPrime(int n)
    {
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
    }
int inv(int a,int m)
{   return power(a,m-2);
}   
int lcm(int a,int b)
{   return a*b/(gcd(a,b));
}
signed main()
{   jaldi
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    sort(a,a+n);
    int count=0;
    for(int i=0;i<n;i++)
    {   for(int j=i+1;j<n;j++)
        {   for(int k=j+1;k<n;k++)
            {   if(a[i]!=a[j] && a[j]!=a[k])
                {   if(a[i]+a[j]>a[k])
                    count++;
                }
            }
        }
    }
    cout<<count;
}



Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll L;
ll K = 0;
ll t;
ll ret = 0;
string s;

void input() {
  IN(L);
}

void solve() {
  double a = ((double)L)/3.0;
  cout << setprecision(10) << a*a*a << endl;
}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 256
open Batteries
module CountDict = Map.Make(Int)
let cnt_int lst =
  let rec add_lst dict l =
    match l with
    | [] -> dict
    | first :: rest ->
      if CountDict.mem first dict then add_lst (CountDict.add first ((CountDict.find first dict) + 1) dict) rest else
      add_lst (CountDict.add first 1 dict) rest
  in add_lst CountDict.empty lst
let n = read_int ()
let a = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ fun a -> a
let dp = Array.init (n+1) (fun _ -> 0)

let rec loop i =
  if i >= n then () else (dp.(i+1) <- dp.(i) + a.(i); loop (i+1))

let _ = dp.(1) <- a.(0); loop 1

let dict = cnt_int @@ Array.to_list dp

let _ = Printf.printf "%d\n" @@ (CountDict.fold (fun f m a -> a + (m * (m - 1))) dict 0) / 2


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

int main(){
	int N, K, S;
	cin >> N >> K >> S;
	vector<int> v;
	rep(i,K) v.push_back(S);
	if (S == 1e9) {
		rep(i,N-K) v.push_back(1);
	}
	else {
		rep(i,N-K) v.push_back(S+1);
	}
	rep(i,N) cout << v[i] << endl;
	return 0;
}


Measured memory_bytes: 3908
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>

using namespace std;

const int nmax = 1e9 + 7;
#define ll long long;

int main(){

  int N, Q; cin >> N >> Q;

  vector < vector <int> > graph(N);

  for (int i = 0; i < N - 1; i++){
    int a, b; cin >> a >> b;
    a--; b--;

    graph[a].push_back(b);
    graph[b].push_back(a);
  }

  vector <int> edge(N);
  edge[0] = 1;
  queue <int> que; que.push(0);

  while (!que.empty()){
    int start = que.front(); que.pop();
    for (int i = 0; i < graph[start].size(); i++){
      int next = graph[start][i];

      if (edge[next] == 0){
        edge[next] = edge[start] + 1;
        que.push(next);
      }
    }
  }
  
  vector <int> ans(N);
  for (int i = 0; i < Q; i++){
    int p, x; cin >> p >> x; p--;
    ans[p] += x;
  }

  vector <bool> checked(N);
  que.push(0); checked[0] = true;

  while (!que.empty()){
    int start = que.front(); que.pop();
    
    for (int i = 0; i < graph[start].size(); i++){
      int next = graph[start][i];

      if (checked[next] == false){
        checked[next] = true;
        que.push(next);
      }

      if (edge[next] == edge[start] + 1){
        ans[next] += ans[start];
      }
    }
    
  }

  for (int i = 0; i < N; i++){
    cout << ans[i];
    if (i != N - 1) cout << " ";
    else cout << endl;
  }
  
    

  

  return 0;
}


Measured memory_bytes: 16372
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n, q;
    cin >> n;
    vector<int> s(n+2);
    s[0] = -1;
    s[n+1] = 1000000001;
    for(int i=0;i<n;++i){
        cin >> s[i];   
    }
    sort(s.begin(), s.end());

    cin >> q;
    vector<int> t(q);
    for(int i=0;i<q;++i){
        cin >> t[i];   
    }

    int ans = 0;
    for(int i=0;i<q;++i){
        int ng = 0; // s[ng] は t[i] 未満の値が格納されている
        int ok = n; // s[ok] は t[i] 以上の値が格納されている
        while(ok-ng > 1) {
            int mid = (ok+ng)/2;
            if(s[mid] < t[i]) {
                ng = mid;
            } else {
                ok = mid;
            }
        }
        if(s[ok] == t[i]) ++ans;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3396
#include<vector>
#include<iostream>
#include<algorithm>
#include<functional>
#include<string>
#include<limits.h>
#include<cmath>
#include<queue>
#include<map>
#define rep(i,n) for (int i=0; i<n; i++)
using namespace std;
typedef long long ll;

ll gcd(ll a,ll b){
  ll r;
  while ((r=a%b)){a=b;b=r;}
  return b;
}

int main(){

  int n; cin >> n;
  int flag=0;
  for (int i=9; i>=1; i--){
    if (n % i==0 && n/i<=9) {flag=1;cout << "Yes" << endl; break;}
  }

  if (flag == 0) {cout << "No";}

  return 0;
}


Measured memory_bytes: 256
import bisect
N,M=map(int,input().split())
A=list(map(int,input().split()))
dic={}
s=0
for i in range(N):
  s+=A[i]
  r=s%M
  if r in dic.keys():
    dic[r].append(i)
  else:
    dic[r]=[i]
ans=0
s=0
for i in range(N):
  s+=A[i]
  r=s%M
  num=bisect.bisect_right(dic[r],i)
  ans+=(len(dic[r])-num)
  if r==0:ans+=1
print(ans)

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

using namespace std;

int main(){
    int N, Y;
    cin >> N >> Y;
    for (int x = 0; x <= N; ++x) {
        for (int y = 0; y <= N - x; ++y) {
            int z = N - x - y;
            if(10000*x + 5000*y + 1000*z == Y){
                cout << x <<  " ";
                cout << y <<  " ";
                cout << z << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
    return 0;
}


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

template <class T>
T root(std::vector<T>& v, T x) {
    return v[x] - x ? (v[x] = root(v, v[x])) : x;
}

template <class T>
void unite(std::vector<T>& v, T x, T y) {
    x = root(v, x);
    y = root(v, y);
    if (x != y) v[x] = y;
}

int main() {
    long long n, m;
    std::cin >> n >> m;
    std::vector<int> p(n);
    std::vector<std::deque<int>> g(n);
    for (int i = 0; i < n; i++) p[i] = i;
    for (int i = 0; i < m; i++) {
        int a, b;
        std::cin >> a >> b; a--; b--;
        unite(p, a, b);
        g[a].push_back(b);
        g[b].push_back(a);
    }
    std::map<int, std::deque<int>> sub;
    for (int i = 0; i < n; i++) {
        sub[root(p, p[i])].push_back(i);
    }

    long long a = 0, b = 0, c = 0;
    std::vector<bool> done(n, false), color(n);
    for (auto& s : sub) {
        auto v = s.second;
        if (v.size() == 1) {
            b++;
            continue;
        }
        std::deque<int> q;
        q.push_back(v[0]);
        color[v[0]] = true;
        bool odd = false;
        while (!q.empty()) {
            auto curr = q.front();
            done[curr] = true;
            for (auto to : g[curr]) {
                if (done[to] && color[to] == color[curr]) {
                    odd = true;
                    break;
                } else if (!done[to]) {
                    q.push_back(to);
                    color[to] = !color[curr];
                }
            }
            q.pop_front();
            if (odd) break;
        }
        if (odd) a++;
        else c++;
    }
    // std::cout << a << " " << b << " " << c << std::endl;

    std::cout << (a * a + 2 * a * c + 2 * c * c + 2 * n * b - b * b) << std::endl;

    return 0;
}

Measured memory_bytes: 139776