akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct {
  int value;
  int weight;
  char type;
  long int date;
  char name[21];
} Item;

int compar(const void *a, const void *b)
{
  Item *pa = (Item *)a;
  Item *pb = (Item *)b;
  if (pa->value > pb->value)
    return 1;
  if (pa->value == pb->value) {
    if (pa->weight > pb->weight) return 1;
    if (pa->weight == pb->weight) {
      if (pa->type > pb->type) return 1;
      if (pa->type == pb->type) {
        if (pa->date > pb->date) return 1;
        if (pa->date == pb->date) {
          int c=strcmp(pa->name, pb->name);
          if (c>0) return 1;
          else if (c==0) return 0;
        }
      }
    }
  }
  return -1;
}

int main()
{
  int i, j, n, t, len=1;
  fscanf(stdin, "%d", &n);
  Item items[n];
  for (i=0; i<n; i++)
    fscanf(stdin, "%d %d %c %ld %s\n", &items[i].value, &items[i].weight, &items[i].type, &items[i].date, items[i].name);
  
  qsort(items, n, sizeof(Item), compar);
  
  for (i=0; i<n; i++)
    fprintf(stdout, "%d %d %c %ld %s\n", items[i].value, items[i].weight, items[i].type, items[i].date, items[i].name);

  return 0;
}



Measured memory_bytes: 7716
#include <bits/stdc++.h>
#define SpeeD ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define ll long long
#define endl '\n'
//pair<int, int> *p=new pair<int, int>[n];
//std::vector<pair<int,int>> vp;
//v.push_back(make_pair(x,y))
//pair<int, int> p[1000001];
//string *s=new string [n];
//int freq[e];
//freq[a[i]-'a']++; freq[a[i]]++;
using namespace std;
ll n, t, m, c1, c2, c, x, y, z,sum, mn = 999999999, avg, pos, dif,k, mx, xi, yi;
const int MXN=1e5+7;
ll pre[MXN];
bool prime[MXN];

bool PE ( ll x )
{
    for ( ll i = 2; i * i <= x; i+=1+(i&1))
    if ( x % i == 0 )
    return false;
    return true;
}
ll dist[MXN];
void sieve()
{
    memset(prime , 1 , sizeof prime);

    for ( ll i = 2; i * i <= MXN; i+=1+(i&1))
    if (prime[i])
    {
          for (ll j = i * i; j < MXN; j +=i)
         prime[j] = false;
    }
}
bool vis [MXN], talked[MXN];

bool PR ( string s )
{
    int n = s.length();
    for ( ll i = 0; i < n / 2; i++ )
    if ( s[i] != s[n - i - 1] )
    return false;
    return true;
}
ll dsu[MXN];
int FindRoot (int i )
{
    if (dsu[i] == i)
    return i ;
    return dsu[i] = FindRoot(dsu[i]);
}
int main (void){
    SpeeD;
    
cin >> n;
for (int i = 1 ; i <= n ;i++){cin >> x;
if (i &1 && x&1)
c++;}
cout << c;




}

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

int main()
{
  int n;
  string s;
  cin >> n >> s;
  
  if(n%2 != 0)
  {
    cout << "No"<< endl;
    return 0;
  }
  
  for(int i = 0; i < (n/2); i++)
  {
    if(s[i] != s[i+(n/2)])
    {
      cout << "No"<< endl;
      return 0;
    }
  }
  
  cout << "Yes"<< endl;
  return 0;
}

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

using namespace std;
using ll = long long;
const int F = 26;

int n;
vector<int> c(F);
vector<vector<int>> a;

void init() {
    cin >> n;
    a.resize(n, vector<int>(F));
    for(int i = 0; i < F; i++)cin >> c[i];
    for(int i = 0; i < n; i++)for(int j = 0; j < F; j++)cin >> a[i][j];
}

int main()
{
    init();

    vector<int> last(F, -1);
    for(int i = 0; i < n; i++){ 
        vector<int> cur = a[i];
        for(int j = 0; j < F; j++)cur[j] += (i - last[j]) * c[j];
        int ind =  max_element(cur.begin(), cur.end()) - cur.begin() + 1;
        last[ind - 1] = i;
        cout << ind << endl;
    }
}

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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;

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

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



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  map<ll,ll> m;
  rep(i,n){
    if(a[i]<400) m[0]++;
    else if(a[i]<800) m[1]++;
    else if(a[i]<1200) m[2]++;
    else if(a[i]<1600) m[3]++;
    else if(a[i]<2000) m[4]++;
    else if(a[i]<2400) m[5]++;
    else if(a[i]<2800) m[6]++;
    else if(a[i]<3200) m[7]++;
    else m[8]++;
  }
  ll min=0, max=0;
  for(auto e: m){
    if(e.first!=8) max++, min++;
    else max+=e.second;
  }
  if(max!=0&&min==0) min=1;
  cout<<min<<" "<<max<<endl;
}

