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

// Aの約数とBの約数のから互いに素であるものを選んだ時の最大個数
// gcd(A,B)の因数のうち互いに素であるものの個数
//gcd(A,B)の素因数の個数

ll gcd(ll a,ll b){
    ll r;
    while(b != 0){
        if(a < b)swap(a,b);
        r = a%b;
        a=b;
        b=r;
    }
    return a;
}

map<ll,ll> prime_factor(ll n){
    map<ll,ll> res;
    for(ll i = 2; i*i <= n; i++){
        while(n%i == 0){
            ++res[i];
            n /= i;
        }
    }
    if( n != 1) res[n] = 1;
    return res;
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll a,b;
    cin>>a>>b;
    ll d;
    d = gcd(a,b);
    map<ll, ll> pf;
    pf = prime_factor(d);
    ll ans = 1;
    ans += pf.size();
    
    cout<< ans <<endl;
    return 0;
}


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

#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;
const long double PI = (acos(-1));
const ull MOD = 1000000007;


struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    for(int i = 0; i < N; i++) cin >> H[i];
    vector<int> dp(N);
    dp[0] = 0;
    dp[1] = abs(H[1] - H[0]);
    for(int i = 2; i < N; i++){
        dp[i] = min(abs(H[i] - H[i - 1]) + dp[i - 1], abs(H[i] - H[i - 2]) + dp[i - 2]);
    }
    cout << dp.back() << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    for(int i=0;i<s.length()-1;i++)
    {
        if(s[i]==s[i+1])
        {
            cout<<"Bad"<<endl;
            return 0;
        }
    }
    cout<<"Good"<<endl;
    return 0;
}

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

int main(){
    int a,b;
    
    while(cin >> a >> b){
        int cnt=1;
        int c=10;
        for(int i=0;i<8;i++){
            //cout << c << ' ' << cnt << endl;
            if((a+b)-c<0)break;
            //cout << a << ' ' << b << '=' << a+b << endl;
            cnt++;
            c*=10;
        }
        cout << cnt << endl;
    }
    
    
    return 0;
}
 

