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

int dp[3010][3010] = {0};

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

    int s_len = s.size();
    int t_len = t.size();
    for (int i = 0; i < s_len; i++)
    {
        for (int j = 0; j < t_len; j++)
        {
            if (s[i] == t[j])
            {
                dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1);
            }
            else
            {
                dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1]);
            }
        }
    }

    // 復元
    int i, j;
    i = s_len;
    j = t_len;
    string ans = "";
    while (i > 0 && j > 0)
    {
        if (dp[i][j] == dp[i - 1][j])
        {
            i--;
        }
        else if (dp[i][j] == dp[i][j - 1])
        {
            j--;
        }
        else
        {
            ans = s[i - 1] + ans;
            i--;
            j--;
        }
    }

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

Measured memory_bytes: 35584
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  a[i] = a[i] - (i+1)
a.sort()
ans = 0
if n%2==0:
  c1 = (a[n//2-1]+a[n//2])//2
  c2 = (a[n//2-1]+a[n//2]-1)//2 + 1
  sum1 = 0
  sum2 = 0
  for i in range(n):
    sum1 += abs(a[i]-c1)
    sum2 += abs(a[i]-c2)
  ans = min(sum1, sum2)
else:
  c = a[(n-1)//2]
  for i in range(n):
    ans += abs(a[i]-c)
print(ans)

Measured memory_bytes: 25744
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S; cin >> S;
    if (S[2] == S[3] && S[4] == S[5] ) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <queue>
#include <iostream>
#include <bits/stdc++.h>
#include<stdio.h>
#include<string.h>
#include<fstream>
#include<deque>

#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
//#define int long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
using namespace std;
ll num=0;
ll target;
deque<ll> que;
ll endf=0;

void dfs(){
    if(!que.empty()){
    ll temp=que.front();
    que.pop_front();

    if(temp%10!=0){
        num++;
        if(num==target){
            cout<<temp*10+temp%10-1;
            endf=1;
        }
        que.push_back(temp*10+temp%10-1);
    }

    num++;
    if(num==target){
        cout<<temp*10+temp%10;
        endf=1;
    }
    que.push_back(temp*10+temp%10);
    

    if(temp%10!=9){
        num++;
        if(num==target){
            cout<<temp*10+temp%10+1;
            endf=1;
        }
        que.push_back(temp*10+temp%10+1);
    }
    if(endf==1){
        while(!que.empty()) que.pop_front();
    }
        dfs();
    }
}



int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
       
    ll i,j,k,p=1,q=1;
    ll n,m,tmp;
    string s[200000];
    string str;
    ll sum=0;
    ll strr[200005];
    cin>>n;
    //que.resize(1000000);
    target=n;
    que.push_back(1);
    que.push_back(2);
    que.push_back(3);
    que.push_back(4);
    que.push_back(5);
    que.push_back(6);
    que.push_back(7);
    que.push_back(8);
    que.push_back(9);
    num=9;
    if(n<10){
        cout<<n<<endl;
        return 0;
    }
    dfs();
    ln;
    return 0;
}

Measured memory_bytes: 3968
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define P pair<int,int>
#define PP pair<P,int>
#define fi first
#define se second
#define INF 1e9
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    string st;
    cin>>st;
    int ans=0;
    if(st.length()%2==0){
        ans^=1;
    }
    if(st[0]==st[st.length()-1]){
        ans^=1;
    }
    if(ans){
        cout<<"Second"<<endl;
    }else{
        cout<<"First"<<endl;
    }
    return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  
  vector<int> a(m), b(m);
  
  for(int i = 0; i < m; i++) {
  	cin >> a.at(i) >> b.at(i);
  }
  
  for(int i = 0; i < n; i++) {
    int count = 0;
  for(int j = 0; j < m; j++) {
  	if(a.at(j) == i + 1 || b.at(j) == i + 1) {
    	count++;
    }
  }
  	cout << count << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int minDist(const vector<string>& plane, char wall, int y1, int x1, int y2, int x2)
{
    int dy[] = {0, 0, -1, 1};
    int dx[] = {-1, 1, 0, 0};

    int h = plane.size();
    int w = plane[0].size();

    queue<pair<int, int> > q;
    vector<vector<bool> > check(h, vector<bool>(w, false));
    q.push(make_pair(y1, x1));
    check[y1][x1] = true;
    int ret = 0;
    while(!q.empty()){
        queue<pair<int, int> > q1;
        while(!q.empty()){
            int y = q.front().first;
            int x = q.front().second;
            q.pop();
            if(y == y2 && x == x2)
                return ret;
            for(int i=0; i<4; ++i){
                int y0 = y + dy[i];
                int x0 = x + dx[i];
                if(0 <= y0 && y0 < h && 0 <= x0 && x0 < w && plane[y0][x0] != wall && !check[y0][x0]){
                    q1.push(make_pair(y0, x0));
                    check[y0][x0] = true;
                }
            }
        }
        ++ ret;
        q = q1;
    }
    return -1;
}

int main()
{
    int h, w, n;
    cin >> h >> w >> n;

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

    vector<int> y(n+1), x(n+1);
    for(int i=0; i<h; ++i){
        for(int j=0; j<w; ++j){
            if(plane[i][j] == 'S'){
                y[0] = i;
                x[0] = j;
            }else if('0' <= plane[i][j] && plane[i][j] <= '9'){
                y[plane[i][j]-'0'] = i;
                x[plane[i][j]-'0'] = j;
            }
        }
    }

    int ret = 0;
    for(int i=0; i<n; ++i)
        ret += minDist(plane, 'X', y[i], x[i], y[i+1], x[i+1]);
    cout << ret << endl;

    return 0;
}

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

int f(int w,int h)
{
    if(w>=h){
        if(w%h==0) return h;
        return f(h,w%h);
    }
    else{
        swap(w,h);
        if(w%h==0) return h;
        return f(h,w%h);
    }
}

int main()
{
    int w,h,c;
    cin >> w >> h >> c;
    int a=f(w,h);
    a=(w/a)*(h/a);
    cout << a*c << endl;
    return 0;
}



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

#define MOD 1000000007
#define INF 1000000000000

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


template <class T>
ostream &operator<<(ostream &o, const vector<T>&obj) {
    o << "["; for (int i = 0; i < (int)obj.size(); ++i) o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U>&obj) {
    o << "(" << obj.first << ", " << obj.second << ")"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const queue<T>&obj) {
    queue<T> obj_cp = obj;
    bool first = true;
    o << "{";
    while (!obj_cp.empty()) { o << (!first ? ", " : "") << obj_cp.front(); obj_cp.pop(); first = false; }
    o << "}"; return o;
}

void print() {
    cout << "\n";
}
template<class Head, class... Body>
void print(Head head, Body... body) {
    cout << head << " ";
    print(body...);
}


int main(int argc, char const *argv[]) {
    int N, W;
    cin >> N >> W;
    vector<ll> w(N), v(N);
    for (int i = 0; i < N; ++i) {
        cin >> w[i] >> v[i];
    }

    int vsum_max = accumulate(v.begin(), v.end(), 0);
    vector<vector<ll>> dp(N+1, vector<ll>(vsum_max+1, INF));
    dp[0][0] = 0;
    for (int i = 1; i <= N; ++i) {
        for (int j = 0; j <= vsum_max; ++j) {
            dp[i][j] = dp[i-1][j];
            if (j - v[i-1] >= 0){
                dp[i][j] = min(dp[i][j], dp[i-1][j-v[i-1]] + w[i-1]);
            }
        }
    }
    int ans = 0;
    for (int j = 1; j <= vsum_max; ++j) {
        if (dp[N][j] <= W) {
            ans = max(ans, j);
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 80256
// Sky's the limit :)
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    int T = 1; 
    // cin >> T; 
    while (T--) {
        string s;
        cin >> s;

        int ans = 0, curr = 0;
        for (int i = 0; i < s.size(); i++)  {
            if (s[i] == 'R') 
                ans = max(ans, ++curr);
            else
                curr = 0;
        }
     
        cout << ans << '\n';
    }
    
    return 0;
}



Measured memory_bytes: 3648
(* O(n log n) *)
let kNMax = 200000 in
let kInf = 300000 in
Scanf.scanf " %d %d" @@ fun n k ->
  let balls = Array.make (kNMax + 1) 0 in
  for i = 1 to n do
    let a = Scanf.scanf " %d" @@ (+) 0 in
    balls.(a) <- balls.(a) + 1
  done;
  let c = ref 0 in
  Array.iteri (fun i b -> if b = 0 then balls.(i) <- kInf else incr c) balls;
  Printf.printf "%d\n" @@
    if !c <= k then 0
    else
      (Array.sort (-) balls;
      Array.sub balls 0 (!c - k) |> Array.fold_left (+) 0)

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

int main() {
	// your code goes here
	int a,b;
	cin>>a>>b;
	long c=LONG_MIN,tmp;
	tmp=a-b;
	c=max(c,tmp);
	tmp=a+b;
	c=max(c,tmp);
	tmp=a*b;
	c=max(c,tmp);
	cout<<c<<endl;
	return 0;
}

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

int main()
{
    int n,a;
    cin>>n;
    vector<int>v;
    vector<int>v1;
    for(int i=0;i<n;i++)
    {
        cin>>a;
        v.push_back(a);
    }
    int x,y,z,sum=0;
    x=*min_element(v.begin(),v.end());
    y=*max_element(v.begin(),v.end());

    for(int i=x;i<=y;i++){
    for(int j=0;j<v.size();j++)
    {
        sum+=((i-v[j])*(i-v[j]));
    }
    v1.push_back(sum);
    sum=0;
    }
    z=*min_element(v1.begin(),v1.end());
    cout<<z<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
 
using namespace std;
#define PB push_back
#define MP make_pair
#define REP(i,n) for(int i=0;i<(n);i++)
#define ll long long
int main()
{
    int a,b;
    cin>>a>>b;
    if(a%2!=b%2){
        cout<<"IMPOSSIBLE"<<endl;
    }else{
        cout<<(a+b)/2<<endl;
    }
}

Measured memory_bytes: 384
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <set>
#include <bitset>
#include <iterator>
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
typedef long long int LL;
typedef unsigned long long int ULL;

int main() {
    int n, k;
    cin >> n >> k;
    vector<LL> values;
    rep(i, n) {
        LL value;
        cin >> value;
        values.push_back(value);
    }
    LL n_iter = min(n, k);
    LL ans = 0;
    rep(left, n_iter + 1) {
        rep(right, n_iter + 1) {
            if (left + right > n_iter) continue;

            vector<LL> having;
            rep(i, left) {
                having.push_back(values[i]);
            }
            rep(i, right) {
                having.push_back(values[n - i - 1]);
            }
            sort(having.begin(), having.end());

            LL num_waste = k - left - right;
            LL res = 0;
            rep(i, having.size()) {
                if (num_waste > 0 and having[i] < 0) {
                    num_waste--;
                    continue;
                }

                res += having[i];
            }
            ans = max(ans, res);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
// inputに入力データ全体が入る
function Main(input) {
	const lines = input.split("\n");
	const params = lines[0].split(" ");
	var a = parseInt(params[0], 10);
	var b = parseInt(params[1], 10);
	//出力
  	const result = (a > 12)
    				? b
          			: (a > 5)
    					? b/2
    					: 0;
  
	console.log(result);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#define _CRT_SECURE_NO_WARNINGS
#define llong long long
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <utility>
#include <stdio.h>
#include <math.h>
using namespace std;

int keta(llong n) {
	llong k = 0;
	for (llong i = n; i > 0; i = i / 10)k = k + 1;
	return k;
}
int F(llong x, llong y) {
	return keta(x) <= keta(y) ? keta(y) : keta(x);
}
int main() {
	llong n,ans=100;
	cin >> n;
	for (int i = 1; i <= (int)(sqrt(n)); i++) {
		if (n%i == 0) {
			ans = ans > F(i, n / i) ? F(i, n / i) : ans;
		}
	}
	cout << ans << endl;
}

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

int main() {
 vector<int> arr;
  for (int i = 0; i < 5; ++i) {
    int x;
    cin >> x;
    arr.push_back(x);
  }
  for (int i = 0; i < 5; ++i) {
    if (arr[i] == 0) {
      cout << i+1 << endl;
      break;
    }
  }
}


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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s,t,u;
  int32 a,b;
  cin >> s >> t >> a >> b >> u;
  if(s == u){
    a--;
  }else{
    b--;
  }
  cout << a << " " << b << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <algorithm>
#include <map>
#include <vector>
#include <list>
#include <cmath>
#include <stack>
#include <queue>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;

const int mod = 1000000007;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x% mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res /= a;
	}
};

struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
} comb(2000005);

mint g(int r, int c) {
	return comb(r + c + 2, r + 1) - 1;
}

int main()
{
	long x;
	cin >> x;
	int a = x / 500;
	x -= a * 500;
	int b = x / 5;
	cout << (a * 1000 + b * 5);
}


Measured memory_bytes: 31488
#include "bits/stdc++.h"
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

ll n,a,b;
Vi v;
map<ll,ll> ct;



ll C[51][51]; // C[n][k] -> nCk
void com_init(int N){//O(n^2)
    for(int i=0;i<=N;++i){
        for(int j=0;j<=i;++j){
            if(j==0 or j==i){
                C[i][j]=1LL;
            }else{
                C[i][j]=(C[i-1][j-1]+C[i-1][j]);
            }
        }
    }
}


int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    cin>>n>>a>>b;
    ll tp;
    rep(i,n){
        cin>>tp;
        if(ct[tp]==0)v.pb(tp);
        ct[tp]++;
    }
    Sort(v);
    ll sum = 0;
    ll cut = 0;
    com_init(50);
    rep(i,v.size()){
        if(i==0){
            if(ct[v[i]]>=a){
                ll tmp = 0;
                repi(j,a,min(ct[v[i]],b)+1){
                    tmp += C[ct[v[i]]][j];
                }
                print(v[i]);
                print(tmp);
                break;
            }
        }
        if(cut + ct[v[i]] < a){
            cut += ct[v[i]];
            sum += v[i]*ct[v[i]];
        }else{
            ll tmp = a - cut;
            sum += v[i] * tmp;
            print((double)sum/(double)a);
            
            print(C[ct[v[i]]][tmp]);
            break;
        }
    }
    return 0;
}

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

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

    string s[N];
    for(int i=0;i<N;i++)
        cin>>s[i];

    int M;
    cin>>M;

    string t[M];
    for(int i=0;i<M;i++)
        cin>>t[i];


    int ans=0;

    string a[N+M];
    for(int i=0;i<N;i++){
        a[i]={s[i]};
    }
    for(int i=0;i<M;i++){
        a[i+N]={t[i]};
    }


    for(int i=0;i<N+M;i++){
        int y=0;
        for(int j=0;j<N;j++){
            if(a[i]==a[j])
                y++;
        }
        for(int j=N;j<N+M;j++){
            if(a[i]==a[j])
                y--;
        }
        
        if(y>ans)
            ans=y;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<char> vchar;
typedef vector<vector<char>> vvchar;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef priority_queue<long long> prque;
#define ain(i,n,a) for(long long i=0;i<(long long)(n);i++){cin>>a[i];}
#define aout(i,n,a) for(long long i=0;i<(long long)(n);i++){if(i){cout<<" ";}cout<<a[i];if(i==n-1){cout<<endl;}}
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define vsort(v) sort((v).begin(),(v).end())
#define vrsort(v) sort((v).rbegin(),(v).rend())
#define vreverse(v) reverse((v).begin(),(v).end())
#define pf(a) push_front(a)
#define pb(a) push_back(a)
#define INF 1998021900
#define MOD 1000000007
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  //input
  ll n,i;cin>>n;vll h(n);
  rep(i,n){
  cin>>h[i];
  }
  vll m(n);h[0]--;m[0]=h[0];
  //caricurate
  for(i=1;i<n;i++){
    if(h[i]<m[i-1]){cout<<"No"<<endl;return 0;}
    if(h[i]>h[i-1]){h[i]--;}
    m[i]=max(m[i-1],h[i]);
  }
  //output
  cout<<"Yes"<<endl;
}

Measured memory_bytes: 1792
import java.io.InputStream

private val input = FastScanner()

fun main(args: Array<String>) = input.run {
    val h = nextInt()
    val w = nextInt()
    val n = nextInt()
    val a = nextInts(n)
    var row = 0
    var col = 0
    var dir = 1
    val ans = Array(h) { IntArray(w) }
    a.forEachIndexed { c, m ->
        repeat(m) {
            ans[row][col] = c + 1
            when {
                dir == 1 && col + 1 < w -> col++
                dir == 1 && col + 1 == w -> {
                    row++
                    dir = -1
                }
                dir == -1 && col > 0 -> col--
                dir == -1 && col == 0 -> {
                    row++
                    dir = 1
                }
            }
        }
    }
    ans.forEach {
        println(it.joinToString(" "))
    }
}

class FastScanner(private val input: InputStream = System.`in`) {
    private val sb = StringBuilder()
    private val buffer = ByteArray(4096)
    private var pos = 0
    private var size = 0

    fun nextLong(): Long {
        var c = skipWhitespace()

        val sign = if (c == '-'.toInt()) {
            c = read()
            -1
        } else 1

        var ans = 0L

        while (c > ' '.toInt()) {
            ans = ans * 10 + c - '0'.toInt()
            c = read()
        }

        return sign * ans
    }

    fun nextInt() = nextLong().toInt()

    fun nextInts(n: Int) = IntArray(n) { nextInt() }

    private fun skipWhitespace(): Int {
        while (true) {
            val c = read()
            if (c > ' '.toInt() || c < 0) return c
        }
    }

    private fun read(): Int {
        while (pos >= size) {
            if (size < 0) return -1
            size = input.read(buffer, 0, buffer.size)
            pos = 0
        }
        return buffer[pos++].toInt()
    }
}

Measured memory_bytes: 33868
#include<bits/stdc++.h>
#define int long long int
#define ld long double
#define getFaster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define rev(i,n,init) for(int i=n;i>=init;i--)
#define MAXN 200005
#define MOD2 998244353
#define MOD1 1e9+7
#define f first
#define s second
#define endl '\n'
#define pii pair<int,int>
#define piii pair<pii,int>
#define precise(i) cout<<fixed<<setprecision(i)
#define codejam cout<<"Case #"<<ii+1<<": ";
using namespace std;
const long double PI = atan(1.0)*4;
const int64_t INF=INT64_MAX;
const int32_t LOG=21;
const int MOD=MOD2;

int32_t main()
{ 
      getFaster;
      int tests=1;
      //cin>>tests;
      rep(ii,0,tests)
      {

          int r;
          cin>>r;
          ld ans=2*PI*r;
          precise(6)<<ans<<endl;
      }


      return 0;                         
}

/*
 TIPS(FOR ME):
 1.) Check for corner cases (like 0 is exception case)
 2.) Check for global memory sizes,memory refreshments and its complexity 
 3.) Check for sorting criteria (if used 1-based indexing)
 4.) Check for numbers overflow (while multiplying and doing MOD)
 5.) Check for typecasting issues like int to float( while dividing numbers)
*/

Measured memory_bytes: 3788
#include <stdio.h>
#define LL long long
LL ans,b;
int n,prime[2000],not_prime[10010],tot;
void linear_shaker(int x){
	int i,j;
	for(i=2;i<=x;i++){
		if(!not_prime[i])prime[++tot]=i;
		for(j=1;prime[j]*i<=x;j++){
			not_prime[prime[j]*i]=1;
			if(i%prime[j]==0)break;
		}
	}
}
int main(){
	int i,n,cnt,x,j;
	linear_shaker(10000);
	ans=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		x=i,b=1;
		for(j=1;prime[j]*prime[j]<=x;j++){
			cnt=0;
			if(x%prime[j]==0){
				while(x%prime[j]==0)x/=prime[j],cnt++;
				b*=(cnt+1);
			}
		}
		if(x>1)b*=2;
		ans+=b*i;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 3240
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long k = scan.nextLong();

		if (k == 0) {
			System.out.println("4");
			System.out.println("3 3 3 3");
		} else if (k == 1) {
			System.out.println("3");
			System.out.println("1 0 3");
		} else if (k <= 50) {
			System.out.println(k);
			for (int i = 0; i < k - 1; i++) {
				System.out.print(k);
				System.out.print(" ");
			}
			System.out.println(k);
		} else {
			long a = k / 50;
			long b = k % 50;
			int i = 50;
			System.out.println("50");
			for (; i > 50 - b; i--) {
				System.out.print(50 + a);
				System.out.print(" ");
			}
			for (; i > 1; i--) {
				System.out.print(i + a -1);
				System.out.print(" ");
			}
			System.out.println(i + a - 1);
		}

	}

}


Measured memory_bytes: 23892
<?php
$member_num = trim(fgets(STDIN));
$zyousi_array = explode(' ', trim(fgets(STDIN)));

$count_array = array_fill(1, $member_num, 0);

foreach($zyousi_array as $id) {
  $count_array[$id] += 1;
}

foreach($count_array as $value) {
  echo $value . PHP_EOL;
}

Measured memory_bytes: 36088
#include<bits/stdc++.h>
using namespace std;
const int maxn=3e5+10;
int n,m,k;

int main(){
    int a,b;
    cin>>a>>b;
    if(a==b){
        return !printf("0");
    }
    else{
        a+=b;
        if(a%2){
            printf("IMPOSSIBLE\n");
        }
        else{
            printf("%d\n",a/2);
        }
    }
}
/*
    Good Luck
        -Lci70121
*/


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

struct Segment_tree {
	int T[800010];
	Segment_tree() {memset(T, 0, sizeof(T));}
	void Update(int now, int l, int r, int pos, int x) {
		if (l == r) {
			T[now] = x;
			return ;
		}
		int mid = l + r >> 1;
		if (pos <= mid) Update(now << 1, l, mid, pos, x);
		else Update(now << 1 | 1, mid + 1, r, pos, x);
		T[now] = max(T[now << 1], T[now << 1 | 1]);
	}
	int Query(int now, int l, int r, int L, int R) {
		if (L > R) return 0;
		if (l == L && r == R) return T[now];
		int mid = l + r >> 1;
		if (R <= mid) return Query(now << 1, l, mid, L, R);
		if (L > mid) return Query(now << 1 | 1, mid + 1, r, L, R);
		return max(Query(now << 1, l, mid, L, mid), Query(now << 1 | 1, mid + 1, r, mid + 1, R));
	}
}seg;

int N;
int ans[200010], a[200010];
vector <int> from[200010];

void dfs(int x, int last) {
	ans[x] = seg.Query(1, 1, N, 1, N);
	for (int i = 0; i < from[x].size(); i++) {
		int v = from[x][i];
		if (v == last) continue;
		int tmp = seg.Query(1, 1, N, a[v], a[v]);
		seg.Update(1, 1, N, a[v], seg.Query(1, 1, N, 1, a[v] - 1) + 1);
		dfs(v, x);
		seg.Update(1, 1, N, a[v], tmp);
	}
}

int main () {
	int n; scanf("%d", &n);
	vector <int> all;
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		all.push_back(a[i]);
	}
	sort(all.begin(), all.end()), all.resize(unique(all.begin(), all.end()) - all.begin());
	N = all.size();
	for (int i = 1; i <= n; i++) {
		a[i] = lower_bound(all.begin(), all.end(), a[i]) - all.begin() + 1;
	}
	for (int i = 2; i <= n; i++) {
		int x, y; scanf("%d%d", &x, &y);
		from[x].push_back(y);
		from[y].push_back(x);
	}
	seg.Update(1, 1, N, a[1], 1);
	dfs(1, 1);
	for (int i = 1; i <= n; i++) {
		printf("%d\n", ans[i]);
	}
	return 0;
}


Measured memory_bytes: 42748
#include <iostream>
#include <string.h>
using namespace std;

char s[1001];
char t[1001];
int ns, nt;
int max_concordance = 0;
int main(){
	cin >> s >> t;
  	ns = strlen(s);
  	nt = strlen(t);
  	for (int i=0;i <= ns-nt;i++) {
      	int concordance = 0;
    	for (int j=i;j < i+nt;j++) {
        	if (s[j] == t[j-i]) {
            	concordance++;
            }
        }
      	if (max_concordance < concordance) {
	      	max_concordance = concordance;
        }
    }
  cout << nt - max_concordance << endl;
  return(0);
}

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

const ll mod = 1000000007;
const double eps = 1e-8;

#ifdef DEBUG
#include "inc/debug.hpp"
#else
#define debug(...) 42
#endif

int main() {
    string T;
    cin >> T;
    for (int i=0; i<(int)T.size(); ++i) {
        if (T[i] == '?') T[i] = 'D';
    }
    cout << T << endl;
    return 0;
}

Measured memory_bytes: 3724
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int my_abs(int num){
   if (num > 0)
      return num;
   else
      return -num;
}

int main(){
    string S;
    cin >> S;
    cout << S.at(0);
    cout << S.size()-2;
    cout << S.at(S.size()-1);
    cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
#define pb push_back
using namespace std;
vector<vector<int>>graph;
long long dp[100001];

int main(){
int a,b,c; cin>>a>>b>>c;
int k; cin>>k;
while(b<=a && k>0){
    b*=2;
    k--;
}

while(c<=b && k>0){
    c*=2;
    k--;
}

if(a<b && b<c && a<c && k>=0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}

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

int main() {
	int n; scanf("%d", &n);
	vector<vector<int>> v(3, vector<int>(n + 1, 0));

	for (int i = 0; i < 3; i++) {
		int size = i == 2 ? n - 1 : n;
		for (int j = 1; j <= size; j++) {
			scanf("%d", &v[i][j]);
		}
	}

	int ans = 0;
	int d = -1, c = -1;
	for (int j = 1; j < v[0].size(); j++) {
		d = v[0][j];
		if (c > 0 && d == c + 1)
			ans += v[2][c];
		c = d;
		ans += v[1][d];
	}


	cout << ans;

	return 0;
}

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

const long long INF = LLONG_MAX;
struct edge {
	int from;
	int to;
	long long cost;
};

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); 	
	
	int n, m;
	cin >> n >> m;
	vector<edge> e(m);
	for(int i = 0; i < m; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		a--;
		b--;
		c = -c;
		e[i] = edge{a, b, c};
	}
	vector<long long> d(n, INF);
	d[0] = 0;
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < m; j++) {
			edge tmp = e[j];
			if(d[tmp.from] != INF && d[tmp.to] > d[tmp.from] + tmp.cost) {
				d[tmp.to] = d[tmp.from] + tmp.cost;
				if(i == n - 1 && tmp.to == n - 1) {
					cout << "inf" << endl;
					return 0;
				}
			}
		}
	}
	cout << -d[n - 1] << endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
using namespace std;
//using namespace boost::multiprecision;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}



int main(){
  
  long long a,b,k;
  cin>>a>>b>>k;
  if(a >= k){
    cout<<a-k<<' '<<b<<endl;
  }else if(k <= a+b){
    cout<<0<<' '<<b-(k-a)<<endl;
  }else{
    cout<<0<<' '<<0<<endl;
  }
  return 0; 
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_solve
{
    class Program
    {
        static void Main(string[] args)
        {
           // var n = int.Parse(Console.ReadLine());
            var data = Console.ReadLine();
            string[] Alf = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
            
            for(int i = 0; i < 26; i++)
            {
                if (data == Alf[i]) Console.WriteLine(Alf[i + 1]);
            }



        }
    }
}


Measured memory_bytes: 11092
import sys
s = input()
b = True
max_ = 0
for i in range(len(s)):
    s1 = s[i:]
    for k in range(len(s1)):
        b = True
        s2 = s1[:len(s1)-k]
        for j in s2:
            if j != 'A' and j!='T' and j != 'G' and j!='C':
                b = False
        if b:
            max_ = max(max_, len(s2))
print(max_)

Measured memory_bytes: 38384
// Aizu Vol-2 0203: A New Plan of Aizu Ski Resort
// 2017.8.24 bal4u@uu

#include <stdio.h>
#include <string.h>

#define MAX 15
char map[MAX+5][MAX+5];
int p[MAX+5][MAX+5];
int X, Y;

int main()
{
	int i, k, x, y, x2, y2;
	int m[2] = { -1,1 };

	while (scanf("%d%d", &X, &Y) && X) {
		memset(map, 0, sizeof(map)), memset(p, 0, sizeof(p));
		for (y = 1; y <= Y; y++) for (x = 1; x <= X; x++) scanf("%d", &k), map[y][x] = k;
		for (x = 1; x <= X; x++) p[1][x] = (map[1][x] != 1);
		for (y = 1; y < Y; y++) for (x = 1; x <= X; x++) {
			if (map[y][x] == 1) continue;
			if (map[y][x] == 2) { if (map[y+2][x] != 1) p[y+2][x] += p[y][x]; continue; }
			for (i = 0; i < 2; i++) {
				x2 = x + m[i], y2 = y + 1;
				if (x2 > 0 && x2 <= X && map[y2][x2] == 0) p[y2][x2] += p[y][x];
			}
			y2 = y + 1; if (map[y2][x] != 1) p[y2][x] += p[y][x];
		}
		for (k = 0, y = Y; y <= Y+1; y++) for (x = 1; x <= X; x++) k += p[y][x];
		printf("%d\n", k);
	}
	return 0;
}

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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());


signed main()
{
    gearup;
    ll a,b; cin >> a >> b;
    ll c = a + b;
    if(a % 3 == 0 || b % 3 == 0 || c % 3 == 0)out("Possible");
    else out("Impossible");
}

Measured memory_bytes: 3656
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = s; i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
typedef long long ll;
const int MOD = 1000000007;
using namespace std;


int main(){
    int n, cnt = 0; cin >> n;
    vector<int> p(n);
    REP(i, n) cin >> p[i];
    REP(i, n-1){
        if(p[i] == i+1){
            swap(p[i], p[i+1]); ++cnt;
        }
    }
    if(p[n-1] == n) ++cnt;
    cout << cnt << "\n";
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <map>

using namespace std;
typedef long long ll;

const long long MOD = 1e9 + 7;

map<ll, int> mark;

int main()
{
    ll ans = 0;
    ll N;
    cin >> N;
    for (ll r = 1; r <= 1000000; r++)
    {
        if (N % r == 0)
        {
            ll m = N / r - 1;
            if (r >= m)
                continue;
            if (!mark[m])
                ans += m;
            mark[m] = 1;
            //cout << m << endl;
        }
    }
    for (ll m = 0; m <= 1000000; m++)
    {
        if (N % (m + 1) == 0)
        {
            ll r = N / (m + 1);
            if (r >= m)
                continue;
            if (!mark[m])
            {
                ans += m;
                mark[m] = 1;
            }
            //cout << m << endl;
        }
    }
    cout << ans;
}


Measured memory_bytes: 512
#include <stdio.h>
int main(){
  int n,max,min,i,a;
  long long sum=0;
  max = -1000000;
  min = 1000000;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%",&a);
    if(max<a) max = a;
    if(min>a) min = a;
    sum+=a;
  }
  printf("%d %d %lld\n",min,max,sum);

  return 0;
}

Measured memory_bytes: 600
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }

bool solve() {
    long long a, b, c, d; cin >> a >> b >> c >> d;
    if (a < b) return false;
    if (d < b) return false;
    long long g = gcd(b, d);
    long long rem = a % g;
    long long mi = (c - rem + g) / g * g + rem;
    return mi >= b;
}

int main() {
    int T; cin >> T;
    while (T--) {
        cout << (solve() ? "Yes" : "No") << endl;
    }
    return 0;
}


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

using namespace std;

#define int long long
#define ll long long
typedef pair<int, int> P;
#define mod 998244353
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES puts("YES\n")
#define Yes puts("Yes\n")
#define NO  puts("NO\n")
#define No  puts("No\n")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }


signed main() {

	int N;
	cin >> N;
	vector<int> A(N+1);
	rep(i, N+1) cin >> A[i];
	vector<int> B(N);
	rep(i, N) cin >> B[i];

	int ans = 0;
	rep(i, N) {
		if(A[i]>B[i]) {
			// A[i]からB[i]だけ
			A[i] -= B[i];
			ans += B[i];
		}
		else {
			// A[i]から全部
			ans += A[i];
			B[i] = B[i] - A[i];
			A[i] = 0;
			if (A[i + 1] > B[i]) {
				A[i + 1] -= B[i];
				ans += B[i];
			}
			else {
				ans += A[i + 1];
				A[i + 1] = 0;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cfloat>
#include <algorithm>
#define PB push_back
#define ll long long
#define ull unsigned long long
#define uint unsigned
#define PIE (3.14159265358979323846)
#define MOD 1000000007;
using namespace std;

void checkStream() {
    freopen("input.in", "r", stdin);
    freopen("output.out", "w", stdout);
}

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

    int l {};
    cin >> l;

    cout<<fixed<<setprecision(12)<<static_cast<double>(l*l*l)/27<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
	string s;
	cin>>s;
	int q;
	cin>>q;
	deque<char>dq;
	for(int i=0;i<s.size();i++)
        dq.push_back(s[i]);
    int count=0;
	while(q--){
        int num;
        cin>>num;
        if(num == 1){
            count=(count+1)%2;
        }
        else{
            cin>>num;
            char tmp;
            cin>>tmp;
            if(num==1){
            if(count==0)
            dq.push_front(tmp);
            else dq.push_back(tmp);
            }
            else{
                if(count==0)
                    dq.push_back(tmp);
                else
                    dq.push_front(tmp);
            }

        }
	}if(count==1)
	for(auto it=dq.rbegin();it != dq.rend();it++)
        cout<<*it;
    else
        for(auto it=dq.begin();it!=dq.end();it++)
        cout<<*it;
	//cout<<s;

	}


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

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vii = vector<pii>;
using vs = vector<string>;
#define all(x) x.begin(), x.end()
// int di[] = {0, 1, 0, -1};
// int dj[] = {1, 0, -1, 0};
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
#define x first
#define y second


int main(int argc, char **argv) {
	ios::sync_with_stdio(false), cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

	int d, t, s; cin >> d >> t >> s;
	if (d / double(s) <= t)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

}


Measured memory_bytes: 3688
WORD = gets.chomp
N = gets.chomp.to_i

module Rotate
  def rotate(n)
    first_char = self[0]
    self[0] = (first_char.ord + n % 26).chr
    self
  end
end

class String
  prepend Rotate
end

def solve(word, n)
  tmp_word = word
  tmp_word.each_char.with_index do |char, i|
    # a に変換するために消費する N (z.ord = 122)
    required_n = (122 - tmp_word[i].ord + 1) % 26

    if n >= required_n
      word[i] = 'a'
      n -= required_n
    else
      next
    end
  end

  # それでも余れば最後の文字に足す
  if (n >= 0)
    word[-1] = word[-1].rotate(n)
  end

  return word
end

puts solve(WORD, N)

Measured memory_bytes: 2172
use std::io;
use std::collections::BTreeMap;


/// https://beta.atcoder.jp/contests/arc081/tasks/arc081_a
fn main() {
    let _n = read_one::<usize>();
    let an = read::<isize>();
    let mut bm = BTreeMap::new();

    for a in an {
        *bm.entry(a).or_insert(0) += 1;
    }

    let mut vec = bm.into_iter().filter(|&(_, v)| v >= 2).collect::<Vec<_>>();
    vec.sort_by_key(|&(k, _)| -k);
    if vec.len() < 2 { println!("0"); }
    else if vec[0].1 >= 4 { println!("{}", vec[0].0 * vec[0].0); }
    else { println!("{}", vec[0].0 * vec[1].0)}
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

Measured memory_bytes: 7416
n, k, c = gets.chomp.split.map(&:to_i)
s = gets.chomp

def f(str, n, k, c)
  asap = Array.new(n, nil)
  i = 0

  cnt = 0
  while k != 0
    if str[i] == 'o'
      asap[i] = cnt
      k -= 1
      i += c + 1
      cnt += 1
    else
      i += 1
    end
  end

  return asap
end

a = f(s, n, k, c)
b = f(s.reverse, n, k, c).reverse
bmax = b.compact.max
b.map! { |x| x.nil? ? nil : bmax - x }

n.times do |i|
  if a[i] && b[i] && a[i] == b[i]
    puts i + 1
  end
end

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

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

    int N, K;
    cin >> N >> K;
    string S;
    cin >> S;

    vector<int> stat, cnt;
    for (int i=0; i<N; ++i) {
        if (i == 0 || S[i] != S[i-1]) {
            stat.push_back(S[i]-'0');
            cnt.push_back(1);
        } else {
            cnt[(int)cnt.size()-1] ++;
        }
    }

    int M = cnt.size();
    vector<int> ac(M+1);
    ac[0] = 0;
    for (int i=1; i<M+1; ++i) {
        ac[i] = ac[i-1] + cnt[i-1];
    }

    int ans = 0;
    for (int i=0; i<M; ++i) {
        if (stat[i] == 0) {
            ans = max(ans, ac[min(i+K*2, M)] - ac[i]);
        } else {
            ans = max(ans, ac[min(i+K*2+1, M)] - ac[i]);
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1748
<?php
# 入力部
// fscanf(STDIN, "%d", $a);
// fscanf(STDIN, "%d %d %d", $n, $x, $t);
fscanf(STDIN, "%s", $a);
// fscanf(STDIN, "%d", $n);

# 処理部
// for ($i = 0; $n > $x * $i; $i++) {
// }
// if (strpos($s, 'RRR') !== false) {
//   $r = 3;
// } elseif (strpos($s, 'RR') !== false) {
//   $r = 2;
// } elseif (strpos($s, 'R') !== false) {
//   $r = 1;
// } else {
//   $r = 0;
// }
// $s = "No";
// if ($x >= 30) {
//   $s = "Yes";
// }
// for ($i = 0; $i * 1000 < $n; $i++) {
// }
$c = "a";
if (ctype_upper($a)) {
  $c = "A";
}

# 出力部
// echo $a . "\n";
echo $c . "\n";
// echo ($i * 1000) - $n . "\n";


Measured memory_bytes: 16112
#include<algorithm>//sort(all(変数),greater<型名>())で降順に、*max_element(all(変数))で最大値を獲得
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric>
//xとyのgcdは__gcd(x,y),xとyのlcmは(x*y)/__gcd、accumulate(all(変数),0)で要素の全加算
#include<queue>//priority_queue<型名> 変数
#include<set>
#include<stack>
#include<string>
#include<vector>
#define rep(i,n)  for(ll i=0; i<n; i++)
#define rrep(i,n) for(ll i=n-1; 0<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e18
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
  int n,k; cin >> n >> k;
  vi a(n); rep(i,n) cin >> a[i];
  int ans = 1;
  if(k < n){
    n -= k;
    ans += ceil((double)n/(k-1));
  }
  cout << ans;
}


Measured memory_bytes: 640