Measured memory_bytes: 256
/**
*    author:  yuya1234
*    created: 09.07.2020 16:41:50
**/

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define FORV(i,v) for(auto i=v.begin(); i!=v.end();i++)

#define ALL(v) (s).begin(), (s).end()
#define SORT(s) sort((s).begin(),(s).end())
#define SORTD(s) sort((s).rbegin(),(s).rend())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define SZ(x) ((int)(x).size())
#define MEMSET(v, h) memset((v), h, sizeof(v))

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

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


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

  ll a,b,c,d;
  cin>>a>>b>>c>>d;

  ll ans=0,e;
  e=lcm(c,d);
  ans=b-a+1-(b/c+b/d-b/e-(a-1)/c-(a-1)/d+(a-1)/e);
  
  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 3620
#include <vector>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <tuple>
#include <functional>
#include <limits>
#include <utility>
#include <string>
#include <iostream>

#define DEBUG

using namespace std;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Apply a function to each element of a tuple.
template <typename Tuple, typename Function, std::size_t... Indices>
void apply(Tuple&& tuple, Function&& function, std::index_sequence<Indices...>)
{
	// Don't unpack in function parameters because it's not guaranteed each parameter is evaluated from left to right.
	// [](auto&&...) {}((static_cast<void>(std::forward<Function>(function)(std::get<Indices>(std::forward<Tuple>(tuple)))), 0)...);

	// So, unpack in initializer list.
	static_cast<void>(std::initializer_list<int>{ (static_cast<void>(std::forward<Function>(function)(std::get<Indices>(std::forward<Tuple>(tuple)))), 0)... });
}

// Apply a function to each element of a tuple. (Helper method)
template <typename Tuple, typename Function>
void apply(Tuple&& tuple, Function&& function)
{
	constexpr std::size_t size(std::tuple_size<typename std::remove_reference<Tuple>::type>::value);
	apply(std::forward<Tuple>(tuple), std::forward<Function>(function), std::make_index_sequence<size>());
}

// Overload operator<< for tuple.
template <typename... Elements>
std::ostream& operator<<(std::ostream& os, const std::tuple<Elements...>& tuple)
{
	os << "( ";

	apply(tuple, [&os](const auto& element) { os << element << " "; });

	os << ")";

	return os;
}

// Overload operator<< for pair.
template <typename First, typename Second>
std::ostream& operator<<(std::ostream& os, const std::pair<First, Second>& pair)
{
	os << "( " << pair.first << " " << pair.second << " )";

	return os;
}

// Print each element of a container.
template <typename Container>
void print(const Container& container, const std::string& info = "")
{
#ifdef DEBUG

	for (auto it(begin(container)); it != end(container); ++it)
	{
		cout << *it;

		if (it != prev(end(container))) cout << " ";
	}

	cout << endl;

#endif
}

int main()
{
	auto insertionSort([](auto& container)
	{
		for (size_t i(0); i < container.size(); ++i)
		{
			auto key(container[i]);

			size_t j(i - 1);

			while (j >= 0 && container[j] > key)
			{
				container[j + 1] = container[j];
				--j;
			}

			container[j + 1] = key;

			print(container);
		}
	});

	vector<int> v;

	int len;
	cin >> len;

	for (size_t i(0); i < len; ++i)
	{
		int n;
		cin >> n;

		v.push_back(n);
	}

	insertionSort(v);

	// while (true) {}

	return 0;
}

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

using namespace std;

char mp[1000][1000];
char e[2][2];

int dx[4] = {-1, 0, -1, 0}, dy[4] = {-1, -1, 0, 0};
char a[3] = {'J', 'O', 'I'};

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

	int h, w; cin >> h >> w;

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

	for (int i = 0; i < 2; ++i) cin >> e[i];

	int sum = 0;

	for (int i = 0; i < h - 1; ++i) {
		for (int j = 0; j < w - 1; ++j) {
			if (mp[i][j] == e[0][0] && mp[i][j + 1] == e[0][1] && mp[i + 1][j] == e[1][0] && mp[i + 1][j + 1] == e[1][1]) {
				sum++;
			}
		}
	}

	int ans = sum;

	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			int sum2 = sum;

			char tmp = mp[i][j];

			int cnt = 0;

			for (int k = 0; k < 4; ++k) {
				int y = i + dy[k], x = j + dx[k];
				if (y < 0 || x < 0 || y + 1 >= h || x + 1 >= w) continue;
				if (mp[y][x] == e[0][0] && mp[y][x + 1] == e[0][1] && mp[y + 1][x] == e[1][0] && mp[y + 1][x + 1] == e[1][1]) {
					cnt++;
				}
			}

			sum2 -= cnt;
			
			for (int k = 0; k < 3; ++k) {
				mp[i][j] = a[k];

				int cnt2 = 0;

				for (int l = 0; l < 4; ++l) {
					int y = i + dy[l], x = j + dx[l];
					if (y < 0 || x < 0 || y + 1 >= h || x + 1 >= w) continue;
					if (mp[y][x] == e[0][0] && mp[y][x + 1] == e[0][1] && mp[y + 1][x] == e[1][0] && mp[y + 1][x + 1] == e[1][1]) {
						cnt2++;
					}
				}

				cnt = max(cnt, cnt2);
			}

			sum2 += cnt;

			mp[i][j] = tmp;

			ans = max(ans, sum2);
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 2180
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;