Measured memory_bytes: 3060
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main(){
  int H, W, Q;
  const int MAX_L = 50000;
  while(cin >> H >> W >> Q && H){
    int A[MAX_L], B[MAX_L], O[MAX_L];
    REP(i, Q){
      scanf("%d %d %d", A + i, B + i, O + i);
    }
    bool usedY[MAX_L] = {};
    bool usedX[MAX_L] = {};
    int CY = H;
    int CX = W;
    int ans = 0;
    for(int i = Q - 1; i >= 0; i--){
      if(CX == 0 || CY == 0) break;
      if(A[i] == 0){
        int y = B[i];
        if(usedY[y]) continue;
        usedY[y] = true;
        CY--;
        if(O[i] == 1) ans += CX;
      }else{
        int x = B[i];
        if(usedX[x]) continue;
        usedX[x] = true;
        CX--;
        if(O[i] == 1) ans += CY;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1932
a,b,k = map(int, input().split())
if b - a + 1 > 2*k:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)

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

int main(void){
    int p[100000] = {3};
    int np[100000] = {3};
    bool n[100000] = {false, false, false, true};
    int ans[100002] = {0, 0, 0, 1};
    int p_cnt = 1, np_cnt = 1;
    int i = 5, j;
    while(i < 100000){
        for(j = 0; j < p_cnt; j++){
            if(i % p[j] == 0){
                goto next;
            }
            if((i + 1) / 2 == p[j]){
                np[np_cnt] = i;
                np_cnt++;
                n[i] = true;
            }
        }
        p[p_cnt] = i;
        p_cnt++;
        
        next:
        ans[i] = np_cnt;
        i += 2;
    }
    
    int q;
    cin >> q;
    
    int l, r;
    for(i = 1; i <= q; i++){
        cin >> l >> r;
        cout << ans[r] - ((l == 1) ? 0 : ans[l - 2]) << endl;
    }
    
    return 0;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

// あみだの種類数をあらかじめ計算しておくやり方
// f(n)：n本の縦線で1列分の横線がひけるあみだの種類数

const int mod = 1e9 + 7;

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

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

	ll dp[h+1][w];
	rep(i, h+1) rep(j, w) dp[i][j] = 0;
	dp[0][0] = 1;

	// あみだの種類数の計算
	// 左端の線について、その線とその右の線の間に、
	// 1.横線がある→その右の線はもうあみだに使えず、２つ右の線以降で残りのあみだ
	// 2.横線がない→その右の線以降で残りのあみだ
	// なのでフィボナッチ数が出てくる
	ll f[20];
	f[0] = 1;
	f[1] = 1;
	f[2] = 2;
	for(int i = 3; i < 20; i++){
		f[i] = f[i-2] + f[i-1];
		f[i] %= mod;
	}

	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			// 左の線から移動する、同じ線、右の線から移動するの3パターン
			// （両端の線の場合は左の線からの移動、もしくは右の線からの移動がない）
			// それぞれの場合で左の線と同じ線の間、同じ線と右の線の間が決まり
			// そのほかの線のあみだの種類数を足してゆく。
			// 横棒がある線はあみだに使えないのに注意。

			if(j > 0) dp[i+1][j] += dp[i][j-1] * f[j-1] * f[w-j-1];
			dp[i+1][j] += dp[i][j] * f[j] * f[w-j-1];
			if(j < w-1) dp[i+1][j] += dp[i][j+1] * f[j] * f[w-j-2];
			dp[i+1][j] %= mod;

			// cout << (i+1) << " " << j << " " << dp[i+1][j] << endl;
		}
	}
	// cout << endl;
	cout << dp[h][k-1] << endl;
}


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

int main()
{
  int n;
  cin >> n;
  vector<int> l(n);

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

  // sort(l.begin(), l.end());

  int cnt = 0;
  for (int i = 0; i < n; i++)
  {
    for (int j = i + 1; j < n; j++)
    {
      for (int k = j + 1; k < n; k++)
      {
        if (l[i] + l[j] > l[k] && l[j] + l[k] > l[i] && l[k] + l[i] > l[j] &&
            l[i] != l[j] && l[j] != l[k] && l[k] != l[i])
        {
          cnt++;
          // cout << i << "," << j << "," << k << endl;
        }
      }
    }
  }

  cout << cnt << endl;
  return 0;
}

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

int main()
{
	char n[9];
	cin >> n[0] >> n[1] >> n[2];
	cin >> n[3] >> n[4] >> n[5];
	cin >> n[6] >> n[7] >> n[8];

	cout << n[0] << n[4] << n[8] << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// #define int long long int
#define endl "\n"
#define arrinp(v) for(auto &i:v) cin>>i;
#define arrout(v) for(auto &i:v) cout<<i<<" ";
#define newline cout<<endl;
using namespace std;
int digSum(int n) 
{ 
    if (n == 0)  
       return 0; 
    return (n % 9 == 0) ? 9 : (n % 9); 
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t = 1;
    // cin >> t;
    while (t--) {
        string s;
        cin >> s;
        int count = 0;
        if (s.size() == 1) {
            if (s == "0" or s == "9") {
                cout << "Yes" << endl;
            }
            else {
                cout << "No" << endl;
            }
        }
        else {
            for (int i = 0; i < s.size(); i++) {
                count += s[i]-'0';
            }
            if (count % 9==0) {
                cout << "Yes" << endl;
            }
            else {
                cout << "No" << endl;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3788
n=int(input())
p= list(map(int,input().split()))
cnt=0
cnt2 = 0
c = 1.1
for i in range(n):
    if p[i] == i+1:
        cnt += 1
        if i - c == 1:
            cnt2 += 1
            c = 1.1
        else:
            c = i
ans = (cnt-2*cnt2) + cnt2
print(ans)


Measured memory_bytes: 14008
def first(x):
    cnt = 0
    for i in range(1, h+1):
        for j in range(1, x+1):
            if kv[i][j] == 0:
                kv[i][j] = 1
                cnt += 1
    return cnt

def second(x):
    cnt = 0
    for i in range(1, h+1):
        for j in range(x+1, w+1):
            if kv[i][j] == 0:
                kv[i][j] = 1
                cnt += 1
    return cnt

def fourth(y):
    global kv
    cnt = 0
    for i in range(y+1, h+1):
        for j in range(1, w+1):
            if kv[i][j] == 0:
                kv[i][j] = 1
                cnt += 1
    return cnt

def third(y):
    cnt = 0
    for i in range(y, 0, -1):
        for j in range(1, w+1):
            if kv[i][j] == 0:
                kv[i][j] = 1
                cnt += 1
    return cnt


w, h, n = map(int, input().split())

kv = [[0 for _ in range(w+1)] for _ in range(h+1)]
whites = w * h
blacks = 0


for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        blacks += first(x)
    elif a == 2:
        blacks += second(x)
    elif a == 3:
        blacks += third(y)
    elif a== 4:
        blacks += fourth(y)
print(whites-blacks)


Measured memory_bytes: 9244
#include <bits/stdc++.h>
#define pb push_back
#define long long long
#define pll pair < long , long >
#define vll vector < pll >
#define ml map < long , long >
#define mll map < pll , long >
#define x first
#define y second
#define vl vector < long >
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int main()
{
    io
    set < long > s;
    long n,k,i;
    cin>>n>>k;
    s.insert(1);
    for(i=1;i<=n;++i)
    {
        set < long > ss;
        for(auto j:s)
        {
            ss.insert(j+k);
            ss.insert(j*2);
        }
        s=ss;
    }
    cout<<*s.begin();
    return 0;
}


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

char a[110];

main()
{
	scanf("%s",a);
	int len=strlen(a),ans=INT_MAX;
	for(int i=0;i<26;i++)
	{
		a[len]='a'+i;
		a[len+1]='\0';
		int co=0;
		for(int j=len;j>=0;j--)
		{
			int th=0;
			for(;j>=0;j--)
			{
				if(a[j]=='a'+i)
				{
					break;
				}
				th++;
			}
			co=max(th,co);
		}
		ans=min(ans,co);
	}
	printf("%d\n",ans);
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int D=stdIn.nextInt();
		if(D==25)
			System.out.println("Christmas");
		if(D==24)
			System.out.println("Christmas Eve");
		if(D==23)
			System.out.println("Christmas Eve Eve");
		if(D==22)
			System.out.println("Christmas Eve Eve Eve");
	}
}

Measured memory_bytes: 21332
#include<bits/stdc++.h>
using namespace std;
#define N 16000005
#define LL long long
#define MOD 998244353

string s,t;
int ans;
LL po[N];
LL has[N],hat[N];
int ok[N];
inline LL get_has(int x)
{
	if(x+t.size()-1>=s.size()) return -1;
	LL ret=has[x+t.size()-1]-has[x-1]*po[t.size()]%MOD;
	if(ret<0) ret+=MOD;
	return ret;
}

int main()
{
	
	cin>>s>>t;
	while(s.size()<t.size()*2) s=s+s;
	s=s+s;
	s=s+s;
	s=s+s;
	po[0]=1;
	for(int i=1;i<N;i++)
		po[i]=po[i-1]*29%MOD; 
	has[0]=s[0]-'a'+1;
	for(int i=1;i<s.size();i++)
		has[i]=(has[i-1]*29+s[i]-'a'+1)%MOD;
	hat[0]=t[0]-'a'+1;
	for(int i=1;i<t.size();i++)
		hat[i]=(hat[i-1]*29+t[i]-'a'+1)%MOD;
	for(int i=0;i<s.size();i++)
		ok[i]=(hat[t.size()-1]==get_has(i));
	for(int i=s.size();i>=0;i--)
		if(i+t.size()<N && ok[i]) ok[i]+=ok[i+t.size()];
	for(int i=0;i<s.size();i++)
		ans=max(ans,ok[i]);
	if(ans+1>=s.size()/t.size()) cout<<-1<<'\n';
	else cout<<ans<<'\n';
	
	return 0;
}

Measured memory_bytes: 335780
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;

int N, K, S;
int A[101010];

void solve() {
    FOR(N) {
        if (S != INF)
            A[i] = INF;
        else {
            A[i] = 1;
        }
    }
    FOR(i, 0, K) {
        A[i] = S;
    }
    FOR(N)
    cout << A[i] << " ";
    cout << endl;
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> N >> K >> S;

    solve();
    return 0;
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); ++i)
#define rep2(i,n) for(int i=1; i<=(n); ++i)
#define all(x) (x).begin(),(x).end()
#define Sort(x) sort((x).begin(),(x).end())
#define Sort2(x) sort((x).begin(),(x).end(), greater<int>())
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
const ll a = 1000000000000001;

int main()
{
    ll n; cin >> n;
    n--;
    int a = n % 26;
    vector<char> ans;
    char b = 'a';
    ans.pb(b+a);
    while(n / 26 > 0){
        n = n / 26;
        n--;
        int c = n % 26;
        ans.pb(b+c);
    }
    
    //97=a
    rep(i,ans.size()) cout << ans[ans.size()-i-1];
    cout << endl;
}

/*
g++ c.cpp
./a.out

oj d https://atcoder.jp/contests/abc171/tasks/abc171_c
oj t
*/


Measured memory_bytes: 3588
#![allow(non_snake_case, unused_imports)]

// Input macros
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} }; ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => { let mut $var = read_value!($next, $t); input_inner!{$next $($r)*} }; }
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, [ $t:tt ]) => { { let len = read_value!($next, usize); (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() } }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,HashMap,VecDeque,BinaryHeap};