int main(){
  int N, M;cin>>N>>M;
  vii conflicts;
  for (int i=0;i<M;++i){
    int a,b;cin>>a>>b;conflicts.push_back({b,a});
  }
  sort(conflicts.begin(), conflicts.end());

  int ans=0;
  int pos=-1;
  for (int i=0;i<M;++i){
    if(conflicts[i].second>=pos){
      pos=conflicts[i].first;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1400
/* 
 * Project: okio Marine & Nichido Programing Contest 2020 B - Tag
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/06/13
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
#include <cstdlib> 
using namespace std;

long a, b;
long v, w;
long t;

void solve() {
    
    int diff = abs(a - b);
    int acc = w - v;
    if (acc >= 0) {
        printf("NO\n");
        return;
    }

    diff += acc * t;
    if (diff <= 0)
        printf("YES\n");
    else
        printf("NO\n");

}

int main() {

    scanf("%ld", &a);
    scanf("%ld", &v);
    scanf("%ld", &b);
    scanf("%ld", &w);
    scanf("%ld", &t);
    solve();

}

Measured memory_bytes: 3156
d, g = gets.chomp.split.map(&:to_i)
p = []
c = []
d.times do
  pp, cc = gets.chomp.split.map(&:to_i)
  p.push pp
  c.push cc
end

ans = Float::INFINITY

(2**d).times do |i|
  bits = i.to_s(2).split(//)
  (d - bits.length).times{bits.unshift('0')}

  sum = 0
  count = 0

  d.times do |i|
    next if bits[i] == '0'
    sum += (i+1) * 100 * p[i] + c[i]
    count += p[i]
  end
  if sum >= g
    ans = [ans, count].min
    #p([bits, ' ', sum, count, ans])
    next
  end
  
  flg = false
  (d-1).downto(0).each do |i|
    next if bits[i] == '1'
    p[i].times do |j|
      sum += (i+1) * 100
      count += 1
      if sum >= g
        ans = [ans, count].min
        flg = true
        break
      end
    end
    break if flg

    sum += c[i]
    if sum >= g
      ans = [ans, count].min
      break
    end
  end
  #p([bits, ' ', sum, count, ans])
end

puts ans

Measured memory_bytes: 3836
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
using ll=long long;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=1e9;
const ll INF=1e18;
using P=pair<int,int>;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  ll n,k,ans=0;
  cin >> n >> k;
  if(k==0) {
    cout << n*n << endl;
    return 0;
  }
  /*k=2,b=3のとき
  a=1,2,3|4,5,6|7,8...
    1,2,0|1,2,0|1,2,0...*/
  for(int i=k+1; i<=n; i++) {
    ans+=n/i*(i-k)+max(0LL,n%i-k+1);
  }
  cout << ans << endl;
}


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

int main(){
  string S;
  cin>>S;
  int count;
  for(int i=0;i<S.length();i++){
    if(S[i]=='0')
      count++;
  }

  if(S.length()-count<count)count=S.length()-count;


  cout<<count*2;

}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();

		int dab = Math.abs(a - b);
		int dbc = Math.abs(b - c);
		int dca = Math.abs(c - a);

		System.out.println((dca <= d) || (dab <= d && dbc <= d) ? "Yes" : "No");
	}

}


Measured memory_bytes: 21844
const int isDebugMode = 1;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long gcd(T1 a, T2 b){return a % b ? gcd(b , a % b) : b;}
template<class T1, class T2> void reduce(T1 &a, T2 &b){ll g = gcd(a, b); a /= g; b /= g; return;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

int D;
vector<int> c(26);
int ss[365][26];
vector<int> ans(0);

double powyabai = 1.7;
double cyabaipow = 1.4;
double uresisapow = 1.3;

double evaluate(int day, int kind){

    double yabasa = 0;
    int s = ans.size();
    int idx;
    for(idx = s - 1; 0 <= idx; idx--){
        if(ans[idx] == kind) break;
    }
    yabasa = pow(day - idx, powyabai) * pow(c[kind], cyabaipow);
    double uresisa = pow(ss[day][kind], uresisapow);
    return yabasa + uresisa;
}

int main(){
    cin >> D;
    rep(i, 26) cin >> c[i];
    rep(i, D)rep(j, 26) cin >> ss[i][j];
    rep(i, D){
        double max_eva = -inf;
        double choice = 0;
        rep(j, 26){
            if(chmax(max_eva, evaluate(i, j))) choice = j;
        }
        ans.push_back(choice);
    }
    rep(i, D) pt(ans[i] + 1);
    return 0;
}

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

#define COUT(x) cout << x << endl
#define CIN(x) cin >> x
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
#define EXIST(s, e) (s.find(e) != s.end())
#define SORT(c) sort(c.begin(), c.end())
#define ERASEUNIQE(v) v.erase(unique(v.begin(), v.end()), v.end())

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

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

// typedef
typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

// container util
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()

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

// debug
#define dump(x) cerr << #x << " = " << x << endl;
#define debug(x) cerr << #x << " = " << x << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

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

int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};

int main(int argc, char const *argv[])
{
    int n, k;
    LL ans = 0;
    CIN(n), CIN(k);

    ans += pow((n / k), 3);

    if (k % 2 == 0)
    {
        ans += pow(((n + k / 2) / k), 3);
    }

    COUT(ans);

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple

int main(void)
{
    cin.sync_with_stdio(false);
    int N;
    cin >> N;
    vector<ll> As(N);
    REP(n, N) cin >> As[n];
    sort(ALL(As));

    if (N == 2) {
        cout << As[1] << " " << As[0] << endl;
    }
    else {
        auto n = As[N-1];
        int k = 0;
        auto min_diff = 1e9 + 100;
        for(auto a: As) {
            int diff = 0;
            if (n % 2) {
                auto diff1 = abs(n / 2 - a);
                auto diff2 = abs(n / 2 + 1 - a);
                diff = min(diff1, diff2);
            }
            else {
                diff = abs(n / 2 - a);
            }
            if (diff < min_diff) {
                min_diff = diff;
                k = a;
            }
        }
        cout << n << " " << k << endl;
    }

    

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=((ll)n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=((ll)a);i<((ll)n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    fcout(10)<<(n*2*PI)<<endl;;
    return 0;
}

Measured memory_bytes: 3796
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int n[3];
  n[0]=0;
  n[1]=0;
  n[2]=0;
  int i;
  for(i=0;i<s.length();i++){
    n[(int)(s[i]-'a')]++;
  }
  if(max(n[0],max(n[1],n[2]))-min(min(n[0],n[1]),n[2])<=1)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
//In wrong answers we believe//
#define db 				double
#define ll 				long long int
#define ld				long long double
//#define int 			long long int
#define ull 			unsigned long long
#define vii 			vector <int>
#define vll 			vector < ll >
#define pii 			pair <int, int>
#define fi 				first
#define se 				second
#define rep(i,a,n)      for(int i=a;i<n;i++)
#define endl 			'\n'
#define mem(a,b) 		memset(a, b, sizeof a)
#define mkp 			make_pair
#define pb 				push_back
#define max3(a,b,c) 	max(a,max(b,c))
#define min3(a,b,c) 	min(a,min(b,c))
#define w(t)            int t; cin>>t; while(t--)
#define all(a)			a.begin(), a.end()
using namespace std;
db pi		 =			2*acos(0.0);
db eps       =			0.000001;
ll mod       =			(1e9+7);   //998244353
const ll INF =			1000000000000000LL;
void print(vector <int> &arr){
    for(int i=0;i<arr.size();i++)
        cout<<arr[i]<<" ";
    
    cout<<endl;
}
void printll(vector <ll> &arr){
    for(int i=0;i<arr.size();i++)
        cout<<arr[i]<<" ";
    
    cout<<endl;
}

ll ncr(ll n, ll r)
{
    r=min(r,n-r);
    ll A[r],i,j,B[r];
    iota(A,A+r,n-r+1);  
    iota(B,B+r,1);     

    ll g;
    for(i=0;i<r;i++)
    for(j=0;j<r;j++)
    {
        if(B[i]==1)
            break;
        g=__gcd(B[i], A[j] );
        A[j]/=g;
        B[i]/=g;
    }
    ll ans=1;
    for(i=0;i<r;i++)
        ans=(ans*A[i]%mod);
    return ans;
}
const int SIZE=100001;
bool judgePermutation(int a[], int n){
    static int used[SIZE+1];
    for(int i = 1; i <= n; i++) used[i] = 0;
    for(int i = 0; i < n; i++) used[a[i]] = 1;
    for(int i = 1; i <= n; i++) {
        if(!used[i]) return 0;
    }
    return 1;
}


int main(){	
//CONDITION && cout << "YES" || cout << "NO"; cout << '\n';
//////////////////////////////////////////////////////////////////////
//  ios_base::sync_with_stdio(false);
//  cin.tie(NULL);
//  cout.tie(NULL);
//  cerr.tie(NULL);
//For fast IO
///////////////////////////////////////////////////////////////////// 
//  std::cout.unsetf ( std::ios::floatfield );  // floatfield not set
//  std::cout.precision(10);
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
	int n;
	cin>>n;
	set < string > s;
	rep(i,0,n){
		string ss;
		cin>>ss;
		s.insert(ss);
	}
	cout<<s.size()<<endl;
    return 0;
    }

Measured memory_bytes: 19248
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  cin >> a >> b;
  if(a % 2 == 1 && b % 2 == 1){
  	cout << "Odd" << endl;
  }else{
  	cout << "Even" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define db pop_back
#define q2(n) (n%2)==0
#define vp vector<pair <ll,ll> >
#define vctr vector<ll>
#define in(a) cin>>a;
#define out(a) cout<<a<<"\n";
#define nxt() cout<<"\n";
#define no() cout<<"NO\n";
#define yes() cout<<"YES\n";
#define bug1() cout<<"@ ";
#define bug2() cout<<"# ";
#define ff first
#define ss second
#define ip(n) ll n; cin>>n;
#define ipar(ar,n) ll ar[n]; loop(i,0,n) cin>>ar[i];
#define opar(ar,n) loop(i,0,n) cout<<ar[i]<<" ";
#define loop(i,m,p) for (ll i = m; i < p; i++)
#define loopn(i,m,p) for (ll i = p-1; i >=m; --i)

using namespace std;

int main()
{
     ll t=1;
  //ip(t)
  while(t--)
  {
      string s;
      cin>>s;
      int n=s.length();
      if(s[n-1]=='s')
        s+="es";
      else
        s+="s";
      cout<<s<<endl;



  }

return 0;
}




Measured memory_bytes: 3628
h = []
w = []

while True:
    indata = list(map(int, input().split()))
    if indata[0] == 0 and indata[1] == 0:
        break
    h.append(indata[0])
    w.append(indata[1])

k = 0

while k != len(h):
    for i in range(h[k]):
        for j in range(w[k]):
            if j == 0 or j == (w[k]-1) or i == 0 or i == (h[k]-1):
                print("#", end="")
            else:
                print(".", end="")
        print("\n", end="")
    print("\n", end="")
    k += 1

Measured memory_bytes: 9140
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <ctime>
#define INF 2000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

bool debug=false;
/*---------------------------------------------------*/

int main(){
  int n,a;
  vector<ll>use;
  map<ll,ll> m;
  cin>>n;
  rep(i,n){
    cin>>a;
    m[a]++;
    if(m[a]/2==1){
      m[a]-=2;
      use.pb(a);
    }
  }
  sort(all(use));
  reverse(all(use));
  if(use.size()<2)cout<<0<<endl;
  else cout<<use[0]*use[1]<<endl;
  return 0;
}


Measured memory_bytes: 6528
#include <stdio.h>
int main(){
    int i,a=0;
    char arr[3];
    scanf("%s",arr);
    for (i=0;i<3;i++) {
        if (arr[i]=='o')
            a =(a+1);
    }
    printf("%d\n",700+(100*a));
    return 0;

}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
const int INF=1e9+5;
int main()
{
  int n;
  cin>>n;
  int h[n];
  int i=0;
   int dp[n];
  while(i<n)
  {
    cin>>h[i];
    dp[i]=INF;
    i++;
  }
  i=0;
  dp[0]=0;
  for(;i<n;i++)
  {
    int j=1;
    while(j<3)
    {
      if(i+j<n)
      dp[i+j]=min(dp[i+j],abs(h[i]-h[i+j])+dp[i]);
      j++;
    }
    //cout<<dp[i]<<" ";
  }
  cout<<dp[n-1]<<endl;
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define inf 0x7fffffff
#define RG register
#define inf 0x7fffffff
#define maxn 200005
#define maxm 200005
using namespace std;
typedef long long ll;
inline ll read(){
    ll x = 0, f = 1;
    char ch = getchar();
    while(ch > '9' || ch < '0') {if(ch == '-') f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x *10 + ch -'0';ch = getchar();}
    return x * f;
}
int n,m;
int main(){
	int i,j,u,v;
	n=read();
	int a[105];
	for(i=1;i<=n;i++){
		a[i]=read();
	}
	sort(a+1,a+n+1);
	int cnt=0;
	for(i=1;i<=n;i++){
		for(j=i+1;j<=n;j++)
			for(int k=j+1;k<=n;k++){
				if(a[i]+a[j]>a[k]&&a[i]!=a[j]&&a[j]!=a[k]) cnt++;
			}
	}
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 3600
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;

//置換状態を表す構造体
class perm_state
{
private:
	std::vector<long long>data;
public:
	perm_state(int n)
	{
		for (unsigned int i = 0; i < n; ++i)
		{
			data.push_back(i);
		}
	}
	perm_state operator*(const perm_state &other)
	{
		perm_state ret(data.size());
		for (unsigned int i = 0; i < data.size(); ++i)
		{
			ret.data[i] = other.at(data[i]);
		}
		return ret;
	}
	void swap(unsigned int a, unsigned int b)
	{
		long long tmp = data[a];
		data[a] = data[b];
		data[b] = tmp;
	}
	long long at(unsigned int i)const
	{
		return data[i];
	}
};

perm_state perm_pow(perm_state a_, unsigned long long x_,unsigned int size_)
{
	if (x_ == 0)return perm_state(size_);
	perm_state ans = perm_pow(a_, x_ / 2, size_);
	return ans * ans * ((x_ % 2) ? a_ : perm_state(size_));
}

using ll = long long;

int n;
ll x[123456];
int m;
ll k;
int a[123456];
ll head;
ll diff[123456];

int main(void)
{
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)scanf("%lld", x + i);
	scanf("%d %lld", &m, &k);
	for (int j = 0; j < m; ++j)scanf("%d", a + j);
	head = x[0];
	for (int i = 1; i < n; ++i)
	{
		diff[i - 1] = x[i] - x[i - 1];
	}
	perm_state one(n - 1);
	for (int j = 0; j < m; ++j)
	{
		one.swap(a[j] - 2, a[j] - 1);
	}
	perm_state result = perm_pow(one, k, n - 1);
	ll answer = head;
	for (int i = 0; i < n - 1; ++i)
	{
		printf("%lf\n", (double)answer);
		answer += diff[result.at(i)];
	}
	printf("%lf\n", (double)answer);
	return 0;
}


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

typedef long long ll;

map <string, int> anag;

int main() {
	int n;
	ll ans = 0;
	string s;
	cin >> n;
	while (n--) {
		cin >> s;
		sort(begin(s), end(s));
		anag[s]++;
	}
	for (auto x : anag) {
		ans += (1ll * x.second * (1ll * x.second - 1ll)) / 2ll; 
	}
	printf("%lld\n", ans);
	return 0;
}

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

int main() {
  int N;
  cin >> N;
  
  if(N % 2 == 1){
    cout << (N + 1) / 2 << endl;
  }
  if(N % 2 == 0){
    cout << N / 2 << endl;
  }
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	int a;
	cin>>a;
	if(a==3||a==5||a==7)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long
#define ld long double
#define pii pair<int,int>
#define fi first
#define se second
#define mex 1000005
#define fast  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
vector<int> adj[mex];
//a+b=a^b+2*(a&b)
ll a[51][51];
ll b[51][51];
ll n,k;

void multiply(ll a[51][51], ll b[51][51]){
	ll c[51][51];
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			c[i][j]=0;
			for(int k=0;k<n;k++){
				c[i][j]=(c[i][j]+a[i][k]*b[k][j])%mod;
			}
		}
	}
	
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++)
		 a[i][j]=c[i][j]%mod;
	}
}

void mult(ll k){
	if(k==1)
	 return; 
	mult(k/2);
	multiply(a,a);
	 
	if(k&1)
	 multiply(a,b);
	
	return ;
}
  
int main(){
	fast
	
	cin>>n>>k;
	
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
		 cin>>a[i][j];
		 b[i][j]=a[i][j];
	    }
	}
	mult(k);
	ll tt=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++)
		 tt=(tt+a[i][j])%mod;
    }
    cout<<tt;	
}