// Functions

// Main
fn main(){
    input!{
        A: usize,
        B: usize,
        C: usize,
        X: usize
    }
    let mut ans = 0;
    for ai in 0..A+1{
        for bi in 0..B+1{
            for ci in 0..C+1{
                if 500*ai + 100*bi + 50*ci == X{
                    ans += 1;
                }
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4476
#include<bits/stdc++.h>
using namespace std;
int n;
int a[200005];
long long sum[200005];
long long qaq=4e18;
inline long long _min(long long k1,long long k2) {
	if(k1>k2) return k2;
	return k1;
}
inline long long _abs(long long k1) {
	if(k1<0) return -1*k1;
	return k1;
}
int main() {
	cin>>n;
	for(int i=1;i<=n;i++) {
		scanf("%d",&a[i]);
		sum[i]=sum[i-1]+a[i];
	}
	for(int i=1;i<=n;i++) qaq=_min(qaq,_abs(sum[n]-2*sum[i]));
	cout<<qaq;
	return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>

using namespace std;
int main()
{
	unsigned long n;

	cin>>n;
	vector<unsigned long> pn(n,0);

	for (int i = 0; i < n; ++i)
	{
		cin >> pn[i];
	}
	sort(pn.begin(), pn.end());
	cout << pn[n / 2 ]-pn[n / 2-1];
	
	return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>

int main()
{
    long long int a,b,c,k,ans,ama ;
    int i,j ;
    long long int count=0 ;
    char s[485878],t[84623] ;
   scanf("%lld %lld %lld %lld",&a,&b,&c,&k) ;
   if(k<=a)
    count=k ;
   else
   {
    while(k!=0)
   {
     k=k-a ;
     count=count+a ;
     for(i=0 ; i<b ;i++)
     {
         k=k-1 ;
         if(k==0)
            break ;
     }
     if(k!=0)
     {
         for(i=0 ; i<c ;i++)
     {
         k=k-1 ;
         count=count-1 ;
         if(k==0)
            break ;
     }
     }

   }

    }
    printf("%lld",count)  ;
return 0 ;
}


Measured memory_bytes: 1724
#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;
    return *(long long*)a - *(long long*)b;
}
//  qsort(A, b, sizeof(int), compare_int);

long long  factorial(long long n) {
    if (n > 0) {
        return n * factorial(n - 1);
    } else {
        return 1;
    }
}

int main()
{
  int a ,b, c, d, e, X, Y;
//  long long  a, b, c, d, e, X, Y;
  //  double  c;
  int  A[200003]={};
//  long long  A[200003]={};
//  long long  B[100003]={};
  int  C[100003][11]={};

  int  flag[1003]={};

//  long long  a, b, c, d, X, Y;
  char s[101][101]={};
//  int N, M;
//  int A[1000000001]={};
//  long long  C[101]={};
  int i,j,k;
  long long p,q;
//  int flag=0;
//  int tmp=0;
  char tmp[101]={};
  long long min=10000000000;
//  long long min=100000001;
  int len=0;
  int l=0;
  int r=1000001;
  int cnt=0;
  int num=1;
  int num1=0;
  int num2=0;
  long long ans=1;
  int max=0;
  int addr=0;
  int ptn=0;
//  bool on_off[100]={};
  
//  char alp[26]={'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'};

  //  a=0;
//  scanf("%lld %lld", &a, &b);
//  scanf("%d%d", &a,&c);
//  cnt = strlen(t);
// printf("%d\n",a);
  scanf("%d%d", &a, &b);
  for(i=0;i<a;i++){
    scanf("%d", &c);
    cnt=cnt+c;
    if(cnt<=b) num++;
  }
  printf("%d\n", num);
  

    
//    printf("%s %d %d\n", s[i],C[i][0],C[i][1]);
   // printf("%d\n", C[i][1]);
/*  for(i=0;i<addr;i++){
//  scanf("%lld%lld", &B[0][i],&B[1][i]);
//    ans=ans+A[i];
    printf("%lld ", A[i]);
  }
*/
//    printf("%d ", cnt);
   
//  ans=a*3;
//  ans=(ans+b)/2;
//  printf("%d\n", ans);

  
//  printf("%lf\n",ans);
  //  //  if(flag==0)   printf("TLE\n");
//    if(max < cnt - max)  printf("Yes\n");
//    else  printf("No\n");
  
return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
	using namespace std;
	int main() { 
	    
	    string check, word;

	    cin >> check;
	    int len = check.size();

	    for(int i=0 ; i< len ;i++){
	    	if(check[i] >='A' && check[i] <='Z') check[i] += 'a' - 'A';
	    }
	    cin >> word;
	    int count =0;
	    while(word != "END_OF_TEXT"){
	    	for(int i=0;i<word.size();i++){
	    		if(word[i] >='A' && word[i] <='Z') word[i] += 'a' - 'A';
	    	}
	    	if(word == check) count++;
	    	cin >> word;
	    }
	    
	    cout << count <<endl;
	    
	    

	    return 0;
	}


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

int main() {
  int H,M,h,m,K;
  cin >> H>>M>>h>>m>>K;
  
  int A=(h-H)*60;
  A=A+(m-M);

  if (A==K) {
    cout << 0 << endl;
  }
  else if (A>K) {
    cout << A-K << endl;
  }
}


Measured memory_bytes: 3636
// 16:39〜16:43

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <cmath>

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

using namespace std;

int main(){
	int a, b, c;
	cin >> a >> b >> c;

	if(a + b == c || b + c == a || c + a == b){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mpr make_pair
#define mt make_tuple
 
using namespace std;
 
const ll N = 410;
const ll mod = 1e9 + 7;
ll power(ll x, ll   y, ll p){ ll res = 1; x = x % p;while (y > 0){ if (y & 1) res = (res*x) % p; y = y>>1; x = (x*x) % p;} return res; }
ll n;
ll arr[N], dp[N][N];

ll solve(ll l,ll r){
    ll ret = INT64_MAX;
    if(l == r)  dp[l][r] = 0;
    if(dp[l][r] != -1)  return dp[l][r];
    for(int i=l;i<r;i++)
        ret = min(ret, solve(l,i) + solve(i+1,r) + arr[r] - ((l > 0 ) ? arr[l-1] : 0));
    dp[l][r] = ret;
    return dp[l][r];
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    memset(dp, -1, sizeof(dp));
    for(int i=0;i<n;i++)    cin>>arr[i];
    for(int i=1;i<n;i++)    arr[i] += arr[i-1];
    cout<<solve(0,n-1)<<endl;
    return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INTF = 1e9 + 7;

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

  vector<vector<ll>> v(n, vector<ll>(n));
  for(int i=0; i<n; i++)
    for(int j=0; j<n; j++)
      cin >> v[i][j];

  vector<ll> dp(1<<n);

  for(int mask=0; mask < (1<<n); mask++)
  {
    ll ans =0;
    for(int i=0; i<n; i++)
    {
      if(mask & (1<<i))
      {
        for(int j=0 ;j<i;j++)
        {
          if(mask & (1<<j))
          {
            ans += v[i][j];
          }
        }
      }
    }
    dp[mask] = ans;
  }

  for (int i=1;i<(1<<n);i++){
    for (int j=i; j ; j=(j-1)&i){
      if (dp[i] < dp[i-j] + dp[j])
        dp[i] = dp[i-j] + dp[j];
    }
  }
  
  cout<<dp[(1<<n) - 1];
  return 0;
}

Measured memory_bytes: 768
def answer(a: int, b: int, c: int, k: int) -> int:
    nums = sorted((a, b, c))
    nums[-1] = nums[-1] * 2 ** k

    return sum(nums)


def main():
    a, b, c = map(int, input().split())
    k = int(input())
    print(answer(a, b, c, k))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9084
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define MOD 1000000007
using namespace std;


int main(int argc, char* argv[])
{
    long a,b;
    scanf("%ld%ld", &a, &b);

    if(a*b%2==0) {
        printf("Even\n");
    }
    else {
        printf("Odd\n");
    }

    return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<int> a(n + 1);
	for (int i = 1; i <= n; i++) {
		if (i % 15 == 0)
			a[i] = 0;
		else if (i % 3 == 0)
			a[i] == 0;
		else if (i % 5 == 0)
			a[i] == 0;
		else
			a[i] = i;
	}
	long long sum = 0;
	for (int i = 1; i <= n; i++)
		sum += a[i];
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 7212
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;

ll n,m;
vector<vector<ll>> edge;
vector<ll> dp1;
vector<vector<ll>> dp2;

ll cost(ll a){
    ll ret=0;
    for(int i=0;i<n;i++){
        for(int t=0;t<n;t++){
            if((a>>i&1) && (a>>t&1)){ret+=edge[i][t];}
        }
    }
    return ret/2;
}

void build(){
    for(int i=0;i<1LL<<n;i++){
        dp1[i]=cost(i);
    }
}

ll connect(ll w,ll a){
    ll ret=0;
    for(int i=0;i<n;i++){
        if(a>>i&1){ret+=edge[w][i];}
    }
    return ret;
}



int main(){
    ll C=0;
    cin>>n>>m;
    edge.resize(n,vector<ll>(m,0));
    dp1.resize(1LL<<n);
    dp2.resize(1LL<<n,vector<ll>(n,-1));
    for(int i=0;i<m;i++){
        ll a,b,c;
        cin>>a>>b>>c;
        a--; b--;
        edge[a][b]=c;
        edge[b][a]=c;
        C+=c;
    }
    build();
    dp2[1][0]=0;
    for(int i=1;i<1LL<<n;i++){
        if((i&1)==0){continue;}
        ll k=1LL<<n; k--; k^=i;
        for(int t=0;t<n;t++){
            if(dp2[i][t]==-1){continue;}
            for(ll h=k;h>0;h=(--h)&k){
                dp2[i^h][t]=max(dp2[i^h][t],dp2[i][t]+connect(t,h)+dp1[h]);
            }
            for(int h=0;h<n;h++){
                if((i>>h&1) || edge[t][h]==0){continue;}
                dp2[i^(1<<h)][h]=max(dp2[i^(1<<h)][h],dp2[i][t]+edge[t][h]);
            }
        }
    }
    cout<<C-dp2[(1LL<<n)-1][n-1]<<endl;
    
    
    
    return 0;
}


Measured memory_bytes: 7424
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N = 0;
	for(int i=0;i<3;++i){
		int a;
		cin >> a;
		N = N*10 + a;
	}
	
	if( N%4 == 0 ){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	
	
	solve();
}
#pragma endregion //main()


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <ios>
#include <iomanip>
#include <stack>
#include <queue>
#include <algorithm>

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

using namespace std;

const int INF = 100000000;

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

  int num = 0;

  num += stoi(s.substr(0,4)) * 10000 + stoi(s.substr(5,2)) * 100 + stoi(s.substr(8,2));
  if (num > 20190430) {
    cout << "TBD" << endl;
    return 0;
  }
  cout << "Heisei" << endl;
  return 0;
}

Measured memory_bytes: 256
sp = gets.chomp
t = gets.chomp
if sp.include?(t)
  sp.gsub('?', 'a')
else
  f = false
  ls = sp.size
  lt = t.size
  ls.pred.downto(0){|i|
    break if f
    0.upto(lt.pred){|j|
      break if f
      idx = i - j
      break if idx < 0
      # puts "i:#{i}, #{idx}, #{sp[idx]}, #{t[lt.pred - j]}"
      if sp[idx] == '?' || sp[idx] == t[lt.pred - j]
        if j == lt.pred
        # puts "found at #{j}, #{lt.pred}, #{sp[idx..i]}"
          sp[idx..i] = t
          f = true
        end
      else
        break
      end
    }
  }
  sp = sp.gsub('?', 'a')
end

puts sp.include?(t) ? sp : :UNRESTORABLE



Measured memory_bytes: 1788
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>
#include<numeric>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define SUM(a) accumulate(all(a),0LL)
#define pb push_back
#define endl '\n'
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 2222222222222222222LL;
const ll mod = 1000000007LL;

ll n = 0, m = 0, ans = 0, cnt = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok = true, flag = false;
ll dx[5] = { 1,-1,0,0,0 }, dy[5] = { 0,0,1,-1,0 };
ll ddx[9] = { 1,-1,0,0,1,1,-1,-1,0 }, ddy[9] = { 0,0,1,-1,1,-1,1,-1,0 };
#pragma endregion
#define MAX 222222




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

  cin >> n >> m;
  vpll v;
  pll p;
  rep(i, n) {
	cin >> tmp;
	ans += tmp;
	p.first = tmp, p.second = 0;
	v.pb(p);
  }
  rep(i, m) {
	cin >> tmp;
	ans += tmp;
	p.first = tmp, p.second = 1;
	v.pb(p);
  }
  sort(all(v));
  ma = (n + 1)*(m + 1) - 1;
  ll cnt = ma - n - m;
  ll k = n + m;
  rep(i, k) {
	if (v[i].second == 0) {
	  ans += v[i].first * min(cnt, m);
	  cnt -= m;
	  n--;
	}
	else {
	  ans += v[i].first * min(cnt, n);
	  cnt -= n;
	  m--;
	}
	if (cnt <= 0) break;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 6512
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

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

int a, b;

int main() {
  cin >> a >> b;

  if (b == 1) {
    cout << 0;
    return 0;
  }

  int cnt = 1;
  repe(i, 1, 100) {
    cnt += (a - 1);
    if (cnt >= b) {
      cout << i;
      return 0;
    }
  }
}


Measured memory_bytes: 3600
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;

int main(){

	int ans,length;

	int** dp = new int*[80000];
	for(int i = 0; i < 80000; i++)dp[i] = new int[11];

	char buf[80001];

	while(true){
		scanf("%s",buf);
		if(buf[0] == '0')break;

		for(length = 0; buf[length] != '\0';length++){
			for(int i = 0; i < 11; i++)dp[length][i] = 0;
		}

		dp[0][buf[0] - '0']++;

		for(int i = 1; i < length; i++){
			if(buf[i] != '0'){
				dp[i][buf[i] - '0']++;
			}

			for(int k = 0; k < 11; k++){
				dp[i][(10*k+buf[i]-'0')%11] += dp[i-1][k];
			}
		}

		ans = 0;

		for(int i = 0; i < length; i++)ans += dp[i][0];

		printf("%d\n",ans);
	}

    return 0;
}

Measured memory_bytes: 8284
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

int main(){
	char c;
	std::cin>>c;

	if(c=='A')
		std::cout<<'T'<<std::endl;

	if(c=='T')
		std::cout<<'A'<<std::endl;

	if(c=='G')
		std::cout<<'C'<<std::endl;

	if(c=='C')
		std::cout<<'G'<<std::endl;

	return 0;
}

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

template<typename First, typename Second, typename Third>
struct triple {
   First first;
   Second second;
   Third third;
};

using namespace std;

void solve(){

    int c,k;
    cin>>c;
    vector<int>v(c);
    long long  sum=0;
    for(int i=0;i<c;i++){
        cin>>v[i];  
        sum+=v[i];
    }
    long long  mn=LONG_LONG_MAX;
    long long  res=0;
    for(int i=0;i<c-1;i++){
          res+=v[i];
          sum-=v[i];
          mn=min(mn,abs(res-sum));

    }
    
    cout<<mn;
}

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


Measured memory_bytes: 1024
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

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

    array<int64_t, 256> counter;
    fill(counter.begin(), counter.end(), 0);

    for (auto ch : s)
    {
        counter[ch]++;
    }
    int64_t ans = counter['R'] * counter['G'] * counter['B'];

    for (int i = 0; i < n; i++)
    {
        for (int d = 1; i + 2 * d < n; d++)
        {
            counter['R'] = counter['G'] = counter['B'] = 0;
            for (auto v : { i, i + d, i + 2 * d })
            {
                counter[s[v]]++;
            }
            if (counter['R'] == 1 && counter['G'] == 1 && counter['B'] == 1)
            {
                ans--;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3648
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;*/
#include<algorithm>
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
using namespace std;
#define pb push_back
#define S second
#define F first
#define f(i,n) for(ll i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define CASES  ll t;cin>>t;while(t--)
typedef long long ll;
typedef unsigned long long ull;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
//*X.find_by_order()
//X.order_of_key()
int main()
{
fast;
    ll x;
    cin>>x;
    ll i=1;
    ll y=100;
    while(y<x)
    {
        y=y*1.01;
        i++;
    }
    cout<<i-1;
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <string.h>
using namespace std;
int main () {
  string S;
  long long K;
  cin >> S;
  cin >> K;
  int sub = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] != '1') {
      sub = i;    
      break;
    }  
  }
  if (K < (sub + 1)) {
    cout << '1' << endl; 
  }
  else {
    cout << S[sub] << endl;  
  }

}

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

struct Point{double x, y;};

void koch(int n, Point a, Point b){
  if(n == 0) return;
  Point s,t,u;
  double th = M_PI*60.0/180.0;

  s.x = (2.0*a.x + 1.0*b.x)/3.0;
  s.y = (2.0*a.y + 1.0*b.y)/3.0;
  t.x = (1.0*a.x + 2.0*b.x)/3.0;
  t.y = (1.0*a.y + 2.0*b.y)/3.0;
  u.x = (t.x - s.x) * cos(th) - (t.y - s.y)*sin(th) + s.x;                       u.y = (t.x - s.x) * sin(th) + (t.y - s.y)* cos(th) +s.y ;

  koch(n - 1, a, s);
  printf("%.8f %.8f\n",s.x,s.y);
  koch(n - 1, s, u);
  printf("%.8f %.8f\n",u.x,u.y);
   koch(n - 1, u, t);
  printf("%.8f %.8f\n",t.x,t.y);
   koch(n - 1, t, b);
}

int main(){
  Point a,b;
  int n;

  scanf("%d",&n);

  a.x = 0;
  a.y = 0;
  b.x =100;
  b.y = 0;

  printf("%.8f %.8f\n",a.x, a.y);
  koch(n, a, b);
  printf("%.8f %.8f\n",b.x, b.y);

  return 0;
}



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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

#define ASSERT(expr...) assert((expr))

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;
using ll = long long;

constexpr i64 INF = 1010000000000000017LL;

constexpr i64 MOD = 1000000007LL;

constexpr f64 EPS = 1e-12;

constexpr f64 PI = 3.14159265358979323846;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

ll mod_pow(ll x, ll n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        return mod_pow(x * x % MOD, n / 2) % MOD;
    } else {
        return x * mod_pow(x, (n - 1)) % MOD;
    }
}

ll mod_pow_r(ll x, ll n) {
    if (x == 0) return 0;
    if (n == 0) return 1;

    ll ret = 1;
    while (n) {
        if (n & 1) ret = ret * x % MOD;
        x = x * x % MOD;
        n /= 2;
    }
    return ret;
}

ll factorial(ll n) {
    ll ret = 1;
    REP(i, n) {
        ret *= (i + 1);
        ret %= MOD;
    }
    return ret;
}

ll combination(ll n, ll r) {
    if (n < 0 || n < r || r < 0) return 0;
    ll fn = factorial(n);
    ll fr = factorial(r);
    ll fn_r = factorial(n-r);

    ll d = (mod_pow(fr, MOD - 2) * mod_pow(fn_r, MOD - 2)) % MOD;
    ll u = fn % MOD;
    return u * d % MOD;
}

void solve() {
    ll l; cin >> l;
    cout << static_cast<double>(l*l*l/27.0);
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<int,int>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const ll Lmax=ll(1e18);
const ll INF=1e9;


int main(){
  int l,r,d;
  cin>>l>>r>>d;
  int ans=0;
  for(int i=l; i<r+1;i++){
    if(i%d==0){
      ans++;
    }

  }
  cout<<ans<<endl;



}


Measured memory_bytes: 3628
n = int(input())
lst = list(map(int,input().split()))

num = [0] * n
for i in lst:
  num[i-1] += 1
  
total = 0
for i in range(n):
  m = num[i]
  total += m*(m-1)//2

for k in range(n):
  
  s = num[lst[k]-1]
  t = total + 1- s
  
  print(t)  

Measured memory_bytes: 100596
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <limits.h>
#include <map>
#include <numeric>

namespace test {
	std::string to_string (char val) {
		return std::string (1, val);
		// return std::string{val};
	}
}

using namespace std;

int main (void) {
	int a, b, c;
	cin >> a >> b >> c;

	int result;

	result = b / a;

	cout << ( result > c ? c : result ) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int N;
vector<pair<int,int> >pls,mins;
main()
{
	cin>>N;
	for(int i=0;i<N;i++)
	{
		string s;cin>>s;
		int mn=0,cnt=0;
		for(int j=0;j<s.size();j++)
		{
			if(s[j]=='(')cnt++;
			else cnt--;
			if(mn>cnt)mn=cnt;
		}
		if(cnt>=0)pls.push_back(make_pair(cnt,mn));
		else mins.push_back(make_pair(cnt,mn));
	}
	priority_queue<pair<int,int> >P;
	int now=0;
	for(pair<int,int>p:pls)
	{
		P.push(make_pair(p.second,p.first));
		while(!P.empty()&&now+P.top().first>=0)
		{
			now+=P.top().second;
			P.pop();
		}
	}
	if(!P.empty())
	{
		cout<<"No"<<endl;
		return 0;
	}
	sort(mins.begin(),mins.end(),[](pair<int,int>a,pair<int,int>b)
	{
		return a.second-a.first<b.second-b.first;
	});
	for(pair<int,int>p:mins)
	{
		if(now+p.second<0)
		{
			cout<<"No"<<endl;
			return 0;
		}
		now+=p.first;
	}
	cout<<(now==0?"Yes":"No")<<endl;
}


Measured memory_bytes: 11232
n, m = map(int, input().split())
c = list(map(int, input().split()))
dp = [0]+[float("inf")]*n
for i in range(n): dp[i+1] = min([float("inf")]+[dp[i+1-c_j] for c_j in c if c_j<=i+1])+1
print(dp[-1])


Measured memory_bytes: 7272
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//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 vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int dp[1010][1010];

int main() {
	string s1, s2; cin >> s1 >> s2;

	for (int i = 0; i < s1.length()+1; i++)dp[i][0] = i;
	for (int i = 0; i < s2.length() + 1; i++)dp[0][i] = i;

	for (int i = 1; i < s1.length() + 1; i++) {
		for (int j = 1; j < s2.length() + 1; j++) {
			int cost = s1[i - 1] == s2[j - 1] ? 0 : 1;

			dp[i][j] = min(dp[i - 1][j] + 1, min(dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost));
		}
	}

	cout << dp[s1.length()][s2.length()] << endl;;
	return 0;
}


Measured memory_bytes: 7184
#include <stdio.h>
 
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
 
typedef struct{
  short x,y;
  int cost;
  short ch;
}mouse;
const int MAX=(1<<14)-1;
mouse que[(1<<14)-1];
int s,num;
 
mouse t;
short cx,cy,nx,ny,ch,nch,h,w,n;
int cost;

char ku[1000][1001];

main(){
  scanf("%d%d%d ",&h,&w,&n);
  short maxch[h][w];
  int i,j;
  
  for(i=0;i<h;i++)fread(ku[i],1,w+1,stdin);
 
 
  for(i=0;i<h;i++)for(j=0;j<w;j++){
    if(ku[i][j]=='S')cx=i,cy=j;
    maxch[i][j]=-1;
  }
 
 
  que[s+num++]=(mouse){cx,cy,0,0};
  maxch[cx][cy]=0;
 
  while(1){
    t=que[s++&MAX];
    num--;
    cx=t.x,cy=t.y,cost=t.cost;
    ch=t.ch;
 
    for(i=0;i<4;i++){
      nx=cx+dx[i],ny=cy+dy[i];
      if(nx<0 || nx>=h || ny<0 || ny>=w)continue;
      if(ku[nx][ny]=='X')continue;
      nch=ch;
      if(ku[nx][ny]<='9' && ku[nx][ny]>='1' && ku[nx][ny]-'0'==t.ch+1){
        nch=ch+1;
      }
 
      if(maxch[nx][ny]>=nch)continue;
      if(nch==n){
        printf("%d\n",cost+1);
        return 0;
      }
      maxch[nx][ny]=nch;
      que[s+num++&MAX]=(mouse){nx,ny,cost+1,nch};
    }
  }
}

Measured memory_bytes: 3496
#include <iostream>
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){
    int n, m;
    cin >> n >> m;
    cout << (n -1) * (m - 1) << endl;
    return 0;
}

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

#define ll long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define PI 3.141592653589

using namespace std;

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

void solve_131A(){
    string s;
    cin >> s;
    bool ok = false;
    
    REP(i,3){
        if(s[i] == s[i+1]) ok = true;
    }

    if(ok) cout << "Bad" << endl;
    else cout << "Good" << endl;
}

int main(void){
    solve_131A();
    
    return 0;
}

Measured memory_bytes: 256