Measured memory_bytes: 23808
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func scanStringToken() (word string) {
	scanner.Scan()
	word = scanner.Text()
	return
}

func scanNumberToken() (num int) {
	scanner.Scan()
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return
}

func main() {
	// ※デフォルトでは行単位で読み込む設定になっているので、設定を変えたくないならやらなくていい。
	// SplitFuncはScannerが読み込む単位を設定する関数。行単位とか、単語単位とか。
	// デフォルトでいくつかの関数が用意されている。
	// https://golang.org/pkg/bufio/#ScanBytes
	// https://golang.org/pkg/bufio/#ScanLines
	// https://golang.org/pkg/bufio/#ScanRunes
	// https://golang.org/pkg/bufio/#ScanWords
	// scanner.Split(bufio.ScanWords)

	m := make(map[string]int64, 4)
	a := scanNumberToken()
	for i := 0; i < a; i++ {
		s := scanStringToken()
		m[s]++
	}

	fmt.Println(fmt.Sprintf("AC x %v", m["AC"]))
	fmt.Println(fmt.Sprintf("WA x %v", m["WA"]))
	fmt.Println(fmt.Sprintf("TLE x %v", m["TLE"]))
	fmt.Println(fmt.Sprintf("RE x %v", m["RE"]))

}


Measured memory_bytes: 2092
n,d = map(int,input().split())
ab = []
for _ in range(n):
    a, b = (int(x) for x in input().split())
    ab.append([a, b])

ans = 0

for i in range(n):
    if ab[i][0]**2+ab[i][1]**2 <= d**2:
        ans += 1
print(ans)

Measured memory_bytes: 99108
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cctype>
using namespace std;

char F[70][70];

// s <= t ?
bool compare(string &s, string &t) {
  int ls, lt;
  for(ls = 0; s[ls] == '0'; ++ls) ;
  for(lt = 0; t[lt] == '0'; ++lt) ;
  s = s.substr(ls);
  t = t.substr(lt);
  if(s.length() < t.length()) return true;
  if(s.length() > t.length()) return false;
  return s <= t;
}

int main() {
  ios::sync_with_stdio(false);
  while(true) {
    int W, H; cin >> W >> H;
    if(W == 0 && H == 0) break;
    for(int i = 0; i < H; ++i) cin >> F[i];
    string ans = "0";
    queue<pair<string,pair<int,int>>> Q;
    for(int i = 0; i < H; ++i) {
      for(int j = 0; j < W; ++j) {
        if(isdigit(F[i][j])) {
          string s;
          s.push_back(F[i][j]);
          Q.emplace(make_pair(s,make_pair(i,j)));
        }
      }
    }
    string G[H][W];
    for(int i = 0; i < H; ++i) {
      for(int j = 0; j < W; ++j) {
        G[i][j] = "0";
      }
    }
    while(!Q.empty()) {
      auto p = Q.front(); Q.pop();
      if(compare(ans, p.first)) ans = p.first;
      int i = p.second.first;
      int j = p.second.second;
      if(compare(G[i][j],p.first) == false) continue;
      if(i + 1 < H && isdigit(F[i+1][j])) {
        string s = p.first;
        s.push_back(F[i+1][j]);
        if(compare(s,G[i+1][j]) == false) {
          G[i+1][j] = s;
          Q.emplace(make_pair(s,make_pair(i+1,j)));
        }
      }
      if(j + 1 < W && isdigit(F[i][j+1])) {
        string s = p.first;
        s.push_back(F[i][j+1]);
        if(compare(s,G[i][j+1]) == false) {
          G[i][j+1] = s;
          Q.emplace(make_pair(s,make_pair(i,j+1)));
        }
      }
    }
    int l = 0;
    while(ans[l] == '0') ++l;
    ans = ans.substr(l);
    if(ans == "") cout << "0" << endl;
    else cout << ans << endl;
  }
}

Measured memory_bytes: 1536
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	ld l;
	cin >> l;
	cout << fixed << setprecision(10) << (l / 3 * (l) / 3 * (l) / 3) << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define maxn 100020
#define rep(i,l,r) for(register int i = l ; i <= r ; i++)
#define repd(i,r,l) for(register int i = r ; i >= l ; i--)
#define rvc(i,S) for(register int i = 0 ; i < (int)S.size() ; i++)
#define rvcd(i,S) for(register int i = ((int)S.size()) - 1 ; i >= 0 ; i--)
#define fore(i,x)for (register int i = head[x] ; i ; i = e[i].next)
#define pb push_back
#define prev prev_
#define stack stack_
#define mp make_pair
#define fi first
#define se second
#define inf 0x3f3f3f3f
typedef long long ll;
typedef pair<int,int> pr;

struct node{
	int x,y,w;
};
int L;
int n,m;
vector <node> edge;

int main(){
	scanf("%d",&L);
	while ( L >= (1 << n) ) n++;
	rep(i,1,n - 1) edge.pb((node){i,i + 1,1 << (i - 1)}) , edge.pb((node){i,i + 1,0});
	int len = L - (1 << (n - 1));
	repd(i,n - 1,0){
		if ( len & (1 << i) ){
			edge.pb((node){i + 1,n,L - (1 << i)});
			L -= (1 << i);
		}
	}
	cout<<n<<" "<<edge.size()<<endl;
	rvc(i,edge){
		cout<<edge[i].x<<" "<<edge[i].y<<" "<<edge[i].w<<endl;
	}
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

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

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  VI a(n), b(n), c(n);
  REP(i, 0, n) {
    cin >> a[i];
  }
  REP(i, 0, n) {
    cin >> b[i];
  }
  REP(i, 0, n) {
    cin >> c[i];
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());
  VL bc(n);
  REP(i, 0, n) {
    bc[i] = c.end() - upper_bound(c.begin(), c.end(), b[i]);
  }
  for (int i = n - 2; i >= 0; --i) {
    bc[i] += bc[i + 1];
  }
  VL ac(n);
  ll tot = 0;
  REP(i, 0, n) {
    int tmp = upper_bound(b.begin(), b.end(), a[i]) - b.begin();
    if (tmp < n) {
      tot += bc[tmp];
    }
  }
  cout << tot << "\n";
}


Measured memory_bytes: 2944
MOD = 10**9+7
n = int(input())
from collections import defaultdict
d = defaultdict(int)
for i in range(2, n+1):
  j = 2
  while j*j<=i:
    while i%j==0:
      i //= j
      d[j] += 1
    j += 1
  if i>1:
    d[i] += 1
ans = 1
for ele in d.values():
  ans = ans*(ele+1)%MOD
print(ans)

Measured memory_bytes: 3316
#include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int range(double p,double q,double r){
  return (q<r?q:r)<p&&p<(q<r?r:q);
}
int rangea(double p,double q,double r){
  if(q*r<0&&fabs(q)+fabs(r)>M_PI){
    p+=2*M_PI*(p<0);
    q+=2*M_PI*(q<0);
    r+=2*M_PI*(r<0);
  }
  return range(p,q,r);
}
int pit(int x0,int y0,int x1,int y1,int x2,int y2,int xp,int yp){
  if(rangea(atan2(y0-yp,x0-xp),atan2(y0-y1,x0-x1),atan2(y0-y2,x0-x2)))
    if(rangea(atan2(y1-yp,x1-xp),atan2(y1-y0,x1-x0),atan2(y1-y2,x1-x2)))
      return 1;
  return 0;
}
int main(){
  int i;
  int n,x0,x1,x2,y0,y1,y2,xp,yp,xq,yq;
  vector<int> b;
  cin>>n;
  b.reserve(n);
  for(i=0;i<n;i++){
    cin>>x0>>y0>>x1>>y1>>x2>>y2>>xp>>yp>>xq>>yq;
    if(pit(x0,y0,x1,y1,x2,y2,xp,yp)^pit(x0,y0,x1,y1,x2,y2,xq,yq))
      b[i]=1;
    else
      b[i]=0;
  }
  for(i=0;i<n;i++){
    if(b[i])
      cout<<"OK"<<endl;
    else
      cout<<"NG"<<endl;
  }
  return 0;
}

Measured memory_bytes: 952
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i==n-1];};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    ll x[100010];
    rep(i,0,N) cin >> x[i];
    ll val[100010] = {};
    ll cur = 0;
    rep(i,0,N){
        if(i == 0){
            val[i] = cur;
        }else{
            ll prev = x[i-1];
            ll num = i - cur;
            if(prev < 2 * num - 1){
                cur++;
                val[i] = cur;
            }else{
                val[i] = cur;
            }
        }
    }
    ll ans = 1;
    rep(i,0,N){
        ll p = upper_bound(val, val+N, i) - val;
        ans *= (p-i);
        ans %= MOD;
    }
    print(ans);
}

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

using namespace std;


int main()
{
  	int x,n;
	cin>>x>>n;
	if(n==0)
	{
		cout<<x;
		return 0;
	}
	int a[102];
	for(int i=0;i<102;i++)
		a[i]=-1;
	for(int i=0;i<n;i++)
	{
		int xx;
		cin>>xx;
		a[xx]=1;
	}
	int ans=abs(x+1),val=-1;
	
	for(int i=0;i<=101;i++)
	{
		if(a[i]==-1)
		{
			if(ans>abs(x-i))
			{
				ans=abs(x-i);
				val=i;
			}
		}
	}
	cout<<val;
}

Measured memory_bytes: 3628
#include<iostream>

int main(){
    int N;
    int count = 0 , maxCount = 0,num,maxNum = 1;
    std::cin >> N;
    bool flag = true;

    for(int i = 1 ; i <= N;i++){
        flag = true;
        num = i;
        count = 0;
        while(flag){
           if( num % 2 == 0 ){
               num /= 2;
               count++;
           }else{
               flag = false;
           }
        }
        if(maxCount < count){
            maxCount = count;
            maxNum = i;
        }
    }
    std::cout << maxNum;
}

Measured memory_bytes: 256
macro_rules! get {
    (Vec<$t:ty>) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn bis<F>(ok: i64, ng: i64, p: F) -> i64
    where F : Fn(i64) -> bool {

    let mid = (ok + ng) / 2;
    if (ok - ng).abs() == 1 {
        ok
    } else if p(mid) {
        bis(mid, ng, p)
    } else {
        bis(ok, mid, p)
    }
}

fn main() {
    let N = get!(usize);
    let mut A = get!(Vec<usize>);
    let mut B = get!(Vec<usize>);
    let mut C = get!(Vec<usize>);

    A.push(0);
    A.sort();
    B.push(0);
    B.sort();
    C.sort();

    // 二分探索により、上に乗せられるパーツを求める
    // 計算の無駄を省くため、累積和を計算しておく
    let mut dp = vec!(0; N + 1);
    let mut acc = 0;
    for i in 1..(N + 1) {
        let j = bis(0, (N + 1) as i64, |k| { A[k as usize] < B[i] });
        acc += j;
        dp[i] = acc;
    }
    let ans = C.iter()
        .map(|&c| { dp[bis(0, (N + 1) as i64, |k| { B[k as usize] < c }) as usize] })
        .sum::<i64>();

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


Measured memory_bytes: 13560
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int compare_int(const void *a, const void *b)
{
	return *(int *)a - *(int *)b;
}

int main(void)
{
	int i, j;
	//  dic_t dic[200000];
	int min, max;
	int len, flg;
	int cnt, maxcnt;
	long  aa,bb,cc,dd,ee;
	scanf("%ld %ld %ld", &aa,&bb,&cc);
//	printf("%ld %ld %ld", aa,bb,cc);
    if(bb == 0){
      printf("0\n");
      return 0;
    }
	dd = aa /(bb+cc);	
	ee = aa %(bb+cc);	
//  printf("dd%ld ee%ld",dd,ee);
	if(bb < ee){
  printf("%ld",dd*bb+bb);
    }
  else{
  printf("%ld",dd*bb+ee);
  }
  return 0;


}


Measured memory_bytes: 128